Vut Notes Csy4701
Vut Notes Csy4701
VUT
Vaal University of Technology
EIDBS4 Chapter 1: Sampled Data Systems Page 1-1
Digital to analog
Computer Plant
converter
Desired Actual
output Output
Analog to digital
Transducer
converter
Figure 1-1
The sampling process implies that analog signals be sampled every T seconds and
converted into binary numbers. To ensure a good duplication of the analogue signal,
two aspects are important.
Firstly, the sampling rate must be chosen such that the frequencies contained in the
analog signals presented to the sampling unit, will be adequately reproduced, and
furthermore to ensure that the system remains stable. Secondly the number of binary
bits that are used to digitise the samples, should adequately represent the analogue
values.
For the reconstruction process, a zero order hold circuit is typically used. The raw
signal delivered by the zero order hold circuit still contains high frequencies as a
consequence of the spectrum repetition inherent to the original sampling process, and
these may be cancelled by a low pass filter.
A simplified illustration of the sampling and reconstruction process is given in
Figure 1-2. The signal x(t) is sampled and immediately reconstructed to produce the
signal xR(t).
x(t) xR (t)
T sek
Figure 1-2
EIDBS4 Chapter 1: Sampled Data Systems Page 1-2
k
k=0
1.3.2 Step function
u(k)
The step function u(k) is defined as follows:
u(k) = 0, k<0 1
u(k) = 1 k0
k
k=0
1.4 Z transform
Definition of the z-transform
The z transform X(z) = Z{x(k)} of a digital signal x(k), is defined as:
Example 1-1 Determine the sum of the series: 1/2 + 1/4 + 1/8 + 1/16 + ...........
Let S = 1/2 + 1/4 + 1/8 + 1/16 + ...........
1/2S = 1/4 + 1/8 + 1/16 + .........
S - 1/2S = 1/2
1/2S = 1/2
S = 1
Example 1-2 Determine the z transform of the function x(k) = (kT):
X(z) = 1 + 0z –1 + 0z –2 +..... x(k)
1
X(z) = 1 + 0 + 0 + ….. k
X(z) = 1
Example 1-3 Determine the z transform of the function x(k) = u(kT) .
X(z) = 1 + 1z –1 + 1z –2 + 1z –3 +........
X(z) = 1 + 1/z + 1/z2 + 1/z3 +....... x(k)
(1/z)X(z) = 2 3
1/z + 1/z + 1/z +..... 1
X(z) – (1/z)X(z) = 1 k
z
X(z) =
z1
Example 1-4 Determine the z transform of the function x(k) = ak , for k 0.
X(z) = a0 + a1z –1 + a2z –2 + a3z –3 + .........
X(z) = 1 + (a/z) + (a/z)2 + (a/z)3 + ......
x(k)
(a/z)X(z) = (a/z) + (a/z)2 + (a/z)3 +......
X(z) – (a/z)X(z) = 1 1
X(z)[(1 – (a/z)] = 1
X(z) = 1/[1 – (a/z)]
z k
X(z) =
z a
Example 1-5 Determine the z transform of the function x(k) = sin(k), for k 0.
jk jk Euler’s rule: x(k)
X(z) = Z{sin(k)} = Z e e
jx -jx
sinx=(e – e )/j2 1
j2 cosx=(ejx + e-jx)/2 k
k
= Z e jk e jk = Z e j Z e j
1
j2
1
j2
k
2 3
z e j e j j2
1 z z z ze
j
ze
j
= = =
j2 z e j z e j j2 z e j z e j z e jθ z e jθ
zsin a very important result as well as the corresponding
=
jθ jθ result: Z{cos k} = (z2 – zcos)/(z – ej)(z – e–j)
z e z e
= (z2 – zcos)/(z – 1)(z – 1–)
= zsin
= zsin
= zsin
2 j j 2
z ze ze 1 z 2 2z e j e j 2 1 z 2zcos 1
EIDBS4 Chapter 1: Sampled Data Systems Page 1-4
Example 1-7 Determine the z transform of a) x(k) = u(k – 3) and b) x(k) = u(k + 3).
a) X(z) = Z{u(k – 3)} = z –3 Z{u(k)} = z –3 [z/(z – 1)] = z –2 /(z – 1).
b) X(z) = Z{u(k + 3)} = z3{Z[u(k)] – [x(0) + x(1) z –1 + x(2) z –2 ]}
= z3{z/(z–1) – [1 + z –1 + z –2 ]} = z4/(z – 1) – z3 – z2 – z
1
z 1
0.792z 2
lim y(kT) lim (1 z )Y(z) = lim
k z 1 z 1 z 2
(z 1)(z 0.416z + 0.208)
2
= lim [0.792z/(z – 0.416z + 0.208)] = 0.792/(1 – 0.416 + 0.208) = 1
z1
EIDBS4 Chapter 1: Sampled Data Systems Page 1-6
and B* = 0.70712.356r
(note: we will never calculate B* as B* is just the conjugate of B).
Y(z)/z = 2/(z – 1) + 0.7071– 2.356/(z – 0.70710.7854)
+ 0.70712.356/(z – 0.7071– 0.7854)
Y(z)=2z/(z – 1) + (0.7071– 2.356)z/(z – 0.70710.7854)
+ (0.70712.356)z/(z – 0.7071– 0.7854)
k
y(k) = 2 + 20.7071(0.7071) cos(0.7854k – 2.356)
(az (a z
using 2ab k cos(k ) (Table 1-1)
z b z b
Exercise
1-1 Determine the z transform of the following functions:
a) f(k) = ke – 3k b) f(k) = ksin2k c) f(k) = e – 2k sin3k
Ans: a) f(k) = k(e – 3)k F(z) = ze – 3/(z – e – 3)2 using kak z/(z–a)2 table 1-1
b) F(z) = 1/j2Z{ke j2k – ke – j2k} = z/j2[ej2/(z – ej2)2 – e – j2 /(z – e – j2 )2]
= [z(z2 – 1)sin2]/(z2 – 2zcos2 + 1)2
c) F(z) = ze – 2 sin3/(z2 – 2ze – 2 cos3 + e – 4) from table 1-1 with T=1
1-2 Find the z transform of the following sequence:
f(k) = 1 for k even (0, 2, 4...) and f(k) = –1 for k odd (1, 3, 5..).
Ans: F(z) = 1 – z –1 + z –2 – z –3 + z –4 – z –5 + .....= z/(z+1)
(interestingly, when z = 1 then 1 – 1 + 1 – 1 + 1 – 1 + ........ = ½ )
1-3 Determine the z transform of the following functions:
a) F(s) = 1/(s+1)(s+2) b) F(s) = 1/s2(s+1)
c) F(s) = 10/s(s+5)2 d) F(s) = 5/s(s2+2)
Ans: a) F(s) = 1/(s+1)(s+2) = 1/(s+1) – 1/(s+2)
F(z) = z/(z – e –1) – z/(z – e –2) = z/(z – 0.3679) – z/(z – 0.1353)
b) F(s) = 1/s2(s+1) = A/s2 + B/s + C/(s+1)
A = 1 B = d/ds[1/(s+1)]|s=0 = [– 1/(s+1)2]|s=0 = –1 C = 1
F(s) = 1/s2 – 1/s + 1/(s+1) F(z) = Tz/(z – 1)2 – z/(z – 1) + z/(z – e-T)
c) F(s) = A/s + B/(s+5)2 + C/(s+5) = 0.4/s – 2/(s+5)2 – 0.4/(s+5)
F(z) = 0.4z/(z – 1) – 2Tze-5T/(z – e-5T)2 – 0.4z/(z – e-5T)
EIDBS4 Chapter 1: Sampled Data Systems Page 1-8
d) F(s) = 5/s(s2 + 2) = 5/s(s + j2)(s – j2) = A/s + B/(s + j2) + B*/(s – j2)
=2.5/s – 1.25/(s + j2) – 1.25/(s – j2) = 2.5/s – 1.252s/(s2 + 2)
=2.5/s – 2.5s/[s2+(2)2]
F(z) = 2.5z/(z – 1) – 2.5(z2 – zcos2T)/(z2– 2zcos2T + 1)
1-5 Solve the following difference equations with the aid of the z transform.
a) x(k+2) – x(k+1) + 0.1x(k) = u(k), x(0) = x(1) = 0.
b) x(k+2) – x(k) = 0, x(0) = 1, x(1) = 0.
Ans a) Z{x(k+2) – x(k+1) + 0.1x(k)} = Z{u(k)}
[z2X(z) – z2x(0) – zx(1)] – [zX(z) – zx(0)] + 0.1X(z) = z/(z–1)
X(z)(z2 – z +0.1] = z/(z–1)
X(z) = z/(z-1)(z-0.8873)(z-0.1127)
X(z)/z = 1/(z-1)(z-0.8873)(z-0.1127)=A/(z-1)+B/(z-0.8873)+C/(z-0.1127)
= 10/(z-1) - 11.46/(z-0.8873) + 1.455/(z-0.1127)
X(z) = 10z/(z-1) - 11.46z/(z-0.8873) + 1.455z/(z-0.1127)
x(k) = 10 - 11.46(0.8873)k + 1.455(0.1127)k
b) Z{x(k+2) – x(k)} = 0
z2X(z) - z2x(0) - zx(1) - X(z) = 0
z2X(z)-z2-X(z)=0
X(z)(z2 - 1) = z2
X(z)/z=z/(z+1)(z-1)=A/(z+1)+B/(z-1)
= 0.5/(z+1) + 0.5/(z-1)
X(z) = 0.5z/(z+1) +0.5z/(z-1)
x(k) = 0.5(-1)k +0.5, note that z/(z+1) = z/[z-(-1)] and use Z-1{z/(z-a)}=ak
EIDBS4 Chapter 1: Sampled Data Systems Page 1-9
1-6 A car is bought with a loan of Po rand. The interest is r percent per month and
the loan is paid down at u rand per month over a period of N months.
a) Write down a difference equation for the outstanding amount p(k).
b) Solve for p(k) by means of the z transform.
c) Solve for the monthly instalment u, if the bond must be settled in N months.
d) Take P0 as R15000, r=0.01(1 percent per month) en N=48 months. Find
the monthly payment.
Ans: a) p(0) = Po
p(1) = p(0) + rp(0) – u
p(2) = p(1) + rp(1) – u
p(k+1) = p(k) + rp(k) – u
p(k+1) = (1 + r)p(k) – u
b) Z{p(k+1)} = Z{(1 + r)p(k) – u}
zP(z) – zp(0) = (1 + r)P(z) – uz/(z–1)
P(z)[z – (1+r)] = zPo – uz/(z–1) where p(0) = initial loan = P0
= z[P0 – u/(z–1)]
= z[P0(z–1) – u]/(z–1)
z[Po (z 1) u]
P(z) =
(z 1)[z (1 r)]
P(z) Po (z 1) u
=
z (z 1)[z (1 r)]
A B
=
z 1 z (1 r)
P (z 1) u
where A = o = u/r
z (1 r) z 1
P (z 1) u
and B = o = (rP0 – u)/r
z 1 z 1 r
P(z) (u/r) (rPo u)/r
=
z z 1 z (1 r)
u z rP u z
P(z) = o
r z 1 r z (1 r)
p(k) = (u/r) + [(rPo – u)/r](1+r)k k0
N
c) p(N) = (u/r) + [(rPo – u)/r](1+r) = 0
u+(rPo–u)(1+r)N = 0
u[1 – (1+r)N] = – rPo(1+r)N
u = – rPo(1+r)N/[1 – (1+r)N]
= rPo(1+r)N/[(1+r)N – 1]
d) u = 0.0115000(1.01)48/[(1.01)48 – 1] = R395
EIDBS4 Chapter 2: Transfer Functions Page 2-1
2. TRANSFER FUNCTIONS
2.1 Transfer function of a zero order hold circuit
Consider again the simplified representation of a zero order hold system of Figure 1-2,
repeated here in Figure 2-1.
xR(t) Figure 2-1
x(t)
x(2T)
x(T)
x(3T)
x(5T)
T sec x(0)
x(4T)
1
L{u(t – a)} = e as
0 T 2T 0 T 2T 0 T 2T s
L{(t – a)} = e as
We may find the Laplace transform of the stepwise reconstructed signal xR(t), in
Equation 2-1, by using the transform pair u(t – a) e as .
1
s
1 e sT e sT e 2sT e 2sT e 3sT
XR(s) = x(0)
+ x(T) + x(2T) + ....
s s s s s s
1 e sT 1 e sT 1 e sT
= x(0) + x(T)e sT + x(2T)e 2sT + ........
s s s
1 e sT
= [x(0) + x(T)e sT + x(2T)e 2sT + ......... ]
s
EIDBS4 Chapter 2: Transfer Functions Page 2-2
1 e sT
XR(s) = X*(s) Equation 2-2
s
where we have defined X(s) = x(0) + x(T)e
– sT – 2sT
+ x(2T)e + .... Equation 2-3
Equation 2-2 suggests that we may visualize the sample and hold process to consist of
two separate processes as depicted in Figure 2-2.
Firstly, producing X*(s) from X(s) (the first block in Figure 2-2), could be viewed as
ideal sampling, because when we take the inverse Laplace transform of X*(s), using
the transform pair (t – a) e – as, we find from Equation 2-3,
The output x*(t) of the ideal sampler is a sequence of impulses, as shown in Figure 2-3.
x*(t)
x(2T)
x(T)
x(3T)
x(4T)
x(0) x(5T)
Figure 2-3
0 T 2T 3T 4T 5T t
Although the impulse sequence x*(t) is never physically present in the A/D or D/A
circuitry, it does offer a valuable model of the ideal sampling process. If we accept the
equivalence of the impulse function (t) in the continuous domain and the impulse
function (kT) in the discrete domain, we could also express the output of the sampler
as,
x(kT) = x(0)(kT) + x(T)(kT – T) + x(2T)(kT – 2T) + ............ Equation 2-5
In a sense then, the ideal sampler has a dual interpretation, on the one hand delivering
a sequence of impulses with strength x(0), x(T), x(2T),..., which may be the input to a
continuous time system or the sampler may deliver the sequence of numbers x(0),
x(T), x(2t), ......, which may be the input to a computational device.
EIDBS4 Chapter 2: Transfer Functions Page 2-3
Secondly, the second block in Figure 2-2 is clearly responsible for transforming the
impulses into steps and must represent the zero order hold action of the sample and
hold process, and we conclude that the transfer function of the zero order hold section
is given by:
1 e sT
GH(s) = Equation 2-6
s
Equations 2-4 and 2-5, provide a very important connection between the continuous
time Laplace domain and the discrete time z domain. We already know that the
Laplace transform of x*(t) is given by Equation 2-3. The z transform of the number
sequence in Equation 2-5, is given by:
X(z) = x(0) + x(T)z – 1 + x(2T)z – 2 + .... Equation 2-7
Comparing Equation 2-7 with Equation 2-3, it becomes clear that X*(s) = X(z), if we
allow for,
z = esT Equation 2-8
The response y(t) can then be determined from the relationship Y(s) = G(s)X(s).
Typically, however, we are only interested in the values of y(t) at the sampling instants
and for that purpose, a perfect sampler is introduced at the output, in synchronism with
the input sampler, to produce the impulse sequence y*(t). In Example 2-1, we will
illustrate the relation between the analog output y*(t) and the digital output y(kT), for a
simple system. In general however, it can be shown that the z transforms of y*(t) and
x*(t), are related by:
So, Equation 2-9 will allow us to describe a continuous time system G(s), as a digital
system G(z), with G(z) calculated as per Equation 2-10. G(z) is called the
pulse transfer function of the system G(s).
EIDBS4 Chapter 2: Transfer Functions Page 2-4
Example 2-1 (Only an illustration) The input signal to the system shown in Figure 2-5,
is x(t) = u(t) and the impulse response of the system is g(t) = e – t u(t). Assume T = 1.
x(t) = u(t) x*(t) y(t) y(t)
–t
g(t) = e u(t)
T=1 T=1 Figure 2-5
a) Determine y*(t) using s transform methods and the relationship Y(s) = G(s)X(s)
b) Determine y(k), using the relationship Y(z) = G(z)X(z).
c) Using the sum of an infinite geometric series, determine X*(s) and G*(s) in closed
form and compare with X(z) and G(z).
a) We will find y(t) = L – 1 {G(s)X(s)}and then synthesize y*(t) from y(0), y(1), y(2), ..
y(t)
x(t) = u(t) x (t) = (t) + (t–1) + (t–2) + ...
*
–t
g(t) = e u(t) y(t)
Y(s)
1
X*(s) = 1 + e – s + e – 2s + ... G(s) = T=1
T=1 s 1
1 1 e s e 2s
Y(s) = G(s)X*(s) = (1 + e – s + e – 2s + ....) = + + + .....
s 1 s 1 s 1 s 1
y(t) = e – tu(t) + e – (t – 1) u(t – 1) + e – (t – 2) u(t – 2) + ......
y(0) = 1, y(1) = e – 1 + 1, y(2) = e – 2 + e – 1 + 1, .....
y*(t) = (t) + (e – 1 + 1)(t – 1) + (e – 2 + e – 1 + 1)(t – 2) + .....
b) Now, let us calculate y(k) using z transform methods.
1 y(k)
G(s) =
x(t) = u(t) x(k) = (k) + (k–1) + (k–2) + ... s 1 y(t) Y(z)
z z
X(z) = 1 + z – 1 + z – 2 + ... = G(z) =
z e1
T=1 z 1 T=1
X(z) Y(z)
G1(s) G2(s)
T T Figure 2-6 b
For the system in Figure 2-6 a) the transfer function G(z) = Y(z)/X(z), is given by:
G(z) = Z{G1(s)}Z{G2(s)} Equation 2-11
= G1(z)G2(z).
For the system in Figure 2-6 b) the transfer function G(z) = Y(z)/X(z), is given by:
G(z) = Z{G1(s)G2(s)} Equation 2-12
= G1G2(z).
It is important to understand the meaning of the notation G1G2(z) and also to realise
that G1G2(z) G1(z)G2(z).
Example 2-2 Determine the transfer function G(z) = Y(z)/X(z) for the system shown
in Figure 2-7.
X(z) Y(z)
1/s 1/(s+1)
T T T
G1(s) G2(s) Figure 2-7
From Equation 2-11: G(z) = Z{G1(s)}Z{G2(s)}
= Z{1/s}Z{1/(s + 1)}
= [z/(z – 1)][z/(z – e–T)]
= z2/(z – 1)(z – e–T)
Example 2-3 Determine the transfer function of the system in Figure 2-8.
X(z) Y(z)
1/s 1/(s+1)
T T
G1(s) G2(s) Figure 2-8
From Equation 2-12: G(z) = Z{G1(s)G2(s)}
= Z{[1/s][1/(s+1)]}
= Z{1/s(s+1)}
= z(1 – e-T)/(z – 1)(z – e-T) from Table 1-1.
EIDBS4 Chapter 2: Transfer Functions Page 2-6
Figure 2-9
C(z) G(z)
= T (z) Equation 2-13
R(z) 1 G(z)
Consider now the more general feedback system shown in Figure 2-10.
H(s)
Figure 2-10
C(z) G(z)
= T (z) Equation 2-14
R(z) 1 GH(z)
EIDBS4 Chapter 2: Transfer Functions Page 2-7
Example 2-4
Determine the transfer function T(z) = C(z)/R(z) for the control system in Figure 2-11.
R(z) C(z)
G(s)=1/s
T T
H(s)=1/(s+1)
Figure 2-11
G(z) = Z{G(s)}
= Z{1/s)}
= z/(z – 1)
GH(z) = Z{G(s)H(s)}
= Z{[1/s][1/(s + 1)]}
= Z{1/s(s + 1)}
z(1 e T )
=
(z 1)(z e T )
G(z)
From Equation 2-14: T(z) =
1 GH(z)
z
= z 1
z(1 e T )
1
(z 1)(z e T )
z
= z 1
(z 1)(z e T ) + z(1 e T )
(z 1)(z e T )
z
= z 1
z 2 z ze T + e T + z ze T
(z 1)(z e T )
z (z 1)(z e T )
=
z 1 z 2 z ze T + e T + z ze T
z(z e T )
=
z 2 2ze T + e T
EIDBS4 Chapter 2: Transfer Functions Page 2-8
P(s)
G(z) = (1 z 1 ) Z Equation 2-15
s
Example 2-6 Refer to the system in Figure 2-14 and assume that T = ln2 sec.
a) Determine the transfer function G(z) = Y(z)/X(z).
b) Determine y(k), if x(k) = u(kT).
c) Calculate the final value of y(k) with the aid of the final value theorem (property 8).
X(z) Y(z)
1 e sT 1
GH(s) = P(s) =
s s +1
T T
Figure 2-14
a) G(z) = (1 – z – 1) Z{P(s)/s}
= (1 – z – 1) Z{1/s(s + 1)}
= (1 – z – 1) [z(1 – e-T)/(z – 1)(z – e-T)] table 1-1 (caution when a 1)
But T = ln2 e = 2 e = ½
T –T
Example 2-7
Refer to the control system in Figure 2-15. Determine the output c(k) if r(k) = u(kT)
and T=1/2 sec.
R(z) C(z)
Zero order hold 1
GH(s) P(s)=
s
T T
G(z)
Figure 2-15
G(z) = (1 – z-1)Z{P(s)/s}
= (1 – z-1)Z{1/s2}
= (1 – z-1)[Tz/(z – 1)2]
= [(z – 1)/z][Tz/(z – 1)2]
= T/(z – 1)
According to Equation 2-13 for a unity feedback system:
G(z)
T(z) =
1 G(z)
= [T/(z – 1)]/[1+T/(z – 1)]
= [T/(z – 1)]/[(z – 1+T)/(z – 1)]
= T/(z – 1 + T)
With T = 0.5: T(z) = 0.5/(z – 0.5)
k
0 1 2 3 4
EIDBS4 Chapter 2: Transfer Functions Page 2-11
Exercise
2-1 The output of a linear time-invariant discrete system is given by the following time
sequence:
c(k) = 1 – e-2kT , k = 0, 1, 2, 3, .....,
when a signal is applied to the input of the system that is described by:
r(k) = 1 for all k 1.
Find the transfer function T(z) = C(z)/R(z).
Ans: C(z) = Z{c(k)} = Z{1 – e-2kT}
= z/(z – 1) – z/(z – e-2T) = [z(z – e-2T) – z(z – 1)]/(z – 1)(z – e-2T)
= z(1-e-2T)/(z-1)(z-e-2T)
and R(z) = Z{1} = z/(z-1)
T(z) = C(z)/R(z) = [z(1-e-2T)/(z-1)(z-e-2T)](z-1)/z
= (1-e-2T)/(z-e-2T)
2-2 Determine C(z)/R(z) for the systems in Figure P 2-1 a) - f). Take T=0.5 sec.
a)
r(t) 1 c(t)
s(s + 2)
T
Figure P 2-1 a)
b)
r(t) c(t)
1 10
s +1 s+ 2
T
Figure P 2-1 b)
c)
r(t) c(t)
1 10
s +1 s+ 2
T T
Figure P 2-1 c)
d)
r(t)
1 e sT 5 c(t)
GH(s)= s(s + 2)
s
T
Figure P 2-1 d)
EIDBS4 Chapter 2: Transfer Functions Page 2-12
e)
r(t) c(t)
1 e sT 5
GH(s)= s(s + 2)
s
T
Figure P 2-1 e)
f)
r(t) c(t)
1 e sT 5
GH(s)= s(s + 1)(s + 2)
s
T
Figure P 2-1 f)
Ans:
a) T(z) = Z{1/s(s+2)} = (1/2)Z{2/s(s+2)} = 0.5z(1 – e–1)/(z – 1)(z – e–1)
= 0.316z/(z – 1)(z – 0.3679)
b) T(z) = Z{[1/(s+1)][10/(s+2)]} = Z{10/(s+1)(s+2)}
= Z{10/(s+1) – 10/(s+2)} = 10z/(z – e–0..5) – 10z/(z – e–1)
= [10z(z – e–1) – 10z(z – e–0.5)]/(z – e–0.5)(z – e–1) = 10z(e–0.5 – e–1)/(z – e–0.5)(z – e–1)
= 2.387z/(z – 0.6065)(z – 0.3679)
c) T(z) = Z{1/(s+1)}Z{10/(s+2)} = z/(z – e–0.5)10z/(z – e–1) = 10z2/(z – e–0.5)(z – e–1)
= 10z2/(z – 0.6065)(z – 0.3679)
d) T(z) = (1 – z–1)Z{(1/s)5/s(s+2)} = [(z – 1)/z]Z{5/s2(s+2)} = [(z – 1)/z]Z{5/s2(s+2)}
= [(z – 1)/z]Z{A/s2 + B/s + C/(s+2)} = [(z – 1)/z]Z{2.5/s2 – 1.25/s + 1.25/(s+2)}
= [(z – 1)/z][2.50.5z/(z – 1)2 – 1.25z/(z–1) + 1.25z/(z – e–1)]
= [(z – 1)/z]{[1.25z(z – e–1) – 1.25z(z – 1)(z – e–1)+1.25z(z – 1)2]/(z – 1)2(z – e–1)}
= [(z – 1)/z]{1.25z[z–e–1 – (z2 – z – ze–1 + e–1)+(z2 – 2z + 1)]/(z–1)2(z–e–1)}
= 1.25z[(z – 1)/z]{[z – e–1 – z2 + z + ze–1 – e–1 + z2 – 2z + 1]/(z – 1)2(z – e–1)}
= 1.25z[(z – 1)/z]{[ze–1 – 2e–1 + 1]/(z – 1)2(z – e–1)}
= 1.25(ze–1 – 2e–1 + 1)/(z – 1)(z – e–1)}
= (0.4598z + 0.3303)/(z – 1)(z – 0.3679)
e) G(z) = (1 – z–1)Z{(1/s)5/s(s+2)} = (0.4598z + 0.3303)/(z – 1)(z – 0.3679)
Prob 2-2d
T(z) = G(z)/[1+G(z)] unity feedback system Equation 2-8
= (0.4598z+0.3303)/(z – 1)(z – 0.3679)/[1+(0.4598z+0.3303)/(z – 1)(z – 0.3679)]
= (0.4598z+0.3303)/(z – 1)(z – 0.3679)/
{[(z – 1)(z – 0.3679)+(0.4598z+0.3303)]/(z – 1)(z – 0.3679)}
= (0.4598z + 0.3303)/[(z – 1)(z – 0.3679) + (0.4598z + 0.3303)]
= (0.4598z + 0.3303)/(z2 – 1.3679z + 0.3679 + 0.4598z + 0.3303)]
EIDBS4 Chapter 2: Transfer Functions Page 2-13
R(s) C(s)
2n
G(s) =
s(s + 2)
Figure 3-1
The character of the natural response of the system depends on the roots of the
characteristic equation (denominator of T(s)). For the case when n > , the roots will
be two conjugate complex numbers p = – + j 2n 2 and p = – – j 2n 2 , as
shown in Figure 3-2.
Im{s}
p Complex s plane
d = 2
n
2
n
d
–
Definition of the
damping ratio Re{s}
–
= cos
= – cos( – )
= – (– /n) Figure 3-2
p
= /n
EIDBS4 Chapter 3: Time Domain Analysis Page 3-2
It is clear from Figure 3-2 that the parameters , d, n, and are interrelated and
two equations that will be useful, are given below.
n = 2 2
d Equation 3-2
and = cos = Equation 3-3
n
A typical step response is shown in Figure 3-3 with overshoot D, rise time tr and
settling time ts, indicated (the three important attributes of the step response).
c(t)
tr Figure 3-3
D
1
t
ts
The maximum overshoot may be found by setting the derivative of c(t) equal to zero.
e t e t
c’(t) = – d cos t + sin t
sin d sin d
e t e t
Thus c’(t) = 0 – d
cos t + sin t = 0
sin d sin d
sin(dt+) = dcos(dt+) tan(dt+) = d/ dt + = tan-1(d/)
Now, tan = d/ tan-1(d/) = dt + =
t = 0 (not what we are looking for)
Next possibility: tan( + ) = d/ tan-1(d/) = + dt + = +
t = /d (this must be the first time that c(t) reaches a maximum)
The corresponding maximum value of c(t) is,
e d e d
c(/d) = 1 – sin = 1 – sin
sin d sin
d
EIDBS4 Chapter 3: Time Domain Analysis Page 3-4
The rise time can be found by setting c(t) = 1. From Equation 3-4,
e t e t
c(t) = 1 – sin t = 1 sin t = 0
sin d sin d
-t
sin(dt + ) = 0 {because e can never be zero}
Now, sin(dt + ) = 0 dt + = 0 t = – /d (not the t we are looking for)
Next angle where sin(dt + ) = 0, occurs when dt + =
t = ( – )/d t = [ – tan – 1(d/)]/d (this must be the first time c(t) reaches 1)
tan 1 d
tr = Equation 3-6
d
The settling time is normally defined as the time it takes for the decaying function e - t
(and the corresponding oscillations) to settle down to 2% of the initial value. This
occurs, from equation 3-4, when e-t = 0.02 or – t = ln(0.02) – 4.
4
ts = Equation 3-7
j Im s j Im z
s z | z | = e – T
e – T
d z = dT
dT
– Re s Re z
EIDBS4 Chapter 3: Time Domain Analysis Page 3-5
c(t)
r(t) 1 e sT 1
GH(s) =
s s(s +1)
T=0.5
G(z)
Figure 3-4
1 1
For this system, G(z) = (1 – z-1)Z
s s(s 1)
1
= (1 – z-1)Z 2
s (s 1)
1 1 1
= (1 – z-1)Z 2
s s (s 1)
z 1 Tz z z
=
z (z 1)2 z 1 (z e T )
z 1 z[T(z e T ) (z 1)(z e T ) (z 1) 2 ]
=
z (z 1) 2 (z e T )
Tz Te T (z 2 z e T z + e T ) z 2 2z 1
=
(z 1)(z e T )
(T -1+ eT )z + (1-eT -TeT )
=
(z 1)(z eT )
G(z)
T(z) =
1 G(z)
(T 1 + e T )z + (1 e T Te T )
(z 1)(z e T )
=
(T 1 + e T )z + (1 e T Te T )
1
(z 1)(z e T )
(T 1 + e T )z + (1 e T Te T )
=
(z 1)(z e T ) + (T 1 + e T )z + (1 e T Te T )
EIDBS4 Chapter 3: Time Domain Analysis Page 3-6
(T 1 + e T )z + (1 e T Te T )
T(z) =
z 2 z e T z + e T + (T 1 + e T )z + (1 e T Te T )
(T 1 + e T )z + (1 e T Te T )
T(z) = Equation 3-9
z 2 (T 2)z + (1 Te T )
Analogously to continuous systems, the denominator of T(z) is called the
characteristic equation of the system. The roots of the characteristic equation, also
called the poles of T(z), completely determines the transient behaviour of the system.
It is always possible to distinguish between two components of a system's response.
One component is associated with the driving force, r(t) in this case, and the natural
component which is governed by the poles of the system.
The roots of the characteristic equation can also be determined without calculating the
total transfer function first. For a unity feedback system the appropriate equation will be:
G(z) + 1 = 0 Equation 3-10
and for the general feedback system:
GH(z) + 1 = 0 Equation 3-11
For example, for the system under consideration:
(T 1 + e T )z + (1 e T Te T )
G(z) + 1 = +1=0
(z 1)(z e T )
(T – 1 + e – T)z + (1 – e – T – Te – T + (z – 1)(z – e – T) = 0
z2 + (T – 2)z + (1 – Te – T) = 0,
which is the desired equation according to the transfer function Equation 3-9.
Now with T = 0.5 sec. the transfer function becomes:
0.1065z 0.0902
T(z) = 2 Equation 3-12
z 15
. z + 0.6967
The characteristic equation is:
z2 – 1.5z + 0.6967 = 0 ,
with roots (poles):
T(z) becomes zero when z = – 0.8469 and this value is called a zero of T(z). If a zero
is between –1 and 0, it has a small effect on the step response while a zero moving
towards z = +1 greatly increases the overshoot. We should therefore be able to specify
a continuous second order system that behaves similarly to the present discrete second
order system and apply Equations 3-5 to 3-7 to estimate the overshoot, the rise time
and the settling time.
EIDBS4 Chapter 3: Time Domain Analysis Page 3-7
We could confirm these findings by applying a step input u(kT) to the system:
0.1065z 0.0902 z
C(z) = T(z)R(z) =
z 2 1.5z + 0.6967 z 1
C(z) = z(0.1065z + 0.0902)/[(z – 1)(z – 0.83470.4544)(z – 0.8347– 0.4544)]
C(z)/z = (0.1065z + 0.0902)/[(z – 1)(z – 0.83470.4544)(z – 0.8347– 0.4544)]
= A/(z – 1) + B/(z – 0.83470.4544) + B*/(z – 0.8347– 0.4544)
A = (0.1065z + 0.0902)/(z2 – 1.5z + 0.6967)|z = 1 = 1
B = (0.1065z + 0.0902)/(z – 1)(z – 0.8347– 0.4544)|z = 0.83470.4544
= [0.1065(0.83470.4544) + 0.0902]/[(0.83470.4544) – 1)
(0.83470.4544) – 0.8347– 0.4544)]
= [0.1744920.22552]/[0.443542.16960.732741.5708]
= 0.53692.7683
C(z)/z = 1/(z – 1) + 0.53692.7683/(z – 0.83470.4544)
+ 0.5369–2.7683/(z – 0.8347– 0.4544)
C(z) = z/(z – 1) + [(0.53692.7683)z]/(z – 0.83470.4544)
+ [(0.5369–2.7683)z]/(z – 0.8347– 0.4544)
c(k) = 1 + 20.5369(0.8347)kcos(0.4544k + 2.7683)
= 1 + 1.0738(0.8347)kcos(0.4544k + 2.7683)
With MATLAB a graph of c(k) can be created with the following statements:
a=[0.1065 0.0902]; b=[1 -1.5 0.6967]; dstep(a,b,30)
The result is shown in Figure 3-5.
EIDBS4 Chapter 3: Time Domain Analysis Page 3-8
From the graph the overshoot, rise time and settling time may now be determined.
The overshoot is approximately 0.3 or 30% - estimated value 28.66%. The rise time
from the graph is 5 samples corresponding to 50.5 = 2.5 sec - estimated value is
2.145 sec. The settling time is difficult to read off from the graph but it should be
approximately 25 sample times which is 250.5 = 12.5 sec. - estimated at 11.07 sec.
c(7) = 1.286
c(14) = 0.9181
Figure 3-5
Figure 3-6
EIDBS4 Chapter 3: Time Domain Analysis Page 3-9
In the case of complex roots, z = b and b = 1 (roots lie on the unit circle), the
transient response is of the form cos(k), illustrated in Figure 3-7.
=T=/2
=T=3/4
=T=/4
Figure 3-7
In the case of complex roots of the form, z=b and b 1 (roots inside or outside the
unit circle), the transient response is of the form bkcos(k), illustrated in Figure 3-8.
b>1
b<1
Figure 3-8
EIDBS4 Chapter 3: Time Domain Analysis Page 3-10
It is very clear that if any roots of the characteristic equation fall outside the unit circle
on the z plane, the transient response does not decay but rather continue to grow. We
therefore come to the conclusion that a stable discrete system cannot have any
poles outside the unit circle.
H(s)
Figure 3-9
RTz
In the case of a ramp function r(t) = Rtu(t), R(z) = , and
(z 1)2
(z 1) RTz
ess = lim
z1 z[1 GH(z)] (z 1) 2
RT
= lim
z1 (z 1)[1 GH(z)]
RT
= lim
z1 [(z 1) (z 1)GH(z)]
RT
= lim
z1 ( z 1)GH(z)
R
=
1 lim (z 1)GH(z)
T
z 1
The velocity error constant Ev is now defined as:
Ev = lim (z 1)GH(z)
1
T z 1
R
and the steady state error: ess = .
Ev
For the quadratic function r(t) = ½Rt2u(t) the acceleration error constant Ea is defined
as:
1
Ea = lim (z 1)2 GH(z)
2 z 1
T
R
and the steady state error: ess = .
Ea
The derivation of Ea is left as an exercise.
Example 3-2
Determine the position, velocity and acceleration steady state errors for the system in
Figure 3-10, for r(t)=u(t), r(t)=tu(t) and r(t)= ½t2u(t), respectively.
R(s) C(s)
1
ZOH G(s)=
s(s 0.5)
T=0.1
G(z)
Figure 3-10
EIDBS4 Chapter 3: Time Domain Analysis Page 3-12
-11 1 -1
1
G(z) = (1 - z )Z = (1 – z )Z
s s(s 0.5) s 2 (s 0.5)
2 4 4
= (1 – z-1)Z
s2 s (s 0.5)
z 1 2Tz 4z 4z
=
z (z 1)2 z 1 (z e 0.5T )
z 1 0.2z 4z 4z
=
z (z 1)2 z 1 (z e 0.05 )
z 1 z[0.2(z e0.05 ) 4(z 1)(z e0.05 ) 4(z 1)2 ]
=
z (z 1)2 (z e0.05 )
0.2z 0.2e 0.05 4(z 2 z e 0.05z + e 0.05 ) 4z 2 8z 4
=
(z 1)(z e 0.05 )
(0.2 4 + 4e 0.05 8)z + (4 4e 0.05 0.2e 0.05 )
=
(z 1)(z e 0.05 )
0.0049177z + 0.0048364
=
(z 1)(z 0.95123)
EP = lim G(z) =
z1
R 1
ess = = =0
1 E 1
P
1
Ev = lim (z 1)G(z)
T z1
1 z 1 0.0049177z + 0.0048364
= lim
0.1 z1 1 (z 1)(z 0.95123)
1 0.0049177z + 0.0048364
= lim
0.1 z1 (z 0.95123)
= 100.2 = 2
R
ess = .= ½ = 0.5
Ev
1
Ea = lim (z 1)2 G(z)
2
T z1
1 (z 1) 2 0.0049177z + 0.0048364
= lim
0.01 z1 1 (z 1)(z 0.95123)
1 (z 1)(0.0049177z + 0.0048364)
= lim = 1000 = 0
0.01 z1 (z 0.95123)
R
ess = .= 1/0 =
Ea
EIDBS4 Chapter 3: Time Domain Analysis Page 3-13
Exercise
3-1 Refer to the system discussed in Example 3-1 and select a few values for k and
calculate c(k). Compare your answers with Figure 3-5.
3-2 The block diagram of a discrete control system is given in Figure P 3-1.
a) Determine the transfer function T(z) of the system if the sampling period
T = 0.1 sec.
b) Calculate the unit step response c(k) for k = 0 to 20.
r(t) c(t)
5
ZOH
s(s + 2)
T
Figure P 3-1
Ans:
G(z) = (1-z-1)Z{(1/s)5/s(s+2)} = [(z-1)/z]Z{5/s2(s+2)}
= [(z-1)/z]Z{5/s2(s+2)} = [(z-1)/z]Z{A/s2 + B/s + C/(s+2)}
= [(z-1)/z]Z{2.5/s2 - 1.25/s + 1.25/(s+2)}
= [(z-1)/z][0.25z/(z-1)2 - 1.25z/(z-1) + 1.25z/(z-e-0.2)]
= [(z-1)/z]0.25z{[(z-e-0.2) - 5(z-1)(z-e-0.2) + 5(z-1)2]/(z-1)2(z-e-0.2)}
= 0.25[z-e-0.2 - 5(z2 - z - ze-0.2 + e-0.2)+5(z2 - 2z + 1)]/(z-1)(z-e-0.2)}
= 0.25[z - e-0.2 - 5z2 + 5z + 5ze-2 - 5e-0.2 + 5z2 - 10z + 5]/(z-1)(z-e-0.2)}
= 0.25[-4z + 5ze-0.2 - 6e-0.2 + 5]/(z-1)(z-e-0.2)}
= 0.25[z(-4 + 5e-0.2) - 6e-0.2 + 5)/(z - 1)(z - e-0.2)}
= 0.25(0.09365z + 0.08762)/(z - 1)(z - 0.8187)
= (0.02341z + 0.02191)/(z - 1)(z - 0.8187)
T(z) = G(z)/[1 + G(z)]
= [(0.02341z + 0.02191)/(z - 1)(z - 0.8187)]/
[1+(0.02341z + 0.02191)/(z - 1)(z - 0.8187)]
= [(0.02341z + 0.02191)/(z - 1)(z - 0.8187)]/
[(z - 1)(z - 0.8187)+(0.02341z + 0.02191)/(z - 1)(z - 0.8187)]
= (0.02341z + 0.02191)/(z2 - 1.8187z + 0.8187 + 0.02341z + 0.02191)
= (0.02341z + 0.02191)/(z2 - 1.795z + 0.8406)
b) C(z) = (0.02341z + 0.02191)/(z2 - 1.795z + 0.8406)R(z)
= (0.02341z + 0.02191)/(z2 - 1.795z + 0.8406)z/(z-1)
= z(0.02341z + 0.02191)/(z-1)(z2 - 1.795z + 0.8406)
Now, {z2 – 1.795z + 0.8406
= (z – 0.91680.2058r )(z – 0.9168– 0.2058r )}
C(z)/z = (0.02341z + 0.02191)/(z – 1)(z – 0.91680.2058r)(z – 0.9168– 0.2058r)
= A/(z – 1) + B/(z – 0.91680.2058r) + B*/(z – 0.9168– 0.2058r)
EIDBS4 Chapter 3: Time Domain Analysis Page 3-14
With the aid of MATLAB for T(z) = (0.02341z + 0.02191)/(z2 - 1.795z + 0.8406):
a=[0 0.02341 0.02191]; b=[1 -1.795 0.8406]; dstep(a,b,100);
EIDBS4 Chapter 4: Stability Analysis Page 4-1
4. STABILITY ANALYSIS
4.1 The Jury stability test
A discrete control system is stable if all the roots of the characteristic equation fall
inside the unit circle on the z plane. The Jury test may be used to confirm stability.
Assume the characteristic equation of a discrete system is given by:
Q(z) = anzn + an-1zn-1 + ......+ a1z + a0 = 0, an > 0. (if an < 0, multiply Q(z) by –1)
We now form the following structure (Jury table) with the coefficients of Q(z)
inverted to form the first row:
a0 a1 ..... an – 1 an A B A B
det = = AD – CB
an an – 1 ..... a1 a0 C D C D
b0 b1 ..... bn – 1 ao an
b0 = = a 0 a0 – an an
bn – 1 bn – 1 ..... b0 an a0
..... ..... ..... ..... ao a n 1
l0 l1 l2 l3 b1 = = a 0 a1 – an an – 1
an a1
l3 l2 l1 l0
m0 m1 m2 ao a1
bn – 1 = = a 0 an – 1 – an a1
an a n 1
ao a n k bo b n k
where bk = , ck = , .. The next b row (bn – 1 to b0) is formed by
an ak bn bk inverting the first b row b0 to bn – 1 Then
the first c row may be calculated from the
two previous b rows, in the same way the
The necessary and sufficient conditions
first b row was determined from the two
for the roots of Q(z), to fall inside or on previous a rows.
the unit circle, are:
1) Q(1) > 0
Q(1) 0 n even
2) (–1)nQ(–1) > 0, which implies
Q(1) 0 n odd
3) | a0 | < an
4) If n > 2, construct the Jury table and determine whether the following
conditions are satisfied:
| b0 | > | bn-1 |, | c0 | > | cn-2 |, ....... | l0 | > | l3 |, |m0| > |m2|
Example 4-2 Use the Jury test to determine values for K that will ensure stability for
the system in Figure 4-1. Assume T = ln2 sec.
B(z) A(z)
R(z) C(z)
1 e sT 1
K
s (s +1)(s + 2)
T T
ZOH
G(z)
Figure 4-1
1 e sT
B(z) = K and A(z) = Z
1 –1 1
. = (1 – z )Z
s (s +1)(s 2) s(s 1)(s + 2)
0.5 1 0.5 z 1 0.5z z 0.5z
A(z) = (1 – z – 1)Z =
s s 1 s 2 z (z 1) z e T z - e- 2T
z 1 0.5z z 0.5z
G(z) = B(z)A(z) = K (z 1)
z z 0.5 z - 0.25
z 1 z[0.5(z 0.5)(z 0.25) - (z 1)(z 0.25) 0.5(z -1)(z 0.5)]
= K (z 1)(z 0.5)(z 0.25)
z
EIDBS4 Chapter 4: Stability Analysis Page 4-3
Jury test:
Q(1) = 1 + 0.125K – 0.75 + 0.0625K + 0.125 > 0 0.1875K > – 0.375 K > – 2
Q(–1) = 1 – 0.125K +0.75 + 0.0625K + 0.125 > 0 for n even (2)
– 0.0625K > –1.875 0.0625K < 1.875 K < 30
and | 0.0625K + 0.125 | < 1 ( | a0 | < an )
0.0625K + 0.125 < 1 and 0.0625K + 0.125 > –1
K < 14 and K > –18
Because this is a second order system (n = 2), the Jury table is not involved.
We therefore conclude that for stability: –2 < K < 14.
Exercise
4-1 A digital control system is described by the following difference equation:
x(k+1) = (0.368 – 0.632K)x(k) + Kr(k),
where r(k) is the input and y(k) is the output. Calculate values for K so that the
system is stable.
EIDBS4 Chapter 4: Stability Analysis Page 4-4
4-2 The block diagram of a sampled data control system is given in figure P 4-1.
r(t) e(t) e*(t) c(t)
Nul orde houbaan K
Zero order hold s(s + 1.5)
T
Ans:
G(z) = (1–z-1)Z{(1/s)K/s(s+1.5)} = (1–z-1)Z{K/s2(s+1.5)} = K(1–z-1)Z{1/s2(s+1.5)}
= K(1–z-1)Z{0.6667/s2 – 0.4444/s + 0.4444/(s+1.5)}
= K[(z–1)/z]{0.6667Tz/(z – 1)2 – 0.4444z/(z – 1) + 0.4444z/(z – e – 1.5T)}
= Kz[(z–1)/z]{[0.6667T(z–e–1.5T) – 0.4444(z–1)(z–e–1.5T) + 0.4444(z–1)2]/(z–1)2(z–e–1.5T)}
= K{[0.6667Tz–0.6667Te–1.5T–0.4444(z2–(1+e–1.5T)z+e–1.5T)+0.4444(z2–2z+1)]/(z–1)(z–e–1.5T)}
= K[(0.6667T+0.4444(1+e–1.5T)–0.8888)z+(–0.6667Te–1.5T–0.4444e–1.5T+0.4444)]/(z–1)(z–e–1.5T)
With T = 1:
G(z) = K[(0.6667+0.4444(1+e – 1.5) – 0.8888)z+(– 0.6667e–1.5–0.4444e–1.5+0.4444)]/(z–1)(z–e–1.5)
= K[(0.6667+0.44441.223–0.8888)z+(–0.66670.2231–0.44440.2231+0.4444)]/(z–1)(z–0.2231)
= K[(0.6667 + 0.5435– 0.8888)z+ (– 0.1487 – 0.0991+ 0.4444)]/(z – 1)(z – 0.2231)
= K(0.3213z + 0.1966)/(z – 1)(z – 0.2231)
1 + G(z) = 0 1 + K(0.3213z + 0.1966)/(z – 1)(z – 0.2231) = 0
(z – 1)(z – 0.2231) + K(0.3213z + 0.1966) = 0
2
Thus Q(z) = z – 1.223z + 0.2231 + 0.3213Kz + 0.1966K
= z2 + (0.3213K – 1.223)z + (0.1966K + 0.2231)
For stability:
Q(1) = 1 + 0.3213K - 1.223 + 0.1966K + 0.2231 > 0
0.5179K > 0 K > 0
Q(–1) = 1 – 0.321K + 1.223 + 0.1966K + 0.2231 > 0
0.1244K < 2.446 K < 19.66
and |0.1966K + 0.2231| < 1
0.1966K + 0.2231 < 1 K < 3.952
and – 0.1966K – 0.2231 < 1 K > – 6.221
Final requirement: 0 < K < 3.952
EIDBS4 Chapter 5: Root Locus Techniques Page 5-1
H(s)
Figure 5-1
C(z) G(z)
The closed loop transfer function is given by: .
R(z) 1 GH(z)
One real pole One real pole and One real pole and Two real poles
one real zero one real zero
Two equal Two complex Two real poles Two real poles
real poles poles and one real zero and one real zero
Figure 5-4
We have confirmed rule 1 for this particular GH(z) and also rule two, as we can see
that the root locus section on the real axis, lies to the left of an uneven number of poles
and zero’s (in this case the pole at z = 0.5). Rule 2 is also evident when we inspect
Figure 5-2. Rule 3 is a consequence of the complex conjugate root theorem from
algebra, which states that if a polynomial has real coefficients, any complex roots will
occur in conjugate pairs. Rule 4 will not be important to us, but it is useful to
determine the asymptotes of root locus sections that branches off to infinity (see for
example Figure 5-2 k). We will make extensive use of rule 5, however, the current
example does not exhibit any breakaway points. We will have the opportunity to
calculate breakaway values in Example 5-1.
Finally, the critical value of K when the root locus crosses the unit circle (this is the
value of K that will cause the system in Figure 5-3 to become unstable) will be
important. For the current system, this will happen when z = – 1 and from the
characteristic equation, z + (K – 0.5) = 0, it follows that the marginal value is K = 1.5
The root locus diagram (corresponding to Figure 5-2 i), is shown in Figure 5-5. The
distance between the zero (–0.5) and any breakpoint (say 0.366), is the radius
0.366– (– 0.5)] = 0.866, of a circle with centre at – 0.5 (the zero). Refer to the Appendix
at the end of Chapter 5 for a proof of the circularity of the root locus. The radius is
also given by [(– 0.5 – 0.5)(– 0.5 – 0.25)] = 0.866
Im z
P
unit circle
|z|=1
– 1.366
– 0.5 0.25 0.5
Re z
0.366
Figure 5-5
P’
The system becomes unstable when the root locus cuts the unit circle at P and P’.
Three methods to calculate K at P or P’:
Method 1:
0.125K(z + 0.5)
The root locus equation is: +1=0
(z 05
. )(z 0.25)
0.125K(z+ 0.5) + (z– 0.5)(z– 0.25) = 0 0.125Kz + 0.0625K + z2 – 0.75z + 0.125 = 0
z2 + (0.125K – 0.75)z + (0.125 + 0.0625K) = 0
We now call the two (complex) roots of this quadratic equation z1,2
(0.125K 0.75) (0.125K 0.75)2 4(0.125 0.0625K)
z1,2 =
2
(0.125K 0.75) j 4(0.125 0.0625K) (0.125K 0.75) 2
=
2
(0.125K 0.75) 4(0.125 0.0625K) (0.125K 0.75) 2
= ±j
2 2
1
| z1,2 | =
1 (0.125K 0.75) 2 [4(0.125 0.0625K) (0.125K 0.75) 2 ] 2
2
1
=
1 (0.125K 0.75) 2 (0.125K 0.75) 2 4(0.125 0.0625K) 2
2
= 4(0.125 0.0625K)2 =
1 1 1
0.5 0.25K
2 2
1
But at P and P’ | z1,2 | = 1, and therefore 0.5 0.25K = 1 which implies that K = 14
2
Thus for stability, K must be smaller than 14 (and larger than zero).
EIDBS4 Chapter 5: Root Locus Techniques Page 5-5
Method 2:
From the characteristic equation: z2 + (0.125K – 0.75)z + (0.125 + 0.0625K) = 0.
Using the fact that for z2 + bz + c = 0, | z | = c (this is ONLY true if the roots
are complex):
| z | = 0.125 0.0625K = 1
0.125 + 0.0625K = 1 K = 14 P
unit circle
Method 3: root locus
1
The radius of the root locus circle is: .866 -
1.366 – 0.5 = 0.866
Cosine rule:
0.866 0.5
(0.866)2 = (0.52 + 12 – 20.51cos
cos = (0.52 + 12 – 0.8662)/20.51
cos = 0.5 = 1.0472r
Thus at P, z = 1( – 1.0472) = 12.0944 1.366
and K = – (z – 0.5)(z – 0.25)/0.125(z + 0.5)
= – (12.0944 – 0.5)(12.0944 – 0.25)/0.125(12.0944 + 0.5) = 14 + j0
Root Locus
The root locus may also be drawn with 1
Matlab. The characteristic equation must
be of the form: q(z) = 1+ ka(z)/b(z). For the 0.5
q(z) under discussion, a(z) = z + 0.5, and
Imaginary Axis
Example 5-2 (Problem 8-23, Automatic Control Systems, B.C. Kuo, 7’th edition,
Chapter 8.). The bock diagram of a discrete control system is shown in Figure 5-6.
a) Construct the root loci for the system in the z plane for K 0, without the zero
order hold when T = 0.5 sec. and then when T = 0.1 sec. Find the marginal values
for K for stability.
b) Repeat part a) when the system has a zero-order hold.
K=0 P1 Re z
– 0.2865 0.2865
Im z
unit circle
| z |=1
0.6065
K P2 K= 1 K=0
K=0 P1 Re z
– 0.7787
0.7787
P2 unit circlel
|z|=1
K K= .08209 P1 1
K=0 K=0 Re z
– 0.4505 0.4285
-1.33
P3
EIDBS4 Chapter 5: Root Locus Techniques Page 5-8
P1
unit circle
0.6065
K K= 1
K=0 K=0 Re z
– 0.8474
–2.487
0.792
P2
EIDBS4 Chapter 5: Root Locus Techniques Page 5-9
Exercise: For example 5-1, find the value of K when the root locus cuts the imaginary
axis. (Ans: let z = ja and from char eq: (0.125 + 0.0625K– a2) + ja(0.125K – 0.75) = 0. Now,
x + jy = 0 implies both x = 0 and y = 0 and therefore 0.125K – 0.75 = 0 and so K = 6)
Appendix: Confirmation of the circular root locus for an open loop transfer function
K(z N)
of the form: G(z) = ,
(z P1)(z P2 )
where N is a real zero, and P1, P2 are real poles of G(z).
The characteristic equation may be found from G(z) + 1 = 0
K(z N)
+ 1 = 0 K(z – N) + (z – P1)(z – P2) = 0
(z P1)(z P2 )
z2 – P1z – P2z + P1P2 + Kz – KN = 0 z2 + (K – P1 – P2)z + (P1P2 – KN) = 0
(K P1 P2 ) (K P1 P2 ) 2 4(P1P2 KN)
z =
2
2
When [(K – P1 – P2) – 4(P1P2 – KN)] < 0, the roots are complex, and are given by:
(K P1 P2 ) 4 (P P KN) (K P P ) 2
z= j 1 2 1 2
2 2
Now let x = Re{z} and y = Im{z} z = x jy,
(K P1 P2 )
x = ………….................………………………………..…… (1)
2
and
4 (P P KN) (K P P ) 2
y= 1 2 1 2 ……....…….................………............. (2)
2
EIDBS4 Chapter 5: Root Locus Techniques Page 5-10
For each value of K, x and y may be calculated from equations 1 and 2, and the
resulting (x,y) pairs could then be plotted in the x-y plane. This curve would
correspond to the root locus in the complex plane. In order to find the relationship
between x and y, the parameter K, must be eliminated from equations 1 and 2.
2
(K P1 P2 ) 2
From (1): x = ……………………....….……….………… (3)
4
and also from (1): 2x = – K + P1 + P2
K = P1 + P2 – 2x …………………………………....…....…....……..…….. (4)
2 4(P1P2 KN) (K P1 P2 ) 2
From (2): y =
4
(K P1 P2 ) 2
y = (P1P2 – KN) –
2
…………………….....………………. (5)
4
Using equations (3) and (4) in equation (5):
y2 = [P1P2 – (P1 + P2 – 2x)N] – x2 = P1P2 – P1N – P2N + 2Nx – x2
y2 + x2 – 2Nx = P1P2 – P1N – P2N
Completing the square in x:
y + x – 2Nx + N2 = P1P2 – P1N – P2N + N2
2 2
x
N
EIDBS4 Chapter 6: Digital Controller Design Page 6-1
Example 6-1
Consider the digital control system shown in Figure 6-1.
R(z) C(z)
Digital 1
ZOH P(s)
controller s(s + 2)
T T
B(z) A(z)
Figure 6-1
Design a digital controller such that the dominant closed loop poles have a damping
ratio of 0.5 and a settling time of 2 sec. The sampling period is T = 0.2 sec. Obtain
the response of the designed digital control system to a unit step input. Also obtain the
static velocity error constant Kv of the system. Assume a first order controller device
with transfer function of the form:
z a
B(z) = K Equation 6-1
z b
By specifying and ts, we have specified the transient response completely, that is d ,
n , and D are also fixed.
EIDBS4 Chapter 6: Digital Controller Design Page 6-2
=2
P
0.8272
–2.579 1 Re z
– 0.876
0.6703
Figure 6-2
EIDBS4 Chapter 6: Digital Controller Design Page 6-3
Values for K and b must now be determined to satisfy the requirement that the roots of
the characteristic equation are z = 0.6703±0.6928r.
We now remember that the roots of the quadratic equation z2 – 2rcosz + r2 = 0,
are z = r±, as (z – r)(z – r– ) = z2 – r(1 + 1– )z + r2 = z2 – 2rcosz + r2.
Applying this result to the equation under consideration, we arrive at the following
two equations:
0.01758K + b – 1 = – 20.6703cos0.6928r
0.01758K + b – 1 = – 2×0.6703×0.76946
0.01758K + b – 1 = – 1.03154
0.01758K + b = – 0.03154 .......….………….......………… (1)
and 0.0154K – b = (0.6703)2 = 0.4493.
0.0154K – b = 0.4493…….....…………...........…………. (2)
Solving the two equations (1) and (2) renders K = 12.667 and b = – 0.2542.
The desired transfer function for the controller is therefore:
z 0.6703
B(z) = 12.667
z 0.2542
The open loop transfer function for the system is:
z 0.6703 0.01758(z + 0.876) 0.2227(z + 0.876)
G(z) = B(z)A(z) = 12.667 = ,
z 0.2542 (z 1)(z 0.6703) (z 1)(z 0.2542)
EIDBS4 Chapter 6: Digital Controller Design Page 6-4
Figure 6-3
e(t) is the error signal input to the controller and u(t) the output control signal to the
plant. KP is the proportional gain, KI is the integral gain and KD is the derivative gain.
The integral gain may also be expressed as KI = KP/TI where TI is called the reset time,
while the derivative gain is expressed as KD = KPTD where TD is called the rate time.
EIDBS4 Chapter 6: Digital Controller Design Page 6-5
The typical influence that an increase in the values of KP, KI and KD, have on the
response characteristics of a control system, is summarised in Table 6-1
Rise Time Overshoot Settling time S-S Error
KP Decrease Increase Small change Decrease
KI Decrease Increase Increase Eliminate
KD Small Change Decrease Decrease Small Change
Table 6-1
The discrete transfer function of the PID controller may be obtained by assuming a
de
sampling period of T seconds and using approximate expressions for and e(t)dt .
dt
There are many possible discrete time approximations to integration and differentiation
but for this development we will use the forward difference rule for numerical
differentiation (Figure 6-4 a) and the backward difference rule for numerical
integration (Figure 6-4 b).
0
e[(k+1)T]– e(kT) (k - 1)T
e(t)dt
e(kT)
e[(k–1)T]
e[(k–1)T]
T T
0 (k–1)T kT (k+1)T t (k–1)T kT t
Let us now denote the approximation for de(t) as d(kT) and the approximation
dt t kT
kT
for 0
e(t)dt as i(kT).
de(t) e[(k 1)T] e(kT)
So, d(kT) = Equation 6-4
dt t kT T
kT
and 0
e(t)dt i(kT) = i[(k–1)T] + Te[(k–1)T] Equation 6-5
Using the approximations from Equation 6-4 and Equation 6-5 in Equation 6-2 then,
u(kT) = KPe(kT) + KIi(kT) + KDd(kT) Equation 6-6
z transform applied to Equation 6-6:
U(z) = KPE(z) + KII(z) + KDD(z) Equation 6-7
e[(k 1)T]) e(kT)
Now, from Equation 6-4: d(kT) =
T
zE(z) E(z)
D(z) = Z{d(kT)} =
T
EIDBS4 Chapter 6: Digital Controller Design Page 6-6
z 1
D(z) = E(z) Equation 6-8
T
and from Equation 6-5: i(kT) = i[(k – 1)T] + Te[(k – 1)T]
I(z) = Z{i(kT)} = z – 1I(z) + T z – 1 E(z) I(z) – z – 1I(z) = T z – 1 E(z)
Tz 1
I(z)(1 – z ) = T z E(z) I(z) =
–1 –1
E(z)
1 z1
T
I(z) = E(z) Equation 6-9
z 1
Substituting D(z) from Equation 6-8 and I(z) from Equation 6-9 in Equation 6-7:
T z 1
U(z) = KPE(z) + KI E(z) + KD E(z)
z 1 T
1 K
U(z) = [KP + KIT + D (z 1) ]E(z)
z 1 T
The transfer function B(z) of a digital PID controller is therefore given by,
U(z) 1 K
B(z) = = KP + KIT + D (z 1) Equation 6-10
E(z) z 1 T
The block diagram of the digital PID controller is shown in Figure 6-5.
A digital PID
KP controller
E(z) U(z)
1
K IT
z 1
KD
(z 1) Figure 6-5
T
Example 6-2 An analog PI controller is shown in Figure 6-6. Show that the discrete
1 R 1
equivalent is given by B(z) = KP + KIT where KP = 2 and KI = . We use –E(s)
z 1 R1 R1C
as the input as the typical input to this circuit is the measured value minus desired
value, which is the negative of the error value (e = desired value – measured value)
Figure 6-6
EIDBS4 Chapter 6: Digital Controller Design Page 6-7
Example 6-3 Consider the system in Figure 6-7. The controller is a PI device and the
sampling period is T = 1 sec.
R(z) C(z)
PI 1
ZOH P(s)
controller s 1
T=1 T=1
B(z) A(z)
G(z)
Figure 6-7
a) Determine the step response of the system with proportional control (B(z) = KP = 1).
b) Determine the step response of the system with integral control B(z) = KIT/(z – 1)
c) Design a PI controller B(z) = KP + KIT/(z – 1) such that the dominant closed loop
poles have a damping ratio of 0.5 and a settling time of 10 sec.
z(1 e 1)
a) A(z) = (1 z 1 )Z P(s) 1)Z 1 = z 1 0.63212
= (1 z =
s s(s 1) 1
(z 1)(z e ) (z 0.36788)
z
0.63212 G(z) [0.63212 (z 0.36788)]
G(z) = B(z)A(z) = 1 T(z) = =
(z 0.36788) 1 G(z) 1 [0.63212 (z 0.36788)]
0.63212 z 0.63212z
T(z) = and with step input R(z) = , C(z) =
z 0.26424 z 1 (z 1)(z 0.26424)
EIDBS4 Chapter 6: Digital Controller Design Page 6-8
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10
No of samples (sec)
Figure 6-8
The step response demonstrates clearly the typical deficiency of proportional
control alone - not being able to drive the system to setpoint (which was 1, while
the system only settled on 0.85914, offset = 0.14086). This happened because G(z)
does not contain a pole at z = 1 (or no pole at s = 0 in P(s)). Integral control has the
ability to remedy this situation by forcing the system to setpoint with a pole at z = 1.
K IT
0.63212 0.63212K I
b) G(z) = B(z)A(z) = = (T = 1)
(z 1) (z 0.36788) (z 1)(z 0.36788)
The root locus of Q(z) = 1 + G(z) = z2 – 1.36788z + (0.63212KI + 0.36788) = 0, is
shown in Figure 6-9. Breakaway point: KI = – (z2 – 1.36788z + 0.36788)/0.63212
Thus dKI/dz = 0 which gives z = 0.68394. The root locus intersects the unit circle
at P when 0.63212K I 0.36788 = 1 so that (KI)MAX = 1
Im z
KI = 1
P
0.68394
0.36788 1 Re z
Figure 6-9
0.31606 0.31606
T(z) = =
(z 1)(z 0.36788) 0.31606 z 2 1.36788z 0.68394
z z 0.31606
With step input R(z) = , C(z) =
z 1 z 1 z 2 1.36788z 0.68394
C(z) 0.31606
=
z (z 1)(z 0.827010.59704)(z 0.82701 0.59704)
C(z) 1 0.6045772.54457 0.604577 2.54457
= + +
z z 1 z 0.827010.59704 z 0.82701 0.59704
z 0.6045772.54457z 0.604577 2.54457 z
C(z) = + +
z 1 z 0.827010.59704 z 0.82701 0.59704
c(k) = u(k) + 20.604577(0.82701)kcos(0.58704k + 2.54457)u(k)
= u(k) + 1.2092(0.82701)kcos(0.58704k + 2.54457)u(k)
The step response is shown in Figure 6-10, plotted with MATLAB (a=[0.31606]
b=[1 -1.36788 0.68394] dstep(a,b,20)).
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Figure 6-10
No of samples Time (sec)
As expected, the controller drives the system to setpoint (offset = 0) but with rather
large overshoot and long settling time.
az b
For convenience, let us define a = KP and b = (KI – KP) so that B(z) =
z 1
az b 0.63212 0.63212az 0.63212b
G(z) = B(z)A(z) = =
(z 1) (z 0.36788) (z 1)(z 0.36788)
G(z) + 1 = 0 0.63212az + 0.63212b + (z – 1)(z – 0.36788) = 0
0.63212az + 0.63212b + z2 – 1.36788z + 0.36788 = 0
z2 + (0.63212a – 1.36788)z + (0.63212b + 0.36788) = 0
0.63212a – 1.36788 = – 20.6703cos0.6928 0.63212a = – 1.03154 + 1.36788
a = 0.53208
and 0.63212b + 0.36788 = (0.6703)2 = 0.4493 0.63212b = 0.08142
b = 0.1288
0.53208z 0.1288
B(z) =
(z 1)
0.53208z 0.1288 0.63212 0.33634z 0.081417
G(z) = =
(z 1) (z 0.36788) (z 1)(z 0.36788)
G(z) [(0.33634z 0.081417) (z 1)(z 0.36788)]
T(z) = =
1 G(z) 1 [(0.33634z 0.081417) (z 1)(z 0.36788)]
0.33634z 0.081417 0.33634z 0.081417
= =
0.33634z 0.081417 (z 1)(z 0.36788) z 2 1.03154z 0.4493
The step response is shown in Figure 6-11, plotted with MATLAB
(a=[0.33634 0.081417] b=[1 -1.03154 0.4493] dstep(a,b,20)).
The overshoot should be D = e-/d = e-0.4/0.6928 = 0.163 (seems to be a bit higher)
and the rise time tr = [-tan-1(d/)]/d = [-tan-1(0.6928/0.4)]/0.6928 = 3.023 sec.
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 5 10 15 20 Figure 6-11
No of samples Time (sec)
Exercise
6-1 Design a controller B(z) = [(z+a)/(z+b)] for the plant P(s)=1/(s+1) if it is required
that the damping ratio and the settling time of the final system's step response
should be 0.8 and 1 sec respectively. The sampling period is 0.2 sec.
6-2 Design a controller B(z) = K[(z+a)/(z+b)] for the system P(s) = 1/s(s+1) if it is
required that the compensated system should exhibit an overshoot of no more than
20.788% (D=0.20788) and have a settling time of 4 sec. The sampling period is
0.2 sec. Plot the step response of the final system with Matlab.
K T (z 1)
6-3 Design a PI controller B(z) = K I (another form for I(z) using
P 2 (z 1)
the trapezium rule for numerical integration) for the plant P(s)=1/(s+1) if it
is required that the damping ratio and the settling time of the final system's
step response should be 0.31623 and 4 sec respectively. The sampling period
is T = 0.2 sec.
Ans: = 4/ts = 1
and = /n n = 1/0.31623 = 3.1623 d = 2n 2 = 3 rad/sec.
z = e-T±dT = 0.81873±0.6r
and A(z) = (1 – z-1)Z{1/s(s + 1)} = 0.18127/(z – 0.81873)
B(z) = KP + 0.1KI(z + 1)/(z – 1) = [KP(z – 1) + 0.1KI(z + 1)]/(z – 1)
= [(KP + 0.1KI)z + (0.1KI – KP)]/(z – 1)
G(z) = B(z)A(z) = [(KP + 0.1KI)z + (0.1KI – KP)]/(z – 1)[0.18127/(z – 0.81873)]
= [0.18127(KP + 0.1KI) + 0.18127(0.1KI – KP)]/(z – 1)(z – 0.81873)
T(z) = G/(G+1)
= [0.18127(KP + 0.1KI)z + 0.18127(0.1KI – KP)]/
{z2 + [0.18127(KP + 0.1KI) – 1.81873]z + [0.18127(0.1KI – KP) + 0.81873]}
Q(z) = z2 + [0.18127(KP + 0.1KI) – 1.81873]z + [0.18127(0.1KI – KP) + 0.81873]
With the roots of the characteristic equation required to be 0.81873±0.6r
0.18127(KP + 0.1KI) – 1.81873 = – 20.81873cos0.6
0.18127(KP+ 0.1KI) – 1.81873 = – 1.3515
EIDBS4 Chapter 6: Digital Controller Design Page 6-13
Figure P 6-2
Note: Because T(z) has a zero at z = 0.31764, the overshoot is approximately 40%
while it should be D = e-/d = e-1/3 = 0.3509, or 35%.