You are on page 1of 24

22419 Control por Computador

Grado en Ingeniera Electronica Industrial y Automatica


Homework: Design of digital controllers
January 15, 2014
1. Design proportional controllers for the following systems:
(a) G(z) =

1
z0.4

(b) G(z) =

1
(z+0.9)(z0.9)

in order to meet the following specifications where possible (they do not need to be met
necessarily in a simultaneous way):
a damping ratio of 0.7
a steady-state error below 10% due to a unit step
a steady-state error below 10% due to a unit ramp
If the design specification cannot be met, explain why.
Solution:
(a) This is a first-order system. Consequently:
The compensated system, by means of proportional control, will also be a firstorder system. Therefore, there is no oscillatory response and = 0.7 cannot be
met.
Regarding a steady-state error below 10% due to a unit step, esp is given by:
K
K
=
z1 z 0.4
0.6

Kp = lim Q(z) = lim C(z)G(z) = lim


z1

esp

z1

1
0.6
=
=
1 + Kp
K + 0.6
1

Alberto Ortiz

In order to ensure esp 0.1:


esp =

0.6
0.6 0.06
0.1 0.1K + 0.06 0.6 K
= 5.4
K + 0.6
0.1

1
=
The characteristic equation for this system is 1 + C(z)G(Z) = 1 + K z0.4
0 z + (K 0.4) = 0, which limits K to be lower than the critical gain 1.4
for the system to be stable, i.e. the only pole 0.4 K has to be inside the unit
circle and so |K 0.4| < 1. Therefore, this requirement can neither be met by
this system.
Regarding a steady-state error below 10% due to a unit ramp, it is also impossible
since this is a type-0 system (0 poles at z = 1), and, thus, the error against a
unit ramp is not finite.
(b) This is a second-order system. Consequently:
Regarding = 0.7, the closed-loop characteristic equation is 1 + C(z)G(z) =
0 z 2 0.81 + K = 0. The root locus for this system comprises two branches
1
, i.e. 2 poles and 0 zeros. Branches start at poles
since L(z) = (z0.9)(z+0.9)
z = 0.9 (K = 0) and end at z = (K = ). The interval of the real axis
belonging to the root locus is [0.9, 0.9] and the point of departure from the real
d
axis is dK(z)
= dz
(0.81 z 2 ) = 0 2z = 0 z = 0.
dz
Therefore, all the complex roots of the characteristic equation are over the complex axis. The angle of the root leading to = 0.7 must therefore be 2 .
Since the roots of a second-order discrete-time system are z = en T jd T , we
can write the following equation:

d T = n 1 2 T = n T = 2
= 2
= 2.1996
2
1 0.49
1 2

The closed-loop characteristic polynomial for a second-order discrete-time system


is given by z 2 2 cos(d T )en T z + e2n T , so we can state:
e2n T = K 0.81 0.0460 = K 0.81 K = 0.8560
Since the roots of the closed-loop characteristic equation are:
(
0.81 K
K 0.81

z=
j K 0.81 K > 0.81
By imposing
|z| = 1 for the case of complex roots, we derive the critical gain

Kcr as K 0.81 = 1 Kcr = 1.81. Therefore, the requirement = 0.7 can


be met.
As for a steady-state error of 10% due to a unit step:
Kp = lim Q(z) = lim C(z)G(z) = lim
z1

z1

z1

z2

K
K
=
0.81
0.19

1
0.19
=
1 + Kp
K + 0.19
0.19 0.019
0.19

0.1 0.1K + 0.019 0.19 K


= 1.71
K + 0.19
0.1

esp =

Alberto Ortiz

The requirement can be met since K < Kcr .


Finally, regarding a steady-state error of 10% for a unit ramp, since the compensated system is a type-0 system, a ramp cannot be tracked with finite error.
A more sophisticated controller is needed to increase the type of the system.

2. Design a PID controller for G(s) =

1
(s+1)(s+5) :

(a) first in the s-domain, and then transform it to the z-domain using the Tustin design
method (use 20 times the natural frequency to set the sampling period); and
(b) directly in the z-domain (use the same sampling period of the previous point, and
backward-rectangular integration if needed)
so that a zero steady-state error to a step input is attained, the settling time ts is below
2 seconds and the undamped natural frequency is n = 5 rad/sec.
Solution:
(a) We can first select the sampling period as indicated: Ts =
seconds.

2
s

2
20n

2
100

= 0.0628

According to the requirement of zero steady-state error to an input step, we will start
considering a PI controller:
1

C(s) = K +

s + Ti
K
Ti s + 1
s+
=K
=K
=K
Ti s
Ti s
s
s

If we set = 1, i.e. Ti = 1, we can cancel the (s + 1) term in the plant in the


closed-loop transfer function:
K(s+1)

Y (s)
C(s)G(s)
K
K
s(s+1)(s+5)
=
=
=
= 2
K(s+1)
X(s)
1 + C(s)G(s)
s(s
+
5)
+
K
s
+
5s
+K
1 + s(s+1)(s+5)
A prototype second-order system corresponds to a closed-loop transfer function such
2
as s2 +2nn s+2 . From this, we can set K = n2 = 25 and = 25n = 0.5. For this
n
combination of and n , we obtain a settling time of ts = 4n = 1.6 seconds, well
below the 2-second requirement.
The digital controller is obtained transforming the analog controller in accordance to
the Tustin design method (as required):
T = 0.0628, K = 25, Ti = 1

KT z + 1
2Ti (z 1) + T (z + 1)
K
=K+
=K
C(z) = K +
Ti s s= 2 z1
2Ti z 1
2Ti (z 1)
T z+1

K (T + 2Ti )z + (T 2Ti )
25.7850z 24.2150
=
=
2Ti
z1
z1

Alberto Ortiz

With the help of Matlab, we determine the settling time of the compensated system,
which turns out to be 1.6965, so that the PI controller is sufficcient to meet all the
requirements.
Step Response
1.4

1.2

Amplitude

System: sys2
Settling Time (sec): 1.69
0.8

0.6

0.4

0.2

0.5

1.5
Time (sec)

2.5

(b) As before, we start considering a PI controller, using backward-rectangular integration as indicated:




z + TTi 1
z+
C(z) = K
=K
z1
z1
Using T = 0.0628 seconds, the discrete version of the plant G0 (z) is given by:




G(s)
z1
1
z1
0
Z
=
Z
G (z) =
z
s
z
s(s + 1)(s + 5)


z1
1
1
1
=
Z

+
z
5s 4(s + 1) 20(s + 5)


z1
z
z
z
=

+
z
5(z 1) 4(z eT ) 20(z e5T )
z + 0.8820
= 1.7448 103
(z 0.9391)(z 0.7304)
0.0628
If we set = 0.9391, i.e. TTi 1 = 0.9391 Ti = 10.9391
= 1.0312, we can
cancel, in the closed-loop transfer function, the (z 0.9391) term (i.e. the slowest

Alberto Ortiz

pole) of the plant:


3

(z+0.8820) z0.9391
K 1.744810
Y (z)
C(z)G(z)
(z0.9391)(z0.7304)
z1
=
=
1.7448103 (z+0.8820) z0.9391
X(z)
1 + C(z)G(z)
1 + K (z0.9391)(z0.7304) z1

1.7448 103 K(z + 0.8820)


(z 1)(z 0.7304) + 1.7448 103 K(z + 0.8820)
1.7448 103 K(z + 0.8820)
= 2
z + (1.7448 103 K 1.7304)z + (0.7304 + 1.5389 103 K)

Using n = 5 and T = 0.0628, the characteristic polynomial for the discrete-time


second-order system prototype turns out to be:
p
z 2 2 cos(d T )en T z + e2n T = z 2 2 cos(0.3140 1 2 )e0.3140 z + e0.6280
From the coefficients of the same power of z, we can state a set of equations to
simultaneously discover the values of K and :
p
2 cos(0.3140 1 2 )e0.3140 = 1.7448 103 K 1.7304
e0.6280 = 0.7304 + 1.5389 103 K
e0.6280 0.7304
1.5389 103
p
1.7448 0.6280
2 cos(0.3140 1 2 )e0.3140 =
(e
0.7304) 1.7304
p 1.5389
1.1340e0.6280 + 2 cos(0.3140 1 2 )e0.3140 2.5585 = 0

K=

Solving the previous equation numerically with the help of Matlab1 , we obtain =
0.4148 and K = 26.1683. Using the standard formula, the settling time is ts = 4n =
1.9286.
1 solve(1.1340*exp(-0.628*d) + 2*cos(0.314*sqrt(1-d*d))*exp(-0.314*d) - 2.5585 = 0).
We can

also plot the curve y = 1.1340e0.6280 + 2 cos(0.3140 1 2 )e0.3140 2.5585 for an appropriate range
of values, e.g. = 0 : 0.001 : 1 and look for the intersect with the horizontal axis:
0.5
0.4
0.3
0.2
0.1

X: 0.414
Y: 0.0005029

0
0.1
0.2
0.3
0.4
0.5
0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Alberto Ortiz

For a finer analysis, we resort to Matlab and obtain a settling time for this configuration of 1.68 seconds:
Step Response
1.4

1.2

Amplitude

System: sys
Settling Time (sec): 1.68
0.8

0.6

0.4

0.2

0.5

1.5
Time (sec)

2.5

3. Given a system whose transfer function is G(s) = 1/(1 + s), design in the discrete-time
domain a digital PID controller. The system must verify the following specifications: Mp
= 20%, esp = 0, n = 3 rad/sec. Use T = 0.2s and the trapezoidal integration rule.
Solution:
We start calculating the discrete-time transfer function of the plant:






z1
G(s)
z1
1
z1
1
1
G0 (z) =
Z
=
Z
=
Z

z
s
z
s(s + 1)
z
s s+1


T
z1
z
z
z 1 z(1 e )
1 eT
0.1813
=

=
=
=
z
z 1 z eT
z (z 1)(z eT )
z eT
z 0.8187
Since esp is required to be 0, for now, we will not consider more than the proportional and
integral terms i.e. a PI controller. Using the trapezoidal integration rule, the closed-loop

Alberto Ortiz

transfer function turns out to be:






T
T
1 + 2T
z + 2T
1
K (0.2 + 2Ti )z + (0.2 2Ti )
i
i
C(z) = K
=
z1
2Ti
z1
K (0.2+2Ti )z+(0.22Ti )

0.1813

Y (z)
C(z)G(z)
z0.8187
=
= 2Ti (0.2+2Tz1
K
0.1813
i )z+(0.22Ti )
X(z)
1 + C(z)G(z)
1 + 2Ti
z1
z0.8187
(0.2 + 2Ti )z + (0.2 2Ti )
2Ti (z 1)(z 0.8187) + 0.1813K((0.2 + 2Ti )z + (0.2 2Ti ))
(0.2 + 2Ti )z + (0.2 2Ti )
= 0.1813K
2Ti z 2 + (0.1813K(0.2 + 2Ti ) 3.6374Ti ) z + (1.6374Ti + 0.1813K(0.2 2Ti ))
= 0.1813K

The characteristic equation is thus:


2Ti z 2 + (0.1813K(0.2 + 2Ti ) 3.6374Ti ) z + (1.6374Ti + 0.1813K(0.2 2Ti )) = 0







0.1
0.1
z 2 + 0.1813K
+ 1 1.8187 z + 0.8187 + 0.1813K
1
=0
Ti
Ti
From the overshoot required (20%), we set Mp = 10% to compensate the additional zero
introduced by the PI controller, obtain and next the characteristic equation in the discrete
domain:
Mp = e

d = n

1 2

= q

ln 100p
2 + ln2

= 0.5912
Mp
100

p
1 2 = 2.4197

z 2 2 cos(d T )en T + e2n T = z 2 1.2417z + 0.4919 = 0


A number of equations result equating the coefficients of the two characteristic equations:


0.1
[z 1 ] 0.1813K
+ 1 1.8187 = 1.2417
Ti


0.1
1 = 0.4919
[z 0 ] 0.8187 + 0.1813K
Ti
Solving for K and Ti we obtain:


0.1
0.5770
Ti

 = 3.1826
0.1813K
+ 1 1.8187 = 1.2417 K =

Ti
0.1 + Ti
0.1813 0.1
+
1
Ti
0.1 Ti
Ti
= 0.4919 0.3268(0.1 + Ti ) + 0.5770(0.1 Ti ) = 0
0.1 + Ti
Ti
0.05770 + 0.03268
Ti
Ti =
= 0.3612, K = 3.1826
= 2.4926
0.5770 0.3268
0.1 + Ti
0.8187 + 0.5770

Alberto Ortiz

The digital controller is thus:


C(z) =

K (0.2 + 2Ti )z + (0.2 2Ti )


3.1826z 1.8026
=
2Ti
z1
z1

The time response of the compensated system results to be:


Step Response
1.4
System: sys
Peak amplitude: 1.22
Overshoot (%): 22.3
At time (sec): 0.8
1.2

Amplitude

System: sys
Settling Time (sec): 2.26
0.8

0.6

0.4

0.2

0.5

1.5

2.5
Time (sec)

3.5

4.5

where the overshoot is 22.3%, still slightly higher than required despite we have compensated the additional zero of the controller imposing Mp = 10%.
4. Find the discrete-time equivalent of C(s) =
T = 0.1s.

1
0.1s+1

using the Tustin design method and

Solution:
1
The Tustin design method approximates the continuous-time integrator by the following
s
bilinear transformation:
1
T z+1
2 z1
=
s=
s
2 z1
T z+1
In this case, s =

20(z1)
z+1 .

Therefore:


C(z) = C(s)
=
20(z1)
s=

z+1

1
0.1 20(z1)
z+1

=
+1

z+1
3z 1

Alberto Ortiz

5. Find the discrete-time equivalent of C(s) =


and a generic sampling period T .

2
n
2
s2 +2n s+n

using the Euler design method

Solution:
1
The Euler design method approximates the continuous-time integrator by the following
s
bilinear transformation:
1
Tz
z1
=
s=
s
z1
Tz
Therefore:


n2
=
C(z) = C(s)


2
z1
+ 2n z1
+ n2
s= z1
Tz
Tz
Tz
=
=

z 2 2z+1
T 2 z2

((n

T )2

n2
2n (T z 2 T z)
T 2 z2

(n T )2 z 2
T 2 z2
2 2

(n T ) z
+ 2n T + 1) z 2 2(n T + 1)z + 1

s+2
using the following methods and
6. Find the discrete-time equivalent of C(s) = 10 s+10
T = 0.1s.

(a)
(b)
(c)
(d)
(e)

Euler
Tustin
Pole-zero matching
Impulse-invariance design
Step-invariance design

Solution:

(a) We have to apply the transformation s =




C(z) = C(s)

= 10
s=10 z1
z

10 z1
12z 10
z 0.8333
z +2
= 10
=6
z1
20z 10
z 0.5
10 z + 10

(b) We have to apply the transformation s =




C(z) = C(s)

= 10
s=20 z1
z+1

z1
z1
= 10
:
Tz
z

2 z1
z1
= 20
:
T z+1
z+1

20 z1
z+1 + 2
20 z1
z+1 + 10

= 10

22z 18
z 0.8182
= 7.3333
30z 10
z 0.3333

Alberto Ortiz

10

(c) The pole-zero matching method transforms every zero and pole using z = esT . Therefore:
the continuous-time zero at s = 2 maps onto a discrete-time zero at z =
e20.1 = 0.8187
the continuous-time pole at s = 10 maps onto a discrete-time pole at z =
e100.1 = 0.3679
The digital equivalent of C(s) will thus become:
C(z) =

z 0.8187
z 0.3679

where is calculated so that the gains of both controllers match:


=

s+2
lims0 10 s+10
z0.8187
limz1 z0.3679

2
0.1813
0.6321

= 6.9730

z 0.8187
.
z 0.3679
(d) Impulse-invariance design requires that the impulse response of the analog and digital
controllers match. That is to say:
The final controller is thus C(z) = 6.9730

C(z) 1 = Z[C(s) 1] C(z) = Z[C(s)]


Therefore:




s+2
8
z
= 10Z 1
= 10 80
C(z) = Z[C(s)] = Z 10
s + 10
s + 10
z e10T
z
7z 0.3679
z + 0.0526
= 10 80
= 10
= 70
z 0.3679
z 0.3679
z 0.3679
(e) Step-invariance design requires that the step response of the analog and digital controllers match. That is to say:




z
1
z1
C(s)
C(z)
= Z C(s)
C(z) =
Z
z1
s
z
s
Therefore:






z1
C(s)
z1
s+2
z1
A
B
C(z) =
Z
= 10
Z
= 10
Z
+
z
s
z
s(s + 10)
z
s
s + 10




z1
2/10
8/10
z1
2z
8z
= 10
Z
+
=
+
z
s
s + 10
z
z 1 z e10T
10z 8.7358
z 0.8736
=
= 10
z 0.3679
z 0.3679

Alberto Ortiz

11

7. By pole-zero cancellation design a digital PID controller for a DC motor speed control
1
system where the analog plant transfer function is G(s) = (s+1)(s+3)
so that the time
constant is less than 0.3 seconds, the dominant pole damping ratio is of at least 0.7
and the system attains zero steady-state error due to a unit-step input. Use a sampling
frequency s equal to 20 times the damped frequency d .
Solution:
The sampling period has to be set first, and, to this end, we will use the required time
constant and damping ratio:
1
1
n =
= 4.7619 rad/s
n

p
d = n 1 2 = 3.4007 rad/s s = n jd = 3.3333 j3.4007
2
2
T =
=
= 0.0924 s
s
20d
=

If we choose a slightly shorter sampling period T = 0.08 seconds the corresponding time
constant turns out to be 0.2598 seconds, which meets the requirements of < 0.3 and
0.7.
For this sampling period, the discrete plant transfer function is:




G(s)
z1
1
2.8798 103 (z + 0.8988)
z1
0
G (z) =
Z
=
Z
=
z
s
z
s(s + 1)(s + 3)
(z 0.9231)(z 0.7866)
This is a type-0 plant. Consequently, to attain zero steady-state error, we need a controller
which increases the type of the plant by adding a pole at z = 1:
z+
C(z) = K
z1
We can use to cancel the slowest pole z = 0.9231, so that the controller turns out to be
C(z) = K z0.9231
z1 . In this way, the loop transfer function becomes:
z 0.9231 2.8798 103 (z + 0.8988)
z1
(z 0.9231)(z 0.7866)
z
+
0.8988
= 2.8798 103 K
(z 1)(z 0.7866)

L(z) = C(z)G0 (z) = K

The characteristic polynomial of the compensated system is thus:


z 2 + (2.8798 103 K 1.7866)z + (2.5884 103 K + 0.7866)
Using = 0.7, we can build the characteristic polynomial of a standard second-order
discrete-time system as a function of n : 2
z 2 2 cos(d T )en T z + e2n T = z 2 2 cos(0.0571n )e0.0560n z + e0.1120n
2 If we use both and , we obtain the polynomial z 2 1.4756z + 0.5866. Next, K = 1.0800 results from
n
the equation relating the coefficient of z and K = 77.2498 results for the independent terms. The reason for
this discrepancy is that our polynomial does not correspond to a second-order standard system.

Alberto Ortiz

12

Now, equating the coefficients for the same power of z we obtain:


2.8798 103 K 1.7866 = 2 cos(0.0571n )e0.0560n
K=

1.7866 2 cos(0.0571n )e0.0560n


2.8798 103

2.5884 103 K + 0.7866 = e0.1120n


K=

e0.1120n 0.7866
2.5884 103

and thus:
1.7866 2 cos(0.0571n )e0.0560n
e0.1120n 0.7866
=
2.8798 103
2.5884 103
0.0560n
0.1120n
2 cos(0.0571n )e
+ 1.1126e
= 2.6618
Now, with the help of Matlab, we solve numerically the previous equation 3 , obtaining
0.1120n
0.7866
n = 2.0188 rad/s and K = e 2.588410
= 4.2628. The system poles for this value of
3
K are z = 0.8872 j0.1029, which correspond to the continuous-time poles s = T1 ln |z|
j T1 6 z = 1.4127 j1.4428, so that the time constant is = 1/1.4127 = 0.7078 6 0.3
seconds, which does not match the specifications.
Therefore, we have to resort to a more complex controller that compensates the other pole
of the plant and so speed up the system, i.e.
C(z) = K

(z + )(z + )
(z 0.9231)(z 0.7866)
=K
z(z 1)
z(z 1)

In this way:
(z 0.9231)(z 0.7866) 2.8798 103 (z + 0.8988)
z(z 1)
(z 0.9231)(z 0.7866)
z
+
0.8988
= 2.8798 103 K
z(z 1)

L(z) = C(z)G0 (z) = K

The characteristic polynomial of the compensated system is thus:


z 2 + (2.8798 103 K 1)z + 2.5884 103 K
Equating the coefficients for the same power of z of the characteristic polynomial of a
second-order system with = 0.7 we obtain:
2.8798 103 K 1 = 2 cos(0.0571n )e0.0560n K =
2.5884 103 K = e0.1120n K =
3 solve(2*cos(0.0571*wn)*exp(-0.0560*wn)

1 2 cos(0.0571n )e0.0560n
2.8798 103

e0.1120n
2.5884 103

+ 1.1126*exp(-0.1120*wn) = 2.6617)

Alberto Ortiz

13

and thus:
e0.1120n
1 2 cos(0.0571n )e0.0560n
=
2.8798 103
2.5884 103
0.0560n
+ 1.1126e0.1120n = 1
2 cos(0.0571n )e
Using again Matlab to solve numerically the previous equation in n 4 , we obtain n =
e0.1120n
12.7303 rad/s and K = 2.588410
3 = 92.8439. The system poles for this value of K are
z = 0.3663j0.3258, which correspond to the continuous-time poles s = T1 ln |z|j T1 6 z =
8.9109 j9.0853, so that the time constant is = 1/8.9109 = 0.1122 < 0.3 seconds,
which now does match the specifications.
The time response of the compensated system results to be:
Step Response
1.4

System: sys
amplitude: 1.04
Overshoot (%): 4.12
At time (sec): 0.32

1.2
Peak

System: sys
Settling Time (sec): 0.478

Amplitude

0.8

0.6

0.4

0.2

0.2

0.4

0.6

0.8
Time (sec)

1.2

1.4

1.6

which exhibits a quite contained overshoot around 4%, and a settling time below 0.5 seconds.
z+1
8. Given a plant G0 (z) = z(z+2)
(T = 0.05 s), use the direct control design method to derive
z
a controller that makes the compensated system behave similarly to GR (z) = z+0.7
.

Solution:
4 solve(2*cos(0.0571*wn)*exp(-0.0560*wn)

+ 1.1126*exp(-0.1120*wn) = 1)

Alberto Ortiz

14

First, we have to modify GR (z) so as to properly include the unstable zero = 1 and
the unstable pole = 2 of G0 (z):
zr

n
Y

(z pi ) (z )(a0 + + aq z q )

i=1

m
Y

(z cj ) = (z )(b0 + + bp z p )

j=1

m
Y

(z cj )

j=1

where pi and ci are, respectively, the poles and the zeros of the reference system GR (z).
Starting with p = 1, we set q = p 1 = 0 and r = p + 1 PZD[GR (z)] = 2 0 = 2.
Consequently:
z 2 (z + 0.7) (z + 1)a0 z = (z + 2)(b0 + b1 z)z
and:
z 3 + (0.7 a0 )z 2 a0 z = b1 z 3 + (2b1 + b0 )z 2 + 2b0 z
The following equations result equating coefficients of the same power of z:
1 = b1
0.7 a0 = 2b1 + b0 0.7 + 2b0 = 2 + b0 b0 = 2 0.7 = 1.3
a0 = 2b0
a0 = 2b0 = 2.6
In this way:
Qm

j=1 (z

GRC (z) = (z ) Qn

cj ) a0 + + aq z q
zr

i=1 (z pi )

(z + 1)z(2.6)
2.6(z + 1)
=
(z + 0.7)z 2
z(z + 0.7)

Observe that 1 GRC (z) does contain = 2 in the set of zeros:


1 GRC (z) = 1 +

2.6(z + 1)
z 2 + 3.3z + 2.6
(z + 2)(z + 1.3)
=
=
z(z + 0.7)
z(z + 0.7)
z(z + 0.7)

Notice also that PZD[GRC (z)] = 1 PZD[G0 (z)] = 1, so that no extra poles at z = 0
have to be incorporated.
We are not requested to ensure zero steady-state error, but we have to adjust the DC gains
of both systems:
1

GRF (z) = GRC (z),


GRF (z) =

GR (1)
1
1+0.7
= 2.6(1+1)
=
GRC (1)
5.2
1(1+0.7)

0.5(z + 1)
z(z + 0.7)

We can now derive the controller from GRF (z):


0.5(z+1)

C(z) =

1
GRF (z)
z(z + 2) z(z+0.7)
0.5z(z + 2)
0.5z(z + 2)
=
=
= 2
G0 (z) 1 GRF (z)
z + 1 1 0.5(z+1)
z(z + 0.7) 0.5(z + 1)
z + 0.2z 0.5
z(z+0.7)

Alberto Ortiz

15

The compensated system transfer function is thus:


0.5z(z+2)

z+1

Y (z)
C(z)G0 (z)
0.5(z + 1)
0.5(z + 1)
z 2 +0.2z0.5 z(z+2)
=
=
=
= 2
0
0.5z(z+2)
z+1
X(z)
1 + C(z)G (z)
z + 0.7z
z(z + 0.7)
1 + z2 +0.2z0.5 z(z+2)
as expected.
The time responses of the compensated and the reference system are:
Step Response

Step Response

1
0.9
0.8

0.6
Amplitude

compensated
reference

0.2

0.7
Amplitude

compensated
0.4

0
0

0.6

0.2

0.4

0.6

0.8

1.2

1.2

Time (sec)

0.5
Step Response

0.3

0.8

Amplitude

0.4

0.2

reference

0.6

0.1
0.4
0
0

0.2

0.4

0.6

0.8

1.2

0.2

0.4

0.6

0.8

Time (sec)

Time (sec)

As can be noticed, both systems behave similarly, although the compensated system is a
bit faster than the reference system, and presents less overshoot.
9. Use the direct control design method to derive a controller for a plant given by G(s) =
1
5s
so that the compensated system exhibits zero steady-state error for a unit step
10s+1 e
and a settling time ts of about 10 seconds with no overshoot. The sampling period T
must be set to 1 second.
Solution:
On the one hand, the discretized plant transfer function is given by:
#
"


T
z1
G(s)
z1
0.1
0.9516 101 5
0
5s b
1
G (z) =
Z
=
Z
e
=
z
z
s
z
s(s + 0.1)
z 0.9048
On the other hand, the no-overshoot requirement should make us consider as a first option
1
, whose settling time is given by ts = 3 . For ts = 10
a first-order system GR (s) = s+1
10
seconds, = 3 . Using pole-zero matching, GR (z) becomes:
GR (s) =

s= 3 z=esT
3
10
GR (z) =
10s + 3

lim GR (s)

3
0.2592
=
0.3
3
ze
z 0.7408
lim
z1 z e0.3
s0

Alberto Ortiz

16

As there are no unstable poles nor unstable zeros in the plant, the set of zeros of GR (z)
and of 1 GR (z) remain unaltered. However, for the controller to be causal, we need
PZD[GR (z)] PZD[G0 (z)]. Therefore, a delay of five sampling periods has to be incorporated into the reference transfer function:
GRC (z) = GR (z)z 5 =

0.2592
(z 0.7408)z 5

Next, to ensure zero steady-state error against a unit step, GRC (1) = 1, which is effectively
satisfied by GRC (z) as it is. Consequently:
GRF (z) =

0.2592
(z 0.7408)z 5

The controller transfer function can now be obtained:


0.2592

1
GRF (z)
(z 0.9048)z 5 (z0.7408)z5
2.7236z 5 (z 0.9048)
C(z) = 0
=
=
0.2592
G (z) 1 GRF (z)
0.9516 101 1 (z0.7408)z5
z 6 0.7408z 5 0.2592
The corresponding compensated system is given by:
0.2592
Y (z)
=
X(z)
(z 0.7408)z 5
as expected.
The time response of the compensated system is:
Step Response
1.4

1.2

Amplitude

System: sys
Settling Time (sec): 17.7
0.8

0.6

0.4

0.2

10

15

20
Time (sec)

25

30

35

Alberto Ortiz

17

As can be noticed, the settling time of the compensated system is 12.7 seconds, discounting
the inherent delay of the plant of 5 sampling periods. In order to improve the settling time
of the compensated system, we could try with ts = 4 (instead of the standard formula
ts = 3 ). In this way, the following time response is obtained:
Step Response
1.4

1.2

System: sys
Settling Time (sec): 14.5

Amplitude

0.8

0.6

0.4

0.2

10

15

20

25

Time (sec)

which results in a settling time of 9.5 seconds.


10. Use the direct control design method to derive a controller for a plant given by G(s) =
s+2
s(s+1) so that the compensated system matches the following specifications: overshoot
Mp = 20%, settling time ts = 6.67 seconds and steady-state error for a unit input step
esp below 10 %. Set the sampling period according to 10 times the damped frequency d
(of the reference system).
Solution:
On the one hand, we can determine the sampling period using the enumerated performance

Alberto Ortiz

18

requirements:
Mp = e

1 2

= q

ln 100p
2 + ln2

= 0.4559
Mp
100

4
4
n =
= 1.3153
n
ts
p
d = n 1 2 = 1.1706
2
s = 10d = 11.7060 T =
= 0.5367 seconds
s
ts =

Next, the reference system is obtained by means of pole-zero matching over a second-order
system with and n as specified above:
GR (s) =

n2
s2 + 2n s + n2
lim GR (s)

n2 (z + 1)
z 2 2 cos(d T )en T + e2n T

s0

GR (z) =

n2 (z

lim

+ 1)

T )en T

z1 z 2

2 cos(d
0.1763(z + 1)
= 2
z 1.1727z + 0.5253

+ e2n T

On the other hand, the discretized plant transfer function is given by:




z1
G(s)
z1
s+2
0.6581(z 0.3225)
G0 (z) =
Z
=
Z 2
=
z
s
z
s (s + 1)
(z 1)(z 0.5846)
GR (z) must thus be adapted to incorporate the pole of the plant at z = 1:
1 GR1 (z) = (z 1)

z2

0.1763z 2 0.1763
0.1763(z + 1)
GR1 (z) = 1 2
1.1727z + 0.5253
z 1.1727z + 0.5253
0.8237z 2 1.1727z + 0.7016
=
z 2 1.1727z + 0.5253

Now, we have to add an additional pole at z = 0 in order to meet the causality requirement
PZD[GRC (z)] PZD[G0 (z)] = 1:
GRC (z) = GR1 (z)z 1 =

0.8237z 2 1.1727z + 0.7016


z(z 2 1.1727z + 0.5253)

Alberto Ortiz

19

Finally, in order to ensure |esp | 0.1 we must check:










lim e(t) 0.1 lim z 1 E(z) 0.1
z1 z

t

X(z)
1 + C(z)G0 (z)
z
z1
z1
X(z)
z1
1
z1
E(z) =
=
=
=
z
z 1 + C(z)G0 (z)
z 1 + C(z)G0 (z)
1 + C(z)G0 (z)
1
1 GRC (z)
=
= 1 GRC (z)
GRC (z)
1
1 GRC (z) + GRC (z)
1+ 0
G0 (z)

E(z) = X(z) Y (z) = X(z) E(z)C(z)G0 (z) E(z) =

G (z) 1GRC (z)

z1
lim
E(z) = lim 1 GRC (z) = 1 GRC (1)
z1


z1 z




lim e(t) 0.1 1 GRC (1) 0.1 0.9 GRC (1) 1.1




t

In this particular case, GRC (1) = 1. The requirement is thus fulfilled, GRF (z) = GRC (z)
and the controller turns out to be:
C(z) =

1
GRF (z)
1.2516(z 0.5846)(z 2 1.424z + 0.8518)
=
G0 (z) 1 GRF (z)
(z 0.3225)(z 2 0.9964z + 0.7016)

while the transfer function of the compensated system is:


Y (z)
0.8237z 2 1.1727z + 0.7016
=
X(z)
z(z 2 1.1727z + 0.5253)
as expected.
The time response of the compensated system is:

Alberto Ortiz

20

Step Response
1.4

System: sys
Peak amplitude: 1.08
Overshoot (%): 7.66
At time (sec): 3.76

1.2

System: sys
Settling Time (sec): 5.25

Amplitude

0.8

0.6

0.4

0.2

10

12

14

Time (sec)

As can be noticed, the settling time of the compensated system is 5.25 seconds and the
overshoot is 7.66%, both below the required values.
11. Derive a ripple-free deadbeat controller corresponding to the plant G(s) =
and a sampling period T = 1 second.

1
(5s+1)(3s+1)

Solution:
We first determine the discrete-time version of the plant:




z1
G(s)
z1
1
0
G (z) =
Z
=
Z
z
s
z
s(5s + 1)(3s + 1)
0.0280(z + 0.8371)
0.0280z + 0.0234
=
= 2
z 1.5353z + 0.5866
(z 0.8187)(z 0.7165)
To obtain the deadbeat controller, we set as reference system GR (z) = z 1 (the plant has
one zero and two poles). The controller turns out to be:
1
GR (z)
35.7525(z 0.8187)(z 0.7165) z 1
=
G0 (z) 1 GR (z)
z + 0.8371
1 z 1
35.7525(z 0.8187)(z 0.7165)
=
(z + 0.8371)(z 1)

C(z) =

When we combine this controller C(z) with plant G0 (z), intersample oscillations are observed:

Alberto Ortiz

21

Analog system response


1.5
analog simulation
discrete simulation

0.5

0
0

10 11 12 13 14 15 16 17 18 19 20

In order to avoid them, we will require the controller output to keep constant during n = 2
sampling periods, where n must be the degree of the denominator of the plant:
G0 (z) =

0.0280(1 + 0.8371z 1 )z 1
0.0280(z + 0.8371)
=
(z 0.8187)(z 0.7165)
(1 0.8187z 1 )(1 0.7165z 1 )

U (z) = a0 + a1 z 1 = GR (z)
= GR (z)

X(z)
= GR (z)
G0 (z)

1
1z 1
0.0280(1+0.8371z 1 )z 1
(10.8187z 1 )(10.7165z 1 )
1
1

35.7143(1 0.8187z )(1 0.7165z


(1 z 1 )(1 + 0.8371z 1 )z 1

We can choose now:


GR (z) = K(1 + 0.8371z 1 )z 1
U (z) =

35.7143(1 0.8187z 1 )(1 0.7165z 1 )


1 z 1

in order to satisfy U (z) = a0 + a1 z 1 . Next, we finish the derivation of GR (z) requiring


zero steady-state error against a unit step input to determine K:


1
1 1
= 0.5443
GR (1) = 1 K(1 + 0.8371z )z
=1K=
1 + 0.8371
z=1

Alberto Ortiz

22

The controller finally becomes:


GR (z)
1 GR (z)
35.7143(1 0.8187z 1 )(1 0.7165z 1 ) 0.5443(1 + 0.8371z 1 )z 1
=
(1 + 0.8371z 1 )z 1
1 0.5443(1 + 0.8371z 1 )z 1
19.4601(z 0.8187)(z 0.7165)
=
(z + 0.4557)(z 1)

C(z) =

G0 (z)

The step response of the compensated system is now:


Analog system response
analog simulation
discrete simulation

1.4

1.2

0.8

0.6

0.4

0.2

0
0

10 11 12 13 14 15 16 17 18 19 20

As can be noticed, intersample oscillations have disappeared.


12. Find the direct form I, the direct form II, the parallel form and the cascade form for
1.4z 2 1.12z
controller C(z) = 2
.
z 1.6z + 0.6
Solution:

Alberto Ortiz

23

(a) Direct form I:


C(z) =

1.4z 2 1.12z
U (z)
1.4 1.12z 1
=
=
z 2 1.6z + 0.6
1 1.6z 1 + 0.6z 2
E(z)
(1 1.6z 1 + 0.6z 2 )U (z) = (1.4 1.12z 1 )E(z)
u[k] = 1.6u[k 1] 0.6u[k 2] + 1.4e[k] 1.12e[k 1]

(b) Direct form II:


C(z) =

1.4 1.12z 1
U (z) F (z)
=
1 1.6z 1 + 0.6z 2
F (z) E(z)

U (z)
= 1.4 1.12z 1 U (z) = (1.4 1.12z 1 )F (z)
F (z)
F (z)
1
=
E(z) = (1 1.6z 1 + 0.6z 2 )F (z)
1
E(z)
1 1.6z + 0.6z 2
e[k] = f [k] 1.6f [k 1] + 0.6f [k 2]
u[k] = 1.4f [k] 1.12f [k 1]
f [k] = e[k] + 1.6f [k 1] 0.6f [k 2]
u[k] = 1.4f [k] 1.12f [k 1]
(c) Parallel form:
1.12z 0.84
1.12z 0.84
1.4z 2 1.12z
= 1.4 + 2
= 1.4 +
2
z 1.6z + 0.6
z 1.6z + 0.6
(z 1)(z 0.6)
1
2
= 1.4 +
+
z 1 z 0.6

1.12z 0.84
1 = (z 1)
= 0.7
(z 1)(z 0.6) z=1

1.12z 0.84
= 0.42
2 = (z 0.6)
(z 1)(z 0.6) z=0.6
0.7
0.42
C(z) = 1.4 +
+
z 1 z 0.6

C(z) =

C(z) =

U (z)
0.7z 1
0.42z 1
U (z) = 1.4E(z) +
E(z) +
E(z)
1
E(z)
1z
1 0.6z 1
|
{z
} |
{z
}
U1 (z)

u1 [k] = u1 [k 1] + 0.7e[k 1]
u2 [k] = 0.6u2 [k 1] + 0.42e[k 1]
u[k] = 1.4e[k] + u1 [k] + u2 [k]

U2 (z)

Alberto Ortiz

24

(d) Cascade form:





1.4z 2 1.12z
z(z 0.8)
z
z 0.8
C(z) = 2
= 1.4
= 1.4
z 1.6z + 0.6
(z 1)(z 0.6)
z 1 z 0.6
| {z } | {z }
C1 (z)

C2 (z)

U (z)
U (z) = 1.4C1 (z)C2 (z)E(z)
C(z) =
E(z)
10.8z 1
10.6z 1 E(z)
= 1z1 1 U2 (z)

U2 (z) = C2 (z)E(z) =

u2 [k] = 0.6u2 [k 1] + e[k] 0.8e[k 1]

U1 (z) = C1 (z)U2 (z)

u1 [k] = u1 [k 1] + u2 [k]

U (z) = 1.4U1 (z)

u[k] = 1.4u1 [k]

You might also like