ECE 602 Fall 2010

Funwork #1

Solutions

1. (4 pts) Draw a block diagram illustrating the operation of the Watt’s governor.

◇

A block diagram of the Watt’s governor is shown in Figure 1.

Figure 1: A block diagram of the Watt’s governor system.

2. (4 pts) An example of a closed-loop feedback system is a toilet flushing device connected to a water tank. A toilet system is shown in Figure 2. The control objective is to maintain the level of water in the tank at a constant level. Draw a block diagram of the system.

◇

A block diagram of a toilet flushing system is shown in Figure 3.

Figure 2: Toilet-flushing system for Exercise 2.

3. (4 pts) Compute the transfer function of a discrete-time system whose impulse response is

g[k] = \{ \begin{matrix}0 & for & k ≤ 0 \\ \frac{1}{k} & for & k ≥ 1. \end{matrix}

Is this system lumped or distributed? ◇

We can use the following commands of MATLAB’s Symbolic Toolbox to find the Ztransform of the given impulse response,

                 syms z k;symsum(1/k*(z^(-k)),k,1,inf)

We obtain

G(z) = − ln(1 − \frac{1}{z}) ,

which is not a rational function. Therefore, the system with the given impulse response is distributed.

Figure 3: A block diagram of the toilet flushing system.

4. (4 pts) Suppose that G(s) ∈ ℝ^{p×m} is a proper rational matrix such that

G(s) = G(s)_{sp} + G(∞),

where

G(s)_{sp} = \frac{N_{r−1}s^{r−1} + ⋯ + N_{1}s + N_{0}}{d(s)}

and d(s) = s^{r} + α_{r−1}s^{r−1} + ⋯ + α_{1}s + α_{0}. Show that the following state-space representation is a realization of G(s):

\begin{matrix}˙ ; x̂ & = & [ \begin{matrix}−α_{r−1}I_{m} & −α_{r−2}I_{m} & −α_{r−3}I_{m} & ⋯ & −α_{1}I_{m} & −α_{0}I_{m} \\ I_{m} & O & O & ⋯ & O & O \\ ⋮ & ⋮ & ⋮ & ... & ⋮ & ⋮ \\ O & O & O & ⋯ & O & O \\ O & O & O & ⋯ & I_{m} & O \end{matrix} ] x̂ + [ I_{m} ; O ; ⋮ ; O ; O ] u \\ y & = & [ N_{r−1} N_{r−2} N_{r−3} ⋯ N_{1} N_{0} ] x̂ + G(∞)u, \end{matrix} \}

(1)

◇

We follow the proof of Chen on page 102 with a minor change of notation. Let

Z = [ Z_{0} ; Z_{1} ; ⋮ ; Z_{r−1} ] = (sI − A)^{−1}B,  (2)

where Z_{i} is an m × m sub-matrix of the rm × m block matrix Z. Then,

C(sI − A)^{−1}B + G(∞) = N_{r−1}Z_{0} + N_{r−2}Z_{1} + ⋯ + N_{0}Z_{r−1} + G(∞). (3)

Pre-multiply both sides of (2) by (sI − A) and represent the result as

sZ = AZ + B.  (4)

Applying the above to the given matrices A and B, we obtain

sZ_{1} = Z_{0}, sZ_{2} = Z_{1}, sZ_{r−1} = Z_{r−2},  (5)

and

sZ_{0} = −α_{0}Z_{0} − α_{1}Z_{1} − ⋯ − α_{r−1}Z_{r−1} + I_{m}.  (6)

We have, Z_{1} = \frac{1}{s}Z_{0}, Z_{2} = \frac{1}{s}Z_{1} = \frac{1}{s^{2}} Z_{0}, and in general,

Z_{i} = \frac{1}{s^{i}} Z_{0}, i = 1, …, r − 1  (7)

Substituting (7) into (6) and performing simple manipulations gives

sZ_{0} = −α_{0}Z_{0} − α_{1}Z_{1} − ⋯ − α_{r−1}Z_{r−1} + I_{m}
= −α_{0}Z_{0} − \frac{α_{1}}{s} Z_{0} − ⋯ − \frac{α_{r−1}}{s^{r−1}} Z_{0} + I_{m},

that is,

(s + α_{0} + \frac{α_{1}}{s} + ⋯ + \frac{α_{r−1}}{s^{r−1}} ) Z_{0} = \frac{d(s)}{s^{r−1}}Z_{0} = I_{m}.

Thus

Z_{0} = \frac{s^{r−1}}{d(s)}I_{m}.  (8)

Using the above and (7) yields

Z_{1} = \frac{s^{r−2}}{d(s)}I_{m} … Z_{r−1} = \frac{1}{d(s)}I_{m}.  (9)

Substituting (8) and (9) into (3), we obtain

C(sI − A)^{−1}B + G(∞) = \frac{1}{d(s)} (N_{r−1}s^{r−1} + ⋯ + N_{1}s + N_{0}) + G(∞)
= G(s),

which shows that (1) is a realization of G(s).

5. (4 pts) For a proper rational matrix

G(s) = [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1}{(2s+1)(s+2)} & \frac{3s−1}{s} \\ \frac{3}{s+2} & \frac{4s−10}{2s+1} & \frac{2s+1}{s^{2}+1} \end{matrix} ] ,  (10)

(i) construct its two realizations; (ii) use MATLAB’s tf2ss command to find a realization of G(s).

◇

We first represent the transfer function G(s) as

G(s) = G(s)_{sp} + G(∞)
= [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1/2}{(s+1/2)(s+2)} & −\frac{1}{s} + 3 \\ \frac{3}{s+2} & −\frac{6}{s+1/2} + 2 & \frac{2s+1}{s^{2}+1} \end{matrix} ]
= [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1/2}{(s+1/2)(s+2)} & −\frac{1}{s} \\ \frac{3}{s+2} & −\frac{6}{s+1/2} & \frac{2s+1}{s^{2}+1} \end{matrix} ] + [ \begin{matrix}0 & 0 & 3 \\ 0 & 2 & 0 \end{matrix} ] .

We have

G(s)_{sp} = [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1/2}{(s+1/2)(s+2)} & −\frac{1}{s} \\ \frac{3}{s+2} & −\frac{6}{s+1/2} & \frac{2s+1}{s^{2}+1} \end{matrix} ]
= \frac{1}{s(s + 2)^{2}(s + 1/2)(s^{2} + 1)} [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1/2}{(s+1/2)(s+2)} & −\frac{1}{s} \\ \frac{3}{s+2} & −\frac{6}{s+1/2} & \frac{2s+1}{s^{2}+1} \end{matrix} ]
= \frac{1}{s^{6} + 4.5 s^{5} + 7 s^{4} + 6.5 s^{3} + 6 s^{2} + 2 s}N(s),

where

N(s) = N_{5}s^{5} + N_{4}s^{4} + N_{3}s^{3} + N_{2}s^{2} + N_{1}s + N_{0},

and where

N_{5} = [ \begin{matrix}1 & 0 & −1 \\ 3 & −6 & 2 \end{matrix} ] , N_{4} = [ \begin{matrix}1.5 & 0.5 & −4.5 \\ 7.5 & −24 & 10 \end{matrix} ] , N_{3} = [ \begin{matrix}1.5 & 1 & −7 \\ 6 & −30 & 16.5 \end{matrix} ] ,
N_{2} = [ \begin{matrix}1.5 & 0.5 & −6.5 \\ 7.5 & −24 & 10 \end{matrix} ] , N_{1} = [ \begin{matrix}0.5 & 1 & −6 \\ 3 & −24 & 2 \end{matrix} ] , N_{0} = [ \begin{matrix}0 & 0 & −2 \\ 0 & 00 & 0 \end{matrix} ] .

To construct the first realization, we use Theorem 1 to obtain

A = [ \begin{matrix}O & I_{3} & O & O & O & O \\ O & O & I_{3} & O & O & O \\ O & O & O & I_{3} & O & O \\ O & O & O & O & I_{3} & O \\ O & O & O & O & O & I_{m} \\ O & −2I_{m} & −6I_{m} & −6.5I_{m} & −7I_{3} & −4.5I_{m} \end{matrix} ] , B = [ \begin{matrix}O \\ O \\ O \\ O \\ O \\ I & 3 \end{matrix} ]

C = [ N_{0} N_{1} N_{2} N_{3} N_{4} N_{5} ] , D = G(∞).

In the construction of the second realization we use the result of Exercise 4 to obtain

Ã = [ \begin{matrix}−4.5I_{3} & −7I_{3} & −6.5I_{3} & −6I_{3} & −2I_{3} & O \\ I_{3} & O & O & O & O & O \\ O & I_{3} & O & O & O & O \\ O & O & I_{3} & O & O & O \\ O & O & O & I_{3} & O & O \\ O & O & O & O & I_{3} & O \end{matrix} ] , B̃ = [ \begin{matrix}I & 3 \\ O \\ O \\ O \\ O \\ O \end{matrix} ]

C̃ = [ N_{5} N_{4} N_{3} N_{2} N_{1} N_{0} ] , D̃ = G(∞).

We now use MATLAB’s tf2ss command to find a realization of G(s). We apply the command tf2ss to each column of G(s) to obtain their realizations. We then combine the partial realizations into a realization of G(s). We first concern ourselves with the first column of G(s) that we represent as

g_{1}(s) = \frac{1}{s^{2} + 4s + 4} [ \begin{matrix}s + 1 \\ 3s + 6 \end{matrix} ]

to obtain

A_{1} = [ \begin{matrix}−4 & −4 \\ 1 & 0 \end{matrix} ] , B_{1} = [ \begin{matrix}1 \\ 0 \end{matrix} ] , C_{1} = [ \begin{matrix}1 & 1 \\ 3 & 6 \end{matrix} ] , D_{1} = [ \begin{matrix}0 \\ 0 \end{matrix} ] .

We next represent g_{2}(s) as

g_{2}(s) = \frac{1}{2s^{2} + 5s + 2} [ \begin{matrix}1 \\ 4s^{2} − 2s − 20 \end{matrix} ] .

Applying the command tf2ss gives

A_{2} = [ \begin{matrix}−2.5 & −1 \\ 1 & 0 \end{matrix} ] , B_{2} = [ \begin{matrix}1 \\ 0 \end{matrix} ] , C_{2} = [ \begin{matrix}0 & 0.5 \\ −6 & −12 \end{matrix} ] , D_{2} = [ \begin{matrix}0 \\ 2 \end{matrix} ] .

Finally we represent g_{3}(s) as

g_{3}(s) = \frac{1}{s^{3} + s} [ \begin{matrix}3s^{3} − s^{2} + 3s − 1 \\ 2s^{2} + s \end{matrix} ]

Applying the command tf2ss gives

A_{3} = [ \begin{matrix}0 & −1 & 0 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{matrix} ] , B_{3} = [ \begin{matrix}1 \\ 0 \\ 0 \end{matrix} ] , C_{3} = [ \begin{matrix}−1 & 0 & −1 \\ 2 & 1 & 0 \end{matrix} ] , D_{3} = [ \begin{matrix}3 \\ 0 \end{matrix} ] .

The resulting realization of G(s) is

A = [ \begin{matrix}A_{1} & O & O \\ O & A_{2} & O \\ O & O & A_{3} \end{matrix} ] , B = [ \begin{matrix}B_{1} & O & O \\ O & B_{2} & O \\ O & O & B_{3} \end{matrix} ]
C = [ C_{1} C_{2} C_{3} ] , D = [ D_{1} D_{2}D_{3} ] .

Note that we can apply the command tf2ss directly to each column of G(s) rather than to that of G(s)_{sp}. That is, the command tf2ss does not require that G(s) be strictly proper. We can also use the command ss to obtain in one shot a state-space realization of a given transfer function matrix. We specify the numerator and the denominator of the transfer function matrix using cell arrays, then invoke the tf and finally the ss command. In our example, we could proceed as follows:

num={[1 1],1,[3 -1];3,[4 -10],[2 1]}
den={[1 4 4],[2 5 2],[1 0];[1 2],[2 1],[1 0 1]}
G=tf(num,den)
ss(G)

6. (4 pts) Compute the impulse response of a dynamic system whose transfer function is given by

G(s) = [ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1}{(2s+1)(s+2)} & \frac{3s−1}{s} \\ \frac{3}{s+2} & \frac{4s−10}{2s+1} & \frac{2s+1}{s^{2}+1} \end{matrix} ] .

◇

The LTI system’s impulse response is the inverse Laplace transform of the systems’s transfer function. So in our example,

g(t) = L^{−1}(G(s))
= L^{−1} ([ \begin{matrix}\frac{s+1}{(s+2)^{2}} & \frac{1/2}{(s+1/2)(s+2)} & −\frac{1}{s} + 3 \\ \frac{3}{s+2} & −\frac{6}{s+1/2} + 2 & \frac{2s+1}{s^{2}+1} \end{matrix} ])

= [ \begin{matrix}e^{−2 t} − te^{−2 t} & \frac{1}{3} e^{− \frac{t}{2}} − \frac{1}{3} e^{−2 t} & 3 δ(t) − 1 \\ 3e^{−2t} & −6e^{− \frac{t}{2}} + 2 δ(t) & 2 cos(t) + sin(t) \end{matrix} ] .

7. (4 pts) Can you construct a state-space model of a linear system whose output is zero in response to any input? ◇

A general example of an LTI continuous system whose transfer function is zero is

A = [ \begin{matrix}A_{11} & O \\ A_{21} & A_{22} \end{matrix} ] , B = [ \begin{matrix}O \\ B & 2 \end{matrix} ]
C = [ C_{1} O ] , D = O.

Indeed,

G(s) = C (sI − A)^{−1} B + D
= [ C_{1} O ] [ \begin{matrix}A_{11}^{−1} & O \\ X & A_{22}^{−1} \end{matrix} ] [ \begin{matrix}O \\ B & 2 \end{matrix} ]
= [ C_{1} O ] [ \begin{matrix}O \\ A & {−1 \atop 22} & B & 2 \end{matrix} ]
= O,

where X denotes a sub-matrix whose structure is irrelevant in this problem.

8. (4 pts) For the circuit shown in Figure 4 draw a block diagram with the current i(t) as the system’s input and the voltage v(t) as the system’s output. Then, find the transfer function, V (s)/I(s). ◇

Figure 4: Circuit for Exercise 8.

Let R_{1} = 30 Ω and R_{2} = 20 Ω. The Laplace transform of the current through R_{1} is denoted I_{1}(s) while the Laplace transform of the current through R_{2} is denoted as I_{2}(s). The Laplace transform of the voltage across R_{1} is denoted V_{1}(s). Then we have

V (s) = \frac{1}{sC} I_{2}(s)

and

I_{2}(s) = I(s) − I_{1}(s),

where

I_{1}(s) = \frac{1}{R_{1}} (R_{2}I_{2}(s) + V (s)).

Combining the above equations and performing simple manipulations gives

\frac{V (s)}{I(s)} = \frac{60}{s + 2}

A block diagram based on the above equations is shown in Figure 5.

9. (4 pts) Find the transfer function V_{out}(s)/V_{in}(s) of the circuit shown in Figure 6 that contains an ideal operational amplifier.

Figure 5: Block diagram of the circuit for Exercise 8.

◇

The transfer function V_{out}(s)/V_{in}(s) is

\frac{V_{out}(s)}{V_{in}(s)} = −\frac{Z_{f}(s)}{Z_{1}(s)},

where Z_{f}(s) is the impedance of the feedback path and Z_{1}(s) is the impedance of the forward path. We have

Z_{f}(s) = R_{2}∥sL = \frac{s}{s + 1} Ω

and

Z_{1}(s) = \frac{1}{sC} + R_{1} = \frac{1}{s} + 2 Ω

Hence,

\frac{V_{out}(s)}{V_{in}(s)} = −\frac{s^{2}}{(2s + 1)(s + 1)}

10. (4 pts) The purpose of this Exercise is to show some benefits that the state-space description can offer in the analysis of control systems. Begin by verifying that the transfer function Y (s)/R(s) for both systems shown in Figure 7 and 8 is the same. Obtain the step response for this transfer function.

Figure 6: Circuit for Exercise 9.

[figure: \frac{s−1}{s+2}; r; u; \frac{3}{s−1}; y]

Figure 7: Cascade compensation for Exercise 10: compensator preceding the plant.

Next obtain state-space realizations of the systems shown in Figure 7 and 8. That is, construct state-space realizations of G_{c}(s) = \frac{s−1}{s+2} and G_{p}(s) = \frac{3}{s−1} and then construct the overall state-space model of the cascade systems. The state-space models should of of second-order. Verify that the transfer functions of the models are the same as in the part above. Implement the obtained state-space models in SIMULINK. Obtain plots of the states and the outputs in response to a unit step input. Perform your simulations for different initial conditions that you can impose on the integrators. Compare the external, that is, input-output system behavior against the internal behavior. Can you give an explanation for an unexpected behavior of the state variables even when the external behavior seems to be acceptable. ◇

We first consider the configuration shown in Figure 9. To construct a state-space

[figure: \frac{3}{s−1}; r; \frac{s−1}{s+2}; y]

Figure 8: Compensator following the plant.

Figure 9: SIMULINK diagram of the interconnection of G_{c}(s) and G_{p}(s) with the compensator preceding the plant.

Figure 10: SIMULINK diagram of the implementation of G_{c}(s).

realization of G_{c}(s), we first represent G_{c}(s) as

G_{c}(s) = \frac{s − 1}{s + 2} = \frac{−3}{s + 2} + 1.

A possible state-space realization of G_{c}(s) is

ẋ_{2} = −2x_{2} − 3r
u = x_{2} + r.

In Figure 10, we show a SIMULINK implementation of the above state-space realization of G_{c}(s). A possible state-space realization of G_{p}(s) is

ẋ_{1} = x_{1} + u
y = 3x_{1}.

In Figure 11, we show a SIMULINK implementation of G_{p}(s). A state-space model of the overall configuration shown in Figure 9 is obtained by noticing that the input to the plant is the output of the compensator, that is,

u = x_{2} + r.

Figure 11: SIMULINK diagram of the implementation of G_{(}s).

Taking the above into account, we obtain a state-space model of the overall configuration,

[ ẋ_{1} ; ẋ_{2} ] = [ \begin{matrix}1 & 1 \\ 0 & −2 \end{matrix} ] [ \begin{matrix}x_{1} \\ x_{2} \end{matrix} ] + [ \begin{matrix}1 \\ −3 \end{matrix} ] r
y = [ 3 0 ] [ \begin{matrix}x_{1} \\ x_{2} \end{matrix} ] .

In the configuration shown in Figure 9, where the compensator precedes the plant the output diverges for all non-zero initial conditions except when x_{20} = −3x_{10}, which can be verified by solving the above system for y(t). For example, for the case when the initial conditions are x_{10} = 1 and x_{20} = 0, we obtain the output plot shown in Figure 12. The step response, shown in Figure 13, is obtained by setting zero initial conditions and applying the unit step input.

We now construct a state-space model of the cascade compensation with the compensator following the plant. We note that now

u = 3x_{2}.

Figure 12: A plot of the plant output in the interconnection where the compensator G_{c}(s) is preceding the plant G_{p}(s) with the initial conditions x_{10} = 1 and x_{20} = 0.

Figure 13: Step response of the interconnection of G_{c}(s) and G_{p}(s) with the compensator preceding the plant.

Figure 14: Plot of the output in the interconnection of G_{p}(s) and G_{c}(s) with the compensator following the plant.

Combining the state-space models of G_{p}(s) and G_{c}(s) above, we obtain

[ ẋ_{1} ; ẋ_{2} ] = [ \begin{matrix}−2 & −9 \\ 0 & 1 \end{matrix} ] [ \begin{matrix}x_{1} \\ x_{2} \end{matrix} ] + [ \begin{matrix}0 \\ 1 \end{matrix} ] r
y = [ 1 3 ] [ \begin{matrix}x_{1} \\ x_{2} \end{matrix} ] .

The step response is the same as in the previous configuration—see Figure 13.

A plot of the output for the initial conditions x_{10} = −2 and x_{20} = 1 is shown in Figure 14. We can see that the output reaches its correct steady-state. However, the states are diverging. This is the case for all initial conditions.

A conclusion from the above experiments is that one should not cancel unstable poles because even if the output behavior is acceptable, the internal behavior may be quite opposite leading to a possible damage of the overall system.