Can PNCconf set up my spindle encoder?

More
05 Oct 2014 05:40 - 05 Oct 2014 05:46 #51790 by akb1212
My mill has an encoder on the spindle (1024 ppr in quadrature). The driver for the spindle is using that to control the spindle. But it's also forwarding these signals to the controller. So I have set it up to use encoder 03 as spindle controller.

But when I look in the spindle section of the resulting ini file all that is in there is this:

#********************
# Spindle
#********************
[SPINDLE_9]
ENCODER_SCALE = 4096.0
OUTPUT_SCALE = 10.0
OUTPUT_MIN_LIMIT = -10.0
OUTPUT_MAX_LIMIT = 10.0

No PID data or anything that I would expect to be needed for a proper speed control of a spindle. And no way to use spindle orient, which I need for my ATC.

So my question is quite simple: Will there be possible to make pncconf set up a standard spindle the same way a servo axis is set up so I can control speed and orientation?

I would imagine more parameters needs to be set to make that work? I'm using gmoccapy now and there is no way to control spindle speed, only on and off. I think I was able to control the speed of the spindle back when I used axis as GUI (from it being default) by using S codes. But with that the speed changes were close to instantaneous, which I don't like. I really don't like to go from 0 to 5000 rpm in 0.01 seconds, which is what it would do if I programmed S5000. So it seems to be no PID loop involved in the speed control, which is also quite evident by the lack of PID parameters......

This might mean I need to hand edit my files to implement this. Would there be a set of example files I can take a look at to know if I'm not the right track?
Most of the time only one error will crash LCNC, and if I need to edit it with no example to look at I'm not so confident I'd be able to make it without making any mistakes at all..... I'd feel much more confident with an example to look at to get an idea on what to do.

Anders
Last edit: 05 Oct 2014 05:46 by akb1212. Reason: Correcting errors

Please Log in or Create an account to join the conversation.

More
05 Oct 2014 09:17 - 05 Oct 2014 09:17 #51794 by cmorley
Sorry currently pncconf doesn't configure for PID controlled spindle.

It of course can be hand edited in. I don't have a sample.
Do you really need PID or are you just looking for soft start?
IIRC the ddt component can be used to ramp speed. again no sample.

Chris M
Last edit: 05 Oct 2014 09:17 by cmorley.

Please Log in or Create an account to join the conversation.

More
05 Oct 2014 10:32 #51795 by PCW
Its the "limit2" component that can be used to limit spindle acceleration

linuxcnc.org/docs/html/man/man9/limit2.9.html

Please Log in or Create an account to join the conversation.

More
05 Oct 2014 19:45 #51797 by akb1212
First of I have an ATC that require the spindle to be stopped in exactly correct position. And that position isn't aligned with the index point on the encoder. So it will need to be controlled like a servo to be in that exact orientation. And preferably the motor should act as a servo and lock the spindle in that position while the tool change takes place.

And as far as I know the only way to make the spindle stop in any given position and hold that position is by using a PID loop. I have no intention of implementing a mechanical way to stop the spindle to be able to use the ATC. Besides, the position become misaligned when I disassemble the input gear on the head (I have had a leak in the o-ring there and needed to disassemble it). So I need to be able to have it stop in any given orientation. And the correct thing to use for that is PID loop.

The spindle drive is capable of full C-axis functionality, and to be honest I'd like to be able to use that as well.

And my mill had that functionality with the old controller, and it's not a function that I think it's ok to lose by converting to LCNC.....

I realize this might be considered "advanced" functionality, but I know it's built in to LCNC. So it's something I'd like to implement, but since pncconf doesn't do it I would like to have a look at configurations where this is implemented to get an idea on how to do it myself.

BTW, I have looked in the manuals (all of them) to see what I can find about spindle orientation. But not much comes up, and certainly not enough to ensure me I have all information I need to implement it myself....... which is why I ask for examples of configs I can use as a guide.

I have come to a point where I feel ok with implementing (basic) things by hand editing the config files. Like making my XHC HB04 hand pendant work, and switching to gmoccapy GUI.
But setting up a whole new PID loop with all correct signals and pins and linking them all correctly together isn't something I feel up to yet.

I will look around myself for configs to use as learning examples. But if anyone reading this know about configs with spindle PID control implemented I'd be really happy if you could give me a link to it. And I would believe I'm not the only one who would like to see something like that. In particular lathe users who need to syncronize the spindle to make threads (although most seem to use one index point only for this....).

For me all the hardware with encoders and everything is already implemented. So I don't se a good reason not to implement it propperly..... It's only a configuration issue for me. No hardware modifications needed. All I need now is some examples to look at to figure out how to do it.

Anders

Please Log in or Create an account to join the conversation.

More
05 Oct 2014 19:55 #51799 by cncbasher
look at spindle orient component and also take look at wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrientation

Please Log in or Create an account to join the conversation.

More
05 Oct 2014 20:02 #51801 by cncbasher
look at spindle orient component and also take look at wiki.linuxcnc.org/cgi-bin/wiki.pl?SpindleOrientation

Please Log in or Create an account to join the conversation.

More
06 Oct 2014 01:49 #51809 by akb1212
OK, I did.

It looks like that might be what I need to make it work.

A couple of minor details though...... there is references to both gpio ports and classicladder ports in there. But there are no comments to clarify how to use them. If I blindly implement what's in that guide I'm sure those things would make it fail. So I will have to look in to what the guy who wrote the guide was using those signals for and how he implemented them.

It's also using the outdated newsig and sets commands, and I feel those should be sorted out (in case they are removed as mentioned in the integrator manual).

I think I can assume I will get unreliable data from the position encoder from running it at full speed. But there seems to be measures put in place in the guide to correct for that. So I hope it's what I need.

Thanks.

Anders

Please Log in or Create an account to join the conversation.

More
06 Oct 2014 15:40 - 06 Oct 2014 16:05 #51812 by cncbasher
gpio pins are your encoder , as far as i can decypher the classic ladder pins are used for indication ,so they could be removed , i cannot find any other clear use
of those , but yes i agree it makes the whole example useless as it is when parts are missing , perhaps now is a good point to debug it and repair and update

as far as i can see the functionality is all there , so hoping you find your way through

you would never run the spindle at full speed for an orient request , thats asking for problems .
so long as you have a spindle encoder it should work fine , my spindle incorporates a brake which is linked in to the stud puller , one easy mod is to fit another index at the correct angle
using a opto or proximity detector .

the spindle should be able to hold the required position just fine .
Last edit: 06 Oct 2014 16:05 by cncbasher.

Please Log in or Create an account to join the conversation.

More
10 Oct 2014 18:03 #51939 by akb1212
I have taken a closer look at that guide now. And there are several things that make me think it's not quite what I need.

First off all he states in the description that he states: "known problems. can not stop spindle while in Automode so please do a M05 before using a Mcode to do a spindle orientation. maybe someone can add a proper M19 output?"

Now M19 is what I would want to use, not a several year old method that was made when M19 wasn't implemented.

Another thing is that this guide isn't finished. There are so many loose threads in there I'm not able to complete it.

And there is only a basic hardcoded set point to orient the axis to in there. No way to forward the wanted set point like the M19 command allows for.

It is also made specifically for 5i20 or similar cards that use PWM generators directly. As far as I understand my 5i25/7i77 doesn't use PWM generators, but use analogue outputs directly.

So my conclusion is that this example isn't enough info for me because there is so many details in there that doesn't correspond to my needs or way of doing things.

I will start looking elsewhere.

But I'm kind of surprised to not find much other info on this. Is there nobody who uses a full PID on their spindle? For lathes I would believe that is more or less a requirement? Why else use CNC on it?

I also feel that since M19 is in fact implemented now there should be some more info on configuration requirements. BTW, the user manual doesn't even have info that M19 is implemented. So I'm guessing it's not that long ago it was implemented?

I'll keep looking for other more compatible configs to copy from then....

Anders

Please Log in or Create an account to join the conversation.

More
10 Oct 2014 19:26 #51944 by andypugh

and it's not a function that I think it's ok to lose by converting to LCNC


This needs to be cleaned up, and probably posted to the Wiki. But starting here:
www.linuxcnc.org/index.php/english/forum...-211?start=260#51201

Is a config with orient set up for tool change.
Unfortunately the original HAL file was written by me without reference to a LinuxCNC machine, so contains many typos that are worked through in the following several posts.

The basic idea is to have a sped PID and an Orient PID both driving the spindle servo drive, and to enable/disable them as required. You can actually just add their outputs together as the output of a disabled PID goes to zero.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.144 seconds
Powered by Kunena Forum