Chapter 8 State Estimator based controller design
Chapter 8 State Estimator based controller design
University
1
x1(𝑡) System
Observer
0.5
x1(𝑡)
0
0 2 4 6 8 10
t
1
-0.5 x2(𝑡)
-1
0 2 4 6 8 10
t
8.2 Open-loop State Observer
(2) When system parameters change
System:
0 1 0 0
x x u, x (t0 )
0.8 1 1 0
Observer:
0 1 0 0
xˆ xˆ u , xˆ (t0 )
a b 1 0
a 0.7, b 0.9
8.2 Open-loop State Observer
1.5
x1 & xˆ1 1
System
0.5 Observer
0
0 2 4 6 8 10
t
1
System
0.5 Observer
x2 & xˆ2 0
-0.5
-1
0 2 4 6 8 t 10
8.2 Open-loop State Observer
State feedback control without an observer
d
r + + u y
k2 Plant
- -
x
K1
u K1 x k2 (r y )dt
If all state variables are available for feedback
control, they are directly used without any observer.
8.2 Open-loop State Observer
State control with an open-loop observer
d
r + + u y
k2 Plant
- -
Observer
K1
x
u K1 xˆ k2 (r y )dt
8.3 Asymptotic State Observer
Asymptotic state observer
xˆ Axˆ Bu L( y Cxˆ ), xˆ (t0 )
• Improve the disadvantage
of the open-loop state 제어대상 시스템
observer
• Output x using u and y as
input
• L is the gain matrix
multiplied by the error
between the system and
the observer output.
8.3 Asymptotic State Observer
PI type state control with an observer
d
r + + u y
k2 Plant
- -
Observer
K1
x
u K1 xˆ k2 (r y )dt
xˆ Axˆ Bu L( y Cxˆ ), xˆ (t0 )
8.3 Asymptotic State Observer
Defining the error between the system state and the
observer state as
e x xˆ
Differentiating both sides and substituting the previous
expressions yields
e x xˆ Ax Bu Axˆ Bu L( y Cxˆ )
A( x xˆ ) L(Cx Cxˆ )
A( x xˆ ) LC ( x xˆ )
( A LC )e
8.3 Asymptotic State Observer
(Theorem) Consider an error system
e (t ) ( A LC )e (t ), e (t0 ) x (t0 ) xˆ (t0 )
|IA+LC |= 0.
If L is selected so that all eigenvalues of (A-LC) have
negative real parts, then for any e(t0), e(t)0 as t,
that is, x(t)x(t).
(Proof) The solution of the error system is
( A LC )t
e (t ) e e (t0 )
8.3 Asymptotic State Observer
(Theorem) Consider an asymptotic state observer
2 1 1 0.5
x x u, x (t0 )
0 3 1 0
y 1 0 x
2 3
2 (5 1 ) (2 1 )3 2
q1 Aq2 an-1 B
Step 6: Find K and L.
1
K KQ LK T
8.3 Asymptotic State Observer
Consider the previous system.
2 1 1 0.5
x x u, x (t0 )
0 3 1 0
y 1 0 x
a1 10, a2 34
8.3 Asymptotic State Observer
From and
K a2 a2 a1 a1 28 5
Q= [q1 q2]
1
q2 B
0
2 0 1 1 3
q1 Aq2 a1 B 5
1 3 0 0 1
1
1 3 1 0 1
Q
1 0 1 3
8.3 Asymptotic State Observer
L is obtained as follows:
0 1
K KQ 28 5
1
5 13
1 3
5
LK
T
13
8.3 Asymptotic State Observer
Method 3: Ackermann Formula
Step 1: Find () from the given poles.
( ) ( 1 )( 2 ) ( n ) n a1 n-1 an
Step 2: Find ( A) A n
a A n -1
an I
1
C
CA
Step 3: Find the observability matrix V
Step 4: Obtain the gain matrix L. n1
0 CA
0
L ( A)V 1
1
8.3 Asymptotic State Observer
Consider the same system.
2 1 1 0.5
x x u, x (t0 )
0 3 1 0
y 1 0 x
Design an asymptotic state observer with two poles
of -53j.
The characteristic polynomial from the given poles
becomes
( ) ( 5 j3)( 5 j3)
2 10 34 a1 10, a2 34
8.3 Asymptotic State Observer
(A) becomes
2
2 1 2 1 1 0 18 5
( A) 10 34
0 3 0 3 0 1 0 13
The observability matrix V becomes
C 1 0 1 1 0
V , V
CA 2 1 2 1
The gain matrix L becomes
1 0 18 5 1 0 0 5
L ( A)V 1 0 13 2 1 1 13
8.3 Asymptotic State Observer
Example 1: Consider the same system.
2 1 1 0.5
x x u, x (t0 )
0 3 1 0
y 1 0 x
Program:
8.3 Asymptotic State Observer
State observer
xˆ Axˆ Bu L( y Cxˆ ), xˆ (t0 ) 0
Inserting A, B, C and L gives
2 1 1 1
xˆ xˆ u ( y 1 0 xˆ )
0 3 1 2
Rewriting this yields
xˆ1 2 xˆ1 xˆ2 u 1 ( y xˆ1 )
xˆ2 3xˆ2 u 2 ( y xˆ1 )
8.3 Asymptotic State Observer
Main program
A= [-2 1;0 -3]; C= [1 0]; P= [-5+3*j, -5-3*j];
AT= A'; CT= C'; L= acker(AT, CT, P); L= L';
t=0; xp= [0.5;0]; xo= [0;0]; h= 0.01; u=1; loop= 300;
buf= [t xp' xo'];
for i= 1:loop
xp= RK4(@plant,t,xp,u,h); % call the plant
y= xp(1);
xo= RK4(@observer,t,xo,u,h,y); % call the observer
t= t+h;
buf= [buf; t xp' xo'];
end
8.3 Asymptotic State Observer
subplot 211
plot(buf(:,1),buf(:,2),'b',buf(:,1),buf(:,4),'r','linewidth',2)
axis([0 3 0 0.8])
subplot 212
plot(buf(:,1),buf(:,3),'b',buf(:,1),buf(:,5),'r','linewidth',2)
axis([0 3 0 0.6])
8.3 Asymptotic State Observer
Plant
function xdot= plant(t,x,u)
xdot= zeros(2,1);
xdot(1)= -2*x(1)+x(2)+u;
xdot(2)= -3*x(2)+u;
2 1 1
x x u or
0 3 1
x1 2 x1 x2 u
x2 3x2 u
8.3 Asymptotic State Observer
State observer
function xdot= observer(t,x,u,y)
L1= 5; L2= 13;
xdot= zeros(2,1);
xdot(1)= -2*x(1)+x(2)+u+L1*(y-x(1));
xdot(2)= -3*x(2)+u+L2*(y-x(1));
xˆ 1 2xˆ 1 xˆ 2 u 1 (y xˆ 1 )
xˆ 2 3xˆ 2 u 2 (y xˆ 1 )
8.3 Asymptotic State Observer
0.8
0.6
x1
0.4
0.2
xˆ1
0
0 0.5 1 1.5 2 2.5 3
0.8
0.6
x2
0.4 xˆ2
0.2
0
0 0.5 1 1.5 2 2.5 3
8.3 Asymptotic State Observer
Example 2: Consider a block diagram that controls the
roll angle ϕ of a light airplane by adjusting the aileron
angle θ.
8.3 Asymptotic State Observer
The model of the airplane is as follows:
0 1 0 0 0.1
x 0 1 1 x 0 u, x (t0 ) 0
0 0 0 1 0
y 1 0 0 x
u= -[ 32 16 6]x+16(r-y)dt
(2) Design an asymptotic state observer with poles -32j,
-2 and combine with the tracking controller. Make sure
that the performance at the setpoint ϕd= 20° satisfies
Mp≤10(%) and 2% ts≤9(sec) with x(𝑡0)= 0.
8.3 Asymptotic State Observer
0 0 0 1
AT 1 1 0 , C T 0
0 1 0 0
L= 9
28
52
8.3 Asymptotic State Observer
The state observer becomes
0 1 0 0 9
xˆ 0 1 1 xˆ 0 u 28 ( y 1 0 0 xˆ )
0 0 0 1 52
xˆ1 xˆ2 9( y xˆ1 )
xˆ2 xˆ2 xˆ3 28( y xˆ1 )
xˆ3 u 52( y xˆ1 )
8.3 Asymptotic State Observer
Overall system
r+ 16 + u y
- -
State observer
32 x1
+ +
x2
16
+ +
x3
6
PI-type tracking controller
8.3 Asymptotic State Observer
Main progarm
A= [0 1 0;0 -1 1;0 0 0]; B= [0;0;1]; C=[1 0 0];
AA= [A;C];
AA= [AA zeros(4,1)];
BB= [B;0];
PC= [-2+2j, -2-2j, -1, -2];
K= acker(AA,BB,PC)
PO= [-3+2j, -3-2j, -4];
AT= A'; CT= C'; L= acker(AT, CT, PO);
L= L'
8.3 Asymptotic State Observer
t= 0; xp= [-0.1;0;0]; xo= [0;0;0]; h= 0.01;
r= 20*pi/180; z= 0; loop= 1000; buf=[]; par=[xp(1);L];
u= 0;
for i= 1:loop
buf= [buf; t xp(1) xo(1) u];
z= z+h*(r-xp(1));
u= -K(1:3)*xo+K(4)*z;
xp= RK4(@airplane,t,xp,u,h);
par(1)= xp(1);
xo= RK4(@observer,t,xo,u,h,par);
t= t+h;
end
8.3 Asymptotic State Observer
subplot 211
plot(buf(:,1),buf(:,2),'b',buf(:,1),buf(:,3),'r','linewidth',2)
axis([0 10 -0.1 0.4])
grid on
subplot 212
plot(buf(:,1),buf(:,4),'linewidth',2)
axis([0 10 -5 6])
grid on
8.3 Asymptotic State Observer
Plant
x1 x2
x2 x2 x3
x3 u
8.3 Asymptotic State Observer
State observer
function xdot= observer(t,x,u,par)
y= par(1); L1= par(2); L2= par(3); L3= par(4);
xdot= zeros(3,1);
xdot(1)= x(2)+L1*(y-x(1));
xdot(2)= -x(2)+x(3)+L2*(y-x(1));
xdot(3)= u+L3*(y-x(1));
xˆ1 xˆ2 9( y xˆ1 )
xˆ2 xˆ2 xˆ3 28( y xˆ1 )
xˆ3 u 52( y xˆ1 )
8.3 Asymptotic State Observer
Step response
0.3
x1
0.2
y(t)
0.1 xˆ1
0
-0.1
0 2 4 6 8
t
5
u(t)
0
-5
0 2 4 6 8
t
Adama Science and Technology
University
Assignment IV
1. A dynamic system is modelled by
0 1 0 0 0.1
x 0 1 1 x 0 u, x (t0 ) 0
0 0 0 1 0
y 1 0 1 x
a. Design a PI-type tracking controller so that the closed-loop augmented system has poles –1 ± 1j, –1 and –2.
b. Design an asymptotic state observer with poles -10.5j, -1 and combine with the tracking controller.
Note: simulate and see the result using MATLAB.