0% found this document useful (0 votes)
4 views

Digital Control System

The document discusses the emulation of analog controllers in digital control systems, focusing on two main approaches: emulation and direct digital design. It explains how digital controllers approximate analog designs using difference equations and highlights the importance of analog-to-digital and digital-to-analog converters for interfacing with real-world signals. Additionally, it addresses the effects of sampling frequency and delay introduced by the D2A conversion on system performance and stability.

Uploaded by

dannyabe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Digital Control System

The document discusses the emulation of analog controllers in digital control systems, focusing on two main approaches: emulation and direct digital design. It explains how digital controllers approximate analog designs using difference equations and highlights the importance of analog-to-digital and digital-to-analog converters for interfacing with real-world signals. Additionally, it addresses the effects of sampling frequency and delay introduced by the D2A conversion on system performance and stability.

Uploaded by

dannyabe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 124

ECE4540/5540: Digital Control Systems 2–1

EMULATION OF ANALOG CONTROLLERS

2.1: Control design via time-domain emulation


■ There are two main approaches to digital controller design:

1. Emulation—we look at this now (two methods).


2. Direct digital design—subject of the rest of the course.
■ Emulation is when a digital computer approximates an analog
controller design.
■ Analog:
e(t) u(t)
r (t) D(s) G(s) y(t)

■ Digital:
w(t)
A2D D2A
e(t) e[k] u[k] zoh
u(t)
r (t) Q D(z) G(s) y(t)

v(t)

■ Analog controller computes u(t) from e(t) using differential equations.


■ Digital controller computes u(kT ) from e(kT ) using difference
equations.
■ To interface the computer controller to the “real world” we need an
analog-to-digital converter (to measure analog signals) and
digital-to-analog converter (to output signals).
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–2
■ Sampling and outputting usually done synchronously, at a constant
(system
rate. If sampling period = T, frequency = 1/T .
■ The signals inside the computer (the sampled signals) are noted as
y(kT ), or simply y [k]. y [k] is a discrete-time signal, where y(t) is a
continuous-time signal.
y(t) y(kT )

■ Discrete-time signals are usually converted to continuous-time


signals using a zero-order hold:

e.g., to convert u [k] to u(t).

■ We will spend more time on these topics as the course progresses.


Only a conceptual understanding is needed now.

“Digitization”

■ Continuous-time controllers are designed with Laplace-transform


techniques. The resulting controller is a function of “s”.
dx(t)
x(t) s y(t) =
dt

■ So, “s” is a derivative operator. There are several ways of


approximating this in discrete time. We look at one now called the
“forward rectangular” rule.
! δx(t) x(t + δt) − x(t)
ẋ(t) = lim = lim .
δt→0 δt δt→0 δt

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–3
■ If T is small,
x((k + 1)T ) − x(kT ) x[k + 1] − x[k]
ẋ(kT ) ≈ i.e., ẋ[k] ≈ .
T T
■ To use this approximation, we set T = t
k+1 − tk = sampling interval.

■ We “digitize” a controller D(s) by


1. Noting that controller output is related to controller input via
U (s) = D(s)E(s).
2. Performing term-by-term inverse Laplace transform to get a
differential equation relationship between u(t) and e(t)
n m
! dk u(t) ! dk e(t)
ak k
= bk k
.
k=0
dt k=0
dt
3. Replace derivatives with differences.
EXAMPLE :
U (s) s+a
■ Consider D(s) = = k0 ... a lead or lag controller.
E(s) s+b
1. (s + b)U (s) = k0(s + a)E(s).
2. u̇(t) + bu(t) = k0ė(t) + ak0e(t).
3. Use “forward rectangular rule” to digitize
" #
u[k + 1] − u[k] e[k + 1] − e[k]
+ bu[k] = k0 + ae[k]
T T
u[k + 1] = u[k] +
$ " #%
e[k + 1] − e[k]
T −bu[k] + k0 + ae[k]
T
u[k + 1] = (1 − bT )u[k] + k0(aT − 1)e[k] + k0e[k + 1].
■ Note that we often re-index the difference equation to be in more
familiar terms of “k” instead of “k + 1”
u[k] = (1 − bT )u[k − 1] + k0(aT − 1)e[k − 1] + k0e[k].
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–4
■ Present output of digital controller u[k] depends on previous output
u[k − 1] as well as the previous and current errors e[k − 1] and e[k].

Real-Time Controller Implementation

x = 0. (initialization of “past” values for first loop through)

Define constants:

α1 = 1 − bT .

α2 = k0 (aT − 1).

READ A/D to obtain y[k] and r [k].

e[k] = r [k] − y[k].

u[k] = x + k0 e[k].

OUTPUT u[k] to D/A and ZOH.

Now compute x for the next loop through:

x = α1 u[k] + α2 e[k].

Go back to “READ” when T seconds have elapsed since last READ.

■ Code is optimized to minimize latency between A2D read and D2A


write.
T
RCW I RCW I RCW I

R = read. W = write.
C = compute. I = idle.

■ Rule of thumb: Sampling frequency must be ≈ 30 times the


bandwidth of the analog system for comparable performance.
EXAMPLE : This one with numbers:
(s + 2) 1
■ Let D(s) = 70 , G(s) = .
(s + 10) s(s + 1)
■ Choose to try a sample rate of 20 Hz and also try 40 Hz.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–5

(Note,
] BW of analog system is ≈ 1 Hz or so).
1
➠ Use formula from before to digitize D(s).
■ 20 Hz: u[k + 1] = 0.5u[k] + 70e[k + 1] − 63e[k].
■ 40 Hz: u[k + 1] = 0.75u[k] + 70e[k + 1] − 66.5e[k].
Sampled at 20Hz Sampled at 40Hz
1.5 1.5
analog analog
digital digital
Plant output

Plant output
1 1

0.5 0.5

0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

Time (sec) Time (sec)


■ IMPORTANT NOTE: The closed loop system with digital controller
has poorer damping than the original analog system. This will always
be true when emulating an analog controller. We see why next . . .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–6
2.2: The importance of the D2A “hold” operation
u u(kT )
u(t)

avg. u(t)

■ Even if u(kT ) is a perfect re-creation of the output of the analog


controller at t = kT , the “hold” in the D2A causes an “effective delay.”
■ The delay is approximately equal to half of the sampling period: T /2.
■ Recall from frequency-response analysis and design, the magnitude
of a delayed response stays the same, but the phase changes:
T
!phase = −ω .
2
■ For the previous example, sampling now at 10 Hz, we have:
1
10
Magnitude

0
10

−1
10 −1 0 1 2
10 10 10 10
Phase (Deg)

−100
−120
−140
−160
−180 −1 0 1 2
10 10 10 10
Frequency (rad/sec)
■ The PM has changed from ≈ 50◦ to ≈ 30◦.
PM
■ ζ ≈ . . . ζ changed from 0.5 to 0.3 . . . much less damping.
100
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–7
1.5

Nominal
■ M p from about 20% to about

Plant output
1

30% . . .
■ Faster sampling. . . smaller T . . . 0.5

smaller delay. . . smaller change


in response. 0
0 0.2 0.4 0.6 0.8 1

Time (sec)

Root-locus view of the delay

■ Recall that we can model a delay using a Padé approximation.


T 1 − sT /4
delay −→ e−sT /2 ≈ .
2 1 + sT /4
■ Poles and zeros reflected about the jω-axis.

I(s)

As T → 0, delay dynamics → ∞.
4 4 R(s)

T T

1
■ Impact of delay: Suppose D(s)G(s) = .
s+a
I(s) I(s)
With
delay
−a R(s) ➠ 4 −a 4 R(s)

T T

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–8
■ Does the delayed locus make sense?
1 − sT /4 (sT /4 − 1)
=− .
1 + sT /4 (sT /4 + 1)
■ Gain is negative! We need to draw a 0◦ root locus, not the 180◦ locus
we are more familiar with.
■ Conclusion: Delay destabilizes the system.

PID Control via Emulation



P: u(t) = K e(t) ⎪
⎪ $ & t %
& t
K

⎬ 1
I: u(t) = e(τ ) dτ PID: u(t) = K e(t) + e(τ ) dτ + TD ė(t)
TI 0
0 TI ⎪ $ %

⎪ 1
⎭ or, u̇(t) = K ė(t) + e(t) + T ë(t) .
D: u(t) = K TD ė(t) D
TI
■Convert to discrete-time (use rule twice for ë(t)).
$" # " # %
T TD 2TD TD
u[k] = u[k−1]+K 1+ + e[k] − 1 + e[k − 1] + e[k − 2] .
TI T T T
EXAMPLE :
360000
G(s) = K = 5, TD = 0.0008, TI = 0.003.
(s + 60)(s + 600)
■ Bode plot of cts-time OL system D(s)G(s) with the above PID D(s)
shows that BW ≈ 1800 rad s−1 ≈ 320 Hz.

10 × BW ➠ T = 0.3 ms.

■ From above,
$ %
u[k] = u[k − 1] + 5 3.7667e[k] − 6.333e[k − 1] + 2.6667e[k − 2] .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–9
1.4
continuous
■ Performance not great, so tried 1.2 digital: T=0.3msec

Speed (rads/sec)
digital: T=0.1msec
again with T = 0.1 ms. Much 1

better. 0.8

0.6
■ Note, however, that the error is 0.4

mostly due to the rise time 0.2

being too fast, and the damping 0


0 2 4 6 8 10

too low. Time (msec)


1.5
continuous
digital: T=0.3msec

■ FIDDLE with parameters ➠ Speed (rads/sec) 1

increase K to slow the system


down; Increase TD to increase 0.5

damping. ➠ New K = 3.2, new


TD = 0.3 ms. 0
0 2 4 6 8 10

Time (msec)

KEY POINT: We can emulate a desired analog response using the


forward-rectangular rule, but the delay added to the system due to the
D2A hold circuit will decrease damping. This could even destabilize
the system!!! This delay can be minimized by sampling at a high rate.
(EXPENSIVE). Or, we can change the digital controller parameters,
as in the last example, to achieve the desired system performance
BUT NOT BY emulating the specific analog controller D(s).
■ How do we design the digital controller if we cannot use D(s) as a
prototype? Need Laplace-like tools for discrete-time.

THE z-TRANSFORM!

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–10
2.3: Definition of the z-transform

■ In ECE4510/5510, we saw that the Laplace transform is a very


powerful tool for analysis and design of analog control systems.
■ We are now looking at discrete-time (digital) control systems, and we
need a similar tool. Enter the z-transform. . .

DEFINITION: The (one-sided or unilateral) z-transform is defined as

X (z) = x(0) + x(T )z −1 + x(2T )z −2 + x(3T )z −3 + · · ·


!∞
= x(kT )z −k
k=0
" ∞
! #
or, X (z) = x[k]z −k .
k=0

■ Like the Laplace-transform variable “s,” the z-transform variable “z” is


a complex number.
■ Like the Laplace-transform, convergence of the transform is an
important consideration.

• For the above definition of the z-transform, convergence is always


of the form
X (z) = something, |z| > ρ,
where ρ is a disc on the z-plane.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–11

EXAMPLE : Define the digital impulse (unit pulse) function to be


+
1, k = 0;
δ[k] =
0, otherwise.
−4 −2 0 2 4 6 8
■ Note: This is very different from an analog impulse (e.g., δ[0] is
defined), but plays a similar role.

so, let x[k] = δ[k]


!∞
X (z) = x[k]z −k
k=0

= x[0]z 0 + x[1]z −1 + x[2]z −2 + · · ·

= x[0] = 1.

■ Since this sum converges to 1 regardless of the value of z,


ROC = {|z| > 0}.

EXAMPLE : Consider a delayed impulse:

−4 −2 0 2 4 6 8

x[k] = δ[k − kd ]

!
X (z) = x[k]z −k
k=0

= x[0] + x[1]z −1 + · · · + x[kd ]z −kd + · · ·

= x[kd ]z −kd = z −kd .


■ Again, ROC = {|z| > 0}.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–12

EXAMPLE : Let x[k] be the discrete unit-step function.


+
1, k ≥ 0;
x[k] = 1[k] =
0, otherwise.

!
1(z) = 1[k]z −k
k=0
−4−2 0 2 4 6 8

!
= z −k = 1 + z −1 + z −2 + · · ·
k=0
■ Multiply both sides of this equation by (z − 1).
(z − 1)1(z) = (z + 1 + z −1 + z −2 + · · · ) − (1 + z −1 + z −2 + · · · )

= z − z −∞ (in the limit)

=z if |z| > 1.
z
so 1(z) = , ROC = {|z| > 1}.
z−1
EXAMPLE : Let x[k] = a k 1[k] where a is a complex number.

!
X (z) = a k z −k
k=0

= 1 + az −1 + a 2 z −2 + · · · −4−2 0 2 4 6 8
■ Multiply both sides of this equation by (z − a).

(z − a)X (z) = (z + a + a 2 z −1 + · · · ) − (a + a 2 z −1 + a 3 z −2 + · · · )

= z − a ∞ z −∞ (in the limit)

=z if |z| > |a|


z
so X (z) = , ROC = {|z| > |a|}.
z−a

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–13
2.4: Delay properties of the z-transform

Linearity:
■ The standard linearity rule:
• If x[k] ↔ X (z) and v[k] ↔ V (z),
• Then ax[k] + bv[k] ↔ a X (z) + bV (z). (prove for yourself)
EXAMPLE : Let y[k] = 1[k] + a k 1[k].
■ Then,
z z 2z 2 − (1 + a)z
Y (z) = + = .
z−1 z−a (z − 1)(z − a)
Right shift in time (delay); Theorem 1:
■ Suppose x[k] ↔ X (z), and q is a positive integer.
y[k] = x[k − q]1[k − q]

!
Y (z) = x[k − q]1[k − q]z −k let k̄ = k − q
k=0

!
= x[k̄]1[k̄]z −(k̄+q)
k̄=−q

!
−q
=z x[k̄]z −k̄
k̄=0

= z −q X (z).
■ So, a delay of q samples multiplies the z-transform by z −q .
EXAMPLE : +
1, k = 0, 1, . . . N − 1;
p[k] =
0, otherwise.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–14
■ Note that p[k] = 1[k] − 1[k − N ].
■ By linearity and by the right-shift theorem,

P(z) = 1(z) − z −N 1(z)


z z
= − z −N
z−1 z−1
zN − 1
= N −1 .
z (z − 1)
Right shift in time (delay); Theorem 2:

■ The first delay theorem states: x[k − q]1[k − q] ⇐⇒ z −q X (z).


■ The second delay theorem states: x[k − q] ⇐⇒ . . .
■ The first version is generally used on causal signals. The second
version is generally used on non-causal signals or when analyzing
effect of systems that may have initial conditions.

x[k − 1] ⇐⇒ z −1 X (z) + x[−1]

x[k − 2] ⇐⇒ z −2 X (z) + x[−2] + z −1 x[−1]


...

x[k − q] ⇐⇒ z −q X (z) + x[−q] + z −1 x[−q + 1] + · · · + z −q+1 x[−1].

■ Proof for the first case:


!∞
x[k − 1] ⇐⇒ x[k − 1]z −k let k̄ = k − 1
k=0

!
= x[k̄]z −(k̄+1)
k̄=−1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–15

!
= x[−1] + x[k̄]z −(k̄+1)
k̄=0

= x[−1] + z −1 X (z). Proof of other cases by induction.

EXAMPLE : z-transform of LCCDE.


■ Many discrete-time systems are described by Linear Constant
Coefficient Difference Equations (LCCDEs). These are of the form
!n m
!
ai y[k − i] = bi x[k − i],
i =0 i =0
where n > m.
■ We can find the transfer function of this system by taking the
z-transform of both sides of this equation.
■ System transfer functions always assume zero initial conditions, so
we can use Delay Theorem 1.
! n m
!
ai z −i Y (z) = bi z −i X (z),
i =0 i =0
Y (z)
H (z) =
X (z)
,m −i
i =0 bi z
= ,n −i
.
a
i =0 i z
■ We can multiply numerator and denominator by z n to get it in terms of
positive powers of z.
EXAMPLE : Find the output of a system described by difference equation
y[k] + 0.5y[k − 1] = x[k],
where x[k] = 1[k] and y[−1] = 6.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–16
■ There are initial conditions, so we use Delay Theorem 2,
- −1 .
Y (z) + 0.5 z Y (z) + y[−1] = X (z)
z
Y (z)[1 + 0.5z −1] = −3
z−1
z − 3(z − 1)
Y (z) =
(z − 1)(1 + 0.5z −1)
3z − 2z 2
=
(z − 1)(z + 0.5)
−(8/3)z (2/3)z
= +
z + 0.5 z−1
2 8
y[k] = · 1[k] − (−0.5)k 1[k].
3 3

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–17
2.5: Time multiplication and the z-transform

Multiplication by k and k 2.

■ What happens when we multiply a time sequence x[k] by k or k 2?


■ Recall: ∞
!
X (z) = x[k]z −k .
k=0
■ Then,

d !
X (z) = −kx[k]z −k−1
dz k=0

!
−1
= −z kx[k]z −k .
/k=0 01 2
Y (z)

■ Thus,
d
kx[k] ⇐⇒ −z X (z).
dz
■ Also
2
d 2 2 d
k x[k] ⇐⇒ z X (z) + z 2 X (z).
dz dz
k z
EXAMPLE : Recall that a 1[k] ↔ .
z−a
" # $ %
d z −z 1 −a
= + =
dz z − a (z − a)2 z − a (z − a)2
az
so, ka k 1[k] ↔
(z − a)2
z
and, k1[k] ↔ . (ramp)
(z − 1)2
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–18
Multiplication by a k :

■ Multiply a time sequence x[k] by a k (a complex).



!
a k x[k] ↔ a k x[k]z −k
k=0

! 3 z 4−k
= x[k]
k=0
a
= X (z/a).

Multiplication by cos[ωk] and sin[ωk].

■ Multiply a time sequence x[k] by cos[ωk] or sin[ωk].


■ Recall from Euler’s theorem
e j ωk + e− j ωk e j ωk − e− j ωk
cos[ωk] = and sin[ωk] = .
2 2j
■ So,
1 5 6 1 5 6
cos[ωk]x[k] ⇐⇒ X e− j ω z + X e j ω z
2 2
1 5 − jω 6 1 5 jω 6
sin[ωk]x[k] ⇐⇒ X e z − X e z .
2j 2j
EXAMPLE : Find the z-transform of x[k] = cos[ωk]1[k].
z
■ Recall that 1[k] ⇐⇒ .
z−1
" #
1 e j ωz e− j ω z
X (z) = +
2 e j ω z − 1 e− j ω z − 1
" #
1 e j ω z(e− j ω z − 1) + e− j ω z(e j ω z − 1)
=
2 (e j ω z − 1)(e− j ω z − 1)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–19
" #
1 z 2 − e j ω z + z 2 − e− j ω z
=
2 z 2 − (e j ω + e− j ω)z + 1
z 2 − cos[ω]z
cos[ωk]1[k] ⇐⇒ 2 .
z − (2 cos[ω])z + 1
■ Also,
z sin[ω]
sin[ωk]1[k] ⇐⇒ .
z 2 − (2 cos[ω])z + 1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–20
2.6: Convolution, initial/final value and the z-transform

Convolution
■ Discrete-time convolution is analogous to continuous-time
convolution:
!k
(x ∗ v)[k] = x[i]v[k − i] k≥0
i =0
k
!
or, = v[i]x[k − i]. k ≥ 0.
i =0

■ Assuming that x[k] and v[k] are zero for negative k,



!
(x ∗ v)[k] = x[i]v[k − i] k≥0
i =0

7∞ 8
! !
⇐⇒ x[i]v[k − i] z −k
k=0 i =0
∞ !
! ∞
= x[i]v[k − i]z −k
i =0 k=0

7∞ 8
! !
= x[i] v[k − i]z −k k̄ = k − i
i =0 k=0
⎡ ⎤

! ∞
!
= x[i] ⎣ v[k̄]z −(k̄+i )⎦
i =0 k̄=−i
⎡ ⎤

! !∞
= x[i] ⎣ v[k̄]z −k̄ ⎦ z −i
i =0 k̄=0

= X (z)V (z).
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–21
Initial-value theorem
■ If x[k] ⇐⇒ X (z), x[0] = lim X (z).
z→∞
■ Proof:

!
X (z) = x[k]z −k
k=0

= x[0] + x[1]z −1 + x[2]z −2 + · · ·

as z → ∞, = x[0] + x[1] · 0 + x[2] · 0 + · · ·

= x[0].

■ Also,
x[1] = lim (z X (z) − zx[0])
z→∞
5 6
x[2] = lim z 2 X (z) − z 2 x[0] − zx[1]
z→∞
...

Final value theorem


■ Proof not too enlightening:
lim x[k] = lim (z − 1)X (z)
k→∞ z→1

assuming the limit on the left exists! Conditions for existence: All
poles of X (z) must be inside unit circle | pi | < 1 ∀ i, except possibly a
single pole on the unit circle at z = 1. The residue of the pole at z = 1
is the final value and is found from above.
EXAMPLE :
3z 2 − 2z + 4
■ Suppose X (z) = .
z 3 − 2z 2 + 1.5z − 0.5
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–22
■ Factoring the denominator:
3z 2 − 2z + 4
X (z) =
(z − 1)(z 2 − z + 0.5)
=
3z 2 − 2z + 4 ==
x ss = 2
(z − z + 0.5) = z=1
5
= = 10.
0.5

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–23
2.7: The inverse z-transform

1.] Power-series method:


z2 − 1
■ Suppose X (z) = ,
3
z + 2z + 4
■ Dividing:

6 z −1 +0z −2 −3z −3 −4z −4 ···


z 3 + 2z + 4 z2 −1
z2 +2 +4z −1
−3 −4z −1
−3 −6z −2 −12z −3
−4z −1 +6z −2 +12z −3
−4z −1 −8z −3 −16z −4
6z −2 +20z −3 +16z −4
...

■ So, X (z) = z −1 − 3z −3 − 4z −4 · · · .
■ and x[0] = 0, x[1] = 1, x[2] = 0, x[3] = −3, x[4] = −4, . . .

2.] Partial-fraction expansion


■ Recall that partial-fraction expansion was used to take
inverse-Laplace transforms of things like:
num(s)
H (s) = ,
den(s)
where the order of num(s) <order of den(s).
■ z-transforms almost always have the same order numerator and
denominator which requires modifying the technique slightly.
N (z)
■ Let X (z) = and let D(z) have distinct poles.
D(z)
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–24
X (z) N (z)
■ Do partial-fraction expansion on = .
z z D(z)
X (z) r0 r1 r2 rn
= + + + ···+
z z z − p1 z − p2 z − pn
$ %
X (z)
r0 = z = X (0)
z z=0
$ %
X (z)
ri = (z − pi ) i = 1, . . . , n.
z z= pi
■ So,
r1 z r2 z rn z
X (z) = r0 + + + ···+ .
z − p1 z − p2 z − pn
• Transforming: r0 ⇐⇒ r0 δ[k].
ri z
• Transforming: ⇐⇒ ri pik 1[k].
z − pi
• Note:
- .
r1 p1k + r̄1 p̄1k = 2 |r1| | p1|k cos k ̸ p1 + ̸ r1 k = 0, 1, . . .

if r1 and p1 complex.

EXAMPLE :

■ Suppose
z3 + 1
X (z) = 3
z − z2 − z − 2
z3 + 1
= 3 √ 43 √ 4
1 3
(z − 2) z + 2 + j 2 z + 2 − j 23
1

X (z) r0 r1 r̄1 r2
= + √ + √ + .
z z 1
z+2+ j 23 1
z+2− j 2 3 z − 2

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–25
■ Find the residues:
−1
r0 = X (0) =
2
⎡ ⎤
3

⎢ z +1 1⎥ 3 3
r1 = ⎣ 3 √ 4 ⎦ = +j
(z − 2) z + 12 − j 23 z √
7 21
z=− 12 − j 2
3

$ %
X (z) 9
r2 = (z − 2) = .
z z=2 14
■ So,
@ √ Ak @ √ Ak
1 1 3 1 3 9
x[k] = − δ[k]+r1 − −j 1[k]+r̄1 − + j 1[k]+ 2k 1[k].
2 2 2 2 2 14
■ Note: | p1| = 1, ̸ p1 = 4π/3. |r1| = 0.436, ̸ r1 = 10.89◦.
■ So,
" #
1 4π 9
x[k] = − δ[k] + 0.873 cos k + 10.89◦ 1[k] + (2)k 1[k].
2 3 14
Repeated poles:
■ There is a special rule for repeated poles, just as with
Laplace-transform partial-fraction expansion.
■ Suppose p1 is repeated “n” times.
X (z) r0 r1,1 r1,2 r1,n
= + + + · · · + + other poles
z z z − p1 (z − p1)2 (z − p1)n
■ Then, the residues are calculated as
$ %
X (z)
r1,n = (z − p1)n
z z= p1
$ " #%
1 d X (z)
r1,n−1 = (z − p1)n
1! dz z z= p1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–26
$ " #%
1 d2 n X (z)
r1,n−2 = (z − p 1 )
2! dz 2 z z= p1
...
$ n−1 " #%
1 d n X (z)
r1,1 = (z − p 1 ) .
(n − 1)! dz n−1 z z= p1
■ MATLAB’s residue command automates partial-fraction expansion:
num=[ ] % coefficients of numerator.
den=[] % coefficients of denominator.
[r,p,k]=residue(num,[den 0]) % don't forget '1/z'!

■ Or, there is a somewhat easier way:


num=[ ] % coefficients of numerator.
den=[] % coefficients of denominator.
[r,p,k]=residuez(num,den)

■ Be sure to type help residue or help residuez if there are


repeated roots to understand the format of the results that MATLAB
returns.

3.] Inversion formula:


■ A third way to invert a z-transform is to use the relationship:
B
1
x[k] = X (z)z k−1 dz
2π j )
where this is a counter-clockwise contour integral over the path ) in
the z-plane. ) must be in the region of convergence.
■ This looks terrible, but the theorem of residues makes it simpler. It
reduces to: ⎡ ⎤
!
[residues of X (z)z k−1]⎦ 1[k].
⎢ ⎥
x[k] = ⎣
all poles of X (z)z k−1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–27

■ For a simple pole of X (z)z k−1 at a, the residue is:


=
k−1 =
[residue]z=a = (z − a)X (z)z z=a
.

■ For a repeated pole of X (z)z k−1 at a, repeated m times,


1 dm−1 - m k−1
.
[residue]z=a = (z − a) X (z)z z=a
.
(m − 1)! dz m−1
EXAMPLE :
z
X (z) = .
(z − 1)(z − 2)
■ So,
$ = = %
z k == z k ==
x[k] = + 1[k]
z − 2 =z=1 z − 1 =z=2
- .
= −1 + 2k 1[k].

EXAMPLE :
z
X (z) = .
(z − 1)2
$ $ % %
1 d2−1 z
x[k] = 2−1
(z − 1)2 2
z k−1 1[k]
(2 − 1)! dz (z − 1) z=1
$ = %
d k ==
= z 1[k]
dz =z=1
=
= kz k−1=z=1 1[k]

= k1[k].

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–29
2.8: Time responses versus pole locations

■ We found that the Laplace-transform pole locations determined time


response. The same is true of the z-transform.
Unit step:

■ x[k] = 1[k].
z
■ X (z) = , |z| > 1.
z−1
−4−2 0 2 4 6 8

Exponential (geometric):

■ x[k] = a k 1[k], |a| < 1.


z
■ X (z) = , |z| > |a|.
z−a −4−2 0 2 4 6 8

General cosinusoid:

■ x[k] = a k cos[ωk]1[k], |a| < 1.


■ X (z) =
z(z − a cos ω)
, |z| > |a|. −4−2 0 2 4 6 8
z 2 − 2a(cos ω)z + a 2

■ The radius to the two poles is a.


■ The angle to the poles is ω.
■ The zero (not at the origin) has the same real part as the two poles.
z
■ Note: If ω = 0, X (z) = . . . exponential!
z−a
z
■ If ω = 0, a = 1, X (z) = . . . step!
z−1
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–30
■ Radius of pole locations is the exponential factor, and determines
settling time.

1. |a| > 1, Growing signal which will not decay.


2. |a| = 1, Signal with constant amplitude; either step or cosine.
3. |a| < 1, Decaying signal. Small a = fast decay (see below).

a ≈ duration N

0.9 43

0.8 21

0.6 9

0.4 5

4. |a| = 0, Finite-duration response. e.g., δ[k − N ] ⇐⇒ z −N .


■ Angle of pole locations, ω, determines number of samples per
oscillation.

• That is, require cos[ωk] = cos[ω(k + N )].


= =
2π =
= 360 ==
N= = samples/cycle.
ω =rad ω =deg
N =4 N =5

N =3 N =8
N = 10

N = 20

N =2

■ Solid lines are constant damping ratio ζ .


■ Dashed lines are constant natural frequency ωn .
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–31

I(z)

R(z)

Discrete Impulse Responses versus Pole Locations

Correspondence with continuous signals


■ Let x(t) = e−at cos(bt)1(t).
■ Suppose ⎫
a = 0.3567/T ⎬
π/4 T = sampling period.
b = ⎭
T
■ Then,
# "
5 πk 6
−0.3567 k
x[k] = x(kT ) = e cos 1[k]
4
" #
πk
= 0.7k cos 1[k].
4
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–32

(This is the example used previously).


■ X (s) has poles at s1,2 = −a + jb and −a − jb.
■ X (z) has poles at radius e−aT angle ω = ±bT or at e−aT ± j bT .
s1 T
• So, z 1,2 = e and es2 T .
■ In general, poles convert between the s-plane and z-plane via

z = esT .

EXAMPLE : Some corresponding pole locations:

π
j
T

π
−j
T
s-plane z-plane
■ jω-axis maps to unit circle.
■ Constant damping ratio ζ maps to strange spiral.

Good Good Good

Damping ζ Frequency ωn Settling Time

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–33
■ Higher-order systems:

• Pole moving toward z = 1, system slows down.

• Zero moving toward z = 1, overshoot.

• Pole and zero moving close to each other cancel.

Where from here?

■ We have now seen the most important aspects of z-transform theory.


■ Our next step is to start applying this theory to digital-controller
analysis and design.
■ We begin by revisiting the concept of emulating an analog
controller—what insight and techniques can we gain now that we
understand the z transform?
■ We then move on to direct digital control analysis and design.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–34
2.9: Emulation in frequency domain

■ With a further understanding of the z-transform, we are now in a


better position to understand “design-by-emulation”.
■ Can we design better D(z) to “emulate” D(s)?

• Qualified “yes”.

• Method: Numerical integration.

EXAMPLE : Consider
U (s) a
= D(s) = ,
E(s) s+a
or
u̇(t) + au(t) = ae(t).
■ Rewrite as
& t
u(t) = (−au(τ ) + ae(τ )) dτ
0
& (k−1)T & kT
u(kT ) = (−au(τ ) + ae(τ )) dτ + (−au(τ ) + ae(τ )) dτ
0 (k−1)T
& kT
= u ((k − 1)T ) + (−au(τ ) + ae(τ )) dτ .
/ (k−1)T 01 2
area of −au(τ )+ae(τ ) over kT −T ≤τ ≤kT

■ Can approximate this area several ways:

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–35
f (t)

Forward Rectangular Rule


Area ≈ f ((k − 1)T ) · T
t
kT
f (t)

Backward Rectangular Rule


Area ≈ f (kT ) · T
t
kT
f (t)
Trapezoid Rule
(a.k.a., Tustin Rule or Bilinear Rule)
f ((k − 1)T ) + f (kT )
t Area ≈ ·T
kT 2

Method 1: Use the forward-rectangular rule


■ Using the forward rectangular rule on our example:
u(kT ) ≈ u ((k − 1)T ) + T [−au ((k − 1)T ) + ae ((k − 1)T )]

= (1 − aT ) u ((k − 1)T ) + aT e ((k − 1)T )

■ The transfer function of this is :


U (z) = (1 − aT )z −1U (z) + aT z −1 E(z)

U (z) [z − 1 + aT ] = aT E(z)
U (z) a
= z−1 .
E(z) T
+ a
z−1
• “s” has been replaced by “ ”. Seen already as Euler’s rule.
T
Method 2: Use the backward-rectangular rule
■ Using the backward rectangular rule, we get a different result:
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–36
u(kT ) ≈ u ((k − 1)T ) + T [−au(kT ) + ae(kT )]

u(kT )(1 + aT ) = u ((k − 1)T ) + aT e(kT )


u ((k − 1)T ) + aT e(kT )
u(kT ) = .
1 + aT
■ Finding the transfer function:
(1 + aT )U (z) = z −1U (z) + aT E(z)
- .
U (z) 1 + aT − z −1 = aT E(z)
U (z) aT a a
= = 1−z −1
= z−1
.
E(z) 1 + aT − z −1 +a Tz
+a
T
z−1
• “s” has been replaced by “ ”.
Tz
Method 3: Use the bilinear/Tustin/trapezoid rule
■ Using the bilinear rule:
u(kT ) ≈ u((k − 1)T ) + (T /2) [−au((k − 1)T ) + ae((k − 1)T )

−au(kT ) + ae(kT )]
$ % $ %
aT aT aT
u(kT ) 1 + = u((k − 1)T ) 1 − + [e ((k − 1)T ) + e(kT )] .
2 2 2
■ Finding the transfer function:
$ % $ %
aT aT aT - .
U (z) 1 + = z −1U (z) 1 − + E(z) z −1 + 1
2 2 2
U (z) aT (z + 1) a
= = 2
- z−1 . .
E(z) (2 + aT )z + aT − 2 T z+1
+a
" #
2 z−1
• “s” has been replaced by “ ”.
T z+1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–37
2.10: Stability and prewarping

■ Each of these transformations maps the s-plane to the z-plane. How


do they compare?
■ Consider mapping s = jω (the stability boundary).

1. Forward rectangular rule:


z−1
s=
T
z = 1 + Ts

= 1 + T jω.
2. Backward rectangular rule:
z−1
s= ➠ z(T s − 1) = −1
Tz
1 1
z= =
1 − Ts 1 − T jω
" # " #
1 1 1 1 1 1 + T jω
= + − = + .
2 1 − T jω 2 2 2 1 − T jω
• The term in the parenthesis has magnitude 1 for all ω.

3. Bilinear rule:
" #
2 z−1
s=
T z+1
zT s + T s = 2z − 2

z(T s − 2) = −2 − T s
2 + Ts 2 + T jω
z= = .
2 − Ts 2 − T jω
• Constant magnitude 1 for all ω.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–38
COMMENTS :

■ Rule (1) may possibly map a stable D(s) into an unstable D(z) (!!)
■ Rule (2) always maintains stability (can even map an unstable D(s)
into a stable D(z) (!) but does not do a good job of mapping
frequency response, especially at high frequencies.
■ Rule (3) maps stability information EXACTLY (important later in the
course). The jω-axis in the s-plane mapped directly to the unit circle
in the z-plane. ω from 0 . . . ∞ mapped to an angle 0 . . . π. Frequency
compression/warping.
■ Since the bilinear/Tustin rule is by far the most used, let us examine
the frequency warping some more.
■ Let frequency in the digital domain be ωz , and corresponding
frequency in the analog domain be ωs .
■ Convert H (s) to H (z).

H (z) = H (s)|s= 2 z−1 .


T z+1

■ Let z = e j ωz T (a sinusoid of frequency ωz ).


5 6
H e j ωz T = H (s)|s= 2 e j ωz T −1
T e j ωz T +1

= H (s)|s= 2 3 e j ωz T/2 −e− j ωz T/2 4


T e j ωz T/2 +e− j ωz T/2

= H (s)|s= j 2 tan3 ωz T 4
T 2

" # " #
2 ωz T 2 ω s T
■ So, ω =
s tan and ωz = tan−1 .
T 2 T 2

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–39
■ Near ωz = 0, ωs ≈ ωz , but wz T
frequencies do not match π

anywhere else. Important?


■ What if H (s) is designed using ws
Bode techniques to have a certain
bandwidth? This bandwidth will be
−π
warped!
■ One solution: Redesign H (s) to take into account eventual warping.

1. We want our controller to have bandwidth = ωz1 .


2 ωz T
2. “Pre-warp” our design spec. ωs1 = tan 1 .
T 2
3. Design H (s) to have bandwidth ωs1 .
4. Convert H (s) to H (z) via bilinear transform. Bandwidth = ωz1 .
■ Note: ωz1 is just some critical frequency to be matched. It does not
need to be bandwidth.
■ Another solution: Force warped frequency axis to match at desired
frequency:
z−1
let s = α
z+1
H (z) = H (s)|s=α z−1
z+1
5 j ωz T 6
H e = H (s)|s=α e j ωz T −1
e j ωz T +1

= H (s)|s=α3 e j ωz T/2 −e− j ωz T/2 4


e j ωz T/2 +e− j ωz T/2

= H (s)|s= j α tan3 ωz T 4 .
2

ω1
■ So, ωs = α tan(ωz T /2). Let α = .
tan(ω1 T /2)
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–40
■ Then, at frequency ωz = ω1,
ω1
ωs = tan(ω1 T /2) = ω1.
tan(ω1 T /2)
■ A match! Drawback: Can match at only one frequency.
■ In MATLAB:
sysd=c2d(sys,T,'tustin'); % bilinear
sysd=c2d(sys,T,'prewarp',w1); % w/ freq. match.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–41
2.11: Examples and hold-based methods
1
EXAMPLE : Convert H (s) = to digital.
3 2
s + 2s + 2s + 1
z−1
Method 1) s = .
T
1
H (z) = (z−1)3 2
T3
+ 2 (z−1)
T2
+ 2 (z−1)
T
+1
T3
= 3
(z − 3z 2 + 3z 1 − 1) + 2T (z 2 − 2z + 1) + 2T 2(z − 1) + T 3
T3
= 3 .
z + z 2(2T − 3) + z 1(3 − 4T + 2T 2) + (2T − 2T 2 + T 3 − 1)
z−1 1
Method 2) s = . Gives: H (z) = (z−1)3 2
.
Tz
(T z)3
+ 2 (z−1)
(T z)2 + 2 (z−1)
Tz
+1
■ The rest of the math is up to you...
2z−1 1
Method 3) s = . Gives: H (z) = 8 (z−1)3 (z−1)2
.
T z+1
T 3 (z+1)3
+ 2 T42 (z+1)2 + 2 T2 (z−1)
(z+1)
+1
■ Again, the rest of the math is up to you.
■ For a fast sampling rate, these compare as:
T = 0.1, ωs = 2π/0.1 = 20π , ωs = 63ω p
1.5
cts
1 bilinr
warp
backwd
0.5 fwd

0 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
0
−100
−200
−300 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–42
■ For a medium sampling rate, these compare as:
(system T = 1, ωs = 2π/1 = 2π , ωs = 6.3ω p
1 cts
bilinr
warp
0.5 backwd
fwd

0 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
0
−50
−100
−150
−200
−250 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p

■ For a slow sampling rate, these compare as:


T = 2, ωs = π , ωs = 3.14ω p
1 cts
bilinr
warp
0.5 backwd
fwd

0 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
0
−50
−100
−150
−200
−250 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p

Zero-pole matching

■ There are other methods for emulating continuous-time systems with


discrete-time systems.
■ For example, we have seen before that if we take the z-transform of a
signal, the poles of the z-transform are related to the poles of the
s-transform via z = esT .
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–43
■ There was no direct mapping of zeros.
■ Now, we consider transforming a system. Rules:

1. Poles map as z = esT .


2. Finite zeros map as z = esT .
3. Zeros at ∞ (high freq.) map to z = −1 (high freq).
(but, may want to move one zero from z = −1 to ∞ to give
processing time: zero at ∞ = pole at 0 = 1/z = delay).
4. Match the gain of H (s) and H (z) at dc.

EXAMPLE : First method: move zero at ∞ to z = −1:


a
H (s) = ➠ pole at − a, zero at ∞
s +a
z+1
H (z) = k .
z − e−aT
2k 1 − e−aT
■ Match at dc: H (0) = 1, Hz (1) = ... k = .
s
1 − e−aT 2
(z + 1)(1 − e−aT )
H (z) = .
2(z − e−aT )
EXAMPLE : Second method: move zero at ∞ to origin:
k
H (z) = .
(z − e−aT )
k
■ Match at dc: Hs (0) = 1, Hz (1) = −aT
. . . k = 1 − e−aT .
1−e
" #
1 − e−aT
H (z) = .
z − e−aT

sysd=c2d(sys,T,'matched');

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–44
Hold equivalents

■ Two other methods I won’t discuss in detail.


F E
H (s) z−1
■ ZOH: sysd=c2d(sys,T,’zoh’) H (z) = Z
s z
E F
(z − 1)2 H (s)
■ FOH: sysd=c2d(sys,T,’foh’) H (z) = Z
Tz s2
• The Z{·} notation will be explored in detail in Chapter 3.

■ System from pg. 2–41 revisited. . .


T = 1, ωs = 2π/1 = π , ωs = 6.3ω p
1.5
cts
zoh
1 matched
foh
0.5
0 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
0
−100
−200
−300
−400 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
T = 2, ωs = 2π/2 = π , ωs = 3.14ω p
1.5
cts
zoh
1 matched
foh
0.5
0 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p
0
−200
−400
−600
−800 ωp
0 0.5ω p 1.5ω p 2ω p 2.5ω p

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–45
2.12: Design by emulation

■ These emulation techniques approximate an open-loop system D(s)


with an open-loop system D(z).
■ What happens when D(z) is placed in a feedback loop?
w(t)
A2D D2A
e(t) e[k] u[k] zoh
u(t)
r (t) Q D(z) G(s) y(t)

v(t)

■ We will look at this in more detail later.


■ Recall, though, that the biggest difference in performance will be due
to the T /2 second delay in the ZOH.

EXAMPLE :
1
G(s) = .
s(10s + 1)
■ Specifications for the design:

1. M p < 16%.
2. ts < 10 s to 1%.
3. ess for ramp input < 0.01, slope of ramp = 0.01.
4. Sampling time to give ≥ 10 samples in rise time.
■ Step 1: Design D(s).
“1” ➠ ζ ≥ 0.5.
“2” ➠ σ ≥ 0.46.
0.01
“3” ➠ K v = = 1.0.
0.01

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–46

Choose D(s) to cancel plant pole approximately.

10s + 1
D(s) = .
s+1

−2 −1.5 −1 −0.5
−1

K = 1 . . . ➠ . . . K v = 1 and good pole locations.


ωn ≈ 1 for pole locations, so tr ≈ 1.8 sec.
“4” T = tr /10 = 0.18 ➠ choose T = 0.2.
■ Step 2: D(s) ⇒ D(z): Use pole-zero matching.

• D(s) has zero at −1/10 ➠ D(z) has zero at z = e−0.1T .


−T
• D(s) has pole at −1 ➠ D(z) has pole at z = e .
• D(s) has dc-gain 1 ➠ D(z) has dc-gain 1.
(z − 0.9802)
D(z) = K .
(z − 0.8187)
(1 − 0.9802)
• DC-gain of D(z) = lim D(z) = K . . . K = 9.15.
z→1 (1 − 0.8187)
(z − 0.9802)
D(z) = 9.15 .
(z − 0.8187)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, EMULATION OF ANALOG CONTROLLERS 2–47

10s+1 1
(system dela Step s+1 10s 2+s
ycont

Sum D(s) Plant To Workspace

udisc

To Workspace1

9.15(z−0.9802) 1
ydisc
(z−0.8187) 10s 2+s
Sum1 D(z) Zero−Order Plant2 To Workspace2
Hold

■ Try again, but with 1.0 sec sampling period.


(z − 0.9048)
D(z) = 6.64 .
(z − 0.3679)
■ Much more overshoot, poorer damping.
Simulation for T = 0.2 Simulation for T = 1
1.5 1.5

Disc. Disc.
1 1

Cont. Cont.
Output

Output

0.5 0.5

0
u/10 0
u/10

−0.5 −0.5
0 5 10 15 20 0 5 10 15 20

Time (sec) Time (sec)


Where to from here?

■ We have completed our look at design by emulation.


■ We now move in the direction of direct digital-control design.
■ First, we need to spend some time understanding the D2A and A2D
operations thoroughly.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540: Digital Control Systems 3–1

u
DISCRETE AND HYBRID SYSTEMS

3.1: Laplace transform of ideal sampler

■ Digital control systems are a mixture of discrete-time and


continuous-time components.
■ The interactions between these two parts require that we understand
both from a continuous-time point of view.
■ We begin by looking at the sampling and reconstruction (A2D, D2A)
operations from a continuous-time point of view.
■ Consider a simple unity-gain feedback digital control system with
proportional controller having unity gain.
A2D D2A
x(t) x(kT ) x(kT ) zoh
x̄(t)
r (t) Q 1 G(s) y(t)

■ Every T seconds, the


sampler records x(kT ). The Amplitude
x(t), input to sampler
controller multiplies this value
x̄(t), output of ZOH
by 1. The D2A outputs this
value for the entire sample
period. i.e., it “holds” the
value.
■ So,

x̄(t) = x(0) [1(t) − 1(t − T )] + x(T ) [1(t − T ) − 1(t − 2T )] +

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–2
x(2T ) [1(t − 2T ) − 1(t − 3T )] + · · ·
! " ! −T s "
1 e−T s e e−2T s
X̄(s) = x(0) − + x(T ) − +
s s s s
! −2T s "
e e−3T s
x(2T ) − +···
s s
! "
1 − e−T s # $
= x(0) + x(T )e−T s + x(2T )e−2T s + · · ·
s
%∞ '!
−T s "
& 1 − e
= x(kT )e−kT s .
k=0
s
• First factor is function of input x(t) and sampling period T .
• Second factor is independent of x(t), so can be considered a
transfer function.
DEFINE : %∞ '
&
X ∗(s) = x(kT )e−kT s .
k=0
■ This is a representation of the A2D/sampling operation. X ∗(s) is not a
physical signal, but results from factoring X̄ (s) into two parts. Then:
X ∗ (s) zoh
X (s) X̄ (s)
T ( )
1 − e−T s
s
■ Note, the operation converting X (s) → X ∗(s) is not LTI. (why?) So, it
cannot be represented by a transfer function.

Ideal sampling
■ Take the inverse-Laplace transform of X ∗(s) to view sampling in the
time-domain.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–3
* +
x ∗(t) = L −1
X ∗(s) = x(0)δ(t) + x(T )δ(t − T ) + x(2T )δ(t − 2T ) + · · ·
■ So, x ∗(t) is an impulse train, with impulse values weighted (multiplied)
by the value of x(t) at the sampling instants. That is,
x(t) and x ∗ (t)

&

x (t) = x(t) δ(t − kT )
,k=0 -. /
δT (t)

= x(t)δT (t).

EXAMPLE : Find X (s) for x(t) = 1(t).
&∞

X (s) = x(kT )e−kT s
k=0

= x(0) + x(T )e−T s + x(2T )e−2T s + · · ·

= 1 + e−T s + e−2T s + · · ·
■ Multiply both sides by (1 − e−T s )
(1 − e−T s )X ∗(s) = 1
1 0 −T s 0

X (s) = −T s
0e 0 < 1.
1−e
■ Hmmm. Does this look familiar? Consider z-transform of 1[k] with

z = eT s .
z
1[k] ↔
z−1
Ts eT s 1
let z = e → T s = .
e − 1 1 − e−T s
EXAMPLE : Find X ∗(s) when x(t) = e−t 1(t).

&
X ∗ (s) = x(kT )e−kT s
k=0

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–4

= x(0) + x(T )e−T s + x(2T )e−2T s + · · ·

= 1 + e−T e−T s + e−2T e−2T s + · · ·


# $ # $2
= 1 + e−(1+s)T + e−(1+s)T + · · ·
1 0 −(1+s)T 0
0e 0 < 1.
= −(1+s)T
1−e
■ Hmmm. Does this look familiar too?
# −T $k
Let y[k] = e
z
Y (z) = let z = e T s
z − (e−T )
eT s 1
= Ts = .
e − e−T 1 − e−(1+s)T
■ So, X ∗(s) = X (z)|z=eT s .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–5
3.2: Properties of X ∗ (s) and data reconstruction

Property 1: X ∗(s) is periodic in s, with period jωs .



&
X ∗ (s + jmωs ) = x(kT )e−kT (s+ j mωs )
k=0

&
= x(kT )e−kT s e− j kmωs T .
k=0

Now, ωs =
T

&
= x(kT )e−kT s e− j 2π km .
k=0

From Euler, e− j 2π km = cos(2πkm)


, -. / + ,j sin(2πkm)
-. /=1
1, km∈Z 0, km∈Z

&
So, X ∗ (s + jmωs ) = x(kT )e−kT s
k=0

= X (s).

Property 2: If X (s) has a pole at s = s1, then X ∗(s) has poles at


s = s1 + jmωs , m ∈ Z.
■ A relationship between X (s) and X ∗(s) may be proven:

1 & x(0)
X ∗ (s) = X (s + jmωs ) +
T m=−∞ 2
Then,
1
X ∗ (s) =
(X (s) + X (s + jωs ) + X (s + j2ωs ) + · · · )
T
[Zero locations of X ∗ (s) are periodic (from property 1) but are not
uniquely determined by the zeros of X (s)].
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–6
3ωs
j
2
Complementary Strip
ωs
j
2 Primary Strip
ωs
−j
2
Complementary Strip
3ωs
−j
2

■ What these two properties MEAN is that two different signals X 1(s)
and X 2(s) may have the SAME starred transform X 1∗ (s) = X 2∗(s).
Why?
■ One signal is said to alias as the other.
■ This is very easy to see in the time domain.
■ The (blue) solid line is the
analog signal cos(2π(5)t)
drawn over one second.
■ The (blue) squares show
sampling points for a rate of
f s = 14 Hz.
■ The (green) dots show sampling times for a rate of f s = 7 Hz.
■ The dashed (green) curve is a cos(2π(2)t) signal.

• Both the cos(2π(5)t) and cos(2π(2)t) curves pass through all the
dots so the signal may be assumed to be a 2 Hz sinusoid
(aliasing!).
• Only the cos(2π(5)t) curve passes through all the squares, so the
signal must be assumed to be a 5 Hz sinusoid (no aliasing).

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–7
■ The solution to the problem is easiest to see in the Fourier domain.
F[x(t)] = L[x(t)]|s= j ω. Since X ∗ (s) is periodic, X ∗( jω) is also periodic.
■ For X ( jω) having a spectral bandwidth W < 2 f s the sampled signal
spectrum is the following
X ( jω)
1

ω
Passband of the −W ∗ W
reconstruction filter X ( jω)
1

ω
−ωs −ωs /2 ωs /2 ωs
■ If the sampling rate f s < 2W , then spectral overlap called ALIASING
occurs.
X ( jω)
1

ω
−W W
Aliasing X ∗ ( jω)
1

ω
−2ωs −ωs ωs 2ωs
■ When aliasing is present, it is impossible to recover the original
analog signal from the sampled signal.
■ Nyquist/Shannon said that if a signal is sampled at a rate ω N there
will be no aliasing if ω N ≥ 2 times the highest frequency in the signal.

KEY POINT: Our digital control system will need to sample at least twice
as fast as the closed-loop bandwidth. Four to six times faster is safer.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–8
Data deconstruction

■ If the signal x(t) has been sampled at or above the Nyquist rate ω N , it
is mathematically possible to recover x(t) from x(kT ). Surprise?
Magic?
■ Process X ∗( jω) by passing it through an ideal low-pass filter with
bandwidth ω N /2.
Passband of the
reconstruction filter X ∗ ( jω)
1

ω
−ω N −ω N /2 ω N /2 ωN
■ The filter must have gain T to recover the magnitude lost by sampling.
sin(πt/T )
h(t) = = sinc(t/T ).
πt/T
PROBLEM: h(t) is non-causal.
■ Solution: “Approximate” h(t) very crudely with a causal filter—the
hold circuit.
■ The impulse response of the hold
= + delay.
circuit is:
t t
T −T /2 T /2
■ So, H ( jω) is

( ) T
sin(ωT /2) − j ωT /2
H ( jω) = T e
ωT /2
( )
ω
= T sinc e− j π ω/ωs . ωs
ωs 0 2ωs 3ωs

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–9
EXAMPLE : Let x(t) = 2 sin(ω1t) with ω1 < ωs /2.
X ( jω)
1

3ωs −ωs ωs 0 ωs ωs 3ωs


− −
2 2 X ∗ ( jω) 2 2
1/T

3ωs −ωs ωs 0 ωs ωs 3ωs


− −
2 2 Y ( jω) 2 2
1

3ωs −ωs ωs 0 ωs ωs 3ωs


− −
2 2 2 2
■ Notice that the ZOH does not completely filter out the aliased
frequencies due to sampling. Since most plants are low-pass
devices, this is often okay.
■ The high-frequency components look like stair-steps in time-domain.
Note: Familiar T /2 delay of fundamental frequency.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–10
3.3: Open-loop discrete-time systems

■ We have seen some properties of the sampling operation and of the


hold operation.
■ Sampling:
X (s) X ∗ (s)
T
■ Hold: ( )
zoh 1 − e−T s
X ∗ (s) X ∗ (s)
s

■ The z-transform will enable us to put these elements into a system


and analyze them a little more easily.
■ We first look at open-loop systems, and then at closed-loop systems.

Open-loop discrete-time systems

■ We have already seen the relationship between X ∗ (s) and X (z).


■ Easy to prove:

Z[x[k]] = X (z) = x[0] + x[1]z −1 + x[2]z −2 + · · ·

X ∗ (s) = x(0) + x(T )e−sT + x(2T )e−s2T + · · ·



0
so, X (z) = X (s)0esT =z

and X ∗ (s) = X (z)|z=esT .

■ So, the z-transform is a special case of the Laplace transform for


discrete-time systems.
■ Sometimes it is easier to find the starred transform X ∗ (s) from the
z-transform X (z)!
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–11
EXAMPLE : Let
1
X (s) = .
(s + 1)(s + 2)
■ From the z-transform table in Topic 2.7 of your notes:
z(e−T − e−2T )
X (z) =
(z − e−T )(z − e−2T )
X ∗ (s) = X (z)|z=esT
esT (e−T − e−2T )
= sT .
(e − e−T )(esT − e−2T )
NOTE :

■ X ∗(s) has ∞ poles and zeros in the s-plane because of its periodic
nature.
■ X (z) has a single zero at z = 0, and two poles at z = e−T and
z = e−2T .
■ Pole-zero analysis is going to be easier in the z-domain.

The discrete-impulse/unit-pulse transfer function

■ For continuous-time LTI systems, the impulse response described the


output of the system when the input was the impulse/delta function.
■ The transfer function is the Laplace transform of the impulse
response.
■ The same can be done for discrete-time systems, but the input is now
a discrete-impulse, often called a unit pulse or simply a pulse.

versus
t k
0 0
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–12
■ We are interested in systems that look like:
X ∗ (s) 1 − e−T s Y (s)
X (s) G p (s) Y ∗ (s)
T s T
PLANT
, HOLD -. /
( G(s)
−sT )
1−e
■ Define G(s) = G p (s) to “hide” the mess introduced by the
s
hold operation.
X ∗(s) Y (s)
X (s) G(s) Y ∗ (s)
T T

■ So, Y (s) = G(s)X ∗(s).


■ Y ∗(s) would occur if we sampled Y (s). Y ∗(s) = [G(s)X ∗(s)]∗.

∗ 1 & y(0)
Y (s) = Y (s + jkωs ) +
T k=−∞ 2

1 & y(0)
= G(s + jkωs )X ∗(s + jkωs ) + .
T k=−∞ 2
■ But, since X ∗ (s) is a sampled signal, it is periodic in s + jkωs :
X ∗ (s) = X ∗(s + jkωs ).
■ So,

1 & y(0)
Y ∗(s) = G(s + jkωs )X ∗(s) +
T k=−∞ 2
% ∞
'
1 & y(0)
= X ∗ (s) G(s + jkωs ) +
T k=−∞ 2
y(0)
= X ∗ (s)G ∗(s) +
2
y(0)
or, Y (z) = X (z)G(z) + .
2
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–13

] is the pulse transfer function between the sampled input and the
G(z)
sys
output at the sampling instants.

• Recall that transfer functions assume initial conditions to be zero.

■ It tells us NO information about the output between the sampling


instants.

• If we choose a fast sampling rate, then interpolation can be a good


approximation.
• Simulation is a general tool to help determine inter-sample
behavior accurately.

EXAMPLE : At sample points, left plot looks better than right plot, but
in-between sample points, left plot looks worse than right plot.
Bad Step Response Good Step Response
60 60
Output Temperature ◦ C

Output Temperature ◦ C

58 58
56 56
54 54
52 52
50 50
48 48
46 46
44 44
42 42
40 40
0 5 10 15 20 25 30 35 40 45 50 0 5 10 15 20 25 30 35 40 45 50

Time (s) Time (s)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–14
3.4: Finding G(z) from G p (s)

■ Recall that
( )
1 − e−sT
• G(s) = G p (s),
s

• G (s) is a sampled Laplace transform of G(s), and

0
• G(z) = G (s)0 sT . z=e

■ To find G(z) we must then


!( −sT ) "
1 − e
1. Find g(t) = L−1 G p (s) .
s
2. Find g[k] = g(kT ).
* +
3. Find G(z) = Z g(kT ) .
!( ) "
1 − e−sT
■ Notation: G(z) = Z G p (s) .
s
A shortcut for systems having no time delays:

■ We calculate
!( ) "
1 − e−sT
G(z) = Z G p (s)
s
! "
# $ G p (s)
= Z 1 − e−sT
s
!( )" ! "
G p (s) G p (s)
=Z − Z e−sT .
s s
■ But: e−sT is the cts-time transfer function of a delay of T seconds.
■ In disc-time, z −1 is the transfer function of a unit delay, (T seconds).
! " ! "
G p (s) z − 1 G p (s)
G(z) = (1 − z −1)Z = Z .
s z s

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–15
■ This last term may often be looked up in a table.
1
■ In MATLAB: Let G (s) = .
p
s+1
numc=1;
denc=[1 1];
sysc=tf(numc,denc);
sysd=c2d(sysc,T);% = sampling period.
[numd,dend,T]=tfdata(sysd);

A shortcut for systems having time delays: (The modified z-transform)


■ We often need to analyze systems with pure time delays:
num(s)
1. Plant is of the form G p (s) = e−sτ ;
den(s)
2. Digital controller introduces delay in computation;
D(z) e−sτ HOLD G p (s)
T

3. And/or we want to know plant output between normal sampling times


(the ripple).
e−sT /2 Y2 (s)

D(z) HOLD G p (s) Y (s)


T

■ Consider (without controller D(z) for now):


G(s)
. /, -

X (s)
X (s) HOLD G p (s) e−sτ Y (s)
T

Y (s) = e−sτ G(s)X ∗(s)

Y ∗(s) = [e−sτ G(s)]∗ X ∗(s)


* −sτ +
Y (z) = Z e G(s) X (z)
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–16
■ Let τ = kT + %T, k ∈ Z, 0 < % < 1
−k
* −s%T +
Y (z) = z Z e G(s) X (z)
, -. /
%
=G(z,m) where m=1−%

= z −k G(z, (1 − %))X (z).

• You can use modified-z-transform table from Topic 2.7,

• Or you can work it out by hand,

• Or. . . you can use MATLAB

sys=tf(num,den);
set(sys,'ioDelay',tau); % tau is total delay, in seconds
sysd=c2d(sys,T);

EXAMPLE OF PULSE TRANSFER FUNCTION :


X ∗ (s) 1 − e−T s Y (s)
X (s) G p (s) Y ∗ (s)
T s T
1 1
■ Let G p (s) = and X (s) = (a unit step).
s+1 s
■ So, ( )( )
1 − e−sT 1
Y (s) = X ∗ (s) = G(s)X ∗(s).
s s+1
■ Also note that
!()( )"
1 − e−sT 1 1 − e−T
G(z) = Z =
s s+1 z − e−T
z
and X (z) = Z [1(t)] = .
z−1
■ So,

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–17
( )( )
1 − e−T z 1
Y (z) =
z − e−T z−1
z z
= −
z − 1 z − e−T
# $ 0 T 2T 3T 4T 5T
y[k] = 1 − e−kT 1[k].
NOTE : A shortcut for this particular example would have been to notice
that the sample-and-hold does nothing to the unit-step input!
■ This example is also a good one to illustrate dc gain:
yss = lim (z − 1)Y (z)
z→1

(1 − e−T )z
= lim
z→1 (z − e −T )

1 − e−T
= = 1.
1 − e−T
■ Equivalently, we can find in general

dc gain = lim (z − 1)Y (z)


z→1

= lim (z − 1)G(z)1(z)
z→1

= lim G(z)z = G(1).


z→1
So, G(1) is the dc gain (a.k.a., the final value to a unit-step input).
■ DC gain = lim G(z) = lim G p (s).
z→1 s→0
CONCLUSION: For the following open loop system, we have
Y (z) = G(z)X (z).
X ∗ (s) 1 − e−T s Y (s)
X (s) G p (s) Y ∗ (s)
T s T
PLANT
, HOLD -. /
G(s)
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–18
3.5: Systems with digital filters

■ Our digital controllers will not simply sample and hold their input
value. They will perform some mathematical operations on the
sampled input. “FILTER”
■ So, we expand our system of interest:
x[k] u[k] 1 − e−T s ū(t) y(t)
X (s) D(z) G p (s) Y ∗ (s)
T s T
FILTER HOLD PLANT
■ Suppose our digital filter has transfer function D(z).
■ Then,

U (z) = D(z)X (z), or, via z = esT

U ∗(s) = D ∗(s)X ∗(s).

ū(t) occurs at the output of the hold circuit, so


( )
1 − e−sT
Ū (s) = U ∗(s), and
s
Y (s) = G p (s)Ū (s)
( )
1 − e−sT
= G p (s) U ∗(s).
s
■ Since

U ∗(s) = D ∗(s)X ∗(s),


( −sT )
1−e ∗
Y (s) = G p (s) D-. (s)/ X ∗ (s)
s ,
=D(z)|z=esT
( ( ))∗
∗ 1 − e−sT
Y (s) = G p (s) D ∗(s)X ∗(s)
s
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–19
! ( )"
1 − e−sT
Y (z) = Z G p (s) D(z)X (z)
s
Y (z) = G(z)D(z)X (z).

EXAMPLE : Let the digital controller implement

u[k] = 2x[k] − x[k − 1]

and the plant is:


1
G p (s) = .
s+1
■ Find D(z):

U (z) = 2X (z) − z −1 X (z)


# $
= 2 − z −1 X (z)
U (z) 2z − 1
D(z) = = 2 − z −1 = .
X (z) z
■ Find G(z): 12
1 − esT 1 1 − e−T
G(z) = Z = .
s s +1 z − e−T
■ So, ( )( )
1 − e−T 2z − 1
Y (z) = X (z).
z − e−T z
EXAMPLE : Let x(t) = 1(t), and find Y (z).
z
X (z) =
z−1
( )( )( ) # $
1 − e−T 2z − 1 z (2z − 1) 1 − e−T
Y (z) = T
= #
−T
$.
z−e z z−1 (z − 1) z − e

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–20
■ We can determine y [k] by partial-fraction expansion and inversion of
Y (z):
Y (z) (2z − 1)(1 − e−T ) 1 − e T 1 eT − 2
= = + + .
z z(z − 1)(z − e−T ) z z − 1 z − e−T
z T z(e T − 2)
Y (z) = (1 − e ) + +
z−1 z − e−T
⇕ ⇕ ⇕
(1 − e T )δ[k] 1[k] (e T − 2)e−kT 1[k]
y[k] = (1 − e T )δ[k] + 1[k] + (e T − 2)e−kT 1[k].

NOTE : At k = 0,
y[0] = (1 − e T ) + 1 + (e T − 2) = 0.
■ This could also be observed by noting that Y (z) has higher-order
denominator than numerator.
➠ The delay in the HOLD means that the output is not instantaneous.

Block diagrams and sampled data


■ Control systems exist in great variety.
• Almost always more complicated than the open-loop system we
saw here.
• To be able to analyze closed-loop and more involved systems, we
need to be able to analyze general block diagrams with samplers
in them.
EXAMPLE :
X ∗ (s) A(s) A∗ (s) Y (s)
X (s) HOLD G p1 (s) HOLD G p2 (s) Y ∗ (s)
T T T
, -. / , -. /
G 1 (s) G 2 (s)
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–21

Y (s) = G 2(s) A∗(s)

A(s) = G 1(s)X ∗(s)



* ∗
+∗ 3
Y (s) = G 2(s) A (s)

* ∗
+∗ can this simplify? (pg. 3–12)
A (s) = G 1(s)X (s)

Y ∗(s) = G ∗2 (s) A∗(s)

A∗(s) = G ∗1 (s)X ∗(s)

or, Y ∗(s) = G ∗2 (s)G ∗1 (s)X ∗(s)

Y (z) = G 2(z)G 1(z)X (z).


■ Things are not always this straightforward.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–22
3.6: Some more challenging examples

EXAMPLE : Consider the hybrid system drawn below.


X ∗ (s) A(s) Y (s)
X (s) HOLD G p1 (s) G 2 (s) Y ∗ (s)
T T
, -. /
G 1 (s)

Y (s) = G 2(s) A(s) = G 2(s)G 1(s)X ∗(s)

Y ∗(s) = [G ∗
-. 1(s)/ X (s)]
, 2(s)G

G(s)

= [G(s)X ∗(s)]∗

= G ∗(s)X ∗(s)

Y (z) = G(z)X (z) or, Y (z) = (G 2 G 1)(z)X (z).


■ But, is G ∗(s) = G ∗2 (s)G ∗1(s)?
■ That is, does G(z) = G 2(z)G 1(z)?
■ Let:

G 2(s) = 1/s G 1(s) = 1/s G(s) = 1/s 2



esT ∗
esT ∗
T esT
G 2 (s) = sT G 1 (s) = sT G (s) = sT
e −1 e −1 (e − 1)2

e2sT T esT
G ∗1 (s)G ∗2(s) = sT ̸= sT .
(e − 1)2 (e − 1)2
KEY CONCLUSION : [G 1(s)G 2(s)]∗ ̸= G ∗1 (s)G ∗2(s) in general.
REASON : Sampling is time-varying, so system is not LTI. In fact, in some
cases we may not even be able to find transfer functions. . .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–23

EXAMPLE : Consider the hybrid system drawn below.


A(s) A∗ (s) Y (s)
X (s) G 1 (s) HOLD G p2 (s) Y ∗ (s)
T T
, -. /
G 2 (s)

Y (s) = G 2(s) A∗(s)

A(s) = G 1(s)X (s)

A∗(s) = [G 1(s)X (s)]∗ ̸= G ∗1 (s)X ∗(s)

Y (s) = G 2(s)[G 1(s)X (s)]∗

Y ∗(s) = G ∗2 (s)[G 1(s)X (s)]∗

Y (z) = G 2(z)[G 1 X ](z).

NOTE : We cannot separate [G 1 X ](z) to create a transfer function


Y (z)/ X (z) (!)
■ (a(t) is a function of all previous values of x(t), not just the values of
x[kT ], at the sampling instants.)

Closing the loop—Feedback

■ Ultimately, we are more interested in closed-loop than in open-loop


systems.

EXAMPLE :
G(s)
. /, -

E(s) E (s)
R(s) HOLD G p (s) Y (s)
T

H (s)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–24
E(s) = R(s) − H (s)Y (s)

Y (s) = G(s)E ∗(s)

⇒ E(s) = R(s) − H (s)[G(s)E ∗(s)] = R(s) − [H (s)G(s)]E ∗(s)

E ∗(s) = R ∗(s) − [H (s)G(s)]∗ E ∗ (s)


R ∗(s)
= # $∗
1 + G H (s)
% '

G (s)
Y ∗(s) = # $∗ R ∗(s)
1 + G H (s)
! "
G(z)
Y (z) = R(z).
1 + G H (z)
■ Similarly,
G(s)
. /, -
R(s) D(z) HOLD G p (s) Y (s)
T

H (s)

Y (z) D(z)G(z)
= .
R(z) 1 + D(z)G H(z)
The problem of disturbance
W (s)
A(s) A∗ (s)
R(s) HOLD G p (s) Y (s)
T

Y (s) = G p (s)W (s) + G(s) A∗(s)

A(s) = R(s) − Y (s) = R(s) − G p (s)W (s) − G(s) A∗(s)


Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DISCRETE AND HYBRID SYSTEMS 3–25
# $∗
A∗(s) = R ∗(s) − G p W (s) − G ∗(s) A∗(s)
# $∗
∗ G W (s)
R (s) p
= −
1 + G ∗(s) 1 + G ∗(s)
! " # $∗
1 + G ∗(s) G(s)R ∗(s) G p W (s)G(s)
Y (s) = G p (s)W (s) + −
1 + G ∗(s) 1 + G ∗(s) 1 + G ∗(s)
! ∗ " ! "
G (s) 1 # $∗
Y ∗(s) = R ∗
(s) + G p W (s)
1 + G ∗(s) 1 + G ∗(s)
! " ! "
G(z) 1
Y (z) = R(z) + (G p W )(z).
1 + G(z) 1 + G(z)
G(z)
■ The transfer function from R(s) to Y (s) is . . . no surprise.
1 + G(z)
■ No transfer function exists between W (z) and Y (z) (!)

■ Solution (?)
W (s) G p (s)
W1 (s)
A(s) A∗ (s)
R(s) HOLD G p (s) Y (s)
T

! " ! "
G(z) 1
Y (z) = R(z) + W1(z).
1 + G(z) 1 + G(z)
Where to from here?
■ We now understand the hybrid nature of digital control systems and
are able to analyze such hybrid systems.
■ We’re almost ready for controller design—but first, we look at stability
analysis for discrete-time systems.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540: Digital Control Systems 4–1

STABILITY ANALYSIS TECHNIQUES

4.1: Bilinear transformation


■ Three main aspects to control-system design:
1. Stability,
2. Steady-state response,
3. Transient response.
■ Here, we look at determining system stability using various methods.
DEFINITION: A system is BIBO stable iff a bounded input produces a
bounded output.
■ Check by first writing system input–output relationship as
!m
G(z) K (z − zi )
Y (z) = R(z) = !n R(z).
1 + G H (z) (z − pi )
■ Assume for now that all the poles { pi } are distinct and different from
the poles in R(z). Then,
k1 z kn z
Y (z) = + ···+ + "Y R#$(z).%
z" − p1 #$ z − pn%
Response to R(z)
Response to initial conditions

■ If the system is stable, the response to initial conditions must decay to


zero as time progresses.
& '
k i z
Z −1 = ki ( pi )k 1[k].
z − pi
So, the system is stable if | pi | < 1.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–2

■ { pi } are the roots of 1 + G H (z) = 0. So, the roots of 1 + G H (z) = 0


must lie within the unit circle of the z-plane.
• Same result even if poles are repeated, but harder to show.

■ If the magnitude of a pole | pi | = 1, then the system is marginally


stable. The unforced response does not decay to zero but also does
not increase to ∞. However, it is possible to drive the system with a
bounded input and have the output go to ∞. Therefore, a marginally
stable system is unstable.

Bilinear transformation

■ The stability criteria for a discrete-time system is that all its poles lie
within the unit circle on the z-plane.
■ Stability criteria for cts.-time systems is that the poles be in the LHP.

• Simple tool to test for continuous-time stability—Routh test.

■ Can we use the Routh test to determine stability of a discrete-time


system (either directly or indirectly)?
■ To use the Routh test, we need to do a z-plane to s-plane conversion
that retains stability information. The s-plane version of the z-plane
system does NOT need to correspond in any other way.
z-plane w-plane
■ That is,

• The frequency responses


may be different
• The step responses may
be different . . .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–3
■ Since only stability properties are maintained by the transform, it is
not accurate to label the destination plane the s-plane. It is often
called the w-plane, and the transformation between the z-plane and
the w-plane is called the w-Transform.
■ A transform that satisfies these requirements is the bilinear transform.
Recall:

H (w) = H (z)|z= 1+(T/2)w and H (z) = H (w)|w= 2 z−1 .


1−(T/2)w T z+1

■ Three things to check:

1. Unit circle in z-plane #→ jω-axis in w-plane.


2. Inside unit circle in z-plane #→ LHP in w-plane.
3. Outside unit circle in z-plane #→ RHP in w-plane.
■ If true,

1. Take H (z) #→ H (w) via the bilinear transform.


2. Perform Routh test on H (w).

CHECK : Let z = re j ωT . Then, z is on the unit circle if r = 1, z is inside the


unit circle if |r| < 1 and z is outside the unit circle if |r| > 1.

z = re j ωT
(
2 z − 1 (( 2 re j ωT − 1
w= = .
T z + 1 (z=r e j ωT T re j ωT + 1
■ Expand e j ωT = cos(ωT ) + j sin(ωT ) and use the shorthand
" "
c = cos(ωT ) and s = sin(ωT ). Also note that s 2 + c2 = 1.
& '
2 rc + jrs − 1
w=
T rc + jrs + 1

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
+
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–4
+ & '& '
2 (rc − 1) + jrs (rc + 1) − jrs
+1 =
T (rc + 1) + jrs (rc + 1) − jrs
& 2 2 2 2'
2 (r c − 1) + j (rs)(rc + 1) − j (rs)(rc − 1) + r s
=
T (rc + 1)2 + (rs)2
& ' & '
2 r2 − 1 2 2rs
= +j .
T r 2 + 2rc + 1 T r 2 + 2rc + 1
Notice that the real part of w is 0 when r = 1 (w is on the imaginary
axis), the real part of w is negative when |r| < 1 (w in LHP), and that
the real part of w is positive when |r| > 1 (w in RHP). Therefore, the
bilinear transformation does exactly what we want.
■ When r = 1,
) *
2 2 sin(ωT ) 2 ωT
w= j = j tan ,
T 2 + 2 cos(ωT ) T 2
which will be useful to know.
■ The following diagram summarizes the relationship between the
s-plane, z-plane, and w-plane:
s-plane z-plane w-plane
➃ ωs ➂
j
2 ➁ ➂ R=∞
ωs ➁ ➁
j ➂ ➃ ➃
4 ➀ 2
➀ R=1 j
T
ωs ➆ 2 ➀
−j ➅ ➄ ➄ −T ➆
4
➄ ωs ➅
−j
2
➆ ➅

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–5
4.2: Discrete-time stability via Routh–Hurwitz test
■ Review of Routh test.
b(w)
Let H (w) = . . . a(w) is the characteristic polynomial.
a(w)
a(w) = an wn + an−1wn−1 + · · · + a1w + a0.
Case 0: If any of the an are negative then the system is unstable
(unless ALL are negative).
Case 1: Form Routh array:
wn an an−2 an−4 · · ·
wn−1 an−1 an−3 an−5 · · ·
wn−2 b1 b2 · · ·
wn−3 c1 c2 · · ·
...
w1 j1
w0 k1
( ( ( (
(
−1 ( an an−2 ( ( −1 (( an an−4 (
(
b1 = ( ( b2 = ( ( ···
an−1 ( an−1 an−3 ( an−1 ( an−1 an−5 (

( ( ( (
−1 (( an−1 an−3 (
( −1 (( an−1 an−5 (
(
c1 = ( ( c2 = ( ( ···
b1 ( b1 b2 ( b1 ( b1 b3 (
TEST : Number of RHP roots = number of sign changes in left column.
Case 2: If one of the left column entries is zero, replace it with ϵ
as ϵ → 0.
Case 3: Suppose an entire row of the Routh array is zero, the
wi −1th row. The wi th row, right above it, has coefficients
α1 , α2 , . . .
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–6

Then, form the auxiliary equation:

α1wi + α2wi −2 + α3wi −4 + · · · = 0.

This equation is a factor of the characteristic equation


and must be tested for RHP roots (it WILL have non-LHP
roots—we might want to know how many are RHP).

EXAMPLE : Consider:
1 − e−sT 1
r (t) K y(t)
T s s(s + 1)

) *) *
1 − e−T s 1
G(s) = .
s s(s + 1)
■ From z-transform tables:
) * & '
z−1 1
G(z) = Z 2
z s (s + 1)
) * ) −T *
z−1 (e + T − 1)z 2 + (1 − e−T − T e−T )z
= .
z (z − 1)2(z − e−T )
Let T = 0.1 s.
0.00484z + 0.00468
= .
(z − 1)(z − 0.905)
■ Perform the bilinear transform

G(w) = G(z)|z= 1+(T/2)w


1−(T/2)w

= G(z)|z= 1+0.05w
1−0.05w

−0.00016w2 − 0.1872w + 3.81


= .
3.81w2 + 3.80w
■ The characteristic equation is:

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–7

0 = 1 + K G(w)
(system
= (3.81 − 0.00016K )w2 + (3.80 − 0.1872K )w + 3.81K .

w2 (3.81 − 0.00016K ) 3.81K ➠ K < 23, 813


w1 (3.80 − 0.1872K ) ➠ K < 20.3
w0 3.81K ➠ K >0
■ So, for stability, 0 < K < 20.3.
NOTE : The “equivalent” continuous-time system is:
1
r (t) K y(t)
s(s + 1)

K G(s)
T (s) =
.
1 + K G(s)
■ Characteristic equation: s(s + 1) + K = 0.

s2 1 K
s1 1
s0 K
■ Stable for all K > 0 ➠ sample and hold destabilizes the system.
EXAMPLE : Let’s do the same example, but with T = 1 s (not 0.1 s).
■ (math happens)
0 = 1 + K G(w)

= (1 − 0.0381K )w2 + (0.924 − 0.86K )w + 0.924K .

w2 (1 − 0.0381K ) 0.924K ➠ K < 26.2


w1 (0.924 − 0.386K ) ➠ K < 2.39
w0 0.924K ➠ K >0
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–8
■ So, for stability, 0 < K < 2.39.
■ This is a much more restrictive range than when T = 0.1 s ➠ slow
sampling really destabilizes a system.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–9
4.3: Jury’s stability test
■ H (z) #→ H (w) #→ Routh is complicated and error-prone.
■ Jury made a direct test on H (z) for stability.
■ Disadvantage (?) . . . another test to learn.
b(z)
■ Let T (z) = , a(z) =“characteristic polynomial.”
a(z)
■ a(z) = an z n + an−1 z n−1 + · · · + a1 z + a0 = 0, an > 0.
■ Form Jury array:

z0 z1 z2 ··· z n−k ··· z n−1 z n


a0 a1 a2 ··· an−k ··· an−1 an
an an−1 an−2 ··· ak ··· a1 a0
b0 b1 b2 ··· bn−k ··· bn−1
bn−1 bn−2 bn−3 ··· bk−1 ··· b0
c0 c1 c2 ··· cn−k ···
cn−2 cn−3 cn−4 ··· ck−2 ···
... ... ... ...
l0 l1 l2 l3
l3 l2 l1 l0
m0 m1 m2
■ Quite different from Routh array.
• Every row is duplicated . . . in reverse order.
• Final row in table has three entries (always).
• Elements are calculated differently.
( ( ( ( ( (
(a a ( ( b b ( ( c c (
( 0 n−k ( ( 0 n−1−k ( ( 0 n−2−k (
bk = ( ( ck = ( ( dk = ( ( ...
( an ak ( ( bn−1 bk ( ( cn−2 ck (
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–10

• Stability criteria is different.

a(z)|z=1 > 0

(−1)n a(z)|z=−1 > 0 n = order of a(z)

|a0| < an

|b0| > |bn−1|

|c0| > |cn−2|

|d0| > |dn−3|


...

|m 0| > |m 2| .
n
• First, check that a(1) > 0, (−1) a(−1) > 0 and |a0 | < an . (relatively
few calculations). If not satisfied, stop.
• Next, construct array. Stop if any condition not satisfied.

EXAMPLE :
1 − e−sT K
r (t) y(t)
T = 1s s s(s + 1)

0.368z + 0.264
r [k] K y[k]
z 2 − 1.368z + 0.368

■ Characteristic equation:
(0.368z + 0.264)
0 = 1 + K G(z) = 1 + K
z 2 − 1.368z + 0.368

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–11

= z 2 + (0.368K − 1.368)z + (0.368 + 0.264K ).


■ The Jury array is:

z0 z1 z2
0.368 + 0.264K 0.368K − 1.368 1
■ The constraint a(1) > 0 yields
1 + 0.368K − 1.368 + 0.368 + 0.264K = 0.632K > 0 ➠ K > 0.
■ The constraint (−1)2a(−1) > 0 yields
1−0.368K +1.368+0.368+0.264K = −0.104K +2.736 > 0 ➠ K < 26.3.
■ The constraint |a0| < a2 yields
0.632
0.368 + 0.264K < 1 ➠ = 2.39. K <
0.264
■ So, 0 < K < 2.39. (Same result as on pg. 4–8 using bilinear rule.)

EXAMPLE : Suppose that the characteristic equation for a closed-loop


discrete-time system is given by the expression:
a(z) = z 3 − 1.8z 2 + 1.05z − 0.20 = 0.
■ a(1) = 1 − 1.8 + 1.05 − 0.2 = 0.05 > 0 ✓
■ (−1)3a(−1) = −[−1 − 1.8 − 1.05 − 0.2] > 0 ✓
■ |a0| = 0.2 < a3 = 1 ✓
■ Jury array:

z0 z1 z2 z3
−0.2 1.05 −1.8 1
1 −1.8 1.05 −0.2
−0.96 1.59 −0.69
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–12

( ( ( (
( −0.2 1 ( ( −0.2 −1.8 (
( ( ( (
b0 = ( ( = −0.96 b1 = ( ( = 1.59
( 1 −0.2 ( ( 1 1.05 (

( (
( −0.2 1.05 (
( (
b2 = ( ( = −0.69
( 1 −1.8 (

■ |b0| = 0.96 > |b2| = 0.69 ✓


➠ The system is stable.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–13
4.4: +
Root-locus and Nyquist tests
+
y
■ For cts.-time control, we examined the locations of the roots of the
closed-loop system as a function of the loop gain K ➠ Root locus.
r (t) K D(s) G(s) y(t)

H (s)

K D(s)G(s)
T (s) = .
1 + K D(s)G(s)H (s)
■ Let L(s) = D(s)G(s)H (s). (The “loop transfer function”).
■ Developed rules for plotting the roots of the equation
b(s)
1+ K = 0.
a(s)
“Root Locus Drawing Rules.”
■ Applied them to plotting roots of

1 + K L(s) = 0.

Now, we have the digital system:


G(s)
$ %" #
1 − e−sT G p (s)
r (t) K D(z) y(t)
T s

H (s)

K D(z)G(z)
T (z) = ,
1 + K D(z)G H(z)
■ So, we let L(z) = D(z)G H (z).
■ Poles are roots of 1 + K L(z) = 0.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–14
■ This is exactly the same form as the Laplace-transform root locus.
Plot roots in exactly the same way.

EXAMPLE :
0.368(z + 0.717)
G H (z) = D(z) = 1.
(z − 1)(z − 0.368)

K = 2.39
numd=0.368*[1 0.717];
dend=conv([1 -1],[1 -0.368]);
d=tf(numd,dend,-1);
rlocus(d);

The Nyquist test

■ In continuous-time control we also used the Nyquist test to assess


stability.

I(s) I(s) Zoom

III
II ρ→0
θ
R(s) R(s)
I
IV

■ The Nyquist “D” path encircles the entire (unstable) RHP.


■ The Nyquist plot is a polar plot of L(s) evaluated on the “D” path.
■ Adjustments to “D” shape are made if pole on the jω-axis.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–15
■ The Nyquist test evaluated stability by looking at the Nyquist plot.
• N =No. of CW encirclements of −1 in Nyquist plot.
• P=No. of open-loop unstable poles (poles inside “D” shape).
• Z =No. of closed-loop unstable poles.
• Z = N + P, Z = 0 for stable closed-loop system.
EXAMPLE :
■ This gives:
K
r (t) y(t) 1
s(s + 1) L(s) =
s(s + 1)

■ Pole at origin: Need detour s = ρe j θ , ρ ≪ 1.


■ Resulting Nyquist map has infinite radius.
Cannot draw to scale.
■ No poles inside modified-“D” curve: P = 0.
■ Z = N + P = 0 ➠ Stable system.

■ Note that increasing the gain “K ” only magnifies the entire plot. The
−1 point is not encircled for K > 0 (infinite gain margin).

Nyquist test for discrete systems


■ Three different ways to do the Nyquist test for discrete systems.
■ Based on three different representations of the characteristic eqn.
1. 1 + L ∗(s) = 0. L = DG H
2. 1 + L(z) = 0.
3. 1 + L(w) = 0.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–16

1. 1 + L ∗(s) = 0.
ωs I(s)
■ We know that L ∗(s) is periodic in jωs . j
2
Therefore, the “D” curve does not need
to encircle the entire RHP to encircle
all unstable poles. [If there were any, R(s)
there would be an infinite number.]
■ Modify “D” curve to be: −j
ωs
2
■ Evaluate L ∗(s) on new contour and plot polar plot. Same Nyquist
test as before.
2. 1 + L(z) = 0.
■ We can do the Nyquist test directly using z-transforms. The stable
region is the unit circle. The z-domain Nyquist plot is done using a
Nyquist curve which is the unit circle.
■ Nyquist test changes because we are now encircling the STABLE
region (albeit CCW).
I(z)
• Z = # closed-loop unstable poles.

• P = # open-loop unstable poles.


R(z)
• N = # CCW encirclements of −1 in
Nyquist plot.
• Z = P − N.

■ Probably difficult to evaluate L(z)|z=e j θ for −π ≤ θ ≤ π unless using


a digital computer.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–17
3. 1 + L(w) = 0.
■ Now, we convert L(z) #→ L(w) I(w)

L(w) = L(z)|z= 1+(T/2)w .


1−(T/2)w

■ Bilinear transform maps unit circle


R(w)
to jω-axis in w-plane.
■ Use standard continuous-time test
in w-plane.
■ Summary:

Open-loop fn. Range of variable Rule



G H (s) s = j ω, −ωs /2 ≤ ω ≤ ωs /2 Z = P + Ncw

G H (z) z = e j ωT , −π ≤ ωT ≤ π Z = P − Nccw = P + Ncw

G H (w) w = j ωw , −∞ ≤ ωw ≤ ∞ Z = P + Ncw

■ All three methods produce identical Nyquist plots.


Nyquist Diagrams
■ Note that the sampled
Imaginary Axis

a
system does not have ∞
gain margin (a = 0.418, PM
GM = 2.39) and has smaller
PM than cts.-time system.
Real Axis

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–18
4.5: Bode methods

■ Bode plots are an extremely important tool for analyzing and


designing control systems.
■ They provide a critical link between continuous-time and discrete-time
control design methods.
■ Recall:

• Bode plots are plots of frequency response of a system:


Magnitude and Phase.
• In s-plane, H (s)|s= j ω is frequency response for 0 ≤ ω < ∞.

• In z-plane, H (z)|z=e j ωT is frequency response for 0 ≤ ω ≤ ωs /2.

■ Straight-line tools of s-plane analysis DON’T WORK! They are based


on geometry and geometry has changed— jω-axis to z-unit circle.
■ BUT in w-plane, H (w)|w= j ωw is the frequency response for
0 ≤ ωw < ∞. Straight-line tools work, but frequency axis is warped.

PROCEDURE:

1. Convert H (z) to H (w) by H (w) = H (z)|z= 1+(T/2)w .


1−(T/2)w

2. Simplify expression to rational-polynomial in w.


3. Factor into zeros and poles in standard “Bode Form” (Refer to review
notes).
4. Plot the response exactly the same way as an s-plane
) Bode
* plot.
2 ωT
Note: Plots are versus log10 ωw . . . ωw = tan . Can
T 2
re-scale axis in terms if ω if we want.

EXAMPLE : Example seen before with T = 1 second.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–19
0.368z + 0.264
Let G(z) = .
z 2 − 1.368z + 0.368
(1,2)
, 1+0.5w -
0.368 1−0.5w + 0.264
G(w) = , - , 1+0.5w -
1+0.5w 2
1−0.5w
− 1.368 1−0.5w
+ 0.368
0.368(1 + 0.5w)(1 − 0.5w) + 0.264(1 − 0.5w)2
=
(1 + 0.5w)2 − 1.368(1 + 0.5w)(1 − 0.5w) + 0.368(1 − 0.5w)2
−0.0381(w − 2)(w + 12.14)
= .
w(w + 0.924)
(3)
. / . ωw /
− j ω2w − 1 j 12.14 +1
G( jωw ) = . ωw / .
jωw j 0.924 + 1
(4)
Bode Plots
40
Magnitude (dB)

20

−20

−40 −1 0 1 2 3
10 10 10 10 10

180
Phase (deg)

90

−90

−180

−270
−1 0 1 2 3
10 10 10 10 10

Frequency (warped rads/sec)


■ Gain margin and phase margin work the SAME way we expect.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–20
WAIT!
■ We have discussed frequency-response methods without verifying
that discrete-time frequency response means the same thing as
continuous-time frequency response.
■ Verify
X (z) −→ G(z) −→ Y (z)
z sin ωT
■ Let x[k] = sin(ωkT ) . . . X (z) = .
(z − e j ωT )(z − e− j ωT )
Y (z) = G(z)X (z)
G(z)z sin ωT
= .
(z − e j ωT )(z − e− j ωT )
■ Do partial-fraction expansion
Y (z) k1 k2
= + + Yg (z).
z z − e j ωT z − e− j ωT
■ Yg (z) is the response due to the poles of G(z). IF the system is
stable, the response due to Yg (z) → 0 as t → ∞.
■ So, as t → ∞ we say
Yss (z) k1 k2
= +
z z − e j ωT z − e− j ωT
(
G(z) sin ωT ((
k1 =
z − e− j ωT (z=e j ωT
G(e j ωT ) sin ωT
= j ωT
e − e− j ωT
G(e j ωT )
=
2j
̸ G(e j ωT )
|G(e j ωT )|e j
= .
2j
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, STABILITY ANALYSIS TECHNIQUES 4–21
■ Similarly,
̸ G(e j ωT ) ̸ G(e j ωT )
|G(e j ωT )|e− j |G(e j ωT )|e− j
k2 = =− .
2(− j) 2j
■ Combining and solving for yss [k]

yss [k] = k1(e j ωT )k + k2(e− j ωT )k


̸ G(e j ωT ) ̸ G(e j ωT )
j ωT e j ωkT + j − e− j ωkT − j
= |G(e )|
2j
= |G(e j ωT )| sin(ωkT + ̸ G(e j ωT )).

■ Sure enough, |G(e j ωT )| is magnitude response to sinusoid, and


̸ G(e j ωT ) is phase response to sinusoid.

Closed-loop frequency response

■ We have looked at open-loop concepts and how they apply to closed


loop systems . . . our end product.
■ Closed-loop frequency response usually calculated by computer:
G(z)
, for example.
1 + G(z)
■ In general, if |G(e j ωT )| large, |T (e j ωT )| ≈ 1. If |G(e j ωT )| small,
|T (e j ωT )| ≈ |G(e j ωT )|.
■ Closed-loop bandwidth similar to open-loop bandwidth.

• If PM = 90◦ , then C.L. BW = O.L. BW.

• If PM = 45◦ , then C.L. BW = 2×O.L. BW.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540: Digital Control Systems 5–1

DIGITAL CONTROLLER DESIGN

5.1: Direct digital design: Steady-state accuracy

■ We have spent quite a bit of time discussing digital hybrid system


analysis, and some time on controller design via emulation.
■ We now look at “direct digital design.”

Specifications:
■ Steady-state accuracy,
■ Transient response
■ Absolute/ relative stability,
■ Sensitivity,
■ Disturbance rejection,
■ Control effort.

Steady-state accuracy
■ How well does a control system track step/ramp/. . . inputs?
■ General formulation: Y (z) = T (z)R(z).
■ The error is: e[k] = r[k] − y[k]. In Laplace domain:
E(z) = R(z) − T (z)R(z)

= [1 − T (z)]R(z).
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–2
■ Use the final-value theorem to find ess.
ess = lim (z − 1)[1 − T (z)]R(z).
z→1

Unity-feedback systems:
■ If the system is of the form (unity-feedback)

r [k] D(z) G(z) y[k]

■ Then,
D(z)G(z)
T (z) =
1 + D(z)G(z)
1
1 − T (z) = .
1 + D(z)G(z)
■ Let !
K im=1(z − zi )
D(z)G(z) = !p , zi ̸= 1, pi ̸= 1.
(z − 1) N i =1(z − pi )
■ Also, define the “Bode Gain”
!m "
(z − z )
i ""
K dc = K ! ip=1
i =1 (z − pi ) z=1
"

which is the dc-gain with all poles at z = 1 removed.


■ Consider a step input.
$ #
1 z
ess = lim (z − 1)
z→1 1 + D(z)G(z) z − 1
1
= lim .
z→1 1 + D(z)G(z)

1
• If K p = lim D(z)G(z) then ess = .
z→1 1 + Kp
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–3
1
• If N = 0 then ess = .
1 + K dc
• If N > 0 then ess = 0.

■ Now, consider a ramp input.


$ #
1 Tz
ess = lim (z − 1)
z→1 1 + D(z)G(z) (z − 1)2
T
= lim .
z→1 (z − 1) + (z − 1)D(z)G(z)

1 1 T
• If K v = lim (z − 1)D(z)G(z) then ess = = .
z→1 T Kv K dc
T
• If N = 1 then ess = .
K dc
• If N > 1 then ess = 0 (and so forth).

General unity-feedback result

■ Poles and large gains at z = 1 of D(z)G(z) decrease ess but also


decrease stability.
■ System design is a tradeoff between steady-state accuracy, relative
stability, and complexity.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–4
5.2: Direct digital design: Other requirements

Transient response

■ If the system is dominated by second-order poles near z = 1, then we


can determine pole locations for transient-response (step-response)
specifications.

tp Mp
1
ωn ≥ 1.8/tr 0.9

σ ≥ 4.6/ts

−π ζ / 1−ζ 2 0.1
Mp ≈ e . tr t
ts

■ To convert these specifications to the z-plane,

• r = e−σ T .

• Use zgrid to plot locus of constant ζ and ωn .

• Mark regions of acceptable poles on plot.

EXAMPLE : Plot the specifications for


■ M p ≤ 16% −→ ζ ≥ 0.5.
■ ts < 10 s −→ σ ≥ 0.5.
■ tr ≈ 1.8 s −→ ωn ≈ 1.
■ T = 0.2 s.
■ Then, r = e−σ T = e−0.1 = 0.9.
■ Our three boundaries are plotted. What is the region of acceptable
closed-loop poles?

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–5
■ For dominant second-order systems, transient-response design can
also be done using frequency-response information.
■ M p (percent overshoot) and Mr (resonant peak) are related through ζ :

−ζ / 1−ζ 2
Mp = 1 + e
1
Mr = %
2ζ 1 − ζ 2
• Use Mr < 2 dB.

■ Settling time,
&
4 %
ts ≈ (1 − 2ζ 2) + 4ζ 4 − 4ζ 2 + 2,
ωb ζ
where ωb is the closed-loop bandwidth.
■ Also, tr ωb ≈ 2.

Relative stability

■ Want GM ≫ 1 and PM ≫ 0.
■ PM ≈ 100ζ (especially for second-order systems).
■ Only sure way to measure GM and PM is Nyquist plot.

Sensitivity and disturbance rejection

■ If we define S(z) = 1 − T (z) then

Y (z) = T (z)R(z) + S(z)W (z) + T (z)V (z)

= [1 − S(z)]R(z) + S(z)W (z) + [1 − S(z)]V (z)

for a unity-feedback system.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–6

Sensor noise and plant


Magnitude of D(e j ω )G(e j ω )

sensitivity boundary
■ Want sensitivity small for

Error Boundary
good disturbance rejection

Steady−state
and tracking, but large for
sensor-noise rejection and
robustness.
■ This typically places
constraints on the “loop gain”
L(z) = D(z)G H (z).
−180 Phase Margin
Boundary

Control effort

■ There are always physical constraints on control effort.

|u(t)| < # saturation limits


' tf
|u(τ )| dτ < # finite total resources
0

|u 2(t)| < # finite power

■ Designing controllers with constrained control effort can be difficult.


Subject of “optimal control.”

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–7
5.3: Phase-lag compensation

■ Compensators/controllers come in many varieties.

• Some common types are phase-lead, phase-lag, and PID.

■ Root-locus and Bode techniques can be used to design


compensators.
■ We mostly consider compensation using a first-order system:
(z − z 0)
D(z) = K d .
(z − z p )
■ We first consider using Bode methods to design our compensator, so
we need to convert D(z) → D(w).

D(w) = D(z)|z= 1+(T/2)w ,


1−(T/2)w

which is also first-order, and has transfer function


# $
1 + w/ωw0
D(w) = a0 ,
1 + w/ωw p
where ωw0 = zero location and ωw p = pole location in the w-plane; a0
is the dc-gain.
■ We will eventually need to convert the compensator back to D(z).
The correspondences are
# $
ωw p (ωw0 + 2/T ) 2/T − ωw0 2/T − ωw p
K d = a0 z0 = zp = .
ωw0 (ωw p + 2/T ) 2/T + ωw0 2/T + ωw p
■ If |ωw0 | < |ωw p | then compensator is a “lead” compensator.
■ If |ωw0 | > |ωw p | then compensator is a “lag” compensator.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–8
Phase-lag compensation

■ A phase-lag compensator has its pole closer to the origin (of the
w-plane) than its zero (closer to 1 in the z-plane).
■ The Bode plot of a typical lag compensator is
ωw p ωw0
20 log10 (a0)

( )1
a0ωw p ωw p ωw0
20 log10
ωw0 −90◦

( )
a 0 ωw p
■ Low-frequency gain is a0, high-frequency gain is 20 log10 dB.
ωw0
■ We consider designing a compensator for the system
1 − e−sT
r (t) D(z) G p (s) y(t)
T s

) (
1 − e−sT
■ Let G(s) = G p (s), G(z) = Z[G(s)], G(w) = G(z)|z= 1+(T/2)w .
s 1−(T/2)w

■ Lag controller adds phase. Must be careful NOT to add phase near

crossover of G( jωw ).
■ Therefore, keep both the pole and zero at low frequency.

Phase-lag design method (Bode)

■ System ess specifications determine dc-gain a0.


■ Desired phase margin PM also specified.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–9

1. Plot Bode plot of G(w).


2. Determine frequency ωw1 where phase of G(w) is about
−180◦ + PM + 5◦. The crossover of the compensated system will
occur at approximately this frequency.
3. Choose ωw0 = 0.1ωw1 . This ensures that little phase lag is introduced
at new crossover (actually, about 5◦ . . . see above)
4. At ωw1 we want |D(ωw1 )G(ωw1 )| = 1. The gain of the compensator at
“high frequency” is a0ωw p /ωw0 .
" "
" a 0 ωw p "
" ω G( jωw1 )" = 1
" "
w0
a 0 ωw p 1
=
ωw0 |G( jωw1 )|
or
0.1ωw1
ωw p = .
a0|G( jωw1 )|
5. Design is complete since we know a0, ωw0 , and ωw p . Note that if
H (s) ̸= 1, then we replace G(w) with G H (w).
1
EXAMPLE : Let G p (s) = and T = 0.05 s.
s(s + 1)(0.5s + 1)
# $
z−1 1
G(z) = Z 2
z s (s + 1)(0.5s + 1)
# $
z − 1 0.005z 1.5z 2z 0.5z
= − + −
z (z − 1)2 z − 1 z − 0.9512 z − 0.9048
■ Plot Bode plot of G(w)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–10
Blue: Plant; Red: Lag; Green: Compensated
60

Magnitude (dB)
40

20

−20

−40

−60 −3 −2 −1 0 1
10 10 10 10 10

0
Phase (deg)

−90
−120

−180

−270 −3 −2 −1 0 1
10 10 10 10 10

Frequency (warped rads/sec)


■ Design spec gives a0 = 0 dB, PM = 55◦.
■ From graph, we see that ̸ G( jωw ) = (−180◦ + 55◦ + 5◦) = −120◦ at
ωw1 ≈ 0.36. Also, |G( jωw1 )| ≈ 2.57.
0.1ωw1
■ ω
w0 = 0.1ω w1 = 0.036 and ω wp = = 0.014.
a0|G( jωw1 )|
■ Combining the above, and converting from D(w) to D(z) we get
0.3891z − 0.3884
D(z) = .
z − 0.9993
Finite-precision problem

■ When implementing a phase-lag filter we may have difficulty.


■ Coefficients of filter stored as binary fixed-point values.
■ For example,
b7 b6 b5 b0
+ + + · · · + Value =
21 22 23 28
for an 8-bit fixed-point value.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–11
( )
1 1 1
EXAMPLE : (0.11000001)2 =
+ + = (0.75390625)10.
2 4 256 10
■ Minimum value that can be represented is zero.

■ Maximum value is (0.11111111)2 = (1 − 1/256)10 = (0.99609375)10.


■ For previous example, need denominator coefficient of 0.9993 but
implement 0.99609375. Need numerator coefficients
(0.3891)10 ➠ (0.01100011)2 = (0.38671875)10

(0.38840)10 ➠ (0.01100011)2 = (0.38671875)10


■ Compensator zero is shifted to “1” causing a dc-gain of zero. We get
0.38671875(z − 1)
D(z)implemented = .
z − 0.99609375
Blue: Plant; Red: Lag; Green: Compensated
60
Magnitude (dB)

40

20

−20

−40

−60 −3 −2 −1 0 1
10 10 10 10 10

0
Phase (deg)

−90
−120

−180

−270 −3 −2 −1 0 1
10 10 10 10 10

Frequency (warped rads/sec)



■ Phase margin of 70 (good).
■ System type reduced (bad).
■ Need more bits in implementation or smarter implementation method.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–12
5.4: ]Phase-lead compensation

■ A phase-lead compensator has its zero closer to the origin in the


w-plane than its pole (closer to 1 in the z-plane).
■ Low-frequency gain of 20 log10 a0 dB.
a 0 ωw p
■ High-frequency gain of 20 log dB. (same)
10
ωw0
( )
a0 ωw p
20 log10
ωw0

θm
20 log10(a0 )

ωw0 ωwm ωw p ωw0 ωwm ωw p


■ Adds phase. Maximum phase shift occurs at
%
ωwm = ωw p ωw0 geometric mean

The phase shift is


* +, - ./
1 ωw p ωw0
θm = tan−1 − .
2 ωw0 ωw p

At this location, ,
ωw p
|D( jωwm )| = a0 .
ωw0
■ Note that lead controller decreases phase near crossover.

• Stabilizing effect, but

• Increases high-frequency gain, . . . destabilizing.

■ Design tends to be trial-and-error.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–13
Phase-lead design method (Bode)

■ System ess specifications determine dc-gain a0.


■ Desired phase margin PM also specified.

1. Crossover frequency must be generated ωw1 (more later). Then, spec


is D( jωw1 )G(ωw1 ) = 1̸ (−180◦ + PM). Gain margin not specified, but
must be “adequate.”
2. We see that
1
|D( jωw1 )| =
|G( jωw1 )|
and
'
̸ D( jωw1 ) = −180◦ + PM − ̸ G( jωw1 ) = θ.

3. Can derive (Appendix I of Phillips/Nagle)


1 − a0|G( jωw1 )| cos θ cos θ − a0|G( jωw1 )|
a1 = and b1 = ,
ωw1 |G( jωw1 )| sin θ ωw1 sin θ
where ωw0 = a0/a1 and ωw p = 1/b1.
■ Note that this design method only works when certain constraints on
the value chosen for ωw1 are met. First, θ > 0 since this is a lead
compensator. Also, system must be stable.

I) θ > 0 leads to ̸ G( jωw1 ) < −180◦ + PM.


II ) |D( jωw1 )| > a0 for lead compensator, so |G( jωw1 )| < 1/a0.
III ) b1 must be positive for stability. cos θ > a0|G( jωw1 )|.
■ Note: If H (s) ̸= 1 then replace G(w) with G H (w) everywhere.

EXAMPLE : Revisit previous example.


■ Unity dc-gain, a0 = 1 and PM ≥ 55◦.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–14
■ Choose ωw1 : ̸ G( jωw1 ) < −125◦ by condition ( I).
■ |G( jωw1 )| < 1 by condition ( II).
■ Select (arbitrarily) ωw1 = 1.2. Then, ̸ G( jωw1 ) = −173◦, and
|G( jωw1 )| = 0.45. Thus, conditions ( I) and ( II) are met.
■ Verify: θ = −180 + 55 + 173 = 48◦. cos(θ) = 0.67 > |G( jωw1 )| = 0.45
so condition (III) is met as well.
■ Therefore, our selection for ωw1 is valid. Continue with design.
1 − (1)(0.4576)(cos(48◦))
a1 = = 1.701
(1.2)(0.4576)(sin(48◦))
cos(48◦) − (1)(0.4576)
b1 = = 0.2387.
(1.2)(sin(48◦))
■ So, Blue: Plant; Red: Lead; Green: Compensated
a1 w + a0 60
Magnitude (dB)

D(w) = 40
b1 w + 1 20

1.701w + 1 0

= −20
0.2387w + 1 −40

6.539(z − 0.9710) −60 −2 −1 0 1

D(z) = . 10 10 10 10

z − 0.8106
90

The PM for this controller is


Phase (deg)


0

55◦ and the GM is 12.3 dB. −90


−125
■ A different choice of ωw1 −180

would give same PM but −270 −2


10
−1
10
0
10
1
10

different GM. Frequency (warped rads/sec)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–15
Blue: Plant; Red: Lead; Green: Lag
60

Magnitude (dB)
40

20

■ Compare the two −20

−40
examples from an −60 −3 −2 −1 0 1
10 10 10 10 10
open-loop perspective.
−90
■ Phase-lead has larger

Phase (deg)
−120

bandwidth.
−180

−270 −3 −2 −1 0 1
10 10 10 10 10

Frequency (warped rads/sec)


Closed-Loop: Blue: Plant; Red: Lead; Green: Lag
20
Magnitude (dB)

■ Compare from a closed- −20

loop perspective. −40

−60 −1
Again, phase-lead has
0 1
■ 10 10 10

Frequency (warped rads/sec)


large closed-loop
Step Response

bandwidth or large 1

high-frequency gain.
0.5

0
0 2 4 6 8 10 12 14 16 18

Time (sec.)
■ This may magnify effects due to sensor noise, and accentuate
unmodeled high-frequency dynamics.
■ One possible solution is to add a pole to D(w) at high frequency (so
not to change PM, but to reduce high-frequency gain).

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–16
5.5: Lead/lag tradeoffs; other compensators
■ In summary, some possible advantages of phase-lag compensation
are:
1. The low-frequency characteristics are maintained or improved.
2. The stability margins are improved.
3. The bandwidth is reduced, which is an advantage if high-frequency noise is a
problem. Also, for other reasons, reduced bandwidth may be an advantage.

■ Some possible disadvantages of phase-lag compensation are:


1. The reduced bandwidth may be a problem in some systems.
2. The system transient response will have one very slow term. This will become
evident when root-locus design is covered.
3. Numerical problems with filter coefficients may result.

■ Some possible advantages of phase-lead compensation are:


1. Stability margins are improved.
2. High-frequency performance, such as speed-of-response, is improved.
3. Phase-lead compensation is required to stabilize certain types of systems.

■ Some possible disadvantages of phase-lead compensation are:


1. Any high-frequency noise problems are accentuated.
2. Large signals may be generated, which may damage the system or at least
result in nonlinear operation of the system. Since the design assumed linearity,
the results of the nonlinear operation will not be immediately evident.

Lag-Lead Compensation
■ System specifications cannot always be achieved using a first-order
(lead or lag) compensator.
■ For example, low steady-state error may give very large bandwidth if
a lead compensator is used.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–17
■ One option is to cascade lag and lead filters.
Mag Phase

■ Lag increases low-frequency gain.


■ Lead increases bandwidth and stability margins.

Lead-lag design method (Bode)


■ Design lag first for acceptable Bode gain.
■ Design lead for resulting system to give bandwidth and stability.

PID compensation

■ A practical PID compensator has transfer function


# ( ) ( )$
T z+1 z−1
D(z) = K 1 + + TD .
2TI z − 1 Tz
Note that a bilinear integrator and a reverse-Euler derivative were
used.
Mag Phase

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–18
■ Integrator term improves steady-state performance.
■ Derivative term improves stability and PM.

PID design method (Bode)


K
■ Very similar to lead design. Use D(w) = K + + K TD w.
TI w
■ Find D(w) such that

D( jωw1 )G( jωw1 ) = 1̸ − 180◦ + PM

for a selected ωw1 . Let θ = −180◦ + PM − ̸ G( jωw1 ).


■ Then, we can show that
cos(θ)
K =
|G( jωw1 )|
and
1
TD ωw1 + = tan(θ).
TI ωw1
■ Note that TD and TI are not uniquely specified. Choose one to meet
some other specification. Increasing TD increases bandwidth.
Decreasing TI decreases steady-state errors.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–19
5.6: Root-locus design

■ An alternative design method is to use the root locus.


■ Locus uses open-loop D(z)G H(z) information to plot locus of
closed-loop poles.
■ By adding dynamics to D(z) we change the locus.

Phase-lag controller

■ To design a root-locus lag controller, we assume that the


uncompensated system has good transient response but poor
steady-state response.
■ We set ( )( )
1 − zp z − z0
D(z) = .
1 − z0 z − zp
0 12 3
Kd

■ Note D(z) has unity dc-gain and K d < 1. We place the pole near
(very near) z = 1 and the zero a little to the left of the pole.

■ Consider the uncompensated


locus to the right. Pick a gain K u
za
to give pole locations z a and z a . z3
Assume that these pole locations z1 z2
z̄ a
are chosen to provide good
transient response.

■ Add the lag pole and zero very close to z = 1. The two poles and zero
are so close together, they behave almost like a single pole. The
locus is unchanged, except around z = 1.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–20

z0
z a′
z3
z1 z2
z̄ a′
zp
0 12 3
Expanded scale
■ But, consider the gain K c to get poles at z a′ and z ′a . The compensator
1 − zp
gain K d = < 1.
1 − z0
■ The uncompensated gain is the gain to put poles at z and z without
a a
D(z).
|z a − z 2||z a − z 3|
Ku = .
|z a − z 1|
■ The compensated gain is
|z a′ − z p ||z a′ − z 2||z a′ − z 3 |
Kc =
K d |z a′ − z 0||z a′ − z 1|
|z a − z 2||z a − z 3|

K d |z a − z 1|
Ku
= > Ku.
Kd
■ Therefore, the lag compensator allows us to use larger gain for the
same transient response and hence steady-state error is improved.

Phase-lag design procedure (root-locus method)

1. Plot locus of uncompensated system. Find acceptable pole locations


for transient response on the locus. Set K u = gain to put poles there.
2. Determine from specifications the required gain K c to meet
steady-state error requirements.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–21

3. Compute K d = K u /K c .
4. Choose compensator pole location close to z = 1.
5. The compensator zero is
1 − zp
z0 = 1 − .
Kd
6. Iterate (if necessary) to perfection (choosing slightly different pole
location).

Phase-lead controller

■ A phase-lead controller generally speeds up the transient response of


a system.
(z − z 0) 1 − zp
D(z) = K d , Kd = > 1.
(z − z p ) 1 − z0
■ That is, the zero is closer than the pole to the unit circle.

Phase-lead design procedure (root-locus method)

1. Choose desired pole locations z b and z b .


2. Place the zero of the compensator to cancel a stable pole of G(z).
3. Choose either the gain of the compensated system K c or the
compensator pole z p such that D(z) is phase-lead.
4. Then, for z b to be on the locus, we must satisfy

K c D(z)G(z)|z=zb = −1

Solve for the unknown, which is either K c or z p .


■ Note that we only solve for one pole location. The other roots may not
be satisfactory. May need trial-and-error approach to design.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–22

zb za
z3
z1 zp
z̄ b z̄ a
z0 = z2

Pole-zero Cancellation

■ Can it occur?
If our zero is too far left If our zero is too far right

z3 z3
zp z0 z2 zp z2 z0

■ Either way, the locus is still okay. (What if we tried to cancel an


unstable pole?)

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–23
5.7: Numeric design of PID controllers

■ A PID controller is implemented via difference equations: e.g.,

u[k] = u[k − 1] +
#( ) ( ) $
T TD 2TD TD
K 1+ + e[k] − 1 + e[k − 1] + e[k − 2]
TI T T T
or,
u[k] = u[k − 1] + q0 e[k] + q1 e[k − 1] + q2 e[k − 2]
where q0 , q1, and q2 are constants.
■ Different sets of {q0 , q1 , q2 } give different performance.
■ Can select a set of parameters to satisfy some design specifications.
■ Some types of design spec:
4 4
IAE : J = |e[k]| ISE : J= |e[k]|2.
k k
4
ITAE : J= k|e[k]|
k

■ Over large number of samples, select q = {q0, q1, q2} to minimize J .


Function minimization in one dimension J (q)

■ What value of q minimizes


J (q) = q 2 + 2q + 5?
■ Start with a guess, then refine until
required accuracy is achieved. q
−4 −3 −2 −1 0 1 2 3 4
1. Start with a guess. Say, q = 3.
2. Set the “step size” to a small value. Say γ = 10−3, and set the
gradient “test step size” δq to a value smaller than γ .

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–24
∂J J (q + δq) − J (q)
3. Estimate the slope: ≈ .
∂q δq
( )
∂J
4. Update parameters: q ← q − γ .
∂q
5. Repeat from (3) until convergence.
■ Note that update is in negative direction of gradient.

Function minimization in two dimensions

■ Suppose we need to minimize a


function of two variables, q0 and J (q0 , q1 )
q1. For example,

J (q0 , q1 ) = (q0 − 2)2 + (q1 + 1)2.


■ Instead of a curve to track along, we have a three-dimensional
surface.
1. Start with a guess. Say, q0 = 5 and q1 = 3 .
2. Set the “step size” to a small value. Say γ = 10−3, and set the
gradient “test step sizes” δq0 = δq1 to a value smaller than γ .
3. Estimate the slope in the q0 -direction:
∂J J (q0 + δq0, q1 ) − J (q0, q1 )

∂q0 δq0
4. Estimate the slope in the q1 -direction:
∂J J (q0, q1 + δq1) − J (q0, q1 )

∂q1 δq1
5. Normalize the gradient for better performance
-
( ) ( )
∂J 2 ∂J 2
'= + .
∂q0 ∂q1
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–25
6. Update q0 and q1 :
( )
γ ∂J
q0 ← q0 −
' ∂q0
( )
γ ∂J
q1 ← q1 − .
' ∂q1
7. Repeat from (3) until convergence.

■ Note: In many dimensions,


performance optimization is
complicated and “global”
minimum is not guaranteed.

Function minimization in three(+) dimensions

■ Our PID controller design problem is a problem in three variables.

1. Start with a guess. q = {q0, q1, q2}.


2. Set the “step size” to a small value. Say γ = 10−3, and set the
gradient “test step sizes” δq0 = δq1 = δq2 to a value smaller than γ .
3. Estimate the slope in the q0 -direction:
∂J J (q0 + δq0, q1 , q2 ) − J (q0, q1 , q2 )

∂q0 δq0
4. Estimate the slope in the q1 -direction:
∂J J (q0, q1 + δq1, q2 ) − J (q0, q1 , q2 )

∂q1 δq1
5. Estimate the slope in the q2 -direction:
∂J J (q0, q1 , q2 + δq2) − J (q0, q1 , q2 )

∂q2 δq2

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–26

6. Normalize the gradient for better performance


-
( ) ( ) ( )
∂J 2 ∂J 2 ∂J 2
'= + + .
∂q0 ∂q1 ∂q2
7. Update q0, q1 and q2:
( )
γ ∂J
q0 ← q0 −
' ∂q0
( )
γ ∂J
q1 ← q1 −
' ∂q1
( )
γ ∂J
q2 ← q2 − .
' ∂q2
8. Repeat from (3) until convergence.
g=zpk([0.1+0.1*j 0.1-0.1*j],[0.3+0.5*j 0.3-0.5*j 0.8],1,-1);
gamma=0.01; dq=0.001; T=20;
wgtfn=[0:T]; % for ITAE

q0 = 0.1; q1 = 0.1; q2 = 0.1;

maxiter=410; J=zeros([1 maxiter]);

for i=1:maxiter,
d=tf([q0+dq q1 q2],[1 -1 0],-1);
t=feedback(d*g,1); s=step(t,T+1); J1=wgtfn*abs(1-s);

d=tf([q0 q1+dq q2],[1 -1 0],-1);


t=feedback(d*g,1); s=step(t,T+1); J2=wgtfn*abs(1-s);

d=tf([q0 q1 q2+dq],[1 -1 0],-1);


t=feedback(d*g,1); s=step(t,T+1); J3=wgtfn*abs(1-s);

d=tf([q0 q1 q2],[1 -1 0],-1);


t=feedback(d*g,1); s=step(t,T+1); J(i)=wgtfn*abs(1-s);
if (mod(i-10,100)==0),
J(i), plot(0:T,s); axis([0 T 0 1.4]); drawnow;
end

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–27
p1=(J1-J(i))/dq; p2=(J2-J(i))/dq; p3=(J3-J(i))/dq;
]
Delta=sqrt(p1*p1+p2*p2+p3*p3);

q0=q0-(gamma/Delta)*p1; q1=q1-(gamma/Delta)*p2; q2=q2-(gamma/Delta)*p3;


end

■ Optimization progressing:
PID Step Responses Learning Curve
300

1.2
250
Amplitude

1
200

0.8

J
150
0.6

100
0.4

50
0.2

0 0
0 2 4 6 8 10 12 14 16 18 20 0 50 100 150 200 250 300 350 400

Time (sec.) Iteration


■ Note that each time we adapt {q0 , q1 , q2 } we need to simulate the
system performance (e.g., output to a step input) four times.

Initial guess for K , TI and TD :

■ Ziegler–Nichols can give a good initial guess for PID parameters.


■ “Rules of thumb” for selecting K , TI , TD .
■ Not optimal in any sense—just provide “good” performance.

METHOD I : If system has step response like this,


Slope, A/τ
A
Y (s) Ae−τd s
= ,
U (s) τ s + 1
(first-order system plus delay)
τd τ
■ We can easily identify A, τd , τ from this step response.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–28
■ Don’t need complex model!
■ Tuning criteria: Ripple in impulse response decays to 25% of its value
in one period of ripple

Period RESULTING TUNING RULES :


1
P PI PID
τ 0.9τ 1.2τ
0.25 K = K = K =
Aτd Aτ Aτd
τd d
TI = ∞ TI = TI = 2τd
0.3
TD = 0 TD = 0 TD = 0.5τd

METHOD II : Configure system as

r (t) Ku Plant y(t)

■ Turn up gain K u until system produces oscillations (on stability


boundary) K u = “ultimate gain.”

Period, Pu RESULTING TUNING RULES :


1
P PI PID
K = 0.5K u K = 0.45K u K = 0.6K u
1 TI = 0.5Pu
TI = ∞ TI = Pu
1.2 Pu
TD = 0 TD = 0 TD =
8

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–29
5.8: Direct design method of Ragazzini
■ An interesting design method computes D(z) directly.
■ Note: The closed-loop transfer function is
D(z)G(z)
T (z) =
1 + D(z)G(z)
(1 + D(z)G(z))T (z) = D(z)G(z)

D(z)G(z)(T (z) − 1) = −T (z)


1 T (z)
D(z) = .
G(z) 1 − T (z)
■ Can control design be this simple?
■ The problem is that this technique may ask for the impossible:
(non-causal, unstable . . . ).

Causality:
■ If D(z) is causal, then it has no poles at ∞. D(∞) must be finite or
zero. Therefore, T (z) must have enough zeros at ∞ to cancel out
1
poles at ∞ from .
G(z)
• T (z) must have a zero at infinity of the same order as the order of
the zero of G(z) at infinity.
■ Put another way, the delay in T (z) must be at least as long as the
delay in G(z).

Stability:
■ If G(z) has unstable poles, they cannot be canceled directly by D(z)
or there will be trouble!
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–30
■ The characteristic equation of the closed-loop system is
1 + D(z)G(z) = 0
c(z) b(z)
Let D(z) = and G(z) = . Then
d(z) a(z)
c(z) b(z)
1+ = 0.
d(z) a(z)
■ Let the unstable pole in G(z) be at α, so a(z) = (z − α)a(z). To cancel

it, c(z) = (z − α)c(z), and


(z − α)a(z)d(z) + (z − α)c(z)b(z) = 0

(z − α)[a(z)d(z) + c(z)b(z)] = 0.
■ The unstable root is still a factor of the characteristic equation! (oops).
■ Unstable poles must be canceled via the feedback mechanism. This
imposes constraints on T (z).
• [1 − T (z)] must contain as zeros all the poles of G(z) outside the
unit circle.
• T (z) must contain as zeros all the zeros of G(z) outside the unit
circle.

Steady-state accuracy:
■ Assume that the system is to be of type-I with velocity constant K v .
■ Note:
E(z) = [1 − T (z)]R(z).
■ We must have zero steady-state error to a step. Therefore
z
lim (z − 1)[1 − T (z)] =0
z→1 (z − 1)
or T (1) = 1.
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–31
■ Must have 1/K v error to a unit ramp. Therefore
Tz 1
lim (z − 1)[1 − T (z)] = .
z→1 (z − 1)2 Kv
Use l’hôpital’s rule to evaluate:

"
dT (z) "" 1
−T = .
dz "z=1 K v
# $
z + 0.9672
EXAMPLE : Consider T = 1 s, G(z) = 0.0484 .
(z − 1)(z − 0.9048)
■ Want T (z) to approximate s 2 + s + 1 = 0, or, converting to z-plane,
z 2 − 0.7859z + 0.3679 = 0.

■ So,
b0 + b1 z −1 + b2 z −2 + · · ·
T (z) = .
1 − 0.7859z −1 + 0.3679z −2
■ Causality requires T (z)|
z=∞ = 0 because G(∞) = 0, so b0 = 0.

■ Note that G(z) has no poles outside the unit circle, so don’t need to
worry about that.
■ Zero steady-state error to a step requires
b1 + b2 + · · ·
T (1) = = 1.
1 − 0.7859 + 0.3679
Therefore,
b1 + b2 + · · · = 0.5820.
■ Steady-state error of 1/K v to a unit ramp (let K v = 1)
"
1 dT (z) ""
=−
Kv dz "z=1
"
dT (z) ""
1=+
dz −1 "z=1
Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett
ECE4540/5540, DIGITAL CONTROLLER DESIGN 5–32
(0.5820)[b1 + 2b2 + 3b3 + · · · ] − (0.5820)[−0.7859 + 0.3679(2)]
= ,
(0.5820)2
or, b1 + 2b2 + 3b3 + · · · = 0.5318.
■ So, we have two constraints. We can satisfy these constraints with
just b1 and b2:
Step Response
1.5

b1 = 0.6321

Output y(t) and


control u(t)/20
1

0.5
b2 = −0.0501.
0
■ Then,
−0.5
0.6321z − 0.0501
T (z) = 2 . −1
z − 0.7859z + 0.3679 0 2 4 6 8 10 12 14 16 18

and Time (sec.)

1 T (z) (z − 0.9048) (z − 0.07932)


D(z) = = 13.07 .
G(z) 1 − T (z) (z + 0.9672) (z − 0.418)
■ Note that T (z) has two well damped poles. Why the oscillation?
U (z) D(z) T (z)
= =
R(z) 1 + D(z)G(z) G(z)
(z − 0.0793) (z − 1)(z − 0.9048)
= 13.07 2 .
(z − 0.7859z + 0.3679) (z + 0.9672)
■ This has a poorly damped pole at −0.9672. Aha! This corresponds to
the zero of G(z) at −0.9672.
■ A solution: Use a b3 term in T (z) and add the constraint that
T (z)|z=−0.9672 = 0.

Lecture notes prepared by Dr. Gregory L. Plett. Copyright © 2017, 2009, 2004, 2002, 2001, 1999, Gregory L. Plett

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy