MPC With Integrators
MPC With Integrators
Telemark University College, Kjolnes ring 56, 3918 Porsgrunn, Norway. E-mail contact: David.Di.Ruscio@hit.no
Abstract
A simple Model Predictive Control (MPC) algorithm of velocity (incremental) form is presented. The
proposed MPC controller is insensitive to slowly varying system and measurement trends and therefore
has integral action. The presented algorithm is illustrated by both simulations and practical experiments
on a quadruple tank MIMO process.
Keywords: MIMO systems, model predictive control, optimal controller, integral action, constraints
RL
1. Introduction functional J(u) = 0 dt = L and L is free, are opti-
mized with respect to the control action u subject to
Model Predictive Control (MPC) algorithms are stud- a model and constraints. MPC problems are however
ied in a number of books (e.g. Huang and Kadali based on a moving horizon (i.e. a receding horizon)
(2008), Maciejowski (2002), Camacho and Bordons strategy Garca et al. (1989) were we consider the ini-
(1995), Bitmead et al. (1990)) and in numerous pa- tial time of the optimization interval to be equal to the
pers, se e.g. Maeder et al. (2009) and the references present time t, and the final time of the optimization
therein. interval to be equal to the present time plus a predic-
MPC has its origin in the theory of optimal con- tion horizon, say t+L where L is the prediction horizon.
trol problems, Pontryagin et al. (1956) and Bellmann There is no theoretical difference between standard op-
(1957), and in lecture notes on optimal control the- timal control problems and MPC problems and notice
R t+L
ory at MIT in the early 1960-ties which resulted in the that the functional J(u) = t dt = L.
book Athans and Falb (1966). An early description of the moving horizon or reced-
Parts of the optimal control theory are believed de- ing horizon optimal control strategy where the initial
veloped during the Apollo program in the early 60-ties integration time is set equal to the present time, t, and
where there was a great focus on minimum time (time the final horizon is set equal to t + L where L > 0 is a
optimal control) and minimum fuel (fuel optimal con- constant time interval is as presented in Propoi (1963)
trol) problems, see e.g. Athans and Falb (1966) Ch. and Balchen et al. (1970) p. 208 (in Norwegian).
7 where the minimum principle by Pontryagin et al. An early survey paper on MPC is Garca et al. (1989).
(1956) is used to solve the optimal control problems. A survey of both linear and nonlinear MPC is given in,
This also successful resulted in the state feedback opti- e.g. Maeder et al. (2009), Qin and Badgwell (2003).
mal control law in the Apollo Lunar-Module Autopilot Some early work on non-linear MPC is presented in
Widnall (1970). Balchen et al. (1992) and the references therein.
The above mentioned optimal control problems are The Generalized Predictive Control (GPC) algo-
most often based on a fixed time optimization interval rithm by Clarke et al. (1987) is an algorithm based on
from say a constant initial time t0 = 0 to a final time, an input and output Controlled Auto Regressive and
say L, i.e. a time optimal control problem where a cost Integrated Moving Average (CARIMA) model. The
doi:10.4173/mic.2013.3.2
c 2013 Norwegian Society of Automatic Control
Modeling, Identification and Control
GPC algorithm gives integral action of the closed loop process disturbance, and w may be an unknown con-
system and the present state is estimated using the stant or slowly varying measurements noise vector. v
model and some old known input and output data. and w may represent trends or drifts.
Standard MPC algorithms usually do not achieve in- Note that the variables uk and yk in the model eqs.
tegral action and there is one main reason for this. The (1) and (2) are the actual input and output variable,
answer is that integral action is not necessarily optimal. respectively. Furthermore, note that the model eqs.
However, if integral action is wanted there is some com- (1) and (2) may arise from linearizing non-linear mod-
mon methods to achieve this. els around some nominal steady state variables. The
One commonly used method is to augment an in- model may also rise from system identification based on
tegrator at the input, i.e. augment the plant model trended input and output data. Hence, in these cases,
with an integrator uk = uk−1 + ∆uk . MPC algo- the external noise variables v and w are known, but
rithms is of state feedback type and in this case the the resulting control algorithm to be presented in this
MPC algorithm is a function of the plant state esti- paper is insensitive to these noise variables v and w.
mate x̂k and the estimate ûk−1 . The plant control is Furthermore the system and the measurements may be
then uk = uk−1 + ∆u∗k where ∆u∗k is the MPC cal- influenced by drifts and in these cases the noise vari-
culated optimal control deviation. One should notice ables v and w may be unknown and slowly varying.
that in this case and due to unknown disturbances the Hence, the model eqs. (1) and (2) is a realistic model.
actual previous control uk−1 is not necessarily equal We will study the MPC controller subject to the fol-
to the estimate ûk−1 . This method is among others lowing performance index,
described in Mayne et al. (2000). PL
Jk = i=1 ((yk+i − rk+i )T Qi (yk+i − rk+i )
Another commonly used strategy to incorporate in-
tegral action is to augment an integrator model dk = +∆uTk+i−1 Pi ∆uk+i−1 ), (3)
dk−1 of a constant disturbance d influencing the plant where k is the present discrete time, ∆uk = uk − uk−1
model state equation and the output equation. This is the control rate of change (or control increment),
strategy may be viewed as putting the integrator at the rk is a reference signal and Qi and Pi are symmetric
output. This strategy is also among others described positive semi-definite weighting matrices of appropri-
in Mayne et al. (2000). ate dimensions. For finite prediction horizon L, then
Recently in Ruscio (2012) a simple Linear Quadratic QL may be chosen as the solution to Riccati equation
(LQ) optimal controller algorithm with integral action of the problem to ensure closed loop nominal stability.
is presented. In this method constant or slowly vary- The above MPC objective criterion may be written
ing disturbances in the state and output equations are in more compact form as
removed from the problem by working on deviation
models. Jk = (yk+1|L − rk+1|L )T Q(yk+1|L − rk+1|L )
The contributions of this paper may be itemized as +∆uTk|L P ∆uk|L , (4)
follows:
where Q ∈ RLm×Lm is a block diagonal matrix with
• In this paper an MPC algorithm with integral ac- Qi ∀ i = 1, . . . , L on the block diagonal. P ∈ RLr×Lr
tion, along the same lines as used in the LQ op- is defined similar with Pi ∀ i = 1, . . . , L on the block
timal controller with integral action method, in diagonal. The notation used to define the vectors in
Ruscio (2012) is presented. eq. (4) is defined in Appendix A.
In this paper we consider input rate of change and
amplitude constraints. These constraints may be for-
2. Problem formulation mulated as a linear inequality,
120
Di Ruscio, “Model Predictive Control with Integral Action: A simple MPC algorithm”
The simplified MPC strategy of including a control Hence, we have a strictly proper state space model of
horizon, 1 ≤ Lu ≤ L, and instead calculating a reduced the form
number of future controls ∆uk|Lu , will be discussed and
solved later in the paper. x̃k+1 = Ãx̃k + B̃∆uk , (14)
yk = D̃x̃k . (15)
2.1. Model discussion The state space model eqs (12), (13) (or equivalently
Note that the model eqs. (1) and (2), when v and w are (14), (15) ) may be used to define a Prediction Model
constant vectors, is not unique. The constant trends v (PM) of the form
and w may be incorporated in the model by including
one additional state. We find that the following model yk+1|L = pL + FL ∆uk|L , (16)
is equivalent
where
x̄k+1 Ā x̄k B̃
z }| { z }| { z }| { z }| { pL = OL Ãx̃k , (17)
xk+1 A v xk
= + B uk , (7)
zk+1 01×n 1 zk 0 FL = OL B̃ HLd , (18)
121
Modeling, Identification and Control
where S ∈ RrL×rL and c ∈ RrL×r are matrices with In this case we furthermore have a simple PM of the
ones and zeroes as defined in the Appendix A. form
We find that the constraints may be written as the
linear matrix inequality yk+1|L = pL + F ∆uk , (31)
122
Di Ruscio, “Model Predictive Control with Integral Action: A simple MPC algorithm”
A∆uk|Lu ≤ bk , (45) The state space model (50) and (51) (or equivalently
(52) and (53)) with the performance index (48) defines
where in this case, for 1 ≤ Lu ≤ L we have a standard LQ optimal control problem. The optimal
control is of the form
I(rLu ×rLu )
∆xk
−I(rLu ×rLu ) ∆uk = G1 G2 , (54)
A :=
yk−1 − r
S(1 : rLu , 1 : rLu ) , (46)
123
Modeling, Identification and Control
6. Numerical examples
v = 2gh. Multiplying with the area, a, of the outlet y2: Level tank 2
hole of the tank we obtain the√volumetric flow-rate, q, 6.6
6.4
out of the tank as q = av = a 2gh. 6.2
6
Hence, a mass balance of the four tank process gives 5.8
the state space model 5.6 r2
5.4 y2
5.2
p p 0 500 1000 1500 2000 2500 3000 3500 4000
Samples
A1 ẋ1 = −a1 2gx1 + a3 2gx3 + γ1 k1 u1 , (56)
p p
A2 ẋ2 = −a2 2gx2 + a4 2gx4 + γ2 k2 u2 , (57)
p
A3 ẋ3 = −a3 2gx3 + (1 − γ2 )k2 u2 , (58)
p Figure 1: Simulation of the quadruple tank process and
A4 ẋ4 = −a4 2gx4 + (1 − γ1 )k1 u1 , (59)
the minimum phase case in Example 6.1 with
MPC control with integral action. Level ref-
where Ai ∀ i = 1, . . . , 4 is the cross-section area of tank erences and actual levels illustrated. Predic-
i, ai ∀ i = 1, . . . , 4 is the cross-section area of the outlet tion horizon L = 100 and control horizon
pipe of tank i. Lu = L.
The flow k1 u1 from pump 1 may be divided into a
flow γ1 k1 u1 into tank 1 and a flow (1 − γ1 )k1 u1 to
tank 4, i.e. such that the flow from pump number 1
is k1 u1 = γ1 k1 u1 + (1 − γ1 )k1 u1 . Similarly, the flow
k2 u2 from the second pump may be divided into a flow
u1: MPC
γ2 k2 u2 into tank 2 and a flow (1 − γ2 )k2 u2 into tank 3.4
for the above parameters, as well as nominal values for 0 500 1000 1500 2000 2500 3000 3500 4000
the states and control inputs, are chosen as presented
u2: MPC
in Johansson (2000). 3.4
3.2
The 4 tank process is studied in a number of papers,
3
see e.g. Gatzke et al. (2000) where Internal Model Con-
2.8
trol (IMC) and Dynamic Matrix Control (DMC) were
2.6
used. Here we use the proposed MPC controller with
integral action as presented in Sec. 3.1. 0 500 1000 1500 2000
Samples
2500 3000 3500 4000
124
Di Ruscio, “Model Predictive Control with Integral Action: A simple MPC algorithm”
125
Modeling, Identification and Control
0 h −fp
1
10
−5
r1
5
y −10
1
0 −15
0 10 20 30 40 50 60 70 80 0 1000 2000 3000 4000 5000 6000
h vs samples
2
15 10
h −real
2
5 h −dsr
2
10 h2−pem
r1 and y1
0 h −fp
2
−5
5 r2
y −10
2
0 −15
0 10 20 30 40 50 60 70 80 0 1000 2000 3000 4000 5000 6000
Time [Min] Samples
Figure 3: Practical run of the quadruple tank process Figure 5: This figure illustrates the real measurements
as in Sec. 7, and the non-minimum phase of the level in the two lower tanks as well as
case in Example 6.1 with MPC control with the corresponding simulated outputs of the
integral action. A control horizon Lu = 1 system identification models, from DSR and
and the algorithm in Sec. 4. PEM, as well as the simulated outputs from
0.4
the first principles model.
u1 [V]
0.2
−0.2
more flexible with respect to state observers to be used.
−0.4
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Se e.g. Ruscio and Foss (1998) for a state observer
along these lines.
0.4
u2 [V]
0.2
0
9. Concluding remarks
−0.2
−0.4
0 500 1000 1500 2000 A simple state space MPC controller with integral ac-
2500 3000
Samples
3500 4000 4500 5000
8. Discussion Acknowledgment
The presented MPC algorithm is based on a state The author acknowledges the assistance of Mr.
space model of the plant and is therefore flexible to Danuskha who did the practical implementation on the
be used for MIMO systems. The algorithm may be quadruple tank process.
combined with any state observer for estimating the
present state, e.g. the Kalman filter, Jazwinski (1989)
or simply with a state observer based on past inputs
A. Notations used
and outputs as described in Ruscio and Foss (1998). The special structure of a Hankel matrix as well as
The algorithm as presented in this paper is believed some matching notations, which are frequently used
to work very similar as the GPC algorithm in Clarke throughout the paper, are defined in the following.
et al. (1987). However, as mentioned in the introduc- Given a vector
tion Sec. 1 the GPC algorithm is based on the use of
an input and output CARIMA model. Such models sk ∈ Rnr ∀ k = 0, 1, 2, . . . , (60)
are practical only for SISO systems. CARIMA mod-
els are capable of removing the influence of constant where nr is the number of rows in sk .
disturbances as in the state space model description in Define integer numbers j and i and define the vector
Eqs. (1) and (2) (SISO systems assumed). sj|i ∈ Rinr as follows
The PM used in the GPC algorithm may be written
on the form as in Eqs. (16) - (18). Se e.g. Bitmead sj
et al. (1990). One difference between the presented def sj+1
sj|i = ,
..
MPC algorithm and the GPC algorithm, is that the .
state estimate in the GPC algorithm, e.g. as in Eq. sj+i−1
(17) is calculated based on the smallest number of past
inputs and outputs. The presented MPC algorithm is which is defined as an extended vector.
126
Di Ruscio, “Model Predictive Control with Integral Action: A simple MPC algorithm”
15 14
12
h1
10
1) FP L=300 Lu=5
2) FP+DSR L=300 Lu=5
5 3) DSR L=300 Lu=5 10
r1
h2
0 8
0 500 1000 1500 2000 2500 3000 3500 4000
Samples
6
20
4
15
2
h2
10
1) FP L=300 Lu=5
2) FP+DSR L=300 Lu=5
0
5 3) DSR L=300 Lu=5 0 500 1000 1500 2000 2500 3000 3500 4000
r2 Samples
0
0 500 1000 1500 2000 2500 3000 3500 4000
Samples
18
Level in tank 1: Reference and outputs using PI and proposed LQ controller • j start index or initial time in the sequence used
16
to form sj|i , i.e., sj , is the upper vector element in
14
the extended vector sj|i .
12
10
• i is the number of nr-rows in sj|i .
h1
8
PI
LQ
Examples of such vector processes, sk , to be used in
6
r1
the above definition, are the measured process outputs,
4
2
yk ∈ Rm , inputs, uk ∈ Rr and references, rk ∈ Rm .
0
The extended observability matrix, Oi , for the pair
0 500 1000 1500 2000 2500 3000 3500 4000
Samples
(D, A) is defined as
Figure 7: Quadruple tank process. Level in tank one. D
DA
Illustrating the reference and the outputs
def
Oi = . ∈ Rim×n , (61)
from the process controlled by two single loop ..
PI controllers, and the proposed LQ optimal DAi−1
controller with integral action. The LQ con-
troller were constructed by using the DSR where the subscript i denotes the number of block rows.
method for system identification. The DSR The reversed extended controllability matrix, Cid , for
model was used to identify a Kalman filter the pair (A, B) is defined as
for the system. The states were estimated
with this Kalman filter and the determinis- def
Cid = Ai−1 B Ai−2 B · · · B ∈ Rn×ir , (62)
tic part of the model were used to design the
controller.
where the subscript i denotes the number of block
columns.
127
Modeling, Identification and Control
The lower block triangular Toeplitz matrix, Hid ∈ Clarke, D. W., Mohtadi, C., and Tuffs, P. S. Gener-
im×(i+g−1)r
R , for the quadruple matrices (D, A, B, E). alized Predictive Control-Part I. Automatica, 1987.
23(2):137–148. doi:10.1016/0005-1098(87)90087-2.
E 0m×r 0m×r · · · 0m×r
DB
E 0m×r · · · 0m×r
Di Ruscio, D. Combined Deterministic and Stochas-
d def DAB
Hi = DB E · · · 0m×r
tic System Identification and Realization: DSR - A
.. .. .. . . .. Subspace Approach Based on Observations. Model-
. . . . .
i−2 i−3 i−4 ing, Identification and Control, 1996. 17(3):193–230.
DA B DA B DA B · · · E
doi:10.4173/mic.1996.3.3.
where the subscript i denotes the number of block rows
Di Ruscio, D. Closed and Open Loop Subspace Sys-
and i+g −1 is the number of block columns, and where
tem Identification of the Kalman Filter. Model-
0m×r denotes the m × r matrix with zeroes.
ing, Identification and Control, 2009. 30(2):71–86.
Define ∆uk = uk − uk−1 . Using that uk = ∆uk +
doi:10.4173/mic.2009.2.3.
uk−1 , uk+1 = ∆uk+1 + uk = ∆uk+1 + ∆uk + uk−1 and
so on, we have Garca, C. E., Prett, D. M., and Morari, M. Model pre-
dictive control: Theory and practiceA survey. Au-
uk|L = S∆uk|L + cuk−1 (63)
tomatica, 1989. 25(3):335–348. doi:10.1016/0005-
where S ∈ R Lr×Lr
and c ∈ R Lr×r
are given by 1098(89)90002-2.
Ir 0r ··· 0r
Ir
Gatzke, E. P., Meadows, E. S., Wang, C., and Doyle,
Ir Ir ··· 0r Ir F. J. I. Model based control of a four-tank sys-
S=
.. .. .. .. , c =
.. ,
(64) tem. Computers and Chemical Engineering, 2000.
. . . . . 24(2):1503–1509. doi:10.1016/S0098-1354(00)00555-
Ir Ir ··· Ir Ir X.
where Ir is the r × r identity matrix and 0r is the r × r Huang, B. and Kadali, R. Dynamic Modeling, Predic-
matrix of zeroes. tive Control and Performance Monitoring. Springer,
2008.
References Jazwinski, A. H. Stochastic processes and filtering the-
ory. Academic Press, 1989.
Athans, M. and Falb, P. L. Optimal Control: An Intro-
duction to the Theory and its Applications. McGraw- Johansson, K. H. Interaction bounds in multivariable
Hill, 1966. control systems. Automatica, 2000. 38(2):1045–1051.
doi:10.1016/S0005-1098(01)00285-0.
Balchen, J. G., Fjeld, M., and Solheim, O. A. Reguler-
ingsteknikk Bind 3. Tapir, 1970. Maciejowski, J. Predictive control: with constraints.
Balchen, J. G., Ljungqvist, D., and Strand, Pearson Education, 2002.
S. State-space predictive control. Modeling, Maeder, U., Borrelli, F., and Morari, M.
Identification and Control, 1992. 13(2):77–112. Linear offset-free Model Predictive Con-
doi:10.4173/mic.1992.2.2. trol. Automatica, 2009. 45(2):2214–2222.
Bellmann, R. Dynamic Programming. Princeton Uni- doi:10.1016/j.automatica.2009.06.005.
versity Press, 1957.
Mayne, D. Q., Rawlings, J. B., Rao, C. V., and
Bitmead, R. R., Gevers, M., and Wertz, V. Adap- Scokaert, P. O. M. Constrained model predictive
tive Optimal Control: The Thinking Man’s GPC. control: Stability and optimality. Automatica, 2000.
Prentice-Hall, 1990. 36(2):789–814. doi:10.1016/S0005-1098(99)00214-9.
Camacho, E. F. and Bordons, C. Model Predictive Con- Propoi, A. I. Use of linear programming methods for
trol in the Process Industry. Springer-Verlag, Berlin, synthesizing sampled-data automatic systems. Au-
1995. tomation and remote control, 1963. 24(7):837–844.
128
Di Ruscio, “Model Predictive Control with Integral Action: A simple MPC algorithm”
129