Professional Documents
Culture Documents
LecturenoteonMPC JHL PDF
LecturenoteonMPC JHL PDF
Jay H. Lee
School of Chemical and Biomolecular Engineering
Center for Process Systems Engineering
Georgia Inst. of Technology
Prepared for
Pan American Advanced Studies Institute Program on
Process Systems Engineering
Schedule
Introduction to MPC
- Motivation
- History and status of industrial use of MPC
- Overview of commercial packages
Key Elements of MPC
1
t
de
p = kc 1 + e(t ' )dt '+ D
I 0 dt Ad Hoc Strategies,
Heuristics Regulation
PID Controllers Constraint handling
Local optimization
Controller Plant
Set-point Input Output
r(t) u(t) y(t)
Plant
Controller
Input Output
Set-point
u(t) y(t)
r(t)
Measurements
Computational ) 0
g i ( x i , u i limitation for
Pathnumerical
constraints solution, esp. back in
the 50sgand p ) 0
p ( x 60s Terminal constraints
x& = f (x,u ) Model constraints
Model Predictive Control (Receding Horizon Control)
my move
his move
my
move
Opponent
(The Plant)
The Opponents
My Move
Move I
(The Controller) New State
Operational Hierarchy Before and After MPC
Unit 1 - Conventional
Structure Unit 2 - MPC Structure
Global Steady-State
Plant-Wide Optimization Optimization
(every day)
Local Steady-State
Unit 1 Local Optimization Unit 2 Local Optimization Optimization
(every hour)
Dynamic
High/Low Select Logic Constraint
Model Control
Predictive (every minute)
PID Lead/Lag PID
Control Supervisory
(MPC) Dynamic
SUM SUM
Control
(every minute)
Classical MPC:
Solution Solve at
each time k
p = Size of prediction window
p
1
min
2 3
(
u ( j ),u ( j ),u ( j ) A
r ( k + i | k ) rA *)2
i =1
j = k ,L, k + p 1
+ (rB (k + i | k ) rB *)
2
+ (q(k + i | k ) q *)
2
Adersa
Predictive Functional Control (PFC)
Aspen Technology xk+1 = Axk + Buuk + Bv v k
Aspen Target
yk = g(xk ) = Cxk + NN(xk )
Continental Controls
Multivariable Control (MVC): Linear Dynamics + Static Nonlinearity
DOT Products
NOVA Nonlinear Controller (NLC): First Principles Model
Pavilion Technologies
Process Perfecter: Linear Dynamics + Static Nonlinearity
Results of a Survey in 1999 for Nonlinear MPC
Controller Design and Tuning Procedure
Plant-Wide Optimization
Determine plant-wide the
optimal operating condition for
the day
Local Optimization
Make fine adjustments for
local units
Take each local unit to the Multivariable
optimal condition fast but Control
smoothly without violating
constraints
MPC
Distributed Control
System (PID)
FC TC
PC LC
Local Optimization
A separate steady-state optimization to determine steady-state
targets for the inputs and outputs; RMPCT introduced a dynamic
optimizer recently
The RMPCT and PFC controllers allow for both linear and
quadratic terms in the SS optimization
J = j =1 e + j =0 uk + j + j =0 e
P 2 M 1 2 M 1 2
y u
k+ j k+ j
Qj Sj Rj
( )
T
u = u , u ,...u
M T
0
T
1
T
M1 u uk u
x k +1 = f (x k , u k ) u u k u
y k +1 = g ( x k +1 ) + b k +1 y yk y
Dynamic Optimization
P 2
J = yk+ j + u M 1 u ss
r 2
min
r M j =1
y k+ j S
y k + j ,u Q
past future
past future
Soft Constraint, Zone Control Honeywells RMPCT
quadratic penalty
Finite horizon
Coincidence points
Input Parameterization
control horizon
Convolution data L S
(Finite Impulse
or Step Response)
~20% under
capacity
Debutanizer Diagram
PC
190 lb
Pressure 160 F
Fan
PCT
To Deethanizer
Reflux
Pre-Heater
From Stripper TC
Feed
TC
Flooding Tray 20 Temp.
TC
400 F
Gasoline to blending
Process Limitation
Operation Problems:
Overloading
-- over design capacity.
Flooding
-- usually jet flooding, causing very poor separation.
Constrained Control:
Regulatory Control:
Regulate OVHD PCT or C5 at spec.
Rejecting disturbance not through slurry, if possible.
Real-Time Optimization
Optimization Objectives:
Controlled Manipulated
PCT OVHD Pressure
Fan R-PID Fan Output
RVP Internal Reflux
Diff. Pressure MPC R-PID Reflux
Feed Temp. Pre-heater By-Pass
Pre-heater By-Pass
Tray 20 Temp.
OVHD C5 % Reboiler By-Pass
Reboiler By-Pass
Disturbances
Feed
Stripper Bottom Temp.
MPCs MV Moves
180
160
Pressure (lb)
140
120
Feed-heater by-pass
100
80
60
Reboiler by-pass
40
20 Reflux
0
0 500 1000 1500 2000 2500 3000
minute
Reflux vs. Feed
32
30
28 Feed
26
24 An indication
22 that separation
efficiency
20
increased.
18
16 Reflux
14
12
0 500 1000 1500 2000 2500 3000
minute
Reflux-to-Feed Ratio
0.54
0.52
0.5
0.48
Handling Flood
0.46
0.44
0.42
0 500 1000 1500 2000 2500 3000
minute
Handling Flood
3.2
3
Potential Flooding
2.8
2.6
2.4
Differential
Pressure 2.2
Across Tower 2
1.8
1.6
1.4
1.2
0 500 1000 1500 2000 2500 3000
minute
Product Spec's
180
160
100
80
60
40
190 lb
Pressure 160 F
Fan
Top Tray
PCT
Reflux
Pre-Heater
Feed Tray
Feed
Tray 20 Temp.
Flooding Tray 20
After MPC is on
400 F
RVP
Temperature
Tray #
Gasoline to blending
MPC Control Results (1)
C4- Total 5
% 4.5
4
MPC was turned on
When RMPCT
3.5
3
2.5
2
1.5
1
0.5
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
April, 1991 Date
RVP 7.5
When RMPCT
MPC was turned on
7
6.5
5.5
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
April, 1991 Date
Debutanizer Bottom RVP Daily Average
MPC Control Results (3)
C5+ Total 20
% 18
MPC was turned on
When RMPCT
16
14
12
10
2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
April, 1991 Date
Debutanizer Top C5+ Total (I-C5, N-C5 & C5=+)
Other Benefits
Flooding is eliminated.
Acknowledgment
To Optimization
Options
Model Types
Finite Impulse Response Model or Step Response Model
State-Space Model
Linear or Nonlinear
Measurement Correction
To the prediction (based on open-loop state calculation)
To the state (through state estimation)
Objective Function
Linear or Quadratic
Constrained or Unconstrained
Prediction Model for Different
Model Types
Model relates
input samples to
output samples
{v0 , v1 , v2 ,L}
{y0 , y1 , y2 ,L}
v can be a MV
(u) or a
Measured DV
(d)
Finite Impulse Response Model (1)
Assumptions:
H0 = 0: no immediate effect
The response settles back in n steps s.t. Hn+1 = Hn+2
= = 0: Finite Impulse Response (reasonable for
stable processes)
Finite Impulse Response Model (2)
y (k ) = H1v(k 1) + L + H n v(k n)
Finite Impulse Response Model (3)
T
State x( k ) = v ( k 1),L , v ( k n)
T T
n past input samples
(includes both MVs and
measured DVs)
State Update: Easy!
x(k + 1) = M 0 x(k ) + { v(k )
{ insertion
shift
Assumptions:
S0 = 0: no immediate effect
The response settles in n steps s.t. Sn= Sn+1 = = S: the same
as the finite impulse response assumption
Relationship with the impulse response coefficients:
Step Response Model (2)
State
T n future outputs assuming
x(k ) = y0T (k ),L , yn 1T (k ) the input remains constant at
the most recent value
yi (k ) = y (k + i ) w/ u (k ) = u (k + 1) = L = 0
x(k)
Note yn 1 (k ) = yn (k ) = L = y (k )
Also y (k ) = y0 (k )
Pictorial Representation of the State Update
x(k+1)
M1 x(k)
Step Response Model (3)
State Update
x(k + 1) = M
{ 1 x ( k ) + S{ v(k )
shift step response
drop
y0 (k + 1) S1
S2 y0 ( k )
y (k + 1) y (k )
1
1
M Sn-1 M
yn 2 (k + 1) Sn yn 2 (k )
y (k + 1) y (k )
n 1 n 1
Step Response Model (4)
Prediction
x(k)
z (k + 1) = Az (k ) + B u u (k ) + B d d (k )
y (k ) = Cz (k )
Discretization State-Space
Realization
~ ~ ~ y ( z ) = G u ( z )u ( z ) + G d ( z )d ( z ) State-Space
z& = A z + B u u + B d d Identification
~ or
y = Cz
y ( s ) = G ( s )u ( s ) + G d ( s )d ( s )
Linearization
I/O model
z& = f ( z , u , d ) Identification
y = g ( z) {y(i), u (i), i = 1,L N }
Fundamental Model Test Data
State-Space Model (2)
z (k + 1) = Az (k ) + B u u (k ) + B d d (k )
y (k + 1) = Cz (k + 1)
z (k ) = Az (k 1) + B u u (k 1) + B d d (k 1)
-
y (k ) = Cz (k )
z (k + 1) = Az (k ) + B u u (k ) + B d d (k )
y (k + 1) = Cz (k + 1)
(
y (k + 1) = y (k ) + C Az (k ) + B u u (k ) + B d d (k ) )
z (k + 1) A 0 z (k ) B u Bd
y (k + 1) = CA I y (k ) + u u (k ) + d d (k )
CB CB
z (k )
y (k ) = [0 I ]
State Update
x k + = x k + u
u k + d
d (k )
y (k ) ( 1) ( ) ( )
y ( k ) = x ( k )
State-Space Model (3)
Prediction
Model prediction of y(k) y (k ) = x(k )
Model prediction error e( k ) = y m ( k ) y ( k )
Future input
Predicted future The state stored in moves
output samples memory (to be decided)
yk +1|k u (k )
u
M =
M x ( k ) + M
yk + p|k p u (k + p 1)
Dynamic Matrix
(made of step d (k ) e(k )
response coefficients)
d M + M
Feedback Error
d (k + p 1) e(k ) Correction
Feedforward term: new measurement
(Assume d(k+1)== d(k+p-1)=0)
Summary
Assumptions
Measured DV (d) remains constant at the current value of d(k)
Model prediction error (e) remains constant at the current value
of e(k)
Ramp Type Extrapolation
For Integrating Processes, Slow Dynamics
e(k + i ) = e(k ) + i (e(k ) e(k 1))
d (k ) = d (k + 1) = L = d (k + p 1)
e(k)-e(k-1)
Use of State Estimation
Measurement Correction of State
State Estimate:
Compact representation
Previous State Estimate Of the past input and
(in Memory) measurement record
State Update
To Optimization
State Update Equation
x(k + 1) = x(k ) + u (k ) + d (k )
u d
+ K ( ym (k ) x(k ))
K is the update gain matrix that can be found in
various ways
Pole placement: Not so effective with systems with
many states (most chemical processes)
Kalman filtering: Requires a stochastic model of form
yk +1|k u (k )
u
M = M x(k ) + M
yk + p|k p u (k + p 1)
d (k ) e(k )
d
M +
M
d (k + p 1) e(k )
Additional measurement correction NOT needed here!
What Are the Potential Advantages?
i =1 i =0
CU m (k ) h(k )
Optimization Problem
Quadratic Program
min U (k ) HU m (k ) + g (k )U m (k )
T
m
T
U m ( k )
y | k
Cs cs ( k )
u s (k )
u s (k ) = u (k 1) + u (k ) + L + u (k + m 1)
y|k = bs (k ) + Ls u s (k )
Steady-State
Optimal Setting Values (setpoints) Prediction Eqn.
y , u (k )
*
| k
*
s
State
(sometimes input deviations are included Feedforward Measurement
in the quadratic objective function) Feedback Error
Dynamic
To Dynamic Optimization (Quadratic Program) Prediction Eqn.
Use of Infinite Prediction Horizon
and Stability
Use of Prediction Horizon Why?
Stability guarantee
The optimal cost function can be shown to be the
control Lyapunov function
Less parameters to tune
More consistent, intuitive effect of weight
parameters
Close connection with the classical
optimal control methods, e.g., LQG control
Step Response Model Case
m 1
V (k ) = ( yk +i|k y*) ( yk +i|k y*) + u T (k + i )u u (k + i )
T y
i =1 i =0
m + n 1 m 1
V (k ) = k + i|k
( y
i =1
y*) T
( y y
k + i|k y*) + u
i =0
T
( k + i ) u
u (k + i )
Steady-State Optimization
(Linear Program or Quadratic Program)
x& = f ( x, u , d ) Discretization?
x(k + 1) = F ( x(k ), u (k ), d (k ))
y = g ( x) y (k ) = g ( x(k ))
Orthogonal
Collocation
yk +1|k = g o F ( x(k ), u (k ), d (k )) + e(k )
yk + 2|k = g o F (F ( x(k ), u (k ), d (k )), u (k + 1), d (k ) ) + e(k )
M
yk + p|k = g o F p ( x(k ), u (k ),Lu (k + p 1), d (k ) ) + e(k )
The prediction equation is nonlinear w.r.t. u(k), , u(k+p-1)
k +1
f ( x, u , d )
yk +1|k k u (k )
y k +2 u (k + 1)
k + 2|k = f ( x, u , d ) + u (k )
M k M
k + p M
yk + p|k u (k + p 1)
144424443
f ( x , u , d ) Linearized Effect of Future Input Adjustments
k
Model integration with
Linear prediction equation
constant input u=u(k-1)
and d=d(k)
Linear or Quadratic Program
Additional Comments / Summary
Building a dynamic system model using data obtained from the plant
Why Important?
Outlier removal
Pretreatment Pre-filtering
Conditioned
Data
Model structure
ID Algorithm (Parameter) estimation algorithm
Model
Source of validation data
Validation Criterion
No
End Objective: Control
Yes
Model Structure
Model Structure (1)
Model
Output
Disturbance Noise
Process Noise Model
Measured
Outputs
Inputs Plant
Dynamics
I/O Model
White noise sequence
y ( k ) = G ( q )u ( k ) + H ( q ) e( k )
1424 3 14243
effect of inputs effect of disturbances, noise
Models auto- and cross-correlations of the residual (not physical cause-effect)
b1q 1 + L + bm q m 1
G (q) = 1 the
, H ( q ) = 1 n
1 a1q average
ARMAX (Moving L aof
n q n noise term)1 a1 q L a n q
y (k ) = a1 y (k 1) + L + an y (k n) + b1u (k 1) + L + bmu (k m)
+ e(k ) + c1e(k 1) + L + cn e(k n)
b1q 1 + L + bm q m 1 + c1q 1 + L + cn q n
G (q) = 1 n
, H (q) =
1 a1q L an q 1 a1q 1 L an q n
SISO I/O Model Structure (2)
~
y (k ) = a1 ~
y (k 1) + L + an ~
y (k n) + b1u (k 1) + L + bmu (k m);
y (k ) = ~
y ( k ) + e( k )
b1q 1 + L + bm q m
G (q) = 1 n
, H (q) = 1
1 a1q L an q
Box Jenkins (More general than ARMAX)
b1q 1 + L + bm q m 1 + c1q 1 + L + cn q n
G (q) = 1 n
, H (q) =
1 a1q L an q 1 d1q 1 L d n q n
MIMO I/O Model Structure
Inputs and outputs are vectors. Coefficients are matrices.
For example, ARX model becomes
y (k ) = A1 y (k 1) + L + An y (k n)
+ B1u (k 1) + L + Bmu (k m) + e(k )
( 1
G (q) = I A1q L An q n 1
) (B q 1
1
+ L + Bm q m )
H (q) = (I A q1
1
L An q )
n 1
Model
Model Model Parameter For
Structure Structure (Model) Validation
Data Selection Estimation
Statistical
Prediction Error IV Method
Method Method MLE
Bayesian
Subspace ID
Method
ETFE
Frequency Domain
Prediction Error Method
1 N
2
min e( k ) 2 e(k ) = H 1 (q, )( y (k ) G (q, )u (k ) )
N k =1
ARX, FIR Linear least squares,
ARMAX, OE, BJ Nonlinear least squares
Subspace Method
More recent development
Dates back to the classical realization theories but rediscov
ered and extended by several people
Identifies a state-space model
Some theories and software tools
Computationally simple
Non-iterative, linear algebra
Good for identifying multivariable models
No special parameterization is needed
Not optimal in any sense
May need a lot of data for good results
May be combined with PEM
Use SS method to obtain an initial guess for PEM
Main Idea of the SS-ID Method (1)
Y
Y 0+ = o [L1 L2 ] + L3U 0+ + E 0+
14243 U
M
n 0 P1T o = Q11n/ 2
M = [Q1 Q2 ] T
0 0 P2
Some variations exist among
different algorithms in terms
The column space of Q1 is the state space of picking the state basis
Main Idea of the SS-ID Method(4)
Obtain the data for x(k)
Y (k )
x(k ) = o
{ U (k )
pseudo inverse
Obtain the data for x(k+1) in a similar manner
Obtain A,B and C through linear regression
Consistent estimation since the residual is independent of the regre
ssor
x(k + 1) A B x(k ) Ke(k )
y (k ) = C 0 y (k ) + e(k )
1 424 3
Residual
Obtain K and Cov(e) by using the residual data
Properties
o C , A B
MOESP (Verhaegen)
Error Analysis
Error Types
Bias: Error due to structural mismatch
Bias = the error as # of data points
Independent of # of data points collected
Bias distribution (e.g., in the frequency domain) depends on the
input spectrum, pre-filtering of the data, etc.
Frequency-domain bias distribution under PEM - by Ljung
Variance: Error due to limited availability of data
Vanishes as # of data points
Depends on the number of parameters, the number of data poin
ts, S/N ratio, etc. but not on pre-filtering
Asymptotic distribution (as n, N ):
Main tradeoff
Richer structure (more parameters) Bias, Variance
n
cov(vec(G N )) ( u ) T d
N 442443
1
Noise to signal ratio
Plant Test for
Data Generation
Test Signals
Very Important
Signal-to-noise ratio Distribution and size of the variance
Bias distribution
Popular Types
Multiple steps: Power mostly in the low-frequency region Good e
stimation of steady-state gains (even with step disturbances) but g
enerally poor estimation of high frequency dynamics
PRBS: Flat spectrum Good estimation of the entire frequency re
sponse, given the error also has a flat spectrum (often not true)
Combine steps w/ PRBS?
Multi-Input Testing (MIT) vs.
Single Input Testing (SIT)
Open-Loop Testing
Perturbation Signal r d
y
G0
u
Closed-Loop Testing
Dither Signal d
r
Location 1 Location 2
y
C G0
_ u
Pros and Cons of Closed-Loop Testing
Pros
Safer, less damaging effect on the on-going operation
Generates data that are more relevant to closed-loop c
ontrol
Cons
Correlation between input perturbations and disturbanc
es / noise through the feedback.
Many algorithms can fail or give problems They give
bias unless the assumed noise structure is perfect
Important Points from Analysis
External perturbations (dither) are necessary.
Perturbations due to error feedback hardly contributes to variance
reduction (since they are correlated to the errors)
eu u1 = ( Pe u1 ) ( ue u1 )
123 1424 3
E{G0 G N } = ( H 0 H ) eu u1 Noise to signal Relative contribution
ratio of noise feedback
to input spectrum
Direct Approach
D N = { y (i ), u (i ), i = 1,..., N } G N ( and H N )
Indirect Approach
1
D = { y (i ), r (i ), i = 1,..., N } TN G N
N G =T ( I T C )
yr yr
yr N N N
~N
D2 = { y(i)}
Data Pretreatment
Main Issues (1)
p 1
min ( x j , u j ) + p (x p )
u0 ,K,u p 1 j = 0
stage-wise terminal
cost cost
g j (x j ,u j ) 0 Path constraints
g p (xp ) 0 Terminal constraints
x j +1 = f ( x j , u j ) Model constraints
j
min E ( x j , u j )
u j = ( x j ) j =0
0 < <1
Discount factor
x j +1 = f h ( x j , u j , j ) Markov sys. model
[
Pr g ( x j , u j ) 0 ] Chance constraint
( ( x j ))
The concept of cost-to- *
go
J ( xk ) j k 1
j = k +1
x j , *
[
J * ( xk ) = min E ( xk , u k ) + J * ( f h ( xk , u k )
u(k )
]
ime ns ip+1ac
n
J
S ( ) = min E [
( , u ) + J ]
( )
i
f D ctio
u
o
r se & A
Cu tate sampling &
(S discretization
i = i+1
Approximate Dynamic Programming (ADP)
On-line Decision
[ ]
u = ( x) = arg min E ( x,u ) + J ( f ( x,u ) )
u
~
Sample Avg.
Approximation of Cost-to-Go
~
State and input trajectories: xk , u k J ( x) := xk J ( xk )
Initial cost-to-go: J ( x) = i i