Pergamon
Automatica, Vol. 30, No.ll, pp. 1649-1662, 1994 Copyright ~) 1994 Elsevier Science Ltd Printed in Great Britain. All rights reserved 0005-1098/94 $7.00+ 0.00
0005-1098(94)E0004-2
Automatic Initialization of a Robust Self-tuning Controller* M. L U N D H t and K. J. ASTROM:[:
Relay feedback can be used to initialize adaptive controllers; it admits determination o f the sampling period, suitable specifications and initial values o f parameter estimates. Key Wm~ls--Automatic tuning; adaptive control; self-tuning control; robust control; initialization; pretuning; dead-time compensation.
controller properly. The method can be applied to systems that can be adequately described by models of at most third-order dynamics and a time delay. The paper is organized as follows: a prototype self-tuning controller is described in Section 2. This controller is based on a pole placement design which is modified to improve its robustness. Relay feedback is discussed in Section 3. In Section 4, it is shown how information from an experiment with relay feedback can be used to determine the design parameters required to start the self-tuning controller. Particular attention is given to the choice of control performance. An initialization procedure is described in Section 5 and examples of its use are given in Section 6. An Appendix lists a batch of test processes that were used for validation of the initialization procedure.
Almratt~'l'his paper describes a method for automatically initializing a self-tuning controller. The procedure can be used for systems that are adequately described by models of at most third-order with time delay. For this class of systems it gives a self-tuner that can be initialized simply by pushing a button. 1. INTRODUCTION
TECHNIQUES have been used industrially since the late 1970s. Much has been learned about operational issues over that period. Although self-tuning controllers have the potential to give excellent performance, it has been observed that self-tuning controllers may also be difficult to commission. The reason for this is that self-tuning controllers contain a number of design parameters that have to be chosen by the user. It has been attempted to introduce various pretuning schemes that give the required parameters. The most extensive use of adaptive techniques have therefore been in connection with simple controllers of the PID type (Astrt~m and H~gglund, 1988a; Kraus and Myron, 1984; Hoopes et al., 1983). These controllers have been developed to the stage where tuning is initialized simply by pushing a button. The purpose of this paper is to develop initialization procedures that make a more general self-tuning controller as easy to use as the simple controllers. The key idea is to use an experiment with relay feedback to obtain the information required to start a self-tuning ADAPTIVE
2. THE SELF-TUNING CONTROLLER
The structure of self-tuning controllers is quite well known. (See AstrSm and Wittenmark, 1989.) In this paper we consider indirect discrete-time controllers based on the estimation of a discrete-time model of the type
B(z)
H(z) = A(z)'
(1)
where
A(z) : zd(z n + alz n-1 + ' ' " +an), n(z)
*Received 12 May 1992; revised 23 February 1993; received in final form 30 November 1993. This paper was not presented at any IFAC meeting. This paper was recommended for publication in revised form by Associate Editor A. M. Annaswamy under the direction of Editor C. C. Hang. Corresponding author K. J. AstrOm. Tel. +46 46 108781; Fax +46 46 138118; E-mail
[email protected]. ? ABB Industrial Systems AB, S-721 67 V~ter~s, Sweden. ~tDepartment of Automatica Control, Lund Institute of Technology, Box 118, S-221 00 Lund, Sweden.
= b o z m + b l Z m - a + " " • + bin.
Parameter n is assumed to be less than 4. The sampling interval will be chosen such that d - 5. To have a proper model (1), it is furthermore required that m - < d +n. The reason for restricting the model order is the restricted information about the system that is obtained from the experiment with relay feedback. 1649
1650
M. LUNDHand K. J. ASTROM
Notice, however, that the model class includes many systems that are often encountered in practice. Some examples are: stable systems with real poles; oscillatory systems with two complex poles; and systems with non-minimum phase zeros. Specific examples are given in the Appendix. 2.1. Controller design The controller is specified by requiring that the closed-loop pulse-transfer function relating output to setpoint is given by
B(z) A,,,(1) Hm(Z)-Am(Z ) B ( 1 ) '
(2)
where A,, has the same degree as A. The process zeros are thus retained in the closed-loop system. The controller is linear with a two-degree-offreedom structure. It is described by
R(q)u(k) = T(q)ysp(k) - S(q)y(k),
where Q = N/z aegN. The polynomial N can be used to improve the robustness of the feedback law. In Lundh (1991) it is shOwn how to choose N to achieve various robustness criteria. The calculations to do this are too complicated to do on-line in an adaptive algorithm. There are, however, some simple choices that lead to controllers with significantly improved performance. First N is chosen so that z - 1 is a factor of R. This means that controller gain at low frequencies is infinite, i.e. integral action. To have a controller that is robust with respect to high frequency modeling errors we also require that z + 1 is a factor of S. This means that the controller has good high frequency roll-off. The gain at the Nyquist frequency is zero. A simple example illustrates the benefits of the design procedure.
Example 1. The process
(3)
B(z) A(z)
where R and S are a solution to the Diophantine equation
A(z)R(z) + B(z)S(z) = Ao(Z)Am(Z)
(4)
and
T(z ) = Am(ll ) mo(z ).
()
There exists a solution to (4) that gives a casual controller if A and B are relatively prime and if A0 and A,, are of the same degree as A (,/kstriSm and Wittenmark, 1990). The characteristic polynomial of the closed-loop system is AoA,,, where Ao can be interpreted as the observer polynomial. The polynomials Ao and Am are design parameters. They are chosen to have the same structure as A, i.e. of degree n + d with d zeros at the origin. The remaining factors are chosen to be discrete-time equivalents of S+Wo,
for
n=l
s 2 + V2o~oS + o~, for n = 2 (S + Wo)(Sz + V2oJos + oJz), for n = 3 where too is a design parameter. An additional parameter can be introduced to allow different ~Ooin the polynomials Ao and Am. 2.2. Robust control There are many controllers that give a closed-loop characteristic equation with the desired properties. If one controller Ro, So, satisfying (4) is found, another controller is given by the Youla factorization
R=Ro+QB, S=So-QA,
1 Zd(Z--0.8)
(5)
is controlled with an integrating controller. This means that the denominator of the controller has the structure R ( z ) = R ' ( z ) ( z - 1). The numerator is chosen to have k zeros at z = - 1 , hence S(z) = S'(z)(z + 1)k. The closed-loop characteristic polynomial is specified as
Ao(z)A,,(z)
= z2d(z
--
p)Z
(6)
with 0 - p < 1. The controller is obtained from the solution to (4). The freedom Q is used to give S the desired zeros. The controller obtained will be unstable for small p. Table 1 shows how fast the pole p can be chosen for different delays d to give a stable controller. A controller with k zeros at z = - 1 is stable for p---p,. The last three columns of Table 1 show Pk for k = 1, 2, 3. For processes with small delays d, the pole p can be chosen faster when the controller has zero in z = - 1 compared with a controller without such a zero. The difference is, however, small for large delays. Controller stability is not the only reason for introducing zeros at z = - 1 in the controller. A TABLE 1. LOWER BOUND Pk OF POLEp FOR 0 ~ k ~ 2 CONTROLLER ZEROS IN z = - I THAT GIVES A STABLE CONTROLLER
d
Po
Pl
P2
1 2 3 4 5
0.40 0.46 0.52 0.56 0.58
0.06 0.37 0.47 0.53 0.57
0.00 0.31 0.45 0.52 0.56
Automatic initialization of a self-tuner 10 o ................. .................
i
i
i
i .......... ~.......... :
i ....... i ..... i..-.i....i..-:-~ .. . . . . . . . . . . . . . . . . . . :. . . . . . . . . . . ; ....... ; ..... ;....; ~...-.,7....;..._,--...-.~------ . . . . . . . . :. . . . . . . . . . . : : " : :..: : : ."..-... .':.-, .:. . . . . . . . . .
r ....... ~..... i....~.--~-.~..~., . . . . . . . , . . . . . ~....;...;...:...;.. : . . . . . " . . . . . ~.. ~ L . . ' . . ~ .
!
!
:
:
...........................................
10-1
..................................... .................
i
i
i
!
:
i
i
i
~ !
,
:
".
:~
~....i....i..•~...~...i . . . . . . . . . . . . . . . . . . . . .
'. .....
~.""" "~' '" ':' "" ~"" ":"" ~.....................
!
i
.....................................
!
!
i
i
i
!
! . . . . . !" " " ! " " i " " !' " ? "i . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
~ .......
~.......... :
~
10-2
:
:
;
:
:
:
i
i
i
i
i
i
i
Normalized
FIG.
1.
Noise
sensitivity
S~n(e i~) line).
for
controllers
Notice
the
with difference
controller with such a zero has low gain at high frequencies. This gives low sensitivity to high frequency measurement noise. Figure 1 shows the noise sensitivity for different k. Consider the process (5) with delay d = 2. The closed-loop characteristic polynomial (6) is defined by p = 0.6. The magnitudes of the transfer functions en(z) =
A(z)S(z) A ( z ) R ( z ) + B(z)S(z)
are shown for k-= 0 (solid line), k = 1 (dashed line) and k = 2 (dotted line). The magnitude of ,~Fn(ei'h) decreases with increasing k. From Table 1 it follows that the controllers are stable for these three k. It should also be noticed that the sensitivity functions eo(Z) =
: .....
:i
A(z)R(z) A(z)R(z) + B(z)S(z)
are close for the three cases. This means that the disturbance rejection properties are similar. Analogous behavior of ~cFn(ei°~h) and of ~CFo(ei~h) have been observed for many processes. [] The example has demonstrated some benefits of having a low controller gain at high frequencies. The interval with low gain may be enlarged by introducing more zeros in the controller. This will not be pursued here. 2.3. Parameter estimation In the self-tuning controller the parameters of the model (1) are estimated recursively and the
in high
:
w
:
U"
i. . . . . . ! " " " ! " ' ! ' " ? " ! ' " i
i
i
i
i
i
i, .....~ . . ~ . . . ~ . . . i . . L . :
:
:
:
;
i
i
i
i
i
: i
10 ~
Frequency
k = 0 (solid
:
.'"":'"~"':'"
10 0
10-~
i
i' ':': . . . . . . . i. . . . . . ? ' " ' ! ' " ' i ' " ! " !
.....................................~ ....."~-," : ..:..: ' .............................~ ......... :
:
i
~ ..... i-..-~..-i...~..~--
" .........
~. . . . . . . ! . . . . . !" " " ! ' " " "i'" '!" "'!'"i . . . . . . . . . . . . . . . . . . . . . . . . . . . i
:
i
: . . . . . ~...:- . . . . . . . i. . . . . . i . - . . ~ . . . i . . . i . . ~
~. . . . . . . . . .
!
i
:
: . . . . . :..; .. i. -..i. • ,~...i...i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
' ..................
..................
i
1651
[rad]
line), frequency
k = 1 (dashed
line),
and
k = 2 (dotted
roll-off.
parameters of the controller (3) are computed replacing A and B in (4) by their estimates. The control signal is then computed from (3). Recursive least squares (Ljung and SOderstrt~m, 1983) are used for the estimation. There are several parameters in the parameter estimator that also have to be chosen. 2.3.1. Initialization. The recursive leastsquares estimator has the estimates, their covariances and the regression vector as states. They must be initialized properly before starting adaptation. 2.3.2. Regression filters. It is important to filter the input-output data before sending them to the estimator. This is done by the regression filter which should have bandpass character. It is chosen as the sampled version of s~o} Gr(s) = (s + tor/a)(s 2 + 1.4ators + (awl)2)" The pass band of the filter determines the frequency range where it is desired to have a good fit. To obtain a robust controller it is important that the frequency response of the estimated model is accurate in the frequency range where the Nyquist curve for the loop-transfer function is close to - 1 . Since controllers with significant phase lead are undesirable, as will be discussed later, we assume that the loop-transfer function has -180 ° phase shift at approximately the frequency to180 where the open-loop process has a phase shift of -180 °. Thus the frequency tor could be related to to~80.
1652
M. LUNDHand K. J. ASTROM
The values toi=0.75w~s 0 and a=X/]-0 are reasonable choices. 2.3.3. Forgetting factor. Discounting of old data is essential in adaptive algorithms. It is known, however, that discounting may cause some problems (AstrtJm and Wittenmark, 1989). There are many ways to do the discounting. The particular choice depends on the nature of the parameter variations. Ultimately it would be desirable to let the algorithm explore this itself. Good ways to do this have not been investigated in this paper.
function for a system with a monotone step response. The estimates of k / T and L are often good even for high-order systems. The estimate of T may however be unreliable. A better estimate is obtained by first determining L and then computing T using the phase shift of (7) at O~o~c,i.e.
2.4. Design parameters With the choices discussed above, the design parameters of the controller have been reduced to • w0--pole distance from the origin • h--sampling period • m, n and d--model structure • 0(0)--initial estimates • P(0)--initial covariance.
The slope of the amplitude curve at frequencies larger than 1/V--TIT2 can be used to discriminate this model from (7). The following procedure is another alternative to determine the response time. Let r be the difference between the times where the limit cycle and its derivative have their extrema. It follows that r = 0 for the model (7). By straightforward, but tedious calculations (Lundh, 1991), it can be shown that
Wo~¢L+ arctan ~OosCT= - a r g G(ioJo~). A slightly more general model is
e-SL G(s) = k (1 + sT0(1 + sT2)"
3. RELAY FEEDBACK
It will now be shown that the design parameters can be determined from an experiment with relay feedback. For a large class of processes there will be a symmetric limit cycle oscillation. There are approximate and exact methods to determine the amplitude and the period of the oscillation (see Tsypkin (1984)). The amplitude and the period of the oscillation gives approximately the frequency oJ18o, where the process has a phase lag of 180°. In Holmberg (1991) it is shown that convergence to the limit cycle is very fast for low-order systems. It is also shown that very complicated behavior can be obtained with systems having poorly damped poles. The method is therefore restricted to certain classes of systems.
3.1. Using the waveform It is possible to extract more information from the results of the relay experiment by analyzing the waveform. Dominant oscillatory poles manifest themselves in an oscillatory waveform. In/~str0m and H~gglund (1988b) and H~igglund and/kstr0m (1991) it is shown how the transfer function
e-SL G(s) = k
1 +sT
(7)
can be computed from the samples of the waveform at three points. Parameter L can be estimated independently from the time where the peak occurs. The model given by (7) is often used as an approximation of the transfer
(8)
(9)
logT1
~= T I T ~ T~-L
for the model (9). Notice that r ~ T1 if T2---~T~. For a system with the transfer function
e-SL G(s) = k (1 + dT)"'
(10)
it can be shown that T increases with n. For n = 3 we have approximately r = 1.5T. We will later use T to estimate T in (10) for n = 2 and n = 3. 3.2. Frequency domain information When there exists a stable limit cycle under relay feedback, the input to the process is a square wave with frequency components at ~oo~¢, 3tOo~, 5oJo~ etc. The values of the transfer function at those frequencies can be determined by frequency response analysis. Introduce the normalized frequencies
f~m = OJos~mh. This corresponds to choosing the sampling period as the time unit. Let the signals u(k) and y(k) be defined at k = 1, 2 . . . . , N. The discrete Fourier transforms 1
N
UN(am) = - ~ k~,=' u(k )e -itamk, 1 N YN(f~,,,) = - ~ k~=;y(k )e -i"mk are calculated for m = 1, 3 . . . . .
The frequency
Automatic initialization of a self-tuner response estimate is then YN(nm) /~(e'n") - UN(n,,)" To illustrate the accuracy of the estimates assume that the process is described by
y(k) = H(q)u(k) + v(k),
where tr2 is the variance of the measurement noise and y~ax is the oscillation amplitude. 3.3. Estimation of slope The slope of the transfer function of the crossover frequency is of interest to discriminate between different models. The slope at the frequency f~ = X/-~,,,f~m2 is given by (13)
For the process (11), the estimate (13) is unbiased with variance Var [a] ~ ( t ~ ' ) 2 Var [I/q(¢nm')l] + (~-)2 Var [I/~(e'n-01],
(14)
where tt" is the first derivative of a with respect to I/~(e~)l. An example illustrates the accuracy of the estimate that can be expected.
Example 2. Consider a relay experiment over N -- 200 samples. Assume that the signal to noise ratio is ymax/Cr= 10. Table 2 shows the standard deviation of the estimates of the slope ti for different local n. The standard deviation increases fast with increasing frequency and increasing order of the process. Both these
TABLE 2. STANDARD DEVIATION OF SLOPE IN EXAMPLE 2 n
mI
m2
orn
1
1 1 3
3 5 5
0.12 0.22 0.74
2
1 1 3
3 5 5
0.35 1.10 3.54
3
1 1 3
3 5 5
1.04 5.49 17.45
effects are due to the fact that the magnitude of the open-loop frequency response decreases with frequency. [] The example shows that the slope can be determined reasonably well at frequency Wo~X/3 for first-, second- and third-order systems.
(11)
where v(k) is white noise with zero mean and with variance tr 2. Assuming that the oscillation is dominated by the first harmonic, it was shown in Lundh (1991) that the variance of the estimate satisfies Var[/q(einm)] 4 ( o" ~2 ]H(ein,)[2 = ~ \ y - ~ / m E, (12)
r7 = log I/~(einm,)t - log I/~(ein'2)l log (m0 - log (m2)
1653
4. FINDING DESIGN PARAMETERS In Section 2 it was shown that the self-tuning controller can be described by a few design parameters. It will now be shown how these parameters can be determined. 4.1. Model order The model order can be determined by analyzing the higher harmonics of the limit cycle. The slope of the amplitude curve is estimated using equation (13). Only values n = 1, 2 or 3 are expected. If ti is the slope obtained from (13), the order n is then chosen as follows:
n=
1, if~ <1.3 2, i f l . 3 ~ < 2 . 1 . 3, if 2 . 1 ~
(15)
The interval boundaries have been adjusted empirically. 4.2. Desired closed-loop poles The pattern of the closed-loop poles is determined by parameters d and n. The numerical values are given by parameter too, which is the distance of the poles from the origin. This parameter is critical; its choice depends on the properties of the plant. It is well known that too large a value gives a system that is extremely sensitive to parameter variations (see Lilja (1989)). Similarly, too low a value may give controllers with positive feedback. Intuitively one can expect that a reasonable bandwidth w0 would be related to the oscillation frequency COos¢.To find out if such an assumption is reasonable the design procedure described in Section 2 was applied to many processes with different parameters, see the Appendix. The value of the design parameter Wo was increased until the sensitivity reached the value 2. The relation between parameter w0 and wo,¢ was then investigated and we found the result illustrated in Fig. 2. This figure shows that the ratio Wo/~Oo~ depends critically on the dimensionless quantity wonT. The equation _
wo = 0 . 5 +
1
+0.12
(16)
is a reasonable approximation to the data in Fig. 2.
1654
/~STROM
M. LUNDH and K. J.
.
i
.
.
.
.
.
.
.
.
.
.
.
.
.
".
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
" .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
" .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
' .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
t
..............i ..............................i...............i...............i...............i............................ tOQ 0~08C
0
0
i
i
0.5
1
1.5
2
2.5
3
3.5
4
1/(tOoscT)
FIo. 2. Relation (16) between tOo and tOo~. Empirical results for processes GI(+), G7(°) and GI2(*) in the Appendix.
The dynamics is dead-time dominated if tom T is small and lag dominated if t o ~ T is large. Figure 2 shows that the ratio to0/too~ is approximately 0.5 for lag dominated processes but that it can be much larger for dead-time dominated processes. The values of too~ T for the examples in the Appendix are given in Table A.1. This table shows that the value is in the range 1-2.5 in most cases. Figure 2 then implies that the ratio to0/tom is in the range 1-1.5. The large values of the ratio occurs for the processes which are strongly dead-time dominated. For such systems it is possible to use significantly larger values of the ratio to0/too~. The systems obtained will then have a closed-loop step response that is characterized by a time delay and a rapidly rising response, where the rise time is governed by tOo. For processes with large relative delays the response to command signals and load disturbances are limited by the time delay. There is some benefit in reducing the rise time. The effect is marginal when the rise time is an order of magnitude smaller than the dead time. For first-order systems this corresponds to tooL = 10. This means that tOo/tO18o~ 10/re. It is therefore reasonable to limit the ratio tOo/tOlaoto 4. 4.3. Sampling interval The sampling period is nominally chosen to give tooh = 0.3, 0.5 and 0.7 for first-, second- and third-order processes, respectively. The condition L - 4h is then checked and the sampling
period is increased if necessary. This is done in order not to have unduly fast sampling for dead-time dominated processes. 4.4. Model structure To determine the delay d and the degree m, we start by a least-squares estimation of the parameters in the model B ~ z -1) _ bolZ -~ + bo2z-2 _1_ . . . " b bo,,~z-m, A~;(Z -1) 1 + aolz-1 + ao~z-2 + . . . + aonz-n' (17) where n is obtained from (15) and m d > n q- L/h. The signals u(k) and y(k) that are used for the estimation are obtained by interpolating the signals from the experiment with relay feedback. For a process with time delay, leading coefficients in the numerator of (17) are expected to be insignificant. To determine the delay d we search for significant coefficients in
B~. Here we will suggest a two-step method that has been found to work well for all processes in the Appendix in connection with signals from an experiment with relay feedback. The delay d is first determined for m = n. This choice of m and the delay d obtained may be modified in the second step. The delay is determined as the integer d that maximizes m+d
J(d) = ~ i=d
[boil,
(18)
Automatic initialization of a self-tuner where boi are the estimated coefficients in the numerator of (17). The significant coefficients in B* are the m consecutive b0is with dominating absolute values. In the second step we investigate if the choice m = n is appropriate. Ideally we would expect that the leading coefficients Ib0kl, with k < d are small compared to the largest Iboil, with d <- i -~ d + m. A leading coefficient is considered as small if it satisfies
Ibokl
k
d<-i<-d+m.
(19)
Simulations have shown that r = 0 . 5 is a reasonable value. If (19) is not satisfied for some indices k, the choice of d and m is modified as follows. Let kl be the smallest index for which (19) is violated. The delay is then decreased to d = kt and the degree m is increased by the same amount to keep the quantity d + m constant. 5. AN INITIALIZATION P R O C E D U R E
A procedure for automatic initilization of the self-tuning controller will now be given. From an operational point of view the algorithm is similar to the procedure given in/~str~Sm and H~igglund (1988a) for tuning a PID controller using relay feedback. The procedure has the following steps: Step 1. Bring the process output close to the desired operating value by manual control and wait for stationarity. Estimate the noise level and determine the hysteresis and the amplitude of the relay. Step 2. Introduce relay feedback. Measure process input and output. Stop the experiment after 2-3 periods of a stable limit cycle. Step 3. Determine the period of oscillation tOo~c. Estimate the slope of the amplitude curve from equation (13) and determine the order of the process model. Step 4. Determine the times when the limit cycle and its derivative have their extrema. Estimate the parameters T and L. Step 5. Determine too from equation (16). Limit ¢ao/Calso to 4. Step 6. Determine sampling interval h, delay d, and degree m as was discussed in Section 4.
--v
-1 0
Step 7. Initialize the recursive estimator with parameters computed from n, L, T and h. Run the estimator with the data from Step 2. When evaluating the initialization procedure we have chosen an input signal in the form of a square wave to excite the system during the tuning phase for the self-tuning controller. 6. EXAMPLES
Part of the heuristics for determining the design parameters, like Fig. 2, were based on simple models. To determine the validity of the approach the initialization procedure was tested on a large test batch described in the Appendix. Since the procedure is based on relay feedback it will only work for systems where stable limit cycles are obtained under relay feedback. Extensive experience indicates that this occurs for a wide variety of processes that are encountered in industry, see H~igglund and AstriSm (1991). There are, however, systems where a stable limit cycle is not obtained. The double integrator is a simple example. There are also systems that may give a very complicated behavior under relay feedback. Unstable oscillatory systems with low damping and time delays are such cases (see Holmberg (1991)). The procedure in Section 5 is illustrated by some examples.
6.1. A second-order process with time delay Consider a process with the transfer function 1 GA(S) : --' (S-------~ + 1) e-2~'
i......................C
i
i
10
(20)
where white noise with standard deviation o'n = 0.05 is added to the output. This example could represent a typical process control situation where the dynamics are dead-time dominated. Figure 3 shows the process input (dotted line) and the process output (solid line) during the relay experiment. The oscillation frequency is too~ = 0.71 rad s -~. The slope of the frequency response was estimated as fi = 1.32 for to = ~ tom which gives n = 2. The time constant of (10) is estimated to T = r = 1.08 s. Equation
i....... ...............E
5
1655
15
...................
20
FIG. 3. Processinput and output during relay experiment.
25
1656
M. LUNDHand K. J. /~STRt3M
I
0
-1 0
"~
10
20
30
40
50
60
10
20
30
40
50
60
0
-2 0
FIG. 4. Self-tuning control of a process with transfer function GA(s)----(1/(s + 1)2)e -z~.
(16) gives too = 1.42 rad s-L The sampling interval is chosen subject to the condition L---4h. This gives oJ0h = 0.71. The delay of the discrete-time process model is then estimated to be d = 5 and m = 2. Figure 4 shows a simulation where the process is controlled by a self-tuning controller. Table 3 shows the parameters after the initialization procedure (t = 0) and after 67 s of self-tuning control. For comparison, the true parameters of the process are also given. The estimated parameters at t = 0 and at t = 67 s do not differ much. The estimated parameters deviate somewhat from the true parameters 0t~e. The main reason for this deviation is insufficient excitation. In spite of this, the loop transfer function based on the estimated model 0(67) and the looptransfer function based on the true process 0t,~e do not differ much. The Nyquist curves of the corresponding loop transfer functions are shown in Fig. 5. The same eighth-order controller Gin(z), calculated from the model 0(67) is used for both curves. The curves are adjacent at ¢o,,~, which means that the estimate is good in the critical region. The robustness margin is satisfactory since the loop-transfer function is far T A B L E 3. T R U E A N D ESTIMATED P A R A M E T E R S OF THE M O D E L
(1) al
a2
bo
b~
b2
0(0) 0(67)
-1.0850 -1.1073
0.2736 0.2875
0.1233 0.1057
0.0317 0.0463
0.0308 0.0282
0true
-1.2198
0.3720
0.0819
0.0702
0.0001
2
i 7 7 .....!......i. i
0.5 0 -0.5 -1
i
i
i
:
i
!
i
-1.5 -2 -2
-1.5
-1
l
i
-0.5
0.5
i
i
1.5
2
Re FiG. 5. Nyquist plot of the loop transfer functions based on the estimated process model 0(67) (solid line) and on the true process 0t~e (dashed line). The frequencies too~ and 3roost are marked.
from - 1 . Notice that the sensitivity of the closed-loop system is slightly larger than 2 although the specifications for this system were chosen to give a sensitivity of 2. This is due to parameter errors. 6.1.1. Comparison w i t h PID-control. The controller GRI(Z) is compared with two other controllers to assess the quality of this self-tuning design method: • The PI controller GR2(s) is tuned automatically using a method that is recommended for
Automatic initialization of a self-tuner
• • •'P I
b~
1657
...... ............
..,-'" ..... . .............
,.'"
"'''"
t .," I.'
0.5
/ J
0
0
, 5
, 10
""'"
1'5
20
25
, 30
i
m
tiine [s] 35
40
!
2 •
,..-"
1.5 1
o..
/ 0.5 :.""" 00
.................
I
5
I0
1
I
15
I
20
3'0
tithe Is] 35
40
l~o. 6. Comparison between different tuning methods. Simulation using the controller Gm (solid line), the PI controller GR2 (dotted line), and the PID controller GR3 (dashed line).
processes with long time delays (H~igglund and Astr~m, 1991). We have K = 0.25/IGA (ia~o~)l = 0.34 and T~ = 1.6/~oo~ = 2.27. • The PID controller GR3(s) is determined using dominant pole design (Persson, 1992). This method gives a very well tuned PID controller with K = 0.58, T~ = 2.21 and To = 0.56. Figure 6 shows simulations where the process GA is controlled with these fixed controllers. An input load disturbance affects the process at t = 20s. The behavior of the system for the controller Gm is satisfactory. The response for the controller GR2 is very slow. This example is a typical case where PI and PID controllers can be outperformed by more complicated controllers like Smith Predictors. The controller we have designed will provide dead-time compensation. The example illustrates that the design rules will identify that the dynamics is dead-time dominated and they will automatically select a controller that gives dead-time compensation. 6.1.2. Influence of sampling interval. The controller Gm is compared with two other controllers to demonstrate different choices of sampling interval. The other controllers are obtained by similar initialization procedures followed by self-tuning control for 67 s. • The
sampling
interval
is chosen
as h =
ToJ26 = 0.34 s for the controller GR4(Z). This sampling interval was initially proposed above to meet oJoh <-0.5. It gives o~oh = 0.49. The
delay is d = 7 and the controller GR4 is of tenth-order. • The sampling interval is h = ToJ 6 = 1.48 s for the controller GRs(Z). This is very slow sampling since tooh = 2.12. The control strategy resembles dead-beat since the closed-loop poles are close to the origin. This controller is of fifth-order. Figure 7 shows simulations where the process GA is controlled with the controllers Gin, GR4 and GRs. The sampled signals are shown in order to emphasize the effects of sampling. The responses to the reference input are close for all three controllers. For the load disturbance, the responses for Gm and GR4 are similar, but the response for GR5 is slower. The reason for this slow response is that the disturbance is not detected so fast with a long sampling interval. Such a performance degradation can be avoided with a shorter sampling interval. An even shorter sampling interval, as for GR4, improves performance very little. This illustrates that it is sound practice to bound the number of samples per dead time to 4 or 5. 6.2. A benchmark problem One of the processes in the test batch has been used as a benchmark problem for adaptive control strategies (M'Saad, 1991). Here, it is used to show the benefit of the proposed method for choosing the structure of the process model numerator in Section 4.
1658
M. LUNDHand K. J.
fikSTROM
i i 4~tCa422'-'.'-. ... j! '/'"
~'" :t
0.5
I i i
0 0
I 5
10
ll5
, 20
, 25
....,... ....
i i
;0
I
tilne [s] 35
40
!
2 1.5
1
":'"
0.5
, °o
1'0
ll5
2'0
_ 30
tilne [s] .
40
FIG. 7. Comparison of controllers having different sampling intervals. Control of process Ga using the controllers GRI (h = 0.49 s), GR4 (h ---0.34 s), and Gm (h = 1.48 s).
The process is given by Gs(s) -
(1 - s)o, (1 + s)(s 2 + 2¢,o.s +
e_,L '
where oJp, ~, and L belong to certain intervals. The values top = 15, ~ = 0.5 and L = 0.4 are used here. The experiment with relay feedback gives wo~ = 1.11rads-L The slope of the transfer function is estimated as ~i ~0. Hence, the non-minimum phase properties dominate the process at the oscillation frequency. A first-order process model is therefore chosen. Equation (16) gives OJo= 0 . 6 6 r a d s -1. The sampling interval is h = 0.40 s. The structure of the process model numerator is determined as described in Section 4. After normalization with the largest coefficient, the numerator of (17) is given by B~;(z ) = O.OOz -1 - 0.62z-2
__
0.14Z-3
+ 1.00Z -4 + 0.35Z -5. The first step in the model structure determination gives m = n = 1. The expression (18) is then maximized for d = 3 and we find that coefficient bo2 violates (19). This indicates that the model structure can be improved. The second step of the model structure determination gives m = 3 and d = 1. To show the benefit of the second step for determining the model structure, Fig. 8 shows simulations of two self-tuning controllers with different structure of the process model numerator. The dashed curves correspond to the choices m =1 and d = 3 . The solid curves
correspond to the choices m = 3 and d = 1. Both controllers give ultimately similar responses but the convergence is faster for the more complex model, since this matches the real process better. This shows that the procedure will automatically give a reasonable controller for the benchmark problem. The example also illustrates that the self-tuner compensates for moderate errors in the structure selection in the initialization. 6.3. Different choices o f m o d e l order The degree of the model determines the complexity of the controller. When the slope ti of the frequency response is close to a borderline for the model order, a minor change in/l leads to another model order. Compare with (15). This example demonstrates the consequences of different choices of model order. Consider the process 8 Gc(s) = e -°'°9s. (21) (s + 1)(s + 2)(s + 4) The value of the time delay was judiciously chosen to obtain an estimate of the slope at the borderline in the expression (15). An experiment with relay feedback gives the oscillation frequency ~o~ = 2.05 rad s -1. Waveform analysis gives ~'=0.89s. The slope of the frequency response is a = 2.1, which is on the borderline between the choices degA* = 2 and degA* = 3. Table 4 shows what these choices of degree mean for some parameters in this serf-tuning design method. The delay in the model is in both
A u t o m a t i c initialization o f a self-tuner
1659
o
, t 0
=
10
20
30
4O
,
50
60
tirqe Is]
70
80
90
0 I
-1 0
I
I
I
,
,
,
,
10
20
30
40
50
60
70
ti~e [s] 80
90
FIG. 8. Comparison of controllers based on process models having different numerators. The solid lines correspond to d = 1 and m = 3 and the dashed line to d = 3 and rn = 1. TABLE
4. PARAMETERS
IN T H E
Gc is controlled by two different self-tuning controllers. The controller Gc~ is based on the second-order process model. The other selftuning controller Gc3 is based on the third-order model. First, the reference input is two periods of a square wave with frequency ~o~/3, then it is zero for ten seconds. An input load disturbance affects the system at t ~ 23 s. The system with the controller Gc3 does not tune as fast as the one with Gc2. The reason is
SELF-
TUNING DESIGN METHOD
deg A*
2
3
T L too
0.89 0.24 2.21
0.58 0.01 2.92
s s rad s -I
cases d = 1, and d e g B * - - d e g A * . The sampling interval is h = 0.22 s. Figure 9 shows a simulation where the process
/
-1
V
"
1/ I
0
I
5
1'0
1'5
20
tiwe [s] 25
10 rI Ii
5
r~.
__
0 -5 -10
|| || ||
0
|
i
I~•
I
I
I
5
10
15
20
fi~ne[s] 25
FIG. 9. Self-tuning control of a process with the transfer function Go(s) given by (21). Responses for the system based on the second- and third-order models are shown in solid and dashed curves, respectively.
1660
M. LUNDHand K. J. /~STRI3M 1 !
0.5 !
,s
Y -0.5
-I
i'
-1.5
-2
-2
-1.5
-1
-0.5
0
015
Re
FIG. 10. Nyquist curves for the loop-transfer functions at t = 22 s. Curves for the system based on the second- and third-order models are shown in solid and dashed curves, respectively.
that a more complex process model requires more excitation to converge. After the initial transient the systems behave similarly as long as the reference signal excites the system. This is also verified by the Nyquist curves for the loop-transfer functions at t = 2 2 s . These are close, as shown in Fig. 10. 7. CONCLUSIONS
The paper has described a procedure for automatic initialization of a self-tuning controller. The procedure is based on information obtained from an experiment with relay feedback. For a special class of systems it is shown how the self-tuner can be initialized automatically. The result is a self-tuning controller that can be started simply by pushing a button. Properties of this initialization procedure have been illustrated by some examples. Since the procedure is based on relay feedback it will only work for systems where stable limit cycles are obtained under relay feedback. Extensive experience indicates that this occurs for a wide variety of processes that are encountered in industry, see H~igglund and /~.striSm (1991).
intelligent PID control. In Preprints IFAC Workshop on Artificial Intelligence in Real Time Control, Shenyang, P. R. China, pp. 38-43. Pergamon Press, Oxford. ]~strOm, K. J. and B. Wittenmark (1989). Adaptive Control. Addison-Wesley, Reading, MA. ,~str6m, K. J. and B. Wittenmark (1990). Computer Controlled Systems--Theory and Design (second edition), Prentice-Hall, Englewood Cliffs, NJ. H~igglund, T. and K. J. ~strOm (1991). Industrial adaptive controllers based on frequency response techniques. Automatica, 27, 599-609. Holmberg, U. (1991). Relay Feedback of Simple Systems. Ph.D. thesis TFRT-1034, Department of Automatic Control, Lurid Institute of Technology, Lund, Sweden. Hoopes, H. S., W. M. Hawk Jr. and R. C. Lewis (1983). A self-tuning controller. ISA Trans., 22, 49-58. Kraus, T. W. and T. J. Myron (198,1). Self-tuning PID controller uses pattern recognition approach. Control Engineering, June, 106-111. Lilja, M. (1989). Controller Design by Frequency Domain Approximation. Ph.D. thesis TFRT-1031, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden. Ljung, L. and T. StiderstriSm (1983). Theory and Practice of Recursive Identification. MIT Press, Cambridge, MA. Lundh, M. (1991). Robust Adaptive Control. Ph.D. thesis TFRT-1035, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden. M'Saad, M. (1991). A showcase of adaptive control designs. In C. Commault, D. Normond-Cyrot, J. M. Dion, L. Dugard, M. Fliess, A. Titti, G. Cohen, A. Benveniste and I. D. Landau (Eds)~ Proceedings of the First European Control Conference, ECC 91, Grenoble, France, Vol. 3, pp. 2374-2375. Hermes, Paris. Persson, P. (1992). Towards Autonomous PID control. Ph.D. thesis ISRN LUTFD2/TFRT-1037-SE, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden. Tsypkin, Ya. Z. (1984). Relay Control Systems. Cambridge University Press, Cambridge, U.K. APPENDIX: THE BATCH OF PROCESSES FOR VALIDATION The procedure for initialization of self-tuning controllers in Section 5 involves choices of many variables. These choices were based on heuristic rules. To determine the validity of the initialization procedure, it was tested on a batch of processes. These processes are listed here. The outcome of the initialization procedure for the processes was measured by the peaks of the sensitivity functions.
A.1. Processes Processes with the following transfer functions were considered: 1
Gl(s) = ~( e )
-'c
0.01 -< L - 10
1 G2(s) = ( s + 1)n
3-n-<20
1 - as G3(s) = ---.-.--3 (s + 1)
0.1 -< a - 2
1 Ga(s) = - e - " s
REFERENCES /~strtim, K. J. and T. H~igglund (1988a). Automatic Tuning of PID Controllers. Instrument Society of America, Research Triangle Park, NC. ~,strtim, K. J. and T. H~,glund (1988b). A new auto-tuning design. In Preprints 1FAC Int. Symposium on Adaptive Control of Chemical Processes, A D C H E M '88, Lyngby, Denmark. ,~.str/~m, K. J., C. C. Hang, and P. Persson (1989). Towards
Gs(s) = ~ G6(s) =
1
e -~c
0.05 --- L --- 2
1 - o~s s(s + 1)
1 GT(S) = - - e s+l
0.05 -< ot -< 0.75
sL ~0~
Gs(s) =sls2t + 2~tops + to2p)
0.01 -< L -< 10 e
s
~ = 0.2,
tOp = 4.3
1661
Automatic initialization of a self-tuner 2.6
2.4
+ o
+
+
+
2.2
"~
2
"m
+
O
o:
.Z
o
O
OO
o
o
O
O
1.8
61. OO
,
0
.
go
1.6 ,0
1.4 " 0
1"20
0'.5
!
l
1
1.5
2
2'.5
3
3.5
l/(O~oscT)
FIG. A.1. Maximum sensitivity for the different processes. The circles (©), the plus marks (+), and the stars (*) represent processes modeled with deg A* = 1, deg A* = 2, and deg A* = 3, respectively.
c,(,)-- /
1
+
0.5 \
sL
O.Ol_
25 GI°(S) -- (s + 1)(s + 3)(s2 + 2s + 25) e-3s
(1 s)to~ -
GH(s) = (1 + s)(s 2 + 2r~tOps+ tO~)
e-sL 10--~ top -- 15, 0.2<-L<0.4
C,e(s) = ~ G~(s) =
1
e -'L
0.01 -~ L -< 10 1
(S + 1)(S +p)(s +p2)(S +p3)
2-
The processes Gl(s), G7(s) and Gle(S) were used to heuristically determine the rule (16) for choosing the parameter tOo. Processes G~(s) to G6(s) have been used to assess performance of PID controllers (AstrOm et al., 1989). The process Gu(s) is a benchmark problem for adaptive control (M'Saad, 1991). The process Gs(s) is constructed to have a resonance at 3too~c, which leads to an erroneous estimate of the slope. The processes Gg(s) and Glo(S) are inspired by processes where PID auto-tuning has failed. The process GI3 is a modification of G2(s).
A.2. Validation In the validation the initialization procedure was first applied to the process, the self-tuning controller was then commissioned. Under adaptation, the reference input was initially two periods of a square wave with the frequency to,~/3, then it was zero for 30 samples. The frequency response of the sensitivity function 5°o was calculated using the controller obtained at the time when adaptation stopped. The design objectives were that the controller should be stable and the sensitivity function should satisfy I~*ol-< 2. The controllers were stable for all the investigated processes. The peaks of the sensitivity functions are shown in Fig. A.1. Some of the sensitivity functions have peaks higher than 2. The highest peak is obtained for the process G9(s) with L = 1. This process would better be modeled as a first-order model. Although the formula (16) for choosing the design parameter tOo was derived using simple processes, it works quite well for all the processes in the test batch. Table A1 shows the results of the validation procedure. The second column shows the value of the process parameters used. An exception is the process Gu where Pk = a means tOp = 15, L=0.2; p ~ = b means top=15, L=0.4; p , - c means top = 10, L = 0.2; and Pk = d means top = 10, L = 0.4. Other columns in the table show the estimate of too~T, the peak of ]~ol, the oscillation frequency tOo~, the design parameter tOo, and the slope estimate ft. The chosen model structure is defined by degA*, degB* and d. These are also given. The last column shows the estimated delay L in (10).
1662
M . LUNDH a n d K . J. fikSTROM TABLE A.1. VALUATION OF PROCESSES IN VEST BATCH k
Pk
O)oscT
I~,1
oJ,,sc
oo
r7
degA*
degB*
d
L
1 1 1 1 1 1 1
0.01 0.03 0.10 0.32 1.00 3.20 10.00
2.40 2.45 2.47 1.83 0.91 1.33 0.48
1.87 1.88 1.93 2.02 2.40 1.78 1.92
2.66 2.53 2.31 1.65 0.99 0.52 0.24
2.50 2.34 2.13 1.78 1.73 0.69 0.74
1.79 1.80 1.79 1.77 1.55 0.93 0.31
2 2 2 2 2 1 1
2 2 2 2 2 1 1
1 1 1 2 4 5 4
0.06 0.06 0.11 0.30 1.15 3.39 10.34
2 2 2 2 2 2 2
3 4 6 8 10 15 20
1.35 1.11 0.95 0.91 1.27 1.27 2.42
1.92 1.76 1.68 1.71 1.78 1.78 1.64
1.16 0.74 0.45 0.34 0.27 0.18 0.13
1.51 1.12 0.76 0.60 0.37 0.24 0.12
2.24 2.52 2.39 2.39 2.04 1.49 1.16
3 3 3 3 2 2 1
3 3 3 3 2 2 1
1 1 2 3 4 5 5
0.00 0.15 0.73 1.43 3.30 5.02 11.45
3 3 3 3 3 3
0,10 0.25 0.50 1.00 1.50 2.00
1.19 1.71 1.34 12.13 8.89 37.62
1.95 1.97 2.31 1.69 1.69 1.50
1.07 0.98 0.87 0.72 0.62 0.56
1.53 1.10 1.14 0.42 0.38 0.29
2.21 2.03 1.72 1.22 0.91 0.69
3 2 2 1 1 1
3 2 2 2 2 2
1 1 1 1 1 1
0.02 0.56 0.87 1.47 1.64 1.57
4
--
83.64
1.84
0.94
0.48
1.02
1
1
2
1.08
5 5 5 5 5 5 5 5
0.05 0.10 0.20 0.40 0.60 0.80 1.00 2.00
2.44 2.44 2.56 2.44 2.39 2.06 1.90 >100
2.07 2.08 2.08 2.14 2.17 2.24 2.33 1.84
1.43 1.27 1.06 0.83 0.69 0.56 0.49 0.32
1.33 1.18 0.96 0.77 0.65 0.56 0.52 0.16
1.70 1.70 1.67 1.61 1.56 1.46 1.42 1.26
2 2 2 2 2 2 2 1
2 2 2 2 2 2 2 1
1 1 1 1 1 2 2 2
0.22 0.24 0.26 0.36 0.45 0.63 0.84 3.20
6 6 6 6 6
0.05 0.10 0.25 0.50 0.75
2.44 2.44 2.51 9.54 >100
2.08 2.09 2.14 1.96 1.91
1.43 1.27 0.93 0.71 0.60
1.33 1.18 0.85 0.43 0.30
1.68 1.65 1.54 1.27 1.11
2 2 2 1 1
2 2 2 1 1
1 1 1 2 2
0.22 0.24 0.24 1.59 1.52
7 7 7 7 7 7 7
0.01 0.03 0.10 0.32 1.00 3.20 10.00
11.55 8.34 6.36 3.43 1.68 0.63 0.33
1.40 1.59 1.82 1.91 1.90 1.94 1.95
14.30 12.06 8.16 3.77 1.56 0.67 0.26
8.40 7.50 5.39 3.02 1.77 1.61 1.05
1.00 0.99 0.99 1.02 0.90 0.57 0.17
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 2 4 4 4 4
0.01 0.04 0.11 0.34 1.02 3.34 10.02
8
--
4.09
2.33
0.86
0.65
0.70
1
1
4
1.45
9 9 9 9
0.01 0.10 1.00 5.00
>100 >100 0.85 0.83
1.46 1.72 2.60 1.88
7.70 5.00 1.13 0.40
3.85 2.50 2.09 0.76
1.06 1.10 1.39 0.70
1 1 2 1
1 1 2 1
1 1 3 4
0.02 0.14 1.08 5.23
0.80
1.89
0.61
1.19
0.55
1
1
4
3.31
27.21 10.68 8.24 4.92
1.49 1.50 1.62 1.59
1.20 1.11 1.18 1.08
0.64 0.66 0.73 0.76
-0.02 -0.01 -0.04 -0.03
1 1 1 1
1 3 1 l
1 1 1 2
0.49 0.69 0.58 0.80
10
-
-
11 ll 11 11
a b c d
12 12 12 12 12 12 12 12
0.00 0.01 0.03 0.10 0.32 1.00 3.20 10.00
1.35 1.35 1.35 1.19 1.11 1.22 1.74 0.67
1.92 1.92 1.91 1.93 2.29 2.01 1.69 1.88
1.16 1.15 1.13 1.07 0.94 0.71 0.44 0.22
1.51 1.50 1.48 1.53 1.41 0.99 0.49 0.50
2.24 2.24 2.24 2.25 2.18 1.91 1.15 0.41
3 3 3 3 3 2 1 1
3 3 3 3 3 2 2 1
1 1 1 1 2 3 4 4
0.00 0.00 0.00 0.02 0.12 1.19 3.76 10.58
13 13 13
2.00 4.00 10.00
1.19 2.38 2.19
1.93 1.95 1.87
1.96 4.37 7.82
2.80 4.11 7.67
2.23 1.86 1.61
3 2 2
3 2 2
1 1 1
0.01 0.05 0.00