31
SUPSI DTI Automazione Digital Control of Dynamic Systems Silvano Balemi University of Applied Sciences of Southern Switzerland Manno, 2004

Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

Embed Size (px)

Citation preview

Page 1: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione

Digital Control of Dynamic Systems

Silvano BalemiUniversity of Applied Sciences of Southern Switzerland

Manno, 2004

Page 2: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione

Discrete-time signals

Page 3: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Step response of a sampled system

Time (sec.)

Ampl

itude

Step Response

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.05

0.1

0.15

0.2

0.25

0.3

0.35From: U(1)

To: Y

(1)

Page 4: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Sample and hold

Page 5: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione

Multiplication with a train of unit impulses(operation is linear but time-variant)

Sampling

Page 6: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Train of impulses andits Fourier expansion

Page 7: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Sampled signal

with

Page 8: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Spectrum of Sampled signal

-10 -8 -6 -4 -2 0 2 4 6 8 100

0.5

1

1.5

2SPECTRUM OF A SIGNAL

|R|

-15 -10 -5 0 5 10 150

0.5

1

1.5SPECTRUM OF THE SAMPLED SIGNAL AND ITS COMPONENTS|R*|

w1

Page 9: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Hold

Linear operation

Impulse response of a ZOH

1(t)

1(t − T)

Page 10: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Z transform

where

Laplace transformation with

The z transform corresponds to the sequence

with the function

Page 11: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Relation between different transforms

Page 12: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione

Z transform:Examples and properties

Page 13: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Examples of z transforms

Page 14: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Some transformations

Page 15: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Properties of the z transform

Linearity

Delay

Anticipation

Damping

Product

Initial value

End value

Page 16: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione z transform

1. From the Laplace transformation

Factorization

G(s) =s+ak g(t) = k á eàaát G(z) = k á

zàeàaáTz

Using „primitives“

Page 17: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Inverse z transform

1. Inverse trasform via factorization

2. Inverse transform via recursion

Page 18: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione

Sampled Systems

Page 19: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Discrete-time Transfer functionfrom time domain

No transfer function between u and y but between u* and y*

and with variable substitution l=k-m

Page 20: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Discrete-time Transfer functionfrom frequency domain

with variablesubstitution m=k+n

Page 21: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Transfer functionwith ZOH

Gzoh(z)

Page 22: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione ExampleTransfer function with ZOH

Page 23: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione State space representation

u constant from 0 to T

Transfer function

from

Page 24: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Description ofLinear Time-invariantDiscrete-time Systems

Page 25: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Stability of sampled systems

x x

x

x

x

x

x x

x

x

x

x

Page 26: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Step responses

x

x

x

x

xx

xx

xx

x

x

x

Page 27: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Closed-loopsampled systems

Digital part Analog part

Digitalcontroller

Cont.-timeprocess

Page 28: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Closed-loopDiscrete-time system (2)

model ofA/D conv

model ofprogram

model ofD/A conv

model ofprocess

Gzoh(z)

Page 29: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Example: system stability

≈ 0.09

Page 30: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Example of a program for a controller

(1 + zà1 + zà2) á U(z) = (zà1 + 3 á zà2) á E(z)

Gc(z) = E(z)

U(z)=

z2+z+1z+3

(z2 + z + 1) á U(z) = (z + 3) á E(z)

U(z) + zà1 á U(z) + zà2 á U(z) = zà1 á E(z) + 3 á zà2 á E(z){uk} + {ukà1} + {ukà2} = {ekà1} + 3 á {ekà2}

uk + ukà1 + ukà2 = ekà1 + 3 á ekà2

uk = à ukà1 à ukà2 + ekà1 + 3 á ekà2

Page 31: Digital Control of Dynamic Systems - SUPSIpeople.dti.supsi.ch/~smt/courses/digital.pdf · Digital Control of Dynamic Systems ... process Gzoh(z) SUPSI DTI Automazione Example: system

SUPSI DTI Automazione Example of aprogram for a controller:C-code

ek_1=0; ek_2=0; uk_1=0; uk_2=0;while TRUE{yk=read_yk();ek=yrefk-yk;uk=-uk_1-uk_2+ek_1-3*ek_2;write(uk);uk_2=uk_1; uk_1=uk;ek_2=ek_1; ek_1=ek;}

C-code

Minimize control delay!

ek_1=0; ek_2=0; uk_1=0; uk_2=0;while TRUE{uk=-uk_1-uk_2+ek_1-3*ek_2;yk=read_yk();write(uk);ek=yrefk-yk;uk_2=uk_1; uk_1=uk;ek_2=ek_1; ek_1=ek;}