Tuning of Multivariable Model Predictive Control for Industrial Tasks

This work is concerned with the tuning of the parameters of Model Predictive Control (MPC) algorithms when used for industrial tasks, i.e., compensation of disturbances that affect the process (process uncontrolled inputs and measurement noises). The discussed simulation optimisation tuning procedure is quite computationally simple since the consecutive parameters are optimised separately, and it requires only a very limited number of simulations. It makes it possible to perform a multicriteria control assessment as a few control quality measures may be taken into account. The effectiveness of the tuning method is demonstrated for a multivariable distillation column. Two cases are considered: a perfect model case and a more practical case in which the model is characterised by some error. It is shown that the discussed tuning approach makes it possible to obtain very good control quality, much better than in the most common case in which all tuning parameters are constant.

Tuning of MPC is an important issue since a good choice of parameters is likely to significantly increase control quality. The prediction and control horizons may be determined taking into account the process dynamics, the possible sampling period of the controller and the computational performance of the hardware platform used [23,24]. Additionally, it is possible to use the automatic tuning methodology [25] in which a step response model is experimentally obtained from the process, and the horizons are chosen using some hands-on tuning rules. A thorough review on how to find proper MPC horizons was given in [26]. On the other hand, the choice of numerous coefficients of the minimised MPC cost function is always an issue. This task is particularly important in the case of MIMO processes with strong interactions between the consecutive inputs and outputs. A few tuning methods have been discussed in the literature. In some simple cases, it is possible to explicitly calculate the tuning coefficients [27,28]. A tuning method based on the Robust Performance Number (RPN) was described in [29]. It is also possible to dynamically calculate set-points for MPC to accommodate user-defined output importance [30]. Multiobjective performance optimisation using the goal attainment approach was considered in [31]. A thorough comparison of a few heuristic optimisation algorithms was reported in [32] (the Particle Swarm Optimisation (PSO) method, the firefly algorithm, the grey wolf optimiser and the Jaya algorithm were used). An application of the genetic algorithm was described in [12], whereas the PSO algorithm used to find the parameters of MPC with model uncertainty was considered in [33]. In general, the optimisation-based tuning methods are very computationally demanding as there are numerous decision variables, which means that a large number of simulations must be performed. As a practical solution, a relatively computationally simple simulation optimisation tuning method presented in [34] may be used. It needs only a very limited number of simulations. The considered tuning method was discussed in [35] for the MPC employed for vehicle obstacle avoidance.
The tuning method discussed in [34] typically uses step set-point changes. In this work, a more industrially practical scenario is considered, i.e., compensation of disturbances that affect the process. The disturbances considered include process uncontrolled inputs and measurement noises. For a MIMO distillation column, the tuning procedure is detailed. Two cases are considered: a perfect model case and a more practical case in which the model is characterised by some error. It is shown that the discussed tuning approach makes it possible to use very good control quality, much better than in the most common case in which all tuning parameters are constant. The multicriteria control assessment is used since the control quality is assessed taking into account three factors: the sum of squared errors, the Huber standard deviation and the entropy [36,37].
The article is structured in the following way. First, in Section 2, the MPC task and its tuning parameters are recalled. Next, in Section 3, the tuning procedure is detailed, and the indicators used for control quality assessment are defined. Section 4 reports an application of the considered method for a MIMO distillation process with industrial disturbances. Finally, Section 5 summarises the article.

MPC Problem Formulation
In this work, we deal with MIMO processes that have as many as n u manipulated variables (inputs) and n y controlled variables (outputs). Hence, the following vectors are used: u = [u 1 . . . u n u ] T and y = y 1 . . . y n y T . At each discrete sampling instant, k = 0, 1, . . ., the MPC algorithm calculates on-line the vector of decision variables, which is defined by the increments of the future manipulated variables [6]: . . .
where N u is the control horizon. The MPC decision variables (1) are found as a result of a computational procedure in which the predicted control quality is optimised. An example of the minimised MPC cost function is: The first part of the cost function measures the control errors predicted over the prediction horizon N. The set-points and predicted values for the future sampling instant k + p known at the sampling instant k are denoted by y sp n (k + p|k) andŷ n (k + p|k), respectively, for all process outputs, i.e., n = 1, . . . , n y . The role of the second part of the cost function is to minimise unwanted big changes of the manipulated variables. In some applications for the cost function (2), the predicted squared values of the future manipulated variables may be also taken into account. The tuning coefficients are: ψ p,n ≥ 0 for p = 1, . . . , N, n = 1, . . . , n y and λ p,n > 0 for p = 0, . . . , N u − 1, n = 1, . . . , n u . Typically, the penalties λ p,n are chosen in such a way that the manipulated variables do not change rapidly. As far as the coefficients ψ p,n are concerned, the choice is more difficult. This is because these coefficients prioritise the predicted control errors of the consecutive controlled variables. Additionally, predicted control errors for different sampling instants over the prediction horizon may be taken into account in a different way. In practice, however, for simplicity, all coefficients ψ p,n are set to a constant value. Unfortunately, as is shown in Section 4, this may deteriorate the resulting control quality. The cost function (2) may be conveniently rewritten in a compact form: where the set-point vector for the sampling instant k + p is denoted by y sp (k + p|k), the predicted vector of the output variables for the sampling instant k + p is denoted byŷ(k + p|k) and both vectors are of length n y . The semidefinite-positive matrix Ψ p = diag(ψ p,1 , . . . , ψ p,n y ) is of dimensionality n y × n y , and the definite-positive matrix Λ p = diag(λ p,1 , . . . , λ p,n u ) is of dimensionality n u × n u . In practice, we usually consider some constraints put on process variables. The typical rudimentary MPC optimisation problem is: where the vectors u min and u max define the minimal and maximal values of the manipulated variables, respectively, the vectors u min and u max define the minimal and maximal changes of the manipulated variables, respectively, and the vectors y min and y max define the minimal and maximal predicted values of the controlled variables, respectively. In spite of the fact that as many as n u N u decision variables (1) are computed at every sampling instant k, only the first n u of them are actually applied to the process; in the consecutive sampling instants, the whole calculation procedure is repeated. In this work, the Dynamic Matrix Control (DMC) algorithm [38] is considered. A characteristic feature of the DMC algorithm is the fact that for prediction, i.e., to calculate the scalarsŷ n (k + p|k) or the vectorsŷ(k + p|k), a discrete-time step-response model of the controlled process is used. The model may be obtained in a very simple way from the real process; no complicated identification algorithms need be used, which is a huge advantage. Since the step-response model is linear in terms of the manipulated variables, minimisation of the MPC optimisation task (4) is, in fact, a quadratic optimisation problem. Details related to the implementation of the DMC algorithm for MIMO processes may be found in [6].

MPC Tuning Procedure
When all parameters ψ p,n for p = 1, . . . , N, n = 1, . . . , n y are optimised at the same time, the optimisation problem has as many as n y N decision variables [12,32,33]. For typical lengths of the prediction horizon and a few controlled variables, the resulting optimisation problem is quite difficult. In order to simplify the computational task, the discussed tuning method is based on the following two rules: • The tuning coefficients for only one manipulated variable are calculated at the same time, i.e., ψ 1,n , . . . , ψ N,n , for the consecutive process outputs n = 1, . . . , n y . • If all the coefficients ψ 1,n , . . . , ψ N,n were optimised directly at the same time by a numerical optimisation procedure, we still would have as many as N decision variables.
As an alternative, that sequence of coefficients is parameterised using Gauss-like functions [34]. At first, a very general approximation of the Gauss function is used in which for one point, the function has a value of K n ; for all other points, it has a default value equal to one: The function (5) is characterised by two parameters: m n and K n . The first one defines the chosen sampling instant within the prediction horizon for which the function has the value of K n . When the parameters m n and K n are selected, the trajectory of the weights is calculated precisely from the Gauss function: where a n defines the spread.
All things considered, irrespective of the number of process outputs and the prediction horizon, in the discussed approach, there are always only three decision variables: m n , K n and a n . What is important is that they are not calculated at the same time, but always, only one parameter is found. Calculations are repeated for all process outputs, n = 1, . . . , n y . Unlike fully-fledged optimisation-based tuning methods, in our simulation-based approach, we simply assess how the consecutive parameters influence the value of the performance indices, and we choose the parameters for which the best results are possible. No numerical optimisation is used, but we simply evaluate the values of control the performance indices for a chosen set of tuning parameters. Of course, our procedure is suboptimal, i.e., one may expect that full numerical optimisation of all tuning parameters at the same time may give better results, but our procedure is deliberately rather uncomplicated and is recommended to be used in industrial applications in which all tuning parameters are usually constant.
The tuning procedure is comprised of the following steps: 1. The trajectory of the N coefficients ψ 1,n , . . . , ψ N,n is found for the controlled variable n. All other coefficients are tuned or have their default value.
(a) The best trajectory (5) is found, i.e., its parameters m n and K n are determined.
i. The constant value of the parameter K n is assumed. Its value has to be larger than one, and it should result in a noticeable change in control quality in comparison with the control quality achieved for the scenario in which all coefficients ψ p,n = 1. ii.
The performance indices are calculated from simulations of the MPC algorithm for a few values of the parameter m n . It is recommended to start the tests from m n = N/2 and analyse the results obtained in some neighbourhood of this value first.
iii. The value of the parameter m n is chosen for which the performance indices are the best. iv.
For the chosen value of m n , the performance indices are calculated from the simulations of the MPC algorithm for a few values of the parameter K n . This step should start with the values of the parameter that are lower than those assumed in the first step. Next, it is increased. It is recommended not to choose too large values of K n as this may result in dangerously large values of the manipulated variables. v.
The value of the parameter K n is chosen for which the performance indices are the best.
The best trajectory (6) is found, i.e., its parameter a n is determined.
i. The selected parameters m n and K n are used. ii.
The performance indices are calculated from the simulations of the MPC algorithm for a few values of the parameter a n . It is recommended to perform simulations starting from relatively low values of the parameter, e.g., a n = 1, and slowly increase it until it is clear that any further increment results in no improvement of control quality. iii.
The value of the parameter a n is chosen for which the performance indices are the best.
2. Tuning is repeated for the consecutive manipulated variables, for n = 1, . . . , n y , i.e., the algorithm goes to Step 1.
Having completed the above procedure, the values of the coefficients ψ 1,n , . . . , ψ N,n are calculated from Equation (6) for the found parameters a n , K n and m n , for all n = 1, . . . , n y . The flowchart of the tuning procedure is depicted in Figure 1.
Let us define the control error for the sampling instant k and process output n: e n (k) = y sp n (k) − y n (k) Although different performance criteria may be used to assess control accuracy, in this work, we use the multicriteria approach based on the following three indicators [36,39]: • the Sum of Squared Errors (SSE n ) of the control error e n , • the Huber standard deviation σ n of the control error e n , • the rational entropy H n of the control error e n .
The above indicators are calculated for all n = 1, . . . , n y controlled variables. In addition to the Gauss function (6), the application of other functions such as bellshaped, triangular and trapezoidal ones was studied in [34]. The tuning procedure is similar, i.e., we do not optimise all parameters at the same time, but the influence of the consecutive parameters is analysed, while the best ones are chosen. It turns out that the proposed Gauss function results in the best control quality. This conclusion is based on the authors' experiences with various MPC control algorithms, applied to a few Single-Input Single-Output (SISO) and MIMO processes.

Simulation Results
The discussed tuning method is verified in the control system of a simulated binary distillation column, which separates a two component mixture of water and methanol. The linear approximation of the process (scaled) is described by the following transfer function model introduced by Wood and Berry [40]: The controlled variables, Y 1 and Y 2 , are: the top product (distillate) composition and the bottom product composition, respectively. The manipulated variables, U 1 and U 2 , are: the reflux flow rate and the vapour flow, respectively. The uncontrolled process input (the disturbance), F, is the flow rate of the input stream. All variables are deviations from a typical operating point, and all variables are dimensionless.
The sampling time of MPC is 1 min. To obtain a discrete process representation that is used to determine the step-response model necessary for prediction in the DMC algorithm [6], we use the forward Euler method and the zero-order holder. As a result, the following transfer function representation of the model (8) is obtained: A resulting step-response model is obtained and next used for prediction in the DMC algorithm [6].
The horizons used in the DMC algorithm are: the prediction horizon N = 30, the control horizon N u = 5 and the horizon of process dynamics D = 100 (the horizon of process dynamics is the number of step-response coefficients taken into account by the model used in the DMC algorithm) [39]. All values of the weights that penalise the excessive increments of the manipulated variables, i.e., λ p,n , are equal to one. In this work, the objective of the controller is to effectively compensate the influence of three types of disturbances: changes of the flow rate of the input stream F, as well as the measurement noise of the first and the second process outputs, denoted as δ 1 and δ 2 , respectively. As many as 600,000 min (samples) are considered, i.e., approximately 417 days. It must be emphasised that in this work, the disturbances are not generated artificially, but real industrial disturbances recorded in a distillation process are used [39]. All 600,000 samples of the disturbances are shown in Figure 2. All coefficients λ p,n = 1 for p = 0, . . . , N u − 1, n = 1, . . . , n u [39]. The problem to solve is to carefully select the tuning parameters ψ p,n for p = 1, . . . , N, n = 1, . . . , n y . For this purpose, the tuning procedure presented in Section 3 is used.
Let us first concentrate on tuning the coefficients ψ p,1 , i.e., for the first process output, p = 1, . . . , N. Initially, the trajectory of the weights ψ p,1 is parameterised by means of Equation (5), which is characterised by the parameters m 1 and K 1 . In the first step of the tuning procedure, the influence of the coefficient m 1 on the performance criteria SSE 1 , SSE 2 , σ 1 , σ 2 , H 1 and H 2 is analysed, and the results are shown in Figure 3. We take into account all three criteria for the first process output, i.e., the indices SSE 1 , σ 1 and H 1 , and we choose the value m 1 = 2 because it gives the best control quality. Next, for the chosen parameter m 1 = 2, in the second step, we assess the influence of the parameter K 1 , and it is shown in Figure 4. It is clear that the best results are obtained for K 1 = 100. Finally, the trajectory of the weights ψ p,1 is parameterised by means of Equation (6), which is characterised by the parameter a 1 as well as the fixed parameters m 1 and K 1 . Figure 5 depicts the influence of the parameter a 1 on the considered performance indices. The best set of control quality criteria is obtained for a 1 = 2.  Next, having tuned the coefficients ψ p,1 , let us concentrate on tuning the coefficients ψ p,2 , i.e., for the second process output, p = 1, . . . , N. In the first step of the tuning procedure, the influence of the coefficient m 2 on the performance criteria is analysed, and the results are shown in Figure 6. We take into account all three criteria for the first process output, i.e., the indices SSE 2 , σ 2 and H 2 . We easily find the best value m 2 = 3. Next, for the chosen parameter m 2 = 3, in the second step, we assess the influence of the parameter K 2 , and it is shown in Figure 7. It is clear that the best results are obtained for K 1 = 100. Finally, Figure 8 depicts the influence of the parameter a 1 on the considered performance indices. The best results are obtained for a 2 = 1.  Figure 7. The second step of tuning the coefficients ψ p,2 : the influence of the coefficient K 2 on the performance criteria SSE 1 , SSE 2 , σ 1 , σ 2 , H 1 and H 2 (for all 600,000 samples). All things considered, the coefficients ψ p,1 are characterised by the set of parameters m 1 = 2, K 1 = 100 and a 1 = 2, while the coefficients ψ p,2 by the parameters m 2 = 3, K 2 = 100 and a 1 = 1. The actual values of the coefficients used in MPC optimisation are computed from Equation (6).
To evaluate the efficiency of the chosen parameters ψ p,1 and ψ p,2 , let us consider the values of all six performance criteria. We not consider only the found coefficients, but additionally, we take into account the most practically cases in which all coefficients are constant, i.e., ψ p,1 = ψ p,2 . In the latter case, we consider six values of the coefficients: 0.1, 1, 10, 100, 1000 and 10,000. The values of the obtained performance criteria are given in Table 1. For almost all considered indices (the only exception is σ 2 , but the difference is not significant), the discussed tuning method gives the best results. For constant weights ψ p,1 = ψ p,2 greater than 10,000, the results do not change.
Let us now consider histograms of the control errors for constant values of the coefficients ψ p,1 , ψ p,2 = 0.1, 1, 10 and for the tuned ones. They are shown in Figure 9. Two observations are possible. Firstly, our tuning method gives the most narrow histograms. Secondly, they do not have long "tails", which means that our method eliminates large negative and positive control errors. Figure 10 depicts the first 1000 samples of the control errors for constant values of the coefficients ψ p,1 , ψ p,2 = 0.1, 1, 10 and for the tuned ones. The obtained trends confirm the observations made on the basis of the histograms, i.e., our tuning method gives the best control quality. Table 1. The values of the considered control quality indices for different constant parameters ψ p,1 , ψ p,2 , as well as for the tuned one (for all 600,000 samples).  In the second part of the simulations, we use the obtained set of tuning coefficients, but all gains of all input-output process channels are increased by 20%. Such a case is particularly interesting since the model used in MPC is (practically) never perfect. Table 2 shows the values of all six performance criteria. Additionally, we consider six cases in which all coefficients are constant and have the values 0.1, 1, 10, 100, 1000 and 10,000, respectively. For almost all considered indices (the only exception is σ 2 , but the difference is not significant), the discussed method gives the best results. For constant weights ψ p,1 = ψ p,2 greater than 10,000, the results do not change.

Parameters
The histograms of the control errors are given in Figure 11, and Figure 12 depicts the first 1000 samples of the control errors. Similar to the perfect model case (Figures 9 and 10), our tuning method gives the best results.

Conclusions
For MIMO processes, the classical optimisation approaches to finding the tuning parameters of MPC algorithms require very long vectors of decision variables. The resulting parameter optimisation task may be solved in simulations using some heuristic optimisation algorithms [12,32,33], but the huge computational complexity of such an approach in practice is an issue (the number of decision variables is large). This work presents a computationally simple approach to tuning of MPC parameters. The coefficients are not optimised directly, but they are parameterised. Moreover, the parameters are not calculated at the same time, but always, only one parameter is optimised. Multicriteria control quality assessment is possible. In this work, the following three indices are used: the sum of squared errors, the Huber standard deviation and the rational entropy. Unlike fully-fledged optimisation-based tuning methods, in our simulation-based approach, we simply assess how the consecutive parameters influence the value of the performance indices, and we choose the parameters for which the best results are possible. No numerical optimisation is used. The resulting tuning procedure is suboptimal, but our procedure is deliberately rather uncomplicated and is recommended to be used in industrial applications in which all tuning parameters are usually constant.
The efficiency of the discussed tuning method is demonstrated for a simulated MIMO distillation column. The classical process control task is considered, which is the compensation of the influence of the disturbances. It is shown that the discussed tuning method makes it possible to find the parameters that result in very good control quality, better than in the case of classical equal and large parameters. It is also shown that the determined set of parameters yields good control also in the imperfect model case.
Finally, let us stress the fact that our tuning method may be used to find parameters of numerous types of MPC algorithms. Classical MPC schemes based on linear models [6], as well as nonlinear ones [41] may be taken into account. Additionally, the constraints of different kinds may be included in the MPC optimisation problem. Nomenclature a n the spread of the Gauss function e n the control error of the nth process output J(k) the MPC cost function K n the parameter that defines the maximum value of the functions (5) and (6)  MIMO Multiple-Input Multiple-Output m n the parameter that defines for which sampling instant p the Functions (5) and (6) have the value of K n N the prediction horizon N u the control horizon n u the number of process inputs n y the number of process outputs SISO Single-Input Single-Output u min , u max the vectors that define the minimal and maximal values of the process inputŝ y n (k + p|k),ŷ(k + p|k) the predicted value for the nth process output and the predicted vector for the sampling instant k + p calculated at the current sampling instant k y sp n (k + p|k), y sp (k + p|k) the set point value for the nth process output and the set-point vector for the sampling instant k + p known at the current sampling instant k y min , y max the vectors that define the minimal and maximal predicted values of the process outputs u n (k + p|k), u(k + p|k) the increment of the nth process input and the increment of the input vector for the sampling instant k + p calculated at the current sampling instant k u(k) decision variable vector of the MPC algorithm u min , u max the vectors that define the minimal and maximal changes of the process inputs Λ p the weighting matrix related to the change of the signal u(k + p|k) λ p,n the weighting coefficient related to the change of the signal u n (k + p|k) Ψ p the weighting matrix related to the predicted control error y sp (k + p|k) −ŷ(k + p|k) ψ p,n the weighting coefficient related to the predicted control error y sp n (k + p|k) −ŷ n (k + p|k)