Professional Documents
Culture Documents
Levine
Levine
Levine
William S. Levine
University of Maryland, College Park
Motivation
Intuition
Basic Model Predictive Control (MPC)
The Linear Quadratic Regulator (LQR)
Dealing with Constraints
Stability
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 1
Part
Motivation
Intuition
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 2
Motivation
Systems with many inputs and outputs are becoming more common
because of cheap communications and sensors.
Example: The new synchrotron at Brookhaven National Laboratories
has 120 sensors, 180 actuators, and 792 meter circumference.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 3
Slide from a talk by Joao Hespanha
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 4
Computation, Communication, and Sensing are Cheap and
Ubiquitous
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 5
Part
Motivation
Intuition
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 6
Intuition–From Chess
Start by projecting N moves into the future.
It is impossible to project all the way to the end.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 7
Part
Motivation
Intuition
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 8
Basic Concepts of MPC
At t = 0 project N time steps into the future.
All practical MPC is in discrete time.
Choose the optimal control based on this projection.
It is hard to find a good performance measure.
A particular issue is robustness versus performance.
Do you want to achieve the least bad (best worst case) or the best
expected (average) performance?
It can be very hard to find the optimal move even though the
prediction is perfect.
Repeat this entire process at the next discrete time, WLOG t = 1.
As in Chess, it is reasonable to believe that the result of this iterative
scheme is close to the best possible (optimal), especially for large N.
Because it is close to optimal, it is reasonable to expect that the
closed-loop system will be stable.
Neither of these properties always holds.
Precise conditions to guarantee them are needed.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 9
A Brief (and biased) History Lesson
In the 1960’s there were three main themes in control theory research.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 10
The Discrete-Time Linear Quadratic Regulator
This was, and is, in some respects the coolest theoretical result from
the 1960’s.
Understanding it, in all its details, is fundamental to understanding
basic MPC.
The discrete-time linear time-invariant dynamics are
x(k + 1) = Ax(k) + Bu(k), where x(0) = ξ and k = 0, 1, 2, ... (1)
A is an n × n real matrix and B is an n × m real matrix.
x(k) is the state at time k and u(k) is the control at time k.
Additional requirements
The pair A, B must be stabilizable
Definition
A pair A, B is stabilizable ⇐⇒ the uncontrollable subspace is stable.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 12
The Discrete-Time Linear Quadratic Regulator (continued)
Theorem
Given the stabilizable and detectable LTI system (1) and the performance
measure (2), there exists a unique optimal feedback control
where
F = (R + B T PB)−1 B T PA (4)
and P satisfies the Discrete-Time Algebraic Riccatti Equation
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 13
The Finite Time Version of the Discrete-Time Linear
Quadratic Regulator
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 14
Solution to the Finite Time Version of the Discrete-Time
Linear Quadratic Regulator
Theorem
Given the stabilizable and detectable LTI system (1) and the performance
measure (See Eqn. (6)), there exists a unique optimal feedback control
where
F (k) = (R + B T P(k)B)−1 B T P(k)A (8)
and P(k) satisfies the Discrete-Time Algebraic Riccatti Equation
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 15
Relation between P(k) and P
One might expect something like limN→∞ P(0, N) = P but this is not
generally true.
There is an incorrect Wikipedia article that claims it is.
Sufficient conditions for it to be true are that Qf = P or Qf = 0.
This is important in determining the stability of MPC for LTI systems.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 16
Implementing the Linear Quadratic Regulator
There were, and are, surprisingly few real applications of the LQR.
Why?
You need to measure (or accurately estimate) all of the state vector
x(k).
You may need a lot of amplifiers.
The design burden shifts, even for Single-Input Single-Output (SISO)
problems, to choosing the appropriate Q and R and this is not easy.
None of these is insurmountable.
There are excellent methods to estimate the states that cannot
be measured.
You can use a Kalman filter if there is significant noise.
You can use the Luenberger observer if the noise is not significant.
Often, you can use much simpler estimators. For example, you can
differentiate and low pass filter a position to obtain a velocity.
You do not need many amplifiers if you implement the LQR on a
computer–which you would do anyway.
Choosing Q and R is certainly easier than other methods in the
Multi-Input Multi-Output (MIMO) case.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 17
The Real Problem in Implementing the Linear Quadratic
Regulator
Actuator Saturation
All actuators eventually saturate.
It is usually impractical, if not impossible, to completely avoid.
Valves can only go from fully open to fully closed.
Vanes (rudders, ailerons) that control by altering air or fluid flow have
limitted range.
Power supplies have upper and lower limits.
Failure to account for saturation can cause major problems in a
control loop.
Integrator windup.
Conditional stability–Large exogenous inputs cause instability; small
ones do not.
Designers of classical control systems know this and account for it.
The LQR does not
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 18
Another Real Problem in Implementing the Linear
Quadratic Regulator
State Constraints
Many systems have natural and unavoidable state constraints.
A tank can only hold so much liquid before it overflows.
Many motors have velocity limits.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 19
The Simplest MPC Problem
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 20
The Simplest MPC Problem (continued)
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 24
Stability (Continued)
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 25
Stability (Continued)
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 26
Stability–More Precisely
There are several ways to make the MPC controller drive the state
into the region where the LQR applies exactly. Please see the Figure
on slide 23.
The first one that people used was to add the constraint that
x(N) = 0 to the MPC optimzation problem.
This has two flaws. It is hard to satisfy such a constraint
computationally and it alters the optimization problem in a less than
ideal way.
Motivation
Intuition
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 28
Limits to Stability
We could place upper limits on the size of the steps and lower limits
on the time between steps so as to guarantee stabiity.
This is not uncommon.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 30
Imposing Integral action in MPC
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 31
Using MPC for Tracking
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 32
A Robustness Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 33
Plant Mismodeling and Output Disturbances
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 34
A Positive and Negative Robustness Result
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 35
Dealing with Output Disturbances
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 36
H∞ or Paranoid MPC
In the absence of state and control constraints, there is a fairly
complete H∞ theory. See A.A. Stoorvogel, ”The H∞ Control
Problem: A State Space Approach,” (2000).
When there are convex constraint sets, the problem can be posed as
follows.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 38
H2 , LQG, or Dull (Average) Optimal Control
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 39
H2 , LQG, or Dull (Average) Optimal Control (Continued)
Detailed requirements
A and B as before–including A, B stabilizable.
ξ(k) and ν(k), k = 1, 2, ...N are White Gaussian signals.
E (ξ(k)) = 0 and E (ξ(k)ξT (j)) = Qδ(k − j), Q ≥ 0
E (ν(k) = 0 and E (ν(k)ν T (j) )= Rδ(k − j), R > 0
Q = H T H and A, H detectable
The problem is to find a causal controller that minimizes J(u[0,∞) ),
see Eqn. (18)
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 40
H2 , LQG, or Dull (Average) Optimal Control (Continued)
where
F̂ = AP̂C T (R + C P̂C T )−1 (21)
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 41
The Kalman Filter and the Optimally Controlled System
Figure: LQG
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 42
The Kalman Filter
The last piece of the Time-Invariant Kalman Filter is the equation for
P̂.
P̂ = A(P̂ − P̂C T (R + C P̂C T )−1 C P̂)AT + Q (22)
Nonzero noise added to the input is essential
With no input noise, a solution to the DARE is P̂ = 0.
With a finite end time and no input noise, the time-varying Kalman
Filter eventually ignores input signals.
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 43
The Finite Time Version
The control part is as before except x̂(k) replaces x(k) in the control
part.
The feedback in the filter becomes
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 44
Application to MPC
Whenever the constraints on the control and the state are inactive,
the LQG regulator applies.
When the constraints are active, the separation of control and
estimation is no longer valid.
However, forcing separation, while no longer optimal, is still
reasonable.
Use the correct (with the saturations) plant model in the filter
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 45
Stochastic Stability of MPC
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 46
Part
Motivation
Intuition
An Example
William S. Levine Conventional Model Predictive Control 2016 ACC, Boston, July 5, 2016 47
An Application of MPC to Human Posture
Regulation
Yao Li
Borns Surgical Robotics
Chengdu, China
William. S. Levine
Department of Electrical and Computer Engineering
University of Maryland at College Park
For more details, please see “A Two-Joint Human Posture Control Model
With Realistic Neural Delays,” IEEE TNSRE, VOL. 20, NO. 5, SEPTEMBER 2012
1
Postural Balance Control
Not reflex
Important features:
Small amplitude sway
Spontaneous
Nonlinear Joint Coordination
Small Amplitude Body Sway Small Noise -- Ankle Only
Larger Noise -- Ankle plus Hip
Even larger Noise -- All three joints
Time delay
Transmission, processing, & activation
Optimality
Learning and adaptation
Ankle, Knee, Hip Coordination Energetic efficiency
2
Previous and Current Work
A mathematical models
Results
match the surprising sway
match the nonlinear coordination
reduce energy consumption compared to LQR
Question
Is the resulting controlled system stable?
3
Model Including Muscle Mechanics
Torso
Knee
■ Equations of muscle
model and torque
4
Muscle Model
1.6
1
1.4
Forcevelocity
Forcelength
0.8 1.2
1
0.6
0.8
0.4 0.6
0.4
0.2
0.2
0 0
0.4 0.6 0.8 1 1.2 1.4 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5
Contractile element
Force length curve (assuming velocity is constant)
Force velocity curve (assuming position is constant)
Activation dynamics
Linearization
Linearizing the tendon dynamics at the rest length
results in zero
Instead, we use a linear spring
Linearizing the activation dynamics gives
6
Optimal Control Problem
New overall
Variable
4.5
3.5
2.5
total energy
2
total excitation
1.5
0.5
0
NOR8 NOR4 LQR
13
Accuracy