You are on page 1of 6

ELE 4201 Control Systems Laboratory

Laboratory: II Title: Representation of Systems in Block Diagram Form Objectives: To have each student become familiar with MATLAB by engaging
in exercises to reduce multiple block diagrams into a single block with a transfer function.
Figure 1 shows a block with a state space representation. Such a block represents a system or an element of a system. The MATLAB representation of such a system is given by sys = ss(A,B,C,D), where ss means state space. A physical system may involve many interconnected blocks. In what follows, we shall consider series, parallel, and feedback connected blocks. Combinations of the aforementioned blocks may represent any linear time-invariant system.

x = Ax +

Bu Fig. 1 y = Cx + Du
Series Connected Blocks

G2
Fig. 2 In Figure 2, G1 and G2 are series connected. System G1 (represented by sys1) and System G 2 (sys2) are respectively defined by (in state space) sys1 = ss(A1, B1, C1, D1) and sys2 = ss(A2, B2, C2, D2) The series connected system G1G2 is given by sys = series(sys1, sys2)

Parallel Connected Blocks

G2
Fig. 3 In Figure 3, G1 and G2 are parallel connected. The outputs from the two systems G 1 and G2 can take any combination of addition and subtraction. If G1 and G2 are defined in terms of state space, then sys1 = ss(A1, B1, C1, D1) and sys2 = ss(A2, B2, C2, D2) the parallel connected system G1 + G2 is given by sys = parallel(sys1, sys2) the parallel connected system G1 - G2 is given by sys = parallel(sys1, -sys2) Feedback Connected Blocks

H
Fig. 4

G2

Fig. 5

In Figure 4, G1 and H are in a feedback configuration. The feedback shown can either be negative or positive. In figure 5, both G1 and G2 are also in a feedback configuration but unlike figure 4, there is no subsystem in the feedback loop. This is known as unity feedback, where the feedback loop has a value of 1. If G and H are defined in terms of transfer functions, then sysg = [numg, deng] and sysh = [numh, denh] The entire feedback system is given by sys = feedback (sysg, sysh) or [num, den] = feedback(numg, deng, numh, denh) If the system has unity, then H = 1 and sys can be given by sys = feedback(sysg, [1]) Note that in treating the feedback system, MATLAB assumed that the feedback was negative. If the system involves a positive feedback, we need to add +1 in the argument of feedback as follows: sys = feedback(sysg, sysh, +1) Alternatively, we can use sysh in the statement sys; that is sys = feedback(sysg, -sysh) for the positive feedback system. For state space systems, you can use the following command for the transfer function system sys_ss = ss(sys) where sys is given in terms of transfer function

+ -

2/s

++

1/s

Fig. 6

MATLAB Program >> numg1 = [2]; deng1 = [1 0]; sysg1 = tf(numg1,deng1); >> numg2 = [1]; deng2 = [1 0]; sysg2 = tf(numg2,deng2); >> sysg3 = [1]; >> sys1 = parallel(sysg1,sysg3); >> sys2 = series(sysg1,sysg2); >> sys = feedback(sys2, [1]); MATLAB Response Transfer Function: s + 2/s^2 + s + 2 Type the following in MATLAB >> sys_ss = ss(sys) MATLAB Response a= x1 x2 x1 -1 -1 x2 2 0 b= x1 x2 c= y1 d= y1 u1 0 x1 1 x2 1 u1 1 0

The state space equation obtained is . .x1 = x2 = -1 2 -1 0 x1 x2 1 0 u1 u2

y=

x1 x2

0 0

u1 u2
4

Note that is state space representation is not unique. If we use the statement [A,B,C,D] = tf2ss(num,den) we obtain the following state space equations:

. .x1 =

x2 =

-1 1

-2 0

x1 x2

+ 0

u1 u2

y=

x1 x2

0 0

u1 u2

So if we use the transfer function from the earlier MATLAB response and add the transformation to state space command: >> num = [1 2]; den = [1 1 >> [A,B,C,D] = tf2ss(num,den) MATLAB Response A= -1 -2 1 0 B= 1 0 C= 1 D= 0 2 2];

EXAMPLE 1) Consider the system shown in figure 7. Obtain a state space representation of the closed loop system using two approaches: I Find the transfer function expression for the closed loop system and then transform that expression to a state space expression. II Find the state space representation of the entire closed loop system. - This will require you to make sure that order the numerator is less than or equal to the order of the denominator. - May need to manipulate and redraw the block diagrams. To obtain the corresponding transfer function, we use the statement: sys_tf = tf(sys)

Exercise 1.
Obtain the closed-loop transfer function Y(s)/U(s) with MATLAB.

+ -

(s + 1)2/s

2/s(s + 5)

Fig. 7

You might also like