lecture 14: stability and control ii reprise of stability from last time the idea of feedback...

36
Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems although we will apply linear control to nonlinear systems sometimes successfully 1

Upload: sabina-eaton

Post on 31-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

1

Lecture 14: Stability and Control II

Reprise of stability from last time

The idea of feedback control

Remember that our analysis is limited to linear systemsalthough we will apply linear control to nonlinear systems

sometimes successfully

Page 2: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

2

Reprise

We are dealing with holonomic systems and working with Hamilton’s equations

˙ p i =∂L

∂qi+ Qi

˙ q j = M ji pi

Look at equilibria such that

qi = q0i , pi = p0i = 0

Q0i = −∂L

∂qip i →0,q i →q0

i

With an equilibrium force

Page 3: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

3

Reprise

We can combine the coordinates and the momentum into a state vector

x =qi

pi

⎧ ⎨ ⎩

⎫ ⎬ ⎭

and write the system in terms of x

˙ x k = f k x n,Qi( )

Equilibrium in this setting requires

f k x0n,Q0i( ) = 0

Last time we worked in q, p space —

Page 4: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

4

Reprise

We ask what happens if we perturb q and p, but NOT Q

q j = q0j + ε ′ q 1

j

pi = p0i + ε ′ p i = ε ′ p i

′ ˙ q j = M ji q0k

( ) ′ p i

′ ˙ p i =∂2L

∂qi∂qk

⎝ ⎜

⎠ ⎟

ε →0

′ q k

Page 5: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

5

Reprise

The coefficients on the right hand sides are constant matricesand we can write the equations in a unified matrix notation

′ ˙ q j = M ji q0k

( ) ′ p i

′ ˙ p i =∂2L

∂qi∂qk

⎝ ⎜

⎠ ⎟

ε →0

′ q k

′ ˙ q j

′ ˙ p i

⎧ ⎨ ⎩

⎫ ⎬ ⎭=

0 M ji q0k

( )

∂2L

∂qi∂qk

⎝ ⎜

⎠ ⎟

ε →0

0

⎨ ⎪

⎩ ⎪

⎬ ⎪

⎭ ⎪

′ q j

′ p i

⎧ ⎨ ⎩

⎫ ⎬ ⎭

How does this work in state space?

Page 6: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

6

Reprise

x k = x0k + ε ′ x k

ε˙ ′ x i = f k x0n,Q0i( ) +

∂f i

∂x kε ′ x k

˙ ′ x i =∂f i

∂x k′ x k

∂f j

∂x i=

0 M ji q0k

( )

∂2L

∂qi∂qk

⎝ ⎜

⎠ ⎟

ε →0

0

⎨ ⎪

⎩ ⎪

⎬ ⎪

⎭ ⎪

This is a mixed notation to indicate what goes whereit is not a meaningful notation in terms of the location of the indices

Page 7: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

7

Reprise

The matrix is constant, so the state vector has exponential solutions

′ x k = X k exp st( )⇒ ˙ ′ x i =∂f i

∂x k ′ x k ⇒ sIki X k =

∂f i

∂x k X k

sIki −

∂f i

∂x k

⎝ ⎜

⎠ ⎟X

k = 0⇒ det sIki −

∂f i

∂x k

⎝ ⎜

⎠ ⎟= 0

Page 8: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

8

We can write this symbolically as

det

s

s

s

−M ji q0k

( )

−∂2L

∂qi∂qk

⎝ ⎜

⎠ ⎟

ε →0

s

s

s

⎪ ⎪ ⎪

⎪ ⎪ ⎪

⎪ ⎪ ⎪

⎪ ⎪ ⎪

= 0

which is a polynomial in s of the same degree as the number of variables —generally twice as many as there are generalized coordinates/degrees of freedom

(This is not fully general, but it will suit our current purposes.)

Reprise

Page 9: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

9

If Re(s) < 0 for all s, the system is asymptotically stable

If Re(s) > 0 for any s, the system is unstable

If Re(s) = 0 for all s, the system is marginally stable

stable: if we move the system away from equilibrium, the system will go back

unstable: if we move the system away from equilibrium, the error will grow (initially) exponentially

marginally stable: if we move the system away from equilibrium, the error will oscillate about its reference position

And the real part of s tells us about stability

Reprise

Page 10: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

10

??

Page 11: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

11

OK, let’s take a break and go look at the stability of a three link robot

Note that I told you some wrong things last timeI was working too fast and let some stuff slip

GO TO MATHEMATICA

Page 12: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

12

We quit here; the remainder of this set will reappear in our next class.

Page 13: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

13

Let’s think about control in the context of the simple inverted pendulum

q

add a small, variable torque at the pivot

Page 14: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

14

˙ q =1

ml2p, ˙ p =

∂L

∂θ= mglsinq + Q

There’s a change of sign from the simple pendulum from last timebecause I have chosen a different definition of q

We have equilibrium at q = 0, and Q = 0 there as well.

We know that this will be unstable if it is perturbed with Q remaining zero

Let’s see how this goes in a state space representation

Page 15: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

15

x =q

p

⎧ ⎨ ⎩

⎫ ⎬ ⎭⇒ ˙ x =

1

ml2p

mglsinq

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪+

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭

εQ

(I’ve put in the e because Q is zero at equilibrium)

˙ x ⇒ ε˙ ′ q

˙ ′ p

⎧ ⎨ ⎩

⎫ ⎬ ⎭=

1

ml2ε ′ p

mglsin q0 + ε ′ q ( )

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪+

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭

εQ

˙ ′ q

˙ ′ p

⎧ ⎨ ⎩

⎫ ⎬ ⎭=

1

ml2′ p

mglcosq0 ′ q

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪+

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭Q = 0

1

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪

′ q

′ p

⎧ ⎨ ⎩

⎫ ⎬ ⎭+

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭

Q

Page 16: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

16

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭

Q

If q starts to increase, we feel intuitively that we ought to add a torque to cancel it

Q = −g1q

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x −

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭g1q

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭−g1 0{ }

q

p

⎧ ⎨ ⎩

⎫ ⎬ ⎭

We can expand the feedback term

Page 17: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

17

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭−g1 0{ }x

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0 0

−g1 0

⎧ ⎨ ⎩

⎫ ⎬ ⎭x

˙ x = 01

ml2

−g1 + mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x

multiply the column vector and the row vector

combine the forced system into a single homogeneous system

Page 18: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

18

The characteristic polynomial for this new problem can be solved for

s2 =1

ml2−g1 + mglcosq0( )

and so I can make s2 negative by applying some gain g1.

So this very simple feedback can make an unstable system marginally stable

We can do better . . .

Page 19: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

19

Suppose we feedback the speed of the pendulum as well as the position?

Q = −g1q − g2 p

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x −

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭g1q + g2 p( )

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0

1

⎧ ⎨ ⎩

⎫ ⎬ ⎭−g1 −g2{ }

q

p

⎧ ⎨ ⎩

⎫ ⎬ ⎭

˙ x = 01

ml2

mglcosq0 0

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x +

0 0

−g1 −g2

⎧ ⎨ ⎩

⎫ ⎬ ⎭x

Page 20: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

20

˙ x = 01

ml2

−g1 + mglcosq0 −g2

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪x

And now the characteristic polynomial comes from

det s −1

ml2

g1 − mglcosq0 s + g2

⎧ ⎨ ⎪

⎩ ⎪

⎫ ⎬ ⎪

⎭ ⎪= 0

Combining everything again we get

s s + g2( ) +1

ml2g1 − mglcosq0( ) = 0

Page 21: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

21

s s + g2( ) +1

ml2g1 − mglcosq0( ) = 0

s = −1

2g2 ±

1

2g2

2 − 41

ml2g1 − mglcosq0( )

We can adjust this to get any real and imaginary parts we want

If you are familiar with the idea of a natural frequency and a damping ratiothen you might like to set the control problem up in that language

The linear term is the key — the feedback from the derivative

Page 22: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

22

s s + g2( ) +1

ml2g1 − mglcosq0( ) = 0

The real part is always negative. If z is less than unity, there is an imaginary part.

If z equals unity the system is said to be critically damped

s2 + 2ζωns + ωn2 = 0

can be made the same as the one degree of freedom mass-spring equation

g2 = 2ζωn , g1 = mglcosq0 + ml2ωn2

by setting

s = −ζωn ± ωn ζ 2 −1giving

Page 23: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

23

This suggests a bunch of questions

Is this generalizable to more complicated systems?

Is there a nice ritual one can always employ?

Is this always possible?

Will the linear control control the nonlinear system?

How much of this does it make sense to include in this course?

YES

SOMETIMES

NO

SOMETIMES

??

Page 24: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

24

The question of possibility is really importantso I’m going to address that as soon as I can develop some more notation

The general perturbation problem for control will be

˙ x = A{ }x + B{ } Q{ } ⇔ ˙ x i = A ji x j + B j

i Q j

For a single input system like the one we just sawB will be a column vector and Q a scalar and the equation is

˙ x i = A ji x j + B iQ

Page 25: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

25

We want Q (or Q for one input) to be proportional to x

Q j = −Gkj x k

˙ x i = A ji x j − B j

i Gkj x k

the minus sign is conventional

We see that G has as many rows as there are inputs and as many columns as there are state variables

G is a row vector for single input systems

Page 26: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

26

Rename some dummy indices to make it possible to combine terms

˙ x i = A ji − Bm

i G jm

( )x j

˙ x i = A ji − B iG j( )x jWe have for the single input case

Our control characteristic polynomial will come from

det sI ji − A j

i + Bmi G j

m( ) = 0

and the question is:is it always possible to find G such that the roots are where we want them?

Page 27: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

27

There are always at least as many gains as there are roots, so you’d think so

But it isn’t.

The controllability criterion, which I will state without proof, is that the rank of

Q ji = B j

i ,Aki B j

k,Aki Am

k B jm ,L{ }

must be equal to the number of variables in the state

There are as many terms in Q as there are variables in the state

Page 28: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

28

Q has as many rows as there are variables.

The number of columns in Q is equal to the number of variables times the number of inputs

In the single input case Q is a square matrixAND there is a nice simple way to figure out what the gains must be for stability

We are not going to explore this — we haven’t the time —and it is covered in most decent books on control theory

We can get by with guided intuition.

Page 29: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

29

??

Page 30: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

30

Single input systems are much simpler than multi-input systemsbut we have need of multi-input systems frequently

I will outline the intuitive approach to multi-input systemswhich works best (at least for me) through the Euler-Lagrange equations

This may be a bit hard to follow; we’ll do an example next time

Page 31: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

31

Euler-Lagrange equations

d

dt

∂L

∂˙ q i ⎛

⎝ ⎜

⎠ ⎟=

∂L

∂qi+ Qi

which we can rewrite

M ij˙ ̇ q j +1

2

d

dtM ij( ) ˙ q j =

∂L

∂qi+ Qi

M ij˙ ̇ q j +1

2

∂M ij

∂qk˙ q j ˙ q k =

∂L

∂qi+ Qi

Page 32: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

32

For a steady equilibrium, which is what we are learning how to do

M ijε˙ ̇ ′ q j +1

2

∂M ij

∂qkε 2 ˙ ′ q j ˙ ′ q k =

∂L

∂qi+ Q0i + ε ′ Q i

∂L

∂qi+ Qi = 0⇒ Q0i = −

∂L

∂qi˙ q k = 0

q j = q0j + ε ′ q 1

j ⇒ ˙ q j = ε ′ ˙ q 1j , ˙ ̇ q j = ε ′ ˙ ̇ q 1

j

Qi = Q0i + ε ′ Q i

perturbation

We can drop this term because of the e2.

Page 33: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

33

M ijε˙ ̇ ′ q j =∂L

∂qi+ Q0i + ε ′ Q i

and we need to perturb the gradient of the Lagrangian to finish the linearization

∂L

∂qi=

∂L

∂qi′ q k = 0

+∂2L

∂qi∂qk′ q k = 0

ε ′ q k + O ε 2( )

M ijε˙ ̇ ′ q j =∂2L

∂qi∂qk′ q k = 0

ε ′ q k + ε ′ Q i

or

˙ ̇ ′ q m = M mi ∂2L

∂qi∂qk′ q k = 0

′ q k + M mi ′ Q i

Page 34: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

34

We can use our old method of converting to first order odes on thisand decide controllability (before we knock ourselves out trying to control it)

˙ ′ q m = um

˙ u m = M mi ∂2L

∂qi∂qk′ q k = 0

′ q k + M mi ′ Q i

The state vector is

x =′ q m

um

⎧ ⎨ ⎩

⎫ ⎬ ⎭

Page 35: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

35

and the B matrix is

B =0

M mi

⎧ ⎨ ⎩

⎫ ⎬ ⎭

The A matrix is

A =

0 I

M mi ∂2L

∂qi∂qk′ q k = 0

0

⎨ ⎪

⎩ ⎪

⎬ ⎪

⎭ ⎪

Page 36: Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems

36

??