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

linear optimal control lqr
SMART_READER_LITE
LIVE PREVIEW

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:


slide-1
SLIDE 1

Linear Optimal Control (LQR)

Robert Platt Northeastern University

slide-2
SLIDE 2

The linear control problem

Given:

System:

slide-3
SLIDE 3

The linear control problem

Given:

System: Cost function: where:

slide-4
SLIDE 4

The linear control problem

Given:

System: Cost function: where:

slide-5
SLIDE 5

The linear control problem

Given:

System: Cost function: where:

Calculate:

Initial state: U that minimizes J(X,U)

slide-6
SLIDE 6

The linear control problem

Given:

System: Cost function: where:

Calculate:

Initial state: U that minimizes J(X,U)

Important problem! How do we solve it?

slide-7
SLIDE 7

One solution: least squares

slide-8
SLIDE 8

One solution: least squares

slide-9
SLIDE 9

where

One solution: least squares

slide-10
SLIDE 10

where:

One solution: least squares

slide-11
SLIDE 11

Given:

System: Cost function: where:

Calculate:

Initial state: U that minimizes J(X,U)

One solution: least squares

slide-12
SLIDE 12

Given:

System: Cost function:

Calculate:

Initial state: U that minimizes J(X,U)

One solution: least squares

slide-13
SLIDE 13

Substitute X into J: Minimize by setting dJ/dU=0: Solve for U:

One solution: least squares

slide-14
SLIDE 14

Solve for optimal trajectory:

What can this do?

Start here End here at time=T

Image: van den Berg, 2015

slide-15
SLIDE 15

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

What can this do?

slide-16
SLIDE 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 The number in each cell describes the number of steps “to-go” before reaching the goal state Example:

slide-17
SLIDE 17

Bellman optimality principle:

Bellman solution

Cost of this time step (Cost of future time steps)

slide-18
SLIDE 18

Bellman optimality principle:

Bellman solution

slide-19
SLIDE 19

Bellman optimality principle:

Bellman solution

Cost-to-go from state x at time t Cost-to-go from state (Ax+Bu) at time t+1 Cost incurred on this time step Cost incurred after this time step

slide-20
SLIDE 20

Bellman solution

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

slide-21
SLIDE 21

Bellman solution

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

slide-22
SLIDE 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.

slide-23
SLIDE 23

Bellman solution

How do we minimize this term? – take derivative and set it to zero.

  • ptimal control as a function of state

– but: it depends on P_{t+1}...

slide-24
SLIDE 24

Bellman solution

How do we minimize this term? – take derivative and set it to zero.

  • ptimal control as a function of state

– but: it depends on P_{t+1}... How solve for P_{t+1}???

slide-25
SLIDE 25

Bellman solution

Substitute u into V_t(x):

slide-26
SLIDE 26

Bellman solution

Substitute u into V_t(x):

slide-27
SLIDE 27

Bellman solution

Substitute u into V_t(x):

slide-28
SLIDE 28

Bellman solution

Substitute u into V_t(x):

slide-29
SLIDE 29

Bellman solution

Substitute u into V_t(x):

Dynamic Riccati Equation

slide-30
SLIDE 30

Example: planar double integrator

Air hockey table m=1 b=0.1 u=applied force Initial position

  • f the puck

Initial velocity Goal position Build the LQR controller for: Initial state: Time horizon: Cost fn:

slide-31
SLIDE 31

Example: planar double integrator

Air hockey table

Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 HOW?

slide-32
SLIDE 32

Example: planar double integrator

Air hockey table

Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1

slide-33
SLIDE 33

Example: planar double integrator

Air hockey table

Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1

slide-34
SLIDE 34

Example: planar double integrator

Air hockey table

Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1

slide-35
SLIDE 35

Example: planar double integrator

Air hockey table

Step 1: Calculate P backward from T: P_100, P_99, P_98, … , P_1 ... ...

slide-36
SLIDE 36

Example: planar double integrator

Air hockey table

Step 2: Calculate u starting at t=1 and going forward to t=T-1 ... ...

slide-37
SLIDE 37

Example: planar double integrator

  • rigin

0.2 1 0.2

slide-38
SLIDE 38

Example: planar double integrator

u_x, u_y t

slide-39
SLIDE 39

Example: planar double integrator

slide-40
SLIDE 40

Example: planar double integrator

  • rigin
slide-41
SLIDE 41

Example: planar double integrator

  • rigin
slide-42
SLIDE 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

slide-43
SLIDE 43

The infinite horizon case

Time step E l e m e n t s

  • f

P m a t r i x 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?

slide-44
SLIDE 44

The infinite horizon case

Time step E l e m e n t s

  • f

P m a t r i x 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? Converging toward fixed P

slide-45
SLIDE 45

The infinite horizon case

We can solve for the infinite horizon P exactly: Discrete Time Algebraic Riccati Equation

slide-46
SLIDE 46

Given:

System: Cost function: where:

Calculate:

Initial state: U that minimizes J(X,U)

So, what are we optimizing for now?

slide-47
SLIDE 47

Controllability

A system is controllable if it is possible to reach any goal state from any

  • ther start state in a finite period of time.

When is a linear system controllable? It's property of the system dynamics...

slide-48
SLIDE 48

Controllability

A system is controllable if it is possible to reach any goal state from any

  • ther start state in a finite period of time.

When is a linear system controllable? Remember this?

slide-49
SLIDE 49

Controllability

What property must this matrix have?

slide-50
SLIDE 50

Controllability

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