Lecture-18-19-20 Introduction To Digital Control Systems Dr. Imtiaz Hussain
Lecture-18-19-20 Introduction To Digital Control Systems Dr. Imtiaz Hussain
Lecture-18-19-20 Introduction To Digital Control Systems Dr. Imtiaz Hussain
Lecture-18-19-20
Introduction to Digital Control Systems
1
Lecture Outline
• Introduction
• Difference Equations
• Review of Z-Transform
• Inverse Z-transform
2
Recommended Book
• M.S. Fadali, “Digital Control
Engineering – Analysis and
Design”, Elsevier, 2009. ISBN: 13:
978-0-12-374498-2
3
Introduction
• Digital control offers distinct advantages over analog
control that explain its popularity.
• Accuracy: Digital signals are more accurate than their
analogue counterparts.
• Implementation Errors: Implementation errors are
negligible.
• Flexibility: Modification of a digital controller is possible
without complete replacement.
• Speed: Digital computers may yield superior performance
at very fast speeds
• Cost: Digital controllers are more economical than
analogue controllers. 4
Structure of a Digital Control System
5
Examples of Digital control Systems
Closed-Loop Drug Delivery System
6
Examples of Digital control Systems
7
Difference Equation vs Differential Equation
8
Differential Equation
• Following figure shows a mass-spring-damper-system. Where y is
position, F is applied force D is damping constant and K is spring
constant.
𝐹 ( 𝑡 )=𝑚 𝑦¨ (𝑡 ) + 𝐷 ˙𝑦 ( 𝑡 )+ 𝐾𝑦(𝑡 )
𝐹 1 𝑦
¨ 𝑦
˙ 𝑦
∫ 𝑑𝑡 ∫ 𝑑𝑡
(𝑡 )
𝑚
𝐷
−
𝑚
𝐾
−
𝑚
10
Difference Equation
1 𝐷 𝐾
𝑦 (𝑘 +2)= 𝐹 (𝑘 )− 𝑦 (𝑘 +1) 𝑦 (𝑘 )
𝑚 𝑚 𝑚
𝐹
(𝑘 ) 1 𝑦 (𝑘 +2) 1 ) 1 𝑦 (𝑘 )
𝑚 𝑧 𝑧
𝐷
−
𝑚
𝐾
−
𝑚
11
Difference Equations
• Difference
equations arise in problems where the
independent variable, usually time, is assumed to have
a discrete set of possible values.
12
Difference Equations
•
• Example-1: For each of the following difference equations,
determine the (a) order of the equation. Is the equation (b)
linear, (c) time invariant, or (d) homogeneous?
13
Difference Equations
•
• Example-1: For each of the following difference equations, determine
the (a) order of the equation. Is the equation (b) linear, (c) time
invariant, or (d) homogeneous?
Solution:
a) The equation is second order.
b) All terms enter the equation linearly
c) All the terms if the equation have constant coefficients.
Therefore the equation is therefore LTI.
d) A forcing function appears in the equation, so it is
nonhomogeneous.
14
Difference Equations
•
• Example-1: For each of the following difference equations,
determine the (a) order of the equation. Is the equation (b) linear,
(c) time invariant, or (d) homogeneous?
Solution:
a) The equation is 4th order.
b) All terms are linear
c) The second coefficient is time dependent
d) There is no forcing function therefore the equation is
homogeneous.
15
Difference Equations
•
• Example-1: For each of the following difference equations,
determine the (a) order of the equation. Is the equation (b)
linear, (c) time invariant, or (d) homogeneous?
Solution:
a) The equation is 1st order.
b) Nonlinear
c) Time invariant
d) Homogeneous
16
Z-Transform
• Difference equations can be solved using classical methods analogous
to those available for differential equations.
∞
−𝑘
𝑈 ( 𝑧 ) = ∑ 𝑢𝑘 𝑧
𝑘 =0
u
k k 0 1, 1, 3, 2, 0, 4, 0, 0, 0,...
19
Relation between Laplace Transform and Z-Transform
• Given the impulse train representation of a discrete-time
signal
𝑢(𝑡 ) 𝑢∗ (𝑡 )
𝑢(𝑡 ) 𝑢∗ (𝑡 )
𝑈
( 𝑠) ∗ (𝑠 )
𝑈
∞
∗
𝑢 ( 𝑡 )=∑ 𝑢 𝑘 𝛿 ( 𝑡 − 𝑘 𝑇 )
𝑘=0
20
Relation between Laplace Transform and Z-Transform
∗ ( 𝑡 )=𝑢 𝛿 ( 𝑡 ) +𝑢 𝛿 ( 𝑡 − 𝑇 ) +𝑢 𝛿 ( 𝑡 − 2𝑇 ) +…+𝑢 𝛿 ( 𝑡 −𝑘 𝑇 )
𝑢
• 𝑜 1 2 𝑘
∞
∗ −𝑘𝑠𝑇
𝑈 ( 𝑠 ) = ∑ 𝑢𝑘 𝑒 ( 𝐴)
𝑘 =0
• And the Z-transform of is given as
∞
−𝑘
𝑈 ( 𝑧 ) = ∑ 𝑢𝑘 𝑧 (𝐵 )
• Comparing (A) and (B) yields 𝑘 =0
𝑧=𝑒𝑠𝑇
21
Conformal Mapping between s-plane to z-plane
•
𝑧=𝑒𝑠𝑇
• Where .
(𝜎 + 𝑗 𝜔)𝑇
𝑧=𝑒
• Then in polar coordinates is given by
𝑧=𝑒𝜎 𝑇 𝑒 𝑗 𝜔 𝑇
|𝑧|=𝑒 𝜎 𝑇 ∠
𝑧=𝜔𝑇
22
Conformal Mapping between s-plane to z-plane
•• We
will discuss following cases to map given points on s-plane
to z-plane.
– Case-1: Real pole in s-plane
– Case-2: Imaginary Pole in s-plane
– Case-3: Complex Poles
• We know
|𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
• Therefore
|𝑧|=𝑒 𝜎 𝑇
∠ 𝑧=0
24
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane |𝑧|=𝑒
𝜎𝑇
∠
𝑧=𝜔𝑇
When
|𝑧|=𝑒 0 𝑇 =1
∠ 𝑧=0 𝑇 =0
𝑠=0
1
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
25
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
When
−∞ 𝑇
|𝑧|=𝑒 =0
∠ 𝑧=0
0
−∞
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
26
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
Consider
−𝑎 𝑇
|𝑧|=𝑒
∠ 𝑧=0
0
1
−𝑎
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
27
Conformal Mapping between s-plane to z-plane
•• Case-2:
Imaginary pole in s-plane
• We know
|𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
• Therefore
|𝑧|=1
∠
𝑧=± 𝜔𝑇
28
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
Consider
|𝑧|=𝑒 0 𝑇 =1
∠
𝑧=𝜔𝑇
1
𝑠=
𝑗𝜔
𝜔𝑇
−1
1
−1
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
29
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
When
|𝑧|=𝑒 0 𝑇 =1
∠
𝑧=− 𝜔𝑇
1
−1
𝑇 1
−𝜔
𝑠=−
𝑗𝜔
−1
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
30
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
When
|𝑧|=𝑒 0 𝑇 =1
∠
𝑧=± 𝜋 𝝎𝑻 =𝝅
𝑗 𝜔 1
𝑇
𝜋
−1
1
𝑗𝜔
−
𝑇 −1
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
31
Conformal Mapping between s-plane to z-plane
• Anything in the Alias/Overlay region in the S-Plane will be
overlaid on the Z-Plane along with the contents of the strip
between .
32
Conformal Mapping between s-plane to z-plane
• In order to avoid aliasing, there must be nothing in this region, i.e. there
must be no signals present with radian frequencies higher than w = p/T,
or cyclic frequencies higher than f = 1/2T.
• Stated another way, the sampling frequency must be at least twice the
highest frequency present (Nyquist rate).
33
Conformal Mapping between s-plane to z-plane
Case-3: Complex pole in s-plane |𝑧|=𝑒 𝜎 𝑇
∠
𝑧=𝜔𝑇
|𝑧|=𝑒 𝜎 𝑇
∠
𝑧=± 𝜔𝑇
1
−1
1
−1
𝑠 − 𝑝𝑙𝑎𝑛𝑒 𝑧 − 𝑝𝑙𝑎𝑛𝑒
34
Mapping regions of the s-plane onto
the z-plane
35
Mapping regions of the s-plane onto
the z-plane
36
Mapping regions of the s-plane onto
the z-plane
37
38
39
Example-3
• Map
following s-plane poles onto z-plane assume
(T=1). Also comment on the nature of step
response in each case.
40
z-Transforms of Standard Discrete-Time Signals
• The following identities are used repeatedly to derive several
important results.
𝑛 𝑛 +1
𝑘 1− 𝑎
∑ 𝑎 = 1− 𝑎 , 𝑎 ≠ 1
𝑘=0
∞
1
𝑘
∑ 𝑎 = 1− 𝑎 ,|𝑎|≠ 1
𝑘 =0
41
z-Transforms of Standard Discrete-Time Signals
• Unit Impulse
𝛿 ( 𝑘 ) = 1 , 𝑘 =0
{
0, 𝑘≠0
𝛿 ( 𝑧 ) =1
42
z-Transforms of Standard Discrete-Time Signals
• Sampled Step
𝑢 (𝑘 )= 1 , 𝑘 ≥ 0
{
0 , 𝑘 <0
• or
43
z-Transforms of Standard Discrete-Time Signals
• Sampled Ramp
𝑟 (𝑘 )= 𝑘 , 𝑘 ≥ 0
{0, 𝑘<0
𝑟 ( 𝑘 )
……
𝑘
• Z-transform of the signal 0 1 2 3
𝑧
𝑈 ( 𝑧 )= 2
( 𝑧 − 1)
44
z-Transforms of Standard Discrete-Time Signals
• Sampled Parabolic Signal
𝑘
𝑎 , 𝑘 ≥0
𝑢 (𝑘 )=
{
0 , 𝑘 <0
• Then
𝑛
−1 2 −2 3 −3 𝑘 −𝑘 −𝑘
𝑈 ( 𝑧 )=1+𝑎𝑧 + 𝑎 𝑧 +𝑎 𝑧 + …+𝑎 𝑧 =∑ (𝑎𝑧)
𝑘 =0
45
Exercise
• Find the z-transform of following causal sequences.
𝑓 ( 𝑘 )=2 × 1 ( 𝑘 )+ 4 × 𝛿 ( 𝑘 ) , 𝑘 =0,1,2 , …
𝑓 ( 𝑘 ) = 4 , 𝑘 =2,3 , …
{ 0 , 𝑜𝑡h𝑒𝑟𝑤𝑖𝑠𝑒
46
Exercise
• Find the z-transform of following causal sequences.
𝑓 ( 𝑘 )=2 ×1 ( 𝑘 )+ 4 × 𝛿 ( 𝑘 ) , 𝑘 =0,1,2 , …
𝐹 ( 𝑧 )=𝒵 {2 ×1 ( 𝑘 ) +4 ×𝛿 ( 𝑘 ) }
𝐹 ( 𝑧 )=2× 𝒵 { 1 ( 𝑘 ) } +4 × 𝒵 {𝛿 ( 𝑘 ) }
𝑧
𝐹 ( 𝑧 )= 2× +4
𝑧 −1
6 𝑧 −4
𝐹 ( 𝑧 )=
𝑧 −1 47
Exercise
• Find the z-transform of following causal sequences.
4 , 𝑘 =2,3 , …
𝑓 ( 𝑘 )=
{ 0 , 𝑜𝑡h𝑒𝑟𝑤𝑖𝑠𝑒
Solution: The given sequence is a sampled step starting at k-2 rather than
k=0 (i.e. it is delayed by two sampling periods). Using the delay property,
we have
𝐹 ( 𝑧 )=𝒵 {4 ×1 ( 𝑘 −2 ) }
𝐹 ( 𝑧 )=4 𝑧 −2 𝒵 {1 ( 𝑘 −2 ) }
−2 𝑧 4
𝐹 ( 𝑧 )=4 𝑧 =
𝑧 −1 𝑧 ( 𝑧 −1) 48
Inverse Z-transform
1. Long Division: We first use long division to
obtain as many terms as desired of the z-
transform expansion.
49
Inverse Z-transform
• Example-4: Obtain the inverse z-transform of
the function
𝑧+1
𝐹 ( 𝑧 )= 2
𝑧 + 0.2 𝑧 +0.1
• Solution
• 1. Long Division
50
Inverse Z-transform
𝑧+1
• 1. Long Division 𝐹 ( 𝑧 )=
𝑧 2+ 0.2 𝑧 +0.1
• Thus
𝐹 ( 𝑧 )=0+ 𝑧 −1+ 0.8 𝑧 − 2 −0.26 𝑧 − 3+ …
• Inverse z-transform
𝑓 ( 𝑘 ) = {0 , 1 , 0.8 ,− 0.26 , … }
51
Inverse Z-transform
• Example-5: Obtain the inverse z-transform of
the function
𝑧+ 1
𝐹 ( 𝑧 )= 2
𝑧 + 0.3 𝑧 +0.02
• Solution
• 2. Partial Fractions
𝐹 (𝑧) 𝑧 +1
=
𝑧 𝑧 ( 𝑧 2 +0.3 𝑧 +0.02)
𝐹 (𝑧) 𝑧 +1
=
𝑧 2
𝑧 ( 𝑧 +0.1 𝑧 +0.2 𝑧+ 0.02) 52
Inverse Z-transform
𝐹 (𝑧) 𝑧 +1
=
𝑧 𝑧 ( 𝑧 +0.1)(𝑧 +0.2)
𝐹 (𝑧) 𝐴 𝐵 𝐶
= + +
𝑧 𝑧 𝑧+ 0.1 𝑧 +0.2
F ( z) 1 1
A z F (0) 50
z z 0 0.1 0.2 0.02
F ( z) 1 z 1 0.1 1
B ( z 0.1) ( z 0.1) 90
z z 0.1 z ( z 0.1)( z 0.2) z 0.1 (0.1)(0.1 0.2)
F ( z) 1 z 1 0.2 1
C ( z 0.2) ( z 0.2) 40
z z 0.2 z ( z 0.1)( z 0.2) z 0.2
(0.2)(0.2 0.1)
53
Inverse Z-transform
𝐹 ( 𝑧 ) 50 90 40
= − +
𝑧 𝑧 𝑧 +0.1 𝑧 +0.2
90 𝑧 40 𝑧
𝐹 ( 𝑧 )=50 − +
𝑧 +0.1 𝑧 +0.2
𝑘 𝑘
𝑓 ( 𝑘 )=50 𝛿 ( 𝑘 ) −90 ( −0.1 ) + 40 ( −0. 2 )
54
Inverse Z-transform
• Example-6: Obtain the inverse z-transform of
the function
𝑧
𝐹 ( 𝑧 )=
(𝑧 +0.1)( 𝑧+ 0.2)( 𝑧 +0.3)
• Solution
• 2. Partial Fractions
55
Inverse Z-transform
• Example-6: Obtain the inverse z-transform of the
function 𝑧
𝐹 ( 𝑧 )=
(𝑧 +0.1)( 𝑧+ 0.2)( 𝑧 +0.3)
• Solution
• The most convenient method to obtain the partial fraction expansion
of a function with simple real roots is the method of residues.
• The residue of a complex function F(z) at a simple pole zi is given by
𝐴𝑖= ( 𝑧 − 𝑧 𝑖 ) 𝐹 (𝑧)|𝑧 → 𝑧
𝑖
• This is the partial fraction coefficient of the ith term of the expansion
𝑛
𝐴𝑖
F ( z )=∑
𝑖=1 𝑧 − 𝑧𝑖 56
Z-transform solution of Difference Equations
57
Z-transform solution of Difference Equations
•• Example-7:
Solve the linear difference equation
3 1
𝑥 𝑘 +2 − 𝑥 𝑘 +1 + 𝑥 ( 𝑘 )=1(𝑘 )
( ) ( )
2 2
• With initial conditions
Solution
• 1. Taking z-transform of given equation
2 2 3 1 𝑧
[ 𝑧 𝑋 ( 𝑧 ) − 𝑧 𝑥 ( 0 ) − 𝑧𝑥 ( 1 ) ] − 2 𝑧𝑋 ( 𝑧 )+ 2 𝑋 ( 𝑧 ) = 𝑧 −1
• 2. Solve for X(z)
3 1 𝑧 2 5 3
[𝑧 ¿¿ 2 − 𝑧 + ] 𝑋 ( 𝑧 )= + 𝑧 +( − ) 𝑧 ¿
2 2 𝑧−1 2 2 58
Z-transform solution of Difference Equations
3 1 𝑧 2 5 3
[𝑧 ¿¿ 2 − 𝑧 + ] 𝑋 ( 𝑧 )= + 𝑧 +( − ) 𝑧 ¿
• Then 2 2 𝑧−1 2 2
𝑧 [ 1+( 𝑧 +1)( 𝑧 −1)] 𝑧3
𝑋 ( 𝑧 )= =
( 𝑧 −1)(𝑧 −1)( 𝑧 − 0.5) ( 𝑧 −1 )2 ( 𝑧 − 0.5)
• 3. Inverse z-transform
𝑋 ( 𝑧 ) 𝑧2 𝐴 𝐵 𝐶
= = + +
𝑧 ( 𝑧 − 1 )2 ( 𝑧 −0.5) ( 𝑧 − 1 )2 𝑧 −1 𝑧 −0.5
2𝑧 𝑧
𝑋 ( 𝑧 )= +
( 𝑧 −1 ) 𝑧 −0.5
2
𝑥 (𝑘 )=2 𝑘 +(0.5)𝑘
59
To download this lecture visit
http://imtiazhussainkalwar.weebly.com/
END OF LECTURES-18-19-20
60