lecture 14: stability and control ii reprise of stability from last time the idea of feedback...
TRANSCRIPT
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
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
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 —
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
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?
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
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
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
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
10
??
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
12
We quit here; the remainder of this set will reappear in our next class.
13
Let’s think about control in the context of the simple inverted pendulum
q
add a small, variable torque at the pivot
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
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
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
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
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 . . .
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
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
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
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
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
??
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
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
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?
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
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.
29
??
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
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
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.
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
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
⎧ ⎨ ⎩
⎫ ⎬ ⎭
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
⎧
⎨ ⎪
⎩ ⎪
⎫
⎬ ⎪
⎭ ⎪
36
??