Model Predictive Control
Model Predictive Control
(MPC)
Overview of Model Predictive Control
Impulse/Step Response Model Identification
Predictions for SISO and MIMO Models
Model Predictive Control Calculations
Selection of Design and Tuning Parameters
1
MPC - Motivation
Practical Problems
Model Predictive Control
multivariable
difficult dynamic behavior
nonlinear
constraints (input, output)
2
MPC - Basic Concepts
1. Future values of output variables are predicted using a
Model Predictive Control
3
Model Predictive Control
MPC Block Diagram
4
Model Predictive Control
Control Hierarchy
5
MPC - Calculations
1. At the k-th sampling instant, the values of the manipulated
variables, u, at the next M sampling instants, {u(k), u(k+1), ,
Model Predictive Control
8
When Should MPC be Used?
Terminology:
y CV, u MV, d DV
9
MPC History
Model Algorithmic Control (MAC) (1978)
Model Predictive Control
10
Dynamic Models for MPC
Could be either:
Model Predictive Control
{h i } i = 0, 1, 2 , 3,
Process input-output relationship
y ( k ) = hi u ( k i ) (convolution summation)
i =0
12
For a stable process: h i 0 for i > N
Finite Impulse response (FIR)
N
Model Predictive Control
y ( k ) = hi u ( k i ) (h0 = 0)
i =0
e(k) (noise)
Assumptions:
The input u(k) is a continuing driving function of the process.
We observe u(k) for 0 k n + N where n > N.
The output sequence y(k) for N k n + N is also observed.
The noise e(k) is a random sequence with zero mean and is
uncorrelated with u(k).
14
Using the input-output relationship, we have n+1 eqs.
k = N, y ( N ) = h0 u ( N ) + h1 u ( N 1) + + hN u ( 0 ) + e ( N )
Model Predictive Control
k = N + 1, y ( N + 1) = h0 u ( N + 1) + h1 u ( N ) + + hN u (1) + e ( N + 1)
k = N + n, y ( N + n ) = h0 u ( N + n ) + h1 u ( N + n 1) + + hN u ( n ) + e ( N + n )
y(N ) e( N ) h0 u(N) u ( N 1) u ( 0)
y ( N + 1) e ( N + 1) h1
u ( N + 1) u(N) u (1)
y= ; e= ; h = ; U =
y ( N + n ) e ( N + n ) h N u ( N + n ) u ( N + n 1) u ( n )
( )
1
= UT U
Solution : h UT y (Least-squares estimator)
Accuracy of h
( )
=h
h is an unbiased estimate of h, i.e. E h
h is a consistent estimate of h if n
Potential problems
The selection of settling time parameter N (unknown a priori)
Usually needs to repeat the computation with progressively
increasing N values
A large N value may cause computational difficulty
16
Multivariable FIR Identification
Input-output relationship for the i-th output
r N
yi ( k ) = hij , u j ( k )
Model Predictive Control
j =1 =0
y i = [ U1 U 2 U r ] hi + ei = Uhi + ei
yi ( N ) ei ( N ) uj (N ) u j ( N 1) u j ( 0)
y ( N + 1) e ( N + 1) u j ( N + 1) uj (N) u j (1)
yi = i ; ei = i ; Uj = ;
yi ( N + n ) ei ( N + n ) u j ( N + n ) u j ( N + n 1)
u j ( n )
hij ,0
h
ij ,1 T T
hij = ; h = h T
h T
h
i1
i i2 ir
hij ,N
( )
1
Least-squares estimation = UT U
h UT y i
i
17
Discrete Step Response Models
Model Predictive Control
or hi = Si Si 1
18
Prediction for SISO Step Response Models
The step response model of a stable SISO process
N N
( )
y ( k + 1) = hi u ( k i + 1) = S i S i 1 u ( k i + 1)
Model Predictive Control
i =1 i =1
N 1
y ( k +1) = Si u ( k i + 1) + S N u ( k N + 1)
i =1
Solution:
A single prediction for J step ahead y ( k + J ) = S J u (k ) + y ( k + J )
o
21
Vector Notation for Multiple Predictions
Define vectors:
Y ( k +1) : predicted response for the next P sampling instants
Model Predictive Control
y ( k+1) y o ( k+1)
y ( )
k+ 2 y o ( k+2 )
Y ( k +1) Y ( k +1)
o
y ( k+P )
y ( k+P )
o
u ( k )
u ( )
k+1
U ( k )
u ( k+M -1)
22
Dynamic Matrix Model
The MPC control calculations are based on calculating
U ( k ) so that the predicted outputs move optimally to the
Model Predictive Control
new set-point
The model predictions can be written as
Y ( k +1) = S U ( k ) + Y o ( k +1)
u y ( k ) + y(k)
Process
=
U(s) 15s + 1
Assume that the disturbance transfer function is identical to the
process transfer function, Gd(s)=Gp(s). A unit step change in u
occurs at time t=2 min and a step disturbance, d=0.15, occurs at
t=8 min. The sampling period is t = 1 min.
(a) Compare the process response y(k) with the predictions that
were made 15 steps earlier based on a step response model with
N=80.
(b) Repeat part (a) for the situation where the step response coefficients
are calculated using an incorrect model:
Y(s) 4e-2 s
=
U(s) 20s + 1
25
y ( k +15 ) y ( k +15 ) + d ( k +15 )
y ( k +15 ) + y ( k ) y ( k )
Model Predictive Control
26
Prediction for MIMO Step Response Models
By the Principle of Superposition
N 1 N 1
y1 ( k + j ) = S11,i u1 ( k + j i ) + S11,N u1 ( k + j N ) + S12,i u2 ( k + j i ) + S12,N u2 ( k + j N )
Model Predictive Control
i =1 i =1
N 1 N 1
y2 ( k + j ) = S21,i u1 ( k + j i ) + S21,N u1 ( k + j N ) + S22,i u2 ( k + j i ) + S22,N u2 ( k + j N )
i =1 i =1
y ( k+1) y o ( k+1) u ( k )
y ( k+ 2 ) y o ( k+2 ) u ( k+1)
Y ( k +1) Y ( k +1)
o
U ( k )
y ( k+P ) mP 1
y ( k+P ) mP 1
o u ( k+M -1) rM 1
27
The mP m matrix is defined as
= [Im Im Im ]
T
P times
29
MPC Calculations
The control objective is to calculate a set of control moves
(input changes) that make the corrected predictions as close to
Model Predictive Control
( k + 1)T Q E
min J = E ( k + 1) + U ( k )T R U ( k )
U ( k )
32
MPC Control Law: Unconstrained Case
The MPC control law that minimizes the quadratic objective
function can be calculated analytically J
Model Predictive Control
=0
( ) U ( k )
-1
U ( k ) = S Q S + R
T T
S QE o
( k +1)
where S is the dynamic matrix.
This control law can be written in a more compact form
U ( k ) = K c E
o ( k +1)
where controller gain matrix Kc is defined to be:
( )
-1
Kc S Q S + R
T
ST Q Dimension: rM mP
where: u ( k )
u ( k+1)
U ( k )
(
u k+M -1) rM 1
Note that the controller gain matrix, Kc, is an rM mP matrix.
.
the disturbance. d ( k + j ) = y ( k ) y ( k )
Counter is updated: k = k + 1.
35
MPC with Inequality Constraints
Inequality constraints on input and output variables are
important characteristics for MPC applications
Model Predictive Control
N: model horizon
t : sampling period
P: prediction horizon (number of predictions)
M: control horizon (number of control moves)
Q: weighting matrix for predicted errors (Q > 0)
R: weighting matrix for control moves (R > 0)
37
Selection of Design Parameters
1. N and t
These parameters should be selected so that N t > open-loop
settling time. Typical values of N:
Model Predictive Control
The controller gain matrix, Kc, for two cases (Qii = 1, Rii = 0):
39
Disturbance response [MPC vs. PID (ITAE disturbance tuning)]
Model Predictive Control
40
MIMO Example:
Effects of MPC design parameters (M, P, Q, R)
Wood and Berry process
Model Predictive Control
t = 1 min
Saturation limits of 0.15 were imposed on each input
+1% set-point change in XB at t=0, followed by two feed flow rate
disturbances: +30% increase at t=50 and a return to the original
value at t=100 (Fs = 2.45)
Compare a variety of MPC controllers and a multi-loop control
system (Lee et al., 1998)
Control loop Kc I
XD R 0.85 7.21
XB S -0.089 8.86
41
Unconstrained MPC vs. Multi-loop Control
Model Predictive Control
MPC is superior to the multi-loop control system (faster responses, less oscillation).
42
Effect of input weighting matrix R
Model Predictive Control
When Rii are increased, the MPC inputs become smoother and the output
responses have larger deviations and longer settling times. 43
Effect of output weighting matrix Q
Model Predictive Control
The y responses are similar, but the u responses are smoother for M = 5.
45
MATLAB Tools for MPC
Unconstrained MPC (DMC)
Kmpc = mpccon(model,ywt,uwt,M,P)
Model Predictive Control
model = tfd2step(tfinal,delt,nout,g1,...,g25)
Determines the step response model of a transfer function model.
Inputs:
tfinal: truncation time for step response model.
delt: sampling interval for step response model.
nout: number of outputs, ny.
g1, g2,...: SISO transfer function ordered to be read in columnwise
(by input). The number of transfer functions required is
ny*nu. (nu=number of inputs). Limited to ny*nu <= 25.
Output:
model: step response coefficient matrix in MPC step format. 46
g = poly2tfd(num,den,delt,delay)
Create transfer functions for MPC toolbox
Inputs:
Model Predictive Control
47
Unconstrained MPC (DMC)
[yp,u,ym] = mpcsim(plant,model,Kmpc,tend,r,usat,...
tfilter,dplant,dmodel,dstep)
Simulation of the unconstrained Model Predictive Controller.
Model Predictive Control
REQUIRED INPUTS:
plant(model): the step response coefficient matrix of the plant
(model) generated by the function tfd2step.
Kmpc: the constant matrix computed by the function mpccon.
tend: final time of simulation.
r: reference trajectory (set-point).
OPTIONAL INPUTS:
usat: the matrix of manipulated variable constraints.It is a vector
of the lower limits (Ulow), upper limits (Uhigh) and rate of
change limits (DelU) on the manipulated variables.
tfilter: time constants for noise filter and unmeasured
disturbance lags.
dplant: step response coefficient matrix for the disturbance
generated by the function tfd2step.
dmodel: step response coefficient matrix for the measured
disturbance effect on the model output generated by
the function tfd2step.
dstep: matrix of disturbances to the plant.
OUTPUT:
y (system response), u (manipulated variable) and ym (model
response) 48
Constrained MPC (QDMC)
[yp,u,ym] = cmpc(plant,model,ywt,uwt,M,P,tend,r,ulim,ylim...
tfilter,dplant,dmodel,dstep)
Model Predictive Control
REQUIRED INPUTS:
plant, model, ywt, uwt, M, P, tend, r
OPTIONAL INPUTS:
ulim: matrix of manipulated variable constraints. It is a trajectory
of lower limits (Ulow), upper limits (Uhigh) and rate of change
(DelU).
ylim: matrix of output variable constraints. It is a trajectory of
lower (Ylow) and upper limits (Yhigh) on the output variables.
tfilter, dplant, dmodel, dstep
OUTPUT:
y (system response), u (manipulated variable) and ym (model
response)
49