Файл: Programmable logic controllers. Methods and Applications (Hackworth J., Prentice Hall).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 15.06.2025
Просмотров: 2152
Скачиваний: 0
Chapter 10 - Closed Loop and PID Control
We will now apply the derivative function to our motor control system as shown in
Figure 10-10. For this exercise, we will be adjusting the proportional gain kp and the derivative gain kd only. The integral function will be temporarily disabled by setting ki to zero.
ERROR |
CV |
|||
SP |
kp |
kiI |
CONTROLLED |
TACHO-GENERATOR |
MACHINE |
||||
d |
SUMMING |
|||
JUNCTION |
||||
kd dt |
PV
Figure 10-10 - Closed Loop Control System with Ideal PID
Previously, when we increased the proportional gain of our simple closed loop DC motor speed system example, it began to exhibit instability by hunting. This particular instance was shown in Figure 10-5, and for easy reference, it is shown again below in
Figure 10-11.
Figure 10-11 - Motor Speed Control Response
with High kp Only
Without changing the proportional gain kp , we will now increase the derivative gain kd a small amount. The resulting response is shown in Figure 10-12.
10-10
Chapter 10 - Closed Loop and PID Control
Figure 10-12 - DC Motor Speed Control with High kp and Low Derivative Gain kd
The reader is invited to study and compare Figures 10-11 and 10-12 for a few moments. Notice in particular the way the motor speed accelerates at time t = 0+, the top speed that the motor reaches while the system is hunting, and the length of time it takes the speed to settle.
To see why the addition of derivative gain made such a dramatic improvement in the performance of the system we need to consider the dynamics of the system at certain elapsed times.
First, at time t = 0, the SP is switched from zero to a voltage corresponding to a motor speed of 1000 rpm. Since the motor is not rotating, the tacho-generator output will be zero and the PV will be zero. Therefore, the error voltage at this instant will be identical in amplitude and waveshape to the SP. At time zero when the SP is switched on, the waveshape will have a very high risetime (i.e., a very high slope) which, in turn, will cause the derivative function to output a very large positive signal. This derivative output will be added to the output of the proportional gain function to form the CV. Mathematically, the
CV at time t = 0+ will be
CV(t = 0+) = kp SP + kd mSP
where mSP is the slope of the SP waveform. Since the slope mSP is extremely large at t = 0+, the CV will be large which, in turn, will cause the motor to begin accelerating very rapidly. This difference in performance can be seen in the response curves. In Figure 10-11, the motor hesitates before accelerating, mainly due to starting friction (called
10-11
Chapter 10 - Closed Loop and PID Control
stiction) and motor inductance, while in Figure 10-12 the motor immediately accelerates due to the added “kick” provided by the derivative function.
Next, we will consider how the derivative function reacts at motor speeds above zero. Since the SP is a constant value and the error is equal to the SP minus the PV, the slope of the error voltage is going to be the opposite polarity of the slope of the PV. In other words, the error voltage will increase when the PV decreases, and the error voltage will decrease when the PV increases. Since the waveshape of the PV is the same as the waveshape of the speed, we can conclude that the slope of the error voltage will be the same as the negative of the slope of the speed curve. Additionally, since the output of the derivative function is equal to the slope of the error voltage, then we can also say that the output of the derivative function will be equal to the negative of the slope of the speed curve (for values of time greater than zero). Mathematically, this can be represented as
CV(t > 0) = kp (SP - PV) + kd m(SP - PV)
Since the SP is constant, its slope will be zero. Additionally, as we concluded earlier, the PV is the same as the speed. Therefore, we can simplify our equation to be
CV(t > 0) = kp (SP - speed) - kd mspeed
In other words, the CV is reduced by a constant kd times the slope of the speed curve. Therefore, as the motor accelerates, the derivative function reduces the CV and therefore attempts to reduce the rate of acceleration. This phenomenon is what reduced the motor speed overshoot in Figure 10-12 because the control system has “throttled back” on the motor acceleration. In a similar manner, as the motor speed decelerates, the negative speed slope causes the derivative function to increase the CV in an attempt to reduce the deceleration rate.
Since the derivative function tends to dampen the motor’s acceleration and deceleration rates, the amount of hunting required to bring the motor to its final operating speed is reduced, and the system settles more quickly. For this reason, the derivative function is sometimes called rate damping. If the machine is diesel, gasoline, steam, or gas turbine powered, this is sometimes called throttle damping. Also, if the hunting can be reduced by increasing kd, we can then increase the proportional gain kp to help further reduce the offset without encountering instability problems.
It would seem logical that if the derivative function can control the rate of acceleration to reduce overshoot and hunting, then we should be able to further improve the motor control performance shown in Figure 10-12 by an additional increase in kd. Figure 10-13 shows the response of our motor control system where kd has been increased by a factor of 4. Note that now there is only a slight overshoot and the system settles very quickly. It is possible to achieve even faster response of the system by further increasing
10-12
Chapter 10 - Closed Loop and PID Control
the proportional and derivative gain constants, kp and kd. However, the designer should take caution in doing so because the electrical voltage and current transients, and mechanical force transients can become excessive with potentially damaging results.
Figure 10-13 - DC Motor Speed Control with High kp and Moderate Derivative Gain kd
Although the transient response of our motor control system has been vastly improved, the offset is still present. By increasing the derivative constant kd, we eliminated the overshoot and hunting, but this had no effect on the offset. As indicated in Figure 10-13, the proportional and derivative functions nearly drove the motor speed to the proper value, but then the speed began to droop. As we will investigate next, in order to reduce this offset, the integral function must be used.
Based on the results of our investigations of the derivative function in a PID closed loop control system, we can make the following general conclusion:
In a properly tuned PID control system, the derivative function improves the transient response of the system by reducing overshoot and hunting. A byproduct of the derivative function is the ability to increase the proportional gain with increased stability, reduced settling time, and reduced offset.
10-7. Integral Function
A true integral is defined as the graphical area contained in the space bordered by a plot of the function and the horizontal axis. Integrals are cumulative; that is, as time passes, the integral keeps a running sum of the area outlined by the function being integrated. To illustrate this, we will take the integral of the pulse function shown in
10-13
Chapter 10 - Closed Loop and PID Control
Figure 10-14a. This function switches from 0 to 2 at time t = 0, switches back to 0 at time t = 1 second, then at time t = 2 seconds switches to -3, and finally back to 0 at t = 3 seconds. The integral of this waveform is shown in Figure 10-14b.
y |
S |
||||||||||||||||||
2 |
2 |
||||||||||||||||||
1 |
1 |
||||||||||||||||||
0 |
t (seconds) 0 |
t (seconds) |
|||||||||||||||||
1 |
2 |
3 |
4 |
||||||||||||||||
1 |
2 |
3 |
4 |
||||||||||||||||
-1 |
(a) |
-1 |
(b) |
||||||||||||||||
-2 |
-2 |
||||||||||||||||||
-3 |
-3 |
||||||||||||||||||
Figure 10-14 - Accumulated Area (Integral) of a Pulse Waveform
When the input waveform in Figure 10-14a begins at time t = 0 we will assume that the integral starting value is zero. As time increases from 0 to 1 second, the area under the waveform increases, which is indicated by the rising waveform in Figure 10-14b. At 1 second when the waveform switches off, the total accumulated area is 2. Since the input is zero between t = 1 and t = 2, no additional area is accumulated. Therefore, the accumulated area remains at 2 as indicated by the output waveform in Figure 10-14b between t = 1 and t = 2. At t = 2, the input switches to -3, and the integral begins adding negative area to the total. This causes the output waveform to go in the negative direction.
Since the area under the negative pulse of the input waveform between t = 2 and t = 3 is
-3, the output waveform will decrease by 3 during the same time period.
Notice that the output waveform in Figure 10-14b ends at a value of -1. This is the total accumulated area of the input waveform in Figure 10-14a during the time period t = 0 to t = 4. In fact, we can determine the total accumulated area at any time by reading the value of the integral in Figure 10-14b at the desired time. For example, the total accumulated area at t = 0.5 second is +1, and the total accumulated area at t = 2.5 seconds is +0.5.
For the example waveform in Figure 10-14a, the integral process seems simple. However, as with the derivative, if we wish to take the exact integral of a waveform that is nonlinear, such as a sine wave, the problem becomes more complicated and requires the use of calculus. For a control system (such as a PLC) this would be a heavy mathematical burden. So to lessen the burden, we instead have the PLC sample the input waveform at short evenly spaced intervals and calculate the area by multiplying the height (the
10-14
Chapter 10 - Closed Loop and PID Control
amplitude) by the width (the time interval between samples), and then summing the rectangular slices, as shown in Figure 10-15. Doing so creates an approximation of the integral called the numerical integral or discrete integral. (It should be noted that in
Figure 10-15 the integral of a sine wave over one complete cycle, or any number of complete cycles, is zero because the algebraic sum of the positive slices and negative slices is zero.) As we will see, in a PID control system, the integrate function is used to minimize the offset. Since it will reset the system so that the SP and PV are equal, the integrate function is usually called the reset.
y |
||||
2 |
||||
1 |
||||
0 |
1 |
2 |
3 |
t (seconds) |
4 |
||||
-1 |
||||
-2 |
Figure 10-15 - Discrete Integral of a Sine Wave
The error incurred in taking a numerical integral when compared to the true (calculus) integral depends on the sampling rate. A slower sampling rate results in fewer samples and larger error, while a faster sampling rate results in more samples and smaller error.
When used in a PID control system, this type of numerical integrator has an inherent problem. Since the integrator keeps a running sum of area slices, it will retain sums beginning with the time the system is switched on. If the control system is switched on and the machine itself is not running, the constant error can cause extremely high values to accumulate in the integral before the machine is started. This phenomenon is called reset wind-up or integral wind-up. If allowed to accumulate, these high integral values can cause unpredictable responses at the instant the machine is switched on that can damage the machine and injure personnel. To prevent reset windup, when the CV reaches a predetermined limit, the integral function is no longer calculated. This will keep the value of the CV within the upper and lower limits, both of which are specified by the PLC programmer. In some systems, these CV limits are called saturation, or output (CV) min and output (CV) max, or batch unit high limit and batch unit preload.
10-15
Chapter 10 - Closed Loop and PID Control
In a closed loop system, whenever there is an offset in the response, there will be a non zero error signal. This is because the PV and the SP are not equal. Since the integral function input is connected to the same error signal as the derivative function, the integral will begin to sum the error over time. For large offsets, the integral will accumulate rapidly and its output will increase quickly. For smaller offsets, the integral output will change more slowly. However, note that as long as the offset is non-zero, the integral output will be changing in the direction that will reduce the offset. Therefore, in a closed loop PID control system we can reduce the offset to near zero by increasing the integral gain constant, ki to some positive value.
Therefore, we will now attempt to reduce the offset in our motor speed control example to zero by activating the integral function. Figure 10-16 shows the result of increasing ki. Note that the transient response has changed little, but after settling, the offset is now zero.
Figure 10-16 - DC Motor Speed Control with
High kp, Moderate Derivative Gain kd, and
Low Integral Gain ki.
It is not advisable to make the integral gain constant ki excessively high. Doing so causes the integral and proportion functions to begin working against each other which will make the system more unstable. Systems with excessive values of ki will exhibit overshoot and hunting, and may oscillate.
To summarize the purpose of the integral function, we can now make the following general statement.
In a closed loop PID system, the integral function accumulates the system error over time and corrects the error to be zero or nearly zero.
10-16