PID Tuning section in EMC integrator manual

More
07 Jul 2011 05:55 #11206 by kostas
Hi all,

I'm a beginner in PID, so I am experimenting on manual tuning and saw that the most easy way for me to tune was:
1) increase P until output oscillates
2) increase D until output stabilizes
3) increase I to get to the set point quicker

The integrators manual has a similar description, but with I and D interchanged. I was wondering if this is a typo in the manual, since increasing I after P does not help with oscillation. Or am I doing something wrong?

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

More
07 Jul 2011 11:37 #11219 by BigJohnT
That section of the manual was based on some information that I believe to be reliable. If you didn't notice the footer note:

This Subsection is taken from an much more extensive article found at en.wikipedia.org/wiki/PID_controller

Someplace I have more info on tuning that includes FF1 I think... I need to find that and update the manual.

John

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

More
07 Jul 2011 11:52 #11222 by kostas
Ok John thanks. That would be very helpful.

I had seen the footnote, but didn't try it. Seems that it describes a slightly different method. I'll try it this way to see if it makes any difference.

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

More
09 Jul 2011 23:38 #11339 by jmelson
kostas wrote:

Hi all,

I'm a beginner in PID, so I am experimenting on manual tuning and saw that the most easy way for me to tune was:
1) increase P until output oscillates
2) increase D until output stabilizes
3) increase I to get to the set point quicker

The integrators manual has a similar description, but with I and D interchanged. I was wondering if this is a typo in the manual, since increasing I after P does not help with oscillation. Or am I doing something wrong?

I put a page in the wiki about servo tuning. See
wiki.linuxcnc.org/cgi-bin/emcinfo.pl?PWM_Servo_Amplifiers
It is a little bit specific to my servo system, but should provide some general hints about viewing response and what to adjust, with sample Halscope traces.

Jon

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

More
11 Jul 2011 06:51 #11382 by kostas
Thanks Jon.

I can't understand what the FF0-FF2 parameters are exactly, so I didn't try these till now. I'll experiment a little to see if I can get it right.
My motors are 5W servos with 400 positions and I have managed to get a positioning error as little as 0.002" when moving at rapids (about 300 IPM). I'll see if I can improve this with the extra FF parameters.

Btw, I also tried the at_pid component, but it doesn't give better results than my manual tuning. Maybe I'm doing something wrong.

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

More
11 Jul 2011 17:01 #11424 by jmelson
kostas wrote:

Thanks Jon.

I can't understand what the FF0-FF2 parameters are exactly, so I didn't try these till now. I'll experiment a little to see if I can get it right. [/qoute]
FF0 is useless, it applies a bias based on position of the slide. It is there for pedantic reasons.
FF1 applies an additional output proportional to velocity. It compensates for the finite
gain of all servo amps. When you have the P as high as you can get it, FF1 corrects the remaining
lag during constant speed moves.
FF2 applies and additional output proportional to acceleration. It helps keep error low when
velocity is changling, compensating for the inertia of the machine. VERY small amounts are
all you need.

My motors are 5W servos with 400 positions and I have managed to get a positioning error as little as 0.002" when moving at rapids (about 300 IPM). I'll see if I can improve this with the extra FF parameters.

Btw, I also tried the at_pid component, but it doesn't give better results than my manual tuning. Maybe I'm doing something wrong.

The auto-tuning has not been a great success, many people have not gotten usable results at all.
.002" error at 300 IPM sounds quite good, I doubt you can do much better.

Jon

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

More
11 Jul 2011 22:02 #11438 by kostas
jmelson wrote:

The auto-tuning has not been a great success, many people have not gotten usable results at all.


Too bad. Do you know why? Are there any other auto tuning methods I could try? Just for learning, seems I'm doing fine with hand tuning so far.

.002" error at 300 IPM sounds quite good, I doubt you can do much better.


Yes, I'm pretty happy with this. I'll try just to see how far I can get, mainly for educational reasons.

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

More
12 Jul 2011 00:08 #11443 by andypugh
jmelson wrote:

FF0 is useless, it applies a bias based on position of the slide. It is there for pedantic reasons.


It is not entirely useless, it's usefulness depends on the relative mathematical order of the action and the response.

Consider a closed-loop spindle controller driving a VFD, where voltage in = speed out.

P-gain alone won't work. As soon as the spindle is at speed, then the P-output is zero, and the VFD demand is zero.
So, you need a high gain, and are always just enough below the setpoint to give the necessary voltage output.
(if it is 10V = 1000rpm and you want 500rpm, then with a P-gain of 1 you will have the output of 5V when the actual speed is 999.5 rpm, but that is likely to be too high a gain to be stable.
Generally in closed-loop spindle control you end up using the I-term to provide a constant value for the P-term to modify.

FF0 would let you pre-program the speed/voltage factor in, then the P, I and D terms be small modifiers to that, so the gains can be lower, and the loop stability higher.

When I talk of the mathematical "order" I mean in the sense of time derivatives.

The closed-loop spindle is velocity-result & velocity command.
A motor/tach machine is position-result and velocity command.
A torque-mode servo machine is position-result and accelleration command (neglecting friction)
a stepper system is position-result and position command.

So, FF0 would be useful in velocity-velocity or position-position systems, FF1 in position-velocity, and FF2 in position-accelleration systems.

(I have been thinking about this a lot at work, I have a number of PID controllers driving systems where the P-term is largely useless because of this order-mismatch)

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

More
12 Jul 2011 12:40 #11455 by BigJohnT
Andy,

That's a lot of good info. Do you know of any place that explains PID for non-mathematical minded folks like me?

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

More
12 Jul 2011 15:53 #11462 by kostas
Thanks Andy. That's a lot of good info for me also. And if there's a less mathematical description of these, I would like to read it too.

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

Time to create page: 0.101 seconds
Powered by Kunena Forum