Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
An overview of Model Predictive Control (MPC)
Prof. Cesar de Prada Dpt. of Systems Engineering and
Automatic Control University of Valladolid, Spain
Outline
UVA Introduction to MPC
– Motivation – Basic controllers – Constraints – Implementation methodology – Analysis: Stability, Robustness – Applications and industrial tools (Economic optimization)
Non linear MPC Hybrid MPC Industrial examples
Valladolid
•Capital of Castilla-León •Medium size town •Car industry, Renault
Madrid
Spain
France
Miguel de Cervantes
“El Quijote”
Cristobal Colombus
Valladolid-Madrid 1 h.
University of Valladolid
Second oldest in Spain ( XIII century ) All branches: Humanities, Law, Engineering, Medicine, … 26000 students
Santa Cruz Palace XV century
Vice-Chancellor offices
Dpt. of Systems Engineering and Automatic Control
Founded in 1973 Three locations
– School of Industrial Engineering – Politecnic School – Faculty of Sciences
Two Technology Centres – CARTIF (Automation and Robotics) – CTA (Centre for Sugar Technology)
PhD Course: Process and Systems Engineering (in cooperation with the Chemical Eng. Dpt.) Award of Excellence of the MEC
Erasmus Agreements
“Process control and supervision” Research group
The group 2 Professors 5 lecturers 3 doctoral contracts 12 research grants 2 technicians Research topics: Advanced Control, MPC Process Optimization Modelling and Simulation Fault detection and diagnosis
Web: www.isa.cie.uva.es
Develop new ideas and theory
Develop software tools
Industrial applications
Sede Mergelina
Industry / International cooperation
Int. Research Networks: HYCON2 NoE CITED Networks ALFA Projects European Embedded Control Institute (EECI)
Process Simulators for operators training
Plant-wide optimization
CTA (Centre for Sugar Technology) Joint Research Centre with the Spanish Sugar Industry
Repsol-YPF
CERN
LHC
Empresarios Agrupados
EcosimPro
Why MPC?: Industry Trends
Increasing demands in product quality, costs optimisation, productivity, flexibility to adapt to a wide range of operating conditions, security, care of the environment,..
Increasing pressure on the control systems to fulfil
new and stronger specifications. Increasing needs to rationalise upper level decisions
linked to plant economy, and to integrate and improve all different operating levels.
Conventional control
Reactor FT
FT
FC
FC
TT
AT
Temp
Comp.
Coolant
Product
TC
Feed
PID
Limited performance
Interaction
Saturation…
AC
Multivariable Predictive Control
Reactor
FT
FC
FC
TT AT
MPC
Comp.
Coolant Product
u1 u2
Feed
Temp
MPC considers all manipulated and controlled variables simultaneously, as well as the measured disturbances and constraints. It handles all interactions, disturbances and constraints using a process model in an optimal way improving the control performance.
TT
SP Temp SP Comp.
FT
Decision Hierarchy
In order to implement properly the actions taken in one level, the lower levels must work correctly.
In particular, if the control level does’nt work well, t is not possible to implement economic optimal decisions.
Level 0 Field Instrumentation
Level 1 Conventional Control
PID, DCS
Level 2 Advanced Control
Level 3 Optimization
Economic interest
Economic optimization and Control
Set Point
Set Point
Upper Constraint
Better control means smaller changes around the prescribed set points better product quality
Reduced variance allows to move set points respecting the constraints, giving room for optimization
Economic optimization and Control
Furnace
Dryer Air
Gas
pulp
Dried pulp
gases
MC MT
w
constraint
W1 W2
Moisture of the dryed pulp
SP
Improving control allows to move the moisture set point to a more profitable value, respecting the maximum moisture constraint
Model Predictive Control (MPC) MBPC
Control strategy based in the on-line use of a model to predict the future behaviour of the process output over a certain temporal horizon, as a function of the future control actions
The best control action is selected using an optimization procedure
Many methods sharing some common principles
Process Optimizer u w y v
Predictor y(t+j)
Model Predictive Control
u(t) u(t+j)
y(t+j|t) ^
t t+1 t+2 ...
time
past future
time
Set point
Output prediction CV
PV
MV
OP
SP
Model u y
MPC, Optimization
Process Optimizer u w y v
Predictor y(t+j)
[ ] [ ]∑ ∑=
−
=++∆β++−+=
2N
1Nj
1Nu
0j
22
),..1t(u),t(u)jt(u)jt(w)jt(yJmin
y(t+j) are related with u(t), u(t+1)…through the prediction equations computed with the process model
MPC, control implementation
u(t) u(t+j)
y(t+j|t) ^
t t+1 t+2 ...
time
past future
time
Set point
Output prediction CV
MV
SP
At time t, u(t) is applied to the process, but…
…at time t +1, the whole process is repeated with the information available Moving horizon policy
MPC Control implementation
t t+N2
w(t)
y (t)
r(t+j )y (t+j )
u(t-1)
t+NU
w
u
Y(t+1+j)
t+1
y(t+1)
u(t)
u(t-1)
MPC Key elements
Internal model to compute output predictions Set point Control variables structuring Optimization procedure to compute the best
control actions Moving horizon implementation
A bit of history…
J. Richalet (1978, ADERSA): IDCOM, MPHC, PFC, ... Prett, Gillete, Cutler, Ramaker (1979, Shell): DMC De Keyser, 1979: EPSAC D. Clarke, 1987: GPC Martín-Sánchez, 1984: APC Lemos, Mosca, 1985: MUSMAR .Morari Rawlings .Kouvaritakis, Scatolini, Allgower...
DMC Dynamic Matrix Control
Model: step response (linear) + disturbance
)t(n)it(ug)t(y1i
i +−∆= ∑∞
=
Predictions: )jt(n)ijt(ug)ijt(ug)jt(y1ji
i
j
1ii ++−+∆+−+∆=+ ∑∑
∞
+==
n t j n t y t g u t ip ii
( ) ( ) ( ) ( )+ = = − −=
∞
∑ ∆1
Disturbance model:
∑
∑∑∞
=
∞
+==
−∆−+
+−+∆+−+∆=+
1iip
1jii
j
1ii
)it(ug)t(y
)ijt(ug)ijt(ug)jt(yPredictions:
gi )1t(z)t(z)t(z −−=∆
DMC, Dynamic Matrix Control
∑∑∑∞
=
∞
+==
−∆−+−+∆+−+∆=+1i
ip1ji
i
j
1ii )it(ug)t(y)ijt(ug)ijt(ug)jt(y
∑
∑∑
∞
=+
++
∞
=
∞
+=
−∆−+=
−−∆−−∆−+−∆+−∆+=
=−∆−−+∆+=
1iiijpj
212j1jp
1ii
1jiipj
)it(u)gg()t(yp
....)2t(ug)1t(ug...)2t(ug)1t(ug)t(y
)it(ug)ijt(ug)t(yp
g g d N N Nj i i j i i+ +− ≅ − ≅ > =0 0 1 2 d i j, ,....,
In asymptotically stable systems:
∑=
+ −∆−+=N
1iiijpj )it(u)gg()t(yp Free response of the system
at time t
gi
DMC, Dynamic Matrix Control
( ) ( ) ( )y t j G q u t j pj j+ = + +−1 ∆
G q g q g qj jj( ) ......− − −= + +1
11
p free response
∑=
+ −∆−+=N
1iiijpj )it(u)gg()t(yp
p
u(t-1)
j
j
1ii p)ijt(ug)jt(y +−+∆=+ ∑
=
Predictions: Forced + free response
Notice that, in steady state, ∆u = 0 and pj = yp, so, the predictions correspond to the real process output, eliminating a possible offset
DMC, optimal choice of u
w
y(t+j)
N2
Prediction horizon
t time
u(t-1) u(t)
Nu Control horizon
t time
N1
∆u(t+j) = 0 j ≥ Nu Nu control horizon
Min Cost function:
[ ] [ ]J ( ) ( ) ( )= + − + + +∑∑=
−
=y t j w t j u t j
j
Nu
j N
N 2 2
0
1
1
2β∆
Control structuring:
( ) ( ) ( )y t j G q u t j pj j+ = + +−1 ∆
DMC
G =
+
− +
g gg g g
g g
N
N
N N Nu
1 1
1 1 2 1
2 2 1
0 00 0
0
... ...
... ...... ... ... ... ... ...... ... ... ... ... ... ...
... ... ... ... ...
It can be formulated in matrix form:
[ ]∆ ∆ ∆ ∆u( )' ( ), ( ),..., ( )t u t u t u t Nu= + + −1 1
min ∆u(t), ∆u(t+1),..
[ ]2N11N1N0 p)2Nt(w,...,p)11Nt(w,p)1Nt(w' −+−++−+= +e
[ ] [ ]J ( ) ( ) ( )= + − + + +∑∑=
−
=y t j w t j u t j
j
Nu
j N
N 2 2
0
1
1
2β∆
( ) ( ) ( )y t j G q u t j pj j+ = + +−1 ∆
[ ] 000 ')t('2)t(')t('J eeuGeuIGGu +∆−∆β+∆=
DMC
[ ] 000 ')t('2)t(')t('J eeuGeuIGGu +∆−∆β+∆=
[ ] 0uuGeG
0u
0 =∆β+∆−′−
=∆∂∂
22
J
[ ] 01 '')t( eGIGGu −β+=∆
If there are no constraints:
[ ] )('')t( j1 pwGIGGu −β+=∆ −
Integral action
Delay compensation Tuning: Horizons, β
Open loop stable processes
DMC offset
( ) ( ) ( )y t j G q u t j pj j+ = + +−1 ∆
p
pss
N
1iiijpj
yy
yp)it(u)gg()t(yp
=⇒
=⇒−∆−+= ∑=
+
In steady state:
DMC predictions:
And as
sspy =
So, the predictions in steady state are unbiased and, if the optimization drives the predictions to w, then the process output yp will be equal to the set point w, providing offset free control.
GPC Generalised Predictive Control
A q y t B q u t T q t( ) ( ) ( ) ( ) ( ) ( )− = − +−1 1 1
∆ ξ
Model: CARIMA
)t(y)q(T)q(F
)t(u)q(T)q(N
p p1
1j
1
1j
j −
−
−
−
+∆=
( ) ( ) ( )y t j G q u t j pj j+ = + +−1 ∆Predictions:
T qA q
E q qF q
A qjj j( )
( )( )
( )( )
−
−− −
−
−= +1
11
1
1∆ ∆B q E q
T qG q q
N qT q
jj
j j( ) ( )( )
( )( )( )
− −
−− −
−
−= +1 1
11
1
1
It can be used with open loop unstable systems
Tuning: N2, Nu, β, T(q-1), internal trajectory
PFC Predictive Functional Control
∑ −+=+
=+
+++=+
∑ −++=+
=
−
=
−
j
1i
1if
mj
L
fL
j
1i
1im
j
)1jt(BuCA)jt(y
)t(CA)jt(y
)jt(y)jt(y)jt(y
)1jt(BuA)t(AC)jt(y
m
m
x
x)t(Du)t(Cx)t(y
)t(Bu)t(Ax)1t(x
mm
mm
+=+=+
Model Predictions
∑µ=+=
bN
1iii )j(F)t()jt(u
Base functions
[ ]∑=
µµ+−+=
N
1j
2jj )ht(r)ht(yminJmin
)jt(n)j(y)t()t(CA)jt(y Bk
N
1kkm
jb
++∑µ+=+=
x
Hj coincidence points
r internal reference
∑ −==
−t
1ik
1iBk )1t(BFCA)t(y
Monoreg
Consigna
Proceso
w
py
p∆
dE
t + Nt
m∆Modelo
my
futuropresentepasado
SP
Process
Model
Past t Future
∆p
∆m
Aim: Decrease the error in the future until a certain percentage of the current error w – y(t)
This implies to change the process output by ∆p
Use the model to compute the control u(t) that provides a change in the model output ∆m (u) = ∆p
Key design equation: ∆m (u) = ∆p
Measurable disturbances
y t g u t i d v t i n tii
ii
( ) ( ) ( ) ( )= − + − +=
∞
=
∞
∑ ∑∆ ∆1 1
+ u
v
n
Measurable disturbance
Non-measurable disturbances
y
Controlled variable
DMC model:
Control action
Constraints
They appear naturally in the formulation of a practical control problem.
They can affect to the manipulated or controlled variables: – Saturation in the actuators – Smooth operation of a process – Variance of the controlled variable – Security or quality limits – ….
Constraints
Mm L)jt(yL ≤+≤
Lmax
Lmin
v deltav
Mm D)jt(uD ≤+∆≤
Mm U)jt(uU ≤+≤Range of control signals:
Rate of change of u:
Range of controlled variables:
Should be added to the computation of the optimal decisions
DMC with constraints
L y t j g u t k j p t j L
j N
m kk
j
M≤ + = − + + + ≤
==
∑ ( ) ( ) ( )
, . . . . ,
∆1
1 2
D u t j D
U u t u t j U
j Nu
m M
m Mi
j
≤ + ≤
≤ − + + ≤
==∑
∆
∆
( )
( ) ( )
, . . . ,
1
00
[ ] [ ]∑ ∑=
−
=
+∆β++−+=∆
2N
1Nj
1Nu
0j
22 )jt(u)jt(w)jt(yu
Jmin
u
Quadratic programming problem QP
QP
∆u(t)
∆u(t+1) 0x
bAx
xQ
≥≤
⋅⋅+⋅ xxc21 min
x
Efficient numerical software
A QP problem has to be solved on-line every sampling period
Feasibility
Constraints: Clipping?
∆ u(t+1)
∆u(t)
∆ umax
∆ umax
∆ u* ∆ u with clippling
Contours
Feasibility
Process u y
disturbances
Due to the process dynamics input constraints and disturbances, it may happens that there is no input able to maintain the output within its constraints. The QP problem has no solution.
Physical constraint Operating constraint Hard and soft
constraints
Feasibility (hard constraints)
Change the constraint
Constraint violation
Mm L)jt(yL ≤+≤ ε+≤+≤ Mm L)jt(yL
[ ] [ ] 22N
1Nj
1Nu
0j
22 )jt(u)jt(w)jt(y,uJmin ηε++∆β++−+=ε∆
∑ ∑=
−
=
New decision variable η weighting factor
Output constraint relaxation slack variable: ε ≥ 0
Feasibility
t
y
Prediction
t
u Future control
t
Prediction
t
Future control u
y
Input constraint relaxation
Instead of relaxing this…
Feasibility
Different feasibility polices Constraint Priorities Solved either as a separate problem or continuously
t+N3 t t+N4
Other option: changing the range of application of the constraint N3,N4
Feasibility, Penalty functions
Soft constraints: It is not critical if they are violated by a small amount
t
y
Prediction
[ ] [ ] ( )M
2N
1Nj
1Nu
0j
22 L)jt(yb)jt(u)jt(w)jt(yu
Jmin −+η++∆β++−+=∆
∑ ∑=
−
=
( )ML)jt(yb −+
)jt(y +LM
Multivariable formulation
A model relating the controlled variables with the manipulated ones and the measurable disturbances is needed
y ty t
y t
M MM M
M M
u tu t
u t
n tn t
n tn
m
m
n n nm m n
1
2
11 12 1
21 22 2
1 2
1
2
1
2
( )( )
....( )
...
( )( )
...( )
( )( )
...( )
=
+
M ... M ...
M ...
Reactor
FT
FC
FC
TT AT
MPC
Comp.
Coolant Product
u1 u2
Feed
Temp TT
SP Temp SP Comp.
FT
Multivariable MPC
y t g u t i g u t i g v t i n t
y t g u t i g u t i g v t i n t
y t g u t i g u t i g v t i n
ii
ii
ii
ii
ii
ii
ii
ii
ii
1 11 11
12 21
131
1
2 21 11
22 21
231
2
3 31 11
32 21
331
3
( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) (
= − + − + − +
= − + − + − +
= − + − + − +
=
∞
=
∞
=
∞
=
∞
=
∞
=
∞
=
∞
=
∞
=
∞
∑ ∑ ∑
∑ ∑ ∑
∑ ∑ ∑
∆ ∆ ∆
∆ ∆ ∆
∆ ∆ ∆ t)
u1
u2
y1
y2
y3
v
modelo interno
Internal model
t
y yy t
t
t
y
t
y
t
y
y1
y2
u1 u2 v
Dynamic matrix
Multivariable MPC
J y t j r t j y t j r t j
u t j u t jj N
N
j
NU
= + − + + + − + +∑
+ + + +∑
=
=
−
γ γ
β β
1 1 12
2 2 22
1
2
1 12
2 22
0
1
( ( ) ( )) ( ( ) ( ))
( ) ( )∆ ∆
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
y t j g u t i j g u t i j p t j
y t j g u t i j g u t i j p t j
y t j g u t i j g u t i j p t j
ii
j
ii
j
ii
j
ii
j
ii
j
ii
j
1 11 11
12 21
1
2 21 11
22 21
2
3 31 11
32 21
3
+ = − +∑ + − +∑ + +
+ = − +∑ + − +∑ + +
+ = − +∑ + − +∑ + +
= =
= =
= =
∆ ∆
∆ ∆
∆ ∆
Predictions:
Min Cost function:
γ Equal concern errors β move suppression factors
With constraints: QP problem
Multivariable MPC
( ) ( )∑ ∑ ∑∑= =
−
==+∆+∆
+∆β++−+γ=N
1k
2N
1Nj
1Nu
0j
2kk
M
1K
2kkk)jt(u)jt(u
k
k
k
kk
)jt(u)jt(w)jt(yminJmin
with:
Dmk< ∆uk(t+j)< DMk Umk< uk(t+j)< UMk Lmk< yk(t+j)< LMk
)jt(p)ijt(ug)jt(y k
j
1isiks
n
1sk ++−+∆=+ ∑∑
==
MPC in state-space
[ ] [ ]∑ ∑=
−
=
+∆β++−+=+∆
2N
1Nj
1Nu
0j
22 )jt(u)jt(w)jt(y)jt(u
Jmin
)t(Cx)t(y)t(Bu)t(Ax)1t(x
=+=+
21Mm N,....,NjL)jt(yL =≤+≤
1N,....,0jD)jt(uD uMm −=≤+∆≤
1N,..,0jU)kt(u)1t(uUU)jt(uU uM
j
0kmMm −=≤+∆+−≤⇒≤+≤ ∑
=
uNj0)jt(u ≥=+∆
In order to evaluate J, it is necessary to compute the output predictions
Process model
Cost function
Computing output predictions
)t(Cx)t(y)t(Bu)t(Ax)1t(x
=+=+
∑
∑
=
−
=
−
−++=+
−++=+
+++++=+++=+
+++=+++=+
+=+
j
1k
kjj
j
1k
kjj
23
2
)1kt(BuCA)t(xCA)jt(y
)1kt(BuA)t(xA)jt(x
....)2t(Bu)1t(ABu)t(BuA)t(xA)2t(Bu)2t(Ax)3t(x
)1t(Bu)t(ABu)t(xA)1t(Bu)1t(Ax)2t(x)t(Bu)t(Ax)1t(x
But the state x(t) may be not accesible
Estimation of the model states
)t(Cx)t(y)t(Bu)t(Ax)1t(x
=+=+ As the model state x(t) normally it is not
measured, an state estimator or observer is needed
)t(xC)t(y))]1t(Bu)1t(xA(C)t(y[L)1t(Bu)1t(xA)t(x p
=
−+−−+−+−=
yp represents the measured process output
∑=
− −++=+j
1k
kjj )1kt(BuCA)t(xCA)jt(y
Output predictions are, then, computed by replacing the state x(t) by its estimation:
In steady state: Bu)A....AI(CxCABuCAxCA)jt(y 1jjj
1k
kjj −
=
− ++++=+=+ ∑
Observer design
)]t(xC)t(y[L)t(Ae)1t(e)t(x)t(x)t(e
)]t(xC)t(y[L)t(Bu)t(xA)1t(x
−+=+−=
−++=+
)t(Cx)t(y)t(Bu)t(Ax)1t(x
=+=+
There are many possible design criteria for choosing L. One of them considers the estimation error:
The model output is given by: )t(Cx)t(y =
)t(e)LCA()1t(e)t(LCe)t(Ae)]t(xC)t(Cx[L)t(Ae)1t(e
+=++=−+=+
L can be chosen so that the eigenvalues of (A+LC) are stable and provide the adequate speed of convergence to zero of the estimation error
How to estimate the model states x(t) measuring the model output y(t)?
In predictor form:
e(t) can be driven to zero by proper selection of L
Observer design in filter form
))]1t(Bu)1t(xA(C)t(y[L)1t(Ae)t(e)t(x)t(x)t(e
])1tt(xC)t(y[L)1tt(x)t(x)1t(Bu)1t(xA)1tt(x
−+−−+−=−=
−−+−=
−+−=−
)t(Cx)t(y)1t(Bu)1t(Ax)t(x
=−+−=
Model output is given by: )1t(CBu)1t(CAx)t(Cx)t(y −+−==
)1t(e)LCAA()t(e)1t(LCAe)1t(Ae)]1t(xCA)1t(CAx[L)1t(Ae)t(e
−+=−+−=−−−+−=
L can be chosen so that the eigenvalues of (A+ LCA) are stable and provide the adequate speed of convergence to zero of the estimation error
Predictor
Corrector
Estimating the states x(t) with information up to (t-1) plus y(t)
Estimation error
Time evolution of the estimation error
Offset free control
This formulation does not guarantee that, in steady state, the process output yp is equal to the set point w (being w feasible)
)]BuxA(Cy[LBuxAx p +−++=
The reason is that the observer, at steady state, will fulfill:
But this does not imply that )BuxA(Cy
BuxAx
p +=+=
p1jj yBu)A....AI(CxCA)jt(y ≠++++=+ −
So, the output predictions, in general, will be different from the process output
And the controller will lead the process to a wrong target, hence, an offset will appear
The model is not perfect!
Formulation of the cost function
[ ] [ ]∑ ∑=
−
=+∆+∆β++−+=
2N
1Nj
1Nu
0j
22
)jt(u)jt(u)jt(w)jt(yJmin
)t(u)1t(u)t(u)t(Cx)t(y
)t(Bu)t(Ax)1t(x
∆+−==
+=+The model and cost function must be consistently posed
[ ] [ ]∑ ∑=
−
=+∆+β++−+=
2N
1Nj
1Nu
0j
22
)jt(u)jt(u)jt(w)jt(yJmin
If the model is not perfect, the value of u that minimizes this cost function in steady state may be not be the one that makes the process output y equal to the set point w
J non-consistent
The value of ∆u=0 in steady state is compatible with any value of u that provides zero error in staeady state
Offset-free control
[ ] [ ]∑ ∑=
−
=+∆+∆β++−+=
2N
1Nj
1Nu
0j
22
)jt(u)jt(u)jt(w)jt(yJmin
)t(u)1t(u)t(u)t(Cx)t(y
)t(Bu)t(Ax)1t(x
∆+−==
+=+
)t(xC)t(y))]1t(Bu)1t(xA(C)t(y[L)1t(Bu)1t(xA)t(x p
=
−+−−+−+−=
In order to get offset-free control in spite of the model errors, two conditions are required: 1- The model and cost function must be consistently posed 2- The observer must include integral action in order to get unbiased output predictions
Bu)A...AI(CxCA)jt(y 1jj −++++=+At steady state, the output predictions are:
A biased estimation of y(t+j) leads to incorrect predictions in steady-state, hence to offset
a) Adding an integrating mode to the observer
[ ]
−∆
+
−−
−
+
+−∆
+
−−
=
)1t(uIB
)1t(u)1t(x
I0BA
0C)t(yLL
)1t(uIB
)1t(u)1t(x
I0BA
)t(u)t(x
pu
x
There are three ways of including an integrating mode to the observer: a) Expanding the observer by including u(t) in it b) Using a full velocity form in the model c) Adding a disturbance model
Estimating u(t), which is a known variable seems a bit unnatural, but using the estimated u for computing the output predictions leads to unbiased predictions
Where, in general, )t(u)t(u ≠
Adding an integrating mode to the observer
In steady state, with ∆u = 0:
[ ]
[ ][ ]
[ ]
uBxAx)uBxA(Cy
0)uBxA(CyL)uBxA(CyLuu
)uBxA(C)t(yLuBxAxux
I0BA
0C)t(yLL
ux
I0BA
ux
p
pu
pu
px
pu
x
+=
+=
=+−
+−+=
+−++=
−
+
=
And if Lu is full rank:
Providing unbiased estimations of the output in steady state if the predictions are computed with:
uB)A...AI(CxCA)jt(y 1jj −++++=+
b) Full velocity form of the model
)t(Cx)t(y)t(Bu)t(Ax)1t(x
=+=+
[ ]
)1t(u)t(u)t(u)1t(x)t(x)t(x
)t(y)t(x
I0)t(y
)t(uCBB
)t(y)t(x
ICA0A
)1t(y)1t(x
−−=∆−−=∆
∆=
∆
+
∆
=
++∆
[ ]I0CCBB
BICA0A
A
)t(y)t(x
z defining
vvv =
=
=
∆=
Is equivalent to:
The model can be written as:
)t(zC)t(y)t(uB)t(zA)1t(z
v
vv
=∆+=+
MPC in velocity form
( ) ( )
[ ]'w0....0w)t(zC)t(y
)t(uB)t(zA)1t(z
)jt(uR)'jt(uw)jt(zCQ'w)jt(zCJmin
v
v
vv
2N
1Nj
1N
0jvvvv
)jt(u
u
==
∆+=+
+∆+∆+−+−+= ∑ ∑=
−
=+∆
)jt(uB)A...AI(C)t(zAC)jt(y v1j
vvvjvv +∆++++=+ −
the target is to reduce to zero ∆x(t+j) and to drive y(t+j) as close as possible to w
∆=
)t(y)t(x
)t(zAs
The steady state output predictions will be:
[ ] [ ] [ ]ICA...CAICA...CA0A
I0ICA0A
I0AC jj
jjjvv ++=
++
=
=
with
plus constraints
MPC in velocity form
[ ] )jt(uB)A...AI(C)t(y)t(x
ICA...CA)jt(y v1j
vvvj +∆++++
∆++=+ −
y)jt(y0u,0x =+⇒→∆→∆
The estimator of z is:
[ ]
−∆
+
−−∆
−
+
+−∆
+
−−∆
=
∆
)1t(uCBB
)1t(y)1t(x
ICA0A
I0)t(yLL
)1t(uCBB
)1t(y)1t(x
ICA0A
)t(y)t(x
py
x
And as
MPC in velocity form
[ ]
[ ] [ ]yyLyyandyyL00u0x
uCBB
yx
ICA0A
I0yLL
uCBB
yx
ICA0A
yx
pypx
py
x
−+=−=→∆→∆
∆
+
∆
−
+∆
+
∆
=
∆
In steady state:
If Lx or Ly are full rank, then y)jt(y =+yyp = and as
pyy)jt(y ==+ The predictions are unbiased and the process output presents no offset provided the controller drives the model in z to the set point and reaches steady state
c) Adding a disturbance model
)t(u)1t(u)t(u)t(Cx)t(y
)t(Bu)t(Ax)1t(x
∆+−==
+=+Instead of the model: an expanded one including state and output disturbances is used:
[ ]
=
+
=
+++
)t(v)t(d)t(x
V0C)t(y
)t(u00B
)t(v)t(d)t(x
I000I00DA
)1t(v)1t(d)1t(x Here d(t) and v(t)
are disturbances in the states and the output respectively
Adding a disturbance model
[ ][ ])1t(vV))1t(dD)1t(Bu)1t(xA(C)t(y
LL
)1t(v)1t(d
)t(v)t(d
)1t(vV))1t(dD)1t(Bu)1t(xA(C)t(yL
)1t(dD)1t(Bu)1t(xA)t(x
pv
d
px
−−−+−+−−
+
−−
=
−−−+−+−−+
+−+−+−=
The observer equations are:
[ ][ ]
[ ] 0vV)dDBuxA(C)t(yLL
vV)dDBuxA(C)t(yLL
vd
vd
vV)udDBuxA(C)t(yLdDBuxAx
pv
d
pv
d
px
=−++−
−++−
+
=
−++−+++=In steady state:
so
Adding a disturbance model
[ ]
vVxC)t(ydDBuxAx
vV)dDBuxA(C)t(y
0vV)dDBuxA(C)t(yLL
p
p
pv
d
+=++=
+++=
=−++−
If [Ld`, Lv’]’ is full rank:
So, the extended model provides unbiased output estimation in steady state if the disturbances are incorporated to the model
The offset removal policy, in this case, uses fictitious targets, such that, when given to the MPC, the process reaches the desired set point w. It consists, then, of two stages: the computation of the fictitious targets and the computation of the modified MPC
and from the equation of x:
Modified steady state targets
( ) ( )
maxsmin
ss
sss
ssu,x
uuuvVCxy
dDBuAxx
ywQ'ywminss
≤≤+=
++=
−−
Given the estimated disturbances, we look for states xs and inputs us satisfying the steady state estimation equations and constraints and providing output estimations as close as possible to the desired set point w. They can be obtained solving the optimization problem:
Notice that, if the set point w is reachable, this problem will provide a steady state value ys = w and:
vVCxw s +=
Q weighting matrix
Modified MPC problem
R,S weighting matrixes
[ ]
1N,..,0j,u)jt(uu1N,..,0j,uu)jt(uu
)1jt(u)jt(u)jt(uNj,0)jt(uu)1t(u)1t(u
x)jt(x)jt(x)jt(uB)jt(xA)1jt(x
)jt(uS)'jt(u)jt(uR)'jt(u)jt(xQC'C)'jt(x(min
umaxmin
umaxsmin
us
s
0j)1Njt(u),..,1jt(u u
−=∆≤+∆≤∆−=≤++≤
−+−+=+∆≥=+−−=−
−+=++++=++
+∆+∆++++++∑∞
=−++++
If there is a stable, feasible solution, this modified problem will drive the optimal states and controls to zero, that is, in steady state:
0uuu,0xxx ss =−==−=
ps yvVxCvVCxw =+⇒+=And considering the solution of the observer and modified targets in ss:
Providing offset free control
MPC – Optimal control
u(t)u(t+j)
y(t+j|t)y(t+j|t)^
t t+1 t+2 ...
time
past future
time
Set point
Output predictionCV
PV
MV
OP
SP
Modelu y
MPC is NOT optimal control
An open loop optimization problem is solved every sampling time, starting in the current state
u(t), u(t+1), u(t+2) are considered independent variables in the optimization problem
ProcesoControlleruw y
SP
u(t)=kx(t)
In optimal control u(t+j) are not independent and the target is the control law (k)
Analysis - Stability
With finite horizon N2, there is no guarantee that, even with a perfect model, the application of the “optimally computed” control signals u(t) of MPC leads to a stable closed loop system
w
y(t+j)
N2
Prediction horizon
t
time
u(t-1) u(t)
Nu Control horizon
t time
N1
w
y(t+j)
N2
Prediction horizon
t time
N1
Stability
State at time t
Target
x1
x2
u(t-1) u(t)
Nu Control horizon
t time
State after ∆t
The key point to understand why with finite horizon it is possible to obtain closed loop instability, even if there is no disturbances and the model is perfect, is the fact that, if the predicted trajectory does not reach the target within the prediction horizon time, the solution of the open loop optimization starting at time t with N steps ahead, can be different from the solution of the problem starting at time t + ∆t with N steps ahead, hence, the state of the process at t +2∆t does not need to be in the original trajectory, etc.
State after 2∆t
Infinite horizon
State at time t
Target
x1
x2
u(t-1) u(t)
Nu Control horizon
t time
State after ∆t
State after 2∆t If the target can be reached within the prediction horizon, what happens when the prediction horizon is infinite, then one can apply the Bellman optimality principle to conclude that, as any part of an optimal trajectory is also optimal, the trajectories starting at the state at time t and t + ∆t must coincide. Hence, if the first open loop trajectory is stable, the closed loop trajectory is also stable.
State space model
Given the process x(t+1) =Ax(t)+Bu(t), at every sampling time t, compute the control signals v(0),.…v(N-1) that minimize:
And applying u(t) = v*(0,x(t)) bring the state to the origen starting at x0 at time 0. Q, R, P positive definite matrices
)t(x)0(z,)j(Bv)j(Az)1j(zwith
)j(Rv)'j(v)j(Qz)'j(z)N(Qz)'N(zmin))t(x(J1N
0jvN
=+=+
++= ∑
−
=
Stability
If (A, B) is stabilizable, the solution is unique and at every time t is given by: v(j)= KN-jz(j) with KN-j obtained from the Riccati equations then u(t)=v*(0,x(t))= KNx(t) and susbtituting in the process equation: x(t+1)=Ax(t)+B KNx(t) = (A+B KN)x(t) The stability is not guarantee, but depends on the values of A+B KN Tuning with Q, R, N
Use of JN as a Lyapunov function
As JN is positive definite and JN(0)=0, it can be used as a Lyapunov function for studying stability. Closed loop stability requires: JN(x(t)) > JN(x(t+1))
x1
x2
x0
JN along the system trayectories
++= ∑
−
=
1N
0jvN )j(Rv)'j(v)j(Qz)'j(z)N(Qz)'N(zmin))t(x(J
Optimality principle
J x t J x tx t Qx t u t Ru t J x t J x t
N N
N N
( ( )) ( ( ))( ) ( ) ( ) ( ) ( ( )) ( ( ))' '
− + =
+ + + − +−
11 11
This expression must be positive in order to guarantee stability
The term x t Qx t u t Ru t' '( ) ( ) ( ) ( )+ is positive
But the term J x t J x tN N− + − +1 1 1( ( )) ( ( )) is of unknown sign
Using the optimality principle, and substracting JN(x(t+1)) : t
t+1
x(t)
x(t+1) optimal trayectory from t
t+N
Terminal constraints
))1t(x(J)j(Rv)'j(v)j(Qz)'j(z
)1N(Rv)'1N(v)1N(Qz)'1N(zmin
0)N(z if
)j(Rv)'j(v)j(Qz)'j(z)N(Qz)'N(zmin))1t(x(J
1N2N
0j
v
1N
0jvN
+=
++
+−−+−−=
=
++=+
−−
=
−
=
∑
∑
because v(N-1) has no influence nor in z(N-1) neither in z(N-i) and the minimization should then give: v(N-1)=0 In this way, JN(x(t)) > JN(x(t+1)) and the closed loop system is asymptotically stable
Stability guarantee
w
y(t+j)
N1 N2 t time
Coincidence horizon
Terminal constraints
Clarke, Scatolini
The output predictions were forced to coincide with the set point w for n sampling times
)mt(ub....)1t(ub)nt(ya....)1t(ya)t(y m1n1 −++−+−−−−−=
[ ] [ ]minu
y t j r t j u t jj
Nu
j N
N
J ( ) ( ) ( )∆
= + − + + +=
−
=∑∑ 2 2
0
1
1
2
β∆
y(t+j) = Gj(q-1)∆u(t+j) + pj j = 1,…, N2+M y(t+j) = w j = N2,.....N2+M
Add these constraints
Feasibility?
Infinite horizon
If N→ ∞, ⇒ JN-1 (x(t+1)) - JN(x(t+1)) → 0 and the term x(t)’Qx(t)+u(t)’Ru(t) dominates over
JN-1 (x(t+1)) - JN(x(t+1)) so that is positive and the system is asymptotically stable How to solve the constrained problem with an infinite
number of constraints?
))1t(x(J))1t(x(J)t(Ru)t(u)t(Qx)t(x
))1t(x(J))t(x(J
N1N''
NN
+−+++
=+−
−
Stability: Infinite horizon
[v0, v1, v2, …., vN-1, 0,0,……]
[v0, v1, v2, …., vN-1, KzN, KzN+1 ,……]
w
y(t+j)
N1 N2 ⇒ ∞ Prediction horizon
t time
[ ] [ ]∑∑−
=
∞
=
+∆β++−+1Nu
0j
2
1Nj
2 )jt(u)j()jt(w)jt(yminu
Rawlings, Muske 1993 Input parameterization
Provides stability, but how to solve the constrained problem with an infinite number of constraints?
Rawlings and Muske 1993
QP using problem thesolve and sconstraint impose topossible isit
)j(Rv)'j(v)j(Qz)'j(z)N(Pz)'N(zmin))t(x(J
QA'AP :defining now,
)N(zQA'A)'N(z)N(zQA)')N(zA()j(Qz)'j(z
and )N(zA)jN(z implies this,Njfor 0= v(j)as
)j(Rv)'j(v)j(Qz)'j(z)j(Qz)'j(zmin
)j(Rv)'j(v)j(Qz)'j(zmin))t(x(J
1N
0jv
j
0j
j
j
0j
jj
0j
j
Nj
j
Nj
1N
0j
1N
0jv
0j
1N
0jv
++=
=
==
=+≥
=
++=
=
+=
∑
∑
∑∑∑
∑ ∑∑
∑ ∑
−
=
∞
=
∞
=
∞
=
∞
=
∞
=
−
=
−
=
∞
=
−
=
)j(Bv)j(Az)1j(z +=+
Computation of P
(dlyap) equation matrix Lyapunov QPA'AP:ngsubstracti
........QA'AQA'AQA'APA'A
.......QA'AQA'AQA'AQQA'AP
3322
3322j
0j
j
=−
+++=
++++== ∑∞
=
If A has stable eigenvalues Aj does not diverge and:
If A has some unstable eigenvalue, a terminal constraint must be added to eliminate the unstable modes It requires the origen be reachable in order to be finite
z j Qz jj N
( )' ( )=
∞
∑
Robust MPC
What happens if the model is not perfect?
θ≤θ≤θθρ∀≤ρ≤
≤≤
−ρρ
)( y),u(yy
uuu
w),u(ymax minu
The control actions that minimize the cost function J should be selected in order to minimize the worst possible prediction error depending on the changing or not precisely known parameters ρ(θ)
w
t+j
y
t
[ ] QR)t( )2Nt(),...2t(),1t( ∈θ+θ+θ+θ=ρ[ ])12Nt(u),...1t(u),t(uu −++=
Infinity norm
∞ norm corresponds to the largest deviation of the model output over the set point along the prediction horizon
|| y - w ||∞
w y
y - w for linear systems is a hyperplane function of θ, then, || y - w ||∞ is a convex hypersurface defined by the maximum of the hyperplanes. As θ is constrained to the convex set , then must be located in one of the 2q vertex of polytope Ω
θθθ ≤≤ ∞ρ−θρ w)(,u(ymax
Robust MPC
)ρ,v,u,jt(emaxmaxw)ρ,v,u(ymax ij,iρρ+=−
∞Minimize
is equivalent to maximize an upper bound of ei with respect to u over the vertex of Ω
Ω de vertices2 los de uno θ
wy)ρ,u(ewyuuu
0μμ)ρ,u(eμ
μmin
q
μ,u
−≤≤−
≤≤
≥≤≤−
Large LP programs
Economic optimization
Reactor
FT
FC
FC
TT AT
MPC
Comp.
Coolant Product
u1 u2
Feed
Temp TT
w Temp w Comp. Which is the most profitable operation point?
How to adjust the set points wTemp, wComp to this point?
FT
Economic optimization
MBPC
w
y SP
DCS Process
Economic Optimization
Most of commercial MPC incorporate an economic optimization layer
Trend: Merge both layers in a single MPC drive by an economic cost function
Economic optimization
Reactor
FT
FC
FC
TT AT
MPC
Comp.
Coolant Product
u1 u2
Feed
Temp TT
w Temp w Comp. Economic cost function:
(Product*concentration*price-
– row material*price –
-flow refrigerant*price)*
period of time
Max Benefit
under operating constraints and dynamical model
FT
Operating with constraints
Valve opening
Temperature
Turbine speed
∆ P in the column Pressure
Composition
Operator’s prefered region
Final region
New region of operation
Less variance
DMC Plus
min Linear function of u in steady state ∆u with the constraints: y = G ∆u+p in steady state range of u and y The solution provides ss SP for CV and IRV w = G ∆u*+p IRV = u*
t+N2
LP Optimization
MV1
MV2 Constraint: Values from the LP
IRV
IRV
unconstrained DMC control
DMC Plus
Predictions computation with the internal model
Field values
Unconstrained MPC with IRV settings
Static economic LP at t+N2
IRV SP
Constraints Prices
u
HITO Economic Optimization
Which is the best reachable state in the future? Local optimization around the operating point Control, disturbances and constraints are taken into account Local dynamic models The procedure is repeated every sampling time The targets are always feasible
x state in t Reachable states in t+N2
x optimal state in t+N2 state in t+1 x
x optimal state in t+1+N2
HITO
Predictions computation with the internal model
Field values
Constrained MPC
Economic QP Dynamic optimization
SP
Constraints Prices
u
Key to success…
Easy to understand by the users Can be applied to multivariable processes with
different number of manipulated and controlled variables
Compensates measurable disturbances and delays Takes into account constraints on MV and CV Can be applied to processes with difficult dynamics:
delays, inverse response, unstable systems, slow processes,…
Opens the door to economic optimization of the process operation
MPC
Without model
Controller tuning
Control specification
Modelling
Identification
Process analysis
...but it needs a dynamic process model
With model
Industrial acceptance
Typical application
FEED
PDI
FI
AI
FC
VAP 50#
FC
CONDENSATE
SP
CONTROLLER DMC
TI
AI
AI
SP
From several to dozens of MV, DV and CV
Distillation column
Fast MPC
,..
,min)(*
θ+≤
+θ+=θ
SbAzts
zczFHzzV TTTT
z
Multiparametric quadratic programming
–(Bemporad, Morari, Dua, y Pistikopoulos 2002)
Multiparametric MPC
It is possible to obtain a closed loop expression for the control action as a function of the current state
At each region an explicit control formula
Problems with the number of regions
BB converter
δ
−=
∆
+
δ
=
+δ+++
)()()()(
]1010[
0)()()()(
00000
)1()1()1()1(
ttdtvctil
Vo
dIB
ttdtvctil
IIBA
ttdtvctil
Changes in the input with disturbances δ = Vo(t)-Vo Est (t/t)
BB converter
0 0.005 0.01 0.015 0.02 0.0250
20
40
60
80
100
120
Time (seg)
Vo
(Vol
ts)
Respuesta del BBC
VoVref
Tiempo (mseg) V Referencia Carga R 0 -12 80 5 -100 80
10 -56 80 15 -56 40 20 -56 120
Non-linear MPC (NMPC)
u)jt(uu y)jt(yy
u(t))g(x(t),y(t) ))t(u),t(x(fdt
)t(dx
d))(u),(x(Fu
Jmin pTt
t
≤+≤≤+≤
==
τττ=∆
∫+
Uses an internal non-linear model:
First-principles
Volterra series
Neural network
Wiener, Hammestain,….
Non-linear MPC (NMPC)
u)jt(uu y)jt(yy
u(t))g(x(t),y(t) ))t(u),t(x(fdt
)t(dx
d))(u),(x(Fu
Jmin pTt
t
≤+≤≤+≤
==
τττ=∆
∫+ Dynamic
optimization problem solved every sampling time
How to solve the dynamic optimization problem?
How to estimate the state?
Sequential solution
Process
Simulation from N1to N2 to compute J(u,x(t))
NLP Optimizer
u J
w
u(t)
y(t)
Difficult to impose constraints on x or y
[ ] [ ]
u)jt(uu y)jt(yy
u(t)g(x(t),y(t) ))t(u),t(x(fdt
)t(dx
)jt(u)jt(w)jt(yu
Jmin2N
1Nj
1Nu
0j
22
≤+≤≤+≤
==
+∆β++−+=∆
∑ ∑=
−
=J is evaluated by dynamic simulation of the model
Simultaneous solution
[ ] [ ]
u)jt(uu y)jt(yy.....
1)))))u(t2),g(x(t2)y(t ))2t(u),2t(x(f)3t(x1))u(t1),g(x(t1)y(t ))1t(u),1t(x(f)2t(x
u(t)g(x(t),y(t) ))t(u),t(x(f)1t(x
)jt(u)jt(w)jt(yx,uJmin
2N
1Nj
1Nu
0j
22
≤+≤≤+≤
++=+++=+++=+++=+
==+
+∆β++−+=∆
∑ ∑=
−
=
Now the states x(t+1), x(t+2), ….. are decision variables in addition to u(t), u(t+1),….which results in a large NLP problem
It is easy to impose constraints on x or y (path constraints)
Can be solved with current SQP / IP methods
Discretization of a continuous stiff model can be difficult
Moving Horizon Estimation (MHE)
t-N t
Which initial state in time t-N and minimal disturbances d(t-i) would drive the process in the closest way to the actual output trayectory if the control actions were the ones actually applied ?
t-N
t u
y
d
x
[ ]
Vv
N
0i
22md,x
L)it(dL))t(u),t(x(g)t(y
))t(d),t(u),t(x(f)1t(x
)it(d)it(y)it(yminiNt
≤−≤=
=+
−γ+−−−∑=−
Moving Horizon Estimation (MHE)
t-N t
Once x(t-N) and d(t-N), d(t-N+1),…have been computed optimally, x(t) can be estimated by simulation of the model starting at x(t-N) and with inputs u(t-N), u(t-N+1),…. And disturbances d(t-N), d(t-N+1),…
t-N
t u
y
d
x
[ ]
Vv
N
0i
22md,x
L)it(dL))t(u),t(x(g)t(y
))t(d),t(u),t(x(f)1t(x
)it(d)it(y)it(yminiNt
≤−≤=
=+
−γ+−−−∑=−
Van der Vusse Reactor
DA2CBA
→→→
Highly non-linear reactor difficult to control
NMPC reactor
0.80
1.00
1.20
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
TIME
CbLinf[1]Lsup[1]refy[1]
0
200
400
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
TIME
FUinf[1]Usup[1]
-10000
-5000
00.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
TIME
QkUinf[2]Usup[2]
MV: Product flow MV: Heat removal
2.0
2.5
3.0
3.5
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
TIME
Cax_estim[1]
CV: Composition
370
375
380
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
TIME
T0w_estim[1]
Estimated Input temp.
Estimated CA
Stability guarantee
u)t(uu y)t(yyu(t))g(x(t),y(t) ))t(u),t(x(f)t(x
dRu'uQx'xu
Jmint
≤≤≤≤==
τ+=
•
∞
∫
Similar results that in the linear case. Nominal stability can be assured with infinite horizon and, under certain conditions, the NMPC with infinite horizon can be transformed into an equivalent MPC with terminal penalty
u)t(uu y)t(yyu(t))g(x(t),y(t) ))t(u),t(x(f)t(x
dRu'uQx'x)T(Px)'T(xu
JminT
t
≤≤≤≤==
τ++=
•
∫
Stability guarantee: Optimization of terminal constraints
w (set-point)
y(t+j)
t+N1 t+Np t
time Interval for stability constraints t+Np+Nm
d
(Prada et al., 1998)
• Terminal constraints to guarantee stability over the range [Np, Np+Nm] but not on the set point.
• Minimization of the distance d to the controller set-point, to assure a suitable response without stationary error.
Prediction horizon
Key idea: to split the problem in two parts:
Chemical reactor
mol/l 1C0K 380TK 340K 330TK 280
A
c
≤≤≤≤≤≤
Operation Constraints:
Significant nonlinearities and varying time constants
The objective is to control T and CA by manipulating Tc.
Tc=300+5 K
Tc=300-5 K
CSTR Tc
CA, T
CAf
Coolant stream temperature
T
CA
Concentration of A in the feed
Starting from the equilibrium point
=
=
=
K 300T K, 350T
,l/mol 5.0C
eqc
eq
eqA
Problem formulation
r
y(t+j)
t time
Interval for stability constraints
d
=++−++
=++−++
d)t/NNt(r)t/NNt(y
d)t/1Nt(r)t/1Nt(y
mpmp
pp
Mm
Mm
Mm
D)t/jt(uDU)t/jt(uUY)t/jt(yY
≤+∆≤≤+≤≤+≤
extra degree of freedom
t+N1 t+Np t+Np+Nm
d∈ℜ
[ ] [ ] 21Nu
0j
2tt
t
2
d,ud)jt(ud))(r)(y(min
pk
k
λ++∆β+ττ−τγ ∑∫−
=
+
∆
extra term
Simulation example: Tracking performance
5T ;K 305TK 270 cc ≤∆≤≤
Input constraints Prediction horizon: Np=15
Control horizon: Nu=2
NMPC Stable NMPC
T
CA
TC
T
CA
TC
Nm=3
Simulation example: Tracking performance
1T ;K 305TK 275 cc ≤∆≤≤
Input constraints Prediction horizon: Np=8
Control horizon: Nu=2
NMPC Stable NMPC
T
CA
TC
T
Nm=3