Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

KON 509E: Design of Discrete Control Systems

Digital System Modeling

Assist. Prof. Dr. İlker Üstoğlu


3.1 Introduction
• To analyze and design a controller for a sampled control system, we need a discrete time
model that represents the analog domain.

• Things to handle
• Sampler and Latch (Hold) dynamics
• Handling discrete, sampled and continuous signals and systems
• Proper Setting Sampling Time 𝑇
• z-domain representation of the model
Slide 2
3.2 Sampling
• Sampling is necessary for the processing of analog data using digital elements.

• Successful digital data processing requires that the samples reflect the nature of the
analog signal and that analog signals be recoverable from a sequence of samples.

Slide 3
3.2 Sampling
• In signal processing one is interested in making the difference between the original and
the reconstructed signal as small as possible (=high fidelity)
• In theory, for signals,
• Shannon's Sampling Method (Nyquist)
• 𝜔𝑠 ≥ 2𝜔1 (maximum allowable frequency)
2𝜋
• 𝜔𝑠 = 2𝜋𝑓𝑠 = 𝑇

Slide 4
3.2 Sampling: How to set "the Sampling Time"?
• In theory, for signals,
• Shannon's Sampling Method (Nyquist)
• 𝜔𝑠 ≥ 2𝜔1 (maximum allowable frequency)
2𝜋
• 𝜔𝑠 = 2𝜋𝑓𝑠 = 𝑇
• Define an sampled impulse train

𝒆∗ 𝑡 = 𝑒 0 𝛿 𝑡 + 𝑒 1 𝛿 𝑡 − 𝑇 + 𝑒 2 𝛿 𝑡 − 2𝑇 + ⋯ = 𝑒 𝑘𝑇 𝛿 𝑡 − 𝑘𝑇
𝑘=0
• Now if we take the Laplace transform

𝐸∗ 𝑠 = 𝑒 𝑘𝑇 𝑒 −𝑠𝑘𝑇
𝑘=0
Note that ℒ 𝛿 𝑡 − 𝑇 = 𝑒 −𝑠𝑇

Slide 5
3.2 Sampling: How to set "the Sampling Time"?
• 𝐸 ∗ 𝑠 is periodic

𝐸 ∗ 𝑠 + 𝑗𝑚𝑤𝑠 = 𝑒 𝑘𝑇 𝑒 −(𝑠+𝑗𝑚𝑤𝑠)𝑘𝑇 = 𝐸 ∗ 𝑠
𝑘=0
• Because
𝑒 −𝑘𝑇 𝑗𝑚𝜔𝑠 = 𝑒 −𝑘𝑚 𝑗𝑇𝜔𝑠 = 𝑒 −𝑘𝑚(𝑗𝑇×2𝜋/𝑇) = 1
2𝜋
where 𝜔𝑠 = 𝑇

Slide 6
3.2 Sampling: How to set "the Sampling Time"?
• Aliasing is the phenomenon for which frequencies 𝑤 > 𝜔𝑠 make contributions in the
frequency range [−𝜔𝑠 /2, 𝜔𝑠 /2]
• Under aliasing conditions it is impossible to reconstruct the original signal

Slide 7
3.2 Sampling
• In signal processing one is interested in making the difference between the original and
the reconstructed signal as small as possible (=high fidelity)
• In control systems one is interested that the closed-loop system behaves according to
specs, not much in carefully reconstructing 𝑒(𝑡) = 𝑦(𝑡) − 𝑟(𝑡) !
• For control purposes, the sampling time is mainly related to the closed-loop bandwidth /
settling-time
• The sampling time used in control is typically larger than the one used signal processing

Slide 8
3.2 Sampling: How to set "the Sampling Time"?
• In theory, for signals,
• Shannon's Sampling Method (Nyquist)
• 𝜔𝑠 ≥ 2𝜔1 (maximum allowable frequency)
2𝜋
• 𝜔𝑠 = 2𝜋𝑓𝑠 = 𝑇
• In practice, for dynamic systems,

𝜔𝑠 = 6 ÷ 25 𝜔1
𝑓𝑠 = 6 ÷ 25 𝑓1
𝑇 = 0.04 ÷ 0.16 𝑇1
1 𝑇1
𝑇= =
6 ÷ 25 𝑓1 6 ÷ 25
Now how to define "𝜔1 "?

Slide 9
3.2 Sampling: How to set "the Sampling Time"?
• Now how to define "𝜔1 "?
• Two possible settings of many
• The maximum frequency component of the “dominant” complex pole
• The Bandwidth 𝜔1 =𝜔𝐵𝑊
• Might still have problems
• High order system dynamics, Time delay, Zero dynamics
• Bandwidth: It is frequency vale of 𝐺 𝑗𝑤 where |𝐺(𝑗𝜔)| reduces 70.7% (roughly speaking)
• It defines the frequency interval in which "all" the transient-state dynamics occur
• If BW↗ --> Fast system response
• If BW↘--> Slow system response
• How to calculate the BW?

Slide 10
3.2 Sampling: How to set "the Sampling Time"?
• Bandwidth: It is frequency value of 𝐺 𝑗𝑤 , 𝑤𝐵𝑊 , where |𝐺(𝑗𝜔)| reduces 70.7% (roughly
speaking)
• It defines the frequency interval in which "all" the transient-state dynamics occur
• If BW↗ --> Fast system response
• If BW↘--> Slow system response

• How to calculate the BW?


1
𝐺 𝑠 |𝑠=𝑗𝜔 = 𝐺 𝑗𝜔 → 𝐺 𝑗𝜔 = = 0.707
2
• Why 0.707?

Slide 11
3.2 Sampling: How to set "the Sampling Time"?
• Let us consider the generic 1st order
transfer function given by
𝐾
𝐺 𝑠 =
𝜏𝑠 + 1
where 𝜏 = 1/𝑎 is the time constant
and 𝐾 is the gain.

• Remember the effect of 𝝉 on the


system response?
• 63% of final value-> time constant!
• Settling time! 𝑇𝑠 = 3~4𝜏

Slide 12
3.2 Sampling: How to set "the Sampling Time"?
• Bandwidth of first order systems
1
𝐺 𝑠 =
𝜏𝑠 + 1
𝐺 𝑠 = 𝐺 𝑗𝜔
𝑠=𝑗𝜔
1 1
𝐺 𝑗𝜔 = =
𝜏2 𝜔 2 +1 2

1
𝜔𝐵𝑊 =
𝜏

Slide 13
3.2 Sampling: How to set "the Sampling Time"?
• Bandwidth of first order systems
1
𝐺 𝑠 =
𝜏𝑠 + 1
𝐺 𝑠 = 𝐺 𝑗𝜔
𝑠=𝑗𝜔
1 1
𝐺 𝑗𝜔 = =
𝜏2 𝜔 2 +1 2

1
𝜔𝐵𝑊 =
𝜏
• Now, we can define
1 2𝜋𝜏 6𝜏 𝜏 𝝉
𝑇= = ≅ = → <𝑻<𝝉
6 ÷ 25 𝑓1 6 ÷ 25 6 ÷ 25 1 ÷ 4 𝟒

Slide 14
3.2 Sampling: How to set "the Sampling Time"?
• Now, we can define
1 2𝜋𝜏 6𝜏 𝜏 𝝉
𝑇= = ≅ = → <𝑻<𝝉
6 ÷ 25 𝑓1 6 ÷ 25 6 ÷ 25 1 ÷ 4 𝟒

• The sampling time selection is directly related to the pole location!

• Question: What if the system is as follows:

𝜏𝑎 𝑠 + 1
𝐺 𝑠 =
𝜏𝑠 + 1

• Bode diagram, zero dynamics…

Slide 15
3.2 Sampling: How to set "the Sampling Time"?
• Let us consider the generic 2nd
order transfer function given by
𝐾𝑤𝑛2
𝑮 𝒔 = 2
𝑠 + 2𝜁𝑤𝑛 𝑠 + 𝑤𝑛2
where 𝒘𝒏 is the natural frequency,
𝜁 is the damping ratio
and 𝑲 is the gain.

• Remember the effect of 𝒘𝒏 and


𝜁 on the time response?

Slide 16
3.2 Sampling: How to set "the Sampling Time"?
In control system design, we "usually" prefer to design a system with
0.7 ≤ 𝜁 ≤ 1

Slide 17
3.2 Sampling: How to set "the Sampling Time"?
• Bandwidth of second order systems
𝑤𝑛2
𝐺 𝑠 = 2
𝑠 + 2𝜁𝑤𝑛 𝑠 + 𝑤𝑛2
𝐺 𝑠 = 𝐺 𝑗𝜔
𝑠=𝑗𝜔
1
𝐺 𝑗𝜔 =⋯=
2
𝑤𝐵𝑊 = 𝑤𝑛 1 − 2𝜁 2 + 4𝜁 4 − 4𝜁 2 + 2

Slide 18
3.2 Sampling: How to set "the Sampling Time"?
• Frequency Response (𝑲=1)
1
𝐺 𝑗𝑤 =
(𝑗𝑤/𝑤𝑛 )2 +2𝜁𝑤𝑛 (𝑗𝑤/𝑤𝑛 ) + 1

Slide 19
3.2 Sampling: How to set "the Sampling Time"?
• Now, we can define
• If 𝜁 = 0.7, then
𝑤𝐵𝑊 ≈ 𝑤𝑛 → 0.25 ≤ 𝜔𝑛 𝑇 ≤ 1
• If 𝜁 = 1, then
𝑤𝐵𝑊 ≈ 0.6𝑤𝑛 → 0.4 ≤ 𝜔𝑛 𝑇 ≤ 1.75
• Roughly, we can define now
0.7 ≤ 𝜁 ≤ 1 → 0.25 ≤ 𝜔𝑛 𝑇 ≤ 1.75
• The sampling time selection is directly related to the pole location!
• Question: What if the system is as follows:
(𝜏𝑠 + 1)𝑤𝑛2
𝐺 𝑠 = 2
𝑠 + 2𝜁𝑤𝑛 𝑠 + 𝑤𝑛2
• Bode diagram, zero dynamics…

Slide 20
3.2 Sampling: How to set "the Sampling Time"?
• Sampling period is selected by considering
• Command tracking performance & Disturbance rejection
• The choice is further refined by taking into account the properties of hardware.
• High sampling frequencies may not necessarily yield good performance for every system

Slide 21
3.2 Sampling: Sampled Impulse Response

Slide 22
3.2 Sampling: Sampled Impulse Response

Slide 23
3.2 Sampling: Impulse Response

• 𝐺 𝑧 is the impulse invariant transfer function representation


• To obtain 𝐺 𝑧 , employ the Partial Fraction expansion and table look-up method to 𝐺 𝑠
• Example
1 𝑧
𝐺 𝑠 = →𝐺 𝑧 =
𝑠+𝑎 𝑧 − 𝑒 −𝑎𝑇
Slide 24
3.3 Sampling and Holding Dynamics: Zero-Order Hold
• Zero-order-hold (ZOH) is the interface between the digital and analog world.
• Also named as Step invariant hold
• It holds the sampled sequence for one sampling period (T)
• Easy to implement

• The system response 𝐺𝑧𝑜ℎ (𝑠) is basically the subtraction of step signal from its one sample
delayed version. Thus,
1 − 𝑒 −𝑠𝑇
𝐺𝑧𝑜ℎ 𝑠 =
𝑠

Slide 25
3.3 Sampling and Holding Dynamics: First-Order Hold
• First-order-hold (FOH) and other higher-order methods are
developed to overcome the representation difficulties associated
with ZOH.
• FOH is also named as Ramp invariant hold
• Performs linear interpolation between two samples
• it requires the future (one-step ahead) value of its input m(k),it is
very difficult to implement it in practice

1 − 𝑒 −𝑠𝑇 2
𝐺𝑓𝑜ℎ 𝑠 =
𝑇𝑒 −𝑠𝑇 𝑠 2

Slide 26
3.3 Sampling and Holding Dynamics: System Response

• Now,
𝐵 𝑧 /𝑀 𝑧 = 𝐺 𝑧 = 𝑍{𝐺𝑍𝑂𝐻 𝑠 𝐺1 𝑠 𝐺2 𝑠 𝐻 𝑠 }
• Then, as
1 − 𝑒 −𝑠𝑇 1 − 𝑧 −1
𝐺𝑍𝑂𝐻 𝑠 = =
𝑠 𝑠
• We can define
𝐺1 𝑠 𝐺2 𝑠 𝐻 𝑠
𝐺 𝑧 = 1− 𝑧 −1 𝑍
𝑠
𝐺1 𝑠 𝐺2 𝑠 𝐻 𝑠
• To obtain 𝐺 𝑧 , take the z-transform of 𝑠

Slide 27
3.3 Sampling and Holding Dynamics: System Response
𝐺1 𝑠 𝐺2 𝑠 𝐻 𝑠
𝐺 𝑧 = 1 − 𝑧 −1 𝑍
𝑠
𝐺1 𝑠 𝐺2 𝑠 𝐻 𝑠
• To obtain 𝐺 𝑧 , take the z-transform of 𝑠
• Example
1 1 − 𝑒 −𝑎𝑇 1
𝐺 𝑠 = →𝐺 𝑧 =
𝑠+𝑎 𝑎 𝑧 − 𝑒 −𝑎𝑇
• 𝐺 𝑧 is the step invariant transfer function representation

• In a similar manner, if FOH is employed then the resulting 𝐺 𝑧 is the ramp invariant
transfer function representation

Slide 28
3.3 Sampling and Holding Dynamics: State Space Models
• Consider the continuous-time system
𝑥 (𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡)
𝑦(𝑡) = 𝐶𝑥(𝑡) + 𝐷𝑢(𝑡)
𝑥(0) = 𝑥0
• We want to define the value of 𝑥(𝑡), 𝑦(𝑡) at the time instants 𝑡 = 0, 𝑇, 2𝑇, . . . , 𝑘𝑇, . . . , under
the assumption that the input 𝑢(𝑡) is constant during each sampling interval (zero-order
hold, ZOH)
𝑢(𝑡) = 𝑢(𝑘), 𝑘𝑇 ≤ 𝑡 < 𝑘 + 1 𝑇
• 𝑥(𝑘) ≜ 𝑥 𝑘𝑇 and 𝑦(𝑘) ≜ 𝑦 𝑘𝑇 are the state and the output samples at the 𝑘 𝑡ℎ sampling
instant, respectively

Slide 29
3.3 Sampling and Holding Dynamics: State Space Models
• Let us evaluate the response of the continuous-time system between time 𝑡0 = 𝑘𝑇 and 𝑡 =
(𝑘 + 1)𝑇 from the initial condition 𝑥 𝑡0 = 𝑥 𝑘𝑇 using the time response
𝑡 (𝑘+1)𝑇
𝐴 𝑡−𝑡0 𝐴(𝑡−𝜎) 𝐴((𝑘+1)𝑇−𝑘𝑇
𝑥(𝑡) = 𝑒 𝑥 𝑡0 + 𝑒 𝐵𝑢(𝜎)𝑑𝜎 = 𝑒 𝑥 𝑘𝑇 + 𝑒𝐴 (𝑘+1)𝑇−𝜎
𝐵𝑢(𝜎)𝑑𝜎
𝑡0 𝑘𝑇
• Since the input 𝑢(𝑡) is piecewise constant, 𝑢 𝑡 = 𝑢 𝑘 , 𝑘𝑇 ≤ 𝑡 < 𝑘 + 1 𝑇, By setting 𝜏 = 𝜎 −
𝑘𝑇, we get
𝑇
𝑥 (𝑘 + 1)𝑇 = 𝑒 𝐴𝑇 𝑥 𝑘𝑇 + 𝑒𝐴 𝑇−𝜏
𝑑𝜏 𝐵𝑢 𝑘𝑇
0
• And thus
𝑇
𝑥(𝑘 + 1) = 𝑒 𝐴𝑇 𝑥(𝑘) + 𝑒𝐴 𝑇−𝜏 𝑑𝜏 𝐵 𝑢(𝑘)
0

Slide 30
3.3 Sampling and Holding Dynamics: State Space Models
• The discrete-time system
𝑥(𝑘 + 1) = 𝐴𝑥(𝑘) + 𝐵 𝑢(𝑘)
𝑦(𝑘) = 𝐶 𝑥(𝑘) + 𝐷 𝑢(𝑘)
• where
𝑇
𝐴≜ 𝑒 𝐴𝑇 , 𝐵 ≜ 𝑒𝐴 𝑇−𝜏 𝑑𝜏 𝐵, 𝐶 ≜ 𝐶, 𝐷 ≜ 𝐷
0
• If 𝑢(𝑡) is piecewise constant, 𝐴, 𝐵, 𝐶, 𝐷 provides the exact evolution of state and output
samples at discrete times 𝑘𝑇

Slide 31
3.4 Combined Analog/Discrete Control Systems: Open Loop

Slide 32
3.4 Combined Analog/Discrete Control Systems: Open Loop

Slide 33
3.4 Combined Analog/Discrete Control Systems: Open Loop

Slide 34
3.4 Combined Analog/Discrete Control Systems: Open Loop

Slide 35
3.4 Combined Analog/Discrete Control Systems: Closed Loop

Slide 36
3.4 Combined Analog/Discrete Control Systems: Closed Loop

Slide 37
3.4 Combined Analog/Discrete Control Systems: Closed Loop

Slide 38
3.4 Combined Analog/Discrete Control Systems: Problem

Slide 39
3.4 Combined Analog/Discrete Control Systems: Problem

Slide 40
3.4 Combined Analog/Discrete Control Systems: Problem

Slide 41

You might also like