- LinuxCNC
- General LinuxCNC Questions
- Setting up Closed loop Spindle speed control and Feedback (0-10V Analog)
Setting up Closed loop Spindle speed control and Feedback (0-10V Analog)
The spindle overshoots quiet a lot and it takes time until the PID manages to get to the commander rpm, but it does work and the RPM is exactly as commanded.
Due to the fact that It takes quiet a lot of time, i am wondering if lincurce is not a better option.
Is it correct that I do not need PID for constant surface speed ? If not, I will test lincurve
Please Log in or Create an account to join the conversation.
You can try adding a bit of P then to speed up the tracking even more.
Please Log in or Create an account to join the conversation.
1. When decelerating from a higher RPM let's say 800 rpm to 250 rpm, the rpm goes down to about 170rpm, stays there for about 3 seconds, then goes up to 250 rpm quiet fast.
2. Due to the fact that when accelerating the rpm overshoots quiet much, so when I start a program the axis does not wait until the RPM is settled correctl, it starts to move already when the rpm overshoots. It does overshoot quiet a lot but settle down pretty quickly.
Example: S800 : rpm goes over 920, axis starts to move already because it got the spindle at speed signal when reached 800 rpm.
When doing threading for example, the axis starts to move at the overshoot very fast and goes slower when the rpm settles down.
I could lower the I that much that the overshoot would be less or no overshoot at all, but then it takes long until the rpm is reached.
For now I put all PID to 0, only FF0 set to 1
RPM ist not accurate, but I have no overshoot.
Please Log in or Create an account to join the conversation.
faster than the VFDs acceleration rate, so its guaranteed with a step change
in the commanded RPM. This is usually addressed by passing the commanded
spindle RPM through the limit2 component before it goes to the PID command input.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
- Posts: 5007
- Thank you received: 1441
Please Log in or Create an account to join the conversation.
I played around with P and I, and I would say it worked okay but there are 2 problems.
1. When decelerating from a higher RPM let's say 800 rpm to 250 rpm, the rpm goes down to about 170rpm, stays there for about 3 seconds, then goes up to 250 rpm quiet fast.
This is due to "Integral windup". All the time that the spindle is above the new set speed the I term increases in magnitude, and them it is too large when the setpoint speed is reached.
linuxcnc.org/docs/2.8/html/man/man9/pid.9.html
You can reduce this effect by using the pid.N.maxerrorI term. I _think_ that you would set that to the maximum rpm error that you see. So probably 20 rpm. But note that I am not 100% sure that the I limit is in rpm, it might be volts...
Please Log in or Create an account to join the conversation.
@PCW:
That i do understand, but not this:Overshoot with "I" term is expected if the spindle speed command slews
faster than the VFDs acceleration rate
so its guaranteed with a step change
in the commanded RPM
I will take a look if i manage to configure it in my .HAL on tomorrow, but first i try to find some example configs with limit2.This is usually addressed by passing the commanded
spindle RPM through the limit2 component before it goes to the PID command input.
Thanks for that!
@Todd Zuercher:
I was looking for something like that in the manual about an week ago, but could not find any settings for that on the Toshiba VF-S11.I know the cheep VFDs I recently set up had parameters for linearizing the analog command input for making the commanded speed actually match what the drive output. You might need to read through your drive's manual to figure it out.
Still, thanks for that info.
@andypugh:
Thank you very much for the explanation, i do get it. I found that in the PID manual: Limit on error integrator. The error integrator used by the Igain term will be limited to this value, unless it is zero. Can be used to prevent integrator windup and the resulting overshoot during/after sustained errors. Not normally needed.This is due to "Integral windup". All the time that the spindle is above the new set speed the I term increases in magnitude, and them it is too large when the setpoint speed is reached.
linuxcnc.org/docs/2.8/html/man/man9/pid.9.html
You can reduce this effect by using the pid.N.maxerrorI term. I _think_ that you would set that to the maximum rpm error that you see. So probably 20 rpm. But note that I am not 100% sure that the I limit is in rpm, it might be volts...
It sounds like that could help me and i will try that on tomorrow as soon as i will by in my workshop.
Thanks again. On tomorrow i will let you know if i got set it up better. If its not possible, i will not use PID. For me its only important that the spindle rpm is quiet accurate, that i can get good results when threading and to be able to use CSS. The rpm is out by about 60rpm at max rpm: S1420 rpm = 1483 rpm. The lower the RPM, the smaller the error.
One other thing i would need to set up is the 2. gear (1:8), but i am not sure if i have to use the Linuxcnc gearchange component or the gear change component written by andypugh.
I do have a physical spindle speed potentiometer. I am mentioning this, because on some thread i have read that someone had problems when change speed with the potentiometer, but to be honest, i have thought much about it because first i want to get done the other spindle related things.
PS: The gear has to be changed by a physical switch handle, not by clutches or so. In future i would like to use e.g. a linear actuator to change the the automaticly, but thats is just a idea for now. Also i haven't thought much about that for now.
Have a good evening.
Please Log in or Create an account to join the conversation.
the first thing I have tried when I went to my shop an hour ago was to test with the pid.N.maxerrorI command. I have set it to 10. Works very good! I would say that the spindle rpm problems are solved. It does overshoot, the higher the rpm the more it overshoots, but only for maybe a half second. When decelerating from high rpm e.g. 1200 to low rpm 250rpm the rpm does not any more go down to minimum rpm and stays there for couple seconds, but it does overshoot (or undershoot? ) only to about 220rpm and settles to 250rpm with a second. I put the acceleration to max rpm from 5seconds to 10 seconds. It seems that it does overshoot less now when accelerating to high rpm.
So, that's solved. Thanks you very very much for that.
I will now try to get the gear change done, but I think I will have problems with that. If so, I will post it.
Please Log in or Create an account to join the conversation.
Would really appreciate your help.
PS: the gearchange thing is the last control related thing I need to do. After that I just need to mount the tool holder and I can start to turn something.
Please Log in or Create an account to join the conversation.
Mark
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- Setting up Closed loop Spindle speed control and Feedback (0-10V Analog)