|
|
| . |
|
Scaling PID Tuning Parameters for Different Controller Sample Rates Introduction When tuning servo systems, it may be necessary to adjust the controller's sample rate for optimum performance. Changing the sample rate will directly affect the closed loop response of the PID control algorithm. To maintain stability and performance, the PID parameters must be scaled to match the change in sample rate. This document explains how to scale the tuning parameters properly. This document only addresses scaling for the PID closed loop algorithm. It does not compensate for resonances caused by increased system bandwidth or system nonlinearities.
WARNING! The system may experience stability problems when sample rates are changed from a higher sample rate to a much lower sample rate. This is due to additional phase lag of the zoh (zero order hold, the value that is held constant between sample periods) at a lower sample rate. It is necessary to take the appropriate safety precautions in order to prevent any sudden and unexpected movement of machinery from being hazardous to neighboring objects and/or personnel. Before entering or changing sample rates, verify that all personnel, hands, fingers, body parts, and/or property are clear of the movement area; otherwise, injury or death may result!
PID Loop and Sample Rates When sample rates are changed, the performance of the servos will change. To understand why this relationship exists, it is helpful to look at the architecture of a PID control loop. PID Feedback Loops A simplified PID feedback loop is shown in the diagram below.
Major Components of the PID Feedback Loop,
Compensating the PID Feedback Loop for a Change in SampleRate: Kp- Proportional Term Kp does not need to be compensated for when using different sample rates because the proportional term has no time component.
Ki- Integral Term The equation that the XMP uses for the integral term
provides insight into how to compensate for the change in sample rate.
Example - Ki
Integral Term
The graph above shows a system that is almost in a state of instability due to a large integral term and a lack of a derivative term. Actual position is plotted vs. time showing an external disturbance.
The integral term (Ki) is effectively larger at a 10,000Hz sampling rate than a 2,000Hz sampling rate. This increase in integral gain results in an unstable case, as shown in the diverging oscillation in Figure 3.
When the integral term is properly compensated for by using a smaller compensated integral term, it will result in performance that is very similar to the original performance. Notice the similarity between the graphs of Figure 2 and Figure 4.
Kd- Derivative Term The equation that the XMP uses for the derivative term provides insight into how to compensate for the sample rate change. If you look at the difference between the XMP derivative term and the ideal digital derivative term, you find that the XMP derivative term should be divided by the sample (tsample) to change it to the ideal digital derivative term. This means that you only need to divide by the sample period (tsample) or multiply by the sample rate (1/ tsample) to compensate for a sample rate change.
Example
The graph above shows actual position vs. time where the system is subjected to an external disturbance. The system is tuned to be somewhat underdamped.
Notice that the system has less dampening at a higher sample rate with the same tuning parameters. Next, we will compensate the derivative term for the change in sample rate.
Notice that the disturbance plots at 2,000Hz and 10,000Hz are nearly identical when the PID parameters are compensated for the sample rate.
Compensating the PID Feedforward Loop for a Change in Sample Rate A simplified diagram of the PID feedforward loop is shown below.
Major Components of PID Feedforward
Kaff- Acceleration Feedforward Kaff is calculated as the command acceleration counts / controller sample2 multiplied by Kaff. In order to compensate for acceleration feedforward, convert from (counts / controller sample2) to (counts / second 2) for the original sample rate and back using the new sample rate. new Kaff = (new SR / old SR)2 * old Kaff Example
The above graph shows position error vs. time for a commanded motion with an underdamped servo system. The underdamped nature of the system is difficult to see because the loads on the system are largely inertial. The acceleration feedforward nearly eliminates any inertial based position error.
This stage was intentionally tuned to be underdamped, highlighting an incorrect acceleration feedforward. Notice that large position errors occured because the acceleration feedforward value was not scaled with the change in sample rate (SR).
Notice that when Kaff is changed, the position error is greatly reduced and a profile is produced that is very similar to the graph made at SR = 2,000. See Figure 9 and Figure10.
Kvff- Velocity Feedforward Kvff is calculated as the command velocity counts / controller sample multiplied by Kvff. In order to compensate for velocity feedforward, convert from (counts / controller sample) to (counts / second) for the original sample rate and back using the new sample rate. new Kvff = (new SR / old SR) * old Kvff Example old SR = 2,000
Here is the same move on the same stage as used for the acceleration feedforward example was performed, except velocity feedforward was used.
Notice that a significant position error in the form of a velocity profile appears with the non-scaled Kvff term.
The position error no longer shows the large velocity profile shaped component. The position error plot is similar in nature to the plot with the original sample rate (SR).
Kfff- Friction Feedforward Friction feedforward is not affected by the sample rate, since it has no time component.
Kpff- Position Feedforward Position feedforward is not affected by the sample rate, since it has no time component.
Unexpected Results The control system bandwidth cannot exceed the Nyquist Frequency (½ sample rate). This means that there will only be DAC quantization distortions exciting resonances above ½ the sample rate. This means that if your stage has a large resonance at 3,000 Hz, and you run your controller at a SR = 2,000 Hz, you may never know that the resonance exists. If you change the sample rate to 10,000 Hz, you now have a control system that can create significant 3,000 Hz energy. It would not be surprising to find your stage oscillating at 3,000 Hz. It is good to know where all the resonances are in your system. If you want to raise your sample rate to a frequency that covers a resonance in your system, consider applying a low pass or notch filter to reduce the magnitude of the resonance. Do not be afraid of fine tuning the scaled tuning parameters (Hint: write them down first). It is easier to fine tune scaled parameters than to start applying filters. Applying filters will most likely require the use of revised tuning parameters, so it is easier to fine tune scaled parameters instead. Remember that this method of tuning parameter scaling only provides scaled tuning parameters. It does not take resonances or non-linearities into account, and is not intended to compensate for those effects. Sample Rate Compensation
Summary
Previous | Back to Table of Contents |
||||||||||||||||||||||
| | | Copyright © 2001-2008 Motion Engineering |