You are on page 1of 15
186 _ Microcontrolier-based Temperature Monitoring and Control 8.4.2.1 Ziegler—Nichols PID tuning algorithm Ziegler and Nichols suggested values for the PID parameters of a plant based on open-loop and closed-loop tests. OPEN-LOOP TUNING According to Ziegler and Nichols, an open-loop process can be approximated by the transfer function Keosts 69 = aE 8%) (8-11) where the coefficients K, Ts, and T; are found from a simple open-loop unit step response of the process as shown in Fig. 8.8 Unit step response Fig, 8.8 Finding porameters K, Tg, and T, of a process Ziegler-Nichols then suggests the controller settings given in Table 8.1 in order to minimize the integral of absolute error after the application of a step change in the set point, An example i given below to illustrate the method used. Example 8.5 The open-loop unit step response of a thermal control system is shown in Fig. 8.9. Obtain the transfer function of this system and use the Ziegler—Nichols tuning algorithm to design a proportional and also a proportional-integral-derivative controller for the system. Draw the block diagrams of the system with both type of controllers. Stability ] 87 Table 8.1 Ziegler-Nichols settings Controller Ke T tb qh Proportional a Proportional + Integral ost, 3.3Ta Ka , 12h Proportional + Integral + Derivative a 2a 0.57 is K,Ta.T) found from Kea T+sh) The controller is: 1 Ue) = Ke [1+ 1 +0: 10°C Fig. 8.9 Unit step response of the thermal system Solution 8.5 From Fig. 8.9, the system parameters are obtained as: K=50°C Ts = 30seconds T; = 230 seconds ] 8 8 Microcontroller-based Temperature Monitoring and Control and the transfer function is 50e7305 SO = Ty R05 PROPORTIONAL CONTROL According to Table 8.1, the Ziegler—-Nichols settings for a proportional con- troller are: Ty Kp KT, Thus, 230 =~" =01 & 50 x 30 38 The transfer function of the controller is then and the block diagram of the closed-loop system with the controller is shown in Fig. 8.10. Proportional controller Set point * 50638 output +» 0.183 (1 +280) Fig. 8.10 Block diagram of the system with proportional controller PID CONTROL According to Table 8.1, the Ziegler—Nichols settings for a proportional-integral- derivative controller are: Ti =2Ty Ts = 0.5Ty Stability ] 89 Thus, _ 1.2.x 230 = SS) T0842 30=60 Ty =0.5 x 30= 15 The transfer function of the required PID controller is: UG) 1 —= 4) 1+—— Fo 78 [ + gg tts] or, UG) mor roett) = 0.184 (= E@) ( 60s __ 165.68? + 11.048 + 0.184 ~ 60s and the block diagram of the closed-loop system with the controller is shown in Fig. 8.11. PID controtter Set point * 165.6 s+ 11.045 +0.184 50e-208 | output, 60s | (1 +2308) Fig. 8.11 Block diagram of the system with PID controller Note that the Ziegler-Nichols method does not give any guidance on what type of controller to use, but the best performance is usually obtained by using a PID type controller. CLOSED-LOOP TUNING Ziegler—Nichols closed-loop tuning is based on closed-loop tests. The procedure is as follows (see Fig. 8.12): @ Disable any D and | action of the controller and leave only the P action © Make a set point step test and observe the response @ Repeat the set point test with increased (or decreased) controller gain until a stable oscillation is achieved. This gain is called the “ultimate gain”, Ky ] 90 Microcontrolier-based Temperature Monitoring and Control Py Output < > oscillations Set point [Controller gain = Ky) Fig. 8.12 Ziegler-Nichols closed-loop tests @ Read the period of the steady oscillation. Let this be Py © Calculate the controller parameters according to the following formulas: Proportional and integral controller: Ky = 0.45Ky T= Py/12 Proportional-integral-derivative controller: Ky = 0.6Ky T.=P,/2 Tp=T./8 8.5 Digital realizations A control algorithm represented by a z-transform transfer function must be real- ized using a computer. This is done using unit delays and constant multipliers. A given transfer function can be realized in several ways. Some of the most commonly used realization techniques are: @ Direct programming © Serial programming @ Parallel programming @ Canonical programming These realization techniques are described in the following sub-sections. stabiity 19] 8.5.1 Direct programming In this method, the transfer function is written in terms of the output function, ‘An example is given below. Example 8.6 Let the transfer function of a digital system be: _ ¥@) _ 1-0.52-1 CO) = <0 > Taha 0) Realize this transfer function using direct programming. Solution 8.6 The transfer function can be written as: Y¥(z) — 1.25271 Y(z) + 0.252-?¥(z) = X(z) — 0.5X(z)z7! after the inverse transformation, y(kT) = 1.25y(kT — T) — 0.25y(kT — 2T) + x(kT) — 0.5x(kT — T) we can now realize this equation as shown in Fig, 8.13. (kT) (kT -T) i) y(kT ~ 27) 7 Karo t I Fig. 8.13 Direct realization of Example 8.6 8.5.2 Serial programming In this method, the transfer function is considered as factors and each factor is realized separately and placed in cascade. ] 92 Microcontroller-based Temperature Monitoring and Control Example 8.7 Let the transfer function of a digital system be: oy =X tse = Xm > Gaya 0250 Realize this transfer function using serial programming. Solution 8.7 The transfer function can be written as: G@ = 1-0.527! =(1-052-5 1 1 = GFN — 0252-5 ~ me la =F (0.252) we can now realize this equation as shown in Fig. 8.14. x(nT) y(n) —1__. 1-02527 1-057 Fig. 8.14 Serial realization of Example 8.7 8.5.3 Parallel programming In parallel programming, the transfer function is split into a sum of modules and each module is connected in parallel. Example 8.8 Let the transfer function of a digital system be: YO _ 6@ = 55 Realize this transfer function using parallel programming. Stability ] 93 Solution 8.8 ‘The transfer function can be written as: Y@ _ 0.66 0.33 ea) 0.25% we can realize this equation as in Fig. 8.15. Fig. 8.15 Parallel programming of Example 8.8 8.5.4 Canonical programming In canonical programming we find the difference equations and then realize the transfer function based on these difference equations. Canonical programming is widely used in realizing digital controllers because of its simplicity and the ease of developing an algorithm. Example 8.9 Let the transfer function of a digital system be: Y(z) 1-0.527! ~ (1 = 0.25274) Realize this transfer function using canonical programming. Solution 8.9 The transfer function can be written as: y(KT) = x(KT) + [-0.5x(KT — T) + 1.25y(kT — T)] — 0.25y(kT — 2T) we can realize this equation as in Fig. 8.16. 194 Microcontroller-based Temperature Monitoring and Control x(kT) Fig. 8.16 Canonical programming of Example 8.9 8.6 Realization of the discrete PID controller The discrete PID controller was given in equation 8-9 as: U@) = E@K 1+ + 1) 8-10) @ = BOK | 1+ aqaey tte (8-10) This controller is usually realized using parallel programming since equation 8-10 is already in a form which can be realized easily using parallel programming. Rewriting equation 8-10 as (8-12) (8-13) Equation 8-12 can be realized as shown in Fig. 8.17. In reference to Fig. 8.17, the following equations can be written. Notice that p(kT) and q(KT) are temporary variables used in the equations: p(kT) = be(kT) + p(kT — T) (kT) = ce(kT) — ce(kT — T) u(kT) = p(kT) + aek(t) + q(kT) Stabiity ]Q5 + * 7 T = © kT) 7 - Fig. 8.17 Parallel realization of the PID controller u(kT) We can now develop the following PDL to implement the PID algorithm (note that a, b, c are the PID parameters as defined in equation 8-13): BEGIN DO FOREVER Get set point: rkT) Get system output: (kT) Calculate error: e(kT) = (kT) — y(kT) Calculate I term: p(kT) = be(kT) + p(kT-T) Calculate D term: q(kT) = ce(kT) — ce(kT-T) Calculate PID output: u(kT) = p(kT) + ae(kT) + q(kT) Send control to actuator Save variables: p(kT—T) = p(kT) e(kT=T) = e(kT) Wait for next sample ENDDO 8.7 Problems with the standard PID controller One of the practical problems when the standard form of the PID controller used is known as the “Integral windup” which can cause long periods of overshoot 196 Microcontrolier-based Temperature Monitoring and Control Set point r in the controlled response. Integral windup arises because of an overflow in the digital computer. For example, when the error signal is integrated for long periods of time, an overflow situation may arise. One way to avoid integral windup is to limit the signals in the digital computer to a maximum and minimum. Another possible problem in practice is caused by the derivative action of the controller. This may happen when the set point changes sharply, causing the error signal to change. Under such a situation, the derivative term can give a “kick” in the output, known as the “derivative kick”. This is avoided in practice by moving the derivative term to the feedback loop. The proportional term may also cause a sudden kick in the output and it is also common to move the proportional term to the feedback loop. Figure 8.18 shows the practical realization of the PID controller in practice. Ju 2 Ls} pac [p|Actuator | y ; —Tan and Plant < Output w ez) apc jt — derivative Proportional Fig. 8.18 Practical realization of the PID controller Based on Fig. 8.18, we can develop the following PDL for the practical imple- mentation of a PID controller by a digital computer: BEGIN DO FOREVER Get set point: (kT) Get system output: w(kT) Calculate error: e(KT) = r(kT) — wkT) Calculate I term: (kT) = be(kT) + p(kT-T) Calculate D term: —_q(kT) = ew(kT) — ew(kT-T) Calculate PID output: u(kT) = p(kT) + aw(kT) + q(kT) Stability ]Q7 IF u(kT) > MAX P(KT) = p(kT—T) + MAX — u(kT) u(kT) = MAX ELSE IF u(kT) < MIN p(kT) = p(kT—T) + MIN — u(kT) u(kT) = MIN END IF Send control to actuator Save variables: p(kT—T) = p(kT) w(kT—T) = wkT) Wait for next sample ENDDO END 8.8 Choosing a sampling interval Whenever a digital control system is designed, a suitable sampling interval must be chosen. The simple choice is to sample as fast as possible. However, an unnecessarily fast sampling is a waste of resources. For example, fast sampling requires more expensive A/D converters. On the other hand, if the sampling rate is too low, then signal loss will occur. ‘There are many empirical rules for the selection of the sampling rate. The fol- lowing is a guideline for the choice of a minimum sampling rate: © If the closed-loop system is required to have a natural frequency of Ws, then choose the system sampling frequency as: Ws > 10Wn 2 where ws is the sampling frequency, i.e. ws = = This is the same as choosing T < T,/10 where T, is the closed-loop system settling time. @ If the system has a dominant time constant Tye then choose the sampling interval T as: Tate p< le < to 198 _ Microcontroller-based Temperature Monitoring and Control © If the system has the Ziegler—Nichols open-loop response as given by equation 8.12, then choose the sampling time T as: TU
  • Waa aH Ga =22 z X@) B+22?-42+0.5 9. Realize the following transfer functions using serial programming: Yo _ atd—z) X@ G—052-)0 — 0252-0 — 0.12) b. G@= 10. Realize the following transfer functions using canonical programming: Yo z & GO = <0 - Bye ha ». 6@ =2@ = 22 X@) A423 — 42 4052-25 200 Mictocontrolier-based Temperature Monitoring and Control 11. Realize the PID controller using canonical programming. 12. Explain the practical problems of using the standard forms of PID controllers. Draw the block diagram of a practical PID controller. 13. Develop an algorithm on a digital computer for a PI type controller.
  • You might also like