Lecture-21-22: Introduction to Digital Control

advertisement
Modern Control Systems (MCS)
Lecture-21-22
Introduction to Digital Control Systems
Dr. Imtiaz Hussain
Assistant Professor
email: imtiaz.hussain@faculty.muet.edu.pk
URL :http://imtiazhussainkalwar.weebly.com/
1
Lecture Outline
• Introduction
• Difference Equations
• Review of Z-Transform
• Inverse Z-transform
• Relations between s-plane and z-plane
• Solution of difference Equations
2
Recommended Book
• M.S. Fadali, “Digital Control
Engineering – Analysis and
Design”, Elsevier, 2009. ISBN: 13:
978-0-12-374498-2
Professor of Electrical Engineering
Area of Specialization: Control Systems
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
Aircraft Turbojet Engine
7
Difference Equation vs Differential Equation
• A difference equation expresses the change in
some variable as a result of a finite change in
another variable.
• A differential equation expresses the change in
some variable as a result of an infinitesimal
change in another variable.
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.
𝐹 𝑑 = π‘šπ‘¦ 𝑑 + 𝐷 𝑦 𝑑 + 𝐾𝑦(𝑑)
• Rearranging above equation in following form
1
𝐷
𝐾
𝑦 𝑑 = 𝐹 𝑑 − 𝑦 𝑑
𝑦(𝑑)
π‘š
π‘š
π‘š
9
Differential Equation
1
𝐷
𝐾
𝑦 𝑑 = 𝐹 𝑑 − 𝑦 𝑑
𝑦(𝑑)
π‘š
π‘š
π‘š
• Rearranging above equation in following form
𝐹(𝑑)
1
π‘š
οƒ₯
𝑦
𝑑𝑑
−
𝑦
𝑑𝑑
𝑦
𝐷
π‘š
−
𝐾
π‘š
10
Difference Equation
1
𝐷
𝐾
𝑦(π‘˜ + 2) = 𝐹(π‘˜) − 𝑦(π‘˜ + 1) 𝑦(π‘˜)
π‘š
π‘š
π‘š
𝐹(π‘˜)
1
π‘š
οƒ₯
𝑦(π‘˜ + 2)
1
𝑧
−
𝑦(π‘˜ + 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.
𝑦 π‘˜ + 𝑛 + π‘Žπ‘›−1 𝑦 π‘˜ + 𝑛 − 1 + β‹― + π‘Ž1 𝑦 π‘˜ + 1 + π‘Ž0 𝑦 π‘˜
= 𝑏𝑛 𝑒 π‘˜ + 𝑛 + 𝑏𝑛−1 𝑒 π‘˜ + 𝑛 − 1 + β‹― + 𝑏1 𝑒 π‘˜ + 1 + 𝑏0 𝑒 π‘˜
• Where coefficients π‘Žπ‘›−1 , π‘Žπ‘›−2 ,… and 𝑏𝑛 , 𝑏𝑛−1 ,… are
constant.
• 𝑒(π‘˜) is forcing function
12
Difference Equations
• Example-1: For each of the following difference equations,
determine the order of the equation. Is the equation (a)
linear, (b) time invariant, or (c) homogeneous?
1.
𝑦 π‘˜ + 2 + 0.8𝑦 π‘˜ + 1 + 0.07𝑦 π‘˜ = 𝑒 π‘˜
2.
𝑦 π‘˜ + 4 + sin(0.4π‘˜)𝑦 π‘˜ + 1 + 0.3𝑦 π‘˜ = 0
3.
𝑦 π‘˜ + 1 = −0.1𝑦 2 π‘˜
13
Z-Transform
• Difference equations can be solved using classical methods
analogous to those available for differential equations.
• Alternatively, z-transforms provide a convenient approach for
solving LTI equations.
• The z-transform is an important tool in the analysis and design
of discrete-time systems.
• It simplifies the solution of discrete-time problems by
converting LTI difference equations to algebraic equations and
convolution to multiplication.
• Thus, it plays a role similar to that served by Laplace
transforms in continuous-time problems.
14
Z-Transform
• Given the causal sequence {u0, u1, u2, …, uk}, its ztransform is defined as
π‘ˆ 𝑧 = π‘’π‘œ + 𝑒1 𝑧 −1 + 𝑒2 𝑧 −2 + π‘’π‘˜ 𝑧 −π‘˜
∞
π‘’π‘˜ 𝑧 −π‘˜
π‘ˆ 𝑧 =
π‘˜=0
• The variable z −1 in the above equation can be
regarded as a time delay operator.
15
Z-Transform
• Example-2: Obtain the z-transform of the
sequence
u 
ο‚₯
k k ο€½0
ο€½ 1, 1, 3, 2, 0, 4, 0, 0, 0,...
16
Relation between Laplace Transform and Z-Transform
• Given the impulse train representation of a discrete-time signal
𝑒∗ 𝑑 = π‘’π‘œ 𝛿 𝑑 + 𝑒1 𝛿 𝑑 − 𝑇 + 𝑒2 𝛿 𝑑 − 2𝑇 + β‹― + π‘’π‘˜ 𝛿 𝑑 − π‘˜π‘‡
𝑒(𝑑)
𝑒∗ (𝑑)
∞
𝑒∗ 𝑑 =
π‘’π‘˜ 𝛿 𝑑 − π‘˜π‘‡
𝑒(𝑑)
π‘˜=0
π‘ˆ(𝑠)
𝑒∗ (𝑑)
π‘ˆ ∗ (𝑠)
• The Laplace Transform of above equation is
π‘ˆ ∗ 𝑠 = π‘’π‘œ + 𝑒1 𝑒 −𝑠𝑇 + 𝑒2 𝑒 −2𝑠𝑇 + β‹― + π‘’π‘˜ 𝑒 −π‘˜π‘ π‘‡
∞
π‘ˆ∗ 𝑠 =
• Let z be defined by
π‘’π‘˜ 𝑒 −π‘˜π‘ π‘‡
π‘˜=0
𝑧 = 𝑒 𝑠𝑇
17
Conformal Mapping between s-plane to z-plane
𝑧 = 𝑒 𝑠𝑇
• Where 𝑠 = 𝜎 + π‘—πœ”. Then 𝑧 in polar coordinates is given by
𝑧 = 𝑒 (𝜎+π‘—πœ”)𝑇
𝑧 = 𝑒 πœŽπ‘‡ 𝑒 π‘—πœ”π‘‡
• Therefore,
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
18
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 (𝑠 = 𝜎 + π‘—πœ”)
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
19
Conformal Mapping between s-plane to z-plane
• Case-1: Real pole in s-plane (𝑠 = 𝜎)
• We know
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
• Therefore
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = 0
20
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane (𝑠 = 𝜎)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
When 𝑠 = 0
𝑧 = 𝑒 0𝑇 = 1
∠𝑧 = 0𝑇 = 0
𝑠=0
1
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
21
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane (𝑠 = 𝜎)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
When 𝑠 = −∞
𝑧 = 𝑒 −∞𝑇 = 0
∠𝑧 = 0
0
−∞
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
22
Conformal Mapping between s-plane to z-plane
Case-1: Real pole in s-plane (𝑠 = 𝜎)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
Consider 𝑠 = −π‘Ž
𝑧 = 𝑒 −π‘Žπ‘‡
∠𝑧 = 0
0
−π‘Ž
𝑠 − π‘π‘™π‘Žπ‘›π‘’
1
𝑧 − π‘π‘™π‘Žπ‘›π‘’
23
Conformal Mapping between s-plane to z-plane
• Case-2: Imaginary pole in s-plane (𝑠 = ±π‘—πœ”)
• We know
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
• Therefore
𝑧 =1
∠𝑧 = ±πœ”𝑇
24
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane (𝑠 = ±π‘—πœ”)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
Consider 𝑠 = π‘—πœ”
𝑧 = 𝑒 0𝑇 = 1
∠𝑧 = πœ”π‘‡
1
𝑠 = π‘—πœ”
πœ”π‘‡
−1
1
−1
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
25
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane (𝑠 = ±π‘—πœ”)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
When 𝑠 = −π‘—πœ”
𝑧 = 𝑒 0𝑇 = 1
∠𝑧 = −πœ”π‘‡
1
−1
−πœ”π‘‡
1
𝑠 = −π‘—πœ”
−1
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
26
Conformal Mapping between s-plane to z-plane
Case-2: Imaginary pole in s-plane (𝑠 = ±π‘—πœ”)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
πœ”
When 𝑠 = ±π‘—
𝑇
𝑧 = 𝑒 0𝑇 = 1
∠𝑧 = ±πœ‹
πŽπ‘» = 𝝅
πœ”
𝑗
𝑇
1
πœ‹
−1
−𝑗
𝑠 − π‘π‘™π‘Žπ‘›π‘’
πœ”
𝑇
1
−1
𝑧 − π‘π‘™π‘Žπ‘›π‘’
27
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 ±π‘— .
𝑇
28
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).
29
Conformal Mapping between s-plane to z-plane
Case-3: Complex pole in s-plane (𝑠 = 𝜎 ± π‘—πœ”)
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = πœ”π‘‡
𝑧 = 𝑒 πœŽπ‘‡
∠𝑧 = ±πœ”𝑇
1
−1
1
−1
𝑠 − π‘π‘™π‘Žπ‘›π‘’
𝑧 − π‘π‘™π‘Žπ‘›π‘’
30
Mapping regions of the s-plane onto
the z-plane
31
Mapping regions of the s-plane onto
the z-plane
32
Mapping regions of the s-plane onto
the z-plane
33
34
35
Example-3
• Map following s-plane poles onto z-plane assume
(T=1). Also comment on the nature of step
response each case.
1.
2.
3.
4.
5.
𝑠 = −3
𝑠 = ±4𝑗
𝑠 = ±πœ‹π‘—
𝑠 = ±2πœ‹π‘—
𝑠 = −10 ± 5𝑗
36
z-Transforms of Standard Discrete-Time Signals
• The following identities are used repeatedly to derive several
important results.
𝑛
π‘˜=0
𝑛+1
1
−
π‘Ž
π‘Žπ‘˜ =
,
1−π‘Ž
∞
π‘Žπ‘˜
π‘˜=0
1
=
,
1−π‘Ž
π‘Ž≠1
π‘Ž ≠1
37
z-Transforms of Standard Discrete-Time Signals
• Unit Impulse
1,
𝛿 π‘˜ =
0,
π‘˜=0
π‘˜≠0
• Z-transform of the signal
𝛿 𝑧 =1
38
z-Transforms of Standard Discrete-Time Signals
• Sampled Step
π‘˜≥0
π‘˜<0
1,
𝑒 π‘˜ =
0,
• or
𝑒 π‘˜ = 1, 1, 1,1, …
π‘˜≥0
• Z-transform of the signal
𝑛
π‘ˆ 𝑧 = 1 + 𝑧 −1 + 𝑧 −2 + 𝑧 −3 + β‹― + 𝑧 −π‘˜ =
𝑧 −π‘˜
π‘˜=0
π‘ˆ 𝑧 =
1
1−𝑧 −1
=
𝑧
𝑧−1
𝑧 <1
39
z-Transforms of Standard Discrete-Time Signals
• Sampled Ramp
π‘˜,
π‘Ÿ π‘˜ =
0,
π‘˜≥0
π‘˜<0
π‘Ÿ π‘˜
……
0
• Z-transform of the signal
𝑧
π‘ˆ 𝑧 =
𝑧−1
1
2
3
π‘˜
2
40
z-Transforms of Standard Discrete-Time Signals
• Sampled Parabolic Signal
π‘Žπ‘˜ ,
𝑒 π‘˜ =
0,
π‘˜≥0
π‘˜<0
• Then
𝑛
π‘ˆ 𝑧 = 1 + π‘Žπ‘§ −1 + π‘Ž2 𝑧 −2 + π‘Ž3 𝑧 −3 + β‹― + π‘Žπ‘˜ 𝑧 −π‘˜ =
(π‘Žπ‘§)−π‘˜
π‘˜=0
π‘ˆ 𝑧 =
1
1−π‘Žπ‘§ −1
=
𝑧
𝑧−π‘Ž
𝑧 <1
41
Inverse Z-transform
1. Long Division: We first use long division to
obtain as many terms as desired of the ztransform expansion.
2. Partial Fraction: This method is almost identical
to that used in inverting Laplace transforms.
However, because most z-functions have the
term z in their numerator, it is often convenient
to expand F(z)/z rather than F(z).
42
Inverse Z-transform
• Example-4: Obtain the inverse z-transform of
the function
𝑧+1
𝐹 𝑧 = 2
𝑧 + 0.2𝑧 + 0.1
• Solution
• 1. Long Division
43
Inverse Z-transform
𝑧+1
𝐹 𝑧 = 2
𝑧 + 0.2𝑧 + 0.1
• 1. Long Division
• Thus
𝐹 𝑧 = 0 + 𝑧 −1 + 0.8𝑧 −2 − 0.26𝑧 −3 + β‹―
• Inverse z-transform
𝑓 π‘˜ = 0,
1,
0.8,
−0.26,
…
44
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)
45
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
B ο€½ ( z  0.1)
F ( z)
1
z 1
ο€­ 0.1  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)
46
Inverse Z-transform
𝐹 𝑧
50
90
40
=
−
+
𝑧
𝑧
𝑧 + 0.1 𝑧 + 0.2
90𝑧
40𝑧
𝐹 𝑧 = 50 −
+
𝑧 + 0.1 𝑧 + 0.2
• Taking inverse z-transform (using z-transform table)
𝑓 π‘˜ = 50𝛿 π‘˜ − 90 −0.1
π‘˜
+ 40 −0.2
π‘˜
47
Inverse Z-transform
• Example-6: Obtain the inverse z-transform of
the function
𝑧
𝐹 𝑧 =
(𝑧 + 0.1)(𝑧 + 0.2)(𝑧 + 0.3)
• Solution
• 2. Partial Fractions
48
Z-transform solution of Difference Equations
• By a process analogous to Laplace transform solution of
differential equations, one can easily solve linear
difference equations.
1.
The equations are first transformed to the z-domain (i.e., both
the right- and left-hand side of the equation are ztransformed) .
2.
Then the variable of interest is solved.
3.
Finally inverse z-transformed is computed.
49
Z-transform solution of Difference Equations
• Example-7: Solve the linear difference equation
3
1
π‘₯ π‘˜ + 2 − π‘₯ π‘˜ + 1 + π‘₯ π‘˜ = 1(π‘˜)
2
2
• With initial conditions π‘₯ 0 = 1, π‘₯ 1 =
5
2
Solution
• 1. Taking z-transform of given equation
𝑧2𝑋
𝑧 −
𝑧2π‘₯
3
1
𝑧
0 − 𝑧π‘₯ 1 − 𝑧𝑋 𝑧 + 𝑋 𝑧 =
2
2
𝑧−1
• 2. Solve for X(z)
[𝑧 2 −
3
1
𝑧
5 3
2
𝑧 + ]𝑋 𝑧 =
+ 𝑧 + ( − )𝑧
2
2
𝑧−1
2 2
50
Z-transform solution of Difference Equations
• Then
3
1
𝑧
5 3
2
[𝑧 − 𝑧 + ]𝑋 𝑧 =
+ 𝑧 + ( − )𝑧
2
2
𝑧−1
2 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
2+
𝐡
𝐢
+
𝑧 − 1 𝑧 − 0.5
𝑧
2 + 𝑧 − 0.5
π‘₯(π‘˜) = 2π‘˜ + (0.5)π‘˜
51
To download this lecture visit
http://imtiazhussainkalwar.weebly.com/
END OF LECTURES-21-22
52
Download