Application Note #2442 Tuning with PL and PID Most closed-loop servo systems are able to achieve satisfactory tuning with the basic Proportional, Integral, and Derivative (PID) tuning parameters. However, for systems with resonance, this may not be enough, as the D term results in high gain at high frequencies. To manage these resonances, the Control Engineer can use the Pole filter, PL. The following discussion explains the subject in depth. The gain of the compensation filter can be presented by a frequency response graph, shown in Figure 1. Although the filter includes several components such as P, I, and D, it turns out that at any specific frequency, one component has a dominant effect. Therefore, the filter gain can be approximated by the dominant component. Regardless of system frequency, the Proportional gain (KP) is fixed. At low frequency, the role of KI is large in the overall system gain. As the frequency increases, the role of KI decreases. The role of the Derivative filter (KD) is to provide the system with damping. However, KD produces increasing gain at higher frequencies which tends to excite resonances and noise. Axis Gain db KI Gain KP Gain KD Gain Response Frequency ω (log) (rad/sec) Figure 1- System Gain vs. Response Frequency based on PID To overcome this problem, a low pass filter can be introduced that will attenuate the filter gain at higher frequencies. Figure 2 shows the limit imposed on the KD gain term by the addition of PL. 1
KD Gain Limit due to PL KI Gain KD Gain Axis Gain db KP Gain Response Frequency ω (log) (rad/sec) Figure 2- KD Gain limit due to PL The remaining question is how to select PL so that it attenuates the noise without degrading the loop stability. The frequency response of the filter (ignore KI for now) is: KD Gain Limit due to PL KD Gain Axis Gain db KP Gain ω d Response Frequency ω ω p (log) (rad/sec) ω d Break frequency between KD and KP ω p Break frequency between KD and PL Figure 3- Break Frequency due to KD/PL 2
The break frequencies are the frequencies at which the effect of two terms is equal. For example, at ω d the effect of KD is equal to the effect of KP. At frequencies below ω d, KP is dominant, and above ω d, KD is dominant. The break frequency ω p, the effect of PL equals the effect of KD. For Optima-series controllers, the formulas to determine the break frequencies are: ω d = KP KD T ω p 1 1 = ln T PL In order for PL not to cancel the benefits of KD, we must maintain ω p > 2.5 ω d Then, to find the largest PL, select ω p = 2.5 ω d 2.5 KP 1 1 = ln KDT T PL 2.5 KP 1 = ln KD PL P L = e max 2.5 KP KD Note: This is an absolute maximum for PL. It does not assure that this is the best value. Example: T = 0.001 KP = 10 KD = 100 10 ω d = = 100 rad/s. 100 0.001 The maximum PL for this system is: PL = e -0.25 = 0.78 3
resulting in: Example: ω p = 250 rad/s. A machine has been designed to rotate a mass at high rpm. Any imbalance in the load is likely to cause periodic fluctuations in the velocity. These fluctuations will be mitigated with the use of PL. First, PID parameters were determined using Windows Servo Design Kit (WSDK). Figure 4 shows a basic step response at low speed. Figure 4- Basic PID tuning To simulate motion that displays the high-frequency speed variances, the motor was commanded to Jog at 200,000 counts/sec. The error is plotted in Figure 5. 4
Figure 5- High-speed Jog with no Pole filter A fairly regular oscillatory error has developed at this frequency. The idea is to use the PL filter to smooth it out. Figure 6 shows a WSDK screenshot of this error after a PL of 0.6 was used. Figure 6- Added Pole filter to high-speed jog 5
Note that Figures 5 and 6 have different vertical scales. Figure 7 shows the data exported to a spreadsheet. Some oscillation is still present in the filtered data, but the amplitude has been drastically reduced. Effect of PL on High-Velocity Move 35 25 15 Error, counts 5-5 0 200 400 600 800 1000 PL0 PL0.6-15 -25-35 Time, msec Figure 7- Effect of Pole filter on high-velocity move Summary The Pole filter is a useful tool to help tune out any high-speed oscillations or disturbances in a closed-loop system. By using a combination of the mathematical equations in this application note and the experimental method, a control engineer can greatly improve the performance of their machine. If more information is needed, contact the Applications Department at Galil Motion Control at 1.800.377.6329 or support@galilmc.com 6
PL (Binary 87) FUNCTION: Pole DESCRIPTION: The PL command adds a low-pass filter in series with the PID compensation. The digital transfer function of the filter is (1 - P) / (Z - P) and the equivalent continuous filter is A/(S+A) where A is the filter cutoff frequency: A=(1/T) ln (1/p) rad/sec and T is the sample time. ARGUMENTS: PL n,n,n,n,n,n,n,n or PLA=n where USAGE: n is a positive number in the range 0 to 0.9999. n =? Returns the value of the pole filter for the specified axis. DEFAULTS: While Moving Yes Default Value 0.0 In a Program Yes Default Format 3.0 Not in a Program Yes Controller Usage ALL CONTROLLERS OPERAND USAGE: _PLn contains the value of the pole filter for the specified axis. RELATED COMMANDS: KD Derivative KP KI Proportional Integral Gain EXAMPLES: PL.95,.9,.8,.822 PL?,?,?,? 0.9527,0.8997,0.7994,0.8244 PL? 0.9527 PL,? 0.8997 Set A-axis Pole to 0.95, B-axis to 0.9, C-axis to 0.8, D-axis pole to 0.822 Return all Poles Return A Pole only Return B Pole only 7