Iterative Feedback Tuning of a PID in a Pilot Plant

Iterative Feedback Tuning of a PID in a Pilot Plant

Copyright @ IFAC Digital Control: Past, Present and Future of PlO Control, Terrassa. Spain, 2000 ITERATIVE FEEDBACK TUNING OF A PID IN A PILOT PLANT ...

1MB Sizes 1 Downloads 102 Views

Copyright @ IFAC Digital Control: Past, Present and Future of PlO Control, Terrassa. Spain, 2000

ITERATIVE FEEDBACK TUNING OF A PID IN A PILOT PLANT

Rogelio Mazaeda (*), Cesar de Prada (**)

(*) ISPJAE, Cuba, at present with the Dpt. Systems Engineering and Automatic

Control, Faculty of Sciences, University of Valladolid, cl Real de Burgos, sin, 47011 Valladolid, Spain. E-mail: [email protected] tlf. +34 983 423162, Fax +34 983 423161 (**) Dpt. Sy~tems Engineering and Automatic Control, Faculty of Sciences, University of Valladohd, cl Real de Burgos, sin, 47011 Valladolid, Spain. E-mail [email protected], tlf. +34 983 423164, Fax +34 983 423161.

Abstract: Iterative Feedback Tuning (1FT) is a tuning method that adjust on-line the parameters in the controller so that a performance criterion is minimised. The 1FT method uses only experimental data obtained from the closed loop system without assuming knowledge of the plant or perturbations models. In this paper the application of !FT to the tuning of a PlO controller of a pilot plant is reported. The impact on the achieved system performance due to time weighting of the control error is particularly addressed. Copyright @ 2000 IFA C Keywords: Iterative Feedback Tuning, PID control, Process control.

In between, we can consider those approaches that measure a single dynamic characteristic, such as a point in the Nyquist curve, and then design the controller from it using one of the previously mentioned methods. The well-known method of the relay (Astrom, Hagglund, 1984) belongs to this category.

1. INTRODUCTION.

In spite of the advances in the theory and implementation of control systems, the well-known PlO regulator is still the most widely used controller in the process industry. This explains the continuous interest in developing practical methods for PlO tuning.

The first approach is a very practical one, but it is limited to monotonic processes that can be well represented by a first order plus delay models in a certain range, and cannot be recommended if the dynamic is more complex or very good performance is required. The same happens with the relay method. On the other hand, methods based on a plant model have the drawback that the model has to be obtained previously, either from first principles or by identification, which limits its applicability. Moreover, what is usually required, is a method that can be implemented on-line, but unfortunately, adaptive explicit schemes introduce more questions than answers in many cases when they are considered from an industrial perspective.

In the literature the problem has been focused from different points of view. Early methods, as those from Ziegler- Nichols (1942), are based on tables that provides the PlO parameters from approximate models that have been obtained performing simple experiments on the plant, such as step tests. Rovira (1969), Lopez (1967) and others have given similar tables corresponding to different tuning criteria. Other family of methods assumes the knowledge of a process model and applies different design algorithms to obtain the desired controller. For instance, desired closed loop poles or phase or gain margins can be selected and the PID parameters can be chosen to meet the required specification. If a model is available, another alternative is to tune the PlO minimising a cost function related to its closed loop performance in relation to the PlO parameters.

Another possibility for on-line tuning is to adjust the controller parameters directly in relation to a performance index, without using an intermediate model, as in direct adaptive control. This is the context in which we can place recent contributions

545

such as the Iterative Feedback Tuning (1FT) (Hjalmarsson, et al.. 1994, Hjalmarsson, et al.• 1998). In this method, it is possible to adjust automatically on-line the parameters or a reduced complexity controller, such as the PlO, optimising a performance criterion, without any previous explicit knowledge of the plant dynamics but avoiding the problem of traditional adaptive control schemes.

where p is the vector of parameters that characterise the controller, for instance, the gain, integral and derivative times in a PlO controller.

It is natural to pose the tuning problem as one of optimising a quadratic performance index such as:

In this paper we present an application of this technique to a lab plant. The purpose has been to test the method in a difficult control loop and to obtain conclusions about its applicability in more realistic industrial environments. The paper is organised as follows: part 1 gives the introduction. In section 2 we present an overview of the 1FT method for the case of SISO systems with one degree of freedom. Section 3 describes the process in which the 1FT has been applied. Finally, section 4 gives results of the experiments. The paper ends with some conclusions.

Where E denotes the expected value. This function penalises the errors between the actual output y and the desired one

l:

(4)

This one can be taken either as the set point r or the output of a reference model T d: 2. ITERATIVE FEEDBACK TUNING. (5)

1FT is a novel approach that allows adjusting the parameters of a reduced complexity controller minimising on-line a cost function. For simplicity, we will present here the basic ideas referring to a SISO system controlled with an one-degree-of freedom regulator, such as a PID.

Also, J penalises the control efforts, as it is usual in this kind of problems. L y and Lu are filters that allow us to specify different weights at different frequency ranges in the errors or the control actions. A default selection is to set both to 1.

v Lambda is a design parameter that can be used to specify the relative importance of the conflicting aims: to obtain small errors and to use small or smooth control actions.

y

Finally, N, is an integer specifying the time window, in terms of sampling periods, that it is considered in the cost function.

Fig I. Closed Loop system. Assume the system of Fig. 1, where G represents a LTI process, C is the controller, v is a disturbance signal, y the process output, u the manipulated variable, r the set point and e the error signal so that the process output is given by the equation:

Optimal settings of the controller are those that minimise J, that is:

p.

= arg min

P

J(p)

(6)

If no constraints are considered, the optimal parameters could be obtained analytically by solving:

(1)

Here v is considered to be a weak stationary stochastic process. The control signal u is computed from:

(7) (2)

with respect to p. Nevertheless, this is not easy to compute and, in addition, it requires the process

546

model to be known. Instead, a numerical minimisation can be the only practical approach, using algorithms such as: p. 1= p. -r5·R·-I -aJ (p. ) 1+

1

1

1

op

I

expl~'i

yl{.q)=To{.q~+So{.q~:

eXP2~'i2 =~-}(.q)~ l{.q) =To{.q ~ - }{.q))+So{.q~;

(8)

1

=r,

+

~

While the output in the second one gives the term To (r-y) corrupted by the disturbance term, so that the output gradient can be estimated from (10) as:

r

+

ks{~ ~; l][:; (0,)]'1

(l

(13)

There are several ways of estimating the Hessian in (8). A good approximation is given by:

i

~

So being the sensibility function. Notice that the first experiment gives the closed loop process output, so that one obtains directly:

Where Ri is a positive defmite matrix, for instance the Gauss-Newton approximation of the Hessian of J, and OJ a sequence of positive numbers aimed to force the convergence of the algorithm.

Ri =~ L;:+S{:; (PJ}s{ t to

(l

(14)

(9)

Also, it is not difficult to derive similar expressions for u and to see that: (15)

The main difficulty in applying this kind of methods is the need of having a reliable estimate of the gradient of J at every iteration.

and:

The main contribution of the 1FT approach is that it provides a method for computing on-line non-biased estimations of the gradient of J from closed loop experiments in the plant, opening the door for on-line controller tuning.

(16)

Then, a non-biased estimate of the gradient of J is given by:

One key equation in the 1FT method is:

(10)

(17)

Where To is the closed loop transfer function. It can be obtained easily taking the derivative of the closed loop process output. This equation suggests that an estimate of the derivative of y respect to the controller parameters could be computed from a couple of closed loop experiments. In turn, (10) could be used to estimate the gradient of J in relation to p from (7).

While (9) gives another one for the Hessian R. To summarise, the 1FT algorithm follows the following steps: I.

The first experiment would collect data in normal operating conditions and set point r for N sampling times. The second one will collect also N data points, but this time the set point will be the difference between r and the process output y of the previous experiment:

Starting with sensible values of the controller parameters, the process is controlled in closed loop as in experiment 1, with set point r for N sampling times. The result is a set of values of the process input and output u I and The error is computed according to (11). Next the set point is changed to r_yJ and another N samples of the .; and u2 signals are collected as well. The gradients of both, output and input

i.

2.

547

3.

4.

respect to the controller parameters are computed using (14) y (16). Notice that the same filter is applied to both signals and that this filter depends only on the controller C. Then, the gradient of the cost function J in relation to the controller parameters can be obtained from (17). (9) gives also an estimate of R. In the final step, the controller parameters are updated using (8) or a similar expression and the procedure is repeated until a satisfactory closed loop behaviour is obtained.

The plant is composed of an electric motor M with a fan attached to its axis. The air current it provides depends on the motor speed and it is used to push a rigid sheet that hangs from its upper side and can turn on it.

Angle measurement

Voltage to control speed

S

Notice that in the 1FT method, the updating of the controller parameters p is decoupled from the estimation phase, avoiding many of the problems of classical adaptive control.

Digital Controller (PC)

Speed Measurement

In the literature it is possible to find several modifications ofthe basic ideas above. For instance, changes in the cost function, such as the one due to Lequin et at [1999], in which J is taken as:

Fig 2. Pilot Plant

The aim is to maintain the sheet in a given position acting on the motor speed. The rigid sheet position is measured as the angle that form with the vertical, using a precision potentiometer that gives an electric signal proportional to the angle turned by the sheet. The motor speed is measured using a tachometer that provides an electric signal proportional to the speed. This can be controlled by means of a variable voltage from an amplifier, which in turn, is driven from a control signal from the computer. The PC is a 200 MHz Pentium 11 equipped with a high speed AID and D/A card, a DASI6 from Computer Boards It receives the process measurements and sends the control signal to the motor amplifier.

J(p}=~ JL~_lwYt (L YYt(p})2 + 2N'"l +

I.~lw~(LuUt(p}f]

(18)

Here a set of non-negative weighting factors w has been added as a way of assigning different priorities to the errors in the transient response or in steady state. In this way, choosing an appropriate window, it is possible to approximate minimum rise time or ITSE criteria. Another aim when selecting w is to help in the convergence of the algorithm toward a global minimum: It is well known that minimisation of an index such as J can lead to a local one.

~' ..

.

T

Other extensions of the 1FT method deal with MIMO systems, see for instance (Hjalmarsson and Birkeland, 1998), as well as to non-linear systems (Hjalmarsson, 1998) where classical methods based on linear models doesn't give good results, and in particular, to time varying systems, mainly with slow and periodic changes (Hjalmarsson, 1995).

Fig 3. Cascade Controller Structure. It is worth to notice that the process is highly nonlinear: the dynamics between the sheet position and the motor speed depends on the operating conditions being in general proportional to the cosine of the angle between the sheet and the vertical. In addition, due to the fact that the system is enclosed in a plastic box, the fan creates internal currents and turbulence, which acts as disturbances and makes the process very noisy and difficult to control.

3. IMPLEMENTAnON OF THE lIT METHOD IN A LAB PLANT In order to study the performance of the 1FT method for PID tuning, one of the pilot plants of the Systems Engineering Lab. at the University ofValladolid was selected.

The angular position of the sheet is controlled using a cascade structure: the internal loop is a P controller

548

regulating the speed of the motor. The set point of this controller is given by the external PI controller which receives the angle measurement and adjust the speed of the motor in order to maintain the angle close to its set point. A schematic can be seen in Fig.3. The external PI controller is the one we want to tune using the 1FT method.

35

This control structure is implemented in the computer using a control software called Regula (Prada, Ruiz, 1991). This is a real time general purpose computer control system developed some time ago in our Dpt. Regula is used for teaching purposes, but it has the functionality of most of industrial packages. It runs under DOS and supports all common types of controllers and control structures: cascade, feedforward, ratio, selective, override, etc. Additionally, it incorporates advanced control features such as adaptive and predictive control. A configuration program allows adapting the software to the particular plant that it is being controlled.

Fig. 4. Response of the system with the initial controller to a step change in the reference.

The 1FT algorithm has been incorporated to Regula and can be used with PI, Pill and a 4 parameters PID controllers. It is written as a C subroutine and can be activated as any standard feature. The main drawback of the method from the point of view of implementation is the amount of memory required for storing the results of the two experiments performed at every step of the algorithm. The speed of execution is quite good, because the most CPU consuming operation, the inversion of the R matrix, is limited by the small number of parameters to adjust: usually from 2 to 4. Moreover, R is a symmetric positive definite matrix, which makes things easier.

Two conlecutive iterations (wa5%)

.a 35

130 ~

i:

I-z

\

\ \

\

I ( I

\}

5

K· P(I) c(p) = K p +_1_ =p(o)+--I -I

I

I

15

0

1

I

I 6 10

In our case, for simplicity, the structure of the PI controller was taken as:

\

\

~

~

I

I

0

10

20

\

30

.a

50

I 60

70

time

Fig. 5. Two consecutive iterations of the algorithm for w=5%. (Reference dashed, Output solid).

(19)

I-z

Figure 5 shows the experimental data corresponding to two successive iterations of the 1FT algorithm. As we can see, the set point is first fixed to a constant value r equal to the desired operating point, and then, after the first N= I00 sampling times, is changed to r - i(t) for the same amount of time. The PI parameters are updated and the procedure is repeated again in a new iteration.

4. EXPERIMENTAL RESULTS. In order to tune the PI controller and to test the 1FT method, a set of experiments were conducted in the above-mentioned pilot plant. In all of them, the sampling period was maintained as 0.2 sec. and the number of samples was taken as N=lOO. The control weight f... was chosen as zero, and the set point was given a value of 30 degrees. The desired output l was always equal to the set point, that is, the reference model was taken T= I.

In the index J to be minimised, the filters L y and Lu were set to I, and a window with a number of zeros followed by ones were chosen for the weights w. The w parameters are an easy but effective way of specifying the desired response. If the number of zeros is reduced, that is, if we penalise more the errors at the initial samplings of the time window,

The starting tuning parameters of the PI were: ([p(O) p(l)]=[0.2 0.01]). With this setting the response of the controller to a set point change from 0 to 30 degrees can be seen in FigA.

549

than we will obtain quicker and more active responses, with bigger overshoots. Placing the time window more toward the future, gives optimal controllers with longer rise times, but with less active control and less overshoot.

y-=0.5. As we can see the convergence is quite good,

which reduced the tuning time to reasonable values.

Value of criterion (w-5%.N-l00.Gamrna-0.5) 45

Comparing W=5%(dolted).w-10%(dashedl.w-2O(IoIid)

40

,

35

'

,r-",

r-

30

I

:1

-:--1- :1

;25':1

~201:1 .. I :I ~ 15 I 'f 6 :1 I ' 10 I :I I :I 5 '/ I ' o -- 'I o

2

40

r-"\

\' . . '.J ,'~~

".......

-

,"

.

35

-r·~--'-'-Y~'-o:....?-

\/

/

30

..,/ 25

20

15

10 6

10

12

0

3

2

4

tteraciones

time

Fig. 7. Evolution of the performance criterion against (w=5%, N=I00, number of iterations. Gamma=O.5).

Fig. 6. Comparing the step responses of the system to three different controllers tuned with different w coefficients. (Dotted w=5%, dashed w=1O%, solid w=20%).

Inilial(dotted) \lS Final (solid) Cor4rollers

35

Fig. 6 represents the process output, the sheet angle, and the set point for three experiments, after using the 1FT as tuning algorithm. In the first one only 5% of the w coefficients (the initial ones) are set to zero. That means that the cost function starts to penalise the errors after (N*ts*5)fI00 seconds. In the second the percentage was increased to 10% and in the final experiment 20% of the points has no weight at all. As we can see the 1FT algorithm is able of improving the initial tuning of the PlO controller and the responses are according to the previous comments about the time window: when it is placed more toward the future, the rise time increases and the overshoot decreases. In the figure the dotted curve corresponds to w=5%, the dashed one is for w= 10% and the solid line, with a very small overshoot, was obtained with w=20%. The optimal tuning given by the 1FT were:

/--.

30 , - -

~

i

-

-

-

-

251 20

i

6 15 10

/

I I I I I I

5

/"",,-,,-

\

/

-

\~

~T

-"">""

I

) ,/ .../ I /

I

/

(

I( °O~------:---------:1':"O------!15 time

Fig. 8. Comparing the output responses of two final controllers obtained with different w coefficients (solid lines) with that of the initial controller (dashed lines).

[p(O) p(l)]=[0,4297 0.03013] for the case w=5% [p(O) p(I)]=[O.2297 0.0275] for the case w=1O% [p(O) p(I)]=[O.1693 0.01503] for the case w=20%

To show more clearly the improvement obtained, Fig.8 plots the response of the PlO with the initial setting to a step in the set point (dashed line), and the result of the same experiment with the settings obtained with the 1FT algorithm with two different aims.

Including all points in the experiment, that is with w = 0%, the 1FT algorithm was not able of converging to a minimum. The condition that the closed loop system were very near to the set point in the time instants after a step jump on it, were too strong for the convergence of the method.

5. CONCLUSIONS.

On the other hand, in the other cases the algorithm is able to reach the optimum only in 4 or 6 iterations. Fig.7 shows the time evolution of he value of J for the case with w=5% with a convergence parameter

In this paper the 1FT method has been applied for the tuning of a PI controller in a laboratory experimental

550

facility. The process is difficult to control because of its non-linear nature and the noisy response.

integral criteria", Instrumentation Technology, vol. 12, n 11. Prada C., Ruiz J.A. (1991), "Manual de Usuario de Regula ", Dpt. Systems Engineering, University ofValladolid, Spain, 1991. Rovira, A.A, Murrill, P.W., Smith C.L. (1969) "Tuning controllers for setpoint changes", Instruments and Control systems, December Ziegler, J.G.,Nichols,N.B. (1942), "Optimum settings for automatic controllers",Trans. ASME, 64, pages 759-768.

Nevertheless, the 1FT has proved to be an effective tuning method, giving consistent responses in all cases. The implementation of the algorithm in a computer control system has enhanced it with a practical on-line tuning tool. The method is easy to use and the optimality criterion can be balanced toward more active responses with shorter rising time, or more stable ones with smaller overshoots, using the time window represented by the w parameters. Several experiments were made with different values of the number of samples N, but, provided that if reached the steady state. The 1FT operates in closed loop, which is a desirable characteristic for industrial implementation and can be activated by the operator or automatically using the value of the cost function as a firing criterion.

ACKNOWLEDGEMENTS The authors want to thank the Spanish CICYT for its support to this work through project TAP97-1144C02-01. Also they are grateful to the EU, for the ALFA project 6/ 0272/9 REFERENCES A.strom KJ.,Hagglund T. (1984), "Automatic Tuning of Simple Regulators on Phase and Amplitude Margins", Automatica, Vo1.20, pages 645-651 Halmarsson H., Gunnarsson S., Gevers M. (1994), "A convergent iterative restricted complexity control design scheme" Proc. 33 rd IEEE CDC,pagesI735-1740. Hjalmarsson H. (1995), "Model-free tuning of controllers: Experience with time-varying linear systems ", Proc. 3rd European Control Conference, pages 2869-2874. Hjalmarsson H., Gevers M., Gunnarsson S., Lequin "Iterative Feddback O. (1998), Tuning: Theory and Applications ", IEEE Control Systems, pages 26-41. Hjalmarsson H. (1998), "Control of nonlinear systems using iterative feedback tuning", Proc. American Control Conference 98,pages 2083-2087. Hjalmarsson H., Birkeland T. (1998), "Iterative feedback tuning of linear time-invariant M/MO systems ", submitted to CDC 98. Lequin 0., Gevers M., Triest L. (1999), "Optimizing the settling time with iterative feedback World tuning" ,Proc. 14th Triennial Congress of IFAC, Beijing, P.R.China, pages 433-437. Lopez, A.M., Miller, lA., Murrill, P.W., Smith, C.L. (1967) "Tuning controllers with error-

551