linear optimal control lqr
play

Linear Optimal Control (LQR) Robert Platt Northeastern University - PowerPoint PPT Presentation

Linear Optimal Control (LQR) Robert Platt Northeastern University The linear control problem Given: System: The linear control problem Given: System: Cost function: where: The linear control problem Given: System: Cost function:


  1. Linear Optimal Control (LQR) Robert Platt Northeastern University

  2. The linear control problem Given: System:

  3. The linear control problem Given: System: Cost function: where:

  4. The linear control problem Given: System: Cost function: where:

  5. The linear control problem Given: System: Cost function: where: Initial state: Calculate: U that minimizes J( X,U )

  6. The linear control problem Given: System: Important problem! Cost function: How do we solve it? where: Initial state: Calculate: U that minimizes J( X,U )

  7. One solution: least squares

  8. One solution: least squares

  9. One solution: least squares where

  10. One solution: least squares where:

  11. One solution: least squares Given: System: Cost function: where: Initial state: Calculate: U that minimizes J( X,U )

  12. One solution: least squares Given: System: Cost function: Initial state: Calculate: U that minimizes J( X,U )

  13. One solution: least squares Substitute X into J : Minimize by setting d J/dU =0: Solve for U :

  14. What can this do? Start here End here at time=T Solve for optimal trajectory: Image: van den Berg, 2015

  15. What can this do? This is cool, but... – only works for finite horizon problems – doesn't account for noise – requires you to invert a big matrix

  16. Bellman solution Cost-to-go function: V(x) – the cost that we have yet to experience if we travel along the minimum cost path. – given the cost-to-go function, you can calculate the optimal path/policy Example: The number in each cell describes the number of steps “to-go” before reaching the goal state

  17. Bellman solution Bellman optimality principle: Cost of this time step (Cost of future time steps)

  18. Bellman solution Bellman optimality principle:

  19. Bellman solution Bellman optimality principle: Cost-to-go from state Cost-to-go from (Ax+Bu) at time t+1 state x at time t Cost incurred on Cost incurred after this time step this time step

  20. Bellman solution For the sake of argument, suppose that the cost-to-go is always a quadratic function like this: where:

  21. Bellman solution For the sake of argument, suppose that the cost-to-go is always a quadratic function like this: where: Then:

  22. Bellman solution For the sake of argument, suppose that the cost-to-go is always a quadratic function like this: where: Then: How do we minimize this term? – take derivative and set it to zero.

  23. Bellman solution How do we minimize this term? – take derivative and set it to zero. optimal control as a function of state – but: it depends on P_{t+1}...

  24. Bellman solution How do we minimize this term? – take derivative and set it to zero. How solve for P_{t+1}??? optimal control as a function of state – but: it depends on P_{t+1}...

  25. Bellman solution Substitute u into V_t(x) :

  26. Bellman solution Substitute u into V_t(x) :

  27. Bellman solution Substitute u into V_t(x) :

  28. Bellman solution Substitute u into V_t(x) :

  29. Bellman solution Substitute u into V_t(x) : Dynamic Riccati Equation

  30. Example: planar double integrator Build the LQR controller for: Initial state: Initial position Initial velocity of the puck Time horizon: m =1 b =0.1 Cost fn: Goal position u =applied force Air hockey table

  31. Example: planar double integrator Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 HOW? Air hockey table

  32. Example: planar double integrator Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 Air hockey table

  33. Example: planar double integrator Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 Air hockey table

  34. Example: planar double integrator Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 Air hockey table

  35. Example: planar double integrator Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 ... Air hockey table ...

  36. Example: planar double integrator Step 2: Calculate u starting at t=1 and going forward to t=T-1 ... ... Air hockey table

  37. Example: planar double integrator 1 origin 0.2 0 0 0.2 0

  38. Example: planar double integrator u_x, u_y t

  39. Example: planar double integrator

  40. Example: planar double integrator origin 0 0

  41. Example: planar double integrator origin 0 0

  42. The infinite horizon case So far: we have optimized cost over a fixed horizon, T . – optimal if you only have T time steps to do the job But, what if time doesn't end in T steps? One idea: – at each time step, assume that you always have T more time steps to go – this is called a receding horizon controller

  43. The infinite horizon case x i r t a m P f o s t n e m e l E Time step Notice that elt's of P stop changing (much) more than 20 or 30 time steps prior to horizon. – what does this imply about the infinite horizon case?

  44. The infinite horizon case x i r t a m P f o s t n Converging toward fixed P e m e l E Time step Notice that elt's of P stop changing (much) more than 20 or 30 time steps prior to horizon. – what does this imply about the infinite horizon case?

  45. The infinite horizon case We can solve for the infinite horizon P exactly: Discrete Time Algebraic Riccati Equation

  46. So, what are we optimizing for now? Given: System: Cost function: where: Initial state: Calculate: U that minimizes J( X,U )

  47. Controllability A system is controllable if it is possible to reach any goal state from any other start state in a finite period of time. When is a linear system controllable? It's property of the system dynamics...

  48. Controllability A system is controllable if it is possible to reach any goal state from any other start state in a finite period of time. When is a linear system controllable? Remember this?

  49. Controllability What property must this matrix have?

  50. Controllability This submatrix must be full rank. – i.e. the rank must equal the dimension of the state space

Recommend


More recommend