Non-linear MPC - Northeastern University

21
Non-linear MPC Robert Platt Northeastern University

Transcript of Non-linear MPC - Northeastern University

Page 1: Non-linear MPC - Northeastern University

Non-linear MPC

Robert Platt Northeastern University

Page 2: Non-linear MPC - Northeastern University

NonLinear Model Predictive Control

Given:

System:

Cost function:

where:

Calculate:

Initial state:

U that minimizes J(X,U)

Page 3: Non-linear MPC - Northeastern University

NonLinear Model Predictive Control

Given:

System:

Cost function:

where:

Calculate:

Initial state:

U that minimizes J(X,U)

Page 4: Non-linear MPC - Northeastern University

NonLinear Model Predictive Control

Given:

System:

Cost function:

where:

Calculate:

Initial state:

U that minimizes J(X,U)

Page 5: Non-linear MPC - Northeastern University

Minimize:

Subject to:

NonLinear Model Predictive Control

But, this is a nonlinear constraint– so how do we solve it now?

Page 6: Non-linear MPC - Northeastern University

LTV (linear time varying) problem

Given: a nonlinear system:

A quadratic cost fn

A nominal trajectory:

Find: a controller that works nearby nominal trajectory

Page 7: Non-linear MPC - Northeastern University

Idea: time varying linear system

Linear Time Invariant (LTI):

Linear Time Variant (LTV):Notice time time dependence– each time step is linearized differently

Page 8: Non-linear MPC - Northeastern University

Linear Time Varying LQR (LTV)

Similar first order taylor series expansion as before:

Page 9: Non-linear MPC - Northeastern University

Linear Time Varying LQR (LTV)

Similar first order taylor series expansion as before:

Solution: solve LQR for this TV system:

Resulting controller is linearized about nominal trajectory:

Page 10: Non-linear MPC - Northeastern University

Linear Time Varying LQR (LTV)

Similar first order taylor series expansion as before:

Solution: solve LQR for this TV system:

Resulting controller is linearized about nominal trajectory:

Key points:

– point linearized about changes on each time step

– nominal trajectory does not evenneed to be feasible!

– you DO NEED to know what timestep you’re at throughout

Page 11: Non-linear MPC - Northeastern University

Question

Think about cart-pole

We have shown that you can use linearize LQR about an arbitrary trajectory.

Can you just linearize about the current operating point on eachtime step?

Page 12: Non-linear MPC - Northeastern University

Back to nonlinear control problem...

Minimize:

Subject to:

LTV LQR only works if you have a nominal trajectory

How do you get the nominal trajectory???

Page 13: Non-linear MPC - Northeastern University

Iterative LQR

Key observation:

If: you start with a bad nominal trajectory, run LTV LQR linearized about it, and then integrate forward the resulting locally optimal policy…

Then: the resulting trajectory will be better (lower cost) than the nominal trajectory you started with

Page 14: Non-linear MPC - Northeastern University

Iterative LQR

Page 15: Non-linear MPC - Northeastern University

Iterative LQR

Page 16: Non-linear MPC - Northeastern University

Iterative LQR

Page 17: Non-linear MPC - Northeastern University

Iterative LQRWhy is this not zero?When can we skip these terms?

Page 18: Non-linear MPC - Northeastern University

Iterative LQRWhy is this not zero?When can we skip these terms?

How does this fix problem?

Page 19: Non-linear MPC - Northeastern University

Iterative LQR

Page 20: Non-linear MPC - Northeastern University

Iterative LQR

Page 21: Non-linear MPC - Northeastern University

Iterative LQR

iLQR works well in the MPC context

– stabilization to the trajectory will handle most small deviations from nominal

– can iterate the process to handle larger deviations