Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Adama Science and Technology

University

PCE6101 Linear Systems


Theory
(Regulator Design)

ASTU
School of EEC

1. State Feedback Control


State feedback control

d
r Feedforward + u + + y
Plant
Gain matrix -
Feedback x
Gain matrix

1
Cont…
Realization of state feedback control
Controller Real plant

r u y
u  1.6r  4 x1  5 x2

x1
x2

Cont…
Purpose of using state feedback controllers
r u d y
F + + + Plant
-
K x

Setpoint tracking Tracking controller


- The setpoint changes from time to time
- It controls the output to follow the setpoint
Disturbance rejection Regulator
- The setpoint is fixed for a long time
- It controls to keep the output at the setpoint despite load
or/and disturbance changes

2
Cont…
Boiler level control

Setpoint

Cont…
Fish tank temperature control

3
Cont…
Car cruise speed control

Cont…
Greenhouse climate control

4
Cont…
Missile control

Cont…
Ship autopilot
• Tracking control when
berthing in a port
• Disturbance rejection
control when sailing in the
ocean

5
2. P-Type Regulator
Regulator allows the system to quickly eliminate the
effects of load or disturbance and to ensure that the
output quickly matches the set point.
Assumptions:
The system is controllable (U= n).
All state variables can be fed back.
Control input is not limited.
The setpoint (or reference input) is considered 0
for convenience.

Cont…
(Theorem) Consider a SISO LTI system
x  Ax  Bu , x0
If it is controllable, there exists K that allows the
poles of the closed-loop system to be in the desired
position through a regulator u= -Kx.

r=0 + u y
Plant
-
K
x

6
Cont…
Plant(open-loop) Regulator
x  Ax  Bu
u  Kx
y  Cx  Du
Feedback(closed-loop)
x  Ax  Bu  (A  BK )x +0r
y  Cx  Du  (C  DK )x +0r

Cont…
Method 1: Pole assignment method
Given poles 1 , 2 , , n of a closed-loop system,
find the feedback gain matrix K of
u= -Kx.

7
Cont…
1. Brute force method
Step 1: Obtain the characteristic polynomial from the
given poles 1 , 2 , , n
 ( )  (  1 )(  2 ) (  n )   n  a1 n-1    an

Step 2: Find the characteristic polynomial of (A-BK)
( )   I  A  BK   n  a1 n-1    an 
Step 3: Compare  with  and obtain K.
ai  ai (i  1, 2, , n)

Cont…
For example, consider a controllable system. Find the
regulator u= -Kx by the brute force method so that
the feedback system has two poles -2j2.
-2 0  1 0.5
x    x  1 u , x 0  0 
 0 -1   
y  1 2 x

Controllability check
1 -2 
U  B AB     , U  2
1 -1 

8
Cont…
From the given poles -2j2
( )  (  2  j 2)(  2  j 2)   2  4  8 
Letting K= [k1 k2]
 ( )   I  A  BK
 0   2 0  1
 det(        k1 k2 )
 0    0 1 1
  2  k1 k2 
 det(  )
 k1   1  k2 
 (  2  k1 )(  1  k2 )  k1k2
  2  (k1  k2  3)  k1  2k2  2 

Cont…
Comparing two yields
k1  k2  3  4 k1  k2  1
k1  2k2  2  8 k1  2k2  6
K= [k1 k2]= [-4 5]
Im
Im 2
Re Re
-2 -1 0 -2 0
-2
(open-loop poles) (closed-loop poles)

9
Cont…

Cont…
(Theorem) When the system is a controllable
canonical form,
x  Ax  Bu
if the given closed-loop poles are 1 , 2 , , n , then
the gain matrix K of regulator u= -Kx is given by.
K  (an  an ) (an 1  an 1 )  (a1  a1 ) 
where
( )  A   I   n  a1 n 1  ...  an
( )  (  1 )(  2 )...(  n )
  n  a1 n 1  ...  an

10
Cont…
(Proof) If 1 , 2 , , n are the closed-loop poles, the
characteristic polynomial is
( )  (  1 )(  2 )...(  n )
  n  a1 n 1  ...  an
and the closed-loop system matrix becomes
 0 1 0  0 
 0 0 1  0 

ACL       
 
 0 0 0  1 
 a an 1 an  2  a1 
 n

Cont…
On the other hand, since the open-loop system is the
controllable canonical form, the state equation is
described by
x  Ax  Bu
 0 1 0  0  0 
 0 0 1  0   0 
  
       x    u
   
 0 0 0  1  0 
 a an 1 an  2  a1  1 
 n

11
Cont…
Feedbacking with u= -Kx gives
x  Ax  Bu  ( A  BK ) x
 0 1 0  0  0 
 
 0 0 1  0  0 

(           k1 k2  kn )x
   
 0 0 0  1  0 
 a a  a1  1 
 n n 1  an  2

 0 1 0  0 
 
 0 0 1  0 
      x
 
 0 0 0  1 
 a  k a  k an  2  k3  a1  kn 
 n 1 n 1 2

Cont…
Comparing two system matrices gives
an  an  k1 k1  an  an
an 1  an 1  k2 k2  an 1  an 1
 
a1  a1  kn kn  a1  a1

Thus,
u   Kx
where K  (an  an ) (an 1  an 1 )  (a1  a1 )  

12
Cont…
Example 1: Consider an unstable but a controllable
canonical system.
0 1  0   0.3
x    x    u , x0   
 2 1 1  0 
y   2 3 x

Design u= -Kx such that the closed-loop system has


two poles -2j2.
Solution: Open-loop characteristic polynomial is
 1
 ( )   I  A   2    2
2   1
a1= 1, a2= -2

Cont…
Closed-loop characteristic polynomial with -2j2 is

( )  (  2  j 2)(  2  j 2)   2  4  8
a1  4, a2  8

Therefore
K   (a2  a2 ) ( a1  a1 ) 
  (8  2) (4  1)   10 3
u= -[10 3]x

13
Cont…
u= -[10 3]x

Im Im

2
Re Re
-2 0 1 -2 0
-2

(Unstable (Closed-loop
open-loop system) system)

Cont…

(Open-loop response) (Closed-loop response)

20 1

15 0.5

10
y(t)

y(t)

5
-0.5

0
-1
0 1 2 3 4 5 0 2 4 6 8 10
t t

14
Cont…
2. Similarity transformation method
Step 1: Obtain the characteristic polynomial from the
given poles.
 ( )  (  1 )(  2 ) (  n )
  n  a1 n -1    an
Step 2: Obtain the characteristic polynomial of the
open-loop system.
 ( )   I  A   n  a1 n -1    an
Step 3: obtain u  Kx
K = (an  an ) (an -1  an -1 )  (a1  a1 ) 

Cont…
Step 4: Obtain matrix Q= [q1 q2 … qn].
qn  B
qn 1  AB  a1 B
qn  2  A2 B  a1 AB  a2 B

q1  An 1 B  a1 An  2 B   an 1 B

Step 5: Obtain K  KQ 1

15
Cont…
For example, design a regulator that the closed-loop
system has two poles -2j2.
-2 0  1 0.5
x    x  1 u , x 0  0 
 0 -1   
y  1 2 x
From the given poles, a2

( )  (  2  j 2)(  2  j 2)   2  4  8

a1

Cont…
Characteristic polynomial of the open-loop system
  0   2 0 
( )   I  A  det(   )
 0    0 1
  2  3  2 a1= 3, a2= 2
Obtaining K yields

K   (a2  a2 ) (a1  a1 )    (8  2) (4  3) 
  6 1
Q is

16
Cont…
1
q2  B   
1
 2 0  1 1 1 
q1  AB  a1 B       3     
 0 1 1 1  2 
1 1  1 1 
Q   q1 q2     , Q 1   
 2 1  2 1
Thus
 1 1 
 K  KQ 1   6 1     4 5
 2 1

Cont…
3. Ackermann formula
Step 1: Obtain () from the given poles.
 ( )  (  1 )(  2 ) (  n )   n  a1 n-1    an
Step 2: In (), obtain (A) by substituting A for .
 ( A)  An  a1 An -1    an 1 A  an I
Step 3: Obtain the controllability matrix U.
U  [ B AB  An 1 B ]
Step 4: Find K with the following formula
K   0  0 1 U 1 ( A)

17
Cont…
For example, design a regulator that the closed-loop
system has two poles -2j2 using the Ackermann
formula and draw the block diagram.
-2 0  1 0.5
x    x    u , x0   
 0 -1 1 0 
y  1 2 x
From the poles ( )  (  2  j2)(  2  j2)   2  4  8
 ( A)  A2  a1 A  a2 I
2
 2 0   2 0  1 0   4 0 
   4  8   0 5
 0 1  0 1  0 1   

Cont…
U-1 yields
1 2   1 2 
U  [ B AB ]    , U 1   
1 1  1 1 
Thus
 1 2   4 0 
 K   0 1 U 1 ( A)   0 1   
 1 1   0 5 
  4 5

18
Cont…
Feedback system
u + x1 x1 + y
1  1
+ +
-
-2
+ x 2 x2
1  2
+
-3 -2 0  1
x    x   u
-5  0 -3 1
+ +
y  1 2 x
4
u    4 5 x
Regulator

Cont…
Program:
A= [-2 0;0 -3]; B= [1;1];C= [1 2]; D= 0;
P= [-2+2j, -2-2j];
K= acker(A,B,P)
AA= A-B*K; BB= zeros(size(B));
t= 0:0.01:10; u= zeros(size(t)); x0= [0.5;0];
y= lsim(AA,BB,C,D,u,t,x0);
plot(t,y,'b','linewidth',2) -2 0  1
axis([0 10 -0.1 0.6]) 
x   0 -3 x  1 u
xlabel('t'),ylabel('y(t)')   
y  1 2 x
u    4 5 x

19
Cont…

Response with x(t0)= [0.5 0]T

Cont…
Example 2: Consider a cart+inverted pendulum
system. Design u= -Kx such that the closed-loop
poles are -2j3, -8, -10, where x0=[0.2 0 0 0]T.
0 1 0 0 0 
0 0 -0.491 
0 0.5
x   x   u
0 0 0 1 0 
   
0 0 20.601 0  1 
y  1 0 0 0 x

20
Cont…
From the poles
( )  (  2  j3)(  2  j3)(  8)(  10)
  4  22 3  165 2  554  1040
(A) and U are
 ( A)  A4  22 A3  165 A2  554 A  1040 I
U  [B AB A2 B A3 B ]
 0 0.5 0 0.491 
0.5 0 0.491 0 
 
 0 1 0 20.601
 
 1 0 20.601 0 

Cont…
 0 2.1001 0 0.0501 
 2.1001 0 0.0501 0 
U 1  
 0 0.1019 0 0.0510 
 
 0.1019 0 0.0510 0 

Therefore,

 K   0 0 0 1 U 1 ( A)
  106.0 56.5 238.6 50.2

21
Cont…
MATLAB program
A= [0 1 0 0;0 0 -0.491 0;0 0 0 1;0 0 20.601 0];
B= [0;0.5;0;-1]; C= [1 0 0 0]; D= 0;
P= [-2+3j, -2-3j, -8, -10];
K= acker(A,B,P);
AA= A-B*K;
BB= zeros(size(B));
t= 0:0.01:6;
u= zeros(size(t));
x0= [0.2;0;0;0];
[y,x]= lsim(AA,BB,C,D,u,t,x0);

Cont…
subplot 221
plot(t,x(:,1),'k','linewidth',2)
axis([0 6 -0.1 0.3]),xlabel('t'),ylabel('x_1')
subplot 222
plot(t,x(:,2),'r','linewidth',2)
axis([0 6 -0.6 0.4]),xlabel('t'),ylabel('x_2')
subplot 223
plot(t,x(:,3),'b','linewidth',2)
axis([0 6 -0.1 0.1]),xlabel('t'),ylabel('x_3')
subplot 224
plot(t,x(:,4),'g','linewidth',2)
axis([0 6 -1 0.5]),xlabel('t'),ylabel('x_4')

22
Cont…
0.3 0.4

0.2 0.2
x1 x2 0
0.1
-0.2
0 -0.4

-0.1 -0.6
0 2 4 6 0 2 4 6
t t
0.1 0.5

0.05
0
x3 0 x4
-0.5
-0.05

-0.1 -1
0 2 4 6 0 2 4 6
t t

Cont…
Notes on pole selection
• The closed-loop poles should
be not too far from the open-
loop poles.
• The real part of the closed-loop
poles should be not too large
(large K can amplify the noise).
• Typically, select from the
yellow area in the right figure.

23
Cont…
Butterworth polynomial method
Use the following polynomials, but only stable poles.
(n  1)(2k  1) (n  1)(2k  1)
s  0 [cos( )  j sin( )]
2n 2n
(k  0,1, 2,...)

where
0: constant(natural angular frequency)
n : system order

Cont…
1st-order system (n= 1)
s  0 [cos((2k  1) )  j sin((2k  1) )]
When k= 0
s  0 (cos   j sin  )  0 stable pole, use it.

Im

s
Re
-0 0

24
Cont…
2nd-order system (n= 2)
3(2k  1) 3(2k  1)
s  0 [cos( )  j sin( )]
4 4
When k= 0,
3 3
s1  0 (cos  j sin )  stable(used)
4 4
When k= 1,
9 9 unstable(not used)
s2  0 (cos  j sin ) 
4 4
s1 Im Im s2

Re Re
0 0

Cont…
When k= 2,
15 15
s3  0 (cos  j sin ) unstable(not used)
4 4
When k= 3,
21 21
s4  0 (cos  j sin )  stable(used)
4 4

Im Im

Re Re
0 0
s3 s4

25
Cont…
For example, design a regulator u= -Kx by applying
the Butterworth polynomial to the following system:
0 1 0  1 
x    x    u , x0   
 2 1 1  0
y  1 0 x

The characteristic polynomial of the open-loop


system is
 1
 ( )   I  A    2    2, 0  2
2  1

Cont…
Choose stable poles becomes
3 3
When k= 0 s1  0 (cos  j sin )  1  j
4 4
21 21
When k= 3 s2  0 (cos  j sin )  1  j
4 4

From the above poles


( )  (  1  j)(  1  j)   2  2  2

(A) becomes

26
Cont…
 ( A)  A2  a1 A  a2 I
2
0 1 0 1 1 0 
   2  2 1  2 0 1 
 2 1    
0 1
 
 2 1
U and U-1 becomes
0 1  1 1 
U  [ B AB ]    , U 1   
1 1 1 0 

Cont…
Therefore,
Closed-loop
 K   0 1 U 1 ( A) Im

1 1   0 1 
  0 1   
1.32
1 0   2 1 1

 2 0  Re
  0 1     0 1
-1 -0.5 0
-1
 0 1 -1.32

Open-loop

27
Cont…
1

0.5
y(t)
0

-0.5
0 5 10 t 15 20
1

0.5
u(t)
0

-0.5
0 5 10 15 20
t

3. PI-Type Regulator
Type-n plant
x  Ax  Bu
G ( s )  C ( sI  A) 1 B  D
y  Cx  Du
K (1  T1' s )(1  T2' s ) (1  Tn' s )

s n (1  T1s )(1  T2 s ) (1  Tn s )

Type-0 plant (n= 0)


x  Ax  Bu
y  Cx  Du
K (1  T1' s )(1  T2' s ) (1  Tn' s)
G (s) 
(1  T1s )(1  T2 s )  (1  Tn s )

28
Cont…

Type-1 plant example


K
G ( s) 
s (1  Ts )

Cont…
If a P-type regulator u= -Kx is applied to a type-0
plant (n= 0) where disturbance exists, a steady-state
error occurs.

y 0

29
Cont…
Consider a LTI system with disturbance d

 1 1  0  0.2  1
x    x  1  u   0  d , x (0)  1
 0 1     
y  1 0 x

Find the response when controlling with the regulator


u= -[1 2]x. The TF G(s)= Y(s)/D(s) without
disturbance is
0.2 s  0.6
G ( s)  2 (type 0)
s  4s  4

Cont…
Response with disturbance
Does not
1
x1(t) converge to
0.5 zero
x2(t)
0
-0.5
0 1 2 3 4 5

0 u(t)
-2

-4
0 1 2 3 4 5

30
Cont…
(Problem) Consider a SISO plant with constant
disturbance.
x  Ax  Bu +Wd , x (0)
y  Cx  Du
P-type regulator u = -Kx introduces a steady-state
error. So, let's design a PI-type regulator where d
means disturbance.

Cont…
Introduce a new state variable to design a PI-type
regulator
z   ydt
Differentiating both sides gives
z  y

Original system x  Ax  Bu+Wd 


 y  Cx  Du
New state variable z= 
 x
Augmented vector x   
z

31
Cont…
x  Ax  Bu +Wd
z  y  Cx  Du
Combining  and  yields

 x   A 0   x   B  W 
 z   C 0   z    D  u +  0  d
        
 x
y  C 0    Du
z

Cont…
That is,

x  Ax
   B u +W d
y  Cx   Du

 x  A 0    B   W 
where x    , A    , B   D  ,W   0  ,
 
z  C 0     
C  C 0 , D  D
If the original system (A,B) is controllable, the
augmented system ( A , B ) is also controllable.

32
Cont…
So, the PI-type regulator becomes

     K k   x    K x  k ydt
u   Kx 1 2   1 2
z
where K can be obtained by one of the previously
used methods.

Cont…
Consider a scalar system.
x   x  2u  d , x(0)=0.5
yx
From the system, a= -1, b= 2, w= 1, c=1.
The augmented system is
 x   a 0   x  b   w 
 z    c  u+
0   z   0   0 
d
  
 1 0  x   2  w
  u+
0   z   0   0 
d
1
A B

33
Cont…
If the augmented feedback system has two poles -2j2.
 ( )  (  2  j2)(  2  j2)   2  4  8 
෩ = [k1 k2]
Letting K

 ( )   I  A  BK


 0   1 0   2 
 det( 
0     1 0    0   k1 k2 )
     
  1  2k1 2k2 
 det(  )
  1  
  2  (1  2k1 )  2k2 

Cont…
From  and 
1  2k1  4  k1  1.5
2k2  8  k 2  4

Thus, the PI-type regulator gives

    1.5 4  x   1.5 x  4 ydt


u   Kx z
 

34
Cont…
Feedback system d
u + + x x y
 4 - 2  1
- +
-1
PI-type
1.5
regulator

x   x  2u  d , x(0)  0.5
yx
u  1.5 x  4 ydt 

Cont…
Responses
1

x(t)
0.5
z(t)
0

0 1 2 3 4

0.5
t
y= x= 0
0
u(t) -0.5
-1

-1.5
0 1 2 3 4
t

35
Cont…
Example 3: Consider a system.
0 1 0 0  0.5
x    x  1  u  1  d , x (0)= 0 
 2 2       
y  1 0 x
Obtain a PI-type regulator using MATLAB and plot
the response so that the augmented feedback system
has poles -2 and -2j2 where disturbance d= 1, t>0.

Cont…
Solution: Given the problem
0 1 0  0 
A
2 2  , B  1  , W  1  ,C = 1 0 , D  0
     
So,
0 1 0 0 
 0   
  2 2 0  , B     1 
A B
A   
C 0   1 0 0   D  0 
  
0
 
W     1  , C
W
 C 0  1 0 0 , D  D  0
 0  0
 

36
Cont…
MATLAB program
>> AT= [0 1 0;-2 -2 0;1 0 0];
>> BT= [0; 1; 0];
>> P= [-2 -2+2*j -2-2*j];
>> KT= place(AT,BT,P) % Feedback gain matrix

KT= 14 4 16
Therefore, the PI-type regulator is given by
     K k   x    14 4 x  16 ydt
u   Kx 1 2  
z

Cont…
MATLAB program
t= 0; x= [0.5;0]; h= 0.01; loop= 500;
z= 0; yy= 0; K=[14 4 16]; buf=[t x' 0];
for i=1:loop
y= x(1);

z= z+0.5*h*(y+yy); % ydt
yy= y;
u= -K*[x;z];
x= RK4(@fun,t,x,u,h);
t= t+h;
buf=[buf;t x' u];
end

37
Cont…

t= buf(:,1); x1= buf(:,2); x2= buf(:,3); u= buf(:,4);


subplot 211
plot(t,x1,'b',t,x2,'r')
axis([0 5 -1 1])

subplot 212
plot(t,u,'b')
axis([0 5 -8 1])

Cont…
function xdot= fun(t,x,u)
d= 1;
xdot= zeros(2,1);
xdot(1)= x(2);
xdot(2)= -2*x(1)-2*x(2)+u+d;

0 1 0  0 
x    x  1  u  1  d
 2 2     

38
Cont…
Responses
1
x1(t)
0

x2(t)
-1
0 1 2 3 4 t 5

0
u(t) -2
-4
-6
-8
0 1 2 3 4 5
t

39

You might also like