Optimization method for PID controller design

Optimization method for PID controller design

Computers in Industry 16 (1991) 81-85 Elsevier 81 Short Note Optimization method for PID controller design Yang Yaguang, Jia Chenbing, Chen Jingpin...

284KB Sizes 3 Downloads 150 Views

Computers in Industry 16 (1991) 81-85 Elsevier

81

Short Note

Optimization method for PID controller design Yang Yaguang, Jia Chenbing, Chen Jingping and Lu Yongzai

Research Institute of Industrial Process Control, Zhejiang University, Hangzhou, China

An optimization method for PID controller design is delt with in this paper. In handling the design problem, the simplex method and Powelrs method in nonlinear programming are used under a flexible objective function that provides design options of closed-loop system response curves to meet various practical requirements. Numerical examples are given todemonstrate the design procedures.

Keywords: Optimization, Automatic control, PID controller.

present an optimization method to deal with this problem.

2. Design method A great deal of the transfer functions in a control plant can be formulated as

Y(s)

e

U(s---) = (T,s + 1)(T2s + 1)" 1. Introduction Although m o d e m control theory has been implemented in m a n y software packages for computer-aided design of control theory, the applications of this theory have been limited in scope due to the fact that state space models of realistic systems are seldom completely known [1]. Therefore, industrial control implementation in practice is still mostly composed of P I D controllers. Even for control-oriented computers developed in this decade, the main control function is also P I D control. However, only very few studies are conc e m e d with designing optimal P I D parameters [2]. In view of its wide use in practice, to develop a method which can optimize the P I D controller m a y be very important because in process control even a small improvement in yield can be quite significant economically [1]. In this paper, we will Elsevier Science Publishers B.V.

(1)

When single-loop regulation is considered, the block diagram is as shown in Fig. 1. In the case of cascade control implementation, the block diagram is shown in Fig. 2. To measure a system's performance, one of the most c o m m o n indices is the I T A E index. In the present paper a modified, flexible I T A E performance index is considered, namely 3

S= E ft, K(i) l e(t)lt i=1 ti-1

dt,

(2)

where the t~ are special points on the response curve, as shown in Fig. 3. Obviously, selecting different K ( i ) means putting different weights on response time tr, excessively regulated quantity Mp, and static error e(tf), which provides design options for closed-loop system response curves to meet various requirements. We will first focus on the single-loop regulation

82

ShortNote

Computersm Industry

p r o b l e m , b e c a u s e the m e t h o d can easily be generalized to the c a s c a d e P I D c o n t r o l scheme.

[-

~___~

L--__ __~ L_ . . _ ~

........

2.1. Single-loop control

i

Obviously, the p r o b l e m p r e s e n t e d here is a nonconstraint optimization problem:

Fig. 1. Block diagram of single-loop regulation.

I

3

S( Kp, TI, To), a n d in p a r t i c u l a r to calculate e( t ).

min S = min E ( t` K(i) l e ( t ) l t d t . Ko,TI'TD Kp'TI'TD i==l J't, 1

(3) Since e(t) is a n o n d i f f e r e n t i a b l e f u n c t i o n for Kp, T t a n d T o, one has to choose some n o n l i n e a r p r o g r a m m i n g a l g o r i t h m s w i t h o u t calculating derivatives. T h e simplex m e t h o d a n d Powell's m e t h o d therefore can be considered, the key p r o c e d u r e then being to calculate the p e r f o r m a n c e f u n c t i o n

In the following discussion, the n o t a t i o n used in the b l o c k - d i a g r a m s is a d o p t e d unless i n d i c a t e d otherwise. It is well k n o w n that the c a l c u l a t i n g f o r m u l a tion for a P I D c o n t r o l l e r can be written as

u(n)=u(n-1) + Kp e(n) - e(n - 1) + -~le(n) +-~-[e(n)-2e(n-1)+e(n-2)]},

(4)

Yang Yaguang is an instructor in the

Institute of Industrial Control at Zhejiang University. He received his BSc and MSc degrees in the Department of Automatical Control, Huazhong University of Science and Technology. His research interests are in optimal control, robust control, operations research, and their applications.

where T is the p e r i o d of d a t a sampling. T o a v o i d overflow which m a y occur if T t b e c o m e s zero in the search algorithm, let T [ = 1 / T v Then, the f u n c t i o n S( Kp, T I, TD) b e c o m e s S(Kp, TI', To). Introducing D = I N T ( T 3 / T ),

Jia Chenbing graduated from Zhejiang

University in 1989, with a Bachelor degree of Engineering. At present, he is an engineer at Suzhou Technical Trade Centre. His main interests are in optimizing, computer control, CAD and CAM, and computer management networks.

where I N T ( . ) r e p r e s e n t s the m a x i m a l integer which does n o t exceed the value in b r a c k e t s , the lag b l o c k c a n be s i m u l a t e d as a d a t a shift register as shown in Fig. 4. C o n s i d e r i n g the state s p a c e e q u a t i o n

2 = Ax + Bu,

--

Professor Yoag-zai Im is currently Director of the Research Institute of Industrial Process Control, Zhejiang University, Hangzhou, P.R. China. He is Council Member of the International Federation of Automatic Control (IFAC) and Vice President of the Chinese Association of Automation). He has published more than 100 academic papers and five technical (or text) books; one monograph was published by the Instrument Society of

-America. His present research interests include process modelling and optimization, hierarchical computer control, intelligent control and decision, as well as the applications of artificial neural network in systems control. He received UOP Technical Award in 1989 due to his outstanding contributions on applications of expert systems in industrial process control.

(6)

where u is the i n p u t function, the s o l u t i o n is

x( t ) = eAtx(O) + for eA(t-~)Bu( r ) d'r. -

(5)

(7)

D i s c r e t i z a t i o n of eqn. (7) gives

=eAYx(KT")+ [fo?emi'-¢)B d.r]u(KT" ) + [ f 0 f r e a ( Y - " B d r ] ~(KT~),

(8)

where 7~ is the c o m p u t i n g time step. Let e A¢ = q~(7~),

fo i" eA'i'-')B d'r = t~m(T),

(9) (10)

Computers in Industry

Yang Yaguang et al. / Optimization of PID controller

R



%

u2

oi

x3

x2

83

x~

Fig. 2. Blockdiagram of cascadecontrol.

roTOreA(r-')B d r = ~ r n ( T ) ,

(11)

Noticing that (22)

e(t) = r(t) - x](t),

then x ( ( g + 1 ) T ) = ~?(7")x( K T ) + ~ m ( / ~ ) u ( g T )

+ ~m(/~) ~(K/~).

(12)

Applied to the first inertial block, its state space equation is (13)

Yc = - Tlx + u 1,

therefore, ~2(/~) = e- ¢/r2,

(14)

ep2,,(T ) = 1 - e - t / r 2 ,

(15)

~2m(7~) = - T2 + T2 e -¢'/r2 + T,

(16)

Xz((K+

1)7~ ) = ~2(7~)XE(K7~)

+ q)2m(7~) u,(K7~) + ~2m(7~) z)I(KT~).

, , ( 7 ~) = e - v T ' ,

(18)

.1m(7 ~ ) = 1 - e -~/r',

(19)

6~m(/~) = - T 1 + T1 e -~/r' +/~,

(20)

(Kt)

+ 41m(~P).X2( K T ) .

(4) If 1= m and K1~-- t3, goto the next step; if 1= m but K T < t3, go back to Step 2; otherwise (l < m), go back to Step 3. (5) Compute e ( t ) and the objective function S from (3) and return to the main program (simplex method or Powell's method). 2.2. Cascade control

1)/~) = , l ( / ~ ) X l ( K / ~ ) + ~blm(T)x2

Subroutine 1 (1) Suppose that Kp, T I, T D and t 3 are given parameters from the main program. (2) Calculate e ( t ) from (22), u ( t ) from (4) and u] by shifting data in the specified memory register, and let 1 = 1. (3) Compute x2(K7~) from (17) and X l ( K T ) from

(21). (17)

The next inertial block can be calculated similarly:

xl((K+

the modified ITAE performance index can easily be calculated from eqn. (3). Let m = INT(T//~), then the above discussion may be summarized as the following subroutine used in the simplex method or Powell's method to calculate the objective function.

(21)

In the case of cascade PID control implementation, one can easily write the corresponding subroutine by utilizing a similar method.

Xl

I

l

D

/ I I

I I

Fig. 3. Typicalresponsecurve.

- t

,,n,. I I I ........

A

\

I

I

KL__V

o'0'

Fig. 4. Time lag simulatedby means of a data shift register.

84

( ?ompulers in Industry

Short Note

Subroutine 2 (1) Suppose that Kpl, Kp2, T n, Tl2, To1, To2 and t 3 are given parameters from the main program, where K w, Tii, Toi (i = 1, 2) are P I D parameters of the two regulators. (2) Calculate u3(t ) f r o m (4). Then compute e 2 = u 3 - x 3 and u 2 from (4). (3) Obtain u 1 by shifting data in the specified memory register, and let l] = 1. (4) Calculate x 3 from (17). (5) If l I = m I go to the next step; otherwise go to Step 4. (6) Compute x 2 by moving data in the specified memory register and let / 2 = 1. (7) If l z = m 2 go to the next step, otherwise go to Step 6. (8) Calculate e(t) from (22) and the objective function S ( K p l , Kp2, T n, Tl2, TDI, T D 2 ) f r o m

(2). (9) If K T < t 3, go back to Step 2; otherwise return to the main program.

Table 1 Simulation results of the cascade regulator K(1)

K(2)

K(3)

tr(s)

Mp

e(4)

1 1 1.5 0.5

1 0.5 0.5 1.5

1 1.5 1 1

0.2 0.2 0.17 0.35

0.031 0.1404 0.01713 0.0029

0.000343 0.00542 0.00313 0.0290

For Case 1, K(1) = K(2) = K(3) = 1, the corresponding results are t r = 0.74 s, Mp = 0.03055, e ( t f ) = e(4) = 0.003. In Case 2, taking K(1) = 1.5, K(2) = 0.5, K(3) = 1 , we get t r = 0 . 5 5 s, M p = 0 . 1 3 , [e(4) l = 0.0026, which means that we can improve response time performance by sacrificing the excessively regulated quantity index if needed. For Case 3, K ( 1 ) = 0.5, K ( 2 ) = 1.5, K ( 3 ) = 1, the simulation result shows t r = 0 . 9 s, M p = 0.00018, le(4) l = 0.0018, which implies that we can also improve the excessive regulation performance by reducing other requirements if required. Therefore, the objective function is very flexible.

3. Numerical examples

Example 2 Example 1 Suppose that Suppose that the transfer function of a control plant is given by

Y( s ) o(s)

=

-

u(s)

=

e -°'15~ (0.5s + 1)(0.4s + 1)"

In order to find the optimal P I D parameters for a single-loop regulator, we have used both the simplex method and Powell's method for this problem. Three cases were studied for various values of the K(i). The results are shown in Fig. 5.

e-0.1Se- 0.1s

G(s) = (0.4s + 1)(0.5s + 1)" Using the cascade P I D control scheme, we get the results shown in Table 1. Comparing with the single-loop regulation, one can easily see that even though the lag is worse in the latter problem, the control results are more satisfying because the cascade P I D controller has more design degrees of freedom.

~q case 1 case 2

4. Conclusion

~'

Fig. 5. Simulation results of the single-loop regulator. Case 1: base run. Case 2: improved response time (at the expense of more excessive regulation). Case 3: less excessive regulation (at the expense of a slower response).

To design an optimal P I D controller is certainly a very significant task in the view of practical application. Both programs for the simplex method and Powell's method are worked out. Simulation experience shows that Powell's method is much more effective than the simplex method because the computing time usually does not depend on the selection of the initial points. Since most control-oriented computers are loaded with computer languages such as Fortran and Basic,

Computers in Industry

i n f o r m a t i o n can be exchanged b e t w e e n the P I D algorithm loaded i n these c o m p u t e r s a n d other algorithms. This m e t h o d therefore is p e r h a p s endowed with widespread value to real applications.

References [1] K.J. Astrom, et al., Challenges to control: A collective view, IEEE Trans. Autom. Control, Vol. AC-32, 1987, pp. 275-285.

Yang Yaguang et al. / Optimization of PID controller

85

[2] M.L. Stefano, Optimal design of PID regulators, Int. J. Control, Vol. 33, No. 4, 1981, pp. 601-616. [3] Himmelblau, Applied Nonlinear Programming, The University of Texas, Austin, TX, 1972. [4] M.J.D. Powell, An efficient method for finding the minimum of a function of several variables without calculating derivatives, Comput. J. , Vol. 7, 1964, pp. 155-162.