Chemical and Biological Engineering
MPC Introduction
- B. Wayne Bequette
- Overview
- Basic Concept of MPC
- History
- Optimization Formulation
- Models
- Analytical Solution to Unconstrained Problem
- Summary
- Limitations & a Look Ahead
MPC Introduction Overview Basic Concept of MPC History - - PowerPoint PPT Presentation
MPC Introduction Overview Basic Concept of MPC History Optimization Formulation Models Analytical Solution to Unconstrained Problem Summary Limitations & a Look Ahead B. Wayne Bequette Chemical and Biological
Chemical and Biological Engineering
LC PC PC PC PC LC LC LC cooling water Toluene Hydrogen purge Hydrogen, Methane fuel gas steam steam steam Diphenyl Benzene product CH4 Recycle Toluene CC TC TC Reactor Recycle Column Benzene Column Stabilizer Flash Recycle Compressor cooling water CW CW quench TC LC LC LC TC
FC FC FC FC TC CC TC
l Multivariable, Large Scale
Ø Challenge to tune individual SISO controllers
l Operation at Constraints
Ø Anti-reset windup and other strategies for PID
l Economic Payout for Advanced Control
Ø Economic return justifies capital and on-going maintenance costs
l Model Predictive Control
Ø Evolved independently in the US and France refining industry
Unit 1 - PID Structure
Global Steady-State Optimization (every day) Local Steady-State Optimization (every hour) Dynamic Constraint Control (every minute) Supervisory Dynamic Control (every minute) Basic Dynamic Control (every second) Plant-Wide Optimization Unit 1 Local Optimization Unit 2 Local Optimization High/Low Select Logic PID Lead/Lag PID SUM SUM
Model Predictive Control (MPC)
Unit 1 Distributed Control System (PID) Unit 2 Distributed Control System (PID)
FC PC TC LC FC PC TC LC
Unit 2 - MPC Structure From Tom Badgwell, 2003 Spring AIChE Meeting, New Orleans
Model Predictive Control (MPC)
t k
current step
setpoint
y
actual outputs (past)
P
Prediction Horizon past control moves
u
max min
M
Control Horizon
past future model prediction
t k+1
current step
setpoint
y
actual outputs (past)
P
Prediction Horizon past control moves
u
max min
M
Control Horizon
model prediction from k new model prediction
Find current and future manipulated inputs that best meet a desired future output
“control move”.
l Type of model for predictions? l Information needed at step k for predictions? l Objective function and optimization technique? l Correction for model error?
Chapter 16
Model Predictive Control (MPC)
t k
current step
setpoint
y
actual outputs (past)
P
Prediction Horizon past control moves
u
max min
M
Control Horizon
past future model prediction
t k+1
current step
setpoint
y
actual outputs (past)
P
Prediction Horizon past control moves
u
max min
M
Control Horizon
model prediction from k new model prediction
At next sample time:
Correct for model mismatch, then perform new optimization. This is a major issue – “disturbances” vs. model uncertainty Find current and future manipulated inputs that best meet a desired future output
“control move”.
l Intuitive
Ø Basically arose in two different “camps”
l Dynamic Matrix Control (DMC)
Ø 1960’s and 1970’s – Shell Oil - US Ø Related to techniques developed in France (IDCOM) Ø Large-scale MIMO Ø Formulation for constraints important
l Generalized Predictive Control (GPC)
Ø Evolved from adaptive control Ø Focus on SISO, awkward for MIMO
Charlie Cutler
(1976)
− = + = + +
Δ + − =
1 2 1 2
ˆ
M i i k P i i k i k
u w y r J
Quadratic Objective Function, Prediction Horizon (P) = 3, Control Horizon (M) = 2
With linear models, results in analytical solution (w/o constraints)
General Representation of a Quadratic Objective Function
2 1 2 2 3 3 2 2 2 2 1 1
ˆ ˆ ˆ
+ + + + + + +
Δ + Δ + − + − + − =
k k k k k k k k
u w u w y r y r y r J
Weight 2 control moves 3 steps into future
− = + = + +
+ − =
1 2 1 2
ˆ
M i i k P i i k i k
u w y r J
− = + = + +
1 1
M i i k P i i k i k
Penalize u rather than Δu Sum of absolute values (results in LP) Will usually result in “offset” Existing LP methods are efficient, but solutions hop from one constraint to another
l State Space l ARX (auto-regressive, exogenous input) l Step Response l Impulse (Pulse) Response l Nonlinear, Fundamental (First-Principles) l ANN (Artificial Neural Networks) l Hammerstein (static NL with linear dynamics) l Volterra l Multiple Model
∞ − ∞ + − − + − − ∞ = −
+ + + + + = =∑
k N N k N N k N k i i k i k
u h u h u h u h u h y
1 1 1 1 1 k k k k k
Cx y u x x = Γ + Φ =
+1
State Space Input-Output (ARX)
m k m k k k n k n k k k
u b u b u b u b y a y a y a y
− − − − − −
+ + + + + − − − − =
2 2 1 1 2 2 1 1
Step Response
usually b0 = 0 Some texts/papers have different sign conventions
Impulse Response
∞ − ∞ + − − + − − ∞ = −
Δ + + Δ + Δ + + Δ = Δ =∑
k N N k N N k N k i i k i k
u s u s u s u s u s y
1 1 1 1 1
2 4 6 8 0.5 1 1.5 2 temp, deg C discrete-time step
2 4 6 8 0.2 0.4 0.6 0.8 1 discrete-time step psig
s
1
s s s s
2 4 5 3 Etc.
S = s1 s2 s3 s4 s5 L sN
T
Used in DMC
2 4 6 8 10 0.2 0.4 0.6 0.8 1 discrete-time step psig
2 4 6 8 10
0.2 0.4 0.6 0.8 1 discrete-time step temp, deg C
h h h 1 2 3
hi = si − si−1 si = hj
j=1 i
Impulse and step response coefficients are related
Used in IDCOM
Γ Φ =
−1 i i
C H
= = −
k i i k i i k
1 1 1 k k k k k
+1
k k k k k
x C y u x x
1
= Γ + Φ =
+
with known current state, easy to propagate estimates
k k k k k k k
u C x C Cx y u x x Γ + Φ = = Γ + Φ =
+ + + 1 1 1
and, using control changes
k k k k k k k
u C u C x C y u u u ΓΔ + Γ + Φ = Δ + =
− + − 1 1 1
k k k k k k
− + 1 | | 1
Measurements through k Estimate at k+1 Estimate at k Measurements through k Predicted
State estimate Previous input Current Input change
Now, propagate the prediction for P steps into the future
response "forced" 1 1 1 1 1 1 1 made) are moves control more no (if response" unforced "
"free" 1 1 1 | 2 | | 2 | 1
ˆ ˆ ˆ ˆ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Δ Δ Δ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Γ Φ Γ Φ Γ Γ + ΦΓ Γ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Γ Φ Γ + ΦΓ Γ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Φ Φ Φ = ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡
− + + − = − = − − = − + + +
M k k k P i i P i i k P i i k k P k P k k k k k
u u u C C C C C C u C C C C x C C C y y y
f
f
response "forced" 1 1 1 1 1 2 1 made) are moves control more no (if response" unforced "
"free" 1 2 1 | 2 | | 2 | 1
ˆ ˆ ˆ ˆ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Δ Δ Δ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Φ Φ Φ = ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡
− + + + − − − + + + M k k k M P P P k P k k P k P k k k k k
u u u S S S S S S u S S S x C C C y y y
f
f
Step response coefficients
T i k M i u T i k P i k i k k i k y T k i k k i k u
u W u y r W y r J
f
+ − = + = + + + + Δ
Δ Δ + − − =
1 1 | | | |
ˆ ˆ min
⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ =
y y Y
W W W ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ =
u u U
W W W
Y T
f U T f
Where
f f
f f
and so “unforced” (free response) error future setpoints
f f Y T f T f Y T f T f Y T f f Y T f f Y T
u S W S u E W S u E W E u S E W u S E E W E Δ Δ + Δ − = Δ − Δ − = 2 ˆ ˆ
f U T f
u W u Δ Δ +
=
Δ
J
f
u
min
E W E
Y T
ˆ ˆ
E W S u u W S W S u
Y T f T f f U f Y T f T f
Δ − Δ + Δ 2
=
Δ
J
f
u
min
so can be written
= Δ ∂ ∂
f
u J
and the unconstrained solution is found from
In practice, do not actually invert a matrix. Solve as set of simultaneous equations (or use \ in MATLAB)
Y T f U f Y T f f
Analytical Solution for Unconstrained System
Y T f U f Y T f f 1 −
“unforced” error
moves future and current 1 1
⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Δ Δ Δ = Δ
− + + M k k k f
u u u u Although a set of control moves is computed, only the first move is implemented The next output at k+1 is obtained, then a new
k
u Δ
l Prediction Horizon, P l Control Horizon, M l Manipulated Input Weighting, W
u
l Concise overview of MPC l State space model, unconstrained solution l Have not discussed
Ø State estimation and “corrected outputs”
n The additive disturbance assumption of DMC is
covered in the slides that follow (this is identical to the plant-model mismatch term in IMC)
Ø Disturbances Ø Constraints Ø Other model forms
k k k k k k k k k k k
p y y y y p
| 1 | | 1 | |
ˆ ˆ ˆ ˆ ˆ + = − =
− −
1 | 1 | 1 1 | 1 1 |
− − − − − −
k k k k k k k k k
Notice that Model States are Not “Corrected”
1 | |
−
k k k k
Prediction at step k, based
Model output predicted from k-1 Measured
“additive output” disturbance assumption (previously dk) Forces the model “corrected output” equal to measured output
k k k k k k k k k k k k k k k k k k k k k k k k k k
p u C u C x C p u C x C p x C y p p u x x
| 1 1 | | 1 | | 1 | 1 | 1 | | 1 | | 1
ˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆ ˆ
+ − + + + + + +
+ ΓΔ + Γ + Φ = + Γ + Φ = = + = = Γ + Φ =
Assumes future corrections equal to current correction
response "forced" 1 1 1 1 1 1 1 made) are moves control more no (if response" unforced "
"free" 1 1 1 | | 2 | | 2 | 1
ˆ ˆ ˆ ˆ ˆ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Δ Δ Δ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Γ Φ Γ Φ Γ Γ + ΦΓ Γ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Γ Φ Γ + ΦΓ Γ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Φ Φ Φ = ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡
− + + − = − = − − = − + + +
M k k k P i i P i i k P i i k k k k P k P k k k k k
u u u C C C C C C u C C C C p I I I x C C C y y y
f
f
response "forced" 1 1 1 1 1 2 1 made) are moves control more no (if response" unforced "
"free" 1 2 1 | | 2 | | 2 | 1
ˆ ˆ ˆ ˆ ˆ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Δ Δ Δ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ + ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ Φ Φ Φ = ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡
− + + + − − − + + + M k k k M P P P k P k k k k P k P k k k k k
u u u S S S S S S u S S S p I I I x C C C y y y
f
f
Cain F Cb F Example Inverse Response Process: Van de Vusse
Constant V,T, ρ
A B C
k1 k2
A+A D
k3
dCa dt = -k1Ca - k3Ca2 + (Cain - Ca)u dCb dt = k1Ca - k2Cb - Cbu where u = F/V
10 20 30 40 50
0.1 0.2 0.3 0.4 0.5 0.6 discrete time index, i s(i) step response coefficients
First four coefficients are negative Sum of first eight coefficients is positive
1 2 3 4 5 6
0.5 1 1.5 y, mol/l time, min 1 2 3 4 5 6 1 2 3 u, min-1 time, min P = 10, M = 3 P = 25, M = 1 P = 10, M = 3 P = 25, M = 1
Short prediction horizons & long control horizons lead to more aggressive action
1 2 3 4 5 6
0.5 1 1.5 y, mol/l time, min P = 8 P = 7 1 2 3 4 5 6
2 u, min-1 time, min P = 8 P = 7
Control Horizon: M = 1, Weighting: W = 0 P=7: Unstable
Stability of Inverse Response Systems with DMC
l For a control horizon, M = 1, closed-loop MPC will be stable
for a prediction horizon where the sum of the impulse response coefficients has the same sign as the process gain
min
1
= P i i
For the example, Pmin = 8, so P = 7 = unstable
l Concise overview of MPC l State space model, unconstrained solution l The additive disturbance assumption of DMC is
used for plant-model mismatch
l Upcoming topics
Ø Disturbances and state estimation (Kalman filtering
framework)
Ø Constraints Ø Other model forms