Chapter 12 - Solutions: Problem 12.1. If The Sampling Frequency Is 1 (HZ), Then The Sampling Pe
Chapter 12 - Solutions: Problem 12.1. If The Sampling Frequency Is 1 (HZ), Then The Sampling Pe
Problem 12.1. If the sampling frequency is 1 [Hz], then the sampling pe-
riod, ∆, is 1 [s]. To compute the Z-transform of a sampled signal f (t) we first
obtain the expression for f (k∆) = f [k] and we then use tables to obtain the
Z-transform. The results are shown in the table below
z2 + z + 1
µ(t) − µ(t − 3) µ[k] − µ[k − 3]
z2
√
2z(z − a cos(0.5) − a sin(0.5))
e−0.1t cos(5t + π/4) ak cos(0.5k + π/4) a = e−0.1
2(z 2 − 2a cos(0.5)z + a2 )
bz(z + b)
t2 e−0.25t k 2 bk b = e−0.25
(z − b)3
Problem 12.2. The transfer function for each system can be obtained from the
system recursive equation on applying the Z-transform, with zero initial condi-
tions and then multiplying both sides by z M , where M is the smallest integer
which makes positive all powers of z.
12.2.1 The transfer functions for each of the three cases are
a)
b)
Yq (z) − 0.5z −1 Yq (z) + 0.06z −2Yq (z) = 0.6z −1 Uq (z) + 0.3z −2 Uq (z)
(4)
2
z Yq (z) − 0.5zYq (z) + 0.06Yq (z) = 0.6zUq (z) + 0.3Uq (z) (5)
1
c)
Yq (z) z
Hqc (z) = = 2 (9)
Uq (z) z − 0.5z + 0.64
Problem 12.3. The step response y[k] of a given system with transfer function
Hq (z) can be computed from
z
Yq (z) = Hq (z) (10)
z−1
A partial fraction expansion is then used and known inverse Z-transforms
for simple fractions are applied. Alternatively, a symbolic math. package, such
as Maple V can be used.
We thus have that
z − 0.5 1 z(z − 0.5) 2 1
= 2 =⇒ y[k] = (−0.5)k−2 + µ[k − 2]
z(z + 0.5)(z − 1) z (z − 1)(z + 0.5) 3 3
(11)
z2 2 z 2 z(z − 1)
= − (12)
(z − 1)(z 2− 0.5z + 1) 3 z − 1 3 z 2 − 0.5z + 1
2
z 25 z 5 z 25 1
= − − (16)
(z − 1)(z − 0.6)2 4 z − 1 2 (z − 0.6)2 4 z − 0.6
25 25 2 25 2
=⇒ y[k] = − (0.6) + k(0.6) µ[k] (17)
4 4 6
For the last case we have that
(z + 1)z 50 z 50 z(z + 0.02)
Yq (z) = = − (18)
(z − 1)(z 2 − 0.4z + 0.64) 31 z − 1 31 z 2 − 0.4z + 0.64
It is also worthwhile to recall that
We then compare the second fraction in (18) with (19), from where we obtain
cos(β) = 0.25 and
Thus
50 1
y[k] = 1− sin(kα + β) µ[k] = [1.613 − 1.676 sin(1.32k + 1.29)]µ[k]
31 sin(β)
(21)
Bq (z)
[GGh0 ]q (z) = (22)
Aq (z)
Bq (z) = z 1 − cos(1.6∆)e−1.2∆ − 0.75 sin(1.6∆)e−1.2∆ (23)
−2.4∆ −1.2∆ −1.2∆
+e + 0.75 sin(1.6∆)e − cos(1.6∆)e (24)
2 −1.2∆ −2.4∆
Aq (z) = z − 2ze cos(1.6∆) + e (25)
For [GGh0 ]q (z) to have only one pole, a pole-zero cancellation is required.
Since there is only one zero, and this is real, it is necessary that the sampling
period ∆ is chosen so that the poles are also real. This is only possible if
cos(1.6∆) = ±1, since then there are double poles located at ± e−1.2∆ . This is
equivalent to choose
π
∆ = ±κ ; ∀κ ∈ N (26)
1.6
In this case there is one zero located at e−1.2∆ (or at −e−1.2∆ ) which cancels
one of the poles.
3
Problem 12.5. We first recall that the Delta transform transfer function is
1
the Delta transform of the system output when the input is ∆ δK [k] (see section
§12.11).
Problem 12.6.
12.6.3 The difference equation can be computed from the z −1 form of the trans-
fer function above, since
Problem 12.7.
4
12.7.1 Using the MATLAB command d2c, with ∆ = 0.5 [s] we obtain
3.1275s + 4.4892
Go (s) = (34)
s2 + 3.6652s + 1.4365
12.7.2 We have seen in Problem 12.4 that a pole zero cancellation may arise
for particular choices of the sampling frequency. This happens because the
sampling frequency is a sub-multiple of half the period of an oscillatory
mode (including a damped oscillatory mode). We can thus imagine a
situation where one of the poles in Hoq (z), say the one located at z = 0.8
was originally a double pole which was cancelled by a zero. This could have
happened if the continuous time plant had a damped oscillatory mode of
the form eln(0.8)t cos(ωo t + α), and the sampling period were chosen such
that ωo = κωs , with κ ∈ N.
It can also happen that the phase and frequency in an oscillatory mode in
y(t) (Figure 12.6) (when u[k] = δK [k]) are such that by choosing a suitable
sampling frequency only a constant value is observed.
Problem 12.8. We consider first the case when ∆ = 1 [s]. In this case, the
plant time delay is exactly one sampling period, then it will translate in a pole
at the origin, i.e.
1.25(1 − e−0.8 )
Hoq (z) = (35)
z(z − e−0.8 )
When ∆ = 0.75 [s], the delay is larger than a sampling period. We can apply
the definition of the Z-transform, i.e.
z−1 e−s
z−1
Hoq (z) = Z L = 1.25 Z (1 − e−0.8(0.75k−1) )µ(0.75k − 1)
z s(s + 1) t=0.75k z
(36)
z−1
Hoq (z) = 1.25 Z (1 − e−0.4 e−0.6(k−2) )µ[k − 2] (37)
z
z−1 1 e−0.4
= 1.25 − (38)
z z(z − 1) z(z − e−0.6 )
(1 − e−0.4 )z + (e−0.4 − e−0.6 )
= 1.25 (39)
z 2 (z − e−0.6 )
5
Problem 12.9. We first recall that the stability region in the γ plane is given
by
|γ∆ + 1| < 1 (40)
12.9.1 We observe that the system has poles at γ = −0.1 and at γ = −0.8.
Considering ∆ = 3.5, the first pole is stable, because it satisfies (40); how-
ever, the second one does not satisfy (40), hence the system is unstable.
12.9.2 To obtain the Z-transform transfer function, we simply use the relation-
ship γ = (z − 1)/∆ = (z − 1)/3.5. This yields
z + 0.75
Gq (z) = 3.5 (41)
(z − 0.65)(z + 1.4)
Note that this expression confirms the instability of the system because
there is a pole outside the unit circle.
12.9.3 If ∆ = 1.5, then, both poles are stable, hence the system is stable.
The Z-transform transfer function is obtained using the relationship γ =
(z − 1)/∆ = (z − 1)/1.5. We then obtain
z − 0.25
Gq (z) = 1.5 (42)
(z + 0.2)(z − 0.92)
Which, as expected, is stable.
Problem 12.10. The frequency responses of both filters are shown in Figure
1.
20
0
|H ((ejω∆−1)/∆)|
δ
Magnitudes [dB]
−20
−40
|H(jω)|
−60
−80
10
−2
10
−1
10
0
10
1
ωs 2ωs 2
10
Frequency [rad/s]
12.10.1 The filter frequency responses in Figure 1 show that both filters have
similar frequency response for low frequencies (roughly up to the cutoff
frequency 1 [rad/s]). However, as the frequency increases, the responses
drift apart. The analogue filter frequency response decays monotonically.
However the digital filter, as expected, exhibits a periodic frequency re-
sponse.
6
12.10.2 The periodic nature of the digital filter frequency response precludes its
use as an anti-aliasing filter. Indeed, the purpose of an anti-aliasing filter
is to avoid the folding effect of high frequency components in the signal
being sampled; this purpose is achieved by filtering out the high frequency
component in the signal before it is sampled. This implies that an analogue
filter has to be used unless it is known a-priori that no signal components
lie at the frequency where folded components of the digital filter appear.
This can be achieved by combining a crude analogue filter followed by a
digital filter.
Problem 12.11. To make the comparison, the frequency responses are com-
puted using MATLAB. The results are shown in Figure 2.
In both cases (∆ = 0.5 [s] and ∆ = 0.05 [s]) the frequency responses are
compared and computed using the absolute value of the expression
0.25
0.2
Magnitude
0.15
0.05
0
−2 −1 0 1 2
10 10 10 10 10
Frequency [rad/s]
0.02
0.015
Magnitude
∆=0.05 [s]
0.01
0.005
0
−1 0 1 2 3
10 10 10 10 10
Frequency [rad/s]
7
Chapter 13 - Solutions
Problem 13.1.
13.1.1 The frequency responses for ∆ = 0.1, 1 and 10 [s] are computed using
MATLAB. The results are shown in figure 1.
|Gh0(jω)/∆| 1
0
−2 −1 0 1 2
10 10 10 10 10
1
|Gh0(jω)/∆|
0.5 ∆ =1 [s]
0
−2 −1 0 1 2
10 10 10 10 10
1
|Gh0(jω)/∆|
0.5
∆ =10 [s]
0
−2 −1 0 1 2
10 10 10 10 10
Frequency [rad/s]
1
Using Fourier series we establish that
∞
∞
1 −jkωs t
δ(t − k∆) = e (1)
∆
k=−∞ k=−∞
∞
∞
1
−jkωs t
U (jω) = F u(t)
s
δ(t − k∆) = F u(t) e
∆
k=−∞ k=−∞
(2)
∞
1
= U (j(ω − kωs )) (3)
∆
k=−∞
From the above facts we can appreciate that the staircase nature of m(t),
being a high frequency ingredient, originates on the degree of filtering of
U (j(ω − kωs )), for k = 1, 2, . . . .
On the other hand, since the frequency-response gain of the hold devise is
exactly zero at ω = ωs , 2ωs , 3ωs , . . . , then the high-frequency response
has to do with the degree of damping in the neighborhood of each of those
frequencies. It turns out that the higher the sampling frequency, the higher
the damping. This can be appreciated from Figure 2, where two different
sampling periods have been considered. For the purpose of comparison
scaling and frequency, shifting has been used.
0.35
0.3
Gh0(jω)/∆|∆=1
0.25
Magnitudes
0.2
0.15
Us(jω) ∆
0.1
shifted G (jω)/∆|
h0 ∆=0.5
0.05
0
4.5 5 5.5 6 6.5 7 7.5 8
Frequency [rad/s]
Problem 13.2. We first recall that, if we denote by f(kh) the sampled version
of the plant unit step response, then
z−1
[Go Gh0 ]q (z) = Z [f (k∆)] (4)
z
2
And, for this plant, the step response of the process, f (t), is given by:
1 1 1
f (t) = L = −te−t − e−2t + (5)
(s + 1)2 (s + 2)s 2 2
Then, a discretized version of (5) yields
1 1
f (k∆) = −k∆e−k∆ − e−2k∆ + (6)
2 2
Thus
1 az 2 + bz + c
[Go Gh0 ]q (z) = − 3 −∆ −2∆
2 z + (−2e −e ) z 2 + (e−2∆ + 2e−3∆ ) z + (−e−4∆ )
(7)
where
a = 2∆e−∆ + e−2∆ − 1 (8)
b = −2e−3∆ − 2∆e−∆ − 2∆e−3∆ + 2e−∆ (9)
c = e−4∆ − e−2∆ + 2∆e−3∆ (10)
0.5
h=2
h=2
Im
0
h=0.02 h=0.02
−0.5
−1
−4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0
Re
In Figure 3 two branches can be observed, the one to the right goes from
-0.0296 to -0.2626 and the other from -0.6189 to -3.6582.
3
Problem 13.3. Since the given plant is nonminimum-phase it then exhibits
reverse action, i.e., an undershoot occurs in the unit step response, as shown in
Figure 4.
13.3.1 The pulse transfer function [Go Gh0 ]q (z) is computed via the unit step
response of Go (s). We recall that, if we denote by f (t) that response, we
have that
z−1
[Go Gh0 ]q (z) = Fq (z); where Fq (z) = Z [f [k]] (11)
z
where f [k] is the sampled sequence {f (k∆)}. Unless Go (s) has a zero at
the origin (which would make it impossible to steer it to a constant output
with finite input) then Fq (z) has a pole at z = 1, and therefore all zeros
in [Go Gh0 ]q (z) are zeros of Fq (z).
The problem then reduces to finding a ∆ such that Fq (z) has no zeros
(except for one zero at the origin). We also observe that since [Go Gh0 ]q (z)
has only two poles, then if it has no zeros, the relative degree must be equal
to two, this implies that f [k] must be zero, not only at k = 0, but also at
k = 1. From Figure 4 we conclude that ∆ must be equal to the interval for
which the step response is negative (see the dotted indicator in Figure 4).
0.6
Unit step rersponse
0.4
0.2
−0.2
0 1 2 3 4 5 6 7 8
Time [s]
0.2961
[Go Gh0 ]q (z) = (12)
z 2 − 0.4437z + 0.03688
4
13.3.2 To design a minimal prototype controller for ∆=0.5[s], we first obtain1
[Go Gh0 ]q (z). This leads to
Note that [Go Gh0 ]q (z) has a NMP zero (located at z = 1.77).
Then, because of the nonminimum-phase zero, only the Aoq (z) part can be
canceled, so, Acl (z) (of order 2n, i.e., 4) will be chosen as:
And the controller expression will be given by (15) where P̄ (z) and L̄(z) are
of orders 0 (a constant value) and 1, respectively, in order to achieve the required
cancellation.
−1.297z + 2.297
Tq (z) = (19)
z2
An interesting feature of this problem is that, due to the NMP constraint,
the minimal prototype coincides with a dead-beat behavior.
5
13.4.1 To synthesize a deat-beat control we use equations (13.16.30) to (13.16.32),
this leads to
0.5498z + 0.4502
Toq (z) = (22)
z2
1.4
1.2
0.8
y(t)
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
40
30
20
u(t)
10
−10
−20
0 0.5 1 1.5 2 2.5 3
[s]
Figure 5: Step reference response (nominal case–solid line and real case–dashed
line)
Note that the d.c. gain is the same as in the nominal case.
6
To guage the effect of the unmodeled pole on the above design, we first
compute
Problem 13.5. We first recall that the minimum time dead-beat behavior de-
veloped in subsection §13.6.3, for stable- and minimum-phase plants, implies
Boq (z) Boq (1)z n − Boq (z)
Toq (z) = Soq (z) = (26)
Boq (1)z n Boq (1)z n
Observe that Soq (z) has a zero at z = 1, the loop will then compensate
completely any (either input or output) disturbance (in steady state).
13.5.1 The (sampled) response, Yq (z), to a input disturbance di (t) is given by
Yq (z) = Soq (z)[Go Di ]q (z) (27)
where [Go Di ]q (z) is the Z-transform of the sampled output of the system
Go (s), when the input is a continuous-time signal di (t).
We then have that, if di (t) = µ(t), then Yq (z) has n poles at the origin (so
far, so good). However it also has the n poles of Goq (z), which generally
will be located elsewhere. Since we assume that the plant is stable, then
y[k] will tend to zero not with dead-beat performance, but with dynamics
determined by the poles of Goq (z).
13.5.2 To achieve dead-beat behavior in the presence of step input disturbances,
we need that Soq (z) have not only a zero at z = 1, but also possess the
property that its zeros should coincide with the poles of Goq (z). Thus, the
controller Cq (z) should not cancel the poles of Goq (z).
To design the required dead-beat controller, we set the Diophantine equa-
tion as
Aoq (z) (z − 1)L̄q (z) +Boq (z)Pq (z) = Acl (z) = z 2n (28)
Lq (z)
7
This leads to
Aoq (z − 1)L̄q (z)
Soq (z) = (29)
z 2n
Pd (z)
[Go Di ]q (z) = (30)
(z − 1)Aoq (z)
0.0181z + 0.0164
Goq (z) = (32)
z2 − 1.7064z + 0.7408
8
(z + 0.7923)(0.0006z 2 + 0.0023z + 0.0005)
Yq (z) = Soq (z)[Go Di ]q (z) =
z4
(36)
2.5
2
y(t)
1.5
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5
150
100
50
0
u(t)
−50
−100
−150
−200
0 0.5 1 1.5 2 2.5 3 3.5
Time [s]
Figure 6: Dead-beat behavior for step references and step input disturbances.
Note the large control effort. This is due to the requirement to achieve dead-
beat behavior after 0.4 [s]. We could have forecast this result from inspection of
the controller numerator, which has very large coefficients.
Problem 13.6.
13.6.1 We recall that the minimum time dead-beat controller for a stable plant
is given by:
Aoq (z)
Cq (z) = (37)
Boq (1)z n − Boq (z)
9
a) In this case, we deal with a stable, second order plant (n = 2). We
then compute3 the pulse transfer function
Boq (z) 0.0393z − 0.0344
Goq (z) = = 2 (38)
Aoq (z) z − 1.5967z + 0.6703
From where we have that4 Boq (1) = 0.0736. Thus the controller is
given by
a1 z + a0
Toq (z) = (41)
z2
The coefficients a1 and a0 have to be computed to satisfy two re-
quirements: Toq (1) = 1 (to achieve zero steady state errors) and
Toq (1.2214) = 1 (to satisfy the interpolation constraints, recall sub-
section §8.6.3).
Then a1 = 2.2214 and a0 = −1.2214, the controller is then given by
15.9637z 2 − 24.8961z9.6825
Cq (z) = (44)
z 2 + 0.7022z − 1.7022
3 Use MATLAB command c2dm.
4 Use MATLAB command polyval.
10
d) In this case, we have a second order (n = 2) unstable NMP system:
The issue here is similar to case b), in that we cannot cancel all plant
poles.
For this system
0.0680z − 0.1034
Goq (z) = (45)
z 2 − 1.7755z + 0.7048
a2 + a1 + a0 = 1 (47)
2
a2 (1.5042) + a1 (1.5042) + a0 = 0 (48)
2 3
a2 (1.1052) + a1 (1.1052) + a0 = (1.1052) (49)
Note the choice of three poles at the origin, only one more than the
one required for minimum-time dead-beat control. This seems a sen-
sible choice, since only one unstable pole has to be taken care of.
13.6.2 The above cases suggest that special care has to be taken when dead-
beat control is desired for unstable plants. Starting with z n , for every
11
noncancellable pole (either unstable or too close to the unit circle) we
must add one pole at the origin. We thus write
0.6(α(z − 1) + 1)
Toq (z) = (55)
z 6 (z − 0.4)
12
Note that this Toq (z) still has unit d.c. gain and relative degree equal to
that of Goq (z).
We return to the original choice (54), from where we can compute the
controller as
Toq (z) 0.3153z 5(z − 0.9048)
Cq = = (57)
Soq Goq (z) z 6 − 0.4z 5 − 0.6
13.7.2 We recall (see section §7.4) that when a Smith predictor is used, then
the achieved complementary sensitivity has the form
Ḡo (s)C(s)
To (s) = e−τ s (58)
1 + Ḡo (s)C(s)
This leads to
3.5(s + 0.5)
C(s) = (60)
s
Both designs are compared using a unit step reference. The difference
between the closed-loop outputs is shown in Figure 7.
0.02
0
Output difference
−0.02
−0.04
−0.06
−0.08
−0.1
0 2 4 6 8 10 12 14 16 18 20
Time [s]
13
Problem 13.8. Assume that the digital biproper controller has transfer func-
tion
Uq (z) Pq (z)
= Cq (z) = (61)
Eq (z) Lq (z)
where Pq (z) and Lq (z) are polynomials having the same degree. We can then
build a structure similar to that one built for continuous-time system (see Figure
11.2).
This implies that Cq (z) can be expressed as
cq∞
Cq (z) = (62)
1 + (Cq (z)−1 − c−1
q∞ )cq∞
In the above equation cq∞ = limz→∞ Cq (z). This implies that Cq (z)−1 − c−1
q∞
is a strictly proper transfer function.
Problem 13.9. The structure in Figure 11.6 is defined by the parameters cq∞
and Cq (z)−1 − c−1
q∞ . They are shown for each case in the following table
4z − 1 −0.25
4
z − 0.5 4z − 1
z + 1.2 −10
1
z − 0.8 5z + 6
We observe, in the last case, that the transfer function Cq (z)−1 − c−1
q∞ is un-
stable, this will always happen when the controller is NMP. The disadvantage of
this is that, when the controller output saturates, this transfer function remains
in open loop, and its output grows unbounded.
Problem 13.10.
13.10.1 We use the reaction curve and Cohen-Coon settings, to have a first
set of PID parameters, after some iteration, based on the closed-loop step
response, the following PID controller was chosen.
1.16s2 + 1.68s + 0.35
C(s) = (63)
s(0.1s + 1)
14
Note that a fast pole have been added to make the controller proper (biproper).
13.10.2 The controller in delta form is given by
This digital controller is transformed to the shift form using the MATLAB
command (included in the CD ROM) del2z for ∆ = 0.1 [s]. The controller
has transfer function
With these results, two SIMULINK loops are evaluated: the first one with
the continuous-time PID controller and the second one with the digital
controller (65). A step reference was applied at t = 0 and a step input
disturbance was injected at t = 20 [s]. The outputs of both loops are
indistinguishable, as can be seen in Figure 8. The difference is shown in
Figure 9.
1.4
1.2
Unit step response
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30 35 40
Time [s]
ej ω∆ − 1
≈ jω (66)
∆
In this particular case this is not the case for ∆ = 1, due to the location
of the poles and zeros of C(s).
15
−3
x 10
5
Output difference
−5
−10
−15
0 5 10 15 20 25 30 35 40
Time [s]
Figure 9: Difference in the outputs of the continuous and discrete control loop
outputs described.
Problem 13.11.
13.11.1 The Nyquist diagram is computed (with α = 0.4) for Cq (z)Goq (z)/K,
using MATLAB command freqz5 .
The results are shown in Figure 10
200
100
Imaginary
−100
−200
−3 −2 −1 0 1
Real
Since the open loop has no poles outside the unit disk, and the Nyquist
plot does not encircle the (−1, 0) point, then the closed loop is stable for
K = 1 and α = 0.4. Indeed the stability margins are Mg = 2.43 [dB] and
Mp = 40.66◦.
13.11.2 If we fix K = 2, we can study the effect of α using root locus. We first
need to set the problem in the canonical form 1 + λF (s) = 0. We start
5 MATLAB command dnyquist can also be used.
16
from
2(z − α)
1 + Cq (z)[Go Gh0 ]q (z) = 1 + =0 (67)
(z − 1)(z − 0.7)
After some algebra we finally obtain the canonical form
−2
1+α =0 (68)
z 2 − 0.3z + 0.7
The associated root locus is shown in Figure 11. In this case, we can see
that increasing α from zero the locus will leave the unit disk (one of the
branches leaves through (−1, 0) and the other through (1, 0). Using the
MATLAB command rlocfind, the critical points can be located. In this
way it is found that the critical value for α is 0.7 (the right-hand branch),
the other branch leaves the unit disk when α reaches the value 0.99.
1.5
0.5
Imaginary
−0.5
−1
−1.5
−1 0 1 2
Real
17
10
u[k]
4
0
0 2 4 6 8 10 12
Time [∆]
The loop is then built, with po = 0.1, so as to simulate the closed loop
response for a unit step response. The results are shown in Figure 12.
Figure 12 verifies that a large control effort is required.
13.12.3 With po = 0.1, we draw the Bode diagrams for the plant and the com-
plementary sensitivity. The results are shown in Figure 13.
10
jω
5 |Toq(e )|
0
Magnitude [dB]
−5
−10
|G (ejω)|
−15 oq
−20
−25
−30
50
0
jω
∠ Toq(e )
Phase [°]
−50
−100
jω
∠ Goq(e )
−150
−200
−2 −1 0
10 10 10
Frequency (normalized)
Figure 13: Bode diagrams of the plant and the complementary sensitivity
18
to the difference between the two magnitude curves. Thus, the control
sensitivty has large magnitude at medium and high frequencies.
Problem 13.13. Lemma 13.2 states (equation (13.8.6)) that, if y[k] is the
unit step response, and zo is a plant zero outside the unit circle, then
∞
y[k] (zo )−k = 0 (72)
k=0
This implies that the controller denominator must contain the factor z 10 − 1.
The pulse transfer function of the model is
Boq (z) −0.0141z − 0.0132
Goq (z) = = 2 (74)
Aoq (z) z − 1.846z + 0.8187
The controller is given by
P (z)
Cq (z) = (75)
L(z)
The controller is synthesized using pole assignment. For simplicity, we
choose Acl (z) = z 13 , i.e., we choose all closed-loop poles at the origin. Then
where
19
When Diophantine equation (76) is solved the following results are obtained:
and l0 = −1.1928.
A simulation is carried out with this controller, the results are shown in
Figure 14.
5
Ref. and plant output
−1
0 0.5 1 1.5 2 2.5 3
Time [s]
An alternative approach to solve this problem use the fact that, for this par-
ticular reference, the generating recursive equation is simpler than (73), more
precisely, if we denote by q the forward shift operator, then
Aoq (z) (z − 1)(z 2 − 2 cos(0.2π)z + 1)L̄q (z) +Boq (z)Pq (z) = Acl (z) (84)
L(z)
Since, in this case, n = 2, the degree of Acl (z) has to be chosen at least equal
to 2n + 2 = 6, say we choose Acl (z) = z 6 .
The simplification with respect to the repetitive control approach is that, in
this particular case, we require only two periodic components to build the refer-
ence signal. Hence the Diophantine equation is simpler.
20
Chapter 14 - Solutions
Problem 14.1. If y(t) is the plant unit step response, then
1 0.25 1 0.75
L [y(t)] = Y (s) = Go (s) = − + (1)
s s s+2 s+4
Thus
[Go Gh0 ]q (z) = (1 − z −1 )Z [y(k∆)] = (1 − z −1 )Z 0.25 − e−2k∆ + 0.75e−4k∆
(2)
−x(x − 3)z − (3x − 1)
= 0.25(x − 1) (3)
(xz − 1)(x2 z − 1)
where x = e2∆ .
We see that, provided that x − 3 = 0, the zero, c, is located at
3x − 1 3e2∆ − 1
c= = 2∆ (4)
x(3 − x) e (3 − e2∆ )
Problem 14.2. The continuous time transfer function can be computed using
the MATLAB d2cm command. This yields the following results
∆ [s] Go (s)
1
Problem 14.3. We recall that
Go (jω)
Θ(jω) = (5)
[Go Gh0 ]q (ejω∆ )
We then have
1 0.0048z + 0.0047
a) 0.1
(s − 1)(s + 2) z 2 − 1.9239z + 0.9048
1 0.0308z + 0.0306
c) 0.25
s2 + 0.1s + 1 z 2 − 1.9139z + 0.9753
The frequency description for the three cases can be seen in Figure 1. In all
cases a significant peak originated from the sampling zero appears. This peak
suggests that one should avoid cancelling the sampling zeros during closed-loop
control-system design, otherwise the closed-loop response will exhibit undesirable
inter-sample behavior.
Problem 14.4. We first compute the Laplace Transform of the impulse re-
sponse corresponding to the first-order sample and hold device. This turns out
to be
(1 − e−s∆ )2 ∆s + 1
Gh1 (s) = (6)
∆ s2
We next compute the discrete transfer function for the composed system (first
order hold plus plant model), this is given by Gh1q (z) = [Go Gh1 ]q (z) where
(z − 1)2 ∆s + 1
Gh1q (z) = Z sampled step response of the system Go (s)
∆z 2 s2
(7)
2
20
15
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
150
100
Θ (jω) Case b) ∆=0.2
50
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
Case c) ∆=0.25
50
Θ (jω)
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency ω/ωs
On the other hand, the analogous function, but with a zero order hold is
given by2
0.0048z + 0.0045
Goq (z) = [Go Gh0 ]q (z) = (9)
z2 − 1.856z + 0.8607
We observe that both functions have the same poles (as it should be). How-
ever, the zeros are different. In the zero-order hold case there is one sampling
zero, located at −0.9512, while in the first-order hold case there are two sampling
zeros, located at 0.3663 and at −1.3023. Note that the second of these zeros is
nonminimum phase.
We finally build the two Θ-functions, i.e.,
Go (jω) Go (jω)
Θ(0) (jω) = ; Θ(1) (jω) = (10)
[Go Gh0 ]q (ejω∆ ) [Go Gh1 ]q (ejω∆ )
2 Use MATLAB command c2dm.
3
They are shown in Figure 2. From that figure we observe that the peak in the first
order hold case is one order of magnitude lower than the peak for the traditional
zero order hold case. This is due to the fact that in the second case, the sampling
zero is much closer to the (−1, 0) point than the zeros arising in the first order
hold case.
20
15
(0)
10 Θ (jω)
0
Θ(1)(jω)
−5
0 2 4 6 8 10 12 14
Frequency [rad/s]
Figure 2: Theta functions for the zero- and the first-order holds
The difference observed in the magnitudes of the peaks may suggest that the
control design will be facilitated if one uses a first order hold. However, since
in this case we have a NMP sampling zero, this zero cannot be canceled by the
controller. Hence, zero tracking error can only be achieved after two sampling
periods, which is also the case when the zero-order hold is used and a dead-beat
control is synthesized.
Caution must be exercised when using MATLAB with the first-order hold in
command c2dm because, at least in version 5.3, it appears to yield erroneous
results. SIMULINK however, implements the correct hold.
Problem 14.5. We observe that the system has a NMP zero at s = 4. A NMP
zero also appears in the discrete-time domain, as seen in the pulse function
−0.0396z + 0.0484
Goq (z) = (11)
z 2 − 1.7700z + 0.7788
where the NMP zero is located at z = 1.2235. Note that the system is stable and
there are no sampling zeros.
14.5.1 Since the reference is a periodic signal, we aim for a repetitive controller.
This is designed using pole assignment with cancellation of the plant poles.
We then have that the appropriate Diophantine equation is
4
where
and
14.5.2 The above controller is used in a simulation with the triangular refer-
ence. The results are shown in Figure 3. These results indicate perfect
steady-state reference tracking, after an initial transient which lasts ten
samples. We also observe that the inter-sample errors are very small.
This is due to the fact that there is no zero cancellation.
Another interesting feature of this result is observed when we plot together
the plant input and the plant output, as shown in Figure 4. Here we see
that the non-minimum phase behavior of the system is, in some sense,
used by the controller, since when the reference goes up, the controller
goes down and vice-versa.
This is a case where digital control provides a good answer to the design
problem, i.e., when the good is better than the optimum. The optimum
is to achieve zero error at all time. Since the reference is periodic with
frequency ωo , continuous time design and the Internal Model Principle
would require that the sensitivity be zero at an infinite number of values
(s = ±kjωo , k ∈ N). The discrete design instead aims at achieving zero
error only at some instants (in this case, equivalent to 10 frequencies). Of
course, if we increase the sampling period, i.e., we require zero error at a
smaller number of points, then the inter-sample performance deteriorates.
Problem 14.6. Basically each hold device provides a way to build a continuous
time signal from a discrete-time sequence. However, when modeling any hold
device, a unit impulse sampler is a common feature to describe the energizing
of the sequence of numbers.
14.6.1 The transfer function from u[k] to the system sampled output y[k] can
be computed as the Z-transform of the sampled output when the input is
a unit Kronecker delta (with zero initial conditions). Since the proposed
5
1.5
−0.5
−1 r[k]
−1.5
0 0.5 1 1.5
Time [s]
20
10
Ref. and plant input
−10
10r[k]
−20 u(t)
−30
0 0.5 1 1.5
Time [s]
generalized sample and hold model includes an impulse sampler, then the
Kronecker delta transforms into a Dirac delta. Thus the sampled plant
output is the sampled response of Go (s)Ghg (s) to a unit Dirac delta. Hence
(14.9.5) holds.
14.6.2 Let us define a pulse, starting at t = to with width α and unit height, as
−sto 1 − e−sα
p(t − to ) = (µ(t − to ) − µ(t − to − α) =⇒ L [p(t − to )] = e
s
(18)
Then, the impulse response hhg (t) given in Figure 14.9 can be described
as
m
∆
hhg (t) = gi p t − (i − 1) (19)
i=1
m
6
Then, taking the Laplace transform we obtain
m
∆
∆
1 − e−s m
−s(i−1) m
Ghg = L [hhg (t)] = gi e (20)
i=1
s
Problem 14.7. Consider equations (14.9.7) and (14.9.8). The state at time
t can be computed from
t
x(t) = eA(t−to ) x(to ) + eA(t−τ ) Bu(τ )dτ (21)
to
t−to
= eA(t−to ) x(to ) + eA(t−τ ) Bm(to + τ )dτ (22)
0
Hence the integral interval in (23) can be split into subintervals, thus
∆ m
i∆
m
eA(∆−τ )Bm(k∆ + τ )dτ = u[k] eA(∆−τ ) Bdτ (25)
(i−1)∆
0 i=1 m
A∆ A∆
Γi+1 = e− m Γi ; Γ1 = eA∆ A−1 (I − e− m )B (26)
Problem 14.8. The continuous time transfer function Go (s) can be computed
using the MATLAB ss2tf command, leading to
−s + 1
Go (s) = (27)
s2 + 3s + 2
14.8.1 The pulse transfer function, for ∆ = 0.1, is given by (use MATLAB
c2dm command)
−0.0816s + 0.0902
Goq (z) = [Go Gh0 ]q (z) = (28)
s2 − 1.7236s + 0.7408
7
14.8.2 The pulse transfer function has a zero at z = 1.1057 and poles at z =
0.9048 and z = 0.8187.
14.8.3 We observe that the generalized pulse transfer function is given by
m
Ggq (z) = gi G(i)
gq (z); G(i)
gq (z) = Cq (zI − Aq )
−1
Γi (29)
i=1
The above equation says that Ggq (z) has the same poles3 as Goq (z) and
its zeros can be fully or partially manipulated (depending on the value of
m) by choosing convenient values for the coefficients g1 , g2 , . . . , gm .
In our case m = 2, and
T T
Γ1 = 0.9512 0.4524 ; and Γ2 = 1 0.5 ; (30)
Thus
−0.0364z + 0.0409 −0.0452z + 0.0493
G(1)
gq (z) = ; G(2)
gq (z) =
z2 − 1.7236z + 0.7408 z2− 1.7236z + 0.7408
(31)
Problem 14.9. The apparent advantages in using generalized holds are at least
counterbalanced by the fact that the controller output u in [k∆ (k + 1)∆) is
modulated by the hold function hgh (t). Thus, when the loop is in steady state
for constant references and disturbances, the controller output is a constant, and
the plant input, m(t) is a periodic signal, with period ∆. This input forces a
periodic component, with the same period, at the plant output. The sampling
process does not see this component, because of the stroboscopic effect, and hence
folds this component back into the low frequency region.
Problem 14.10. We can obtain a minimal prototype controller using pole as-
signment for the plant given by (32). We choose a controller which cancels the
plant pole, thus the closed loop polynomial is given by Acl (z) = z(z − 0.8173),
and the controller is
10(z − 0.8173)
Cq (z) = (33)
z − 1)
3 Except for cancellation.
8
This controller yields a complementary sensitivity Toq (z) = 1/z.
We next simulate two control loops, the first one is a pure discrete control
loop which basically implements the above To q(z). The second loop is the hybrid
control loop with the generalized sample and hold mechanism. In both cases a
unit step reference was applied at time t = 0.1 [s]. The results are shown in
Figure 5, where the continuous time plant output, y(t) and the sampled output,
y[k] have been plotted.
−2
y(t), y[k]
−4
−6
−8
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]
We observe from Figure 5 that although there are zero control errors at
sampling instants, the inter-sample signal strongly deviates from the desired
set-point. Another significant feature is that a significant undershoot appears,
i.e. although the generalized hold was designed such that Ggq (z) has no zeros
outside the unit circle, the undershoot is still present in the continuous time
output. To understand that, we consider the plant with transfer function Go (s)
and the plant input m(t). We note that Y (s) = Go (s)M (s) and, since y(t) is
bounded, then its Laplace transform convergence region is defined by s > 0,
hence
∞
Y (1) = Go (1)M (1) = y(t)e−t dt = 0 (34)
0
This equation says that y(t) has to be negative to satisfy the above equa-
tion. The balance has to be achieved initially, since later on the factor e−t will
make any area contribution insignificant.
9
Chapter 18 - Solutions
Problem 18.1. We will solve this problem using a step by step procedure. In
each case the solutions will be built using MATLAB
1
We also observe that
f (0) = αo + β2 (7)
f˙(0) = 2β1 (8)
f¨(0) = −4β2 (9)
18.2.1 A state space model to generate f (t) can be obtained by using the gen-
erating polynomial to build a differential equation
d3 f (t) df (t)
+4 =0 (10)
dt3 dt
18.2.2 A state observer which leads to negligible error after 2 [s] can be built
if we choose the observer poles, for instance, at s = −10, s = −12 and
s = −15. This leads to E(s) = (s + 10)(s + 12)(s + 15) = s3 + 37s2 +
450s + 1800. We can use the MATLAB command place, to design the
observer as follows:
2
Similarly, multiplying (14) by cos(2t), (15) by sin(2t) and making a linear
combination of both results we obtain
The observer was simulated and the results are shown in Figure 1, from
where it can be seen that the estimates are unbiased. For this example we
used αo = −1, β1 = 2 and β2 = 3.
20 10 10
15 8 5
0
10 6
αo β1 −5 β2
5 4
−10
0 2 −15
−5 0 −20
0 1 2 0 1 2 0 1 2
Time [s] Time [s] Time [s]
Problem 18.3. For the given transfer function, we can build the state space
description using the MATLAB command tf2ss. This leads to (we only need
matrices Aq and Cq )
· ¸
1.4 −0.48 £ ¤
Aq = ; Cq = 1 0.8 (21)
1 0
18.3.1 We set the two observer poles at z = 0. The observer gain matrix J can
then be computed using the following MATLAB command:
>>J=(place(Aq’,Cq’,[0 0]))’
3
Problem 18.4. If we denote by x(t) = K the constant to be determined, and
by y(t) the noisy measurement, we have the following state space model
ẋ(t) = 0 (22)
y(t) = x(t) + v(t) (23)
where v(t) is the measurement noise. Then a suitable state space model is de-
scribed by
A = 0; B = 0; C = 1; D=0 (24)
If the observer gain is J = β, then the observer is given by
β
X̂(s) = (sI − A + JC)−1 JY (s) = (X(s) + V (s)) (25)
s+β
If X(s) = K/s then
K K β
X̂(s) = − + V (s) (26)
s s+β s+β
· ¸
β
x̂(t) = K − Ke−βt + L−1 V (s) (27)
s+β
| {z }
vf (t)
We see that the observed state has two error components: one decays to zero
with time and the other is the filtered noise.
We first consider β = 5. If v(t) = sin(0.5t) then the filtered noise is
5
vf (t) = √ sin(0.5t − arctan 0.1) ≈ 0.997 sin(0.5t − 0.1) (28)
0.25 + 25
This is a significant error. However, if β = 0.1, then the filtered noise is
0.1
vf (t) = √ sin(0.5t − arctan 5) ≈ 0.196 sin(0.5t − 1.37) (29)
0.25 + 0.01
which is a much smaller error. However when β = 0.1, the other error com-
ponent (e−βt ) decays much slower. This suggests the existence of a trade off
between noise immunity and speed.
Problem 18.5. We first build a state space description for the plant and the
disturbance. If the plant state is xp (t) and the disturbance generating model
state is xd (t), then
· ¸ · ¸· ¸ · ¸
ẋp (t) −2 2 xp (t) 1
= + (30)
ẋd (t) 0 0 xd (t) 0
· ¸
£ ¤ xp (t)
y(t) = 1 0 (31)
xd (t)
4
18.5.1 The observer gain J can be computed using the following MATLAB com-
mand:
leading to J = [6 20]T .
18.5.2 We can only allocate one closed loop pole, since the disturbance state
is uncontrollable. Say we want to shift the plant pole from s = −2 to
s = −12. This is achieved by choosing k1 = 5. Then the complete feedback
gain vector becomes £ ¤ £ ¤
K = k1 1 = 5 1 (32)
18.5.3 The controller state space model is defined by the 4-tuple (A − JC − BK,
J, K, 0), hence the controller transfer function C(s) = P (s)/L(s) is ob-
tained with
>>[P,L]=ss2tf(A-JC-BK,J,K,0); Cont=tf(P,L);
>>Go=tf(2,[1 2]);To=minreal(Go*Cont/(1+Go*Cont);
This yields
100s + 480
To (s) = (33)
(s + 12)(s2 + 8s + 40)
thus the closed loop polynomial is equal to the complementary sensitivity
denominator (since there is no pole-zero cancellation).
Problem 18.6. We first use the MATLAB command c2dm, to obtain [Go Gh0 ]q (z)
leading to
0.2212
[Go Gh0 ]q (z) = 2 (34)
z (z − 0.7788)
18.6.1 The state space description for the sampled data transfer function can
be obtained using the MATLAB command tf2ss, leading to
0.7788 0 0 1 £ ¤
Aq = 1 0 0 ; Bq = 0 ; Cq = 0 0 0.2212 (35)
0 1 0 0
18.6.2 To build the observer we choose to set the observer poles at z = 0.4,
z = 0.5 and z = 0.6. We then use the MATLAB command place to
obtain
£ ¤T
J = 0.0854 0.8062 −3.2604 (36)
5
Problem 18.7. With the given nominal model Go (s) and the given controller
C(s) we can compute the closed loop polynomial (we must include the canceled
factor (s + 1)2 ), that leads to
The controller has integration, and this suggests that this was forced via modeling
an input disturbance (as in Problem 18.5). Thus the observer polynomial, E(s),
has degree 3, and the state feedback polynomial, F (s), has degree 2 (the state
associated with the disturbance model belongs to the uncontrollable subspace).
We thus make the following associations.
£ ¤T
J = 0 50.02 50.02 (41)
£ ¤
Ko = 0.96 2.88 (42)
£ ¤
K = 0.96 2.88 1 (43)
Problem 18.8. We will use the strategy described in section §18.7 (in the
book), and in particular the state description in equations (18.7.15) to (18.7.18),
from the book. We first build a state space description for the nominal model,
which is given by (use MATLAB command tf2ss)
· ¸ · ¸
−6 −9 1 £ ¤
Ao = ; Bo = ; Co = 0 6 ; Do = 0 (44)
1 0 0
And the composite description is given by (18.7.17)-(18.7.18), from the book,
with Ad = 0, Cd = 1.
18.8.1 We first use an observer to estimate the composite state, the observer
polynomial is chosen as E(s) = (s + 4)(s + 5)(s + 6) (with this choice,
the observer natural modes satisfy the speed requirement). Thus J =
1 The MATLAB command place has some problems dealing with multiple roots.
6
[1.833 1.5 20]T . We next choose the control poles to be located at s = −4
and s = −5, i.e F (s) = (s + 4)(s + 5) (recall that the disturbance state
is uncontrollable) this is achieved with Ko = [3 11], thus the composite
feedback gain is
K = [3 11 1] (45)
Using the MATLAB function paq, the same controller (46) is obtained.
If one wants to synthesize a minimum order, biproper controller, we must
specify a fourth order closed loop polynomial
The use of a (full order) observer has led to a strictly proper controller.
On the contrary, the choice of a minimum degree closed loop polynomial
in the pole assignment method leads to a biproper controller.
Problem 18.9.
18.9.2 The observer poles are chosen at s = −3 and s = −4. This leads to
7
On the other hand, from the state space model, we have that
This leads to
4
f (t) = y(t) − 2ẏ(t) = 29x1 (t) − 40x2 (t) − 2u(t) (55)
dx̂(t)
= (Ao − JCo )x̂(t) + Bo u(t) + Jy(t) (57)
dt