engineering tripos part iia - control group · pdf fileengineering tripos part iia module 3f1...

19
Engineering Tripos Part IIA Module 3F1 -- Signals and Systems Discrete Time Systems (Lectures 1--6) Handout 2 Rodolphe Sepulchre Oct 2013 Keith Glover Oct 2012 available on RS homepage 2 From Part I (lectures 1 to 3) to Part II (lectures 4 to 6) • Part I was about ‘solving‘ Linear Time-Invariant discrete-time systems. Both in the time domain and in the z-transform domain. • A main outcome of Part I is the observation • Part II is about using that property to ANALYSE and DESIGN digital filters (without actually soving them) G(z ) LTI (causal) {z k } k2Z {z k } k2Z this holds for z in the convergence domain of G(z)

Upload: truongliem

Post on 23-Mar-2018

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

Engineering Tripos Part IIA

Module 3F1 -- Signals and Systems

Discrete Time Systems (Lectures 1--6)

Handout 2

Rodolphe Sepulchre Oct 2013Keith Glover Oct 2012

available on RS homepage

2

From Part I (lectures 1 to 3) to Part II (lectures 4 to 6)

• Part I was about ‘solving‘ Linear Time-Invariant discrete-time systems. Both in the time domain and in the z-transform domain.

• A main outcome of Part I is the observation

• Part II is about using that property to ANALYSE and DESIGN digital filters (without actually soving them)

G(z)LTI(causal)

{zk}k2Z {zk}k2Z

this holds for z in the convergence domain of G(z)

Page 2: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

The consequences of stability

3

From now one, we will assume that the system is stable and that G(z) is a rational transfer function (i.e. defined by N poles, M zeros, and a DC gain).

{zk}k�0

1X

i=0

gizk�i �

1X

i=k+1

gizk�i

�! 0, k ! +1| z |� 1

G(z)

LTI causal stable

{zk}k�0

provided

1. The magic formula holds for signals initialized at zero, modulo a transient response :

1X

i=0

| gi |< 1 ) G(ej✓) ✓

{ej✓k}k�0 G(ej✓k)

The consequences of stability

4

LTI causal stable

2. The pulse response has a well defined Fourier transform and the system has a well-defined frequency response:

stability implies exists for all

{ej✓k}k�0 + transient

A central property for engineers !

Page 3: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

yk+1 = ayk + uk

Y (z) = G(z)y0 +G(z)U(z), G(z) =1

1� az�1

y0ak

Z�1

The consequences of stability

5

3. Also nonzero initial conditions have a transient effect:

Example: first-order filter

decays exponentially in time if the filter is stable.

(The example generalizes to filters of arbitrary order. Why?)

) gk = ↵1pk1 + · · · + ↵npk

n

The location of poles determine the transient behavior

Re

Im

1

x

x

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

6

Page 4: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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

7

uk = cos(k✓) (yss)k

uk = cos(✓k) + j sin(✓k)

The frequency response determines the steady-state behavior

G(z)LTI stable causal

G�ej✓

�ejk✓

��G�ej✓

���cos

�k✓ + \G

�ej✓

��(yss)k =

(yss)k =

=��G

�ej✓

��� ej\G(ej✓)

For a real input uk = cos(k✓)

For the exponential input , the magic formula gives

Page 5: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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 the

application.

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 ! 2 [0, ⇡/T ].

This corresponds to G(ej✓) for ✓ 2 [0, ⇡], i.e. the evaluation of

G(z) around the upper half unit circle.

9

θ

10

The frequency response can be measured e.g. for this 6 input 6 output mechanical system

Page 6: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

H(z) = c⇥Qm

k=1(z � zk)Qnk=1(z � pk)

��ej✓ � p1

�� \�ej✓ � p1

�ej✓

\H(ej✓) = \(c) +mX

k=1

\(ej✓ � zk)�nX

k=1

\(ej✓ � pk)

Relate the Bode plot to pole-zero location:

Re

Im

xx

xo

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

p1

|H(ej✓)| = |c|Qm

k=1 |ej✓ � zk|Qnk=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

Page 7: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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�1X

k=0

x(kT )e�j2⇡nk/N

x(kT ) =1N

N�1X

n=0

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

Im

Re

Important note: computers only compute one transform: the Fourier transform of a finite length discrete-time signal (DFT).

x

x

x

x

x

x

X(z) =N�1X

k=0

x(kT )z�k

Take N points around the unit circle: ej2⇡n/Nfor n = 0, . . . N � 1.

Evaluate the z-transform at these points:

This is the definition of the Discrete Fourier Transform!

The inverse transform is:

13

xx

Important note: There exists an efficient algorithm to compute DFT: the Fast Fourier Transform. It takes O(N logN) operations !

= c⇥ z2 � �p

2z + �2

z2 � µp

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 � µp

2z + µ2)Y (z) = c(z2 � �p

2z + �2)U(z)

Lecture 5: 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 a

pair 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 to

one for frequencies away from 50 Hz.

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

14

Page 8: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

yk = µp

2yk�1 � µ2yk�2 + cuk � c�p

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

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

Page 9: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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

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 10: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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

3. Continuous/discrete interfaces

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

3.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

Page 11: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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

3.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

Page 12: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

3.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

Page 13: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

reference, r

Lecture 6. 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

Page 14: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

(i) \F (ej✓) = \A +mX

i=1

\(ej✓ � zi)�nX

i=1

\(ej✓ � pi)

The Encirclement Property

For any rational function F (z) then the number of

encirclements of the origin by F (ej✓) as ✓ increases

from 0 to 2⇡ tells us something about the number

of 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

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 from

0 to 2⇡ is 2⇡.

(iii) If |zi| > 1 then the increase in \(ej✓ � zi) as ✓ increases from

0 to 2⇡ is 0.

unit circle

unit circle✓

⇡2⇡

2⇡

2⇡⇡ ✓

No net change

in � during one

whole revolution 28

Page 15: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

= 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

Page 16: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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 by1 + 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 pointby 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 ofthe �1/K point by G(ej✓) is

32

Page 17: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

=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 di↵erent

from plotting the continuous-time one (G(ej✓) instead of G(j!)),

its interpretation is exactly the same: gain and phase margins can

be read o↵ it in the same way, and have the same meanings. Gain

and phase margins can also be found from the Bode diagram in

exactly the same way as for continuous time.

• For physical systems G(ej✓) = G(e�j✓

). Thus to find a complete

Nyquist diagram you only need to plot G(ej✓) for 0 ✓ ⇡

(which corresponds to frequencies used on Bode plot) and

then draw in complex conjugate locus.

• See Remark 2 on continuous time revision notes for tips on

counting encirclements.

34

Page 18: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

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 hence

correctly count the encirclements, it is customary to indent the path

of z around the poles on the unit circle with a small semi-circular

excursion outside the unit circle. Then the open loop poles on the

unit 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-plane

and 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 0(1)(z � 1)+

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

Asymptotes

If there is an open-loop pole of multiplicity one on the unit

circle then the Nyquist diagram will be asymptotic to a

straight line as it tends to infinity. It is possible to find

the 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 19: Engineering Tripos Part IIA - Control Group · PDF fileEngineering Tripos Part IIA Module 3F1 ... Relate the Bode plot to pole-zero location: Re Im x x x o ... Advantage: transfer

1ej✓ � 1

=n

ej✓/2(ej✓/2 � e�j✓/2)o�1

=e�j✓/2

2j sin(✓/2)

= �12� j

2 tan(✓/2)

G(ej✓) ⇡ �12F (1) + F 0(1)� j

F (1)2 tan(✓/2)

But

Hence

⇡ F (1)(z � 1)

+ F 0(1)

Hence the asymptote as ✓ ! 0 will be a straight line with a constantreal part of � 1

2F (1) + F 0(1).

For multiple poles on the unit circle the asymptotic behaviour is more

complex and requires more terms in the Taylor series expansion.

= cos

2

� j sin

2

large as ✓ ! 0

37

and � 12F (1) + F 0(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 0(z) =

�1.5

38