Comparison between an auto-tuned PI controller, a predictive controller and a predictive functional controller in elementary dynamic systems G. Valencia-Palomo∗ and J.A. Rossiter. Automatic Control and Systems Engineering, University of Sheffield, UK. e-mail: ∗ g.valencia-palomo@sheffield.ac.uk Abstract— In this paper three controllers are compared: a novel auto-tuned PI, a Model Predictive Controller (MPC) and a Predictive Functional Controller (PFC) in order to illustrate the similarities and differences as well as their advantages and disadvantages. These controllers are tested in different elementary systems and the tuning is made following specific rules. The results of these tests shows the benefits of use simple algorithms to control different plants that exhibit low order systems behaviors. I. I NTRODUCTION In the process industry most of the controllers are PI(D) mainly due to its price and ease of tuning. These controllers solves well most of the monovariable control tasks (e.g. flow, pressure, temperature and so on). However, in more complex systems that exhibits dead time, non-minimum phase or when the system is subject to constraints or constant perturbations, the so-called conventional control structures do not always give good results and are difficult to maintain. Therefore, in the practice, the process is often regulated manually by an operator. On the other hand, a modern control algorithm that has had success in the process industry is indeed the predictive control (MPC) (Maciejowski, 2002; Rossiter, 2003; Camacho and Bordons, 2004). Model predictive control is a common name for computer control algorithms that use explicit process model to predict the future plant response. According to this prediction the algorithm optimices the manipulated variable to obtain an optimal plant response. But while there are currently many academic predictive controller developments that solves a large variety of complex problems, the majority of these have not been tested experimentally nor exploited commercially. The different linear MPC approaches involves the resolution of a quadratic problem (QP) in order to obtain the optimal input to the process. The computational load associated to solve an on-line QP can be heavy and my require a standalone computer. In the last decade a predictive functional control (PFC) has been pioneered by Richalet (1993). The advantage of PFC compared to different MPC configurations is its flexibility to transform a QP problem into a square system of equations, witch allows for an easy implementation in practice. But despite its industrial success does not enjoy wide acceptance in the academic world because of the inconsistency of its mathematical formulation. This paper aims to make a comparison between these three control techniques: PI(D), MPC and PFC in order to illustrate the similarities and differences as well as their advantages and disadvantages when are used to control different types of systems. II. T HE CONTROLLERS In this section the background of the controllers are exposed. The PI controller is adjusted by a state of the art tuning rule while the algorithms of the predictive controllers MPC and PFC are formulated in state-space. II-A. Auto-tuned PI(D) A novel auto-tuned PI(D) controller described in (Clarke, 2006; Gyöngy and Clarke, 2006) is used. A schematic diagram of the system is shown in Fig. 1. The objetive is to adapt the controller so as to achieve a carefully chosen design point on the Nyquist diagram. The key components are phase/frecuancy and plant gain estimators (PFE, GE), described in detail in (Clarke, 2002). In essence a PFE injects a test sinewave into a system and continuously adapts its frequency ω1 until its phase shift attains a desired value θd (in this case the design point). Also forming important part of the tuner, but not shown in Fig. 1, are variable band-pass filters (VBPF) at the inputs of the PFE and GE. These are second-order filters centered on the current value of the test frequency. They are used to isolate the probing signal from the other signals circulating on the loop (such as noise, set-point changes and load disturbances). The algorithm is initialized using a first-order/dead-time (FODT) approximation Ga (s) for the plant, obtained from a simple step test. The initialization involves the computation of suitable values for the parameters associated with the GE, PFE and the controller. II-B. Model predictive control (MPC) Consider the discrete-time system with no disturbing and no measurement errors: ( x (k + 1) = Ax (k) + Bu (k) (1) y (k) = Cx (k) Test frecuency (from FPE) Set-point r 1 + + where: 1 Design GE Controller C(s) u Control signal u = ∆UHC ; IHC ×HC −IHC ×HC T R= −T GH P C −GHP C Output y Plant G(s) PFE Fig. 1. Schematic diagram of the autotuning PI(D). where x(k), y(k) and u(k) are the state vector, the measured output and the process input respectively. x(k) ∈ Rn , in the SISO case: y(k), u(k) ∈ R. A MIMO process has the same description but with y(k) ∈ Rl and u(k) ∈ Rm . By simplicity in the notation only the first case is considered, the extension to MIMO case is straightforward. By iterating the model, the output prediction with a prediction horizon HP and a control horizon HC is given by: ŶHP = FHP + GHP C ∆UHC (2) where matrices ŶHP , ∆UHC , FHP and GHP C are defined as follows: ŶHP = £ ŷ (k + 1|k) ... ŷ (k + HP |k) ¤T ;c = 1m ∆umax 1m ∆umin 1m Umax − 1m u(k − 1) −1m Umin + 1m u(k − 1) 1n ymax − FHP −1n ymin + FHP 1m is an (HC × m) × m matrix formed by HC m × m identity matrices; 1n is an (HP × n) × n matrix formed by HP n × n identity matrices; and T its a lower triangular block matrix whose nonnull block entries are HC × HC identity matrices. The set of control increments is calculated by minimizing an objective function for a prediction horizon. The objective is to minimize the error between the predicted output ŷ(k) and the reference trajectory w(k) along the prediction horizon: J= HP X j=1 HC X 2 2 [w (k + j|k) − ŷ (k + j|k)] + λ [∆u (k + j|k)] j=1 (4) where the second term in the Eq. (4) is the control effort and λ is the weighting sequence factor. The reference trajectory w(k), is the desired output in closed loop of the system and is given by: w (k + i|k) = s (k + i) − αi [s (k) − y (k)] ; 1 ≤ i ≤ HP ∆UHC = ∆ u (k|k) . . . ∆u (k + HC |k) (5) where s(k) is the set-point and α determines the smoothness CB CA .. of the approach from the output to s(k). .. £ ¤ . . P w (k + 1|k), . . . , w (k + HP |k) , then, the If W = H −1 i C H CA C Pi=0 CA B FHP = u (k − 1)objective function (4) can be expressed in terms of the HC CAHC +1 x (k) + CAi B predicted output (2): i=0 .. .. . . mı́n J (u) = 1 uT Hu + fT u + b PHP −1 i (6) 2 CAHP i=0 CA B subject to Ru ≤ c CB ··· 0 ³ ´ .. .. .. where: H = 2 GTHP C GHP C + λI , fT = . . . T PHC −1 .. 2(FHP − W)T GHP C and b = (FHP − W) (FHP − W) . . CAi B CB GHP C = Pi=0 Therefore the solution takes the form of a standard HC i ··· CAB + CB i=0 CA B Quadratic Programming (QP) formulation. The objective .. .. .. . . . function (6) is convex since it is quadratic with positive PHP −1 PHP −HC definite Hessian (H > 0). Also the constraints are linear. CAi B · · · CAi B i=0 i=0 Given these conditions, it is a well known result that a local minimum, if it exists, is also a global minimum (Bazaraa The considered constraints are: limits in the control et al., 1993). In this work the active set method proposed signal (Umin ,Umax ), limits in the slew rate of the ac- by Fletcher (1987) is used to solve the QP problem. tuator (∆umin ,∆umax ) and limits in the output signals (ymin ,ymax ). Then for a process with m inputs, n outputs, II-C. Predictive functional control (PFC) This control algorithm has two main characteristics that the constraints along the horizons HP and HC can be distinguish it from the rest of the predictive controllers: the expressed as: use of coincidence points and basis functions. The concept of coincidence points is used to simplify Ru ≤ c (3) the calculations considering only a subset of points on the £ ¤T TABLE I S YSTEMS TO BE CONTROLLED . TABLE II M ODELS FOR PREDICTION . Sys Transfer function Umin Umax ∆umin ∆umax Sys Transfer function 1 1 s+1 e2 G(s) = s+1 1 G(s) = 2s2 +2s+1 −s+1 G(s) = s2 +1.5s+0.5 1 G(s) = s−1 s−1 G(s) = s2 −s−2 3 -3 1.5 -1.5 1 1 2 1 2 3 -1 -2 -1 -2 -3 0.4 0.5 0.3 0.5 0.5 -0.4 -0.5 -0.3 -0.5 -0.5 2 3 4 5 6 0.99 s+0.9 2 G(s) = 0.99e s+0.9 0.9 G(s) = 1.8s2 +1.8s+0.9 −s+0.9 G(s) = s2 +1.35s+0.45 0.9 G(s) = s−0.9 s−0.9 G(s) = s2 −1.8s−1.8 2 3 4 5 6 G(s) = prediction horizon. The desired output and predicted output must match in these points, not in all the horizon. The other characteristic is the representation of the manipulated variable as a sum of a set of pre-determined basis functions: u (k + i|k) = nB X µj (k) B (i) (7) j=1 They are chosen according to the set-point profile and the expected disturbances (in this case a first order model response). Minimizing the objective function requires therefore less calculation because only the optimal set of weighting factors µj has to be found. Thus, the concept of control horizon, does not exist in this algorithm because it is replaced by the number of basis functions used. The function to be minimized is: J= HP X 2 [ŷ (k + nCj |k) − w (k + nCj |k)] (8) j=1 where nCj corresponds to the chosen coincidence points (one coincidence point in this case). Notice that the coincidence points, must be, at least equal to the number of basis functions used. III. T HE SYSTEMS TO BE CONTROLLED For the simulations six elementary systems to be controlled are chosen in order to test different aspects of the controllers. These systems with its constraints are shown in Table I. Each one of these systems has a characteristic type of response: (1) first order system, (2) first order system with delay, (3) second order system, (4) non-minimum phase system, (5) instable system, (6) instable system with instable zero. IV. C ONTROLLER DESIGN IV-A. PI The controller design is based in choose a design point in the Nyquist diagram. This design point is chosen to obtain the desired closed loop behavior, i.e. rise time, damping value, settling time. In this case, the desired damping value of 0.5 for all the systems is chosen. From this desired damping value, the variables for all the auto-tuning process are obtained as is shown in (Clarke, 2006; Gyöngy and Clarke, 2006). Unfortunately this controller can not G(s) = be useful for unstable systems since it only works with stable systems. The final tuning parameter values for the PI controller in the diverse cases studied are shown in Table III. For this controller the constraints are not used to compute the control signal. It will be shown in the numerical simulations how this controller will act in the system when the constraints do not exist; this controlled will be labelled as PI unconst. And also there is going to be shown the same controller acting in the same system when this constrains do exist, and for this controller (labelled as PI) in case that one constraint is violated the variable is saturated to their maximum or minimum value. IV-B. MPC and PFC The predictive control design and tuning procedure is generally described as follows (DMC Corp., 1994): 1 Variable selection: From the control objectives, define the size of the problem, and determine relevant control variables and manipulated variables. For these systems the ‘real’ models are known and since they are SISO is straightforward determine the controlled and manipulated variables. 2 Plant test: Test the plant systematically by varying manipulated variables and capturing data showing how the controlled variables respond. This step is mainly to determine the move sizes of the manipulated variables (already showed in Table I). 3 Model for prediction: This step is the most important fact in this type of controllers since the quality of the model will determine the accuracy of the predictions and the complexity of the optimization. The considered prediction models in this work are slightly different from the ‘real’ models of the system, since they are derived only with the information of the dead time, rise time and overshoot to build a first or second order system. The models for prediction are shown in Table II. In order to introduce these models for prediction to the controller, they are discretized with a sampling time of Ts and converted to a state-space representation. 4 Tuning parameters for the controller: Configure the controller and enter initial tuning parameters. For the MPC the following parameters are required to be tuned: prediction horizon HP , control horizon HC and control weighting sequence factor λ. For the PFC are required to be tuned: prediction horizon HP , coincidence point nC and the rise I 7.05 0.30 0.50 0.16 — — HP 5 6 10 10 10 20 MPC HC 3 4 3 2 5 5 λ 0.3 1 1 2 1 1 HP 5 6 10 10 10 — PFC nC 4 5 4 6 5 — α 0.7 0.4 0.7 0.6 0.7 — time α of the first order model used as reference trajectory. For both cases (MPC and PFC) HP is chosen so that HP is equal to the settling time τs of the system that is going to be controlled taken into account the sample time. In case that the system is unstable, HP should be a big value, typically 10 ≤ HP ≤ 20 depending on the sample time 1 . For the MPC HC and λ are chosen in certain way to establish a compromise between the control effort and the time to reach the set-point, and always with 1 ≤ HC < HP and 0.1 ≤ λ ≤ 10. In the same way, α (0.1 × τs ≤ α ≤ τs ) and nC (1 ≤ nC < HP ) are chosen for the PFC. This is done doing a ‘global search’ by varying the parameters within its permitted values and choosing the best pair that minimizes τs + Σ∆u2 . 5 Simulation: Test the controller off-line using closed-loop simulation to verify the controller performance. V. reader is reminded that, for unstable systems, if HP the values of the matrices of the form Ai could be high, computational ill-conditions and therefore to bad results as (Rossiter et al., 1998). One alternative proposed is to stabilize before trying to control it. is too big leading to noticed in the system Controlled output (y) 1.5 0.8 0.6 0.4 1 0.5 PI PI unconst MPC PFC ref 0.2 0 0 2 4 0 6 0 2 Time (sec) Input increments (∆ ∆u) N UMERICAL SIMULATIONS The controllers designed in the Section IV will be applied to systems of the Section III. The simulations were carried out in Matlabr . The results can be seen in Figs. 2 to 7. Besides the qualitative results for each case, some quantitative values are shown for each simulation: the settling time τs , the overshoot Mp and the control effort Σ∆u2 . These quantitative values are going to be the performance indices of the controllers. For the first simulation, in Fig 2 can be appraised that the PI controller for the unconstrained system works as its expected according to the parameters for what it was tuned. However, when this controller is applied to the system with constraints the performance is very poor since the first control move because the slew rate needs to be saturated for the constraint violation. This constraint violation affects the controller behavior throughout the transient, despite that this violation is almost negligible. Also in the same figure is shown the MPC and the PFC controllers. Due to their tune, the MPC and PFC controllers have no need to operate near the constraints of the system and the settling times are almost the same as the PI controllers with a smoother input. The performance indices of this simulation are shown in Table IV. 1 The Step response of G(s) 1 Amplitude P 1.58 0.56 0.71 0.34 — — Amplitude Ts 0.5 s 0.5 s 0.5 s 1s 0.1 s 0.3 s 3 1 2.5 0.5 0 -0.5 PID PID unconst MPC PFC -1 -1.5 0 2 4 Time (sec) 6 Inputs (u) 1.5 4 Time (sec) Amplitude PI Sys 1 2 3 4 5 6 For the second simulation, in Fig. 3 can be seen that, as in the fist case, the PI controller for the unconstrained system works well, but when its applied to the constrained system its performance decrease because of the violation of the constraints. The system response of the constrained system with the PI controller is almost the same as with the MPC controller and the PFC controller, being the plots practically overlayed. The performance indices of this simulation are shown in Table V and shows for the PI, MPC and PFC very similar values. Amplitude TABLE III T UNING PARAMETERS . 2 1.5 1 0.5 0 6 PID PID unconst MPC PFC 0 2 4 Time (sec) Fig. 2. System 1. TABLE IV P ERFORMANCE INDICES FOR THE SYSTEM 1. PI PI unconst MPC PFC τs 5.1 s 3.9 s 3.8 s 3.7 s Mp 36 % 22 % 2% — Σ∆u2 8.31 3.88 1.31 2.32 6 Step response of G(s) Controlled output (y) Step response of G(s) 1 0.4 0.2 0.6 0.4 PI PI unconst MPC PFC ref 0.2 0 2 4 Time (sec) 6 0 8 0 5 10 Amplitude 0.6 1 1 0.8 Amplitude Amplitude Amplitude 1.2 1 0.8 0 Controlled output (y) 1.4 0.8 0.6 0.4 0 0 5 Time (sec) Input increments (∆ ∆u) 10 0 15 PI PI unconst MPC PFC ref 0 5 Input increments (∆ ∆u) Inputs (u) 0.5 10 15 Time (sec) Inputs (u) 0.8 1.5 0.6 0.2 0.8 0.6 0.1 0.4 0 0.2 0 5 10 15 0 PID PID unconst MPC PFC 0 Time (sec) 5 10 Time (sec) 0.4 PID PID unconst MPC PFC 0.2 Amplitude Amplitude PID PID unconst MPC PFC 0.3 Amplitude 1 0.4 Amplitude 0.4 Time (sec) 1.2 -0.1 0.6 0.2 0.2 15 0.8 0 1 0.5 PID PID unconst MPC PFC -0.2 15 -0.4 0 5 10 15 0 0 Time (sec) 5 10 Fig. 3. System 2. Fig. 4. System 3. TABLE V P ERFORMANCE INDICES FOR THE SYSTEM 2. P ERFORMANCE INDICES FOR THE SYSTEM 3. PI PI unconst MPC PFC τs 7.4 s 12.5 s 7.6 s 8.0 s Mp 7.1 % — — — Σ∆u2 0.30 0.43 0.29 0.33 15 Time (sec) TABLE VI PI PI unconst MPC PFC τs 12.2 s 12 s 8.3 s 6.4 s Mp 12.6 % 9.5 % 4.0 % — Σ∆u2 0.50 0.59 0.49 0.95 In the third simulation, the system to be controlled is a second order system. The PI controller for the unconstrained system and the PI controller for the constrained system performance are almost the same despite the slew rate constraint violation. And for the MPC and PFC the system have almost the same performance with the tuning, reaching the set-point within less time than the PI controllers. The performance indices of this simulation are shown in Table VI. For the fourth simulation, as in the previous case, the PI controller for the unconstrained system and the PI controller for the constrained system performance are almost the same. The system regulated by MPC and the PFC controller shows a less inverse response because the control effort es less than the PIs and for that the system input is smother. The performance indices of this simulation are shown in Table VII. For the fifth simulation, the auto-tuned PI cannot be tuned because this controller has the restriction to work with stable systems. However, the MPC and the PFC can be tuned without problems using the methodology presented in Section IV. The Fig. 6 shows the system output using this two controllers. The constraints does not affect the controllers behavior since they are included in the calculation of the input signal. The performance indices of this simulation are shown in Table VIII. Step response of G(s) Controlled output (y) Step response of G(s) 2 Controlled output (y) 2.5 1 1.5 1.2 1 2 0.5 0.6 0.4 PI PI unconst MPC PFC ref 0.2 0 0 5 10 -0.2 15 0 5 Time (sec) 1 Input increments (∆ ∆u) 0 0.2 0.4 0.6 0.8 Time (sec) 1 PID PID uncost MPC PFC 10 15 Time (sec) 20 25 Inputs (u) 2.5 MPC 2 0.2 Amplitude Amplitude 0.4 0.2 0 5 Input increments (∆ ∆u) 0.6 0.1 0 0.6 0.4 0.2 MPC ref 0 Inputs (u) PID PID uncost MPC PFC 0.4 -0.2 0 15 0.8 0.3 0.6 0.2 Time (sec) 0.4 Amplitude 10 1.5 0.5 Amplitude -0.5 0 Amplitude 1 0.8 Amplitude Amplitude Amplitude 0.8 0 -0.2 1.5 1 0.5 0 -0.4 MPC -0.5 -0.1 0 5 10 0 15 0 5 Time (sec) 10 15 Time (sec) 0 5 10 15 Time (sec) 20 25 0 5 10 15 Time (sec) Fig. 5. System 4. Fig. 7. System 6. TABLE VII P ERFORMANCE INDICES FOR THE SYSTEM 6. 20 25 TABLE IX P ERFORMANCE INDICES FOR THE SYSTEM 4. τs 12.0 s 10.4 s 7.8 s 9.7 s PI PI unconst MPC PFC PI PI unconst MPC PFC Σ∆u2 0.17 0.18 0.16 0.18 Mp 13.4 % 8.5 % 1.0 % — Step response of G(s) 1 0.8 Amplitude Amplitude 10 6 4 0 0.6 0.4 MPC PFC ref 0.2 2 0 0.5 1 1.5 Time (sec) 2 0 2.5 0 1 Input increments (∆ ∆u) 4 5 Inputs (u) 0.6 1.5 MPC PFC 0.4 MPC PFC 1 0.2 Amplitude Amplitude 2 3 Time (sec) 0 -0.2 0.5 0 -0.5 -0.4 -1 0 1 2 3 Time (sec) 4 5 0 1 2 3 Time (sec) Fig. 6. System 5. TABLE VIII P ERFORMANCE INDICES FOR THE SYSTEM 5. PI PI unconst MPC PFC τs ∞ ∞ 2.7 s 3.2 s Mp — — 3.1 % — Σ∆u2 ∞ ∞ 0.89 1.14 4 Mp xx % xx % 16.5 % — Σ∆u2 ∞ ∞ 1.42 ∞ For the sixth simulation, the system to be controlled is also a unstable system so as in the previous case, the autotuned PI does not work. But since this is a more difficult case, the PFC cannot be tuned either. On the other hand the MPC controller can reach the set-point successfully. The performance indices of this simulation are shown in Table IX. Controlled output (y) 12 8 τs ∞ ∞ 13.2 s ∞ 5 VI. C ONCLUSIONS In this work three controllers applied to different elementary systems are presented: an auto-tuned PI controller, an MPC controller and a PFC controller. As it can be seen in all the simulations, the systems with the PI controller performs really well, and the auto-tuning makes the controller easy to implement even in the practise. Although the operation of the controller near the constraints might lower the performance. For both, the MPC controller and PFC controllers the most difficult part is the formulation of the model for prediction as in any model based controller. In the case of the PFC controller the best characteristic is how the controllers deals with the optimization problem to obtain a faster calculation. However, the best performance indices are from the MPC, in fact this is the only controller than could deal with all the systems presented. But in spite of that, they are not as used in practice as one would think. Existing MPC products are not suitable for all applications or they do not capture all the benefits possible when they are applied. And a high level of expertise is required to implement and maintain a MPC controller is an impediment to more widespread utilization. So, provide a higher performance and make it easier for non-experts to actually configure, tune and maintain realworld MPC applications is needed in order to bring the MPC to the practice. R EFERENCES Bazaraa, M. S., H. D. Sherall and C. M. Shetty (1993). Nonlinear Programming: Theory and Algorithms. John Wiley & Sons Inc. Camacho, E. and C. Bordons (2004). Model predictive control. 2nd ed.. Springer Verlag. Clarke, D.W. (2002). Designing phase-locked loops for instrumentation applications. Measurement 32, 205–227. Clarke, D.W. (2006). Pi auto-tuning during a single transient. IEE Proceedings Control Theory and Applications 153(6), 671–683. DMC Corp., [DMC]T M (1994). Technology overview. Product literature from DMC Corp. Fletcher, R. (1987). Practical methods of optimization. 2nd ed.. John Wiley. Gyöngy, I.J. and D.W. Clarke (2006). On the automatic tuning and adaptation of pid controllers. Control Engineering Practice 14, 149– 163. Maciejowski, J.M. (2002). Predictive control with constraints. Prentice Hall. Richalet, J. (1993). Practique de la commande predictive. Hermes, France. Rossiter, J.A. (2003). Model predictive control: a practical aproach. CRC Press. Rossiter, J.A., B. Kouvaritakis and M.J. Price (1998). A numerically robust state-space aproach to stable-predictive control strategies. Automatica 34(1), 65–73.