Beruflich Dokumente
Kultur Dokumente
Mobile Robots
Dr. Magnus Egerstedt
Professor
School of Electrical and
Computer Engineering
Module 4
Control Design
x = Ax + Bu, y = Cx
The dilemma: We seem to need x but all we have is y
Game plan:
Design u as if we had x
Figure out x from y
Step 1: State feedback using pole placement
4.1.1
0 1
x = Ax + Bu, A =
, B=
0 0
State Feedback: u = Kx = k1 k2 x
0
1
4.1.2
Computing Eigenvalues
Given a matrix M, its eigenvalues satisfy the characteristic
equation
M () = det(I M ) = 0
m1 m2
M=
m3 m4
1 0
m1
I M =
M =
0 1
m3
m2
m4
4.1.3
Computing Eigenvalues
Given a matrix M, its eigenvalues satisfy the characteristic
equation
M () = det(I M ) = 0
m1
m
2
det(I M ) =
m3
m4
= ( m1 )( m4 ) m2 m3
= 2 (m1 + m4 ) + m1 m4 m2 m3 = 0
4.1.3
Computing Eigenvalues
Given a matrix M, its eigenvalues satisfy the characteristic
equation
M () = det(I M ) = 0
M () = 2 (m1 + m2 ) + m1 m4 m2 m3 = 0
m1 + m4
(m1 + m4 )2
=
m1 m4 + m2 m3
2
4
But this is really annoying is there an easier way?
4.1.3
M () = 2 (m1 + m2 ) + m1 m4 m2 m3 = 0
Lets stop here!
4.1.4
u = Kx x = (A BK)x
0
A BK =
0
ABK () =
1
0
k1
0
1
1
+ k2
k1
k2
0
k1
1
k2
= 2 + k2 + k1
4.1.5
Desired Eigenvalues
Lets pick the eigenvalues that we would like the closed-loop
system to have
1 , . . . , n
If these were indeed the eigenvalues, then the characteristic
polynomial would be
n
() = ( 1 )( 2 ) ( n ) =
i=1
( i )
() = ( + 1)( + 1) = 2 + 2 + 1
Now we just line up the coefficients!
4.1.6
k2 = 2
k1 = 1
K=
1 2
x = Ax + Bu
u
x
u = Kx
4.1.7
ABK () = n + an1 n1 + . . . + a1 + a0
n
() =
( i ) = n + bn1 n1 + . . . + b1 + b0
i=1
n1 :
..
.
0 :
4.2.1
Questions
Is this always possible? No!
How should we pick the eigenvalues? Mix of art and science
Do we have to compute large determinants? No!
In MATLAB:
>> P=[lambda1,lambda2,lambda3,];!
>> K=place(A,B,P);!
4.2.2
Example
x =
u = Kx =
k1
k2
ABK () =
2 0
1 1
x+
1
1
2 k1
x A BK =
1 k1
2 + k1
k2
1 + k1
1 + k2
k2
1 k2
= 2 + (3 + k1 + k2 ) + 2 k1 k2
4.2.3
Example
ABK () = 2 + (3 + k1 + k2 ) + 2 k1 k2
() = ( + 1)2 = 2 + 2 + 1
1 :
3 + k1 + k2 = 2 k1 + k2 = 5
???
0 : 2 k 1 k 2 = 1 k 1 + k 2 = 1
4.2.4
4.2.5
Rate of Convergence
x = (A BK)x, Re() < 0, eig(A BK)
min
Re
4.2.6
In MATLAB
% System matrices!
A=[2,0;1,-1]; B=[1;1];!
% Let's pick our favorite poles!
P=[-0.5+1i,-0.5-1i];!
% Pole placement!
K=place(A,B,P);!
% Compute the solution!
x=[1;1]; t=0; tf=5; dt=0.01; !
while (t<tf);!
x=x+dt.*(A-B*K)*x;!
t=t+dt;!
end; !
4.2.7
4.3.1
A Modest Example
Given a discrete-time system
?
0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.3.2
A Modest Example
?
0
We want to solve
x =
AB
un1
..
An1 B .
u1
u0
4.3.3
A Modest Example
x
?
0
x =
AB
un1
..
An1 B .
u1
u0
(n mn)
rank() = n
Turns out, this generalizes quite nicely
4.3.3
Controllability Theorem 1
x = Ax + Bu, x n
AB
n1
controllability matrix
rank() = n
4.3.4
x =
2 0
1 1
x+
Two Systems
1
1
AB =
x =
2
2
0 1
0 0
0
1
1 2
1 2
AB =
1
0
0 1
1 0
= [B AB]
not CC!
pole-placement possible
n=2
rank() = 1
n=2
= [B AB]
CC!
rank() = 2
4.3.5
Controllability Theorem 2
u = Kx, x = (A BK)x
4.3.6
0 1
0 0
0
1
x2
In MATLAB:
>> G=ctrb(A,B);!
>> rank(G)!
ans: 2!
x0
x1
4.3.7
4.4.1
The Base:
x 1 = v cos
x 2 = v sin
=
Extra states:
The Pendulum:
,
Inputs:
L , R
v,
4.4.2
LINEARIZE!
1
2
2
+ mb d2 sin cos = L (L R )
((3L +
)m
+
m
d
sin
+
I
)
2
w
b
2R2
R
2
4.4.3
Linearization
Linearize this mess around (x,u)=(0,0), and plug in the
physical parameters for the segway robot:
x = Ax + Bu
A=
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
2.16
0
0
0
72.49
0
0
0
0
0
1
0
B=
0
0
0
0
1.67
1.67
0
0
0.029
0.029
0
0
24.15 24.1514
4.4.4
Controllability?
>> rank(ctrb(A,B))!
ans =!
Not CC!
6!
4.4.5
A Smaller System
T , u = [L R ]T
x = [v ]
x = Ax + Bu
0
0
A=
0
0
0 2.16
0
0
0
0
0 72.49
0
0
1
0
1.67
1.67
0.029 0.029
B=
0
0
24.15 24.15
>> rank(ctrb(A,B))!
ans =!
CC!
4!
4.4.6
x
= x [vd d 0 0]T = x
The dynamics become
x
= x = x = Ax + Bu = A(x ) + Bu + A
Luckily,
A = 0 x
= A
x + Bu
4.4.7
Pole-Placement
We have a CC system that we wish to stabilize
After some tweaking, the following eigenvalues seem to
behave well:
4.4.8
=
v
curvature rather than pose
4.4.9
x = Ax + Bu
y = Cx
?
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.5.1
x = Ax + Bu
y = Cx
4.5.1
x = Ax + Bu
y = Cx
observer
4.5.1
The Predictor-Corrector
x = Ax
y = Cx
First idea: Make a copy of the system
x
= A
x
predictor
x
= A
x + L(y C x
)
corrector
Luenberger observer
4.5.2
estimated state e = x x
Cx
e = x x
= Ax A
x L(y C x
)
e = A(x x
) LC(x x
) = (A LC)e
Just pick L such that the eigenvalues to A-LC have negative
real part!!
4.5.3
Pole-Placement, Again
e = (A LC)e
Want
4.5.4
Example
x =
1
0
2
2
e = (A LC)e =
=
x, y =
1
0
2
2
1 L1
L2
L1
L2
2 + L1
2 + L2
4.5.5
Example
e =
1 L1
L2
2 + L1
2 + L2
+ 1 + L1
ALC () =
L2
2 L1
+ 2 L2
= 2 + (3 + L1 L2 ) + 2 + 2L1 + L2
() = ( + 1)2 = 2 + 2 + 1
L1 = 2/3
L2 = 1/3
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.5.6
Example
1
x
= A
x+
3
2
1
1.2
0.9
(y C x
)
0.8
0.8
0.7
0.6
0.6
0.4
0.5
0.2
0.4
0
0.3
0.2
0.2
0.4
0.6
0.1
4.5.7
The Block-Diagram
x = Ax
y = Cx
x
= A
x + L(y C x
)
4.5.8
4.5.9
x = Ax
y = Cx
x
= A
x + L(y C x
)
4.6.1
xk+1 = Axk
yk = Cxk
Can we recover the initial condition by collecting n output
values?
y0 = Cx0
y1 = Cx1 = CAx0
..
.
yn1 = CAn1 x0
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.6.2
y0
y1
y2
..
.
yn1
C
CA
CA2
..
.
CAn1
x0
4.6.3
Observability Theorem 1
x = Ax, x n
y = Cx
Definition: The system is completely observable (CO) if it
is possible to recover the initial state from the output.
C
CA
..
.
CAn1
observability matrix
rank() = n
4.6.4
Observability Theorem 2
x
= A
x + L(y C x
), e = (A LC)e
CO Theorem 2: Pole-placement to arbitrary
eigenvalues is possible if and only if the system is CO!
4.6.5
4.6.6
4.7.1
A Game Plan
x = Ax + Bu
y = Cx
Assume CC and CO
u = Kx x = (A BK)x
u = K x
x
= A
x + Bu + L(y C x
)
e = (A LC)e
4.7.2
x = Ax BK x
= Ax BK(x e) = (A BK)x + BKe
e=xx
e = (A LC)e
x
e
A BK
0
BK
A LC
x
e
4.7.3
x
e
A BK
0
BK
A LC
x
e
M () = ABK ()ALC ()
If we havent messed up in the design, we have
Everything works!!
4.7.4
4.7.5
x = Ax + Bu
y = Cx
u = K x
x
= A
x + Bu + L(y C x
)
4.7.6
4.8.1
Eigenvalue Selection
Typically, the observer should be faster than the controller,
since the controller wont do anything useful until the state
estimate is close.
Note: Large observer eigenvalues give large observer gains:
Not a problem The observer is a software construct!
4.8.2
Eigenvalue Selection
Im()
Re()
observer
controller
4.8.3
Humanoid Robot
torque constant
= (Ki b)
J
current
moment of inertia
Aldebaran Nao
0
0
1
x =
b/J
y= 1 0 x
friction coefficient
x+
0
K/J
CC & CO!!
4.8.4
Reference Tracking
x = Ax + Bu
d
e=
y = Cx
d
e = Ax + Bu = Ae + A
+ Bu = Ae + Bu
0
d
y = Cx = Ce + C
= Ce + d
0
u = K e
e = A
e + Bu + L(y C e d )
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.8.5
u = K x
x
= A
x + Bu + L(y c
x)
K = R1 B T P
(xT Qx + uT Ru)dt
0 = AT P + P A + Q P BR1 B T P
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.8.6
u = K x
x
= A
x + Bu + L(y c
x)
x = Ax + Bu + DI vI
y = Cx + DO vO
T 1
L = P C T (DO DO
)
T 1
0 = AT P + P A + DI DIT P C T (DO DO
) CP
Magnus
Egerstedt,
Control
of
Mobile
Robots,
Georgia
Ins<tute
of
Technology
4.8.7
Next Module
But, the real world (especially for robots) is more complex
than a simple LTI system
HYBRID SYSTEMS!
4.8.8