Sunteți pe pagina 1din 14

Advanced Control

SISO-MIMO Design Examples

Scope SISO-/ MIMO design examples

Keywords SISO (Single In - Single Out), MIMO (Multiple In Multiple Out)

Prerequisites state space description, state regulator (LQR), observer (LQG)


and loop transfer recovery (LTR)

Contact Markus Kottmann, markus.kottmann@hsr.ch

Date September 27, 2009


Advanced Control, SISO-MIMO Design Examples MSE

Solved Exercises

1 State Controller including Integral Part


Given is a system in input-output-description
1
Y (s) = ∙ U (s)
s2 +2∙s+2
1. Find the state space description in controllable canonical form.

2. Design a state feedback controller with an integral part and closed loop poles
p1,2 = −1 ± i, p3 = −10 using MATLAB.

3. Plot the step response of the output y and the error e using MATLAB or
Simulink.

2 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

2 Two-Mass-Swinger
Given is the system below, with the force u as input signal, and the two positions
y1 and y2 as output signals.

Assume that m1 = 1kg, m2 = 2kg, k = 36N/m, b = 0.6N s/m. The equations for
the system are

m1 ÿ1 = k(y2 − y1 ) + b(ẏ2 − ẏ1 ) + u


m2 ÿ2 = k(y1 − y2 ) + b(ẏ1 − ẏ2 )

The state variables are x1 = y1 , x2 = y2 , x3 = ẏ1 , x4 = ẏ2 .

1. Find a state space description of this system with y = [y1 y2 ] T .



2. Design a state regulator with closed loop poles p1,2 = −2 ± i ∙ 2 3, p3 = −10,
p4 = −10. Design an observer with poles [-15, -15, -16, -16]. Find a suitable
prefilter Kvf .

3. Create the closed loop system with the state vector [x x̃]T and verify that
the eigenvalues of the system correspond to the two pole placement designs.

4. Plot the step response of the outputs y1 and y2 and verify the correct selection
of Kvf .

5. Compare the system responses for the condition when the two mass swinger
 T
has a state vector x = [1 1 0 0]T and the observer x̃ = 0 0 0 0 respective
 T
x̃ = −1 − 1 0 0 . Explain.

January 17, 2011 Büchi Roland, Markus Kottmann 3


Advanced Control, SISO-MIMO Design Examples MSE

3 Four-Mass-Swinger
Given is the system below, with two forces as input, u = [u1 u2 ]T , and four posi-
tions as output: y = [y1 y2 y3 y4 ]T . The state variables are x1 = y1 , x2 = y2 ,
x3 = y3 , x4 = y4 , x5 = ẏ1 , x6 = ẏ2 , x7 = ẏ3 , x8 = ẏ4 . Assume that m = 1kg,
k = 36N/m, b = 0.6N s/m.

1. Find the state space description of this system.

2. Design a state regulator with closed loop poles [−2 ± i ∙ 3, −2 ± i ∙ 4, −3 ± i ∙ 3,


−3 ± i ∙ 4]. Design an observer with poles [-15, -15, -15, -15, -16, -16, -16, -16].

3. Compare the behaviour of the system without and with observer (LQR vs.
LQG-LTR). Compare the responses of initial values [-1 -1 -1 -1 0 0 0 0]
(Initial state of the observer!).

4. Design the state regulator and the observer using optimal control.

4 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

4 Train
Given is the system below, where the forces u1 and u2 are the inputs and d1 = y2 −y1 ,
d2 = y3 −y2 and d3 = y4 −y3 are the differences between the positions of the waggons.
Assume that m = 1kg, k = 36N/m, b = 0.6N s/m.

The state variables are x1 = d1 , x2 = d2 , x3 = d3 , x4 = d˙1 , x5 = d˙2 , x6 = d˙3 , x7 = ẏ1 .

1. Find the state space description for this system with one output ẏ1 .

2. Design a state regulator with closed loop poles [−2 ± i ∙ 3, −2 ± i ∙ 4, −3 ± i ∙ 3,


-10]. Design an observer with poles [-20, -20, -20, -20, -21, -21, -21].

3. Compare the behaviour of the system without and with observer (LQR vs.
LQG-LTR).

4. Plot the step response of the output ẏ1 . Find a suitable prefilter Kvf .

5. Design the state regulator and the observer using optimal control.

January 17, 2011 Büchi Roland, Markus Kottmann 5


Advanced Control, SISO-MIMO Design Examples MSE

Solutions

1 State Controller including Integral Part


1.
   
0 1 0
ẋ = x+ u
−2 −2 1
 
y= 1 0 x

2.
     
  0  1 0    0
ė  e 
= 0 0 1  +  0 w
ż z
0 −2 −2 1
| {z } | {z }
 B̂

Listing 1: Calculate feedback gain with integral action by pole placing


A = [0 1; -2 -2];
B = [0; 1];
C = [1 0];

Ahat = [0 C ; zeros (2 ,1) A ];


Bhat = [0; B ];

Khat = place ( Ahat , Bhat , [ -1+1 j -1 -1 j -10]) ;


K1 = Khat (1) ;
K2 = Khat (2: end ) ;

 
K̂ = 20 20 10
K1 = 20
 
K2 = 20 10

3. The system G1 (s) without the integral action is:

ẋ = [A − BK2 ]x + Bu
y = Cx

The integrator GI (s) = K1 1s is connected in series to G1 (s) to get the loop


transfer function L(s) = G1 (s)GI (s). The transfer function G(s) from r to y
is then found by closing the loop. The error is then defined as e = y − r or
in laplace E(s) = Y (s) − R(s) ⇔ E(s) = G(s)R(s) − R(s) ⇔ Ge (s) = E(s) R(s)
=
G(s) − 1.

6 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

Listing 2: Create closed loop system and plot step response


G1 = ss (A - B * K2 ,B ,C ,[]) ;
GI = tf ( K1 ,[1 0]) ;
L = G1 * GI ;
G = feedback (L ,1) ;
Ge = G -1;
step (G , Ge ) ;
legend ( ’y ’ , ’e ’) ;

Refer to figure 1 for the step response.

Step Response

1.5
y
e

0.5
Amplitude

-0.5

-1
0 1 2 3 4 5 6 7
Time (seconds)

Figure 1: Step response of the state controller with integral action

When you simulate the step response with Simulink you can refer to the block
diagram in the script. To verify your implementation use the MATLAB com-
mand linmod(’yourSimulinkFile’) to get a system description. Check the
eigenvalues of this system to make sure that they correspond to the pole place-
ment design.

January 17, 2011 Büchi Roland, Markus Kottmann 7


Advanced Control, SISO-MIMO Design Examples MSE

2 Two-Mass-Swinger

1.

ẋ1 = x3
ẋ2 = x4
k k b b
ẋ3 = − x1 + x2 − x3 + x4 + u
m1 m1 m1 m1
k k b b
ẋ4 = x1 − x2 + x3 − x4
m2 m2 m2 m2

      
ẋ1 0 0 1 0 x1 0
ẋ2   0 0 0 1  x2  0
   
 = k b   +  u

ẋ3  − m k
m
− m
b
m x 3 1
1 1 1 1
k
ẋ4 m2
− mk2 mb2 − mb2 x4 0
 
    x1
y1 1 0 0 0  
x2 
=
y2 0 1 0 0 x3 
x4

2. The design is straight forward. The only thing that needs special attention
is the design of the prefilter Kvf . Because we have two outputs but only one
input, we have to decide for which output we want the static gain to be 1.
We select the second output y2 (in this example the choice does not really
matter because both outputs have the same static gain). The static gain is
not influenced by the observer because at steady state the observer errors are
zero for all suitable H.

Listing 3: Design state regulator and observer by pole placing


m1 = 1;
m2 = 2;
k = 36;
b = 0.6;

A = [0 0 1 0; 0 0 0 1; [ - k k -b b ]/ m1 ; [ k -k b -b ]/ m2 ] ;
B = [0; 0; 1; 0];
C = [1 0 0 0; 0 1 0 0];

K = acker (A , B , [ -2+2 i * sqrt (3) -2 -2 i * sqrt (3) -10 -10]) ;


H = place (A ’ , C ’ , [ -15 -15 -16 -16]) ’ ;

Kvf = 1/( C (2 ,:) /( - A + B * K ) * B ) ;

8 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

 
K = 130.4444 −41.5556 23.1 15.4185
 
30.4 0.6
 0.3 30.7 
H=185.94 54.06 

27.03 212.97
Kvf = 88.8889

3.
Listing 4: Create the closed loop system and check the eigenvalues
Ag = [A - B * K B * K ; zeros ( size ( A ) ) A - H * C ];
Bg = [ B ; zeros ( size ( B ) ) ];
Cg = [ C zeros ( size ( C ) ) ];

G = ss ( Ag , Bg , Cg , []) * Kvf ;

eig ( G )

4.
Listing 5: Step response of the closed loop system
step ( G ) ;

Refer to figure 2 for the step response plot.

5.
Listing 6: Initial responses of the closed loop system
x0 = [1 1 0 0 0 0 0 0];
initial (G , x0 ) ;
hold on
x0 = [1 1 0 0 -1 -1 0 0] ;
initial (G , x0 ) ;
hold off
legend ( ’ Observer state [0 0 0 0] ’ , ’ Observer state [ -1 -1 0 0] ’
)

Refer to figure 3 for the initial responses. Because the controller uses inaccurate
state estimations during the transients of the observer, the performance of the
controller is initially reduced.

January 17, 2011 Büchi Roland, Markus Kottmann 9


Advanced Control, SISO-MIMO Design Examples MSE

Step Response

1.5

1
To: Out(1)

0.5
Amplitude

1.5

1
To: Out(2)

0.5

0
0 0.5 1 1.5 2 2.5 3 3.5
Time (seconds)

Figure 2: Step response of the closed loop system

Response to Initial Conditions

1.5

1
To: Out(1)

0.5

0
Amplitude

-0.5

1.5
Observer state [0 0 0 0]
Observer state [-1 -1 0 0]

1
To: Out(2)

0.5

-0.5
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (seconds)

Figure 3: Initial responses of the closed loop system

10 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

3 Four-Mass-Swinger

January 17, 2011 Büchi Roland, Markus Kottmann 11


Advanced Control, SISO-MIMO Design Examples MSE

Response of y1-y4 to initial Conditions -1 (state regulator)


0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)

Response of y1-y4 to initial Conditions -1 (state regulator with observer)


0.2

-0.2

-0.4

-0.6

-0.8

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)

12 Büchi Roland, Markus Kottmann January 17, 2011


MSE Advanced Control, SISO-MIMO Design Examples

4 Train

January 17, 2011 Büchi Roland, Markus Kottmann 13


Advanced Control, SISO-MIMO Design Examples MSE

transient behaviour d1, d2, d3 (state regulator)


0.04

0.02

-0.02

-0.04

-0.06

-0.08
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)

Step Response

(state regulator)
1.4

1.2

1
Amplitude

0.8
Velocity

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3
Time (sec)

transient behaviour d1, d2, d3 (state regulator with observer)


0.04

0.02

-0.02

-0.04

-0.06

-0.08

-0.1

-0.12
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)

Step Response

(state regulator with observer)


1.4

1.2

1
Amplitude

0.8
Velocity

0.6

0.4

0.2

0
0 0.5 1 1.5 2 2.5 3
Time (sec)

14 Büchi Roland, Markus Kottmann January 17, 2011

S-ar putea să vă placă și