1 lecture 15: stability and control iii — control philosophy of control: closed loop with feedback...
DESCRIPTION
3 SIMULATION LINEAR CONTROL GOAL EQUILIBRIUM Ideal output input feedback Actual output error disturbance + Q0Q0TRANSCRIPT
1
Lecture 15: Stability and Control III — Control
Philosophy of control: closed loop with feedback
Ad hoc control thoughts
Controllability
Three link robot control
Holonomic systems with N degrees of freedom and K distinct inputs
2
PLANT
CONTROL
GOALINVERSEPLANT
+
-
+
-
Ideal output
input
feedback
Actual output
error
Mechanical/electromechanicalsystem
disturbance
+
K dimensional vector
3
SIMULATION
LINEAR CONTROL
GOALEQUILIBRIUM
+
-
+
-
Ideal output
input
feedback
Actual output
error
disturbance
+
Q0
4
LINEAR CONTROL
+
-
+
-
Ideal output
input
feedback
Actual output
error
disturbance
+
Q0 €
qi = q0i , ˙ q i = 0
€
˙ p i = ∂L∂qi + Qi
€
˙ q j = M ji pi
€
0 = ∂L∂qi + Q0i
5
Let’s think about control in the context of the simple inverted pendulum
q
add a small, variable torque at the pivot
6
€
˙ q = 1ml2 p, ˙ 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
Hamilton’s equations
7
€
x =qp ⎧ ⎨ ⎩
⎫ ⎬ ⎭⇒ ˙ x =
1ml2 p
mglsinq
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪+
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭
εQ
(I’ve put in the e because Q is zero at equilibrium)
€
˙ x ⇒ ε˙ ′ q ˙ ′ p ⎧ ⎨ ⎩
⎫ ⎬ ⎭=
1ml2 ε ′ p
mglsin q0 + ε ′ q ( )
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪+
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭
εQ
€
˙ ′ q ˙ ′ p ⎧ ⎨ ⎩
⎫ ⎬ ⎭=
1ml2 ′ p
mglcosq0 ′ q
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪+
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭Q = 0 1
ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪′ q ′ p
⎧ ⎨ ⎩
⎫ ⎬ ⎭+
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭
Q
8
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭Q
If q starts to increase, we feel intuitively that we ought to add a torque to cancel it
€
Q = −g1q
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x −
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭g1q
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭−g1 0{ }
qp ⎧ ⎨ ⎩
⎫ ⎬ ⎭
We can expand the feedback term
9
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭−g1 0{ }x
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
0 0−g1 0 ⎧ ⎨ ⎩
⎫ ⎬ ⎭x
€
˙ x = 0 1ml2
−g1 + mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x
multiply the column vector and the row vector
combine the forced system into a single homogeneous system
10
The characteristic polynomial for this new problem can be solved for
€
s2 = 1ml2 −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 . . .
11
Suppose we feed back the speed of the pendulum as well as its position?
€
Q = −g1q − g2 p
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x −
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭g1q + g2 p( )
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
01 ⎧ ⎨ ⎩
⎫ ⎬ ⎭−g1 −g2{ }
qp ⎧ ⎨ ⎩
⎫ ⎬ ⎭
€
˙ x = 0 1ml2
mglcosq0 0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x +
0 0−g1 −g2
⎧ ⎨ ⎩
⎫ ⎬ ⎭x
12
€
˙ x = 0 1ml2
−g1 + mglcosq0 −g2
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪x
And now the characteristic polynomial comes from
€
det s − 1ml2
g1 − mglcosq0 s + g2
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪= 0
Combining everything again we get
€
s s + g2( ) + 1ml2 g1 − mglcosq0( ) = 0
13
€
s s + g2( ) + 1ml2 g1 − mglcosq0( ) = 0
€
s = − 12
g2 ± 12
g22 − 4 1
ml2 g1 − 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
14
€
s s + g2( ) + 1ml2 g1 − 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
15
??
16
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
??
17
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{ }fE ⇔ ˙ x i = A ji x j + B j
i fEj
In the ad hoc example we worked, we used Q, the generalized force, as input
We cannot do that in general, so I have put in fE as the actual external force vector
18
For a single input system like the one we just sawB will be a column vector and fE a scalar and the equation is
€
˙ x i = A ji x j + B i fE
We’ll eventually see how we get from Euler-Lagrange to state space including B
19
We want fE (or fE for one input) to be proportional to x
€
fEj = −Gk
j x k
€
˙ x i = A ji x j − B j
i Gkj x k
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
the minus sign is conventional
20
Rename dummy indices (j —> m) 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?
21
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
€
W 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 W as there are variables in the state
22
W has as many rows as there are variables.
The number of columns in W is equal to the number of variables times the number of inputs
In the single input case W 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.
23
??
24
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 shortly.)
We are working on the yellow box in the block diagram
25
Euler-Lagrange equations
€
ddt
∂L∂˙ q i ⎛ ⎝ ⎜
⎞ ⎠ ⎟= ∂L
∂qi + Qi
which we can rewrite
€
M ij˙ ̇ q j + 12
ddt
M ij( ) ˙ q j = ∂L∂qi + Qi
€
M ij˙ ̇ q j + 12
∂M ij
∂qk ˙ q j ˙ q k = ∂L∂qi + Qi
26
For a steady equilibrium, which is what we are learning how to do
€
M ijε˙ ̇ ′ q j + 12
∂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.
27
€
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
28
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
⎧ ⎨ ⎩
⎫ ⎬ ⎭
and the A matrix is straightforward
29
The meaning of B is not immediately clear
B is a matrix connecting the actual inputs to the systemIt is not the connection between the generalized forces and the system
We get that by going back and remembering how the generalized forces are defined
€
Qi = ∂ ˙ W ∂˙ q i
30
Recall
€
˙ W = F1 ⋅v1 +L + τ1 ⋅ω1 +L
The vector forces and torques are made of componentsand we arrange the components into the vector fE
The velocities and rotation rates are linear functions of the
€
˙ q i
The terms in are linear in the components of fE
€
˙ W
We can combine all this to write
€
˙ W = aij qk( ) ˙ q i fEj
31
The coefficients will depend on the individual problembut in any case we will have
€
Qi = ∂ ˙ W ∂˙ q i
= aij qk( ) fEj
€
˙ u m = M mi ∂2L∂qi∂qk
′ q k = 0
′ q k + M mi ′ Q i
We can substitute this into the momentum equation
€
˙ u m = M mi ∂2L∂qi∂qk
′ q k = 0
′ q k + M miaij qk( ) fEj
32
Now we can go back to the state picture with a better idea of what A and B are
€
x =′ q m
um
⎧ ⎨ ⎩
⎫ ⎬ ⎭
state vector
state equations
€
˙ x =0 I
M mi ∂2L∂qi∂qk
′ q k = 0
0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪′ q m
um
⎧ ⎨ ⎩
⎫ ⎬ ⎭+
0M miaij qk( )
⎧ ⎨ ⎩
⎫ ⎬ ⎭fE
Explicit appearance of the actual forcesin the differential equations
33
and the B matrix is
The A matrix is
€
A =0 I
M mi ∂2L∂qi∂qk
′ q k = 0
0
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪
€
B =0
M miaij qk( )
⎧ ⎨ ⎩
⎫ ⎬ ⎭
34
Can we make sense out of the whole thing — how do we do a problem?!
Suppose we are given a mechanism and a task for it to do
Consider only the simple task of going to some configuration and stopping there
We can treat the final configuration as our equilibriumand design a control that will bring us to that equilibrium
€
q j = q0j + ε ′ q 1
j ⇒ ˙ q j = ε ′ ˙ q 1j , ˙ ̇ q j = ε ′ ˙ ̇ q 1
j
Qi = Q0i + ε ′ Q i
We want to make
€
′ q 1j → 0, ′ Q i → 0
35
all the holonomic constraints
generalized coordinates
Lagrangian
generalized forces
Euler-Lagrange track Hamilton track
goal
equilibrium forceslinearization
control design simulation(nonlinear)
Start from square one using what we know so far
36
LINEAR CONTROL
+
-
+
-
Ideal output
input
feedback
Actual output
error
disturbance
+
Q0 €
qi = q0i , ˙ q i = 0
€
˙ p i = ∂L∂qi + Qi
€
˙ q j = M ji pi
€
0 = ∂L∂qi + Q0i
Euler-Lagrange
Hamilton
Hamilton
37
??