CHEMICAL ENGINEERING TRANSACTIONS VOL. 81, 2020 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Qiuwang Wang, Min Zeng, Panos Seferlis, Ting Ma, Jiří J. Klemeš Copyright © 2020, AIDIC Servizi S.r.l. ISBN 978-88-95608-79-2; ISSN 2283-9216 Efficient Convex-Lifting-Based Robust Control of a Chemical Reactor Michaela Horváthová*, Juraj Oravec, Monika Bakošová Slovak University of Technology in Bratislava, Faculty of Chemical and Food Technology, Institute of Information Engineering, Automation, and Mathematics, Radlinskeho 9, SK-812 37 Bratislava, Slovak Republic michaela.horvathova@stuba.sk Efficient operation of chemical reactors is a very challenging task. Continuous stirred-tank reactors (CSTRs) are important devices of the process industry. CSTRs have complex non-linear behaviour. CSTRs operation is influenced by various uncertain parameters. The industrial operation of CSTRs still offers lots of opportunities to become more energy efficient. The optimisation-based robust control design evaluates optimal control action in the presence of the uncertain parameters subject to the constraints on manipulated variables and controlled variables, taking into account economic criteria. The main contributions of this project are designing and tuning of the advanced control strategy for a CSTR. Particularly, the robust control method based on the convex lifting is designed for a laboratory CSTR. The novel convex-lifting-based robust control strategy considering the improved control law is developed to optimise the control performance in real-time control. The presented case study is the first analysis investigating the application of robust convex-lifting based control on a CSTR. The reference tracking problem is investigated under various working conditions. In the case study, the controllers are designed with (i) single tunable robust positive invariant (RPI) set and (ii) multiple tunable RPI sets. The designed offset-free convex-lifting-based robust controllers are compared with respect to their control performance and the computational complexity. 1. Introduction Reduction of greenhouse gases emissions is crucial for supporting sustainable industrial production. It is considered that about 75 % of these emissions originate in energy production and consumption (Wang et al., 2019). Controller synthesis methods usually follow these main objectives: safe and sustainable operation and profit maximisation. All these objectives need to be achieved simultaneously, so advanced optimisation-based approaches are employed to control vital parts of industries (Bauer and Craig, 2008). An example of a vital part of the chemical, petrochemical, pharmaceutical, and food industries is a continuous stirred-tank reactor (CSTR). Various reactions may run in a CSTR, however, neutralisation is one of the most important. Especially, pH value control plays a key role in wastewater treatment. Every industrial operation where wastewater is generated has a system for neutralising the pH value of water before it is discharged (Tchobanoglous et al., 2003). Control performance of these systems directly reflects the environmental impact of the operation. Optimal operation of a neutralisation plant is a challenging task. The nonlinear behaviour, multiple steady-states, and heat effects of the chemical reactions lead to time-varying uncertain parameters, which require advanced controllers to handle. One example of an advanced control is a Model Predictive Control (MPC). This approach is optimisation-based, and it is able to handle constraints on controlled and manipulated variables while ensuring stable and safe operation. The future behaviour of the plant is predicted based on the model. The implementation of MPC to control the neutralisation plant is described in Hermansson et al. (2015). In this work, different modelling techniques are used to describe the complex behaviour of the neutralisation plant and their comparison is provided. Because of the nonlinear behaviour of the plant, models with time-varying uncertain parameters are suitable to describe the dynamics of the plant. However, conventional MPC is not able to deal with models with uncertain parameters. To handle these models Robust Model Predictive Control (RMPC) was introduced (Bemporad and Morari, 1999). In Oravec et al. (2017), RMPC was successfully designed and applied to a laboratory DOI: 10.3303/CET2081145 Paper Received: 01/04/2020; Revised: 25/05/2020; Accepted: 31/05/2020 Please cite this article as: Horváthová M., Oravec J., Bakošová M., 2020, Efficient Convex-Lifting-Based Robust Control of a Chemical Reactor, Chemical Engineering Transactions, 81, 865-870 DOI:10.3303/CET2081145 865 neutralisation plant, which was considered also in this case study. In Prokop et al. (2019), a robust controller was designed for a CSTR with a jacket cooling. The robust controller had a structure of two degrees of freedom. In both papers, the simulation and experimental results confirmed satisfying control performance for the reference tracking and disturbance rejection. The drawback of the advanced robust controllers, e.g., RMPC, is the necessity to solve optimisation problems in each control step. This fact restricts application of the advanced robust control methods on industrial hardware, as it is bounded by its computational requirements. To overcome this obstacle, the convex-lifting- based robust control design was introduced in Nguyen et al. (2017). This approach is also optimisation-based, which respects constraints and provides the guarantee of safe and stable operation. It eases the computational burden by solving complex optimisation problems before real-time control. During the real-time control, it solves problems of linear programming (LP). In the paper Oravec et al. (2019a), the original approach proposed in Nguyen et al. (2017) was improved by introducing (i) single tunable robust positive invariant (RPI) set and (ii) multiple tunable RPIs. The main contribution of this paper is to design advanced convex-lifting-based robust control for a laboratory CSTR. A novel approach from Oravec et al. (2019a), that has never been considered for a CSTR before, is designed for a neutralisation plant, to demonstrate its ability to handle complex plants effectively. The case study investigates the results of simulations w.r.t two different approaches: (i) single tunable robust positive invariant (RPI) set and (ii) multiple tunable RPIs. 2. Description of the neutralisation plant Neutralisation is a reaction in which an acid reacts with a base to form salt and water. The pH (potential of Hydrogen) value of the products depends on the strength of the acid and base, their concentrations and amounts mixed together. The laboratory neutralisation plant or CSTR used in this case study is depicted in Figure 1. Considered CSTR of Armfield PCT40 has a complex behaviour, which is caused by the shape of the titration curve. Titration curve reflects the dependence of pH value on the volume of reagent added to the solution. The “S”-like shape of the titration curve is nonlinear, the CSTR’s behaviour is significantly nonlinear, see Oravec et al. (2017). The reaction mechanism is more complex than a single reaction. The chemical reaction of neutralisation can be simplified into the following equation: 𝑁𝑎𝑂𝐻 (𝑎𝑞) + 𝐶𝐻3𝐶𝑂𝑂𝐻 (𝑎𝑞) → 𝐶𝐻3𝐶𝑂𝑂𝑁𝑎 (𝑎𝑞) + 𝐻2𝑂 (𝑙) (1) where the products of the reaction were sodium acetate (CH3COONa) and water (H2O). Sodium hydroxide (NaOH) and acetic acid (CH3COOH) were used as reactants. The neutralisation process ran in a vessel (Figure 1, (I)), which had a volume VCSTR=1.5 dm3. The controlled variable was the pH value of the outlet from the reaction vessel. The pH probe depicted in Figure 1, (II) served as a sensor. The pH value of the outlet solution depended on amounts of acid and base present in the reaction vessel. The manipulated variable was the flow rate of the base qB, while the flow rate of the acid was constant qA. The acidic reactant was fed by the peristaltic pump A (Figure 1, (III)) and the base was fed using the pump B (Figure 1, (IV)). Figure 1: Neutralisation plant of Armfield PCT 40: (I) reaction vessel, (II) pH probe, (III) pump A, (IV) pump B 866 2.1 Mathematical model of the neutralisation plant Because of the complex behaviour of the plant, the introduction of a robust controller is convenient. It is necessary to derive a sufficiently precise mathematical model with uncertainties in the system gain and time constant. Based on experimentally collected data, the step-response-based identification determined multiple system gains and time constants. To describe the nonlinear behaviour of the plant, the step responses were measured in multiple operating conditions. Next, the model of the neutralisation plant was transformed into the form of the state space system in the discrete-time domain subject to the polytopic uncertainties: 𝑥(𝑘 + 1) = 𝐴𝑣 𝑥(𝑘) + 𝐵𝑣 𝑢(𝑘) + 𝑤(𝑘), 𝑦(𝑘) = 𝐶𝑣 𝑥(𝑘), 𝑥(0) = 𝑥0, (2) where k is the discrete-time sample, x(k) is the vector of system states, i.e., pH value in the reaction vessel, u(k) is the manipulated variable, i.e., volumetric flow rate of the pump B, and y(k) is the controlled variable, i.e., pH value in the reaction vessel. The additive disturbance, i.e., the magnitude of the measurement noise is represented by w(k). The parameters Av, Bv, Cv depict state, input and output matrices. The polytopic uncertainty of the controlled system in Eq(2) has the following form: 𝔸 = convhull([𝐴𝑣 , 𝐵𝑣 , 𝐶𝑣 ], ∀𝑣 = 1, 2), (3) where 𝔸 is the convex hull of the system vertexes. The parameter v represents the v-th vertex of the system. Table 1 summarises the minimum and maximum values of the system matrices in Eq(2). Further technical details of the identification are described in Oravec et al. (2017). Table 1: Minimum and maximum parameters of the uncertain discrete-time state-space model Vertex matrix Av Bv Cv Minimum 0.90 9.48 0.01 Maximum 0.95 9.72 0.03 3. Convex-lifting-based robust controller design The details of the convex-lifting-based robust control design are described in the paper Oravec et al. (2019a). The main objective is the advanced optimisation-based robust controller design with the reduced computational effort of real-time control. The controller design procedure is divided into 2 phases: (i) the offline phase, which is evaluated before the real-time control, followed by (ii) the online phase evaluated during the real-time control. The offline phase serves to construct the convex-lifting-based polytopic partition, to design single or multiple RPI sets, and to compute the associated single or multiple linear state-feedback control laws. The main objective of the online phase is to compute the optimal value of the manipulated variable in each control step. In the offline phase, (i) single tunable RPI set or (ii) multiple tunable RPIs can be constructed. When 2 RPI sets are designed: outer RPI set is designed to maximise its volume and to reduce aggressivity of the associated control trajectory and inner RPI set is designed with reduced volume offering a more aggressive controller. The main role of the offline phase is to compute the value of the manipulated variable at each sample time. To compute the manipulated variable, the following scenarios are considered: (i) if system states are present in the inner RPI set, then aggressive controller K2 is implemented; (ii) if the system states are located within the outer RPI set, controller K1 with decreased aggressivity is implemented; (iii) otherwise, if system states are inside the polytopic partition of the convex lifting, then LP problem is solved to compute optimal value of the manipulated variable. The considered linear control laws had the form: 𝑢(𝑘) = 𝐾1 𝑥(𝑘), or 𝑢(𝑘) = 𝐾2 𝑥(𝑘). (4) To remove the steady-state error, the integral action was introduced into the controller synthesis. Vector of system states was extended using integral action in the following way: �̃�(𝑘) = [ 𝑥(𝑘) 𝑥I ] = [ 𝑥(𝑘) ∑ 𝑒(𝑘) 𝑘 𝑗=0 ], (5) where x̃ is the extended vector of states, xI is the integral action state. The parameter e(k) = pHref – pH(k) is the control error computed subject to the reference pH value pHref. Although the implementation of other forms of the integral action, e.g., the velocity form is possible, the considered form enables to preserve the efficient formulation of the optimisation problem. The original uncertain system in Eq(2) and Eq(3) was modified subject to the extended vector of states: 867 �̃�(𝑘 + 1) = �̃�𝑣 �̃�(𝑘) + �̃�𝑣 �̃�(𝑘) + 𝑤(𝑘), 𝑦(𝑘) = �̃�𝑣 �̃�(𝑘), �̃�(0) = �̃�0, (6) where �̃�𝑣 , �̃�𝑣 , �̃�𝑣 are state-space matrices augmented w.r.t. the integral action. During the construction of the RPI sets the following LQR-based quality criterion was used: 𝐽 = ∑ (𝑥(𝑘)T𝑄P𝑥(𝑘) + (∑ 𝑒(𝑖) 𝑘 𝑖=0 ) T 𝑄I (∑ 𝑒(𝑖) 𝑘 𝑖=0 ) + 𝑢(𝑘)T𝑅𝑢(𝑘)) 𝑁 𝑘=0 , (7) where matrix QP > 0 represents the weighting matrix of the proportional part of the controller gain, QI > 0 stands for the weighting matrix associated with integral action from Eq(5). The parameter R represents the weighting matrix associated to the manipulated variables. The weighting matrix associated with system states for (i) single tunable RPI set is defined as Q = diag([QP, QI]). If (i) two tunable RPI sets are designed two pairs of weighting matrices are tuned, then matrices Q1, R1, are associated with outer RPI set and Q2 R2 are associated with inner RPI set. All penalty matrices were tuned to optimise the control performance w.r.t. the worst-case control scenario. The manipulated variable and the system states were restricted within the symmetric constraints in the following form: 𝑢min ≤ 𝑢(𝑘) ≤ 𝑢max, 𝑥min ≤ 𝑥(𝑘) ≤ 𝑥max, (8) where umin, umax and xmin, xmax are the limit values of the manipulated variables and the system states. Further details about tunable convex-lifting-based control are in Oravec et al. (2019a). 4. Results and discussion 4.1 Control setup The numerical simulations were evaluated using MATLAB/Simulink R2019a environment (Mathworks, 2019). To generate the closed-loop system simulations CPU i7 3.4 GHz, 8 GB RAM were provided. The multi- parametric programming for the construction of the convex lifting was handled by the MPT (Herceg et al., 2013). To formulate optimisation problems, YALMIP toolbox (Lofberg, 2004) was employed. In the offline phase, the semidefinite programming (SDP) was solved by the solver MOSEK (Mosek, 2019). In the online phase, the linear programming (LP) was solved by linprog (Mathworks, 2019). At time tstep = 3000 s the following sequence of the step changes of the reference pH value were considered: (1) 7 → 6, (2) 6 → 7. (a) (b) Figure 2: Constructed convex-lifting-based polytopic partition for the model of CSTR with single (a) or multiple (b) RPI sets The overall control time and sampling time were tc = 6,000 s and ts = 10 s. The considered constraints on the manipulated variable in Eq(8) were restrained within the symmetric constraint: -2.5 ≤ u(k) ≤ 2.5. This symmetric constraint corresponds to the following values of voltage and volumetric flow rate of the pump A: 0 V ≤ UA ≤ 5 V 868 and 0 ≤ qB ≤ 12 ml s–1. The constraint on the controlled variable was: -7 ≤ y(k) ≤ 7, which corresponds to the value following values within which pH value is restricted by its definition:0 ≤ pH ≤ 14. The additive disturbance w(k) was limited by maximal amplitude of the measurement noise wmax = 0.1. The weighting matrices during the design of (i) single tunable robust positive invariant (RPI) were set as follows: Q = diag([5, 1]), R = 1. The approach with (ii) multiple tunable RPIs was tuned as follows: Q1 = diag([50, 1]), R1 = 1 and Q2 = diag([5, 1]), R2 = 1. In Figure 2a, the system state x corresponds to the normalised controlled variable and the system state xI represents the state associated with the integral action from Eq(5). The feasible set of the system initial conditions was lifted w.r.t. the piece-wise affine function ℓ(x) representing the lifted value corresponding to the system states. Within the RPI sets the parameter ℓ(x) = 0. 4.2 Closed-loop system simulations (a) (b) Figure 3: Controlled variable (a) and manipulated variable (b) of compared approaches (i) tunable approach (blue dotted), (ii) multiple tunable approach (red solid), reference (a) (black dashed), constraints (b) (dashed black) The convex-lifting-based controllers were designed w.r.t. two different strategies: (i) tunable convex-lifting-based robust control with a single pair of weighting matrices, (ii) multiple tunable convex-lifting-based robust control with multiple pairs of weighting matrices. The parametric solution of (i) tunable convex-lifting-based approach is shown in Figure 2a and the parametric solution of (ii) multiple tunable convex-lifting based approach is depicted in Figure 2b. The trajectories of the controlled variable, i.e., the pH value, are depicted in Figure 3a, while the associated manipulated variable, i.e., the voltage of the pump A is shown in Figure 3b. Table 2: Comparison of convex-lifting-based robust control approaches Approach V [–] tset (1) [s] tset (2) [s] σ (1) [%] σ (2) [%] ISI [-] (i) tunable 272.9 655 660 5.7 4.5 3,298 (ii) multiple tunable 776.7 585 590 3.3 2.7 3,296 As can be seen in Figure 3a, the designed controllers with integral action were able to ensure the offset-free control trajectory. Despite the fact, that steady-state error was removed, the overshoot was observed in both control trajectories. As shown in Figure 3b, the constraints on manipulated variable were not violated. Properties of both designed convex-lifting-based approaches are summarised in Table 2. The parameter V in Table 2 denotes the total volume of the constructed RPI sets. By maximizing the volume of the RPI set, the complexity reduction during the online phase is achieved. With the increased volume of the RPI set, the necessity to compute the manipulated variable by solving linear programming (LP) decreases. If the states are present in the RPI set, then manipulated variable is computed by linear state-feedback control law. Complexity reduction of online phase means efficient energy managing of the battery life of embedded hardware, which directly contributes to the concept of the Industrial Internet of Things (IIoT). The parameters tset (1), tset (2) and σ (1), σ (2) stand for settling times and overshoots observed during the reference step changes of pH value (1) 7 → 6 and (2) 6 → 7. Settling time was defined as the time at which the trajectory of the controlled variable settled within 5 %-neighbourhood of the reference. The criteria ISI is defined 869 as the integral of squared value of control input. Minimisation of the evaluated quality criteria represents minimisation of the consumption of a reagent, potentially harmful to the environment. As can be seen, the implementation of multiple tunable approach increased the RPI set volume and decreased the settling time, overshoot and the criteria ISI. Control performance and, simultaneously, the complexity of the offline phase were improved. Improved control performance of a CSTR also leads to a faster and more accurate neutralisation, which minimises the negative impacts on the environment. Due to the lack of space, we omit the detailed numerical comparison to other standard control strategies, and it will be addressed in our further research. When compared to RMPC implemented on the neutralisation plant considered in this case study, the implementation of the convex-lifting-based strategies increased overshoot decreased settling time. 5. Conclusions The convex-lifting-based robust control was applied to the model of the CSTR using a simulation case study. The reference tracking problem was analysed subject to the (i) single tunable RPI set and (ii) multiple tunable RPIs. The steady-state error was successfully removed using the extended vector of states in both analysed approaches. The implementation of (ii) multiple tunable RPIs approaches generated an improved control performance and increased volume of RPI set when compared to (i) single tunable RPI. Improved control performance can be interpreted as possible decreased production costs and environmental impacts. Increased volume of RPI set means reduced computational complexity and increased possibilities for industrial application of the novel approach. The control trajectories promise the possibly successful laboratory implementation of the convex-lifting-based control approaches on the neutralisation plant. The future research will be focused on the possibility of laboratory implementation on CSTR, future industrial application and comparison with other existing robust control methods. Acknowledgements The authors gratefully acknowledge the contribution of the Scientific Grant Agency of the Slovak Republic under the grants 1/0545/20, the Slovak Research and Development Agency under the project APVV-15-0007, and the Research & Development Operational Programme for the project University Scientific Park STU in Bratislava, ITMS 26240220084, supported by the Research 7 Development Operational Programme funded by the ERDF. References Bauer M., Craig I., 2008, Economic assessment of advanced process control: A survey and framework, Journal of Process Control, 18, 2-18. Bemporad A., Morari M., 1999, Robust model predictive control: A survey in: Robustness in Identication and Control, Springer, London, UK. Herceg M., Kvasnica M., Jones C., Morari M., 2013, Multi-Parametric Toolbox 3.0. European Control Conference, Zurich, Switzerland, 502–510. Hermansson A. W., Syafiieb S., 2015, Model predictive control of pH neutralization processes: A review, Control Engineering Practice, 45, 98-109. Löfberg J., 2004, Yalmip: A toolbox for modelling and optimization in MATLAB. Proc. of the CACSD Conference, Taipei, Taiwan, 284-289. Mathworks, Inc., 2019, MATLAB R2019s <www.mathworks.com> accessed 15.03.2020. Mosek ApS, 2019, MOSEK v8.1 <www.mosek.com> accessed 15.03.2020. Nguyen N. A., Olaru S., Rodríguez-Ayerbe P., Kvasnica M., 2017, Convex liftings based robust control design, Automatica, 77, 206-213. Oravec J., Bakošová M., Hanulová L., Horváthová M., 2017, Design of robust MPC with integral action for a laboratory continuous stirred-tank reactor, In Proceedings of the 21st International Conference on Process Control, Štrbské Pleso, Slovakia, 459-464. Oravec J., Holaza J., Horváthová M., Nguyen N. A., Kvasnica M., Bakošová M., 2019, Convex-lifting-based robust control design using the tunable robust invariant sets, European Journal of Control, 49, 44-52. Prokop R., Matušů R., Vojtesek J., 2019, Robust control of continuous stirred tank reactor with jacket cooling, Chemical Engineering Transactions, 76, 787-792. Tchobanoglous G., Burton F., Stensel H., 2003, Wastewater Engineering. Metcalf & Eddy Inc., New York, USA. Wang X. C., Klemeš J. J., Dong X., Sadenova M., Varbanov P. S., Zhakupova G., 2019, assessment greenhouse gas emissions from various energy sources, Chemical Engineering Transactions, 76, 1057- 1062. 870