Experimental Application of Predictive Controllers

Model predictive control (MPC) has been used successfully in industry. The basic characteristic of these algorithms is the formulation of an optimization problem in order to compute the sequence of control moves that minimize a performance function on the time horizon with the best information available at each instant, taking into account operation and plant model constraints. The classical algorithms Infinite Horizon Model Predictive Control (IHMPC) and Model Predictive Control with Reference System (RSMPC) were used for the experimental application in the multivariable control of the pilot plant (level and pH). The simulations and experimental results indicate the applicability and limitation of the control technique.


Introduction
The process control is related to the application of the automatic control principles to industrial processes.The globalization effect upon industries brought a perception of the importance associated to the product quality over organization profits.Because of that, the process control has been more and more demanded and explored, in order not only to assure that the process is according to acceptable performance levels but also to address legal requirements in terms of safety and quality of the products [1].In this context, predictive controllers are able to deal with system requirements in a proper way and simple to be implemented.One of the biggest concerns on control theory is related to the stability of closed loop of systems.It is natural that only stable closed-loop response is considered for real implementation.A representative algorithm of this controller class is Infinite Horizon Model Predictive Control (IHMPC) [2].
During the closed-loop project, there are some theoretical tools that can be incorporated into the controllers and aggregate desirable characteristics.This is the case of predictive controllers that incorporate a reference path in their formulation (RSMPC) [3].In this case, the value of control action is computed from a QDMC (Quadratic Dynamic Matrix Control) problem that has a first-order reference system incorporated directly into the formulation.Consequently, there is an effort for eliminating undesirable situations of too high speed and for balancing the system response.
Most industrial chemical processes have a nonlinear characteristic, although linear controllers are used in many of these systems.The great advantage of this approximation is having an analytical solution to the control problem and also the low computational complexity.This kind of approach is very common in the industry practice.
The pH system is used as a benchmark for applications in process control, mainly because of its strong nonlinear behavior.For the experimental application case addressed in this work, it is a control of multiple inputs and multiple outputs (MIMO), in which inputs are acid and base flows and outputs are reactor level and stream pH output.This system presents not only a nonlinear feature, but also an interaction between inputs and outputs linked to the system directionality.In this kind of system, classical controllers do not work to keep the stability and required performance.In addition, MPC solves the problem of open loop optimal control in real time, considering the current state of the system to be controlled as much as a policy feedback offline.As can be seen in the experimental data, the multivariable system could not be controlled with optimal classical controllers.That is why it was chosen to implement IHMPC and RSMPC predictive controllers in real time [4].Section 2 presents the control algorithms used in the implementation described in this work.In Section 3 there is a description of the experimental system.Section 4 presents the simulations with the controllers and experimental results of the closed loop.Section 5 shows the main conclusions of this paper.

Model Predictive Control
The model predictive control (MPC) theory was originated in the end of 1970s decade and developed considerably ever since [5][6][7][8][9][10].MPC became an important control strategy of industrial applications, mainly due to great success of its implementations in the petrochemical industry.The reason for MPC being so popular might be due to its ability to deal with quite difficult control challenges, although other characteristics such as its ability to control constrained multivariable plants, have been claimed as one of the most important features [6].The ability to handle input, output, and internal state constraints can be assigned as the most significant contribution to the many successful industrial applications [11][12][13].Other benefits to consider are the possibility of embedding safety limits, the possibility of obtaining advantages in using it in highly nonlinear plants as well as in time-varying plants, the consideration of process noise in the formulation, the high level of control performance, reduced maintenance requirements, and improved flexibility and agility [14].
The various predictive control algorithms differ from each other depending on the way the predictive model is used to represent the process, the noise description, and on the cost function to be minimized.There are many control predictive applications well succeeded not only in chemical industry but also in other areas [15].The use of statespace models, in spite of other formulations, was responsible for a substantial maturing of the predictive control theory during the 1990s decade [16].The state-space formulation not only allows the application of linear system theorems already known, but also it makes easier to generalize for more complex cases.In this situation, the MPC controller can be understood as a compensator based on a state observer and its stability, performance, and robustness are determined by the observer poles, established directly by parameter adjustment, and by regulator poles, determined by performance horizons and weights [17].Figure 1 shows the receding horizon strategy, which is the center of the MPC theory.
Figure 2, based on Richalet [18] and Richards and How [19], shows interfacial areas of the MPC control developments.
Considering its application to MIMO processes, MPC deals directly with coordination and balancing interactions between inputs and outputs and also with associated constraints [20].In spite of being really effective in suitable situations, MPC still has limitations as, for instance, operation difficulties, high maintenance cost (as it demands specialized work) and flexibility loss, which can result in a controller weakness.These limitations are not connected only to the algorithm itself, but also to the necessity of a plant model, for which is necessary maintenance.In practical terms, the limits of MPC applicability and performance should not be connected to the algorithm deficiencies, but to the issues linked to the modeling difficulties, sensor adequacy, and insufficient robustness in the presence of faults [15,21].[2].For simplicity the algorithm will be presented only for stable systems.For unstable systems see the reference section [2].The discrete dynamical system used is shown in (1) in which y is the vector output, u is the vector input, and x is the states vector:

IHMPC. The IHMPC formulation was introduced by Muske and Rawlings
The receding horizon regulator is based on the minimization of the infinite horizon open-loop quadratic objective function at time k (2).Q is a symmetric positive semidefinite penalty matrix on the outputs.R is a symmetric positive semidefinite penalty matrix on the inputs.S is a symmetric   horizon open-loop objective.For stable system, Q is defined as the infinite sum (4).This infinite sum can be determined from the solution of the discrete Lyapunov equation (5).Using simple algebraic manipulation, the quadratic objective 0.2 0.4 0.6 0.8 1.2 1.4 1.6 1.8 pH q 2 /q 1 0 2 1 q 3 = 0 mL/s q 3 = 0.05 mL/s q 3 = 0.08 mL/s q 3 = 0.1 mL/s Experimental q 3 = 0.5 mL/s is show in (6).The matrices H, G, and F are showed in ( 7)- : min

H=
2.2.RSMPC.The RSMPC strategy is basically a transformation of an optimization problem with constraints into a quadratic programming problem [3].The RSMPC development is presented next.Consider a general system described by (10).By linearizing (10) with the Taylor's series expansion around the point immediately before the current operational point, one obtains (11).The matrices are defined in ( 12)-( 16).Equation ( 11) is integrated from t to t + Δt and by assuming u k constant between samples, one can write (17): where Since A is not singular, then (17) can be written for each prediction instant from k = 1 to k = P, where P is the prediction horizon and N is the control horizon, with P ≥ N and Δu k+ j = 0 to N ≤ j ≤ P. The resulting set of equation is showed below, where The controller is designed in order to transform the closedloop behavior in a fist-order system behavior according to (24).To overcome the problem of infeasible solutions of the MPC optimization problem, a slack variable (λ) is introduced in order to allow the system to deviate from reference system and to satisfy hard constraints [3] resulting in (25).This equation can be written for each prediction instant (26):   where The cost function can be written as (30).This equation can also be reorganized as a quadratic programming problem (31): min Δu(k),...,Δu(k+Nm)λ(k),...,λ(k+Np) in which The controller cannot eliminate offset unless (33) is handled [3]:

The Experimental System
The experimental system built was a neutralization process that occurs in a shaken reactor tank.Figure 3 presents a photo of the experimental system.
Figure 4 shows a diagram indicating how the system works.The numbers indicate acid flow (1), base flow (2), buffer flow (3), and output flow (4).This number is used in the indexes of the modeling of the experimental system.The flows of acid (q 1 ) and base (q 2 ) are the manipulated variables (u); the flow of buffer solution (q 3 ) is the unmeasured or measured disturbance (d), depending on how it is treated in the control formulation.For the case of this study, the buffer solution flow was used only to make simulation tests.The level height of the reactor (h) and the output flow pH (q 4 ) are the controlled variables or the outputs (y).
The system was specially chosen for this study because of its strong nonlinear dynamic behavior and low operational cost, considering the consumption of inputs as electrical energy and raw material [3,22].The system becomes interesting under the control perspective, as it is a multivariable and nonlinear process in which the static gain suffers strong variations inside the flow operation band.Figure 5 presents the system titration curve.It can be observed that the process pH changes from 4 to 9 in the [0.87; 1.22] interval of the ratio q 2 /q 1 .This change in the process gain is just what makes the neutralization problem difficult to solve under the control perspective, as small modifications on the relation q 2 /q 1 can cause big or small pH variations, depending on where the operating point is in the operational region.It has to be emphasized that, in an analytical process of titration, only one drop is enough to change the pH from 4 to 9. Thus, it can be inferred that the sensitivity of the dynamic process associated to this offers a challenge problem for control in real time.It can be noticed that, once a buffer solution is added, the nonlinear behavior of the system smoothes up, so that the controller action gets u (mL/s) easier, according to what the simulation curves with this solution indicate.If the system was linear, the relation given by pH ×q 2 /q 1 plots would be a line whose approximation can be realized by the simulated curve of larger amount of buffer solution.Montandon [3] presented results for the closed-loop system using pH control of the acid flow with classical PID controller.The conclusion was that this implementation was not able to reject disturbances in a satisfactory manner.During the preparation of this work it has been studied certain PID testing for the MIMO case, but the answers proved to be mostly unstable and hard to tune.

Phenomenological Model.
Hall [23] developed the physical model of this process, which is based on the hypotheses of the perfect mixture, constant density, and total solubility of the present ions.The chemical reactions involved in the acid-base neutralization (HNO 3 -NaOH) are shown in (34)-(38).In order to have a complete model it will be considered the presence of a buffer (NaHCO 3 ).However, for the experimental results, this solution was not used:  u (mL/s) where The amounts of W a and W b are called as invariants, because their concentrations are not affected along the reaction.The reactions are fast enough to allow the system to be considered as in equilibrium.Then, the equilibrium reactions can be used to determine the concentration of the hydrogen (H) ions through the concentration of the reaction invariants.Equation (41) gives the equilibrium concentration.According to Gustafsson and Waller [24], there are two reaction invariants defined for the ith stream and presented in ( 42) and ( 43), which, when are combined, Making the mass balance in the reactor, together with the invariant equations and considering that the density is constant by hypothesis, will result in a differential equation system (45)-(47): where Ar is the reactor area, Vr is the reaction volume; h is the solution height in the reactor; W a is the acid reaction invariant; W b is the base reaction invariant.The flow output of the system is driven by gravity.The output flow (q 4 ) is done by a globe-type valve (48).This equation shows the relation between output flow and the reactor height and the parameters to be estimated (c v and p7).The valve parameters were estimated by using the model and experimental data from open loop.After this process of defining the parameters of the valve it was locked so as to avoid modifying these parameters.Nominal operation conditions are presented in Table 1: For estimation and validation of the model, the plant operation must be done through the inputs that excite all the dynamic modes and in a large frequency band, so that the outputs have enough information for that procedure.These are the most usual excitation types: ramp, step, and impulse.However, in order to gather information in a broader range of frequency, random inputs made of sequences of steps with variable amplitude and duration are applied, as it is indicated by Montandon [3].The sampling time for the process was 10 s.The acid and base flows vary as q 1 ∈ [9.856 13.310], q 2 ∈ [9.977 13.215], with a step probability equal to 0,8, in which the duration of each step was 120 s.The flows in which General parameters Δt = 10 s u max = 38 mL/s u min = 4 mL/s the variations occurred were 12 mL/s each, in order to keep the flow sum inside the limit given by q 1 + q 2 ∈ [21. 5 24.5].The values presented were defined in such a way that, during the operation, the reactor did not get empty nor presents overflow.A set of experimental data composed by 6000 acquisition points was used.The estimation procedure used half of the data and the validation employed the remaining data, in order to assure that the model would have the ability for predicting unknown data.The estimation is a nonlinear solution of the approximation curve that uses the least square method with a first trial given by a random value and a step equal to 15.The estimated values that resulted were c v = 20.4477 and p7 = 0.0523.Figure 6 shows the error in predicting h. Figure 7 presents the set of input random data.Figure 8 presents the results of the simulation and the experimental ones for the closed-loop run, in which one can notice that the model is very representative of the process, with difficulties to predict around pH 7; this phenomenon was already expected, taking into account the titration curve of the system.Figure 9 shows the validation of the model by the prediction of the output that comes very close to the experimental data.

Results and Discussions
The real-time implementation was done using the successive linearization around the operating point.In this case, the linear form results (11).
A controller designed around a stationary state would not be able to control the system, because, for some regions, the stationary state would be very far from the desired point and so the plant model mismatch.Even with the successive linearization, the system control would not be successful, mainly in regions with high gain.There are several ways to deal with this problem.One of them is to expand the states, creating a new state matrix, and then the original structure of the optimization problem can be kept (59).The term related to the output linearization does originate problems for the controller, because it only maps state output and does not interfere in the systems dynamics as the term f k−1 does.Once this modification is done, it is possible to work on the controller previously defined.This option was chosen for real-time operation.Another form can be found in Reis [25]: For the real application in the experimental system, which has nonlinear characteristics, it is necessary to perform successive linearization of the process model in order to apply linear algorithms.The dynamic evolution of the process results in a time-varying system (LTV).The equation of the IHMPC and RSMPC in an LTV form can be easily extrapolated from the formulation presented herein, and for simplicity its description is omitted.In the experimental system, there are the states h, W a , and W b .For this case, the last two states are not measured, as it was shown in the modeling section of the system, so you need to estimate them ( x).To this end, we used a Kalman filter [26], (60).For the IHMPC controller, we also used an open-loop observer (61), informing the model that the error (e) enters into the plant and model in order to minimize the interference of state estimation in the system behavior [27]: RSMPC and IHMPC were implemented in real-time operation of the experimental plant, using the interface through LabVIEW and the controller computation, using the routines implemented in Matlab.In the literature there are several techniques of controller tuning.In this work Henson and Seborg [11] and Montadon's [3] indications were adopted.Besides, a field refinement was done during the initial run in closed loop with each controller, making small adjustments in parameters, so that the system would deliver a better experimental performance in closed loop.Such results were omitted in this paper.Table 2 shows the parameters of each controller resulting from the simulation and used in the experimental run.The controllers were at first tuned with identity matrices and a control horizon equal to 10; besides, a tuning was done until achieving a satisfactory response.Figure 10 presents the structure of the experimental plant, and Figures 11 and 12 show the LabVIEW implementation.Equation (62) shows that the calibration curves of the instruments.V 0 , V 1 , V 2 , V 3 , and V 4 are channel voltages.The regression coefficients are equal to 1 [4,28]: Setpoint variations were done to evaluate the ability of the controllers to lead with transitions.Starting the system with a pH equal to 7 and a reactor height equal to 18 cm, variations were done according to the vector in (63), considering that each step took 2000 seconds.For all controller simulations a random noise of average equal to zero was added with about 10% of the outputs (h and pH): (63) Figures 13,14,15,and 16 present the closed-loop simulation that uses RSMPC.The performance shown is quite reasonable.
The experimental run was done in two steps to preserve and manipulate the data separately.In the first part was made a variation in the pH setpoint and kept the level constant.In the second part it was done otherwise.Figures 17,18,19,and 20 show the experimental run of the pH setpoint changes, and Figures 21,22,23,and 24 show the experimental run of level setpoint changes.The system was controlled in all runs.During the experiment, there was a need to increase the weight matrix of the control action (as indicated in Table 2); as the output response started to oscillate, it was not able to reach the desired setpoint.However, the overall response can be considered satisfactory.
The results for the IHMPC simulation are presented in Figures 25,26,27,and 28.The results are suitable to apply on line the control to the real process.
Like RSMPC, experimental runs with IHMPC were done in two steps.Figures 29, 30, and 31 show the experimental run of the pH setpoint changes, and Figures 32, 33, and 34 show the experimental run of level setpoint changes.This controller showed a performance superior to the RSMPC controller performance and with satisfactory and adequate response and performance.

Conclusions
Through this research it was able to better understand the use of predictive controllers in a real-time application, paving the way for research in the area.The experimental application led to an approximation of reality and industrial practice, experiencing some of the common problems and issues in the implementation of controllers.It was possible to verify the need for a mastery of techniques and concepts of process control, system modeling, parameter identification, scheduling, optimization, and, in addition, common sense engineering to solve the experimental problems.
The control of such class of nonlinear processes is a very challenging area with many possibilities for development and that undoubtedly has importance and influence on the performance of process and in consequence results in their organizations.
This work carried out the experimental application of two predictive controllers: IHMPC and RSMPC, both in simulation environment and in the experimental plant dealing with the level and pH control.
The experimental plant was modeled and has the required parameters identified through the run in open loop.The simulation results were satisfactory and indicated that the model is representative of the real process and suitable for the control purposes that were aimed.The simulation answers of the system outputs subjected to the controllers were adequate and satisfactory.The theoretical and experimental responses of the IHMPC runs were satisfactory.
The controller adjustment for real-time operations was suitable and feasible.The interference of matters related to leaking, process noises, and noises from electrical source and other problems associated to real-time application brought additional difficulties that demanded process knowledge of the process.
The experimental application of robust controllers associated or not to control systems tolerant to failures and the use of online identification employing neural networks will be presented elsewhere.

Figure 1 :
Figure 1: MPC and the receding horizon strategy.