PRES22_0231.docx DOI: 10.3303/CET2294169 Paper Received: 14 April 2022; Revised: 18 May 2022; Accepted: 23 May 2022 Please cite this article as: Galčíková L., Horváthová M., Oravec J., Bakošová M., 2022, Self-Tunable Approximated Explicit Model Predictive Control of a Heat Exchanger, Chemical Engineering Transactions, 94, 1015-1020 DOI:10.3303/CET2294169 CHEMICAL ENGINEERING TRANSACTIONS VOL. 94, 2022 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Yee Van Fan, Jiří J. Klemeš, Sandro Nižetić Copyright © 2022, AIDIC Servizi S.r.l. ISBN 978-88-95608-93-8; ISSN 2283-9216 Self-Tunable Approximated Explicit Model Predictive Control of a Heat Exchanger Lenka Galčíková*, 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, Radlinského 9, SK-812 37 Bratislava, Slovak Republic lenka.galcikova@stuba.sk The energy efficiency of industrial plants is an important matter regarding the goals of a climate-neutral economy by 2050. To increase the energy efficiency of industrial plants, sophisticated controllers that optimise the performance of the plants, with regards to the minimisation of their energy consumption, are considered. Such a control strategy is an explicit solution of model predictive control (MPC) which meets the requirements of the implementation of optimal control along with the ability to be easily applicable in practice as the optimisation problem is not solved in the online phase. This paper proposes the idea of self-tunable approximated explicit MPC. The tuning of approximated explicit model predictive control is performed through linear interpolation between two optimal explicit MPC controllers. The explicit controllers are constructed based on different input penalty matrices - the upper and lower bound on penalty matrix R. A novel idea of self-scaling of penalty matrix R is presented. Based on the distance of the reference value from the steady state, the aggressiveness of the controller is adjusted whenever a change of reference occurs. The proposed idea of this online self-tuning of the explicit controller is applied to a system of a laboratory heat exchanger. As the aggressiveness of the approximated controller is adjusted during control, improvement in control performance is achieved compared to the explicit controllers utilizing the lower and the upper bound on penalty matrix R during the whole control. In addition, the proposed method also leads to decreased energy consumption associated with the volume of the heating medium. After 1 hour of plant operation, the heating medium savings reach 80 ml and the associated energy savings are approximately 2 kJ. 1. Introduction The achievement of the plan concerning the climate-neutral economy by 2050, requires a reduction of global CO2 emissions to net zero. This aim requires the implementation of CO2 and energy-reducing technologies on a global scale in every part of the industry (Lameh et al., 2021). One way to increase the efficiency of industrial plants is to use more sophisticated controllers to optimise the performance of the plants, concerning the minimisation of energy consumption. Minimisation of energy consumption goes hand in hand with the minimisation of CO2 production. This can be achieved by considering MPC to control plants in the industry (Morato et al., 2020). MPC can consider the future behaviour of the plant and based on this knowledge and tuning of various parameter, it optimises the control performance of the plant. Therefore, the selection of the tuning parameters dictates the control performance of the plant (De Schutter et al., 2020). As a consequence, the real-time tunability of these weighting matrices is a desired property of the MPC framework (Sorourifar et al., 2021). In Moumouh et al. (2019), the authors utilize an online learning algorithm based on artificial neural network to adjust the MPC tuning parameters. Another online tuning approach in Al-Ghazzawi et al. (2001) exploits the sensitivity expressions for the closed-loop response with respect to the MPC tuning parameters. Despite all its advantages, the practical implementation of the MPC framework is quite narrowed due to the strictly limited memory and computational capacity of industrial computers. To overcome this obstacle, the authors in Bemporad et al. (2002) introduced the so-called explicit MPC. Explicit MPC evaluates the parametric solution of the MPC for all possible combinations of initial conditions before the real-time control. During the 1015 real-time control, explicit MPC evaluates only the point-location problem and simple multiplication to compute the optimal control input. The disadvantage of explicit MPC is that the evaluation of the parametric solution, which is computed before real-time control, is very computationally demanding. Therefore, any tuning of explicit MPC is computationally very expensive. In Baric et al. (2005), the authors present the parametrisation of the explicit MPC by the input penalty. Despite the significant contribution of this work, this approach is only applicable to MPC optimisation problems with a linear cost function. In Klaučo and Kvasnica (2018), another idea of real-time tunable explicit MPC was introduced, which was not limited only to linear optimization problems. This work presented a form of approximated explicit MPC, in which adjusting the input penalty in a certain range is possible in real-time control. In this approach, one stores the explicit MPC precomputed for two different values of tuning parameters. During the real-time control, the user can select the tuning parameter within the range of the two different values of tuning parameters. Based on linear interpolation, the approximated control input is computed without the necessity to recompute the explicit MPC again. Based on linear interpolation, the approximated control input is computed without the necessity to recompute the explicit MPC again. A novel work by Oravec and Klaučo, (2022) follows up on the idea of real-time tunable approximated explicit MPC and guarantees the closed-loop system stability and recursive feasibility. The previous works related to tunable explicit MPC did not focus on the parameters tuning strategy itself. This work presents an extension of the tunable explicit MPC introduced in Klaučo and Kvasnica, (2018). It provides the significant ability to adjust the aggressiveness of the controller without the necessity to intervene and tune the penalty matrices during control. The idea is to offer a self-tuning algorithm to adjust the input penalty based on the reference value and current operating conditions. This extension is demonstrated considering a model of a laboratory heat exchanger. Heat exchangers are widely used in various branches of the industry. Therefore, their optimised operation corresponds with climate-neutral policies. To demonstrate the benefits of the proposed approach in terms of climate neutrality, the energy consumption of the heat exchanger is analysed. 2. Preliminaries In this section, the theoretical background associated with the explicit model predictive control is briefly explained. Next, its modification to the online tunable explicit model predictive control is introduced. 2.1 Explicit model predictive control Let us consider the following reference tracking formulation of MPC problem: min 𝑢𝑢0,…,𝑢𝑢𝑁𝑁−1 � �(𝑥𝑥ref − 𝑥𝑥𝑘𝑘)T𝑄𝑄(𝑥𝑥ref − 𝑥𝑥𝑘𝑘) + 𝑢𝑢𝑘𝑘 T𝑅𝑅𝑢𝑢𝑘𝑘�, 𝑁𝑁−1 𝑘𝑘=0 (1) s. t. 𝑥𝑥𝑘𝑘+1 = 𝐴𝐴𝑥𝑥𝑘𝑘 + 𝐵𝐵𝑢𝑢𝑘𝑘, (2) ∆𝑢𝑢𝑘𝑘 = 𝑢𝑢𝑘𝑘 − 𝑢𝑢𝑘𝑘−1, (3) 𝑥𝑥min ≤ 𝑥𝑥𝑘𝑘 ≤ 𝑥𝑥max, (4) 𝑢𝑢min ≤ 𝑢𝑢𝑘𝑘 ≤ 𝑢𝑢max, (5) ∆𝑢𝑢min ≤ ∆𝑢𝑢𝑘𝑘 ≤ ∆𝑢𝑢max, (6) 𝑥𝑥0 = 𝑥𝑥(𝑡𝑡), 𝑢𝑢−1 = 𝑢𝑢∗(𝑡𝑡 − 𝑇𝑇s), (7) where k = 0, ..., N-1 denotes the step of prediction horizon N, t denotes time, x is the vector of system states, u is the vector of the input variable. A represents the discrete-time system state matrix, and B is the discrete-time input matrix. Vectors umin, umax, xmin, xmax, ∆umin, ∆umax are the limit values on the input, state, and change of the input variable, respectively. The positive semi-definite matrix Q ≥ 0 penalises the control error, i.e., the difference between the current system state and its reference value xref. The positive definite matrix R > 0 penalises the value of the input variable. Ts represents sampling time and symbol * denotes the optimal solution. The aim of the optimisation problem in Eq(1) – Eq(7) is to minimise the control error as well as the input variable, which is interconnected with control costs. By tuning the weight matrices Q and R, an optimal control input can be obtained according to requirements on control performance and energy savings. By updating the initial condition in Eq(7) with current measurement and previous optimal control input, MPC becomes a receding control strategy. 1016 In many practical applications, it is often impractical or even impossible to implement a control strategy, in which solving an optimisation problem is necessary. The reason is that the industrial hardware is often limited in terms of computational capacity and available memory. In the fundamental work by Bemporad et al. (2002), the authors show how to perform offline all the computations necessary for the implementation of MPC, while preserving all its above-mentioned characteristics. In the offline phase, the explicit solution of the optimisation problem is obtained for the whole set of feasible initial conditions – parameters 𝜃𝜃. The parametric solution of Eq(1) – Eq(7) acquires the form of a piece-wise affine control law defined over a union of r critical regions: 𝑢𝑢(𝑡𝑡) = � 𝐹𝐹1𝜃𝜃 + 𝑔𝑔1 if 𝜃𝜃 ∈ ℛ1, ⋮ 𝐹𝐹𝑟𝑟𝜃𝜃 + 𝑔𝑔𝑟𝑟 if 𝜃𝜃 ∈ ℛ𝑟𝑟. (8) In Eq(8), F and g, respectively, represent the slope and affine section of the control law corresponding to each critical region ℛ. In the online phase, a real-time control is realised. Based on identifying the critical region where the parameter value lies, the optimal value of control input is calculated considering the corresponding control law. 2.2 Tunable explicit model predictive control As the optimisation problem stated in Eq(1) – Eq(7) is precomputed for a specific combination of weight matrices Q and R, it is not possible to tune the explicit model predictive controller online. In Klaučo and Kvasnica (2018), the authors present the approximated explicit MPC using linear interpolation. The idea is to construct two explicit controllers with two different weight matrices R, while penalty Q remains fixed. More specifically, the setup of the two controllers is chosen such that Rl < Ru, where Rl = diag(rl,1,…,rl,m) and Ru = diag(ru,1,…,ru,m) denote the lower and the upper bound on penalty matrix R, respectively. In the online phase, the objective is to interpolate between the optimal control input ul corresponding to the explicit MPC associated with Rl and the control input uu associated with Ru. When a specific value of penalty R = diag(r1,…,rm) is determined such that rl,i ≤ ri ≤ ru,i, for i = 1,…,m, the approximated control action is calculated as: 𝑢𝑢(𝜃𝜃, 𝑅𝑅) = 𝑅𝑅 � 𝑎𝑎1 ⋮ 𝑎𝑎𝑚𝑚 � + � 𝑏𝑏1 ⋮ 𝑏𝑏𝑚𝑚 �, (9) where 𝑎𝑎𝑖𝑖 = 𝑢𝑢l,𝑖𝑖−𝑢𝑢u,𝑖𝑖 𝑟𝑟l,𝑖𝑖−𝑟𝑟u,𝑖𝑖 , 𝑏𝑏𝑖𝑖 = 𝑟𝑟l,𝑖𝑖 𝑢𝑢u,𝑖𝑖−𝑟𝑟u,𝑖𝑖 𝑢𝑢l,𝑖𝑖 𝑟𝑟l,𝑖𝑖−𝑟𝑟u,𝑖𝑖 . (10) The ability to tune the controller online is achieved at the expense of storing and evaluating two explicit controllers. Moreover, the optimality is sacrificed as the control inputs are evaluated using linear interpolation. On the contrary, the ability to adjust the aggressiveness of the explicit model predictive controller online, can be a very beneficial tool in practice. 3. Self-tuning of explicit model predictive control In many practical applications, it is often beneficial to modify the controller parameters according to current operating conditions. The necessity to adapt the controller may occur due to changing properties of the controlled system or requirements on control performance. In this section, the idea of self-online tuning is presented. It provides the ability to adjust the aggressiveness of the controller without the necessity to intervene and tune the penalty matrices during control. The need to adjust the controller online may often arise from tracking a time-varying reference. This paper focuses on adjusting the matrix R whenever the reference value is changed. The further the reference value is from the steady state, the more aggressive controller is tuned. The procedure of tuning the controller is based on evaluating the difference between the reference and the steady state, and using this deviation to scale the penalty matrix R. Let us first determine the maximal possible deviation from the steady state based on the constraints on system states: 𝑑𝑑max = max (|𝑥𝑥min|, 𝑥𝑥max) (11) The maximal deviation from the steady state dmax in Eq(11) also corresponds to the maximal absolute value of reference which can be set during control. Based on the information about the maximal deviation from the steady state, the ratio p between the current reference and the maximal deviation is evaluated as 1017 𝑝𝑝 = |𝑥𝑥ref| 𝑑𝑑max . (12) Note that the ratio p can acquire values from interval 〈0, 1〉 as |xref| ≤ dmax. Therefore, the ratio p represents a way how to normalise the deviation from steady state and is exploited to scale the penalty matrix R. If the system has only one state (or if only one output out of multiple states is controlled), the ratio p is scalar and can be directly utilised in scaling the penalty matrix R. If multiple states are controlled, p becomes a vector. In such a case, it is suggested to exploit the maximal element of vector p to tune the controller: 𝑝𝑝 = max � |𝑥𝑥ref| 𝑑𝑑max � . (13) The ratio p is utilised to scale the penalty matrix R in the following way: 𝑅𝑅 = (𝑅𝑅𝑢𝑢 − 𝑅𝑅𝑙𝑙)(1 − 𝑝𝑝) + 𝑅𝑅𝑙𝑙. (14) It can be seen in Eq(14) that with increasing value of the ratio p, the value of R approaches Rl. On the contrary, if p decreases, R converges to Ru. In other words, higher ratio p leads to more aggressive controller, as the control inputs are penalised more compared to the setup associated with Ru. 4. Case study Heat exchangers are widely used in various branches of the industry. Therefore, the proposed control method was investigated on an experimentally identified model of a laboratory liquid-to-liquid plate heat exchanger, see Figure 1. The controlled variable is the temperature T of heated liquid at the outlet of the heat exchanger (Armfield, 2007). The manipulated variable is the volumetric flow q of the heating medium. For more detailed description of the plant and model identification see e.g., Oravec et al. (2019). Figure 1: Laboratory heat exchanger Armfield Process Plant Trainer PCT23: cold medium (1) and heating medium (2) pumps, cold medium (3) and hot medium (4) tanks, heat exchanger (5) The matrices of the state-space model of the system, discretised with sampling time Ts = 1 s, are 𝐴𝐴 = 0.94, (15) 𝐵𝐵 = 0.97. (16) One of the significant benefits of MPC is the ability to limit the values of the state, input, and output variables. Based on the physical limitations of the process, the input variable, its change, and the state variable are constrained in the following way: −16 °C ≤ 𝑥𝑥 ≤ 8 °C, (17) −5 ml s−1 ≤ 𝑢𝑢 ≤ 5 ml s−1, (18) −3 ml s−1 ≤ ∆𝑢𝑢 ≤ 3 ml s−1. (19) Note, that the states x and inputs u represent variables in the deviation form. The values of temperature and volumetric flow of the heating medium corresponding to zero steady state are Ts = 45 °C and qs = 6 ml s-1. 1018 The adjustable parameters of the MPC optimisation problem are prediction horizon N and weight matrices Q and R. The length of the prediction horizon N was set to 20 steps. The tuning parameter Q penalizing the squared control error was set to Q = 10. The lower bound Rl and the upper bound Ru of weight matrix R penalizing the squared control input were set followingly: 𝑅𝑅l = 5, 𝑅𝑅u = 100. (20) Subsequently, the explicit model predictive controllers were constructed based on both control setups, i.e., using the lower and upper bound on weight matrix R. Both controllers are necessary for the online phase for linear interpolation of the control action. As the adjustment of the weight matrix R depends on the change of reference value, tracking of multiple references was investigated in the control simulation. The reference temperature Tref was set to the following values: 49 °C, 39 °C, 33 °C, and 46 °C. The trajectory of the controlled variable can be seen in Figure 2a, and the corresponding trajectory of the manipulated variable can be seen in Figure 2b. In the legends of both figures, the control profiles utilizing the controller associated with Rl, are denoted with lower index “l”, and the control profiles corresponding to upper bound on R, i.e., Ru, are denoted with lower index “u”. Lower index “a” denotes the control profiles associated with approximated control inputs based on the linear interpolation described in Section 2.2. a) b) Figure 2: Comparison of the controlled variable (a) and the manipulated variable (b) generated by optimal explicit MPC and approximated controller It can be seen in Figure 2b that the profile of control inputs associated with Ru is damped as the control inputs are more penalised compared to the controller with Rl. As a consequence, this damped controller does not reach the third reference temperature which is far from steady state, see Figure 2a. On the contrary, the approximated controller is aggressive enough to achieve all reference values but does not lead to such an oscillating trajectory as the optimal controller associated with Rl. Note that the aggressivity of the approximated controller is variable. It depends on the distance of the reference value from the zero steady state. With every reference step change, the weighting matrix R is recomputed. The first and the fourth reference values were achieved with a relatively damped trajectory. On the other hand, the further the reference was set from the zero steady state, the more aggressive setup of the controller was used for interpolation. The aggressive behaviour can be seen in tracking the second and the third reference temperature. The control performance of all three controllers was evaluated and analysed by various criteria summarised in Table 1. Specifically, the following criteria were evaluated: the integral squared value of control error ISE, the volume of heating medium V consumed in control, and the corresponding energy E necessary to heat the heating medium used for control. Table 1: Control performance comparison R ISE [°C2 s] V [ml] E [kJ] Rl 931 1,742 36.2 Ru 941 1,745 36.3 Ra 886 1,735 36.0 1019 When comparing the qualitative criterion ISE, applying the approximated control actions lead to the highest accuracy. Moreover, the approximated controller leads to a reduction in heating medium consumption. This is also linked with savings of the energy necessary to heat the heating medium. Note that the improvement factors in the evaluated criteria are not very significant as they were evaluated for 300 seconds of control simulation. After 1 hour of plant operation, the heating medium savings would reach 80 ml and 2 kJ of energy would be saved. Moreover, when considering large-scale industrial heat exchangers, the savings would be nonnegligible. 5. Conclusions This work focuses on self-tunable explicit model predictive control of a heat exchanger. The tuning of approximated explicit MPC is based on linear interpolation between the optimal solutions evaluated by two explicit MPC controllers. The setup of the explicit controllers differs only in weight matrix R. In this paper, a novel idea of self-scaling of matrix R is presented. Based on the distance of the reference value from the steady state, the aggressiveness of the controller is recomputed when the reference value changes. The self-tuning of the approximated explicit controller was applied to a system of a laboratory heat exchanger. Tracking of multiple reference values was investigated and control performance was evaluated. As the controller's aggressivity modified with each step change of the reference, the control performance improved compared to the explicit controllers utilizing the same penalty matrix R during the whole control. The proposed method also decreased the volume of the heating medium and energy consumption associated with heating, which reflects the goals of a climate-neutral economy by 2050. After 1 hour of plant operation, the heating medium savings reach 80 ml and the associated energy savings are approximately 2 kJ. The future work will focus on two main challenges. First, the model of the considered heat exchanger is linear although the heat transfer process is nonlinear. Therefore, the proposed method will be practically implemented and explored on the laboratory heat exchanger. Secondly, the scaling of R matrix corresponding to MIMO systems will be further investigated, as it represents a more challenging task when tuning the controller’s aggressivity. Acknowledgments The authors gratefully acknowledge the contribution of the Scientific Grant Agency of the Slovak Republic under the grants 1/0545/20, 1/0297/22, the Slovak Research and Development Agency under the project APVV-20- 0261. L. Galčíková was also supported by an internal STU grant. References Al-Ghazzawi, A., Ali, E., Nouh, A., Zafiriou, E., 2001, On-line tuning strategy for model predictive controllers. Journal of Process Control, 11, 265-284. Armfield, 2007, PCT 23: Process Plant Trainer, manual, Armfield Limited, Ringwood, UK. Baric M., Baotic M., Morari M., 2005, On-line Tuning of Controllers for Systems with Constraints, Proceedings of the 44th IEEE Conference on Decision and Control, 8288-8293. Bemporad, A., Morari, M., Dua, V., Pistikopoulos, E.N., 2002, The explicit linear quadratic regulator for constrained systems. Automatica, 38, 3-20. De Schutter J., Zanon M., Diehl M., 2020, TuneMPC —A tool for economic tuning of tracking (N)MPC problems, IEEE Control Systems Letters, 4, 910-915. Klaučo, M., Kvasnica, M., 2018, Towards on-line tunable explicit MPC using interpolation, In Preprints of the 6th IFAC Conference on Nonlinear Model Predictive Control, Madison, Wisconsin, USA. Lameh M., Dhabia M.A., Linke P., 2021, Cost Analysis for CO2 Reduction Pathways, Chemical Engineering Transactions, 88, 583–588. Morato M.M., Normey-Rico J.E., Sename O., 2020, Model predictive control design for linear parameter varying systems: A survey, Annual Reviews in Control, 49, 64-80. Moumouh, H., Langlois, N., Haddad, M., 2019, A Novel Tuning approach for MPC parameters based on Artificial Neural Network, IEEE 15th International Conference on Control and Automation (ICCA), 1638-1643. Oravec, J., Klaučo, M., 2022, Real-time tunable approximated explicit MPC. Automatica, 110315. Oravec, J., Bakošová, M., Galčíková, L., Slávik, M., Horváthová, M., Mészáros, A., 2019, Soft-constrained robust model predictive control of a plate heat exchanger: Experimental analysis. Energy, 180, 303-314. Sorourifar, F., Makrygirgos, G., Mesbah, A., Paulson, J.A., 2021, A data-driven automatic tuning method for MPC under uncertainty using constrained Bayesian optimization, 16th IFAC Symposium on Advanced Control of Chemical Processes, 54, 243-250. 1020 PRES22_0346.pdf Self-Tunable Approximated Explicit Model Predictive Control of a Heat Exchanger