Introduction to Discrete Time Introduction to Discrete Time Systems ...

6 downloads 278 Views 252KB Size Report
➢Ogata, K. “Discrete Time Control Systems”, g , y. ,. Prentice-Hall-4th Ed. ◇ REFERENCE. ◇REFERENCE. ➢Shinners, S.M., “Modern Control Theory”,. Prentice- ...
1

Introduction to Discrete Time Systems and the Z Transform Dr. Wahidin Wahab Dr. Feri Yusivar Dept.EE, University of Indonesia

2

L t Lecturer Contact C t tD Details t il ‹ Dr. D Ir.Wahidin I W hidi Wahab W h b – Dept.EE, University of Indonesia, Pondok Cina, Depok 16424 – e-mail e mail wahidin Wahab@ui edu [email protected] ‹ DR. Ir.Feri Yusifar – Dept.EE, D t EE University U i it off Indonesia, I d i Pondok P d k Cina, Ci D k 16424 Depok – e-mail [email protected]

3

M d l Overview Module O i ƒ Discrete time control - single input /single output » z transform based control design

ƒ State space control - multi-input, multi-output » time ti domain d i based b d

Text & references – Modern C t l module Control d l ‹ TEXT

¾Ogata, g , K. “Discrete Time Control Systems”, y , Prentice-Hall-4th Ed ‹ REFERENCE

¾Shinners, S.M., “Modern Control Theory”, Prentice Hall Prentice-Hall ¾Phillip Panther & Troy Nagle, “Digital Control Systems, Design and Analysis Analysis”,, Prentice Hall.Inc.

4

5

P Pre-requisite i it Knowledge K l d ‹ Good

understanding of classical (continuous time control) ‹ good knowledge of linear algebra – in particular, rank, basis, eigenvalues, eigenvectors

6

C t t Contents ‹ Data

Acquisition,

– A/D conversion, conversion sample/hold, sample/hold ‹ Operations

on discrete time signals ‹ Z Transform – derivation, inverse transform, properties, examples ‹ Ref. Ref

Chapters 1 & 2 of Ogata

7

D t A Data Acquisition i iti ‹ Typical Discrete Time Actuation Plant l

control System G(s)

DAC

Digital Controller

Set Input p

ADC c(t) output ((measurement))

8

D t A Data Acquisition i iti ‹ Analog

to digital conversion

– two stage process » Sample/Hold » A/D Converson

9

S Sample/Hold l /H ld (S/H) ‹ Receives

an analog signal and holds it constant for a specified time ‹ Holding time short compared to sampling period i d

10

S Sample/Hold l /H ld (S/H) B ff i Amplifiers Buffering A lifi

Amp 1

Amp 2 Sampling Trigger

C

Switch closed - tracking time, Switch open - hold time

11

V Voltage e acrosss capaciitor

S Sample/Hold l /H ld Capacitor voltage following signal level

Aperture Time

Hold time

Time

Tracking Time

12

A l tto Di Analog Digital it l Conversion C i ‹ Takes

sampled signal and converts it to a digital signal – a finite number of digits

Continuous i Signal i l

Discrete Signal

13

A l tto Di Analog Digital it l Conversion C i ‹ Accuracy

depends on number of digital levels available ‹ Quantization – For an n bit word there are 2n available quantization levels

14

Q Quantisation ti ti ‹

Error incurred in rounding sampled signal to nearest digital level (i+1)th quantization level

ith q quantization level

signal Signal will be rounded up to (i+1)th level - closest level Sampling instant

15

Q Quantization ti ti Error E ‹ Error

incurred in rounding sampled signal to nearest level

let FSR = Full Scale Reading, Q = quantization level = range between adjacent levels FSR Q = n , n = byte length 2 Source of random noise - can derive statistics

16

Q Quantization ti ti Error E Quantizati Q i ion error = difference diff b between actuall signal i l value and quantized value e(t ) = x(t ) − y (t ) Quantized signal value y(t)

Error e(t) Q

Signal sample x(t)

Sampling instant

17

Q Quantization ti ti Error E Worst case value of e(t) = 0.5Q Q 0 ≤ e(t ) < 2 Error is uniformly distributed between -0.5Q and +0.5 Q Mean = zero

18

V i Variance off Q Quantization ti ti Error E σ = E (e(t ) − e )

2

2

Q 2

1 2 = ∫ ξ dξ Q Q −

2

Q →σ = 12 2

2

19

D/A C Conversion i ‹

Signal reconstructed using hold circuits – Zero Order hold » most commonly used - least delays » staircase function

– Higher order holds » interpolation i l i between b sampling li instants i » delay increases with order of hold - stability problems

20

D/A C Conversion i Reconstructed Signal - Staircase function Original signal Signal samples

Zero Order Hold

21

D/A C Conversion i Reconstructed signal Original signal Signal samples

First Order Hold - Linear Interpolation p between samples - one sample delay

Operations on Discrete Time Si Signals l ‹ Notation

1 Assume constant sampling rate f s = T continuous time signal x(t ) → discrete time signal x(kT ) or x(k ), where k is an integer

Note - Multi-rate sampling can occur in some systems

22

Operations on Discrete Time Si Signals l ‹ Fourier

Transforms - Continuous Signal

Continuous Time FT (CFT) X(f )=



− j 2πft ( ) x t e dt , ∫

−∞

x(t ) =



j 2πft ( ) X f e df ∫

−∞

Continuous in time and frequency domains

23

Operations on Discrete Time Si Signals l ‹ Fourier

Transforms - Discrete time signal

– infinite length Discrete time FT (DTFT)

X(f )=



− j 2πnf ( ) x n e ∑

n = −∞

x(n ) =

0.5

j 2πnf ( ) X f e df ∫

− 0.5

Discrete in time domain, continuous and periodic i freq. in f domain d i Normalised frequency =frequency(Hz)/Sampling Frequency(Hz) -0.5 1

37

Z Transform of Unit Ramp F Function ti ⎧kT x(kT ) = ⎨ ⎩0 ∞

X ( z ) = ∑ kTz k =0

−k

kT ≥ 0



= T ∑ kz k =0

−k

38

Z Transform of Unit Ramp F Function ti ∞



k =0

k =0

X ( z ) = ∑ kTz − k = T ∑ kz − k

(

−1

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

−2

−3

)

+ 3 z + ... =

Tz

−1

(1− z )

−1 2

39

Z Transform of Polynomial F Function ti ak ⎧a k k ≥ 0 x(k ) = ⎨ ⎩0 otherwise ∞

X (z ) = ∑ a z k

−k

k =0

−1

2 −2

= 1 + az + a z

+

40

Z Transform of Polynomial F Function ti ak X ( z ) = 1 + az − 1 + a 2 z − 2 +... =

1 1 − az

−1

z = z−a

41

Z Transform of an Exponential F Function ti ⎧e − akT k ≥ 0 x( kT ) = ⎨ otherwise ⎩0 X (z) =



∑ x( k )z

k =0

−k

=



∑e

k =0

− akT − k

z

42

Z Transform of an Exponential F Function ti X ( z) =



∑e

− akT − k

k =0

→ X ( z) = 1 + e =

1 1− e

z

− aT −1

z

− aT − 1

z

+e

− 2 aT − 2

z

+...

43

Z Transform of an Exponential F Function ti

X (z) =

1 1− e

− aT − 1

z

=

z z−e

− aT

44

Z Transform of a Sinusoidal F Function ti ⎧sinω kT x( kT ) = ⎨ ⎩0

kT ≥ 0 otherwise

Recall

[

1 jωkT − jωkT sinω kT kT= e −e 2j

]

1⎡ 1 1 ⎤ ∴ X (z) = ⎢ − 2 j ⎣1 − e jωT z − 1 1 − e − jωT z − 1 ⎥⎦

45

Z Transform of a Sinusoidal F Function ti 1⎡ 1 1 ⎤ X (z) = ⎢ − 2 j ⎣1 − e jωT z − 1 1 − e− jωT z − 1 ⎥⎦ jω T − j ωT − 1 ⎡ ⎤ − e e z 1⎢ ⎥ ∴ X (z) = 2 j ⎢ 1 − e j ω T + e − j ωT z − 1 + z − 2 ⎥ ⎣ ⎦

(

(

)

)

46

Z Transform of a Sinusoidal F Function ti

(

)

j ωT − jωT − 1 ⎡ ⎤ e − e z 1⎢ ⎥ X (z) = 2 j ⎢ 1 − e j ωT + e − j ωT z − 1 + z − 2 ⎥ ⎣ ⎦

(

→ X (z) =

)

z −1 sinω T 1 − 2z − 1 cosω T + z − 2

47

Z Transform of a Sinusoidal F Function ti X (z) =

z 1 − 2z

∴ X (z) =

−1

−1

sinω T

cosω T + z z sinω T

−2

z − 2z cosω T + 1 2

48

49

E Exercise i Find the Z transform of the cosine function

⎧cosω kT x( kT ) = ⎨ ⎩0

kT ≥ 0 otherwise

50

E Exercise i Z transform of the cosine function

X ( z) =

z − z cosωT 2

z − 2z cosωT + 1 2

51

Z Transform T f Properties P ti ‹

Linearity (Superposition)

Z{ax ( k ) + by b ( k )} = aX X ( z ) + bY ( z ) X ( z ) = Z{x ( k )}, Y ( z ) = Z{ y ( k )} a , b constants Refer to text for proof

52

Z Transform T f Properties P ti ‹ Multiplication

{

by ak

} ( )

Z a k x( k ) = X a −11z

Refer to text for proof

53

Z Transform T f Properties P ti ‹ Shifting

theorems

If X ( z ) = Z {x(t )}

Delay n samples

Z {x(t − nT )} = z X ( z ) −n

⎡ −k ⎤ Z {x(t + nT )} = z ⎢ X ( z ) − ∑ x(kT ) z ⎥ k =0 ⎣ ⎦ n −1

n

Advance n samples

54

P f off Shifting Proof Shifti Theorems Th ‹ Delay

Theorem

T show To h Z{x ( t − nT T )} = z − n X ( z ) Z{x( t − nT T )} =



−k x kT − nT T z ) ∑ (

k =0

→ Z{x( t − nT )} = z

−n



∑ x( kT − nT )z

k =0

− ( k − n)

55

P f off Shifting Proof Shifti Theorems Th ‹ Delay

Theorem

Z{x( t − nT )} = z

−n



∑ x( kT − nT )z

− ( k − n)

k =0

Let m=k-n → Z {x( t − nT )} = z − n



−m x ( mT ) z ∑

m= − n

56

P f off Shifting Proof Shifti Theorems Th ‹ Delay

Theorem

Z{x( t − nT )} = z

−n



∑ x ( mT ) z

−m

m= − n

Now x ( mT ) = 0, m < 0 ∴ Z{x( t − nT )} = z − n



i.e. A causal signal

−m x ( mT ) z ∑ m= 0

57

P f off Shifting Proof Shifti Theorems Th ‹ Delay

Theorem

Z{x( t − nT )} = z



−n

∑ x ( mT ) z

m= 0 −n

→ Z{x( t − nT )} = z

X (z)

−m

58

P f off Shifting Proof Shifti Theorems Th ‹ Advance

Theorem

To show n−1 ⎡ n −k ⎤ Z{x( t + nT T )} = z ⎢ X ( z ) − ∑ x( kT )z ⎥ ⎣ ⎦ k =0

Z{x( t + nT )} =



∑ x( kT + nT )z

k =0

−k

59

P f off Shifting Proof Shifti Theorems Th ‹ Advance

Theorem

Z{x( t + nT )} = =z

n





∑ x( t + nT )z

k =0

∑ x( kT + nT )z

k =0

− ( k + n)

−k

60

P f off Shifting Proof Shifti Theorems Th ‹ Advance

Theorem

n −1 1 ⎡ ∞ − ( k + n) −k ⎤ + ∑ x( kT )z ⎥ ⎢ ∑ x( kT + nT )z k =0 ⎥ Z{x( t + nT )} = z n ⎢ k = 0 ⎢ n−1 ⎥ −k ⎢− ∑ x( kT )z ⎥ ⎣ k =0 ⎦

61

P f off Shifting Proof Shifti Theorems Th ‹ Advance

Theorem

∞ n −11 ⎡ n −k −k ⎤ Z{x( t + nT )} = z ⎢ ∑ x( kT )z − ∑ x( kT )z ⎥ ⎣k = 0 ⎦ k =0 n⎡



= z ⎢ ∑ x( kT )z ⎣k = 0

−k



n−1

−k ⎤

k =0



∑ x( kT )z ⎥

This step can be understood by substituting values for k = 0,1,2…

62

E Example l Define discretized unit step function ⎧1 1(kT ) = ⎨ ⎩0

k ≥0 otherwise

Find the Z transform of

1(k − 1) &1(k − 4 )

U(k-1) & U(k-4)

1(kT) is the discretized version of the step function u(t)

63

E Example l −1

1 z = Z {1(k − 1)} = z ⋅ −1 1− z 1 − z −1 −4 1 z −4 Z {1(k − 4)} = z ⋅ = −1 −1 1− z 1− z −1

64

E Example l k

y (k ) = ∑ x(h ) → y (k ) = x(0 ) + x(1) + x(2 ) + ...x(k ) h =0

y (k − 1) = x(0 ) + x(1) + x(2 ) + ...x(k − 1) ∴ y (k ) − y (k − 1) = x(k ) → Y ( z ) − z −1Y ( z ) = X ( z )

65

E Example l Y (z ) − z Y (z ) = X (z ) 1 ( ) Y (z ) = X z −1 1 z 1− −1

66

C Complex l T Translation l ti Theorem Th

{

Ze

− akT

}

(

x(kT ) = X ze

aT

)

67

E Example l

{ }= X (ze ) =

Z te

at

aT

Te

− aT T

(1− 1 e

−a aT

z

−1

z

)

−1 2

N t th Note thatt th the z-transform t f off th the unit it ramp is i

Z (t ) =

Tz

−1

(1 − z )

−1 2

68

I iti l Value Initial V l Theorem Th x(0 ) = lim{X ( z )} z →∞

Proof ∞

X ( z ) = ∑ x(k )z − k = x(0 ) + x(1)z −1 + x(2 )z − 2 + ... k =0

taking limit as z → ∞ result is obvious

69

Fi l Value Final V l Theorem Th Used to define steady-state performance of system.

{(

li {x(k )} = lim lim li 1 − z k →∞

z →1

−1

)X (z )}

Proof ∞



Z {x(k )} = ∑ x(k )z , Z {x(k − 1)} = ∑ x(k − 1)z −k

k =0

k =0





k =0

k =0

−k −k −1 ( ) ( ) ( ) x k z − x k − 1 z = X z − z X (z ) ∑ ∑

−k

70

Fi l Value Final V l Theorem Th Proof (cont.) ∞

∑ x(k )z k =0

−k



− ∑ x(k − 1)z

−k

= X (z ) − z X (z ) −1

k =0

taking limits ∞ ⎧∞ −k −k ⎫ lim⎨∑ x(k )z − ∑ x(k − 1)z ⎬ = lim 1 − z −1 X ( z ) z →1 k =0 ⎩ k =0 ⎭ z →1

{(

)

}

71

Fi l Value Final V l Theorem Th Proof (cont.) (cont ) ∞ ⎧∞ −k −k ⎫ lim⎨∑ x(k )z − ∑ x(k − 1)z ⎬ = lim 1 − z −1 X ( z ) z →1 k =0 ⎩ k =0 ⎭ z →1 Assuming g that x(k ) = 0, k < 0 LHS becomes

{(



)

}

∑ [x(k ) − x(k − 1)] = [x(0) − x(−1)] + [x(1) − x(0)] + [x(2) − x(1)] k =0

= x(∞ ) = lim{x(k )} k →∞

+ ...

72

I Inverse ZT Transform f ‹ Four

– – – –

Methods

Direct Division Computational P i l Fraction Partial F i Expansion E i Inversion Integral b0 ( z − z1 )...( z − z m ) Assume X ( z ) = ( z − p1 )...(z − pn ) X(z) = ratio of two polynomials in z

73

Di t Di Direct Division ii ‹ Divide

denominator polynomial into numerator polynomial to get series of form

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

−2

74

E Example l 10 z + 5 X (z ) = (z − 1)(z − 0.2) −1

−2

10 z + 5 z X (z ) = 1 − 1.2 z −1 + 0.2 z − 2

75

E Example l 10 z −1 + 5 z −2 X (z ) = −1 −2 1 − 1.2 z + 0.2 z 10z-1 11-1.2z 1 2z-11+0.2z +0 2z-22

10z-1+5z-2 10z-1-12z-2+2z-3 17z-2-2z-3

76

E Example l 10z-11+17z-22 1-1.2z-1+0.2z-2

10z-1+5z-2 10z-1-12z-2+2z-3 17z-2-2z-3 17z-2-20.4z 20.4z-3+3.4z 3.4z-4 18.4z-3-3.4z-4

77

E Example l 10z-11+17z-22+18.4z-33 1-1.2z-1+0.2z-2

10z-1+5z-2 10z-1-12z-2+2z-3 17z-2-2z-3 17z-2-20.4z 20.4z-3+3.4z 3.4z-4 18.4z-3-3.4z-4 18.4z-3-22.08z-4+3.86z-5 18.68z-44-3.68z-55

78

C Computational t ti l Method M th d ‹

MATLAB filter command – determine response to Kronecker delta input » delta function for discrete time systems

⎧1 x(k ) = ⎨ ⎩0

k =0 otherwise

79

C Computational t ti l Method M th d MATLAB filter command ⎧1 k = 0 x(k ) = ⎨ ⎩0 otherwise

‹

−1

−2

b0 + b1 z + b2 z + ... Let G ( z ) = 1 + a1 z −1 + a2 z − 2 + ... Form num = [b0 b1 b2 ....], den = [1 a1 a2 ....] g = filter (num, den, x)

80

C Computational t ti l Method M th d ‹ Difference

Equation Approach – based on delay theorem – Example

Again assume ass me Kronecker delta input inp t Y ( z) 0.4673z −1 − 0.3393z − 2 = G( z) = X ( z ) 1 − 1.5357 z −1 + 0.6607 z − 2

(

)

(

Y ( z ) 1 − 1.5357 z −1 + 0.6607 z − 2 = X ( z ) 0.4673z −1 − 0.3393z − 2

)

81

C Computational t ti l Method M th d ‹ Difference

(

Equation Approach - Example

)

(

Y ( z ) 1 − 1.5357 z −1 + 0.6607 z −2 = X ( z ) 0.4673 z −1 − 0.3393 z −2 Y ( z ) − 1.5357 z −1Y ( z ) + 0.6607 z − 2Y ( z ) = 0.4673 z −1 X ( z ) − 0.3393 z − 2 X ( z ) ∴ y (k ) − 1.5357 y (k − 1) + 0.6607 y (k − 2) = 0.4673 x(k − 1) − 0.3393 x(k − 2)

)

82

C Computational t ti l Method M th d ‹ Difference

Equation Approach - Example

y (k ) − 1.5357 y (k − 1) + 0.6607 y (k − 2) = 0.4673 x(k − 1) − 0.3393 x(k − 2) y (0) = 0 y (1) = 0.4673, x(0) = 1

83

P ti l Fractions Partial F ti ‹

Similar to technique used with Laplace

N ( z) X (z ) = ( z − p1 )( z − p2 )...( z − pn ) (divide by z if a zero appears at origin) & expand as : an a1 a2 X ( z) = + + ... + z − p1 z − p2 z − pn ai = residues

84

P ti l Fractions Partial F ti Calculation of residues

ai = [( z − pi ) X ( z )]z = pi Double order pole

c1 c2 X (z ) = + 2 ( z − pi ) ( z − pi )

[

c1 = ( z − pi )

2

]

[

]

⎧d ⎫ 2 X ( z ) z = pi , c2 = ⎨ ( z − pi ) X ( z ) ⎬ ⎩ dz ⎭ z = pi

85

E Example l Inverse Z transform of

( 1 − e )z X (z ) = (z − 1)(z − e ) − aT T

− aT

Zero at origin - divide by z

(

)

X (z ) 1 − e − aT 1 1 = = − − aT (z − 1) z − e z z − 1 z − e − aT

(

)

86

E Example l X (z ) 1 1 = − z z − 1 z − e − aTT 1 1 X (z ) = − −1 1− z 1 − e − aT z −1 1 ⎫ 1 ⎫ − ak −1 ⎧ −1 ⎧ akT Z ⎨ = 1 Z = e , ⎨ −1 ⎬ − aT −1 ⎬ ⎩1 − z ⎭ ⎩1 − e z ⎭

x(kT)=1 - e-akT

87

I Inversion i IIntegral t l Let C be a circle in the z plane centre origin such that all the poles of X ( z ) z k −1 lie inside it, then 1 −1 k −1 Z {X ( z )} = x(k ) = x(kT ) = X ( z ) z dz ∫ 2πj C

88

I Inversion i IIntegral t l Can easily be computed in terms of residues of X ( z ) z k −1 x(k ) = K1 + K 2 + ... + K m , K i = residue of pole zi of X ( z ) z

{

K i = lim ( z − zi ) X ( z ) z k −1 z → zi

k −1

}

Mutiple pole order q

[

1 d q −1 q k −1 ( ) ( ) Ki = li lim z − z X z z i q −1 z z → i (q − 1)! dz

]

89

E Example l Using U i the h inversion i i integral i l method h d find fi d the h inverse i Z Transform of

(

− aT

)

z 1− e X (z ) = − aT (z −1) z − e

(

)

90

E Example l x(k ) = K1 + K 2 , where K1 , K 2 are the residues of at each pole z k −1 X ( z )

K1 = residue of pole at z = 1

(

)

⎧ z k 1 − e − aT ⎫ =1 = lim⎨( z − 1) ⋅ ⎬ − aT z →1 ( z − 1) z − e ⎭ ⎩

(

)

91

E Example l K 2 = residue of p pole at z = e

(

)

− aT

k − aT ⎧ ⎫ z 1− e − akT = lim⎨( z − 1) ⋅ = −e ⎬ − aT z →1 (z − 1) z − e ⎭ ⎩

(

x(kkT ) = K1 + K 2 = 1 − e Ref. - Ogata Chapter 3

)

− akT