Download - Introduction for MPC
1B Erik Ydstie, CMU
Course Objectives: 1. The McNamara Program for MPC2. The Feldbaum Program for MPC3. From Optimal Control to MPC to SYSID for Control and Back4.Towards Tractable Optimization Formulations5. State of Art (Challenging – Problem of Integration and Software)
System Identification for MPC Conflict of Conflux?B. Erik Ydstie, Carnegie Mellon University
System Identification (SYSID) Review
Mass and Energy Balance Constraints (nonlinear)
dzidt
=pi(z) +nMV +nDVX
j=1
fi(uj , z), i = 1, ..., n
yk =hk(z), k = 1, ..., nPV
Linear (output) error model
e(t) = y(t)�Gp(q�1)u(t)
LT
Feed
Product
Cooling water return
FT
TT
Interface Layer (SCADA)
Measured Outputs y
Control Inputs u
CT FT
FT
Distributed Control System (DCS) Setpoints y*
Model Predictive Controller
• Capture Flowsheet structure• Energy and material balances
- Collinearity- Uncollinearity
Used for very large systems 50 + MV/DVs 100+ CVs
B. Erik Ydstie, ILS Inc. 3
Data Flow
MPC Control
ABBHoneywellAspenEmerson Process
Prior InformationStep-responseState SpaceLaguerre,…Tuning Parameters,…
.XML
.TXT
B.ErikYdstie
Model estimated using output error identification (global optimality)
MPC –SYSID • Boiler Master –Turbine Master Controls (Emerson/Ovation)• Turbine Controls for SiemensSYSID Data from
B.ErikYdstie
Problem: Define the Operator G that “best” matches the prior information and process data.
Bayes Estimation Problem with Constraints
• Prior structure of G• Digraph (edges in the process network)• Parametric representation for each Gij (nodes)’• Information of collinearity structure
• Process Data• Semi-closed loop• Experiment Design
G25
G38
0 1000 2000 3000 4000 5000 6000 7000-50
0
50
100
150
200
250
300
350
400
Prior Information: System Strucure
10 MV/DVs12 CVs
I/O Data
DigraphNetwork
Collinearity:SVDRGAAngles
N(n,m) =
(n� 1)n(m� 1)m
4
= 2970, 7! 0.12 deg separation
Bilinear constraints
Prior Information: Model Structures
B. Erik Ydstie, ILS Inc. 7
Polynomials used NameB FIR, SRA,B ARX, Equation error,
Instrumental variables,..A,B,C ARMAX, AMLB,F OE (Output Error,
Markov-Laguerre, Kautz,…..)
State space representations have become popular for multivariable systems after the introduction of sub-space identification.
Halfway Conclusion: • The components are in place for systematic SYSID• Software is lacking• Quite difficult to do due to non-stationary disturbances• Theory not that easy to understand completely• Comprehensive Software solutions not available yet.
8
n
CA
CACAC
n
=
úúúúúú
û
ù
êêêêêê
ë
é
×-1
2rank
[ ] n BABAABB n =× -12 ||||rank
)()()()( tuqAqBty =
• A(q) and B(q) no common factors = Observable+Controllable (Co-prime)• A(q) and B(q) no common unstable factors = Detectable+Stabilizable
Reachability: Any state can be reached in a finite amount of time
Observability: Any state can be determined in a finite amount of time
Detectable: Any unstable state is observableStabilizable: Any unstable state is reachable
The Admissibility Problem
The FIR / Markov-Laguerre Models are automatically stabilizable
B. Erik Ydstie, ILS Inc. 9
MISO Identification
Data is persistently excited from a SISO case.
0 500 1000 1500 2000 2500-4
-2
0
2
4
6
8
10
12
14
16
MV7 is most excited
MV2 is least excited
Cond(F) = O(1)
1
N
NX
k=1
u(k)u(k � i)
0 1000 2000 3000 4000 5000 6000 7000 8000 9000-3
-2
-1
0
1
2
3
4
5
6
CV 3Prior (blue)Update (red)Data (yellow)
ExcitationMV 1 DMV2 AMV3 AMV 4 AMV 5 AMV 6 A
We get (Ljung, Wahlberg, Forsell) Bias and Variance:
Bias
Variance
B. Erik Ydstie, ILS Inc. 10
Systemu1
u2
y1y2
Generating Multivariable Input Signals
Same results hold as long as PE and independent noise and disturbance sequences. Results based law of large numbers, difficult to achieve using PRBS type excitation.
1
N
NX
k=1
u(k)u(k � i) = V (N)TV (N � i) = R(N) =
⇢R > 0, i = 0
0, i 6= 0
Input sequences must be independent in time wrt to the network.
1 2 3 4 5 6 7 8 9 100
2
4
6
8
10
0 1000 2000 3000 4000 5000 6000 700028
30
32
34
36
38
40
42
44
0.2210 �0.2206
�0.2206 0.3301
�
[0.2019]
108
64
200
24
68
1
-0.5
0
0.5
10
Orthogonal inputs:
Mass balance constraints in the process
B. Erik Ydstie, ILS Inc. 11
y(t) = Gc0(q
�1)u(t) +Hc0(q
�1)v(t)
Gc0(q
�1) = Sc0(q
�1)G0(q�1)
Hc0(q
�1) = Sc0(q
�1)H0(q�1)
Sc0(q
�1) =1
1 +G0(q�1)K(q�1)
Closed Loop System:
Issues for closed loop identification:
• Model parameterization• Algorithm and mathematical approach• Filters to shape bias and variance• Excitation (complete theory for SISO, Lacking for MIMO, some progress for Networks• Extension to multivariable case (treated very superficially in most books and papers)
Methods that may fail:• Regression type models (equation error, instrumental variables)• Subspace methods• Compensation methods (direct and indirect)• Correlation/spectral methods
Closed Loop Identification
Use output error methods for identification (open and closed loop)
Excitation
Process
MPC
12
Integration of SYSID with MPC:The Decision Problem
1. Defining clear business objectives (Stable/Robust Performance)2. Developing plans to achieve the objectives (Predictive Control)3. Systematically monitoring progress against the plan (Feedback, Filter)4. Adapt objectives/plans as new needs and opportunities arise (Identification)
Control/Plan Process MeasureRobert McNamara,1960, (CEO Ford, US Secretary of State)
Repeated Identification -> Iterative Learning -> Adaptive Control
Model and Desired Performance Objectives
13
The McNamara Program for MPC
MPC Process Measure EvaluateCritic
Model and Desired Performance Objectives MPC Design/Identify/Adapt
1. Measure, evaluate and critique (Gap analysis)2. Control strategies (Optimal Control/Model Predictive Control/Hinfinity)3. Identification, Learning, Adaptation
a) Adapt Controllers (directly or indirectly)b) Adapt Performance Objectives (closed loop, Q,R/move suppression)
Performance Objectives
Predictive Model
• The Decision problem is driven by Uncertainty (more than accurate models)• Numerous Practical and Theoretical Challenges Remain• MPC provides a fruitful Paradigm to Study these Challenges
Current Practice
B Erik Ydstie, CMU 14
The Feldbaum (1961) Program
Each field well advanced, but poorly integrated(Especially on the software side)
minu2U,y2Y
1X
i=1
(y(t+ i+ 1)� y(t+ i+ 1)⇤)2 + ru(t+ i)2
• Optimal (Certainty Equivalent, LQ Optimal Control, 1980 to MPC)• Caution (Robust Control, 1980 ) • Probing (System ID / Adaptation, 1980 )
H1
min
u(t+i)
TX
i=0
x(t+ i)
TQx(t+ i) + u(t+ i)
TRu(t+ i)
| {z }Finite Horizon Cost
+ x(t+ i)
TPx(t+ i)| {z }
Terminal Cost
Subject to: x(t+ 1) = Ax(t) +Bu(t)
x(t+ i)min x(t+ i) x(t+ i)max
u(t+ i)min u(t+ i) u(t+ i)max
*
*
B Erik Ydstie, CMU 15
From LQ to MPC and Back Again
Step 2: Split Objective in Two and use Predictions from Model
Step 1: Formulate a (linear) model
Step 3: Ignore last part Step 4: Solve QP and use first control.Step 3: Repeat Step 4 (and hope for the best)
Theory for robust stability and performance
x(t+ 1) = Ax(t) +Buf (t) +Ke(t)
y(t) = ✓
Tx(t) +Duf (t) + e(t)
x(t+ T )TPTx(t+ T )
minu2U,y2Y
T�1X
i=0
(y(t+ i+ 1)� y(t+ i+ 1)⇤)2 + ru(t+ i)2| {z }Model Predictive Control
+1X
i=T
(y(t+ i+ 1)� y(t+ i+ 1)⇤)2 + ru(t+ i)2| {z }LQ Control
B Erik Ydstie, CMU 16
MPC and SYSID:Learn from the Past and Control Into the Future
Step 2B: Split Objective in Three and use Past Information
Model Identified from Past Data
Control Into the Future
min✓2⇥
NX
i=0
(y(t� i)� y(t� i)⇤)2 + (✓ � ✓0
)TF0
(✓ � ✓0
)| {z }SYSID�Bayes
minu2U,y2Y
1X
i=1
(y(t+ i+ 1)� y(t+ i+ 1)⇤)2 + ru(t+ i)2| {z }Robust MPC
• Adaptive Control• Iterative Control• Closed Loop Identification• Identification for Control+++
Basic Idea: Controller works while data is collected
✓(0) 7! ✓(t1) 7! ✓(t2), ....
SYSID and MPC - Conflict or Conflux?Adapted from Polderman (1986)
Exampe: LTI System:
Linear feedback:
System
y(t) = ay(t� 1) + bu(t� 1)
e(t) = y(t)� y(t)
Model+
-
Question: Will system satisfy performance specifications when the same control is applied to both systems?
(The question of (Roust Lagrange) stability for closed loop identification and control was addressed by 1995)
uy
u(t) = K(a, b)y(t)
Definition: An Identification Based Control is said to be Self-Tuning if SYSID gives the “correct control”
Set of Identified Models : GSet of Parameters with correct controls : HControl and Estimation are Self Tuningif : H ✓ G
B Erik Ydstie, CMU 18
G = {a, b : ay(t� 1)� bK(✓)x(t)| {z }y(t)
= ay(t� 1)� bK(✓)x(t)| {z }y(t)
}
Analysis: Assume model output matches plant output
An infinite number of solutions. These depend on K.
Example 1: One step ahead predictive control
Solve for u(t) : y(t+ 1)
⇤= ay(t) + bu(t)
G =
⇢a, b :
a
b=
a
b
�u(t) = � a
by(t)
Get correct control even if parameter estimates are off.
Thm: Any identifier that minimizes prediction error is self tuning when used with minimum variance control.
Admissibility Problem (close to singularity gives large, oscillatory controls)(Problem of “direction”)
a-1 -0.5 0 0.5 1
b
-1
-0.5
0
0.5
1
The admissible set
B Erik Ydstie, CMU 19
Example 2: Pole placement control (Vogel and Edgar,
Find gains so that : y(t) = a0y(t� 1), 0 < a0 < 1
u(t) = � a� a0
by(t)
H =
⇢a, b :
a
by(t)) =
a
by(t)
�The set that gives correct controls H ✓ G
H =
⇢a, b : �a� a0
by(t)) =
�a� a0
by(t)
�
H ✓ G
Thm: Any identifier that minimizes prediction error is self tuning when used with pole-placement.
In this case Admissibility is more Complex as we require:
Observability and Controllability
Can be expressed as Bilinear Constraints in SYSID problem.
It is going well so far!!
a-1 -0.5 0 0.5 1
b
-3
-2
-1
0
1
2
3
4
Admissible set
B Erik Ydstie, CMU 20
Example 3: Model Predictive Control
H =
⇢a, b : �a� a0
by(t)) =
�a� a0
by(t)
�
Thm: MPC does NOT satisfy the self-tuning principle.
minu
(y(t+ 1)2 + ru(t)2) + py(t+ 1)2
u(t) = � ba
r + b2G =
(a, b : a� a = (b� b)
ba
r + b2
)
H 6✓ Gunless :
r = 0 and/or
a = a, ˆb = b
-1 -0.5 0 0.5 1-5
0
5
H
H
G
B Erik Ydstie, CMU 21
Problem: Information in the Past is Not Connected to Future Information
Additional means are needed to get optimal controls for MPC.• Persistent Excitation to Converge Controls• More Complex Controls to Align sets G and H?• “Intelligent” Excitation (SYSID for Control, Dual Control)
B Erik Ydstie, CMU 22
From Feldbaum to MPC and Back
minu2U,y2Y
TX
i=1
(y(t+ i)� y(t+ i)⇤)2 + ru(t+ i)2
| {z }Model Predictive Control
+1X
i=T+1
(y(t+ i)� y(t+ i)⇤)2 + ru(t+ i)2
| {z }LQ Control
y(t+ i)�Maximum Likelihood Estimate
F (t+ i)� Fisher Information Matrix
minu2U,y2Y
TX
i=1
(y(t+ i)� y(t+ i)⇤)2 + ru(t+ i)2| {z }Robust CE AMPC
+x(t+ i)TF (t+ i)�1
x(t+ i)| {z }Information Gathering
+x(t)PTx(t)
Challenges (identification using past data is the easiest): • Solve a robust control problem on line (structured and unstructured uncertainty)• “Back out control signals” from forward propagation of Fisher matrix• What to do with the arrival cost
Special Case (TA Heirung/ J Morinelly)
• Fix the transition matrix A (step-response/Kautz model)• Solve CE (rather than robust Hinfinity) control problem (caution
related to parameter uncertainty only)• Ignore arrival cost
Computationally Expensive and Untested
24
So What are the Issues?Data Rich – But Information Poor Systems
(Nature is not a kind adversary)
• MPC and SYSID - Conflict or Conflux?• How to represent/parametrize the system• How to excite the system• How to manage changing models• Directionality• Complexity• Software
25
Conclusions• MPC is not self tuning• There is a “strong" inter-action between
control and identification• Different ways to “solve the problem”
– More complex “control”– External Excitation (setpoints/inputs)– Identification for control
• Need to Retune Controller when model changes
• Collinearity issue is not well understood• Very Large scale Applications are challenging• MPC Maintenance is still challenging
4756 linesof assemblycode (1983)
15 linesof MATLABcode (2014)
CMUPitt
Golden Opportunities