Вы находитесь на странице: 1из 35

Digital Control

System Models
M. Sami Fadali
Professor of Electrical Engineering
University of Nevada

1
Outline
• Model of ADC.
• Model of DAC.
• Model of ADC, analog subsystem
and DAC.
• Systems with transport lag.
• Examples

2
Common Digital Control System
Configuration

Computer or Analog
Microprocessor DAC Subsystem

ADC

3
ADC Model
Model ADC as ideal sampler with sampling period T.
Assume that
(i) ADC outputs are exactly equal in magnitude to
their inputs. (i.e. neglect quantization errors).
(ii) ADC yields digital output instantaneously.
(iii) Sampling is perfectly uniform.
T

4
DAC Model
Assume that DAC
(i)outputs are exactly equal in magnitude to their inputs.
(ii) yields an analog output instantaneously.
(iii) outputs are constant over each sampling period.
zero-order-hold: piecewise constant analog output.
first-order hold constructs signals in terms of straight lines
second-order hold constructs them in terms of parabolas.
ZOH
𝑢 𝑘 𝑢 𝑡 = 𝑢 𝑘 , 𝑘𝑇 ≤ 𝑡 < 𝑘 + 1 𝑇, 𝑘 = 0,1,2, …

kT Zero-order kT (k+1)T
Hold 5
Transfer Function of ZOH
Use impulse sampling and Laplace
transform of a unit pulse
1 𝑒 −𝑠𝑇
L 1 𝑡 = L 1 𝑡−𝑇 =
𝑠 𝑠
1 − 𝑒 −𝑠𝑇
𝐺𝑍𝑂𝐻 𝑠 =
𝑠

kT (k+1)T

6
Effect of Sampler on Transfer
Function of a Cascade
In the s-domain
𝑌 𝑠 = 𝐻2 𝑠 𝑋 𝑠 = 𝐻2 𝑠 𝐻1 𝑠 𝑈 𝑠
= 𝐻𝑒𝑞 𝑠 𝑈 𝑠 , 𝐻𝑒𝑞 𝑠 = 𝐻2 𝑠 𝐻1 𝑠

U(s) X(s) Y(s)


H1(s) H2(s)

7
Time Response
𝑡
𝑦 𝑡 = න ℎ2 𝑡 − 𝜏 𝑥 𝜏 𝑑𝜏
0
𝑡 𝜏
= න ℎ2 𝑡 − 𝜏 න ℎ1 𝜏 − 𝜆 𝑢 𝜆 𝑑𝜆 𝑑𝜏
0 0
Change order and variables of integration
𝑡 𝜏
𝑦 𝑡 = න 𝑢 𝑡 − 𝜏 න ℎ1 𝜏 − 𝜆 ℎ2 𝜆 𝑑𝜆 𝑑𝜏
0 0
𝑡
= න 𝑢 𝑡 − 𝜏 ℎ𝑒𝑞 𝜏 𝑑𝜏
0 8
Punch Line
Equivalent impulse response for cascade
= the convolution of cascaded impulse responses.
• Impossible to separate convolved time function
𝑡
ℎ𝑒𝑞 𝑡 = න ℎ1 𝑡 − 𝜆 ℎ2 𝜆 𝑑𝜆
0
• Sample the output
𝑖𝑇
𝑦 𝑖𝑇 = න 𝑢 𝑖𝑇 − 𝜏 ℎ𝑒𝑞 𝜏 𝑑𝜏 , 𝑖 = 0, 1, 2, . . .
0
9
Convolving 𝒖∗ 𝒕 & CT Signal
𝑡
𝑦 𝑡 = ‫׬‬0 ℎ 𝑡 − 𝜏 𝑢 𝜏 𝑑𝜏
𝑡 ∞

=න ℎ 𝑡−𝜏 ෍ 𝑢 𝑘𝑇 𝛿 𝜏 − 𝑘𝑇 𝑑𝜏
0 𝑘=0

Repetitions of the CT function each in


the location of an impulse in the train
U(s) U*(s) Y(s)
H(s)

10
Sampled Output
• Change the order of summation and integration
∞ 𝑡
𝑦 𝑡 = ෍ 𝑢 𝑘𝑇 න ℎ 𝑡 − 𝜏 𝛿 𝜏 − 𝑘𝑇 𝑑𝜏
𝑘=0 0

= ෍ 𝑢 𝑘𝑇 ℎ 𝑡 − 𝑘𝑇
𝑘=0
• Sample and transform

𝑦 𝑖𝑇 = ෍ 𝑢 𝑘𝑇 ℎ 𝑖𝑇 − 𝑘𝑇 , 𝑖 = 0, 1, 2, …
𝑘=0

𝑌 𝑧 =𝐻 𝑧 𝑈 𝑧 , 𝑌 ∗ 𝑠 = 𝐻∗ 𝑠 𝑈∗ 𝑠
11
Transfer Function for Cascade
• Cascade not separated by samplers: components cannot
be separated after sampling.
• Cascade separated by samplers: each block has a
sampled output and input as well as a z-domain transfer
function.
• 𝑛 blocks not separated:
𝑌 𝑠 = 𝐻 𝑧 𝑈 𝑧 = 𝐻1 𝐻2 … 𝐻𝑛 𝑧 𝑈 𝑧
• 𝑛 blocks separated:
𝑌 𝑠 = 𝐻 𝑧 𝑈 𝑧 = 𝐻1 𝑧 𝐻2 𝑧 … 𝐻𝑛 𝑧 𝑈 𝑧
12
Example
Find the equivalent sampled impulse response
sequence and the equivalent z-transfer
function for the cascade of the two analog
systems with sampled input
(a) If the systems are directly connected.
(b) If the systems are separated by a sampler.
1 2
𝐻1 𝑠 = , 𝐻2 𝑠 =
𝑠+2 𝑠+4

13
(a) Systems Directly Connected
2 1 1
𝐻 𝑠 = = −
𝑠+2 𝑠+4 𝑠+2 𝑠+4
• Impulse response ℎ 𝑡 = 𝑒 −2𝑡 − 𝑒 −4𝑡
• Sampled impulse response
ℎ 𝑘𝑇 = 𝑒 −2𝑘𝑇 − 𝑒 −4𝑘𝑇 , 𝑘 = 0,1,2, …
• z-transfer function
𝑧 𝑧 𝑒 −2𝑇 − 𝑒 −4𝑇 𝑧
𝐻 𝑧 = −2𝑇
− −4𝑇
=
𝑧−𝑒 𝑧−𝑒 𝑧 − 𝑒 −2𝑇 𝑧 − 𝑒 −4𝑇
14
(b) Systems Separated By Samplers
𝑧 2𝑧
𝐻1 𝑧 = −2𝑇
, 𝐻2 𝑧
𝑧−𝑒 𝑧 − 𝑒 −4𝑇
2𝑧 2
𝐻 𝑧 =
𝑧 − 𝑒 −2𝑇 𝑧 − 𝑒 −4𝑇
2 𝑒 −2𝑇 𝑧 𝑒 −4𝑇 𝑧
• Partial fractions 𝐻 𝑧 = −
𝑒 −2𝑇 −𝑒 −4𝑇 𝑧−𝑒 −2𝑇 𝑧−𝑒 −4𝑇
• Impulse response sequence
2 −2𝑇 𝑒 −2𝑘𝑇 − 𝑒 −4𝑇 𝑒 −4𝑘𝑇
ℎ 𝑘𝑇 = −2𝑇 𝑒
𝑒 − 𝑒 −4𝑇
2 −2 𝑘+1 𝑇 − 𝑒 −4 𝑘+1 𝑇 , 𝑘 = 0,1,2, …
= −2𝑇 𝑒
𝑒 − 𝑒 −4𝑇
15
TF for DAC, Analog Subsystem,
ADC Combination
𝐺 𝑠 −𝑠𝑇
𝐺𝑍𝐴 𝑠 = 𝐺 𝑠 𝐺𝑍𝑂𝐻 𝑠 = 1−𝑒
𝑠
𝑔𝑍𝐴 𝑡 = 𝑔 𝑡 ∗ 𝑔𝑍𝑂𝐻 𝑡 = 𝑔𝑠 𝑡 − 𝑔𝑠 𝑡 − 𝑇
−1
𝐺 𝑠
𝑔𝑠 𝑡 = L
𝑠

T
kT Zero-order kT (k+1)T Analog
Hold Subsystem

16
Impulse Response of DAC and
Analog Subsystem
1.5
1.0

1.0 0.8
Positive Step

0.5 0.6

0.0 0.4

0.5
0.2
Delayed Negative Step

1.0 0.0

1.5
0.2
0 2 4 6 8 1 0 2 4 6 8 10
time s time s

(a) Response of analog (b) Response of analog


system to step inputs. system to a unit pulse input. 17
Sample & z-Transform
• Sampled impulse response
𝑔𝑍𝐴 𝑘𝑇 = 𝑔𝑠 𝑘𝑇 − 𝑔𝑠 𝑘𝑇 − 𝑇
• z-transfer function of DAC (zero-order hold),
analog subsystem, ADC (ideal sampler) cascade
𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1 Z 𝑔𝑠∗ 𝑡
𝐺 𝑠 ∗
= 1−𝑧 −1
Z L −1
𝑠

• Simplify Notation
𝐺 𝑠
𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1
Z
𝑠
18
Example
Find the z-domain transfer function for ADC,
DAC, and the shown series R-L circuit with the
inductor voltage as output.

R
L
Vin Vo

19
Solution
𝑉𝑜 𝐿𝑠 𝐿/𝑅 𝑠
• Voltage divider = =
𝑉𝑖𝑛 𝐿𝑠+𝑅 𝐿/𝑅 𝑠+1
𝑉𝑜 𝜏𝑠 𝐿
= ,𝜏 =
𝑉𝑖𝑛 𝜏𝑠 + 1 𝑅
𝐺 𝑠
• Use 𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1
Z
𝑠
1
𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1
Z
𝑠+1/𝜏
𝑧−1 𝑧 𝑧−1
= −𝑇/𝜏
=
𝑧 𝑧−𝑒 𝑧 − 𝑒 −𝑇/𝜏
20
Example
Find the z-domain transfer function of an
amplifier, an armature controlled DC motor,
ADC and DAC if the s-domain transfer
function of the motor and amplifier is
𝜃 𝑠 𝐾
𝐺 𝑠 = =
𝑉𝑖𝑛 𝑠 𝑠 𝜏𝑚 𝑠 + 1

21
Solution
𝐺 𝑠 𝐾/𝜏𝑚
= 2
𝑠 𝑠 𝑠 + 1Τ𝜏𝑚
• Partial fraction expansion
𝐺 𝑠 𝐴11 𝐴12 𝐴2
=𝐾 2 + +
𝑠 𝑠 𝑠 𝑠 + 1Τ𝜏𝑚
1Τ𝜏𝑚 𝑑 1Τ𝜏𝑚
𝐴11 = ቉ = 1, 𝐴12 = ቉ = −𝜏𝑚
𝑠 + 1Τ𝜏𝑚 𝑠=0 𝑑𝑠 𝑠 + 1Τ𝜏𝑚 𝑠=0
1Τ𝜏𝑚
𝐴2 = 2 ቉ = 𝜏𝑚
𝑠 𝑠=−1Τ𝜏 𝑚
22
Solution (Cont.)
𝐺 𝑠
• Use 𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1 Z
𝑠
1 𝜏𝑚 𝜏𝑚
𝐺𝑍𝐴𝑆 𝑧 = 1− Z 𝐾 2 −
𝑧 −1 +
𝑠 𝑠 𝑠 + 1Τ𝜏𝑚
𝑇Τ𝜏𝑚 𝑧−1
= 𝐾𝜏𝑚 −1+
𝑧−1 𝑧 − 𝑒 −𝑇Τ𝜏𝑚
𝐺𝑍𝐴𝑆 𝑧
𝑇Τ𝜏𝑚 + 𝑒 −𝑇Τ𝜏𝑚 − 1 𝑧 + 1 − 𝑒 −𝑇Τ𝜏𝑚 𝑇Τ𝜏𝑚 + 1
= 𝐾𝜏𝑚
𝑧 − 1 𝑧 − 𝑒 −𝑇Τ𝜏𝑚

23
Systems with Transport Lag
• Transfer function for systems with a transport delay
𝐺 𝑠 = 𝐺𝑎 𝑠 𝑒 −𝑇𝑑 𝑠
𝑇𝑑 = 𝑙𝑇 − 𝑚𝑇, 0 ≤ 𝑚 < 1,
𝑇𝑑 𝑇𝑑
𝑙= = positive integer, 𝑚=𝑙−
𝑇 𝑇
Example: time delay = 3.1 s, 𝑇 = 1 𝑠
 𝑙 = 4 and 𝑚 = 0.9

− 𝑙−𝑚 𝑇𝑠
𝐺𝑎 𝑠 𝑒
𝐺𝑍𝐴𝑆 𝑧 = 1 − 𝑧 −1
Z L −1
𝑠
24
Delay Theorem

𝐺𝑎 𝑠 𝑚𝑇𝑠
𝐺𝑍𝐴𝑆 𝑧 = 𝑧 −𝑙
1−𝑧 −1
Z L −1
𝑒
𝑠
𝐺𝑎 𝑠
• Define the transfer function 𝐺𝑠 𝑠 =
𝑠

• Advance theorem of Laplace transforms


𝑚𝑇𝑠 ∗
𝐺𝑍𝐴𝑆 𝑧 = 𝑧 −𝑙
1−𝑧 −1
Z L −1
𝐺𝑠 𝑠 𝑒
= 𝑧 −𝑙 1 − 𝑧 −1 Z 𝑔𝑠 𝑘𝑇 + 𝑚𝑇 25
Use Modified z-Transform
𝐺𝑍𝐴𝑆 𝑧 = 𝑧 −𝑙 𝑧 − 1 Z𝑚 𝑔𝑠 𝑘𝑇
• Causal time function 𝑔𝑠 𝑡 = 𝐴0 + σ𝑛𝑖=1 𝐴𝑖 𝑒 −𝑝𝑖 𝑡
• Sampling & shifting
𝑛

𝑔𝑠 𝑘𝑇 + 𝑚𝑇 = 𝐴0 𝟏 𝑘𝑇 + 𝑚𝑇 + ෍ 𝑒 −𝑝𝑖 𝑘𝑇+𝑚𝑇

𝑖=1
• Shifting a step function has no effect on
samples, shifting a decaying exponential does.

26
Modified z-Transform
𝑛
𝐴0 𝐴𝑖 𝑒 −𝑝𝑖𝑚𝑇
Z𝑚 𝑔𝑠 𝑘𝑇 = +෍
𝑧−1 𝑧 − 𝑒 −𝑝𝑖𝑇
𝑖=1
• Transfer function
𝑛
𝐴0 𝐴𝑖 𝑒 −𝑝𝑖𝑚𝑇
𝐺𝑍𝐴𝑆 𝑧 = 𝑧 −𝑙 𝑧−1 +෍
𝑧−1 𝑧 − 𝑒 −𝑝𝑖𝑇
𝑖=1

27
Example

If the sampling period is 0.1 s, determine


the z-transfer function for the ADC, DAC
and analog transfer function
3𝑒 −0.31𝑠
𝐺 𝑠 =
𝑠+3

28
Solution
• Delay in terms of the sampling period 𝑇𝑑 = 𝑙𝑇 − 𝑚𝑇
𝑇𝑑
• Integer 𝑙 = = 3.1 = 4
𝑇
𝑇𝑑 0.31
𝑚=𝑙− =4− = 0.9
𝑇 0.1
3 1 1
• Partial fraction expansion 𝐺𝑠 𝑠 = = −
𝑠 𝑠+3 𝑠 𝑠+3
• z-transfer function
−0.3×0.9
1 𝑒
𝐺𝑍𝐴𝑆 𝑧 = 𝑧 −4 𝑧 − 1 −
𝑧 − 1 𝑧 − 𝑒 −0.3
−4
0.2366𝑧 + 0.02256
𝐺𝑍𝐴𝑆 𝑧 = 𝑧
𝑧 − 0.741 29
CT Function 𝑔𝑠 𝑡
𝑔𝑠 𝑡 1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
0 0.5 1 1.5 2

t s
30
Block Diagram of Single-loop
Digital Control System

R(z) + E(z) U(z) Y(z)


C(z) GZAS(z)

31
Closed-loop Transfer Function
𝐶 𝑧 𝐺𝑍𝐴𝑆 𝑧
𝐺𝑐𝑙 𝑧 =
1 + 𝐶 𝑧 𝐺𝑍𝐴𝑆 𝑧
• CL characteristic equation
1 + 𝐶 𝑧 𝐺𝑍𝐴𝑆 𝑧 = 0
• Closed-loop System Poles
• Roots of the characteristic equation
(selected for desired time response
specifications as in s-domain design)
32
MATLAB Commands
z-transfer function for ADC, DAC & analog
subsystem.
>> g= tf(num, den) % Enter analog transfer function
>> gd= c2d(g,T, 'method') % Sampling period T
'method' = method to obtain the digital transfer
function

33
MATLAB Example
𝐺 𝑠 = 2𝑠 2 + 4𝑠 + 3 ൗ 𝑠 3 + 4𝑠 2 + 6𝑠 + 8

>> g = tf( [2,4,3], [1,4,6,8])


>> gd= c2d(g, 0.1, 'zoh') % zero-order hold
>> gd = c2d(g, 0.1, 'foh') % first-order hold
>> gd = c2d(g, 0.1, 'impulse') % z-transform ×T

34
Transport Delay
>> g=tf(3,[1,3],'InputDelay', 0.31)
Transfer function:
3
exp(-0.31*s) * -------
s+3
>> c2d(g,.1)
Transfer function:
0.2366 z + 0.02256
z^(-4) * -----------------------
z - 0.7408 35