Latin American Applied Research
31:403-410 (2001)
COMPARISON BETWEEN LINEAR-ADAPTIVE, LINEAR LOCAL MODEL NETWORK AND NONLINEAR MPC CONTROLLERS A. R. SECCHI* , L. G. S. LONGHI and J. O. TRIERWEILER Departamento de Engenharia Química, Universidade Federal do Rio Grande do Sul Rua Sarmento Leite, 288/24, 90050-170, Porto Alegre, RS, Brazi -
[email protected] Keywords: Model Predictive Control, Nonlinear Control, Adaptive Control, Multi-linear MPC. Abstract
There exist some situations where a fixed linear controller can no t be used to control a pro cess. Inthis wo rk, three possibilities to deal with these situations are tested and co mpared: (i) nonlinear control, (ii) adaptive linear control and (iii) lo cal linear model netwo rk co ntro l. The used co ntro llers belo ng to the MPC (Model Predictive Co ntrol) categ ory due to the great po pularity of this paradigm at the chemical industries. An iso thermal CSTR (Co ntinuo us Stirred Tank Reacto r) processing the classical Van de Vusse reaction is used as the plant. The compariso n between the different controllers is basedon the follo wing criteria: closed-loo p perfo rmance, easiness to implement and co ntro ller reliability. Finally, an experimental applicatio n is presented.
1. Introduction Chemical processes are inherently nonlinear. Despite this fact most of the control techniques are based on linear models. Most of these approaches show a satisfactory behavior. However, there exist some situations where a fixed linear controller can not be used to control a process: (i) when the systems gain experiments a sudden change of magnitude; (ii) when the static gain of SISO (Single Input Single Output) system changes its sign inside the operating range or more general, when det(G(0)) changes its sign, for MIMO (Multiple Input Multiple Output) systems and (iii) when the systems dynamics presents different behaviors inside the operating range (e.g. when zeros and poles change their signs, or cancel each other). Systems carried out within a wide range of operation conditions could present these problems. In this work, three possibilities to deal with this situation are tested and compared: (i) nonlinear control, (ii) adaptive-linear control and (iii) local linear model network control (Trierweiler and Secchi, 1998). An isothermal CSTR (Continuous Stirred Tank Reactor) processing the classical Van de Vusse reaction is used as the plant. Despite the model simplicity this process presents interesting characteristics, such as change of gains sign and transition between minimum and non-minimum phase inside operating range. It must be noted that this kind of phenomenon can really happen in real situations if there exist competitive reactions occurring inside the reactors vessel, for example.The used controllers belong to the MPC category due to the great popularity of this paradigm at the chemical industries. The comparison between the different controllers is based *
on the following criteria: closed-loop performance, easiness to implement and controller reliability. The plan of this paper is as follow. In section 2 the controllers are described. In section 3, the process to be controlled and its main characteristics are described. In section 4, the results are presented. Section 5 reports an experimental application with MPC and, in section 6, the conclusions are presented. 2. Controllers Structures 2.1 Model Predictive Control A MPC algorithm employs a model of the process to predict its future behavior over an extended prediction horizon. A performance objective to be minimized is defined over the prediction horizon, usually a sum of quadratic set point tracking errors and control effort terms. This cost function is minimized by evaluating a profile of manipulated input moves to be implemented at successive sampling instants over the control horizon. The feedback behavior is achieved by implementing only the first manipulated input move and repeating the complete sequence of steps at the subsequent sampling time. The various MPC algorithms propose different cost functions for obtaining the control law. A quite general expression for the objective function is: P
J=
M
å y (t + j / t) - r (t + j ) +å Du(t + j - 1) j = P0
2
Q
j =1
2 R
(1)
(t + j/t) is the predicted output j steps into the where y future based upon information available at time t,
Author to whom correspondence should be addressed.
403
Latin American Applied Research
31:403-410 (2001)
r(t+j) is the reference signal j steps ahead, Du(t) = -1
x
(1-z ).u(t) = u(t)-u(t-1), and
2 W
is the weighted
Euclidean norm of x Î Â defined as x 2W =x .W.x nxn with W Î Â positive definite. The tuning parameters are the minimum costing horizon (P0), the maximum costing horizon (P), the control horizon (M), the sampling time (tS), the controlled variable weight (Q), and the move suppression weight (R). The weighting matrices Q and R can be chosen as time-varying (i.e., functions of j). Here, for simplicity, they are assumed to be timeinvariant. n
T
2.2 Linear-Adaptive MPC The structure of the adaptive algorithm used in this work is based on Fig. 1. This structure is called STR (Self-Tuning Regulator) or STC (Self-Tuning Controller), depending on author. This kind of adaptation is the simplest one, and can only be applied to controllers with explicit process model as part of the internal structure of the control law. The role of the system identification block is just only to update the parameters of the internal linear model. The adaptive implementation used in this work is composed by a GPC (Generalized Predictive Controller) controller and a RLS (Recursive Least Squares) estimator. These are briefly described in the next lines. The linear model used in GPC to predict the process response is known as CARIMA (Controlled Auto Regressive and Integrated Moving Average): A( z -1 ).y (t ) = B( z -1 ).u(t - 1) +
1
C (z - ).x (t) D
|(2)
where u(t) and y(t) are the process input and process output at the time t, respectively; x (t) is the white -1 noise; A, B, and C are polynomials in z (in the case of an adaptive implementation, the coefficients ai's , b i's, and ci's are obtained by recursive estimation) and -1 D = 1- z .
Figure 1. Implicit or direct STR adaptive structure. There are several ways to compute the GPCs control law from Eqns. 1 and 2. In this work it was used the optimized implementation with U-D factorization proposed by Clarke and Mothadi (1989). The controller performance depends strongly on the quality of model parameter fitting, thus the system 404
identification algorithm is a fundamental part of the controller structure. According to Rohrs (1984), the system identification algorithm must be reliable and give a smooth parameter adjusting in order to increase the controller robustness. Estimated parameters with wide changeability increase the probability to the system became unstable. The parameter estimation algorithm used here is the well- known RLS (Recursive Least Square) algorithm, whose equations are obtained minimizing the following objective function: JE =
1 2
N
åa
(N - j) E
.[ y j (k ) - y j (k )]2
(3)
j =1
where a E is the forgetting factor, used to give higher weights to more recent measures, y(k) are the ( k ) are the estimated values, measured values, and y according to the Eqn. 4. T y(k ) = Y (k ).q(k - 1)
(4)
Y(k) is called the regressor vector (or data vector) and q (k-1) is the estimated model parameters vector. More details about this estimation algorithm can be found in many books of system identification and will not be presented here. 2.3 Local Linear Model Network (LLMN) MPC The basic idea behind the local models is the decomposition of the operating space in possibly overlapping subspaces. Each subspace corresponds to a local model. The construction of local model networks can be divided in: 1. Selection and range specification of the operating space variables. These variables define the operating space. 2. Division of the space in subspaces. 3. Choose of the local variables used in the definition of the local models. These variables can be other than the operating space variables. 4. Choose of the local model structure and the corresponding parameter identification. 5. A method to combine the local models into a global process model. In industrial processes it is expected that system's properties can be represented properly by a soft interpolation of the information of specific points distributed in the space (also known as operating points). Here, as in many other works in this area, the intermediary properties will be interpolated in the following way:
y = f (x l , x r ) = å ni =1f i ( x l ).r i (x r )
(5)
where the weighting functions r1(xr), r2(xr), ... , r n(xr) are responsible for the soft transition among the operating points, which are described by the local
A. R. SECCHI, L. G. S. LONGHI and J. O. TRIERWEILER models fi(xl) that, after properly weighted by the weighting functions, will compose the system's output represented by y; xl corresponds to the group of variables used in the local models and xr, to the group that defines the operating space, Xr. Naturally, the vectors xr and xl can have elements in common. In the extreme case, they can be identical. In principle, the local models can be of any type (e.g., state-space model, transfer function). They can be both linear as nonlinear. Preferentially, they should be linear in the adjustable parameters to allow its fast and efficient determination. Here, the ARX-model structure is used as local models. Regarding the weighting functions, they typically satisfy: n
å r i (x r ) = 1, " x r
(6)
i =1
which is known as the normalization condition. Weighting functions that satisfy Eqn. 6 guarantee a homogeneous distribution in the definition space, being, in this way, less sensitive to the location of its centers. When the functions that quantify the influence of a given center in the space do not satisfy the normalization condition, they can easily be normalized through
mi
r i (x r ) =
(7)
n
åm k
k =1
where m i represents a function that is being normalized and n the total number of centers. The weighting functions are also known as basis functions. A usual choice for m i is a gaussian function, i.e.,
(
m i (xr ) = exp - xr - ci
2
2
2s i
)
(8)
which assumes after the normalization the following form: ri ( xr ) =
(
exp - x r - c i
å exp(- x n
k =1
r
2
- ck
2s i2 2
)
2s
2 k
)
(9)
In Eqn. 9, ck is the location of the center k, and sk is the corresponding standard deviation. s k quantifies the degree of expansion (i.e., width) of the center k along of each dimension defined by the variables that characterize the operating space. Depending on the location of the center and of its width, the normalization leads to a number of important side effects which can have important consequences for the resulting local model network. These effects are explained in (Trierweiler and Neumann, 1998). For the interested reader, more details about the LLMN MPC implementation can be found in (Trierweller and Secchi, 1998).
2.4 Used Controllers In this work, five MPC strategies are compared regarding to the prediction model. The objective function (Eqn. 1) and the same constraints are used for all controllers. The constraints in the manipulated variables are given by umin £ u(t) £ umax and |Du(t)| < Dumax, " t. The prediction models for the controllers are the following: (a) a nonlinear model without model-plant mismatch; (b) a linearized model calculated for a given steady-state; (c) a linear-adaptive controller; (d) a LLMN with linear predictions; and (e) a LLMN with nonlinear predictions. The first strategy solves the optimization problem using a SQP algorithm. All the others strategies use either the corresponding analytical solution for the unconstrained case with saturation in u(t) and Du(t), or use a QP algorithm for the constrained case. The last strategy (i.e.,(e)) can also be solved in the above manner because it was implemented through an iterative algorithm. That is, it is started by a linear prediction, i.e., the solution of the case (d). With this linear model it is calculated an initial moving trajectory for the control action u. Then several interpolated models are calculated along of this trajectory for each sampling time of the prediction horizon. With these interpolated models a new moving trajectory is optimized. After that the interpolated model can be updated and a new trajectory can again be calculated. These two steps are performed until to reach the convergence or a specified number of iterations. This idea is based on the fact that all linear prediction model can be represented by y = Gu + d where the vector d contains the terms depending on known values and Gu depends on future control inputs. For the unconstrained problem, the MPC gain T -1 T matrix is given by: K = (G .Qd.G+Rd) .G .Qd where Q d = diag(Q,...,Q) and R d = diag(R,...,R). Therefore, the MPC gain matrix depends on the operating space variables along the prediction horizon, which are unknown but may be estimated through the linear models interpolated by the control moving trajectory of the previous iteration step. The iterative approach is a direct substitution technique to solve the nonlinear prediction model. This strategy is a good compromise between the simplicity of a simple linear predictive model (case (d)) and the numerically intensive calculation of a nonlinear predictive model (case (a)). 3. Plant Description The CSTR with van de Vusse reaction scheme has been used as a benchmark problem for nonlinear process control algorithms (e.g., Chen et al. (1995)).
405
Latin American Applied Research
31:403-410 (2001)
Here, it will be analyzed an operating point that is almost the same as the one proposed in that work. 3.1 Description of the Process The van de Vusse reaction consists of the following reaction scheme: A
k1
®
k2
® 2A ® D B
f p = k 2 + ( k 1 - k 2 ).
- k1 - f p + ( k1 + f p ).2 + 4. k 3. CAin. f p 2. CAin. k 3
(12)
which can easily be derived from the condition zero = 0 for the maximum CB.
C
k3
Here, B is the wanted product and C and D are the undesired byproducts. The van de Vusse reaction is carried out in an ideal isothermal continuous stirred tank reactor (CSTR) which is modeled by: 2 dC A Fin (CAin - CA ) - [k1 (T )CA + k 3 (T ).CA ] = dt VR
dCB F = - in .CB + [ k1 (T )CA + k 2 (T ).CB ] dt VR
(10)
(11)
where ki is given by the equation of Arrhenius, i.e., ki(T ) = ki0.exp(Ei/(T [oC]+273,15 )), for i = 1, 2 and 3. In the present study, it is used the same kinetic parameters proposed in (Engell and Klatt, 1993), i.e., 12 9 k10 = k20 = 1,287.10 h, k30 = 9,043.10 liter/(mol.h), E1 = E2 = -9758.3 K, and E3 = -8560 K. We assume that the CSTR works at 114.5 ºC. The manipulated and controlled variables are f = F in /VR (the inverse of the residence time) and CB (concentration of component B), respectively. f is -1 assumed to vary in the range 3 £ f [h ] £ 35. The inlet concentration of A, CAin, is the main unmeasured disturbance and occurs in the interval 4.5 £ C Ain [mol/liter] £ 5.7. 3.2. System's Dynamics The plot of the steady state concentration CB over f for a given reactor temperature, T, and inlet composition C Ain (Fig. 2) reveals an interesting behavior of the system. The reactor exhibits a change in gain at the peak of the reactor yield (i.e., where the concentration C B achieves its maximum value), and displays nonminimum-phase behavior (inverse response) for operating points on the left of this peak and minimum-phase behavior with overshoot for operating points on the right. The three curves shown in Fig. 2 were obtained by three different values of CAin. In Fig. 2 it is also shown the zero of the system, which is null for the maximum obtainable CB for a given C Ain and reactor temperature. Observe that, for the case where k1 = k2, the value of f corresponding to the maximum of C B is independent of CAin and is given by fp = k2. For the more general case, the following expression can be used:
406
Figure 2. C B vs. f (left scale) and zero vs. f (right scale) for T = 114.5 ºC and distinct concentrations of C Ain. The Eqns. 10 and 11 can easily be linearized at each steady-state point shown in Fig 2. Based on this linearized model, the transfer function of f to CB can be obtained. The transfer function can be represented in the following form: DCB ( s) K ( bs + 1) = G( s) = (t 1.s + 1).(t 2 .s + 1) Df ( s)
(13)
Figure 3. The transfer function parameters K, t1 and t2 vs. f for C Ain = 4.5 mol/l (dashdot line) and CAin = 5.7 mol/l (dashed line).
A. R. SECCHI, L. G. S. LONGHI and J. O. TRIERWEILER The parameters K, t1 and t2 of this transfer function are shown in Fig. 3 for the extreme CAin concentrations. Note that the dominant time constant, t1, is independent of CAin, whereas K, t2 and b (b = 1/zero, see Fig. 2) present a small variation with CAin. 4. Results 4.1 Controllers Tuning To allow comparisons, all controllers were tuned with the same default parameters: P0 = 1 P = 20 M= 3 R = 0,01 Q=1
The results for the controllers, except for the linear one which does not work well even with P = 100, are showed at the Fig. 7. Figure 8 shows the process gain estimated by the adaptive RLS identification algorithm. It must be noted the identification block is able to change the gain signal. When this change is not achieved the controller fails
The sampling time (ts) was set to 0,002 h. To implement the linear case (b), it was used the process model (Eqns. 10 and 11) linearized around the operation point corresponding to fSS = 11 and CAinSS = 5,1 (CASS = 1.849, CBSS = 1.067). This linearized model was also used as the starting model to the adaptive controller (case c).
Ca_in [mol/l]
4.2 Test Sequence #1 The first sequence of events is composed by step perturbations on C Ain (Fig. 4) and step set-point changes (solid lines on Fig. 5a). This sequence does not present gain/zero sign changes and so have no difficulties to be followed. In fact, all controllers had similarly good performances. This can be verified by looking the results shown on Fig. 5, where is very hard to follow the performance of each controller. The observed steady-state errors occur due to the initial choice of an unreachable operating point (see Fig. 2).
) > K@
5.40
5.20
5.00
4.80
4.60 4.40 0.00
0.40
0.80
1.20
1.60
2.00
Time [hr]
Figure 4. Perturbations sequence for test #1. 4.3 Tests Sequence #2 The second sequence of events tested are given in the Fig. 6 (step changes on CAin) and Fig. 7 (step changes on set-point). This sequence present change of sign in the gain and in the zero of the system transfer function. First, it was tried to maintain the same tuning set used in the former test. However, as all controllers failed when the prediction horizon was set to 20 samples, this parameter was modified to 100 samples.
7LP H>K@
Figure 5. Test sequence #1. Nonlinear MPC (dashed line), LLMN MPC with nonlinear prediction (dash-dot line), LLMN MPC with linear prediction (solid line) linear-adaptive MPC (dotted line) and linear nonadaptive MPC (solid line). 4.4 Comments and Comparison It could be observed from the tests that if there are no gain/zero sign changes it is possible to obtain an arbitrarily satisfactory tuning to all MPC controllers, even to the linear case (b). However, if these changes occur, besides the fact that any fixed linear control fails, it may not be possible to get an arbitrarily good adjust. In this case, the performance will be strongly dependent on the particular MPC implementation.
407
Latin American Applied Research
31:403-410 (2001) -1
corresponding to the centers f = 11.02 h and f = 18.20 -1 h (Trierweiler and Secchi, 1998). 0.10
5.00
Estimated gain
Ca_in [mol/l]
6.00
4.00 0.00
0.40
0.80
1.20
1.60
2.00
Time [hr]
Figure 6. Perturbations sequence for test #2.
0.00
-0.10 0.00
0.40
0.80 1.20 Time [hr]
1.60
2.00
Figure 8. Zoom on the estimated gain (by the adaptive estimation algorithm). Finally, it must be emphasized that the sampling time plays a crucial role in the control tests. Preliminary simulations with another choices led the same system to bad responses. This observation about the role of the sampling time on adjustment of MPC controllers had ever been pointed in (Longhi and Secchi, 1996). 5. Experimental Application The experiment described in this section was used to demonstrate the strategies studied could be applied to a real process. The process is a pilot plant composed by a vertical fixed bed tubular reactor. The reactor's extern wall is covered with a firebrick layer where are inserted the electric resistances responsible by the reactor heating. The reactor is divided into 3 zones, each one with a temperature sensor (thermosensor) and a heating element (resistance) as showed in the Fig. 9.
Figure 7. Sequence test #2. Nonlinear MPC (dashed line), LLMN MPC with nonlinear prediction (dash-dot line), linear-adaptive MPC (dotted line) and LLMN MPC with linear prediction (solid line). In respect to the linear-adaptive case, the critical step is the recursive estimation algorithm. There exist a strong interaction between the control and estimation algorithms. Despite the presented results, the adaptive implementation presents an extreme lack of robustness. It is a very complicated task to find acceptable settings to these 2 algorithms together. Concerning to the LLMN implementation, it was noted that is sufficient to use a linear model at each side of the peak of Fig. 2, such as the local models 408
Figure 9. Pictorial representation of the reactor temperature control system. The plant is built at the UFRGS Chemical Engineering Department and is controlled by a PC486/25MHz microcomputer equipped with an 8 bits AD/DA converter (IEE-98) developed at the UFRGS Electrical Engineering Department. The graphical interface to the control algorithm is made by the SISTCON (SISTema para CONtrole de processos)
A. R. SECCHI, L. G. S. LONGHI and J. O. TRIERWEILER software, developed by the UFRGS Simulation Laboratory (LASIM). The three measured temperatures in the reactor zones are the controlled variables and the resistance voltages are the manipulated variables. The tests were restricted to heating and cooling of ethylic alcohol inside the reactor. The control objective was to get a fast heating without overshoot. 45
Temp erature (oC ) e App lied Volt ag e (V)
40 35 30 25 20 High Zone
15
Tempera ture 10
Ap p lied voltag e Set -Point
5 0 0
1
2
3
65
4 Ti me (hou rs )
5
6
7
8
Temperature (oC) and Ap plied Volt age (V)
60 55 50 45 40 35 30 25
Intermed iate Zone
20
Temp erature
15
Ap pl ied Voltag e
10
Set-Point
5 0 0
1
2
3
4 Tim e (hours)
5
6
7
8
Temperature (oC ) and Appl ied Voltage (V)
40 35 30 25 20 Low Zone Temp erature 10
A p pli ed Voltag e S et-Point
5 0 0
1
2
3
4 Tim e (hou rs )
5
6
7
6. Conclusion The success of MPC depends on the predictive capacity of the model. In many cases, due to the its easy implementation and a narrow operating range, it would be possible to use a linear model to predict the plant outputs. However, in some special situations the linear control can not be used. In these cases, it would be desirable to have some alternative approaches to control the plant. In this work, some strategies to achieve this goal were tested. The best performance was obtained with a nonlinear MPC with no model-plant mismatch. Obviously, this is an unrealistic situation. However, the other approaches tested were found to be near this best performance in some situations. It is not so simple to say what of these implementations is the best recommended. The implementation difficulties to all approaches are similar: It is difficult to tune the linearadaptive approach, and the LLMN implementation may demand a great effort to obtain the local models. It would be interesting to carry out a robustness study with these approaches. References
45
15
1989). Because the process does not change its linear dynamics during the processing, a linear decentralized implementation was used. The controller performance to step set-point changes in the 3 zones is shown in the Fig. 10. The results show that the control objective to set-point changes was reached. Similar performance was observed by simulation with the linear-adaptive controller.
8
Figure 10. Temperature and applied voltage in the reactor with GPC controller; (a) high zone, (b) medium zone and (c) low zone. An open-loop identification with the 3 reactor's zones response to a PRBS signal in the manipulated variable was used to make an initial tuning of the GPC's parameters. The MATLAB software was used to develop a multivariable ARX input-output model used in the controller design. The sampling time was set to 15 minutes, P0 and M had unitary choice, P was set to 5 samples and a first order observer polynomial with root equal to 0,8 was used (Clarke and Mohtadi,
Chen H., A. Kremling and F. Allgöwer, Nonlinear Predictive Control of a Benchmark CSTR, Proc. of 3rd ECC, Rome, Italy, 3247-3252 (1995). Clarke D. W. and C. Mothadi, Properties of Generalized Predictive Control, Automatica 25, 859-875 (1989). Engell S. and K. U. Klatt, Nonlinear Control of a Non- Minimum-Phase CSTR, Proc. of American Control Conference, Los Angeles, 2041-2045 (1993). Longhi L. G. S. and A. R. Secchi, Análise dos parâmetros do GPC, Proc. XI Brazilian Congress of Chemical Engineering (COBEQ), Rio de Janeiro, Brazil, (1996). Rohrs C. E., Some Design Guidelines for DiscreteTime Adaptive Controllers, Automatica 20, 653660 (1984). Trierweiler, J. O. and U. Neumann, Redes de modelos locais: uma solução simples para problemas complexos, Proc. XII Brazilian Congress of Chemical Engineering (COBEQ), Porto Alegre, Brazil, (1998).
409
Latin American Applied Research
31:403-410 (2001)
Trierweiler J. O. and A. R. Secchi, Exploring the potentiality of using multiple model approach in nonlinear model predictive control, Workshop on
nonlinear model predictive control: assessment and future directions for research, Ascona, Switzerland, (1998).
Received September 2, 1999. Accepted for publication March 14, 2001. Recommended by A. Bandoni. 410