Файл: Microcontroller based applied digital control (D. Ibrahim, 2006).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 14.06.2025
Просмотров: 3284
Скачиваний: 1
226 DISCRETE CONTROLLER DESIGN
Figure 9.15 Root locus of the system without compensator
or
p = 0.242.
The required controller transfer function is then
D(z) |
z − 0.5 |
. |
|||
= z |
|||||
− |
0.242 |
||||
The compensator introduces a zero at z = 0.5 and a pole at z = 0.242. The root locus of the compensated system is shown in Figure 9.16. Clearly the new locus passes through the required points z1,2 = 0.3 ± j 0.3, and it will be at these points that the d.c. gain is K = 0.185. The step response of the system with the compensator is shown in Figure 9.17. It is clear from this diagram that the system has a steady-state error.
The block diagram of the controller and the system is given in Figure 9.18.
Example 9.6
The block diagram of a system is as shown in Figure 9.19. It is required to design a controller for this system with percent overshoot (PO) less than 17 % and settling time ts ≤ 10 s. Assume that T = 0.1 s.
228 |
DISCRETE CONTROLLER DESIGN |
||||
+ |
z − 0.5 |
0.185 |
Y(z) |
||
R(z) |
_ |
z − 0.242 |
(z − 0.2)(z − 0.9) |
||
Figure 9.18 Block diagram of the controller and the system
+ |
0.1K |
||||||||||||||||
R(z) |
D(z) |
ZOH |
Y(z) |
||||||||||||||
_ |
(s + 0.1) |
||||||||||||||||
Figure 9.19 Block diagram for Example 9.6
Solution
The damping ratio, natural frequency and hence the required root positions can be determined as follows:
For PO < 17%, ζ ≥ 0.5. |
||
For ts ≤ 10, ζ ωn ≥ |
4.6 |
or ωn ≥ 0.92 rad/s. |
ts |
||
Hence, the required pole positions are found to be
z1,2 = e−ζ ωn T cos ωn T |
+ j sin ωn T |
|||
1 − ζ 2 |
1 − ζ 2 |
or
z1,2 = 0.441 ± j 0.451.
The z-transform of the plant, together with the zero-order hold, is given by
= |
z |
s2(s 0.1) |
= |
(z |
1)(z 0.9048) |
|||||
G(z) |
z − 1 |
Z |
0.1K |
0.00484K (z + |
0.9672) |
. |
||||
+ |
||||||||||
− |
− |
|||||||||
The root locus of the uncompensated system and the required root position is shown in Figure 9.20.
It is clear from the figure that the root locus will not pass through the marked point by simply changing the d.c. gain. We can design a compensator as in Example 9.5 such that the locus passes through the required point, i.e.
D(Z ) = z − n . z − p
The angle of G(z) at the required point is
G(z) = 0.441 + j 0.451 + 0.9672 − (0.441 + j 0.451 − 1) − (0.441 + j 0.451 − 0.9048) or
G(z) |
= |
tan−1 |
0.451 |
− |
tan−1 |
0.451 |
− |
tan−1 |
0.451 |
= − |
259◦. |
||||
1.4082 |
− |
0.559 |
− |
0.4638 |
|||||||||||
DIGITAL CONTROLLERS |
229 |
Figure 9.20 Root locus of uncompensated system
Since the sum of the angles at a point in root locus must be a multiple of −180◦, the compensator must introduce an angle of −180 − (−259) = 79◦. The required angle can be obtained using a compensator with a transfer function, and the angle introduced by the compensator is
D(Z ) |
= |
(0.441 |
+ |
j 0.451 |
− |
n) |
− |
(0.441 |
+ |
j 0.451 |
− |
p) |
= |
79◦ |
|||||||||||||
or |
|||||||||||||||||||||||||||
tan−1 |
0.451 |
− |
tan−1 |
0.451 |
= |
79◦. |
|||||||||||||||||||||
− |
− |
||||||||||||||||||||||||||
0.441 |
n |
0.441 |
p |
||||||||||||||||||||||||
If we choose n = 0.6, then |
0.451 |
||||||||||||||||||||||||||
109◦ − tan−1 |
= 79◦ |
||||||||||||||||||||||||||
0.441 |
− |
p |
|||||||||||||||||||||||||
or |
|||||||||||||||||||||||||||
p = −0.340. |
|||||||||||||||||||||||||||
The transfer function of the compensator is thus |
|||||||||||||||||||||||||||
D(z) |
= z |
z − 0.6 |
. |
||||||||||||||||||||||||
+ |
0.340 |
||||||||||||||||||||||||||
230 DISCRETE CONTROLLER DESIGN
Figure 9.21 Root locus of the compensated system
Figure 9.21 shows the root locus of the compensated system. Clearly the locus passes through the required point. The d.c. gain at this point is K = 123.9.
The time response of the compensated system is shown in Figure 9.22.
9.2 PID CONTROLLER
The proportional–integral–derivative (PID) controller is often referred to as a ‘three-term’ controller. It is currently one of the most frequently used controllers in the process industry. In a PID controller the control variable is generated from a term proportional to the error, a term which is the integral of the error, and a term which is the derivative of the error.
Proportional: the error is multiplied by a gain K p . A very high gain may cause instability, and a very low gain may cause the system to drift away.
Integral: the integral of the error is taken and multiplied by a gain Ki . The gain can be adjusted to drive the error to zero in the required time. A too high gain may cause oscillations and a too low gain may result in a sluggish response.
Derivative: The derivative of the error is multiplied by a gain Kd . Again, if the gain is too high the system may oscillate and if the gain is too low the response may be sluggish.
Figure 9.23 shows the block diagram of the classical continuous-time PID controller. Tuning the controller involves adjusting the parameters K p , Kd and Ki in order to obtain a satisfactory
PID CONTROLLER |
231 |
Figure 9.22 Time response of the system
Kp |
+ |
+ |
||||||||||||
E |
Kp |
Σ |
U |
|||||||||||
Ti s |
||||||||||||||
+ |
||||||||||||||
KpTd s |
||||||||||||||
Figure 9.23 Continuous-time system PID controller
response. The characteristics of PID controllers are well known and well established, and most modern controllers are based on some form of PID.
The input–output relationship of a PID controller can be expressed as
u(t ) |
K p e(t ) |
1 |
t |
e(t )dt |
Td |
de(t ) |
, |
(9.14) |
|||
= |
+ T |
+ |
|||||||||
dt |
|||||||||||
i |
0 |
||||||||||
where u(t ) is the output from the controller and e(t ) = r (t ) − y(t ), in which r (t ) is the desired set-point (reference input) and y(t ) is the plant output. Ti and Td are known as the integral and
232 DISCRETE CONTROLLER DESIGN
derivative action time, respectively. Notice that (9.14) is sometimes written as
u(t ) = K p e(t ) + Ki |
t |
+ u0, |
(9.15) |
|||||
e(t )dt + Kd dt |
||||||||
de(t ) |
||||||||
0 |
||||||||
where |
||||||||
Ki = |
K p |
and Kd = K p Td . |
(9.16) |
|||||
Ti |
||||||||
Taking the Laplace transform of (9.14), we can write the transfer function of a continuous-time PID as
U (s) |
= K p + |
K p |
+ K p Td s. |
(9.17) |
E (s) |
Ti s |
To implement the PID controller using a digital computer we have to convert (9.14) from a continuous to a discrete representation. There are several methods for doing this and the simplest is to use the trapezoidal approximation for the integral and the backward difference approximation for the derivative:
dt |
≈ |
e(k T ) |
− T |
− T ) |
and |
0 |
t |
n |
T e(k T ). |
||||||||||||||||
e(t )dt ≈ |
|||||||||||||||||||||||||
de(t ) |
e(k T |
||||||||||||||||||||||||
k |
= |
1 |
|||||||||||||||||||||||
Equation (9.14) thus becomes |
e(k T ) |
||||||||||||||||||||||||
u(k T ) K p e(k T ) |
Td e(k T ) − e(k T − T ) |
T |
n |
u0. |
(9.18) |
||||||||||||||||||||
= |
+ |
+ |
+ |
||||||||||||||||||||||
T |
Ti |
k |
= |
1 |
|||||||||||||||||||||
The PID given by (9.18) is now in a suitable form which can be implemented on a digital computer. This form of the PID controller is also known as the positional PID controller. Notice that a new control action is implemented at every sample time.
The discrete form of the PID controller can also be derived by finding the z-transform of (9.17):
U (z) |
K |
1 |
T |
T |
(1 − z−1) |
. |
(9.19) |
|||||||
E (z) |
= |
+ Ti (1 − z−1) + |
||||||||||||
p |
d |
T |
||||||||||||
Expanding (9.19) gives |
||||||||||||||
u(k T ) = u(k T − T ) + K p [e(k T ) − e(k T − T )] + |
K p T |
e(k T ) |
||||||||||||
Ti |
||||||||||||||
+ |
K p Td |
[e(k T ) − 2e(k T − T ) |
− e(k T − 2T )]. |
(9.20) |
||||||||||
T |
||||||||||||||
This form of the PID controller is known as the velocity PID controller. Here the current control action uses the previous control value as a reference. Because only a change in the control action is used, this form of the PID controller provides a smoother bumpless control when the error is small. If a large error exists, the response of the velocity PID controller may be slow, especially if the integral action time Ti is large.
The two forms of the PID algorithm, (9.18) and (9.20), may look quite different, but they are in fact similar to each other. Consider the positional controller (9.18). Shifting back one