Chemical Engineering Science 57 (2002) 3005 – 3011
www.elsevier.com/locate/ces
Closed-loop automatic tuning of PID controller for nonlinear systems K. K. Tan ∗ , R. Ferdous, S. Huang Department of Electrical and Computer Engineering, National University of Singapore, 4 Engineering Drive 3, Singapore 117576, Singapore Received 15 October 2001; received in revised form 20 April 2002; accepted 1 May 2002
Abstract In this paper, a robust control system is 2rst proposed which is suitable for the control of a class of nonlinear systems. A parallel connection of a relay to a proportional integral derivative (PID) controller collectively forms the robust controller. The relay ensures robust control by providing a high feedback gain, but it also induces a control chattering phenomenon. Instead of viewing chattering as an undesirable yet inevitable feature, the chattering signals are used as natural excitation signals for identifying an equivalent PID controller using the recursive least squares algorithm. No other explicit input signal is required. Analysis is provided on the stability properties of the control scheme. Simulation results for the level control of 7uid in a spherical tank using the scheme are presented. ? 2002 Elsevier Science Ltd. All rights reserved. Keywords: Nonlinear systems; Robust performance; PID control; Automatic tuning; Relay; Least squares estimation
1. Introduction Controllers of the proportional-integral-derivative (PID) type are still popular in the process control industry despite advances and increasing sophistication in the so-called mathematical control system theory. PID control is often combined with logic, sequential machines, selectors, and function blocks to build complicated automation systems, such as those used for energy production, transportation, and manufacturing. Many sophisticated control strategies, such as model predictive control, are also organized hierarchically based on PID control. The continued success of this controller provides a strong testimony to the rule-of-thumb in engineering practice, the TSTF (try simple things 2rst) principle. Indeed, the PID controller has probably the most impressive record in terms of the number of successful industrial applications. The reason is that it has a simple structure which is easy to be understood by the engineers, and under practical conditions, it has been performing more reliably compared to more advanced and complex controllers. A multitude of approaches towards the design of PID control for linear systems has been reported over the years (Astrom & Hagglund, 1988, 1995; Gawthrop, 1986; Ho, ∗
Corresponding author. Tel.: +65-6874-2110; fax: +65-6779-1103. E-mail address:
[email protected] (K. K. Tan).
Hang, & Cao, 1995). For nonlinear systems, adaptive control methods are rampantly suggested and used in the literature (Zhang, Ge, & Hang, 2000; Ordonez & Passino, 2001). However, one should be careful of the possible abuse of adaptive schemes, which being inherently nonlinear, is much more complicated than a 2xed gain regulator. Under the harsh realities of a practical control environment, the pre-requisites for eEective application of adaptive control can be easily breached, yielding results which are far from satisfactory, and in many cases, worse than that achievable by PID control. This is despite of the more signi2cant eEort and resources used in the implementation of adaptive control schemes. Gain scheduling and robust high gain control are possible alternatives to adaptive control algorithms (Jiawen & Brosilow, 1998; Kuang-Hsuan & Shamma, 1998). In this paper, we 2rst propose a robust control system, involving the use of a relay in parallel with a PID controller, to provide a high gain feedback system which may be used for the robust control of nonlinear systems. The con2guration may be viewed as PID control augmented with a sliding mode. The chattering signals, incurred as a consequence of the relay, are used in a recursive least squares (RLS) algorithm to autotune an equivalent robust PID controller which may then replace the parallel PID-relay construct. The relay may be re-invoked for re-tuning purposes following changes in set-points or changes in the time-varying system
0009-2509/02/$ - see front matter ? 2002 Elsevier Science Ltd. All rights reserved. PII: S 0 0 0 9 - 2 5 0 9 ( 0 2 ) 0 0 1 8 6 - 0
3006
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
For closed-loop control based on model (1) under control (3), it follows that t e d eJ = ae˙ + be − ckp e − cki 0
− ckd e˙ − cd sgn(e) − f(x; x) ˙ + fd ; where fd = rJ − ar˙ − br. Letting t T z= e d; e; e˙ ;
Fig. 1. Con2guration of the robust control scheme.
2. Robustness analysis The con2guration of the robust control scheme is shown in Fig. 1, which comprises of a relay connected in parallel with a PID controller Gc (henceforth called the PID-relay construct) for the robust control of a nonlinear system Gp . It may be viewed as a PID controller augmented with a sliding mode, thus yielding a high gain feedback system which can ensure robust performance even in the face of modelling errors. The PID control may be tuned just based on a linear model, and the relay will compensate for possible inadequacy through its high gain incorporated into the feedback loop. The price to pay is the emergence of control chattering in the closed loop, which in many cases should not be allowed to persist inde2nitely due to potential damages caused to the 2nal control elements. However, as will be illustrated in this section, the chattering signals can be used in the tuning of an equivalent robust PID controller which may subsequently replace the PID-relay construct. Consider a class of nonlinear systems described by (1)
where y and y˙ are assumed to be limited, and therefore, the nonlinear part described by f(y; y) ˙ is assumed to be bounded, i.e., f(y; y) ˙ 6 fM . De2ne the error between the desired trajectory r (which is twice diEerentiable) and the system output y e = r − y:
(5)
0
dynamics, similar to the way an auto-tuning relay is used (Astrom & Hagglund, 1995). Robustness analysis will be provided in the paper to illustrate the robust stability properties of the control scheme. Simulation results are provided to illustrate the eEectiveness of the proposed control scheme when applied to the level control of 7uid in a spherical tank.
yJ = ay˙ + by + cv + f(y; y); ˙
(4)
(2)
Under the proposed structure of Fig. 1, the control signal v is given by t v = d sgn(e) + kp e + ki e d + kd e; ˙ (3) 0
where sgn(:) is the usual sign operator, kp , ki and kd are the respective gains of the PID controller, and d denotes the relay amplitude.
and formulating (4) into a matrix form, we have z˙ = Az + B[D(t) − f(x; x) ˙ + fd ]; where
0
1
0
0
1
b − ckp
a − ckd
A= 0 −cki 0 B=0
(6)
;
(7)
(8)
1 D(t) = −cd sgn(e):
(9)
Assume that the PID parameters kp ; ki ; kd and the relay amplitude d can be tuned to ensure the dominant system to be stable. This implies that A is a stable matrix. Thus, the following Lyapunov equation will hold: AT P + PA = −I;
(10)
where I is the unit matrix. Theorem 1. Assume that system (1) admits a relay-induced oscillation under the setup proposed. Then; if the PID parameters are tuned properly; the state z is uniformly bounded. Proof. De2ne the Lyapunov function V = z T Pz:
(11)
The derivative of V is given by V˙ = z T (AT P + PA)z + 2z T PBD(t) − 2z T PBf(y; y) ˙ + 2z T PBfd = −z2 + 2z T PBD(t) − 2z T PBf(y; y) ˙ + 2z T PBfd : (12) Note that f(y; y) ˙ 6 fM and fd 6 fdM . Thus; we have − 2z T PBf(y; y) ˙ 6 z T PBBT Pz + 6 z T PBBT Pz +
1 2 f 1 2 f ; M
(13)
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
2z T PBfd 6 z T PBBT Pz +
3007
1 2 f d
1 2 f ; dM where is an arbitrary constant. Therefore, it follows that 6 z T PBBT Pz +
D(t) 6 cd|sgn(e)| = cd = DM ;
(14)
as|sgn(e)| 6 1:
(15)
Fig. 2. Equivalent PID controller.
Now the term 2z T PBD(t) can be expressed approximately as 1 2z T PBD(t) 6 z T PBBT Pz + D2 (t) 1 2 D : M The following derivative of V is thus obtained: V˙ 6 −z2 + 3max (PBBT P)z2 6 z T PBBT Pz +
+
(16)
1 2 1 1 f + f 2 + D2 M dM M
= −[1 − 3max (PBBT P)]z2 +
1 2 1 2 1 2 + DM : fM + fdM
(17)
Let = 1 − 3max (PBBT P) and choose subject to 0 ¡ ¡ 1=3max (PBBT P). Since min (P)z2 6 V 6 max (P)z2 , it follows that 1 2 1 2 1 2 V + fM V˙ 6 − + fdM + DM max (P) =−
V + 0 ; max (P)
2 2 2 where 0 = 1=fM + 1=fdM + 1=DM . Hence, 0 max (P) 0 max (P) − (P) t e max : V (t) 6 + V (0) −
(18)
(19)
For state z, it thus follows that
0 max (P) 0 max (P) −=(max (P))t z 6 e : + V (0) − min (P) min (P) (20) This implies that
lim z(t) =
t→∞
0 max (P) ; min (P)
(21)
i.e., state z is bounded under the condition of Theorem 1.
Fig. 3. Spherical tank.
The RLS 2tting method is applied to the input and output chattering signals of the PID-relay construct (directly in the time domain) to yield the gains of the equivalent PID controller. The equivalent PID controller of this form is described by t de v(t) = Kp e + Ki e dt + Kd : (22) dt 0 The equation can be written in a matrix form as Kp t de e dt v(t) = e Ki : dt 0 Kd
Eq. (23) can be written in the linear-in-the parameters form as v(t) = "(t)#T ;
3. Automatic tuning of an equivalent PID controller The main idea, to be pursued in this section, is to approximate the parallel PID-relay construct with an equivalently tuned PID controller G˜ c as shown in Fig. 2.
(23)
where
Kp
"(t) = Ki Kd
3008
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
Fig. 4. Simulation results (a) control signal and (b) closed-loop performance (1) PID-relay controller, (2) equivalent PID controller.
Fig. 5. Simulation results (a) control signal (b) closed-loop performance at diEerent operating level of the tank using the equivalent PID controller.
and
t de T : e dt # = e dt 0
where "(t − 1) refers to the controller settings identi2ed during the last cycle, $(t) and K(t) are the error signal and Kalman gain vector, where
The RLS algorithm with a time varying forgetting factor can be directly used here as vt and #T are available, the update of "(t) can be expressed as
$(t) = v(t) − #T "(t − 1);
(25)
K(t) = P(t − 1)#(I + #T P(t − 1)#)−1 ;
(26)
"(t) = "(t − 1) + K(t)$(t);
P(t) = (I − K(t)#T )P(t − 1)=:
(27)
(24)
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
3009
Fig. 6. Closed-loop performance under the in7uence of measurement noise.
Fig. 7. Closed-loop performance based on a 2xed PID setting.
is a forgetting factor (0 ¡ ¡ 1). There are two matrices to be initialized for the recursive algorithm, P(0) and "(0). It is usual to initialize P(0) such that P0 =%I , where % is a large number (104 –106 ) and I is the identity matrix. "(0) may be set to be the gains of the PID controller before tuning. The robust control con2guration, comprising of the relay and the PID controller, puts a high gain in the loop and en-
sures satisfactory closed-loop performance. Although it incurs a chattering phenomenon, the chattering signals have been used as naturally arising signals to automatically tune an equivalent PID controller. No other explicit and deliberate excitation signals are needed, sparing the usual tedious identi2cation exercise necessary for control tuning. However, it should be acknowledged that the equivalent PID controller
3010
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
Fig. 8. Comparison of closed-loop performance (1) 2xed PID controller, (2) proposed control system.
chosen remains a linear controller. It is only tuned to the the closest equivalence to the original relay-plus-PID controller in the least squares sense. As such, in terms of actual performance and robustness, a degradation is expected with the equivalent controller. The favorable trade-oE the chattering phenomenon will be eliminated with the equivalent PID controller. An existing ongoing work considers instead the use of a nonlinear PID controller as the equivalent controller to reap further performance improvement. 4. Simulation study To illustrate the performance attainable with the proposed control system, a simulation study is carried out on the level control of 7uid in the classical spherical tank system. This 7uid level control problem is a common one associated with storage tanks, and blending and reaction vessels in the process industries. The spherical tank system is shown in Fig. 3, it is essentially a system with nonlinear dynamics. The spherical tank has nonlinear dynamics described by the 2rst-order diEerential equation (R − y)2 dy 2 Qi (t) − Qo = (R 1 − ; R2 dt where R is the radius of the spherical tank and the diEerence between the in7ow Qi and out7ow Qo causes the water level y to rise or fall in a manner described by the nonlinear 2rst-order diEerential equation above. Qi can be manipulated via a pump and it is thus the manipulated variable here. From the expression, it can be seen that the rise time of the water level is fastest at the top and the bottom of the tank, but slowest at the middle, as be2ts intuition. The out7ow
of the tank is dependent on the water level in line with the Bernoulli equation which states that the out7ow of a tank is proportional to the square root of the height of the 7uid level: Qo = cd % 2g(y − yo ): In this simulation, the following parameters with respect to the spherical tank and the relay are selected; R = 1, cd = 1, % = 1, yo = 0:1, and d = 0:25. Fig. 4 shows the closed-loop performance of the proposed control system for the two control schemes. The response (marked ‘1’) corresponds to the use of the PID-relay construct, while the response (marked ‘2’) corresponds to the use of the equivalent PID controller, automatically tuned from the e and v signal based on the method presented in Section 4. Fig. 5 shows the closed-loop performance based on the proposed equivalent PID controller, corresponding to different operating level of the spherical tank. Three setpoint changes to diEerent desired level are simulated, each followed by the simulation of a static load disturbance (with an amplitude roughly 10% of the setpoint changes) seaping in. Fig. 6 shows the response to the same set of setpoint changes, but they now occur under the in7uence of signi2cant measurement noise. The performance is compared to that achieved by a PID controller with 2xed gains. This PID controller is tuned at the mid level of the spherical tank. The control performance is shown in Fig. 7. Fig. 8 provides a magni2ed illustration of the response to a setpoint change to show the improved performance of the robust scheme, both in setpoint tracking and load regulation.
K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011
5. Conclusion A robust control system is proposed which is suitable for the control of nonlinear systems, comprising of a parallel connection of a relay to a PID controller. The relay ensures robust control by providing a high feedback gain, but it also induces a control chattering phenomenon. The chattering signals are used as a natural excitation signal for identifying an equivalent PID controller using the RLS algorithm. No other explicit input signal is required. Analysis shows the robust stability properties of the control scheme. Simulation results on a spherical tank level control further illustrate the practical applicability of the scheme. References Astrom, K. J., & Hagglund, T. (1988). Automatic tuning of PID controllers. Research Triangle Park, NC: Instrument Society of America.
3011
Astrom, K. J., & Hagglund, T. (1995). PID controllers: Theory, design and tuning. Research Triangle Park, NC: Instrument Society of America. Gawthrop, P. J. (1986). Self-tuning PID controllers: Algorithms and implementations IEEE Transaction on Automatic Control, 31(3), 201. Ho, W. K., Hang, C. C., & Cao, L. S. (1995). Tuning of PID controllers based on gain and phase margin speci2cation. Automatica, 31, 497– 502. Jiawen, D., & Brosilow, C. B. (1998). Nonlinear PI and gain-scheduling. American control conference, Proceedings of the 1998, Vol. 1 (pp. 323–327). Kuang-Hsuan, T., & Shamma, J. S. (1998). Nonlinear gain-scheduled control design using set-valued methods. American control conference, Proceedings of the 1998, Vol. 2 (pp. 1195 –1199). Ordonez, R., & Passino, K. M. (2001). Adaptive control for a class of nonlinear systems with a Time varying structure. IEEE Transactions on Automatic Control, 46(1), 152–155. Zhang, T., Ge, S. S., & Hang, C. C. (2000). Stable adaptive control for a class of nonlinear systems using a modi2ed Lyapunov function. IEEE Transactions on Automatic Control., 45(1), 129–132.