4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1...

5
Engineering Tripos Part IIa Module 3F1 -- Signals and Systems Discrete Time Systems (Lectures 1--6) Handout 2 Ioannis Lestas, October 2010 g k = α 1 p k 1 + ··· + α n p k n 4. Time response behaviour/pole locations Re Im 1 x x Let p i = poles of G(z) (assume distinct). 2 x 1. Distance from origin is a measure of decay rate. 2. Complex poles just inside unit circle give lightly damped oscillation. 3. Oscillation is possible for real poles on negative real axis. x x x xx x x x x x x x 3 α i 1 p i z 1 (|p i | < 1) α 0 1 z 1 α 0 y k lim k→∞ y k = y k = as k →∞ +(z 1) α i 1 p i z 1 (z 1)Y (z)= zα 0 α i p k i lim z1 (z 1)Y (z) Suppose all the poles of (z-1) Y(z) lie strictly inside the unit circle. Then Final Value Theorem (FVT) Proof. Y(z) has all poles inside the unit circle except possibly a (non-repeated) pole at z=1. Assuming distinct poles, partial fractions gives: + terms of the form Inverse z-transform: + terms of the form Note: α 0 = α 0 Y (z)= 4 (k 0) U (z)= 1 1 z 1 Y (z)= G(z) 1 1 z 1 = G(z) z z 1 lim k→∞ y k = = G(1) Example. Let G(z) be the transfer function of a stable filter. Find the steady state response to a step input. Note that Y(z) satisfies the conditions of FVT. Then: Thus, G(1) is the “d.c. gain “ of a digital filter. lim z1 (z 1)G(z) z z 1 5 u k = cos(kθ) (y ss ) k U (z)= 1 1 e jθ z 1 Y (z)= G(z) 1 1 e jθ z 1 β i 1 p i z 1 5. Frequency Response G(z) Stable system + terms of the form constants Easier to work with complex form: uk = e jkθ = G e jθ 1 1 e jθ z 1 where pi are the poles of G(z). G(e jθ ) comes from “cover-up rule” in partial fractions. 6 G e jθ e jkθ G e jθ cos kθ + G e jθ (y ss ) k = (y ss ) k = = G e jθ e jG(e jθ ) All terms except the first correspond to decaying exponentials, since |p i | < 1. Hence, the steady state response for u k = cos(kθ)+ j sin(kθ): For a real input u k = cos(kθ) 7 G e jθ e jkθ Take u k = e jkθ . Then Alternative derivation (using convolution) = k i=0 g i e j(ki)θ y k = k i=0 g i u ki = e jkθ k i=0 g i e jiθ = e jkθ g i e jiθ g i e jiθ e jkθ · (tail) i =0 i = k +1 { 8 = i=k+1 g i e jiθ i=k+1 |g i | Stable G(z) i=0 |g i | = M< k i=0 |g i | M as k →∞ i=k+1 |g i | = M k i=0 |g i | 0 as k →∞ Note that So “tail” part corresponds to “transients”, and tends to zero as k →∞. We then get the same expression as before for steady state response. 9

Transcript of 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1...

Page 1: 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1 Gain-phase plots/Bode diagrams ... The Bode plot displays |G(ejωT) ... Advantage:

Engineering Tripos Part IIa

Module 3F1 -- Signals and Systems

Discrete Time Systems (Lectures 1--6)

Handout 2

Ioannis Lestas, October 2010

⇒ gk = α1pk1 + · · · + αnpk

n

4. Time response behaviour/pole locations

Re

Im

1

x

x

Let pi = poles of G(z) (assume distinct).

2

x

1. Distance from origin is a measure of decay rate.

2. Complex poles just inside unit circle give lightly damped oscillation.

3. Oscillation is possible for real poles on negative real axis.

x

x

x

x x

xx

xx

x

x

x

3

αi

1− piz−1(|pi| < 1)

α0

1− z−1

α0

⇒ yk →

limk→∞

yk =

yk =as k →∞

+(z − 1)� αi

1− piz−1(z − 1)Y (z) = zα0

αipki

limz→1

(z − 1)Y (z)

Suppose all the poles of (z-1) Y(z) lie strictly inside the unit circle. Then

Final Value Theorem (FVT)

Proof. Y(z) has all poles inside the unit circle except possibly a (non-repeated) pole at z=1. Assuming distinct poles, partial fractions gives:

+ terms of the form

Inverse z-transform:

+ terms of the form

Note:

α0 =

α0

Y (z) =

4

(k ≥ 0)

U(z) =1

1− z−1

⇒ Y (z) = G(z)1

1− z−1= G(z)

z

z − 1

limk→∞

yk = = G(1)

Example. Let G(z) be the transfer function of a stable filter. Find the steady state response to a step input.

Note that Y(z) satisfies the conditions of FVT. Then:

Thus, G(1) is the “d.c. gain “ of a digital filter.

limz→1

(z − 1)G(z)z

z − 1

5

uk = cos(kθ) (yss)k

⇒ U(z) =1

1− ejθz−1

⇒ Y (z) = G(z)1

1− ejθz−1

βi

1− piz−1

5. Frequency Response

G(z)

Stable system

+ terms of the form

constants

Easier to work with complex form: uk = ejkθ

= G�ejθ

� 11− ejθz−1

where pi are the poles of G(z).

G(ejθ) comes from “cover-up rule” in partial fractions. 6

G�ejθ

�ejkθ

��G�ejθ

��� cos�kθ + ∠G

�ejθ

��(yss)k =

(yss)k =

=��G

�ejθ

��� ej∠G(ejθ)

All terms except the first correspond to decaying

exponentials, since |pi| < 1.

Hence, the steady state response for uk = cos(kθ) + j sin(kθ):

For a real input uk = cos(kθ)

7G

�ejθ

�ejkθ

Take uk = ejkθ. Then

Alternative derivation (using convolution)

=k�

i=0

giej(k−i)θ

yk =k�

i=0

giuk−i

= ejkθk�

i=0

gie−jiθ

= ejk�

gie−jiθ −

�gie

−jiθ�

−ejkθ · (tail)

i = 0 i = k + 1

∞∞

{

8=

�����

∞�

i=k+1

gie−jiθ

����� ≤∞�

i=k+1

|gi|

Stable G(z) ⇒∞�

i=0

|gi| = M <∞

⇒k�

i=0

|gi|→M as k →∞

⇒∞�

i=k+1

|gi| = M −k�

i=0

|gi|→ 0 as k →∞

Note that

So “tail” part corresponds to “transients”, and tends to zero as k →∞.

We then get the same expression as before for steady state response.9

Page 2: 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1 Gain-phase plots/Bode diagrams ... The Bode plot displays |G(ejωT) ... Advantage:

u(kT ) = cos(ωkT )

⇒ yss(kT ) =��G

�ejωT

��� cos�ωkT + ∠G

�ejωT

��

cos(ωkT ) = cos((ω + 2π/T )kT )

Linear or logarithmic scales are used for ω and |G(ejωT )| depending on theapplication.

5.1 Gain-phase plots/Bode diagrams

Take a sinusoid of frequency ! rad/sec, sampled with T = sampling period (seconds):

Re

ImNote that

so going more than a complete revolution is redundant.

The Bode plot displays |G(ejωT )| and ∠G(ejωT ) versus ω for ω ∈ [0, π/T ].

This corresponds to G(ejθ) for θ ∈ [0, π], i.e. the evaluation ofG(z) around the upper half unit circle.

10

H(z) = c�m

k=1(z − zk)�nk=1(z − pk)

��ejθ − p1

�� ∠�ejθ − p1

�ejθ

∠H(ejθ) = ∠(c) +m�

k=1

∠(ejθ − zk)−n�

k=1

∠(ejθ − pk)

5.2 Pole-zero diagram

Re

Im

xx

xo

Consider the vectors joining the poles/zeros to ejθ.

p1

|H(ejθ)| = |c|�m

k=1 |ejθ − zk|�nk=1 |ejθ − pk|

11

E.g.1

z − 0.4which is a simple low pass filter.

Re

Im

x0.4

ejθ

10.6→

← 11.4

12

Consider a sequence x(kT ) which is zero for k < 0 and k ≥ N .Then the z-transform of the sequence is given by:

X(ej2πn/N ) =N−1�

k=0

x(kT )e−j2πnk/N

x(kT ) =1N

N−1�

n=0

X(ej2πn/N )ej2πnk/N

Im

Re

5.3 Relation between z-transforms and Discrete Fourier Transforms (DFTs)

x

x

xx

x

xx

xx

x

X(z) =N−1�

k=0

x(kT )z−k

Take N points around the unit circle: ej2πn/N for n = 0, . . . N − 1.

Evaluate the z-transform at these points:

This is the definition of the Discrete Fourier Transform!The inverse transform is:

There are fast algorithms for its computation if N = power of 2(FFT — Fast Fourier Transform). 13

= c× z2 − λ√

2z + λ2

z2 − µ√

2z + µ2

We need to arrange a dip in |H(ejωT )| around ω = 2π × 50 rad/sec.

<

H(z) = c× (z − λejπ/4)(z − λe

−jπ/4)(z − µejπ/4)(z − µe−jπ/4)

(z2 − µ√

2z + µ2)Y (z) = c(z2 − λ√

2z + λ2)U(z)

6. Design of Digital Filters

Im

Re

x

x

o

o

!/4

Note that(unity d.c. gain)

(Y(z) = H(z) U(z))

Example. Design a causal digital notch filter to attenuate 50 Hz noise.

Assume a sampling period of T = 2.5 milliseconds.

ωT = 2π × 50× 0.0025 = π/4 radApproach: Place a pair of zeros of H(z) at λe

±jπ/4.We need to put in apair of poles as well to make it causal. Let’s place the poles at µe±jπ/4

where µ λ. This will result in the frequency response being close toone for frequencies away from 50 Hz.

where we can choose c so that the H(1) = 1.

14

yk = µ√

2yk−1 − µ2yk−2 + cuk − cλ√

2uk−1 + cλ2uk−2.

so the filter can be implemented by the difference equation:

For " = 0.99 and µ = 0.9 the Bode plot is:

In principle we could make the notch as narrow and deep as we like by taking both " and µ closer and closer to one.

But this would require increasingly accurate arithmetic operations.

For a DSP implementation there would be a practical limit imposed by rounding and quantisation.

Also, a narrow notch is less effective if frequency varies.

15

x(t) ≈ x(t + T )− x(t)T

s =z − 1zT

6.1 Design of Digital Filters (Controllers) by Transformation from s-domain.

It is often useful to discretise systems which are defined in continuous time. Two simple approaches are to approximate the derivative:

(Euler's method or Forward difference)

(Backward difference).

In terms of the transform variables s and z this corresponds to the substitutions:

(Euler's method or Forward difference)

(Backward difference).

Another substitution which is based on the Trapezoidal approximation for integration is

(Tustin's transformation)

bilinear transformation

x(t) ≈ x(t)− x(t− T )T

s =z − 1

T

s =2(z − 1)T (z + 1) 16

s =z − 1zT

s =z − 1

T

stable region

Each of these transformations corresponds to a certain mapping between the s-plane and z-plane. In the diagram below, the shaded region shows the set of points in the z-plane which corresponds to the left half of the s-plane.

1 11

Forward Difference

Re

Im Im Im

ReRe

TustinBackward Difference

Backward difference or Tustin transformations applied to stable continuous time systems result in stable discrete time systems (since all the left half plane poles get mapped into the unit disk). Not necessarily true for Euler's method.

s =2(z − 1)T (z + 1)

17

z − 1z

Z��

L−1

�G(s)

s

��

t=kT

Z ({1}) =z

z − 1

H(z) =

Y (s)y(t)y(k)Y (z)

L (1) =1s

6.2 Design of Digital Filters by Response Matching.

Step response invariance. Take a continuous time system with Laplace transfer function G(s). The corresponding step invariance discrete time system (with sampling period = T seconds) is the system whose step response is equal to the step response of the continuous time system sampled at t = kT seconds.

We can find the z-transfer function of the step invariance system as follows:

1. Find the step response of the continuous time system.

2. Sample it at times t = kT and take z-transforms.

3. Multiply by (z-1)/z.

Inverse Laplace transform

18

Page 3: 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1 Gain-phase plots/Bode diagrams ... The Bode plot displays |G(ejωT) ... Advantage:

H(z) =

(z − 1)2/Tz

(z − 1)2

TzZ

��L−1

�G(s)s2

��

t=kT

Ramp response invariance. Take a continuous time system with Laplace transfer function G(s). The corresponding ramp invariance discrete time system (with sampling period = T seconds) is the system whose ramp response is equal to the ramp response of the continuous time system sampled at t = kT seconds.

We can find the z-transfer function of the ramp invariance system as follows:

1. Find the ramp response of the continuous time system.

2. Sample it at times t = kT and take z-transforms.

3. Multiply byZ ({kT}) =

Tz

(z − 1)2

19

7. Continuous/discrete interfaces

We will consider ideal ADC and DAC's defined as follows.

7.1 Analog-to-digital converter (ADC)

Takes a continuous time signal u(t), which is assumed to be smooth (i.e. continuous), and samples it to produce the number sequence {u(kT)}

ADC

Also termed a sampler

u(kT)u(t)

20

u(t) = u(kT ) for kT ≤ t < (k + 1)T

7.2 Digital-to-analog converter (DAC)

Takes the number sequence {u(kT)} and produces a continuous time signal u(t). E.g. a zero order hold is defined by:

DAC

u(kT) u(t)

21

(1) Linear extrapolation through the last two discrete inputs (e.g. qn. 10, Ex. paper).

u(t)

u(t)

(2) Linear interpolation of last two discrete inputs.

Smoother output, but more delayed.22

7.3 Transfer function analysis of DAC and ADC interfaces

Hybrid - involving discrete and continuous components with appropriate interfaces.

Approach - observe the system from the DISCRETE side of interfaces and work out z-transfer functions.

Advantage: transfer function analysis is possible

Disadvantage: ignores inter-sampling behaviour

Take a linear, time-invariant continuous time system with transfer function G(s).

(e.g., zero-order hold)

{u(kT)}u(t) y(t) {y(kT)}

DAC G(s) ADC

23

⇒ y(kT ) =

H(z) =z − 1

zZ

��L−1

�G(s)

s

��

t=kT

G(s)1s

Since Z ({u(kT )}) = 11−z−1 we get

⇒ Y (s) = �L−1

�G(s)

s

��

t=kT

What is the nature of the discrete system taking {u(kT)} to {y(kT)}?

We can check that it is LINEAR and TIME-INVARIANT.

Therefore it has a z-transfer function-call it H(z). We can find H(z) by taking any input, finding the output and taking the ratio of z-transforms.

This is the same as the step invariant approximation of G(s).

{u(kT)} u(t) y(t) {y(kT)}DAC G(s) ADC

Take u(kT ) = 1 for all k ≥ 0.

⇒ u(t) = 1 for t ≥ 0

24

reference, r

8. The Nyquist Stability CriterionThe Nyquist diagram can be determined experimentally and it is desirable to have a stability test for the closed-loop system that uses such an open-loop measurable quantity.

The Nyquist Stability Criterion is such a test and is analogous in discrete-time to the continuous time case.

K G(z)CONTROLLER PLANT

error, e output, y

Closed-loop system

25

cos (ω1kT ) A cos (ω1kT + φ)

Frequency ω1T

K G(z)CONTROLLER PLANT

reference, r error, e output, y

G(z)stable

Experiment (if open loop stable):Im

ReA

Nyquist diagram

φ

26

(i) ∠F (ejθ) = ∠A +m�

i=1

∠(ejθ − zi)−n�

i=1

∠(ejθ − pi)

The Encirclement Property

For any rational function F (z) then the number ofencirclements of the origin by F (ejθ) as θ increasesfrom 0 to 2π tells us something about the numberof poles and zeros of F (z) inside the unit circle, as follows.

Let

F (z) =A(z − z1)(z − z2) . . . (z − zm)(z − p1)(z − p2) . . . (z − pn)

then

27

Page 4: 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1 Gain-phase plots/Bode diagrams ... The Bode plot displays |G(ejωT) ... Advantage:

F (z) =A(z − z1)(z − z2) . . . (z − zm)(z − p1)(z − p2) . . . (z − pn)

ejθ

ejθ

ejθ − zi

φ = ∠�ejθ − zi

zi

zi

(ii) If |zi| < 1 then the increase in ∠(ejθ − zi) as θ increases from0 to 2π is 2π.

(iii) If |zi| > 1 then the increase in ∠(ejθ − zi) as θ increases from0 to 2π is 0.

unit circle

unit circleθ

φ

π2π

φ

φ

φ

π

2ππ θ

No net changein φ during onewhole revolution 28

= 2π(− number of poles of F (z) inside the unit circle )

F (z) =A(z − z1)(z − z2) . . . (z − zm)(z − p1)(z − p2) . . . (z − pn)

(iv) Hence the increase in ∠F (ejθ) as θ increases from 0 to 2π is

number of zeros of F (z) inside the unit circle

(v) Hence

Number of counterclockwise encirclements of the origin by F (ejθ)as θ increases from 0 to 2π is= number of zeros of F (z) inside the unit circle

− number of poles of F (z) inside the unit circle

(we have assumed there are no poles or zeros on the unit circle)

29

1 + KG(z) = 0

Closed Loop Stability

K G(z)CONTROLLER PLANT

reference, r error, e output, y

The closed-loop poles are the roots of

If

then

assumecausal(m " n)

roots are closed loop poles

roots are open loop poles

Y (z) =KG(z)

1 + KG(z)R(z)

G(z) =A(z − z1)(z − z2) . . . (z − zm)(z − p1)(z − p2) . . . (z − pn)

=b(z)a(z)

1 + KG(z) =a(z) + Kb(z)

a(z) 30

1 + KG(ejθ) G(ejθ)− 1

K

Im

Re

Im

Re

Shift by-1 andscale by1/K

Hence (by the encirclement property):

The number of counter clockwise encirclements of the origin by

1 + KG(ejθ) is

= { number of closed-loop poles inside the unit circle}− { number of open-loop poles inside the unit circle}

31

Hence we get the discrete-time Nyquist Stability Criterion

The above closed-loop system will be stable if (and only if)

the number of counter clockwise encirclements of the −1/K point

by G(ejθ) as θ increases from 0 to 2π

= the number of open-loop unstable poles.

= { number of closed-loop poles inside the unit circle }

- { number of open-loop poles inside the unit circle }

= { number of open-loop poles outside the unit circle }

- { number of closed-loop poles outside the unit circle }

since the total number of poles is the same for the open and closed loops.

Hence the number of counter clockwise encirclements of

the −1/K point by G(ejθ) is

32

=z − 2 + K

z − 21 + K

1z − 2

check:

⇒ G(ejθ) =1

ejθ − 2

ejθ

⇔ 1 < K < 3

⇒ 1 < K < 3

Im

Re

Closed-loop stable

Example.

x1 2-1

Im

Re-1

-1/3

z-plane

G(z) =1

z − 2

−1 < − 1K

< −13

33

Interpretation

Note the following points:

• If the open-loop system is stable, then just plot G(ejθ) for 0 ≤ θ ≤ π,and use the same rule as for continuous-time: ‘Leave the −1/Kpoint on your left as you move along the Nyquist diagram’.

• Although plotting the discrete-time Nyquist diagram is differentfrom plotting the continuous-time one (G(ejθ) instead of G(jω)),its interpretation is exactly the same: gain and phase margins canbe read off it in the same way, and have the same meanings. Gainand phase margins can also be found from the Bode diagram inexactly the same way as for continuous time.

• For physical systems G(ejθ) = G(e−jθ). Thus to find a completeNyquist diagram you only need to plot G(ejθ) for 0 ≤ θ ≤ π(which corresponds to frequencies used on Bode plot) andthen draw in complex conjugate locus.

• See Remark 2 on continuous time revision notes for tips oncounting encirclements.

34

Open-loop poles on the unit circle

Closing the locus

Im

Re

x

x1

In order to obtain a closed curve for the Nyquist locus and hencecorrectly count the encirclements, it is customary to indent the pathof z around the poles on the unit circle with a small semi-circularexcursion outside the unit circle. Then the open loop poles on theunit circle are counted as being stable in the stability criterion.

The “right turn” in the z-plane then gives a “right turn” in the G-planeand a circular arc of large radius is produced which continues for mπradians where m is the multiplicity of the pole on the unit circle.

35

G(z) =1

(z − 1)F (z)

G(z) =1

(z − 1){F (1) + F �(1)(z − 1)+

+12F ��(1)(z − 1)2 + . . .

Asymptotes

If there is an open-loop pole of multiplicity one on the unitcircle then the Nyquist diagram will be asymptotic to astraight line as it tends to infinity. It is possible to findthe asymptote along which it tends as follows.

Suppose that G(z) has a pole at z = 1, i.e.

where F (z) has no poles or zeros at z = 1.

Then for z ≈ 1, expand F (z) in a Taylor series to give

36

Page 5: 4. Time response behaviour/pole locations Engineering ...icl20/3f1/3F1_2_filled_2010.pdf · 5.1 Gain-phase plots/Bode diagrams ... The Bode plot displays |G(ejωT) ... Advantage:

1ejθ − 1

=�

ejθ/2(ejθ/2 − e−jθ/2)�−1

=e−jθ/2

2j sin(θ/2)

= −12− j

2 tan(θ/2)

G(ejθ) ≈ −12F (1) + F �(1)− j

F (1)2 tan(θ/2)

But

Hence

≈ F (1)(z − 1)

+ F �(1)

Hence the asymptote as θ → 0 will be a straight line with a constant

real part of −12F (1) + F �

(1).

For multiple poles on the unit circle the asymptotic behaviour is morecomplex and requires more terms in the Taylor series expansion.

= cosθ

2− j sin

θ

2

large as θ → 0

37

and − 12F (1) + F �(1) =

1z

− 1z2

− 1K

< −1 ⇔ 0 < K < 1

− 1K

x1

Example.

Im

Rex

z-plane

right turn

Closed-loop stable for

Im

Re

Nyquist diagram

0.5-1.5 -1

G(z) =1

z(z − 1). Then, F (z) = , F �(z) =

−1.5

38