Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Programmable logic controllers. Methods and Applications (Hackworth J., Prentice Hall).pdf
Скачиваний:
844
Добавлен:
12.08.2013
Размер:
6.34 Mб
Скачать

Chapter 10 - Closed Loop and PID Control

As the previous example illustrates, attempting to improve the performance of a closed loop system by simply increasing the proportional gain kp has lackluster results.

Some performance improvement can be achieved up to a point, but any further attempts to increase the proportional gain result in an unstable system. Therefore, some other method must be used to “tune” the system to achieve more desirable levels of performance.

10-5. Closed Loop Systems Using Proportional, Integral, Derivative (PID)

In the example previously used, there were three fundamental problems with the simple system using only proportional gain. First, the system had a large offset; second, it was slow to respond to changes in the SP (both of these problems were caused by a low proportional gain kp), and third, when the proportional gain was increased to reduce the offset and minimize the response time, the system became unstable and oscillated. It was impossible to simultaneously optimize the system for low offset, fast response, and high stability by tuning only the proportional gain kp.

To improve on this arrangement, we will add two more functions to our closed loop control system which are an integral function ki and a derivative function kd dtd , as shown

in Figure 10-7. Notice that in this system, the error signal is amplified by kp and then applied to the integral and derivative functions. The outputs of the proportional gain

amplifier, kp, the integral function ki , and the derivative function, kd dtd , are added together

at the summing junction to produce the CV. The values of kp, ki, and kd, are multiplying constants that are adjusted by the system designer, and are almost always set to a positive value or zero. If a function is not needed, it’s particular k value is set to zero.

For the proportional kp function, the input is simply multiplied by kp. For the integral ki function, the input is integrated (by taking the integral) and then multiplied by ki. For the derivative kd function, the input is differentiated (by taking the derivative), and then multiplied by kd. There is some interaction between these three functions; however, generally speaking each of them serves a specific and unique purpose in our system. Although the names of these functions (integral and derivative) imply the use of calculus, an in-depth knowledge of calculus is not necessary to understand and apply them.

10-7

Chapter 10 - Closed Loop and PID Control

 

ERROR

 

CV

SP

kp

kiI

CONTROLLED

MACHINE

 

 

d

SUMMING

 

 

JUNCTION

kd dt

PV

Figure 10-7 - Closed Loop Control System with Ideal PID

The PID system shown in Figure 10-7 is called an ideal PID and is the most commonly used PID configuration for control systems. There is another popular version of the PID called the parallel PID or the electrical engineering PID in which the three function blocks (proportional, integral and derivative) are connected in parallel, as shown in Figure 10-8. When properly tuned, the parallel PID performs identical to the ideal PID. However, the values of ki and kd in the parallel PID will be larger by a factor of kp because the input to these functions is not pre-amplified by kp as in the ideal PID.

 

kp

CV

 

ERROR

SP

kiI

CONTROLLED

MACHINE

 

d

SUMMING

 

JUNCTION

 

kd dt

 

 

 

PV

Figure 10-8 - Closed Loop Control System with Parallel PID Type

10-6. Derivative Function

By definition, a true derivative function outputs a signal that is equal to the graphical slope of the input signal. For example, as illustrated in Figure 10-9a, if we input a linear ramp waveform (constant slope) into a derivative function, it will output a voltage that is

10-8

Chapter 10 - Closed Loop and PID Control

equal to the slope m of the ramp, as shown in Figure 10-9b. For a ramp waveform, we can calculate the derivative by simply performing the “rise divided by the run” or m = )y/)t, where )y is the change in amplitude of the signal during the time period )t. As Figure 10-9b shows, our ramp has a slope of +0.5 during the time period 0 to 2 seconds, and a slope of -0.5 for the time period 2 to 4 seconds.

y

 

 

t

 

 

 

 

m

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

y

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.5

 

 

 

 

 

 

0.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

t (seconds) 0

 

 

 

 

 

 

 

 

 

 

t (seconds)

0

1

2

3

4

 

1

 

2

 

 

3

 

4

 

 

 

 

 

 

 

 

 

 

 

(a)

 

 

-0.5

 

 

 

 

(b)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 10-9 - Slope (Derivative) of a Ramp Waveform

As another example, if we input any constant DC voltage into a derivative function, it will output zero because the slope of all DC voltages is zero. Although this seems simple, it becomes more complicated when the input signal is neither DC nor a linear ramp. For example, if the input waveform is a sine wave, it is difficult to calculate the derivative output because the slope of a sine wave constantly changes. Although the exact derivative of a sine wave (or any other waveform) can be determined using calculus, in the case of control systems, calculus is not necessary. This is because it is not necessary to know the exact value of the derivative for most control applications (a close approximation will suffice), and there are alternate ways to approximate the derivative without using calculus. Since the derivative function is generally performed by a digital computer (usually a PLC or a PID coprocessor) and the digital system can easily, quickly, and repeatedly calculate )y/)t, we may use this sampling approximation of the derivative as a substitute for the exact continuous derivative, even when the error waveform is non-linear. When a derivative is calculated in this fashion, it is usually called a discrete derivative, numerical derivative, or difference function. Although the function we will be using is not a true derivative, we will still call it a “derivative” for brevity. Even if the derivative function is performed electronically instead of digitally, the function is still not a true derivative because it is usually bandwidth limited (using a low pass filter) to exclude high frequency components of the signal. The reason for this is that the slopes of high frequency signals can be extremely steep (high values of m) which will cause the derivative circuitry to output extremely high and erratic voltages. This would make the entire control system overly sensitive to noise and interference.

10-9

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