Servo "PID" Algorithim (Allen Bradley)

kdcui

Lifetime Supporting Member
Join Date
Dec 2007
Location
USA
Posts
386
I've started working with servos and am wondering what algorithm the servo drives (Kinetix 6000s) use when the servo loops are closed.

I am used to working with standard PID instructions, and in the Servo configuration uses gains that are in different units, which leads me to believe it is probably some second-order equation.

Knowing the algorithim might help me understand more clearly the impact of the P and I gains on a servo.

Thanks.
 
the best place to look is here:http://literature.rockwellautomation.com/idc/groups/literature/documents/um/motion-um001_-en-p.pdf

specifically, Servo loop block diagrams start on page 361.
The base algorithm (and most common configuration)is a "2 degrees of freedom" setup, where there is a PI position loop that feeds a PI velocity loop. The output of that gets scaled and converted to torque.
So when you ask about what effect the gains have, the question is: which ones. There is a set of gains for both loops (pos and vel)

happy reading,
Tom
 
Thanks Tom, this is exactly what I'm looking for.

Another question for you: there seems to be two different selections for using Position servo - one where the velocity loop is closed by the controller, the other where the velocity loop is closed by the drive.

I understand what this means but how does this impact control? By having the drive close the velocity loop, does this free up bandwidth on the controller end?

Also, after an Autotune, there is a Bandwidth parameter displayed in Hz. What does this number signify and how is it calculated? It seems to be proportional with the proportional gain.

Thanks again.
 
Last edited:
What type of actuator(motor) are you hooking up? If you're gonna be using an AB motor, then the appropriate structure is AXIS_SERVO_DRIVE. I think the AXIS_SERVO is kind of a generic drive with AQB encoder only. (Or if you have an analog card like the 1756-HYD) Velocity is never closed in the controller - too slow. For one of the loops, it says it's closed in the external velocity drive.

The Position proportional bandwith (the proportional gain)that the autotune calculates is based on the detected load ratio. I don't know how it calculates that. But you're correct that the units in the popup box are in Hz, while the units in the Axis properties are rad/sec. Hence the difference of 2*PI. If you decrease/decrease the pos prop gain in the popup box, logix will appropriately adjust other tuning parameters to reflect that change. So say you had a compliant load. Then you would decrease that bandwith in the popup box and logix would appropriately detune the system.
 
Not so!

think the AXIS_SERVO is kind of a generic drive with AQB encoder only. (Or if you have an analog card like the 1756-HYD) Velocity is never closed in the controller - too slow. For one of the loops, it says it's closed in the external velocity drive.
The M02AE, M02AS and HYD02 use pretty much the same code. I know because I help write some of it. Actually it is the same code with different conditional compile options based on the type of card. The M02AE, M02AS, HYD02 are all the same speed and they do have a velocity loop, BUT the velocity is derived from the position which limits its usefulness. Each loop should have its own feed back to make multiple loop controls effective and these motion modules only have one feedback for position. When there is only one feedback the inner and outer loops can be condensed or simplified to a simple PID. In this case the inner loop proportional gain does the same thing as the PID derivative gain. The inner loop integrator gain and the outer loop proportional gain combine to for the PID's proportional gain. The outer loops integrator gain becomes the PID's integrator gain. We realized this way back and made the option to simply use the PID gain set as there is only one feed back device. It isn't about the controller being slow. It is the feedback device that is slow. The M02AE and M02AS can close the loop much faster when using encoders.

So now I ask you. How many controllers have a position AND velocity feedback device to justify the inner and outer loop PI control? Even if there is a second feedback device it must update quickly and provide noise free data. If there is only position data then closing the inner loop quickly doesn't do much good if the position feedback resolution is coarse because of quantizing and decreasing the same time only makes the quantizing worse.
The HYD02 can't have a faster inner loop than outer loop unless one purposely makes the update loop for the outer loop twice or four times as long. The reason is that the feed back devices update only so fast and there is no point in closing the loop around the same old data.

However, this are good reasons to have a inner and outer loop for even the M02AS and HYD02. These cards are used on hydraulic systems where the system gain is different extending than when retracting. Having two inner loop gain sets, one for extending and one for retracting, allow one to accurately control the velocity in each direction. The outer loop only needs one set of gains. This means only two inner loop gains need to change. The actual method used was to have just one directional scaling factor which is simpler.

So say you had a compliant load.
Few motor control systems can handle compliant loads well. Reducing the gains reduces the problem but doesn't make it go away. Compliant system require a second derivative gain or maybe even a third derivative gain to play all the poles.

A while back there was a thread that asked about why the derivative gains are important. Pandiani and I showed that even with best efforts a type 0 second order underdamped system ( a simple mass on a spring ) cannot be controlled well with just a PI controller. The derivative gain was required.
http://deltamotion.com/peter/Mathcad/Mathcad - T0C1 MassOnASpring-PID.pdf
Hydraulic systems are type 1 second order underdamped systems. The fact that the velocity gets integrated to position adds another poles with 90 degrees phase lag. To properly control these systems a second derivative gain is required. As stated above, one can simply reduce the gains with a PI control but that limits how far the closed loop poles can be moved to the left. My research shows that the optimal position on the -real axis in the s domain is at -ζω were zeta is the damping factor and omega is the natural frequency.
If ζ and ω are high then there is little problem but if they are low then performance specifications will not be met. I have seen too many integrators try to fight this battle that they can't win. The mechanical/hydraulic guys control the damping factor and natural frequency.
 
I would be first to admit that while Peter is an expert in this field, I am not.
However, consider this scenario:
You're commissioning a machine with said AB components and a compliant load. The included autotune does not work, because it is too hot and the load goes crazy. It may even be week three out of the two that were agreed upon.

You find yourself with some choices, two of which are:
a)detune the servo controller and probably get acceptable performance
b)crave a derivative gain and think of all its possibilities

...

:)
 
...
However, consider this scenario:
You're commissioning a machine with said AB components

ttichy said:
The included autotune does not work
stop right there.

Allen Bradley had a perfectly good servo motion autotuning algorithm until they went GML on Creonics. Creonics could tune compliant loads. I have yet to see full autotune succeed perfectly the way A/B thinks they can do it with a resistance test and a jerk.
 
GML and Creonics.... that's um.... a little... before my time :)
So how did creonics autotune?

You had to type all the right parameters into the right fields in the DOS window, and it would run the load according to what you wanted to tune to...this could be back and forth siz or seven times on a linear axis depending on how carefully you chose the setup. it has been a long time, but there were explicit instructions in their books for how to come up with numbers that should generate good results and it did work. You had to stand there and watch it do its thing, and you could break stuff if you tried tuning values outside the mechanical limits of the machine, so it was no means idiot proof, and I think that's why A/B changed it...

I recall having to choose a tuning increment distance in counts, as well as a tuning limit, minimum and maximum speeds, whehter to check for backlash and adjust the backlash compensation automatically...that's all I can rememeber...

We had a short list of numbers we knew worked well for each system with a Max Control or EuroSAM on it and it just worked. You change gearing, belts, motors, no problem, just plug in the burr brown (if there wasn't a terminal permanently on the machine) hit the setup passcode, follow the cheat sheet and it would run like a gazelle after the tuning operation. Once in a great while we might have to run it a 2nd time with different values, or go back in and manually set some of the setups or gains for a particular non-standard app that didn't want to tune.
 
ttichy said:
You find yourself with some choices, two of which are:
a)detune the servo controller and probably get acceptable performance
b)crave a derivative gain and think of all its possibilities
These are poor choices.

The key to auto tuning is system identification. That is procedure that calculates the system gain, frequencies, offsets and dead times. Once these are known there are formulas like below that can calculate the controller gains.

Most auto tuning systems only support one model. If the system doesn't match the model the auto tuning will not work. Also, models are linear. Auto tuning an non-linear system will not work. It is possible to auto tune for one particular position or operating point but those gains will not work well over the range of travel. On swing arm type of systems we recommend auto tuning at multiple places along the travel and then use a cam table or what we call curves that will change the gains smoothy and continuously on-the-fly throughout the stroke.

I am not a fan of the pulse method of exciting a system. In fact I can't use the pulse method when tuning a 100 ton system because the ground would shake, welds would break and I would be thrown out. The pulse method has its limitations in that it usually only records the peak velocity obtained, the time of peak velocity and the time it takes to reach 0 speed. From this one can calculate the system gain and time constant or the inverse of the time constant, the corner frequency. From there it is simple. For a simple first order position model the gains are calculated as follows
Ki=λ³/(K*α)
Kp=2*λ²/(K*α)
Kd=(3*λ-α)/(K*α)
Where λ is the location of the 3 closed loop poles at -λ. The larger or more negative λ is the faster or hotter the system is. This is operator selected. If one wants to use only a PI control then λ=α/3 so Kd=0 but this limits the response.
K is the system gain with units of velocity/control output
α is the corner frequency in rad/sec. This is the inverse of the time constant or 1/τ

Rockwell allow one to get a slightly faster response with lower gains by allowing an slightly under damped response. This is done by allowing the closed loop poles to be imaginary. If you look in the parameters there is a place where you set the closed loop damping factor. A closed loop damping factor of 0.8 doesn't result in to much over shoot to a step change in the set point and step changes should never occur anyway.

The real problem is depending on measuring just two points. The peak velocity and the time the velocity reaches 0. Any small error can make a big difference to the results.

We use a different method to calculate the system gain and corner frequency. We excite the plant with a wave form that provides more information. We don't need to use square waves but can ramp the excitation up and down to lessen the shock. We use a fancy non-linear regression that adjusts the coefficients for several models to the recorded data. This requires good graphing/logging tools. We may be using 1000s of points to do this. The result is that we get a statistically better fit than just using two points. We also use more than on model. If you try to auto tune a compliant system to a simple model it will not work. It is that simple. We have a model for a compliant system and a simple first order model like the one most motor people use. If the system is compliant the compliant model will fit the data better. We can tell because data fitting model returns a sum of squared error or norm. The smaller the sum of square error or norm the better the fit. I have an example of how we did this about 5 years ago. We have improved since then.
http://deltamotion.com/peter/Mathcad/Mathcad - Sysid T1P2 ODE.pdf
You can see we use our logged graph data. The thing to notice is that our model predicts the position data almost exactly. The actual velocity data shown on page 4/5 is using pretty much the same techniques that people use here to calculate velocity. However one can see that the estimated or modeled velocity is accurate and smooth. This is key to using the derivative gain on a motion controller. As an added bonus notice that there is an estimated acceleration too!!! Accelerations can not be calculated by simply differentiating positions twice as the quantizing error is significant.

Generating accurate models is the first step and the difficult part of auto tuning. Once there is an accurate model the gains can be CALCULATED!

We have notice that some companies say they have 'auto tuning' just to say they have it for marketing purposes. We have auto tuning that really works because our engineers and I go out into the field and we want to look like heros and not embarrassed chumps.

OkiePC you can see that in the graph the actuator moved 2 inches that is not far but the actuator must really be moved to get an accurate model. This requires a setup page like you mentioned. We have one too. Nothing is idiot proof. We have a sanity check your parameters disclaimer.
 

Similar Topics

Hey Guys, Got an application where the Engineer purchased some Hydraulic Servo Valves and would like me to write a PID to control the position...
Replies
3
Views
1,646
Hello, I'm student from Malaysian and currently doing a final year project about PID controller design for servo motor by using PLC. If you dont...
Replies
19
Views
7,870
Gents, I have an application that I am starting. First of all, we have Kinetix 6000 drive communicating to a Controllogix Sercos Motion Card. I...
Replies
10
Views
3,983
Is it possible for me to tuning 2 servo at the same time, because this servo is connected by mechanical so I'm afraid that I need to tuning them...
Replies
3
Views
98
Back
Top Bottom