You are on page 1of 7
Chemical Engineering Science 57 (2002) 3005 – 3011 www.elsevier.com/locate/ces Closed-loopautomatic tuning of PID

Chemical Engineering Science 57 (2002) 3005 – 3011

Chemical Engineering Science 57 (2002) 3005 – 3011 www.elsevier.com/locate/ces Closed-loopautomatic tuning of PID

www.elsevier.com/locate/ces

Closed-loopautomatic 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 rst 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 uid 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 de- spite 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 hierarchi- cally 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 rst) principle. Indeed, the PID controller has probably the most impressive record in terms of the number of successful in- dustrial applications. The reason is that it has a simple struc- ture which is easy to be understood by the engineers, and under practical conditions, it has been performing more re- liably 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: eletankk@nus.edu.sg (K. K. Tan).

Hang, & Cao, 1995). For nonlinear systems, adaptive con- trol methods are rampantly suggested and used in the lit- erature (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 xed gain regulator. Under the harsh realities of a practical control environment, the pre-requisites for e ective 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 signi cant e ort and resources used in the implementation of adaptive con- trol schemes. Gain scheduling and robust high gain control are possible alternatives to adaptive control algorithms (Ji- awen & Brosilow, 1998; Kuang-Hsuan & Shamma, 1998). In this paper, we rst propose a robust control system, in- volving 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 con gura- tion may be viewed as PID control augmented with a slid- ing 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 0009-2509(02)00186-0

3006

K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011

et al. / Chemical Engineering Science 57 (2002) 3005–3011 Fig. 1. Con guration of the robust

Fig. 1. Con guration of the robust control scheme.

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 prop- erties of the control scheme. Simulation results are provided to illustrate the e ectiveness of the proposed control scheme when applied to the level control of uid in a spherical tank.

2. Robustness analysis

The con guration of the robust control scheme is shown in Fig. 1, which comprises of a relay connected in parallel with a PID controller G c (henceforth called the PID-relay construct) for the robust control of a nonlinear system G p . It may be viewed as a PID controller augmented with a slid- ing 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 inade- quacy through its high gain incorporated into the feedback loop. The price to pay is the emergence of control chat- tering in the closed loop, which in many cases should not be allowed to persist inde nitely due to potential damages caused to the nal control elements. However, as will be il- lustrated 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)

y = ay˙ + by + cv + f(y; y˙);

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 f M . De ne the error between the desired trajectory r (which is twice di erentiable) and the system output y

(2)

e = r y:

Under the proposed structure of Fig. 1, the control signal v is given by

v

= d sgn(e) + k p e + k i t e d + k d e;˙

0

(3)

where sgn(:) is the usual sign operator, k p , k i and k d are the respective gains of the PID controller, and d denotes the relay amplitude.

For closed-loopcontrol based on model (1) under control (3), it follows that

e = ae˙ + be ck p e ck i t e d

0

ck d e˙ cd sgn(e) f(x; x˙) + f d ;

(4)

where f d = r ar˙ br. Letting

z

= t e d ; e; e˙ T ;

0

and formulating (4) into a matrix form, we have

z˙ = Az + B[D(t) f(x; x˙) + f d ];

where

A =

01

00

ck i

b ck p

B = 0

0

1

0

1

a ck d

;

(5)

(6)

(7)

(8)

(9)

Assume that the PID parameters k p ; k i ; k d and the relay am- plitude d can be tuned to ensure the dominant system to be stable. This implies that A is a stable matrix. Thus, the fol- lowing Lyapunov equation will hold:

(10)

A T P + PA = I;

D(t) = cd sgn(e):

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. De ne the Lyapunov function

V

The derivative of V is given by

= z T Pz:

˙

V

= z T (A T P + PA)z + 2z T PBD(t)

2z T PBf(y; y˙)+2z T PBf d

= z 2 + 2z T PBD(t) 2z T PBf(y;

(11)

y˙)+2z T PBf d :

(12)

Note that f(y; y˙) 6 f M and f d 6 f dM . Thus; we have

2z T PBf(y; y˙) 6 z T PBB T Pz + 1 f 2

6

z T PBB T Pz +

1 f M ;

2

(13)

K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011

3007

2z T PBf d 6 z T PBB T Pz

+ 1 f

2

d

6

z T PBB T Pz +

1 f dM ;

2

(14)

where is an arbitrary constant. Therefore, it follows that

= D M ; as|sgn(e)| 6 1: (15)

Now the term 2z T PBD(t) can be expressed approximately as

2z T PBD(t) 6 z T PBB T Pz

D(t) 6 cd|sgn(e)| = cd

+ 1

1

D 2 (t)

2

6

z T PBB T Pz +

D

M :

(16)

The following derivative of V is thus obtained:

˙

V

6 z 2 +

3 max (PBB T P) z 2

+ 1 f M + 1 f

2

2

dM +

1

D

2

M

= [1 3 max (PBB T P)] z 2

+ 1 f M + 1 f

2

D M :

Let = 1 3 max (PBB T P) and choose subject

0 ¡ ¡ 1=3 max (PBB T P). Since min (P) z 2 6 V 6 max (P) z 2 , it follows that

2

dM +

1

2

(17)

to

˙

V 6

(P) V + 1 f M + 1 f

2

max

dM + 1

2

2

M

D

=

(P)

max

V

+ 0 ;

where 0 = 1= f M + 1= f dM + 1= D M . Hence,

2

2

2

V(t) 6 0 max (P)

+ V (0) 0 max (P) e

max (P) t :

(18)

(19)

For state z, it thus follows that

z 6 0 min max (P) (P)

+ V (0) 0 min max (P) (P)

e =( max (P))t :

(20)

This implies that

t z(t) = 0 max (P) ;

lim

min (P)

(21)

i.e., state z is bounded under the condition of Theorem 1.

3. Automatic tuning of an equivalent PID controller

The main idea, to be pursued in this section, is to approx-

imate the parallel PID-relay construct with an equivalently

˜

tuned PID controller G c as shown in Fig. 2.

˜ tuned PID controller G c as shown in Fig. 2. Fig. 2. Equivalent PID controller.

Fig. 2. Equivalent PID controller.

c as shown in Fig. 2. Fig. 2. Equivalent PID controller. Fig. 3. Spherical tank. The

Fig. 3. Spherical tank.

The RLS tting method is applied to the input and out- put 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

v(t) = K p e + K i t e dt + K d

0

de

dt

:

(22)

The equation can be written in a matrix form as

v(t) = e

t e dt

0

de

dt

K p

K i

K

d

:

(23)

Eq. (23) can be written in the linear-in-the parameters form as

v(t) = (t) T ;

where

(t) =

K p

K i

K d

3008

K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011

et al. / Chemical Engineering Science 57 (2002) 3005–3011 Fig. 4. Simulation results (a) control signal

Fig. 4. Simulation results (a) control signal and (b) closed-loopperformance (1) PID-relay controller, (2) equivalent PID controller.

(1) PID-relay controller, (2) equivalent PID controller. Fig. 5. Simulation results (a) control signal (b)

Fig. 5. Simulation results (a) control signal (b) closed-loop performance at di erent operating level of the tank using the equivalent PID controller.

and

T = e

t e dt

0

de :

dt

The RLS algorithm with a time varying forgetting factor can be directly used here as v t and T are available, the update of (t) can be expressed as

(24)

(t) = (t 1) + K(t) (t);

where (t 1) refers to the controller settings identi ed during the last cycle, (t) and K(t) are the error signal and Kalman gain vector, where

(t) = v(t) T (t 1);

(25)

K(t) = P(t 1) ( I + T P(t 1) ) 1 ;

(26)

P(t)=(I K(t) T )P(t 1)= :

(27)

K. K. Tan et al. / Chemical Engineering Science 57 (2002) 3005–3011

3009

/ Chemical Engineering Science 57 (2002) 3005–3011 3009 Fig. 6. Closed-loopperformance under the in uence of

Fig. 6. Closed-loopperformance under the in uence of measurement noise.

under the in uence of measurement noise. Fig. 7. Closed-loopperformance based on a xed PID

Fig. 7. Closed-loopperformance based on a xed 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 P 0 = I , where is a large number (10 4 –10 6 ) and I is the identity matrix. (0) may be set to be the gains of the PID controller before tuning. The robust control con guration, comprising of the relay and the PID controller, puts a high gain in the loop and en-

sures satisfactory closed-loopperformance. Although it in- curs 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 iden- ti cation 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

et al. / Chemical Engineering Science 57 (2002) 3005–3011 Fig. 8. Comparison of closed-loop performance (1)

Fig. 8. Comparison of closed-loop performance (1) xed 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 con- troller 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-o the chat- tering 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 con- troller 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 uid in the classical spherical tank system. This uid 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 rst-order di erential equation

Q i (t) Q o = R 2 1 (R y) 2

R 2

dy

dt ;

where R is the radius of the spherical tank and the di erence between the in ow Q i and out ow Q o causes the water level y to rise or fall in a manner described by the nonlinear rst-order di erential equation above. Q i 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 topand the bottom of the tank, but slowest at the middle, as be ts intuition. The out ow

of the tank is dependent on the water level in line with the Bernoulli equation which states that the out ow of a tank is proportional to the square root of the height of the uid level:

Q o = c d 2g(y y o ):

In this simulation, the following parameters with respect to the spherical tank and the relay are selected; R = 1, c d = 1,

= 1, y o = 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 con- struct, 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-loopperformance based on the proposed equivalent PID controller, corresponding to dif- ferent operating level of the spherical tank. Three setpoint changes to di erent desired level are simulated, each fol- lowed 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 in uence of signi - cant measurement noise. The performance is compared to that achieved by a PID controller with xed 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 magni ed 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

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.

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 speci cation. 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 modi ed Lyapunov function. IEEE Transactions on Automatic Control., 45(1), 129–132.