Professional Documents
Culture Documents
YRW2013 Zanon
YRW2013 Zanon
YRW2013 Zanon
22/01/2013
3 Application Examples
Optimal Control with Collocation
MHE + MPC for Car Control
3 Application Examples
Optimal Control with Collocation
MHE + MPC for Car Control
Application to:
Control: trajectory planning and tracking
Estimation: system identification, observers
Direct Methods for Optimal Control — Mario Zanon
Direct Methods for Optimal Control - Problem formulation 5 / 30
What is needed?
1 Parametrization of the controls u:
basis functions with local support, e.g.: piecewise constant
2 State discretization strategy: next slides
Basic idea
1 Define a time grid: t0 < t1 < . . . tN , e.g.: equidistant
2 Discretize the controls u(t), e.g.: piecewise constant on the
grid
3 Discretize the states x(t) by numerical integration
Integrators
∂xk+1 ∂xk+1
Must provide both next state and sensitivities ∂xk , ∂uk
Different ways of computing the sensitivities:
1 External numerical differentiation
easy to implement, inaccurate, expensive
3 Automatic Differentiation
100% precise, cheap
Basic idea
1 Define a time grid: t0 < t1 < . . . tN , e.g.: equidistant
2 Discretize every function f (t) as a polynomial defined for
every interval, e.g. for x(t):
D
X
xkD (t) = pj (τ )xkj
1
j=0
t =tk0 + hτ
0.5
x
D
X
0 ẋkD (t) = ṗj (τ )xkj
j=0
D
X 1 0
0 0.5 1 1.5 2 = p (τ )xkj
t h j
j=0
Collocation NLP
R tk+1
Integrals: tk L(x(t), u(t))dt ≈ lk (Xk , uk )
N
X
min m(xN(D+1)+N ) + lk (Xk , uk )
X0 ,...,XN+1
u0 ,...,uN k=0
s.t. x0 = x(t0 )
ck (Xk , uk ) = 0, ∀k ∈ [1, N]
x ≤ xk ≤ x
u ≤ uk ≤ u
xN(D+1)+N = x(tf )
Example
Large use for chemical applications with long time horizons and
large state dimensions.
Basic idea
Something between collocation and single shooting
1 Define a time grid: t0 < t1 < . . . tN , e.g.: equidistant
2 Discretize the controls u(t), e.g.: piecewise constant on the
grid
3 The initial state of each interval xk is a variable in the NLP
4 System dynamics: close the gaps xk+1 − f (xk , uk )
NLP properties
NLP solution can depend strongly on initial guess
Depending on the problem: interior point vs SQP
Only local minimum can be found
Homotopies might be needed
System properties
Unstable dynamics: simultaneous approach
Stiff systems: implicit integration scheme needed
3 Application Examples
Optimal Control with Collocation
MHE + MPC for Car Control
Trajectory Planning
Plan an optimal
trajectory, e.g.:
Fly with
minimal fuel
Aerobatic
maneuvers
Drive while
avoiding
obstacles
Maximize
energy
production
Trajectory Tracking
Open Loop + Model Mismatch
1
0.5
x
−0.5
−1
0 0.5 1 1.5 2 2.5 3
t
0.5
u
−0.5
−1
0 0.5 1 1.5 2 2.5 3
t
Trajectory Tracking
MPC + Model Mismatch
0.04
x
0.02
−0.02
−0.04
u
−0.06
−0.08
−0.1
−0.12
0 0.5 1 1.5 2 2.5 3
t
3 Application Examples
Optimal Control with Collocation
MHE + MPC for Car Control
Tether: k = 2
Node: n = 1, parent i = 0
Tether: k = 3 Tether: k = 1
Tether: k = 1
Parametric study
Compare the extracted power for different wing areas
Systems with up to 209 states
NLP: up to 40000 variables
Discretization:
10 control intervals, 1 to 4 collocation elements
order 4 Radau polynomials
piecewise constant controls
Optimization problem solved more than 100 times
4000
8 PW
3000
Tethers
y [m]
2000 Airfoils
1000
0
0 2000 4000 6000 8000 10000 12000 14000 16000
x [m], Pw [W/m2]
Car Control
Obstacle Avoidance and Online Friction Coefficient Estimation
Y [m] 5
−5
0 20 40 60 80 100 120 140 160 180 200
X [m]
0.7
0.6
0.5
µ [-]
0.4
0.3
0.2
0 20 40 60 80 100 120 140 160 180 200
X [m]
Car Control
Just to give an idea, this it the tire force:
1.4 1
0.9
1.2
0.8
1 0.7
0.6
0.8
F [N]
0.5
σ
0.6
0.4
0.4 0.3
0.2
0.2
0.1
0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4
σ F [N]