Tube MPC Extension of MPT: Experimental Analysis

The success of the real-world implementation of advanced control policies relies on the robustness of the designed control laws. This paper presents a new software package for the robust model predictive control (MPC) synthesis in the framework of the Multi-Parametric toolbox (MPT) that is representing one of the most successful open-source tools in this field. In this paper, we introduce the Tube MPC design in a user-friendly way. The goal of the paper is to demonstrate that the wide research community may benefit from the ease of the advanced controller design in a few lines of code and its implementation to control the laboratory plant.


I. Introduction
The model predictive control (MPC) [11] is a widelyused optimal control policy, garnered significant popularity worldwide in both, academia and industry, in several past decades, e.g., see [3,15]. The well-elaborated software packages have an irreplaceable dissemination role in providing cutting-edge control algorithms for a wide audience in both, academic research and industrial practice.
There are various tailored software tools dedicated to the MPC design problem, e.g., see MPC Toolbox [12], ACADO Toolkit [7], CasADi [1], to name a few. Among other software packages, the Multi-Parametric Toolbox (MPT) [5] for MATLAB programming environment arise into a well-matured MPC design tool with a special focus on the multi-parametric optimization and the corresponding explicit MPC design. MPT provides all the steps necessary for the construction of the MPC controller including its tuning, and evaluation of the control performance, and offers also export to Python and C-code. Update presented in [9] extends MPT toolbox by introducing the robust MPC design framework. Technically, the robust MPC design for the linear time-invariant (LTI) system is affected by parametric and/or additive disturbances. Although MPT benefits from various advanced methods introduced in [9], e.g., by including the evaluation of the forward/backward robust invariant sets, etc., the evaluation of the worstcase scenario-based robust (explicit) MPC design is hardly tractable and time-consuming. As the complexity of MPC controller design is determined by the number of decision variables and the length of the prediction horizon, such a robust MPC design approach is limited just for the systems with a modest complexity.
Therefore, the main benefit of implementing Tube MPC is that this approach designs robust MPC in a computationally tractable way similar to nominal (non-robust) MPC. Tube MPC was originally introduced in [17,13] and refined in many later works, e.g., by introducing the elastic [19] and homothetic tubes [18], the state estimation [14], the reference-tracking [10], considering the linear parameter-varying (LPV) systems [6], sampled-data systems [4], parallel computing [20], etc.
The main contributions of this paper are twofold. First, we present the new package MPTplus extending the original MPT toolbox by the ability to design, tune, and validate the Tube MPC controllers designed in a user-friendly way. Next, we provide an extensive case study investigating the benefits of the developed package considering the advanced robust control of the laboratory plate heat exchanger.
The paper is organized as follows: the Section II briefly reviews the theoretical backgrounds on the Tube MPC design. Section III introduces the proposed software package. The benefits of the proposed toolbox are demonstrated in Section IV by considering a laboratory analysis of the designed controllers, followed by the main conclusions summarized in Section V.

II. Tube MPC design
This section briefly reviews the main theoretical backgrounds of the original (rigid) Tube MPC design approach proposed in [13]. Consider an uncertain linear timeinvariant (ULTI) system in the form: where t stands for the time instant in the discretetime domain determined by the given sampling time T s . A ∈ R nx×nx is system matrix, B ∈ R nx×nu is input matrix, such that the matrix pair (A, B) is stabilizable. E ∈ R nx×nw is disturbance matrix, x ∈ R nx is the vector of the system states, u ∈ R nu is control action, d ∈ D ⊂ R nx is bounded additive disturbance such that D is compact set containing the origin. For the sake of notation, in ULTI system (1) holds: where X ∈ R nx and U ∈ R nu are polytopes, i.e., compact sets, containing origin in their strict interiors. Assume that the closed-loop system (A + BK) is Schur stable for some given state feedback controller K ∈ R nu×nx . The gain matrix K can be computed by solving the discrete-time Riccati equation: leading to the well-known discrete-time LQ-optimal controller design: where the penalty matrices Q ∈ R nx×nx , R ∈ R nu×nu and Lyapunov matrix P ∈ R nx×nx are set such that Q ⪰ 0, R ≻ 0, and P ≻ 0 hold. The "tube" introduced into the MPC design is evaluated by the convex set T ⊂ R nx and represents the origin for the perturbed system, see [13]. By plugging the LQ-optimal controller as in (5) into (1) and updating the additive disturbances per (2), we obtain an autonomous discretetime uncertain system Subsequently, if T is a robust positive invariant (RPI) set for (6), then we have that following statement holds where ⊕ denotes the Minkowski sum. Obviously, T in (7) is constructed as the minimal RPI set to minimize the conservativeness of Tube MPC design by: where Σ represents a set addition. However, if the K is not a dead-beat controller, then the minimal RPI set T does not necessarily lead to the polytope, see [13]. Therefore, T is designed as the outer approximation of the minimal RPI set. Algorithm constructing such invariant approximations of the minimal robust positively invariant set T is proposed in detail in [16]. Finally, the Tube MPC design problem has the form: for all steps ∀k = 0, . . . , N − 1 along the prediction horizon N . The decision variablesû k ,x k , are optimized subject to the nominal system behaviour in (9c), i.e., an idealized system without the impact of any uncertain parameters. The state and input constraints in (3) are respectively adopted in (9d), (9e) to respect the RPI set T in (7) assuming: (X ⊖ T), (U ⊖ K T) are non-empty sets, convex by definition. Analogous, the initial condition in (9b) takes into account the RPI set T keeping the perturbed system state vector x(t) close to its nominal counterpartx 0 . The terminal constraint in (9f) has the conventional form, i.e., the set X N ⊂ R nx is constructed to be positive invariant, such that no constraints of (9d), (9e) are active. The quadratic cost function in (9a) is minimized considering the Q, R, P as defined for (4). Note, ∥x N ∥ 2 P denotes simplified notation for the weighted two norm:x ⊤ N Px N , and analogous hold for the remaining terms. The corresponding stability and recursive feasibility proofs of (9) are documented in [13].
The control action u(t), which is applied to the controlled plant in (1), is determined by the control law κ : where the symbol ⋆ denotes the solution of the optimization problem in (9) and X F ⊆ R nx is the corresponding domain, i.e., the feasibility set of the optimized initial conditionsx 0 of (9). Tube MPC is implemented in receding horizon fashion, i.e., just the first control action u(t) = κ(x(t)) is applied to the plant and the optimization problem in (9) is re-computed in each control step.
III. Package for Tube MPC design This section briefly reviews the benefits of the package MPTplus 1 from the user's perspective.

A. Installation
MPTplus can be installed in a comfortable way using tbxManager 2 :

tbxmanager install mptplus
The other option is to install the package MPTplus manually and set the corresponding path in MATLAB. We recall that MPTplus is dependent on the MPT toolbox, see [5].

B. Tube MPC Controller construction and evaluation
The benefits of the package are demonstrated by adopting an illustrative example of the Tube MPC design introduced in [13]. First, we use the conventional MPT framework to define the control problem. The ULTI system in (1) for x(0) = [−5, −2] ⊤ and for given matrices in the form: is defined intuitively by calling:  (2)

IV. Experimental analysis
The early stage of the code MPTplus was used to investigate its benefits of easily modifying controller parameters and its implementation using the laboratory case study of heat exchanger control.

A. Laboratory plate heat exchanger
The case study of the developed package was performed using a laboratory heat exchanger Armfield Process Control Trainer PCT23, see Figure 1. The controlled process is the three-stage indirect liquid-liquid plate heat exchanger ( Figure 1, device 1), in which cold medium (water) stored in two retention tanks ( Figure 1, device 2) is heated. The hot medium (water) is preheated to a fixed temperature in the heating tank ( Figure 1, device 3). The heating of hot medium is provided by an electric spiral, controlled by a suitably designed auxiliary PID controller. Cold and hot media are pumped into the heat exchanger by two peristaltic pumps (Figure 1, device 4-5). The flowrate of the cold medium is constant and the flow-rate of the hot medium is manipulated variable. Further technical details are listed in [2].
The process of heating the cold medium is a challenging control problem due to the nonlinear and asymmetric behaviour of the plate heat exchanger. The aim of control is to ensure offset-free reference tracking follows the temperature of the cold medium (cool water) on the output of the heat exchanger from its initial steady-state value T 0 into the required reference values representing a new steady-state value. Tuning such a controller operating in the presence of nonlinearity is a non-trivial control problem. Therefore, this plant was selected to investigate the benefits of the proposed MPTplus package. The tuning parameters of the MPC design and the physical constraints of the manipulated variables can be easily modified and simulated using the MPTplus toolbox, which helps the user stay focused on improving the control performance.

B. Control setup
Since MPC is a model-based control approach, it was necessary to identify the values of the system parameters, first. In industrial practice, it is expected the designed controller provides offset-free reference tracking. For that reason, the considered mathematical model of the plate heat exchanger was augmented by an integral action. The set of experimentally collected data was evaluated using the step-response-based identification method. The resulting matrices of the augmented discrete-time statespace system in (1) are as follows considering the sampling time T s = 3 s. The bound on the additive disturbance d(t) in (1) was determined according to the amplitude value of the measurement noise and the impact of the nonlinearities w max = 0.8. To satisfy the physical limits of the manipulated variable the constraints on the control input u in the deviation form were introduced −30 ≤ u(t) ≤ 20, (13) corresponding to the preferred bounds on the pump supplying the hot medium to the heat exchanger within a range of operating conditions of an interval 5 % − 55 %. In order to improve and analyze the control performance, the other controller was easily tuned considering the relaxed constraints on control input: and these bounds correspond to the operating conditions of an interval 0 % − 85 %. Analogous to other tuning parameters, such as the penalty matrices Q, R, also constraint relaxation has a significant impact on the control performance, as it directly shapes the closed-loop control law, especially, in the case of the robust control policy. The sequence of the references was considered to investigate the control performance subject to both, increasing (heating) and decreasing (cooling) values of the steadystate temperature values. The evaluated set of the operating points was set as follows: 30 • C → 35 • C → 40 • C → 35 • C. Simultaneously, the temperature of the hot medium was kept constant at the value 60 • C using an auxiliary P controller with the proportional gain 0.2.
The parameters of the Tube MPC design problem in (9) were tuned by adjusting the penalty matrices Q, R, and the length of the prediction horizon N . As the identified time constant of the plant was T = 341 s and the sampling time was chosen as T s = 3 s, the length of the prediction horizon was set as N = 60 to sufficiently cover the dynamics of the plate heat exchanger. The extensive laboratory experiments led to the following tuning: Note, 0.1 in Q in (15) tunes the aggressiveness of the controller and 10 penalizes the integral action ensuring the offset-free control performance. This selection of such weighting matrices values was motivated by the aim to reduce the energy consumption needed to heat the cold medium to the reference temperature. Finally, the Tube MPC controller was constructed in MATLAB 2022b programming environment, using toolboxes YALMIP R20210331, MPT 3.2.1, MPTplus, and solver Gurobi 10.0 4 . Tube MPC was executed on CPU i7 1.2 Ghz with 16 GB RAM, and the communication with the laboratory heat exchanger plant was provided via WiFi using eLab toolbox [8].

C. Results and discussion
Measured control trajectories evaluated for the Tube MPC controller setups described in Section IV-B are depicted in Figure 2. The Figure 2a shows the control trajectory of the temperature of the cold medium and Figure 2b plots the associated control inputs -the flow rate of the hot medium fed by the pump into the heat exchanger. Although Figure 2 depicts the original (nonfiltered) trajectory of the controlled temperature T out , the first-order discrete-time domain filter with a time constant T f = 0.5 s was implemented to reduce the measurement noise on the output signal processed by the Tube MPC controller.
We have also investigated the set of control performance criteria and Tables I-II summarize the computed values, where t ϵ is the settling time evaluated for 0.8 neighbourhood of the reference, e max stands for the maximum overshoot, and V , E are the corresponding consumption of hot medium and energy, respectively.
As can be seen in Figure 2a, the controlled variable T out reached the reference value of the new operating point after a relatively small value of the settling time t ϵ . The evaluated values of the settling time t ϵ differ significantly in each case. The settling time of the step changes to the lower temperature is increased due to the nonlinear behaviour of the heat exchanger described in Section IV-A. In the step change of the reference value from 35 • C to 40 • C the control input was firstly too aggressive in both setups, which led to an oscillating behaviour of the output and prolonged settling time. Nevertheless, it can be assumed in the setup with the relaxed constraints on the control input that a greater portion of time is needed to settle the temperature T out , if the reference has decreased (cooling). Similar trend is also visible for the result of the setup with the tight constraints.
On the other hand, control with more relaxed input constraints needed considerably less time to settle the temperature T out , as the control input could be more freely adjusted. Figure 2a illustrates that the maximum overshoot e max is much higher in the case of a decrease of the reference value, see Table II for the computed values. These overshoots were markedly reduced in the case with the relaxed input constraints. Figure 2b shows the control inputs corresponding to the controlled variables described in the previous paragraph. Even though the maximum overshoot e max is the highest in the case of reference change towards lower values (cooling), the manipulated variable reached its constraints in the case of the increasing reference value (heating). Adjusting penalty matrix R could decrease the aggressiveness of the control input, however, there would be the cost of prolonging the settling time.
Besides others control performance indicators, also the volume of the hot medium consumed during the control V and corresponding energy E were evaluated. The results in Tables I-II, show that more water and energy are needed if the controller operates above the initial point temperature. Moreover, even though the control trajectory presented in Figure 2 confirmed the improved result for the control setup with the relaxed constraints (Figure 2a, purple solid; Figure 2b, orange solid), values of energy E and water consumption V are slightly higher in this case. Based on the experimental results, it can be observed that although the control setup with relaxed constraints on control input achieved better control performance of the controlled variable (output temperature T out ), it is at the price of increased demands on the environment.

V. Conclusion and future work
The paper presented a Tube MPC design using the novel software package MPTplus extending the features of the MPT toolbox. The benefits of the proposed package were  (a) Controlled variable -the temperature of the cold medium: control setup with tight input constraints (greem solid), control setup with relaxed input constraints (orange solid), and the reference (black dotted).
(b) Manipulated variable -flow-rate of hot medium: control setup with tight constraints (green solid), control setup with relaxed constraints (orange solid), and hard constraint for the tighter control setup (black dashed). presented using the extensive case study of the control of the plate laboratory heat exchanger. The ease of Tube MPC design and tuning package enabled a user to fully focus their attention on improving the control performance leading to the decreased consumption of hot medium and reduced energy demands. Further development of the software package consider introducing advanced Tube MPC design methods including, e.g., LPV systems [6], sampleddata [4], reference-tracking [10], state estimation [14], introducing elastic tubes [19], homothetic tubes [18], etc. The development of MPTplus will include also deeper integration of the functions available for the conventional (non-robust) MPC controllers designed by the core MPT toolbox, e.g., sub-optimal complexity reduction methods, etc.