Strojniški vestnik - Journal of Mechanical Engineering 59(2013)2, 112-123 © 2013 Journal of Mechanical Engineering. All rights reserved. D0l:10.5545/sv-jme.2012.619 Received for review: 2012-06-01 Received revised form: 2012-12-04 Accepted for publication: 2012-12-14 Nonlinear Control of a Hybrid Batch Reactor Simon Štampar1* - Saša Sokolič1 - Gorazd Karer2 1 Metronik d.o.o., Slovenia 2 University of Ljubljana, Faculty of Electrical Engineering, Slovenia This paper introduces a new class of advanced control algorithms for batch-reactor temperature control where a nonlinear PI controller with a feed-forward part in a cascade combination with a P controller is used. The main goal of the algorithm is to optimize production by lowering the costs of the temperature control and increasing the quantity and quality of the chemical, biological, pharmaceutical, food and beverage products produced in these reactors. The algorithm is designed to cope with the constraints and the mixed discrete and continuous nature of the process by manipulating variables for heating and cooling. The stability and robustness of the control algorithm is proven through the Popov Stability Criterion. The simulation results of the proposed algorithm show much better performance compared to a conventional cascade PI control structure, which is most commonly used in industry. Furthermore, the study also shows real-time implementation on a bioreactor using the proposed algorithm. Keywords: nonlinear process control, cascade control, batch reactor, temperature control 0 INTRODUCTION These days the use of batch reactors in the chemical, pharmaceutical, food and beverage industries is very common. According to some statistics, 50% of all production processes in industry are batch-type processes [1]. The term batch reactor is used for a variety of process operations, such as chemical reactions, product mixing, batch distillation, crystallization, solid dissolution, and polymerization. In some cases these reactors have specific, role-dependent, names, such as crystallizer or bioreactor. A typical batch reactor consists of a vessel and a heating -cooling system. The authors in [2] and [3] recognize that, because of the versatility, drastic changes in the pre-described temperature, mixed continuous and discrete hybrid nature of the batch reactor, a rapid and precise temperature control is hard to achieve, especially with conventional PI control algorithms, which are most commonly used in the process industry. Today, forced by competitiveness and the optimization of production costs, we strive to lower the costs of the temperature control and increase the quantity and quality of the products produced. To achieve better temperature control, which is essential for a large number of reactors, an improvement in the control algorithm was made by using a nonlinear PI controller in a cascade. Another important aspect of the control algorithm is the simplicity of the design and implementation, because these are widely used in real processes, spatially on low-cost hardware implemented by process engineers. The batch reactors we are dealing with are of a hybrid and nonlinear nature, because of the discrete heating-cooling mediums and the continuous position of the analogue valve. Over the last three decades in the fields of modelling, simulations and temperature control of batch reactors, a lot of research and development has been carried out. This is reflected in many published studies in the field of advanced control principles for the temperature control of batch reactors. In [4], a historical review of the development of control algorithms is presented. Surveys with examples and explanations of the theoretical and mathematical background for the following fields are given: optimal control [5] to [7]; internal model control [8] to [11]; predictive control [12] and [13]; adaptive control [14] and [15]; nonlinear control [16] to [20]; fuzzy-model-based controls [21] and [22]. Some of the advanced control algorithms are already used in industry, but most of them are only presented in scientific studies. From the conclusions of these reports we can summarize that the use of advanced control algorithms - because of the higher quality, quantity and lower cost requirements - are increasingly necessary. Therefore, a lot of improvement is possible in this field, especially if the advanced algorithm is implemented in a real process. The most promising concepts in the field of adaptive control are [23] to [28]. The authors in [28] developed a self-tuning adaptive control, whose performance meets the required strict temperature tolerances in the polymerization reactor. The field of optimal control is represented by [29] to [33] and the field of predictive control by articles [34] to [37]. More recently, the model predictive functional control (PFC) scheme has been commonly used for the temperature control of the batch reactor's content, as seen in [38] to [40]. In the field of nonlinear control the authors in [41] developed a new nonlinear observer-based controller for the control of a continuous stirred tank 112 *Corr. Author's Address: Metronik d.o.o., Stegne 9a, 1000 Ljubljana, Slovenia, simon.stampar@metronik.si reactor with recycle. As mentioned before, this paper introduces a new class of advanced control algorithm, where a nonlinear PI controller with a feed-forward part in a cascade combination with a P controller is used. The main goal of the proposed algorithm is fast and exact reference temperature tracking and a fast disturbance rejection. What is more, with this algorithm the number of heating-cooling medium switchings, and consequently their consumption, should be as low as possible. A good process model is needed for the development and testing of the proposed algorithm. The authors in [42] to [45] discuss different types of batch reactors, which are used in the chemical, biological, pharmaceutical, food and beverage industries. They also present different modelling techniques for these reactors. Our choice for the development and testing of the proposed algorithm is a theoretical model for the process of heating and cooling the reactor's content. In the literature, a number of papers and books have been published that discuss the construction of a theoretical model, such as in [46]. The basic theoretical models of a batch reactor are described in [46] to [49]. These works contain theoretical models for different types of batch reactors and discuss the basis of heat conduction between the reactor's jacket, the reactor's core and to the reactor's surroundings. The author in [50] presents a two-stage modelling concept for an industrial heat exchanger using prior knowledge of the process and recorded data. Similar to this approach, a detailed nonlinear theoretical model for the heating and cooling of a hybrid batch reactor was successfully developed in [51]. We also decided to use this theoretical model for the development and testing of our proposed algorithm. For this new class of control algorithms a stability and robustness analysis also has to be conducted. The stability-analysis problem for this process with a nonlinear feedback control algorithm is formulated using the Lur'e problem, which belongs to the group of Lyapunov functions, as described in [52] to [54]. In this particular case we use a sub-class of the Lur'e system studied by Popov, as described in [55] to [58]. A comparison is made to show the performance advantages of this algorithm according to a conventional cascade PI control. This paper also contains an implementation of this algorithm on a real process. In order to show the flexibility of the proposed algorithm, it is implemented on a slightly different type of batch reactor, i.e., a bioreactor. The goal of temperature control is to achieve fast and, more particularly, precise temperature control with fast disturbance rejection over a long time period (weeks). The maximum allowed temperature tolerance is ±0.2 °C. Exceeding the tolerance can harm the product quality or even destroy livings cells in the bioreactor, as these are very sensitive to temperature. The paper is organized in the following way: the first section describes the theoretical model of the batch reactor; the second section contains a detailed description of the proposed algorithm; the third section contains a stability and robustness analysis of the proposed algorithm; the forth section contains the simulation results of the proposed algorithm and a comparison with a conventional PI controller; in the last section an implementation example of this algorithm on a real bioreactor is shown. Finally, we make some concluding remarks. 1 THE HYBRID BATCH REACTOR MODEL The hybrid batch reactor, described in [50], is made of stainless steel and serves to prepare solvents that are used in drug production. Its capacity is 630 liters. The temperature control (heating and cooling) of the reactor's content is performed via pipes wrapped around the wall of the reactor. The heating and cooling occurs via these pipes with a heating-cooling medium (water 50% and glycol 50%) at three different temperatures Tin: Tin1 = -25 °C, Tin2 = 5 °C and Tin3 = 140 °C. The right medium for temperature control is chosen according to the output of the control algorithm. The different input mediums cannot be mixed with each other. Additional adjustment in the control algorithm is made with an analogue valve, which determines the amount of fresh medium pumped into the reactor's jacket. The scheme of the hybrid batch reactor is shown in Fig. 1. Fig. 1. Scheme of the hybrid batch reactor The reactor's core temperature T is controlled TJin, and the reactor's by the jacket inlet temperature, jacket temperature, Tj. The authors in [50] simplified the reactor's jacket as a flat plate connected to the reactor's core with a surface S. The heat transfer between the reactor's core and the jacket is defined by the highly nonlinear overall thermal conductivity U. While the parameters m and c define the mass and heat capacity of the reactors core content, the parameters mj and c}- define the mass and heat capacity of the medium mixture in the reactor's jacket. Other parameters used in the theoretical model are as follows: ® is the flow of the heating-cooling medium; vv (range between 0 and 100%) is the position of the analogue valve that represents the ratio between the fresh input heating-cooling medium Tin and the reflux of the heating-cooling medium Tj. So the theoretical model is defined by the first law of thermodynamics, the conservation of energy, as in [46] and [49], (Eqs. (1) to (3)). T■■ = v T Jin v in c1 - vv )tj (1) dT, j-¿t = ®CjTjin-®CjTj -US(-T) (2) mc— = US ( - T). dt W / (3) The authors in [50] determined that the process of heating and cooling the reactor's contents is highly nonlinear in terms of its parameters. Therefore, the authors developed a complex and detailed nonlinear theoretical model. Due to the nonlinearities of the theoretical model described in [50], we used this detailed model for the development and testing of the advantages of the proposed algorithm in comparison with a conventional cascade PI algorithm. 2 THE NONLINEAR ALGORITHM As already described in the introduction, for the control of the reactor's core and jacket temperature we introduce a new class of advanced control algorithm where a nonlinear PI controller with a feedforward part in a cascade combination with a P controller is used. While the internal proportional term controls the reactor's jacket temperature, the external nonlinear control loop controls the reactor's core temperature. The goal of the control law is to achieve fast and exact reactor-core reference-temperature tracking. It is also very important to optimize the costs of the temperature control. For this reason the number of on/ off valve switchings should be as low as possible. With this restriction we minimize the amount of heating-cooling medium used and extend the lifecycle of the equipment. The main contribution of the new control algorithm is in the external nonlinear control loop. The nonlinear control contains a feedback and feedforward part. The feedback part RFB is made of a modified nonlinear hyperbolic function N(e) with an additional conventional PI controller. The output of the control uFB(t,e) is shown in Eq. 4. f t \ uFB(t,e) = N(e) kCpe(t) + kdJe(c)dT (4) N (e) = 1 + (o -1) p + q - 2 (p+q) where e(t) is the difference between the reference temperature rt(t) and the reactors core temperature T(t). N(e) is a modified hyperbolic function, where p = exp(£j e(t)) and q = exp(-£j e(t)). This function is bounded between 1 (e = 0) and k0 (e = ®). The proportional kcp and integrating part kci define the PI parameters of the proposed algorithm where the integrating part kci serves in steady-state error reduction. The error can be caused by heat losses to the reactor's surroundings, disturbances in the system, heating the reactor's content from mixing and especially endothermic and exothermic reactions, etc. The main idea of this algorithm is that with a larger error e(t) the output of the control action increases much faster than with a conventional PI controller. Such a type of control gives us a large controller output when the reactor's temperature is far from the reference temperature (very fast reference temperature tracking) and a small controller output when it is near the reference temperature (smaller than with a conventional PI controller, and consequently fewer heating-cooling medium switchings). This reduces the heating-cooling medium consumption and extends the equipment's lifecycle. To provide such a type of response the modified hyperbolic function parameters are determined as k0 = 100 and kj = 0.2. The feed-forward part adds the reference temperature to the controller output. The combination of the feedback and feed-forward provides us with a large feedback controller output plus a reference temperature when we are far from the reference and a small feedback controller output plus a reference temperature when we are near the reference. This combination can be employed because we can predict that the reactor's core and jacket temperature will be approximately equalized in the steady state. Before the output of the external nonlinear part can be used for the internal controller reference we have take some limitations into account. The output has to be limited between the highest jacket temperature allowed Tjmax and the lowest jacket temperature allowed Tjmm. In the case where that limit is exceeded we also have to freeze the integrating part to avoid windup. We can now define the nonlinear control uc(t,e) with the feedback and feed-forward parts for the whole operating range, as shown in Eqs. (5) and (6). ( ' ^ uc (t,e) = N(e) kcpe(t) + kci je(t)c1t + t (t) (5) ■(t,e ) = (t,e) S Tmin < uc (t,e)< Tj jmin T■ jmax jmin T jmax jmin > uc (,e) ( ,e )> Tj jmax • (6) The internal controller of this algorithm is a conventional feedback proportional controller Rj, which controls the reactor's jacket inlet temperature Uj(t) (Eq. (7)). :{t) = jej {t), (7) So the decision logic DL is defined as follows: if T n(t-) = Tm and vv(t) < -S then Tm(t+) = Tml if T n(t-) = Tn2 and Vv(t) < -S then Tm(t+) = Tm3 (9) if Tn(t-) = Tn2 and Vv(t) > 1+S then Tm(t+) = Tni if T n(t-) = Tn3 and Vv(t) < -S then Tn(t+) = Tn2 In the decision rules, the parameter S defines the dead zone involved in the switchings of the heating-cooling medium. A control scheme for the proposed algorithm is shown in Fig. 2. The parameters Gc and Gj are the transfer functions that represent the dynamics of the heating and cooling of the reactor's jacket and core. Before testing the proposed algorithm we include some limitations in the switchings between the heating-cooling media. First, it is important that only one medium at a time is used. We also have to consider the equipment protection against deformation due to high-temperature changes in the reactor's jacket. So, no direct heating-cooling medium change from Tn1 to Tin3 and vice versa is allowed. To optimize the cooling of the reactor's core we consider that the medium Tin1 = -25 °C is used only if the reactor's core temperature is low enough T(t) < 30 °C. This limitation stems from the fact that the heat transfer between the reactor's jacket and core is much smaller because of a thick film that is formed on the walls inside the reactor's jacket, as described in [50]. where ej(t) is the difference between the nonlinear control output uc(t,e) and the reactor's jacket Tj(t) temperature; kjp is the proportional gain. In the end, the decision logic for the choice of the input heating-cooling medium is defined. First, on the basis of the previous input heating-cooling medium Tin(t-), the position of the mixing valve is calculated from Eq. (1) as follows: ■(' ) = uj (()- T () Tin ((-)- T ( ) ' (8) 3 STABILITY AND ROBUSTNESS ANALYSIS FOR THE NONLINEAR ALGORITHM The dynamics of the batch reactor's heating and cooling are approximately represented by two firstorder transfer functions for the reactor's core Gc (Eq. (10)) and jacket Gj (Eq. (11)), as developed in [50]. The first relates the reactor's core temperature T to the control input Tj given by: Gc(s) = T(s) T j (s) K, Gc 1 TgcS +1 1660s +1 (10) Rj DL Tin ^ Gj Tj Gc —► ui Vv Fig. 2. Control scheme for the proposed algorithm where TGc represents the time constant for the first order process of heating and cooling the reactor's core and KGc its gain. The second relates the reactor's jacket temperature Tj to the control input Uj given by: G (s) = jd Uj (s) K Gj 1 Tj +1 35s +1 (11) where T0]- represents the time constant for the first order process of heating and cooling the reactor's jacket and K0J its gain. So the closed-loop process of heating and cooling the reactor's core and jacket employs the cascade algorithm with the nonlinear PI controller and a proportional term. The nonlinear controller does not employ the feed-forward part, because the stability analysis is made just on the closed-loop process. To investigate the absolute stability of the closed-loop process W(s) (Eq. (12)), we combine the linear parts of the nonlinear algorithm (Eq. (5)), the proportional controller (Eq. (7)), and the two firstorder transfer functions of the heating and cooling of the reactor's jacket (Eq. (10)) and core temperature (Eq. (11)): W (s ) = KGjkjp TGjs' 'KGjkjp K (kcps + kci) s (TgcS +1) . (12) The closed-loop process W(s) is a third-order transfer function, which separates out the nonlinear part of the nonlinear control algorithm. controller GR, with a time constant TIMC as the tuning parameter (Eq. (14)). G* (s) = - (s ) LOc - GIMC (s)Gc (s) KGcTIMC 1 + - TGcS ■(14) The parameters for the batch reactor's temperature control are determined heuristically and are Timc = 335 for the external loop and kjp = 2 for the proportional part of the internal loop. So, the parameters for the conventional PI controller are kcp =- LGc KGcTIMC . = 5 and kci = 1 KGcTIMC =3-10- 3.2 Popov Stability Criterion For the stability analysis of our process we can now apply the Popov Stability Criterion. The Popov plot examines W(jm), which consists of the plot ReWjm) against mlmW(jm), where m is a parameter between (0,®); Re and Im refer to the real and imaginary parts of the plot. From this plot the range of the allowed values for the nonlinear part of the control algorithm can be determine by retaining closed-loop stability. For a better understanding of the Popov Stability Criterion a graphical interpretation is given as follows: The closed-loop system is absolutely stable if the Popov plot P(jm) = Re[Wjm)]+jmlm[W(/m)], m > 0 lies to the right of the line that intercepts the point 1 1 — + j0 with slope — as shown in Fig. 3. k y 3.1 Control Algorithm Parameters (Linear Parts) The parameters for the Pl controller are determined through the internal model control (IMC) approach. The standard IMC design scheme is proposed in [8]. The IMC design is, in the ideal case, the inverse of the process model Gc-1(^) . In the ideal case, inversion can lead to an unstable controller in the case of unstable zeros in the model. In our case the inversion is made by the so-called H2 optimality criterion, as in [8]. The only tuning parameter for the lMC design procedure Gmc is the time constant TIMC (Eq. (13)), which defines the desired closed-loop behavior. gimc (s ) = gcl (s) 1 TgcS +1 ((es +1) Kgc (es +1) .(13) Fig. 3. Popov plot 3.3 Stability Analysis With the assumption that the process model is equivalent to the real process we get a conventional Pl To apply the Popov Criterion to the system, we need to compute the intersection of the Popov plot W(jm) with the real axis. From Eq. (12) we can obtain the real (Eq. (15)) and imaginary (Eq. (16)) parts as follows: , , -C1 ikcpm2 - kcpb1 + kcia1) ReW (jm) =-^--, (15) lu 2\, 2 2 lb1 -m ) + m a1 , , -c1 {(kcpa1 - kci ) + kcA ) mImW(jm) =-^--'-, (16) ((-®2) 2 2 m a, where: a, = TGc + Taj+ KGjkjpTGc = 8.63-10-2 , 1 TGcTGj (l + KC;k:„ ) b -Gj = 516 10_5 and TGcTGj (KGcKGjkjp ) TGcTGj = 3.44 -10-5 . So the Popov plot of W(jm) for the parameter „ t ^ tt, • t ' C1 (kcph - kcia1 ) -c, {kcib) ^ m = 0 starts at the point —-----,-^—- b,2 b,2 V y and for the parameter m = ® terminates at the point (0,0). By investigating the process stability - with the parameters ax, b1, c1 > 0 and kcp, kci > 0 - two distinct cases are possible, depending on the value of the pa a) parameters kcp and k 7 kcp < ai. cp' k In this case mlmW(jm) is always negative for m > 0. This means that the Popov plot of W(jm) remains always entirely in the third and fourth quadrants and does not cross the real axis. Therefore we can easily construct a straight line with a non-negative slope passing through the origin, such that the Popov plot is entirely to the right of this line. From the above conclusions it is obvious that the range of the nonlinear gain is (0,®). The Popov plot starts at point (-0.001,-0.002) for the parameter m = 0 and terminates at point (0,0) for the parameter m = ® (Fig. 4). b) kcp / kcp > ax. With the parameters specified for the temperature control of the batch-reactor content we meet the criterion for Popov stability in case a). To analyse the stability of the proposed control algorithm in the case of process model uncertainties, we calculate the stability condition through the interval of possible values for the dynamics of the reactor's core (Eq. (10)) and jacket (Eq. (11)). Reljw) Fig. 4. Popov plot for stability analysis First, it is given that the time constant of the reactors core temperature TGc varies from 100 to 3000. By following the rules written in case a) we can conclude that the controlled process is stable for the whole interval of possible values for the parameter TGc. In the second process model uncertainty, it is given that the time constant of the reactors jacket temperature TGj- varies from 10 to 300. Again by following the rules written in case a) we can conclude that the controlled process is stable for the whole interval of possible values for the parameter TGJ. 3.4 Robustness Analysis In many cases in industry, the controller output has a delayed impact on the temperature in the reactor's core. This is because of the delays in the position changes of the analogue and on/off valves. To prove the robustness of the control algorithm in such cases we add an additional first-order process to the system GA, which simulates the actuator's delays. 1 Ga (s) = TAs +1 (17) where TA represents the time constant for the first order process that simulates the actuator's delays. For the robustness analysis of the closed-loop process W(s) (Eq. (18)), we combine the following: the linear parts of the nonlinear algorithm; the proportional controller; the two first-order transfer functions of the heating and cooling of the reactors c, = jacket and core temperature; and the first-order transfer function that represent the actuator delays. W (i ) = KGjkjp Tr.Tr.AS2 + Tr.tS + TGjS + 1 + KGjkjp y ( v G^GA* ^±GA- V K Gc (TgcS +1) kcps + kc ^ (18) To apply the Popov Criterion to prove the robustness of the proposed algorithm, we need to compute the crossing of the Popov plot W(jm) with the real axis. From Eq. (18) we can obtain the real (Eq. (19)) and imaginary (Eq. (20)) parts as follows: co2 (d2 kci - a2 d2 kcp ) - b2 d2 kci + d2 c2 kcp ReW(jc) = -22 cp> 22 ci-( (19) 2 I 2 \2 I 2 \2 c (c - b2 ) + (c a2 - c2 ) ffl4 d2 K +m2 (a2 d2 kci - b2 d2k )- d2c2 kci .... vlmW =- ' 2 , 2-T2--(20) ffl (ffl - b2 ) + (ffl a2 - c2 ) where «2 = j + ^ + ^ = 7.92-10-2, TGjTGcTA Tr: + TA + TPc + TrKGikin , = -r-A---Gc r JP = 4.30 -10-3, TJTCTA 1 + Kr;k:„ , =-ruiL = 2.58 -10 and 2 TrjTrcTA = KGjICGckjp = L72 io_6. 2 TGjTGCTA By increasing the actuator delay TA from 10 to 180 seconds, the maximum allowable nonlinear gain A-max decreases from 128 to 35 (Fig. 5). Fig. 5. Maximum allowed nonlinear gain according to the actuator delay From the robustness analysis we can conclude that with longer actuator delays the proposed algorithm may lead to an unstable temperature control. To avoid this we consider the modified hyperbolic function limitation by reducing the parameter k0 to kmax. So, with knowledge of the actuator delay, the upper limit of the nonlinear gain can be precisely defined. The Popov plot for the above process with an actuator delay of TA = 20 seconds starts at point (-0.0023, -0.0020) for the parameter m = 0 and terminates at point (0, 0) for the parameter m = ® (Fig. 6). Now we have to find the crossover frequency where the process crosses the real axis in the Popov plot mlmW(j'm) = 0. By solving the Popov-plot crossover frequency we obtain one suitable solution m0. The value of W(jm) at the crossover is then obtained (Eq. (21)). w02 (d2kci - a2d2kcp )- d2kci + d2c2kcp ReW (jw0 )= 0 1 2 °-22 cpj ,22 " .2 2 cp .(21) »o2 ( (®o2 The equation above indicates that the Popov plot crosses the negative real axis at the frequency m0. Therefore, the maximum allowable nonlinear gain can be determined (Eq. (22)), as described in [55]. 1 ReW (joo (22) Fig. 6. Popov plot for the robustness analysis 4 SIMULATIONS In this section, the proposed algorithm was tested by simulating the theoretical model of the batch reactor s developed in [50]. The main goal of the study was to achieve rapid and exact reference-temperature tracking, a good disturbance rejection, and a minimal number of the heating-cooling medium switchings. The low switching ratio minimizes the amount of heating-cooling medium used, extends the equipment's lifecycle, and lowers the costs of temperature control. For the simulation we assume some disturbances as they appear in the real process. There is a disturbance in the prefabricated heating-cooling media. Because of the sensor noise we consider disturbances in the reactor's jacket temperature Tj and the reactor's core temperature T. The initial values are: reactor's jacket temperature Tj(0) = 0 °C, reactor's core temperature T(0) = 0 °C, and mass of the reactor's contents m(0) = 550 kg. At time t = 400 min we took into account the addition of 80 kg of chilled water, which cools the reactor's content down by 10 °C. At this time, a simulation of a continuous endothermic reaction was also started and this lasted until the end. The parameters for the proposed algorithm with the external nonlinear controller and the internal proportional controller are k0 = 100, kcp = 5, kci = 3-10-3 and kjp = 2. The dead zone of the switchings of the heating-cooling medium was chosen to be 8 = 20. The simulation results are shown in Figs. 7 to 9. Fig. 7 shows the batch reactor's core temperature T and the changing reference temperature rT; Fig. 8 shows the batch reactor's jacket temperature Tj; and Fig. 9 shows the position of the continuous valve. industry cases the PI control algorithm is used for the batch reactor's temperature control. Fig. 7. Control of the reactor's core temperature with the proposed algorithm To show the advantages of the proposed algorithm we compared it to a conventional cascade PI control. This comparison was chosen because in almost all Fig. 8. Reactor's jacket temperature with the proposed algorithm Time[min] Fig. 9. Position of the continuous valve with the proposed algorithm 5.1 Simulations for the Cascade PI Controller The simulation results using a conventional cascade PI controller are given in this subsection. The control scheme is presented in Fig. 10. Different sets of PI parameters were compared. While a "rapid" PI results in rapid reference-temperature tracking and many heating-cooling medium switchings, a "slow" PI results in fewer heating-cooling medium switchings but much slower reference-temperature tracking than with the proposed algorithm. For the sake of comparison, we adjusted the parameters so that the PI controller achieved approximately the same switchings ratio. The dead zone of the switchings of the heating-cooling medium is the same as with the proposed algorithm, 8 = 20. The parameters for the conventional cascade controller with an external PI - C and internal PI - J controller are kcp = 5, kci = 3 10-3, kjp = 5 and ka = 2.5 10-2 . 5.2 Comparison of the Simulation Results As seen from the simulation results using the proposed control algorithm (Figs. 7 to 9) and the PI control algorithm (Figs. 11 to 13) both control approaches give us approximately the same heating-cooling medium switchings. Nevertheless, it is obvious that the proposed algorithm gives us a much faster and more precise reference-temperature tracking than the cascade PI control algorithm. The control performance PI-J DL Tin ^ Gj Tj Gc —► w Fig. 10. Cascade PI control 140 120 100 80 D 60 I- 40 20 0 -20 ---TTC] -SPTO 0 50 100 150 200 250 300 350 400 450 500 Time [min] Fig. 11. Control of the reactor's core temperature (PI) Fig. 12. Reactor's jacket temperature (PI) Fig. 13. Position of the continuous valve (PI) is measured using only the root-mean-square deviation for both algorithms (Eq. (23)). K ( )-t (i ))2 i =l:n RMSD = where n is the number of measurements. (23) The result for the proposed control algorithm is RMSDsq = 4.3012 °C and for the PI control algorithm RMSDPI = 4.8700 °C. From the simulation results we can conclude that the proposed algorithm ensures a much better performance, i.e., reference-temperature tracking, than the PI control approach. The number of heating-cooling medium switchings with the proposed algorithm is also smaller with only 24, rather than the 29 seen with the conventional cascade PI algorithm. Another indicator for the longevity of the equipment is the total movement (TM) of the analogue valve that is calculated in Eq. (24). The total movement for the proposed algorithm is 29.73 and for the PI algorithm it is 47.77. Again, the proposed algorithm gives us the better result. The movement of the analogue valve is reduced by 40% compared to the conventional cascade PI algorithm. TM = vv (1)+ Z|(vv (i)- vv (i-1))) (24) i =2:n 5 REAL PROCESS-TEMPERATURE CONTROL In addition, in order to prove the effectiveness of the proposed algorithm, its implementation on a real process is shown. To show the flexibility of this algorithm it is implemented on a slightly different type of batch reactor, i.e., a bioreactor. The bioreactor is made of stainless steel. It consists of a tank, with a capacity of 40 litres, and a heating-cooling system, which is made of a single external cooling jacket. The heating and cooling is done through the jacket with water at two different temperatures Tin1 = 17 °C, Tin2 = 60 °C. The water for the temperature control is chosen based on the output of the control algorithm. The input waters cannot be mixed with each other. An additional adjustment from the control algorithm is made with an analogue valve, which defines the amount of fresh water pumped into the reactor's n jacket. The approximate scheme of the bioreactor is the same as in Fig. 1. It differs only in the number of heating-cooling inputs. The goal of this temperature control is to achieve fast and, more particularly, precise temperature control with a fast disturbance rejection for very long time periods (weeks or months). The maximum-allowed temperature deviation is ±0.2 °C. Exceeding the tolerance can harm the product quality or even destroy the living cells in the bioreactor, which are very sensitive to temperature. Those living cells are the main component of the end product therefore, lack of temperature control could result in large financial losses. Due to the high sensitivity to temperature, the reactor's jacket temperature is limited to between 42 and 20 °C. The parameters for the proposed algorithm are k0 = 100, kcp = 1, kcl = 2-10~3 and k]p = 3.5. The results from the real-time temperature control of the bioreactor are shown in the Figs. 14 to 16. The reference reactor's core temperature changes from 37 to 20 °C and back to 37 °C. Then it remains at 37 °C for several weeks. the criterion for a less than ±0.2 °C core-temperature deviation. 150 200 250 Time [min] Fig. 14. Real-time bioreactor core-temperature control with the proposed algorithm Fig. 15. Real-time bioreactor jacket-temperature control with the proposed algorithm The real process data from the bioreactor for the temperature control with the proposed algorithm provides us with excellent performance data and meets a 60 c 0 1 40 o 20 0 i : J V N/ 0 50 100 150 200 250 300 350 400 Timetmin] Fig. 16. Real-time position of the continuous valve 6 CONCLUSION The main idea of this study was to develop a new control algorithm that provides us with rapid and precise reference-temperature tracking, a good disturbance rejection, and a minimum number of heating-cooling medium switchings. A new class of advanced control algorithms was developed for temperature control, where a nonlinear PI controller with a feed-forward part in a cascade combination with a P controller is employed. The obtained results showed that the proposed algorithm meets the desired criteria and more. According to the other advanced control principles, the main advantage of the algorithm is in the analytical expression of the control law, which enables its use in real-time control and can be implemented on low-cost hardware by process engineers, who do not have as much knowledge in the field of advanced control algorithms. The stability of the proposed algorithm was successfully studied using the Popov stability criterion. A comparison with a conventional cascade PI controller showed better performance, fewer heating-cooling medium switchings, and less analogue valve movement. This reduces the costs of temperature control by using less heating-cooling medium and extends the lifecycle of the equipment. The implementation example on a real process, where the temperature of a bioreactor's content is controlled, shows excellent performance and meets the criterion for a less than ±0.2 °C core-temperature deviation. 7 ACKNOWLEDGEMENTS Operation part financed by the European Union, European Social Fund. 8 REFERENCES [1] Bratina, B., Tovornik, B., Sokolic, S. (2011). Industrial software tools for system operation analysis and optimization. Automatization in industry and Economy, from: http://www.aig.si/11/images/stories/clanki/Avto_ Procesov_DaljinskoMP4_Bozidar_Bratina_N.pdf, accessed on 2012-06-01. [2] Loeblin C., Perkins, J.D., Srinivasan, B., Bonvin, D. (1999). Economic performance analysis in the design of on line batch optimization system. Journal of Process Control, vol. 9, no. 1, p. 61-78, D0I:10.1016/S0959-1524(98)00034-1. [3] Juba, M.R., Hamer, J.W. (1986). Progress and challenges in batch process control. Chemical Process Control, vol. 3, p. 139-183. [4] Ray, W.H. (1983). Multivariate Process Control - A Survey. Computers & Chemical Engineering, vol. 7, no. 4, p. 367, D0I:10.1016/0098-1354(83)80019-2. [5] Robinson, A.C. (1971). A survey of optimal control of distributed-parameter systems. Automatica, vol. 7, no. 3, p. 371-388, D0I:10.1016/0005-1098(71)90130-0. [6] Feichtinger, G., Hartl, R.F., Sethi, S.P. (1994). Dynamic optimal control models in advertising: Recent developments. Management Science, vol. 40, no. 2,p. 195-226, D0I:10.1287/mnsc.40.2.195. [7] Sargent, R.W.H. (2000). Optimal control. Journal of Computational and Applied Mathematics, vol. 124, p. 361-371, D0I:10.1016/S0377-0427(00)00418-0. [8] Morari, M., Zafiriou, E. (1989). RobustProces Control, Prentice Hall, Englewood Clifs. [9] Economou, C.G., Morrari, M., Palsson, B.O. (1986). Internal model control: Extension to non-linear systems. Industrial & Engineering Chemistry Process, vol. 25, no.2, p. 403-411, D0I:10.1021/i200033a010. [10] Xie, W.F., Rad, A.B. (2000). Fuzzy adaptive internal model control. IEEE Transactions on Industrial Electronics, vol. 47, no. 1, p. 193-202, D0I:10.1109/41.824142. [11] Hussain, M.A., Kershenbaum, L.S. (2000). Implementation of an inverse-model-based control strategy using neural networks on a partially simulated exothermic reactor. Chemical Engineering Research and Design, vol 78, no. 2, p. 299-311, D0I:10.1205/026387600527167. [12] Garcia, C.E., Morari, M. (1989). Model predictive control: Theory and practice: A survey. Automatica, vol. 25, no. 3, p. 335-348, D0I:10.1016/0005-1098(89)90002-2. [13] Qina, S.J., Badgwell, T.A. (2003). A survey of industrial model predictive control technology. Control Engineering Practice, vol. 11, no. 3, p. 733-764, D0I:10.1016/S0967-0661(02)00186-7. [14] Seborg, D.E., Edgar, T.F., Shah, S.L. (1986). Adaptive control strategies for process control: A survey. American institute of Chemical Engineers Journal, vol. 32, no. 6, p. 881-913, D0I:10.1002/aic.690320602. [15] Astrom, K.J., Wittenmark, B. (1997). A survey of adaptive control applications, Dynamic modeling control applications for industry workshop. IEEE Industry Applications Society, vol. 1, p. 649-654. [16] Bequette, B.W. (1991). Nonlinear control of chemical processes: A review. Industrial & Engineering Chemistry, vol. 30, p. 1391-1413, D01:10.1021/ ie00055a001. [17] Isidori, A. (1995). Nonlinear Control Systems. Springer Verlag, London. [18] Chen, L., Bastin, G., Van Breusegam, V. (1995). A case study of adaptive nonlinear regulation of fed-batch reactors. Automatica, vol. 31, no. 1, p. 55-65, DOI:10.1016/0005-1098(94)00068-T. [19] Pringle, T.C., MacGregor, J.E. (1997). Nonlinear adaptive temperature control of multi-product, semi-batch polymerization reactors, vol. 21, no.12, p. 13951409, DOI:10.1016/S0098-1354(97)00013-6. [20] Freeman, R.A., Kokotovic, P.V. (1996). Robust nonlinear control design: State-space and Lyapunov techniques. Systems & Control, Birkhauser, Boston, D0I:10.1007/978-0-8176-4759-9. [21] Sugeno, M. (1985). An introductory survey of fuzzy control. Information Sciences, vol. 36, no. 1-2, p. 5983, D0I:10.1016/0020-0255(85)90026-X. [22] Precup, R.E., Hellendoorn, H. (2011). A survey on industrial applications of fuzzy control. Computers in Industry, vol. 62, no. 3, p. 213-226, D0I:10.1016/j. compind.2010.10.001. [23] Karer, G., Škrjanc, I., Zupančič, B. (2008). Self-adaptive predictive functional control of the temperature in an exothermic batch reactor. Chemical Engineering and Processing, vol. 47, no.12, p. 23792385, D0I:10.1016/j.cep.2008.01.015. [24] Chen, L., Bastin, G., Van Breusegam, V. (1995). A case study of adaptive nonlinear regulation of fed-batch reactors. Automatica, vol. 31, no. 1, p. 55-65, D0I:10.1016/0005-1098(94)00068-T. [25] Louleh, Z., Cabassud, M., Le Lann, M.V. (1999). A new strategy for temperature control of batch reactors: Experimental application. Chemical Engineering Journal, vol. 75, no. 1, p. 11-20, D0I:10.1016/S1385-8947(99)00073-X. [26] Xaumier, F., Le Lann, M.V., Cabassud, M., Casamatta G. (2002). Experimental application of nonlinear model predictive control: temperature control of an industrial semi-batch pilot-plant reactor. Journal of Process Control, vol.12, no. 6, p. 687-693, D0I:10.1016/ S0959-1524(01)00057-9. [27] Le Lann, M.V., Cabassud, M., Le Lann, M.V., Casamatta, G. (1992). Adaptive control of a multipurpose and flexible semi-batch pilot plant reactor. Computers & Chemical Engineering, vol. 16, no. 9, p. 837-848, D0I:10.1016/0098-1354(92)80036-9. [28] Vasanthi, D., Pranavamoorthy, B., Pappa, N. (2012). Design of a self-tuning regulator for temperature control of a polymerization reactor. ISA Transactions, vol. 51, no. 1, p. 22-29, D0I:10.1016/j.isatra.2011.07.009. [29] Chang, J.-S., Hseih, W.Y. (1995). Optimization and control of semibatch reactors. Industrial & Engineering Chemistry Research, vol. 33, no. 2, p. 545-556, D0I:10.1021/ie00041a015. [30] Cuthrell, J.E., Biegler, L.T. (1989). Simultaneous optimization and solution methods for batch reactor control. Computer and Chemical Engineering, vol. 13, no. 1-2, p. 49-62, DOI:10.1016/0098-1354(89)89006-4. [31] Luus, R., Okongwu, O.N. (1999). Towards practical optimal control of batch reactors. Chemical Engineering Journal, vol. 75, no. 1, p. 1-9, DOI:10.1016/S1385-8947(99)00019-4. [32] González-Figueredo, C., Ayala, O.R., Aguilar, S., Aroche, O., Loukianov, A., Sánchez, A. (2011). Optimal temperature tracking of a solid state fermentation reactor. Computer Aided Chemical Engineering, vol. 29, p. 839-843, DOI:10.1016/B978-0-444-53711-9.50168-1. [33] Hosen, M.A., Hussain, M.A. (2012). Optimization and control of polystyrene batch reactor using hybrid based model. Computer Aided Chemical Engineering, vol. 31, p. 760-764, DOI:10.1016/B978-0-444-59507-2.50144-X. [34] Foss, B.A., Johansen, T.A., Sorensen, A.V. (1995). Nonlinear predictive control using local models-applied to a batch fermentation process. Control Engineering Practice, vol. 3, no. 3, p. 389.396, DOI:10.1016/0967-0661(95)00012-J. [35] Clarke D. (1994). Advances in Model-Based Predictive Control. Oxford Science Publication, Oxford. [36] Karer, G., Škrjanc, I., Mušič, G., Zupančič, B. (2007). Hybrid fuzzy model-based predictive control of temperature in a batch reactor. Computers and Chemical Engineering, vol. 31, no. 12, p. 1552-1564, DOI:10.1016/j.compchemeng.2007.01.003. [37] Lakshmanan, N., Arkun, Y. (1999). Estimation and control of batch processes using multiple models. International Journal of Control, vol. 72, no. 7-8, p. 659-675, DOI:10.1080/002071799220849. [38] Richalet, J. (1993). Industrial application of model based predictive control. Automatica, vol. 25, no. 5, p. 1251-1274, DOI:10.1016/0005-1098(93)90049-Y. [39] Škrjanc, I., Matko D. (2001). Fuzzy predictive functional control in the state space domain. Journal of Intelligent and Robotic System, vol. 31, no. 1-3, p. 283297, DOI:10.1023/A:1012011010623. [40] Škrjanc, I. (2008). Self-adaptive supervisory predictive functional control of a hybrid semi-batch reactor with constraints. Chemical Engineering Journal, vol. 136, no. 2-3, p. 312-317, DOI:10.1016/j.cej.2007.04.012. [41] Di Ciccio, M.P., Bottini, M., Pepe, P., Foscolo, P.U. (2011). Observer-based nonlinear control law for a continuous stirred tank reactor with recycle. Chemical Engineering Science, vol. 66, no. 20, p. 4780-4797, DOI:10.1016/j.ces.2011.06.038. [42] Pulley R.A. (1986). Batch Process Modeling. Springs Laboratory, Herts. [43] Luyben, W.L. (2007) Chemical Reactor Design and Control. John Wiley & Sons, Inc., Hoboken, DOI:10.1002/9780470134917. [44] Jakobsen, H.A. (2007) Chemical Reactor Modeling, Springer-Verlag, Berlin. [45] Caccavale, F., Pierri, F., Iamarino, M., Tufano, V. (2011). Control and Monitoring of Chemical Batch Reactors. Springer Verlag, London, DOI:10.1007/978-0-85729-195-0. [46] Preglej, A., Karba, R., Steiner, I., Škrjanc, I. (2011). Mathematical Model of an Autoclave. Strojniški vestnik - Journal of Mechanical Engineering, vol. 57, no. 6, p. 503-516, DOI:10.5545/sv-jme.2010.182. [47] Fowler, A.C. (1997). Mathematical Models in the Applied Sciences. Cambridge University Press, Cambridge. [48] Cuthrell, J.E., Biegler, L.T. (1989). Simultaneous optimization and solution methods for batch reactor control. Computer and Chemical Engineering, vol. 13, no. 1-2, p. 49-62, DOI:10.1016/0098-1354(89)89006-4. [49] Ingham, J., Dunn, I.J., Heinzle, E., Prenosil, J.E. (1994). Chemical Engineering Dynamics: Modelling with PC Simulations. VCH Verlagsgesellschaft, Weinheim, DOI:10.1002/9783527616015. [50] Dragan, D. (2011). Fault Detection of an Industrial Heat-Exchanger: A Model-Based Approach. Strojniški vestnik - Journal of Mechanical Engineering, vol. 57, no. 6, p. 477-484, DOI:10.5545/sv-jme.2010.128. [51] Štampar, S., Sokolič, S., Karer, G., Žnidaršič A., Škrjanc, I. (2011). Theoretical and fuzzy modelling of a pharmaceutical batch reactor. Mathematical and Computer Modelling, vol. 53, no. 5-6, p. 637-645, DOI:10.1016/j.mcm.2010.09.016. [52] Montagner, V.F., Oliveira, R.C.L.F., Calliero, T.R., Borges, R.A., Peres, P.L.D., Prieur, C. (2009). Robust absolute stability and nonlinear state feedback stabilization based on polynomial Lur'e functions. Nonlinear Analysis, vol. 70, no. 5, p. 1803-1812, DOI:10.1016/j.na.2008.02.081. [53] Sastry, S. (1999). Nonlinear Systems: Analysis, Stability and Control. Interdisciplinary Applied Mathematics, Springer-Verlag, Berlin, Heidelberg. [54] Georgiou, T.T., Smith, M.C. (1997). Robustness analysis of nonlinear feedback systems: An input-output approach. Transactions on Automatic Control, vol. 42, no. 9, p. 1200-1221, DOI:10.1109/9.623082. [55] Arcak, M., Larsen, M., Kokotovic, P. (2003). Circle and Popov criteria as tools for nonlinear feedback design. Automatica, vol. 39, no.4, p. 643-650, DOI:10.1016/ S0005-1098(02)00276-5. [56] Krstic, M., Kanellakopoulos I., Kokotovic P. (1995). Nonlinear and Adaptive Control Design. John Wiley & Sons, New York. [57] Popov, V.M. (1960). Criterion of quality for non-linear controlled systems. Preprints of the First IFAC World Congress, Moscow, p. 173-176. [58] Homayoun, S. (1998). A new class of nonlinear pid controllers for robotic applications. Journal of Robotic System, vol. 15, no. 3, p. 161-181, DOI:10.1002/ (SICI)1097-4563(199803)15:3<161::AID-ROB4>3.0.CO;2-O.