scieee AI-readable full text Open interactive document viewer

Application of iterative nonlinear model predictive control to a batch pilot reactor

Ramos Cueli, José; Bordons Alba, Carlos

Abstract

The aim of this article is to present the Iterative Model Predictive Controller, inmpc, as a good candidate to control chemical batch reactors. The proposed control approach is derived from a model-based predictive control formulation which takes advantage of the repetitive nature of batch processes. The proposed controller combines the good qualities of Model Predictive Control (mpc) with the possibility of learning from past batches, that is the base of Iterative Control. It uses a nonlinear model and a quadratic objective function that is optimized in order to obtain the control law. The controller is tested on a batch pilot reactor, and a comparison with an Iterative Learning Controller (ilc) is made. Under input constraints and for this nonlinear plant, a fast convergence rate is obtained with the proposed controller, showing good operational results. Although the controller is designed for discrete-time systems, it is a necessary condition that the continuous-time model does not present blow-up characteristics. The batch pilot reactor emulates an exothermal chemical reaction by means of electrical heating.

Full text

APPLICATION OF ITERATIVE NONLINEAR MODEL PREDICTIVE CONTROL TO A BATCH PILOT REACTOR J.R. Cueli and C. Bordons 1 Escuela Superior de Ingenieros. University of Seville. Camino de los Descubrimientos, s/n. 41092, Seville, Spain [email protected],bor[email protected] Abstract: The aim of this article is to present the Iterative Model Predictive Controller, inmpc, as a good candidate to control chemical batch reactors. The proposed control approach is derived from a model-based predictive control formulation which takes advantage of the repetitive nature of batch processes. The proposed controller combines the good qualities of Model Predictive Control (mpc) with the possibility of learning from past batches, that is the base of Iterative Control. It uses a nonlinear model and a quadratic objective function that is optimized in order to obtain the control law. The controller is tested on a batch pilot reactor, and a comparison with an Iterative Learning Controller (ilc) is made. Under input constraints and for this nonlinear plant, a fast convergence rate is obtained with the proposed controller, showing good operational results. Although the controller is designed for discrete-time systems, it is a necessary condition that the continuous-time model does not present blow-up characteristics. The batch pilot reactor emulates an exothermal chemical reaction by means of electrical heating. Copyright c °2005 IFAC. Keywords: Batch control, optimal control, predictive control, learning algorithms. 1. INTRODUCTION Batch processes are never in steady-state regime since the whole operation is carried out in transient mode. These processes experience continuous transitions and are usually highly nonlinear, involving complex reaction mechanisms and model-plant mismatch. Batch operation is done under unsteady state and reference trajectories are frequently time-varying, making process variables to change over wide ranges exhibiting therefore significant nonlinear behavior. This leads to 1This work was partially supported by Spanish Ministry of Science and Technology under grant DPI2001-2380-C02- 01. The authors acknowledge the Predictive Control Group of the University of Seville for their commentaries. time-invariant models be unsuitable for describing the process and consequently control strategies based upon linear models can drive to significant errors. Nonlinear controllers will be essential for improved performance or stable operation. Nonlinear Model Predictive Control (nmpc) seems to be a good way to tackle the problem. Although there are some preliminary studies about the application of mpc to batch processes (Morari and Lee, 1997), there is still a lot of work to be done in aspects such as modelling, state estimation, stability and computational problems related to dynamic optimization. Iterative controllers (Moore, 1998) have been used originally in robotics (Arimoto et al., 1984) because of its simplicity and effectiveness. Later Copyright (c) 2005 IFAC. All rights reserved 16th Triennial World Congress, Prague, Czech Republic 63 they have been extended to industrial processes (Mezghani et al., 2002). On the other hand, mpc controllers are widely used in process industry (Camacho and Bordons, 2004). Nevertheless, the linear model based controllers are not suitable in this case because of the nonlinearity of the process. Even using a batch controller (based on a linear model), like the one described in Lee et al. (2000), the closed loop behavior is not satisfactory. This is due to the nonlinear characteristics of the process. In this work, two controllers are tested on an exothermal reactor plant: Iterative Learning Control (ilc) and Iterative Nonlinear Model Predictive Control (inmpc). The reaction heat is computed in simulation and produced in a resistance inside the tank, therefore its value is limited. Ilc has been widely studied in literature since Arimoto et al. (1984). It has good convergence properties and it is simple to implement. The only elements needed for the basic implementation are a gain and a memory. The control law is given by the following equation u(t) = uk−1(t) + Kilcek−1(t+d) (1) where kis the batch index, tthe time and dis the delay. It is very important to choose correctly the plant delay d, because an incorrect value (specially lower values than the real plant delay) may lead to instability. The proposed controller, inmpc, is a combination of iterative and nonlinear model predictive controllers and it is devised to control nonlinear batch processes. The use of deviation variables in its formulation simplifies identification task, while iterative nature makes perfect tracking possible, even with plant-model mismatch. The proposed control approach to the problem is based on a modelbased predictive control formulation which takes advantage of the repetitive nature of the process. Like in most of the mpc controllers, inmpc uses a receding horizon strategy; in other case, the matrices appearing in the optimization problem can be quite large. As it is a batch controller, it uses the information available from past batches, using the system trajectory during the last batch to compute the current batch control variable. It also allows the use of input/output constraints, as it is done in mpc. The paper is organized as follows. In section 2 a description of the pilot reactor batch process is presented. Section 3 describes the proposed algorithm, showing the development of the control strategy for the reactor model. This strategy is applied to the laboratory plant and the results are shown in section 4. Finally the major conclusions are drawn in section 5. Fig. 1. Pilot reactor system 2. PROCESS DESCRIPTION The process (figure 1) is a pilot plant, where the chemical reaction is experimentally emulated by generating heat inside the tank with a resistance, in a quantity that is computed on-line integrating the nonlinear dynamical equations. Also, it has a cooling recirculation loop equipped with a heat exchanger, a pump and a valve for controlling the recirculation flow. There are temperature sensors along the plant as well as valves controlling the inlet and outlet water flows. The objective is to control the tank temperature, tracking a desired reference trajectory, which is known. This trajectory can be computed in advance optimizing some cost function. The batch process experiments are performed in the following way. Firstly, the tank is filled with water to a prescribed level. Later, valves are closed in order to keep constant level. Initial conditions (temperatures and tank level) must be the same for every batch. Then, the exothermal reaction starts and a temperature profile must be tracked, using the heat exchanger to compensate the heat produced in the reaction, which is given by Lee et al. (2000): (dCA/dt =−k0e−E RT C2 A Q(t)=(−∆H)V k0e−E RT C2 A (2) where Tis the absolute temperature inside the reactor. The initial concentration of reactive is constant and equal to Ca0. Q(t) is computed (integrating equation (2)) and the equivalent heat is generated into the tank by using the resistance. This experimental emulation of a process in a physical plant is done also in the work of Santos et al. (2000). The kinetics parameters are given in table 1, taken from Lee et al. (2000). It also presents physical plant parameters. First principles are applied to get the plant model for control purposes. Model equation is given by: mC ˙ T=FC (Te−T) + Q(t) (3) where Q(t) is computed using equation (2) and generated at the tank resistance, Cis the specific 64 Table 1. Chemical reaction kinetics and tank parameters Parameter Value Units −∆HV/MCp20 l·K/mol k01.16 ·1017 l/mol ·s E R13550 K Ca00.9mol/l T0303 K M30 ·103g Cp4.18 J/g ·K h0.92 m Fmax 10 l/s Qmax 15 ·103W heat of reactive, mis the tank mass, Fthe water flow, Tethe inlet temperature and Tthe inner temperature (controlled variable). The initial conditions are given by T(0) = T0. Therefore, the complete model is obtained joining together the previous equations. The temperature is the controlled variable and the recirculating water flow is the manipulated variable. If the term Q(t) keeps an approximately constant value at time tfor every batch, modelling task is highly simplified. In fact, it is not necessary to know the generated heat for the purpose of constructing an approximated model for the iterative controller. In a batch process, this term will practically disappear when batch deviation variables are used, letting a small residual term that is included in the plant noise model. Note that, although generated heat can be measured in the laboratory experiments, in general it will be not possible to have a sensor for this variable in the real chemical reactor. The specific heat of reactive and tank mass are known. Hence, only the expression for the water temperature after the heat exchanger and valve characteristics have to be known. The static valve characteristic, linear in this case and the static heat exchanger model can be used because their dynamics are fast in relation to the tank temperature dynamics (singular perturbation hypothesis). The heat exchanger model is given by Te≃βTew+ (1 −β)T(4) where βis the exchanger efficiency β=f(F, Tew−T) (5) and can be computed on-line with the available data (parameters in table 2), being Tewthe temperature of the inlet cold water in the exchanger. The following simple equation is used for calculation: β≃aeF+be(Tew−T) + ce(6) Note that the identification phase is substantially reduced, since part of the model parameters are not needed for an iterative model-based controller in batch processes. The resulting model is approximated, and its quality depends on how much does Table 2. Identified parameters Parameter Value Unit ae−8.78 ·10−4(l/s)−1 be−2.43 ·10−41/K ce0.964 the quantity of heat change from one run to another. In section 4 it is verified, a posteriori, that this quantity is small enough. There are instants at the beginning where the approximation error is bigger, but it is still acceptable for the purpose of controlling the plant. This error tends to zero when the batch number increases. Therefore, from the point of view of the iterative predictive controller, the plant model is obtained substituting (4)-(6) into (3). The heat generated is supposed to be compensated by the controller. The following discrete time model is obtained: Tt+1 =Tt+Ts Ft∆Tet[aeFt+be∆Tet+ce] m(7) where ∆Tet=Tew−Ttand Tsis the sampling time. 3. CONTROLLER SYNTHESIS Controller formulation combines the learning capabilities of iterative controllers with the optimized trajectories of mpc controllers. It is summarized in the following subsections. In order to fix notation, utis the variable uat time treferred to the batch k. The batch index is omitted if the variable is referred to the running batch. 3.1 Past batches information The controller takes advantage of the repetitive nature of the process. It has been noted that using information from past batches to control the new one can improve the tracking performance of the control algorithm. Indeed, perfect tracking is possible in the ideal case (no noise), even with model uncertainty (Xu et al., 2001). The proposed controller can also control nonlinear processes. Although the algorithm is based on a local formulation (i.e. global minimum is not guaranteed), it is applied to the plant, obtaining good results. Perfect tracking could be obtained in the absence of noise and non-repetitive disturbances. Past batches information is taken into account by using batch deviation variables, i.e. the differences between the variables defined at the same time but at consecutive batches. It makes repetitive disturbance rejection a simple fact because this kind of disturbances are cancelled by using batch 65 deviation variables. They are defined in the following way: ˜x(t) = x(t)−xk−1(t) (8) Assume that the plant is given by the model ½˙x(t) = f(x(t), u(t)) + v(t) y(t) = g(x(t)) + w(t)(9) with the constant initial conditions xk(0) = x0 and where vand ware disturbance terms. Substituting the expressions of the deviation variables (8) into the dynamic model (9), we have ½d˜xk(t)/dt =˜ fk¡˜xk(t),˜uk(t)¢ ˜yk(t) = ˜gk¡˜xk(t)¢(10) Past batches information permits better control of the plant because repetitive disturbances are eliminated from the model. Therefore, identification phase is simplified in batch processes and there is no need to include into the model disturbance terms that are repetitive. It is worth to remark that a model-based iterative controller for a batch reactor does not need to model, in the experiment conditions indicated in this work, the kinetic parameters of the chemical reaction. The reason is that the generated heat, although it depends on temperature, is approximately the same at different batches. 3.2 Basic characteristics The proposed control approach to the problem is based on a model-based predictive control formulation, which is suitable to be applied to repetitive or batch nonlinear processes. The characteristics of the controller are: •The model is obtained from plant linearization around a given base trajectory, that is equal to the last batch trajectory. •Like in most of the mpc controllers, it uses a receding horizon strategy. •As a batch controller, it uses the information available from past batches in two ways: using batch deviation variables and computing linearized model around last batch. •Reference trajectory is a combination between the set point and the trajectory of the system in the last batch: r(t) = (1 −α)sp (t) + αyk−1(t). In many cases, α can be make equal to 0, and its only purpose is to smooth the trajectories, making the deviation variables smaller and improving the accuracy of the ltv model. •The linear time-varying (ltv) prediction can be computed (see section 3.3.1) in a similar way that is done in mpc: ˜y=G˜u+f •Possible addition of input or output constraints. •Minimization of a functional: J=ky−rk2+λk˜uk2=k˜y−˜rk2+λk˜uk2 (11) with ˜r(t) = r(t)−yk−1(t) = (12) = (1 −α)sp (t)+(α−1) yk−1(t) 3.3 Control law The so called variational model, which is the original system linearized around a base trajectory, is obtained. The discrete time version of this variational system is the plant model in which is based the mpc controller. If system is linearized around a trajectory close to the one that the system will follow, the linear time-varying (ltv) model shall be quite accurate. This is analogous to the optimizing response equations in the formulation of the epsac controller (Keyser, 1997), with the difference that the base trajectory in inmpc is the one followed by the system in the last batch. It means that the base trajectory is taken in this way with the expectation that it will be close to the trajectory in next batch, or, at least, that the nonlinear terms neglected in the approximation are small enough. The simplified nonlinear state-space model of the system (after disturbance cancellation, equation 10) is linearized around the last batch trajectory ¡xk−1(t), uk−1(t)¢and sampled, obtaining the following ltv system: ½˜xt+1 =At˜xt+Bt˜ut ˜yt=Ct˜xt(13) Remark 1. It is implicitly assumed that the deviation variables are small, so the linearized system is accurate. This can be assured making the control slow (i.e. a few more batches will be needed to get convergence). Remark 2. Deviation variables will tend to zero when the system converges to the reference trajectory, but in the first iterations these variables can be large. In these cases, it may be useful to compute an optimal open-loop solution to the optimization problem, which is applied to the plant for the first iteration of the controller. 3.3.1. Predictor equations If the plant model is given by equation (13) and ξkis an integral white noise, the optimal 1-step ahead prediction is ½˜xt+1|t=At˜xt|t+Bt˜ut ˜yt+1|t=Ct+1 ˜xt+1|t+et+1|t (14) 66 with et+n|t=et|t= ˜yt|t−˜yt|t−1. This means that the best prediction for the error is assumed to be equal to the error at instant k. Note that Ck+n can be computed because the base trajectory is known for every instant of time. The n-step ahead prediction is given by                  ˜xt+n|t=Ãn−1 Y i=0 At+i!˜xt|t+ + n−1 X i=0   n−1 Y j=1+i At+j Bt+i˜ut+i ˜yt+n|t=Ct+n˜xt+n|t+et|t (15) Hence, the prediction is linear and can be put in matrix form: ˜y=G˜u+f(16) where G˜uis the forced response, and fis the free response. The elements of matrix Gand vector f are given by gi,j =Ct+i  i−1 Y h=j At+h Bt+j−1(17) fi=Ct+i  n−1 Y j=0 At+j ˜xt+et+i|t(18) and ˜u= [˜ut˜ut+1 · · · ˜ut+m−1]t(19) ˜y= [˜yt+1 ˜yt+2 · · · ˜yt+p]t(20) Given the prediction (equation 16), the objective function (equation 11) can be optimized. In the non constrained case, it gives the classical result: ˜u=−(G0G+λI)−1G0(˜r−f) (21) with the difference that now Gis a dynamic matrix that represents a ltv model and changes from one batch to another. Notice that this equation corresponds to a control with a gain that is changing at every sampling time. If the problem has constraints, a standard qp problem has to be solved in order to obtain the control law. 4. RESULTS In this section, the controller is tested on the pilot plant and it is compared to a well-known iterative controller. The first batch is obtained for all iterative controllers keeping the control valve constant at 50%. The initial conditions are the same for every run and experiment time is 20 minutes. The hypothesis that the generated heat profile is approximately constant in the closed-loop system has been considered. Experiments have shown that this assumption is adequate. The ilc gain (see section 1) is tuned by simulation and it is made equal to 10. The plant delay is equal to 30s. The sample time is Ts= 15s, so d= 2. ilc control makes the system converge to the reference trajectory under some general conditions. Unfortunately, this convergence can be quite slow. As pointed out by Longman (2000), the error can even increase in the transitory. Therefore inmpc is a good candidate to control this plant in an optimal way. The controller takes into account the process nonlinearity using a ltv model. It permits the controller to work adequately at every time during experiments. In both cases (ilc and inmpc), it is a crucial point to choose correctly the model delay dbecause iterative controllers may lead to instability if model delay is lower than the real one. Figures 2 and 3 illustrate the main difference between both controllers. Although both controllers converge to the optimal temperature profile, inmpc requires only four iterations to get an acceptable fit. An excessively slow convergence is obtained with ilc, or ilc combined with linear mpc (figure 4). It may be not allowed in an industrial plant because the first batches could have to be discarded if tracking errors are large. 0 2 4 6 8 10 12 14 16 18 20 30 35 40 45 Temperature (ºC) 0 2 4 6 8 10 12 14 16 18 20 0 20 40 60 80 100 Valve (%) Time (min) Fig. 2. ILC, fourth iteration 0 2 4 6 8 10 12 14 16 18 20 30 35 40 45 Temperature (ºC) 0 2 4 6 8 10 12 14 16 18 20 0 20 40 60 80 100 Valve (%) Time (min) Fig. 3. INMPC, fourth iteration First iterations of both controllers can be viewed in figures 5 and 6. These 3D figures illustrate well the concept of two independent time variables 67 0 5 10 15 30 35 40 45 50 Temperature (ºC) INMPC, run 2 0 5 10 15 30 35 40 45 50 Temperature (ºC) Time (min) Linear MPC combined with ILC, run 2 Fig. 4. Comparison between linear and non-linear iterative MPC at the second iteration appearing in batch processes: one axis corresponds to time and the other, to batch index. From the experiments, it is clear that, after four iterations, ilc is only able to follow the final descending set point ramp, whereas inmpc performs correctly during all the experiment. The reason is that inmpc uses a ltv model that is also recomputed at every batch, resulting in a time and batch varying control gain (see equation (21), Gis variable, so the control gain too), whereas ilc has a fixed gain. Additionally, the constraints are only considered in the inmpc. Moreover, this controller optimizes a cost function and is based on a nonlinear model. It is the explication that inmpc performs better than ilc. 5. CONCLUSIONS A model based control strategy which is suitable for controlling iterative processes, such as a batch chemical reactor, is presented. The reaction is experimentally simulated by an electrical heating, limiting the model-plant mismatch. The controller, called inmpc, combines standard characteristics of nonlinear model predictive control with iterative learning capabilities. The controller presents a good convergence rate when applied to this simulated pilot plant, that is faster than the one obtained by other iterative techniques such as ilc. Moreover, trajectory tracking is refined at every batch. After some batches, the tracking error tends to zero, surpassing non-learning nmpc controllers whose trajectory is the one computed by the controller in the first run. The modelling task is reduced when batch controller inmpc is used. Although good results have been obtained in this application, a deeper study of aspects such as stability and convergence must be addressed in the future. Fig. 5. ILC, four iterations Fig. 6. INMPC, four iterations REFERENCES Arimoto, S., S. Kawamura and F.Miyazaki (1984). Bettering operation of robots by learning. Journal of Robotic Systems 1(1), 123–140. Camacho, E. F. and C. Bordons (2004). Model Predictive Control 2nd edition. Springer- Verlag. London. Keyser, R. (1997). A gentle introduction to model based predictive control. In: Proc. Int. Conf. Control Eng. and Signal Processing. Lima. Lee, J.H., K.S. Lee and W.C. Kim (2000). Model-based iterative learning control with a quadratic criterion for time-varying linear systems. Automatica 36, 641–657. Longman, R.W. (2000). Iterative learning control and repetitive control for engineering practice. Int. J. Control 73(10), 930–954. Mezghani, M., G. Roux, M. Cabassud, M.V. Le Lann, B. Dahhou and G. Casamatta (2002). Application of iterative learning control to an exothermic semibatch chemical reactor. IEEE Trans. Contr. Syst. Technol. 10(6), 822–834. Moore, K. L. (1998). Iterative learning control: an expository overview. Appl. and Comput. Controls, Sign. Proces. and Circ. pp. 425– 488. Morari, M. and J. Lee (1997). Model predictive control: Past, present and future. In: Proc. PSE’97. Norway. Santos, L., P. Afonso, J. Castro, N. Oliveira and L. Bielgler (2000). On-line implementation of nonlinear MPC: an experimental case study. In: Preprints ADCHEM. Pisa, Italy. Xu, J.-X., T.H. Lee, J. Xu and Q. Hu (2001). Iterative learning control with Smith time delay compensator for batch processes. In: Proc. ACC’01. Arlington, VA. 68