# Lecture 10: From Analog to Digital Controllers A Digital Control ...

Ηλεκτρονική - Συσκευές

15 Νοε 2013 (πριν από 4 χρόνια και 6 μήνες)

108 εμφανίσεις

Lecture10:
FromAnalogtoDigitalControllers
•Thesamplingtheorem
•Aliasingandpresamplingﬁlters
•Unsamplingsignals
•Discretetimeapproximationofcontinuoustimecontroller
?
Frequencydomain
?
Statespace
Process
ut
(
)
)
uk
yt
(
ut
(
)
y
k
Sampler
Hold
Computer
uk
yk
t
t
t
yt
()
t
D-A
A-D
TheSamplingTheorem(Shannon1949)
Acontinuous-timesignalwithFouriertransform
F
D
ω
E
0
for
h
ω
h
ω
0
,isuniquelydeﬁnedbyitssampledvalues,provided
thesamplingfrequency
ω
s

2
π

h
satisﬁes
ω
s

2

ω
0
.
Thesignalcanbereconstructedbytheinterpolationformula
f
D
tE
[
X
k[
f
DkhE
sin
ω
sDt

khE
2
ω
s
Dt

khE
2
Thefrequency
ω
s

2
isdenoted
ω
N
andcalledtheNyquist
frequency.
Proofidea
2

N

N

N
2

N
0
F
s
(

)
F(

)

N

N
02

N
2

N
Let
F
D
ω
EbetheFouriertransformof
f
andexpandtheperi-
odicfunction
Fs
D
ω
EasaFourierseries
F
sD
ω
E
1
h
[
X
k[
F
D
ω

k
ω
sE
[
X
k[
C
k
eikh
ω
Itisstraightforwardtoverifythat
Ck

f
DkhE
k

0,1,2,...
HenceM
f
D
khEN0
FsD
ω
E0
F
D
ω
E0
f
DtE
c
&
Dept.ofAutomaticControl,Lund1
Aliasingandpresamplingﬁlters
Aliasingandfrequencyfolding
0
5
10

0
1
Time
2

N

N

N
2

N
0

N

N
0
2

N
2

N
F(

)
Fs
(

)
ω
N

ω
s
2
Nyquistfrequency
NewfrequenciessincethesystemisNOTtime-invariant
ω
sampled

ω

n
ω
s
n

0,1,2,...
Mini-problem
Awheel,rotating90turnspersecond,isﬁlmedusinga
camerawithsamplingtime10ms.Whatwillthewheelrotation
looklikeontheﬁlm?
Example—Feedwaterheatinginashipboiler
Steam
Valve
Pressure
Pump
Feed
water
Condensed
water
To boiler
Temperature
2 min
38 min
Temperature
2.11 min
Time
Pressure
c
&
Dept.ofAutomaticControl,Lund2
Pre-andpostsamplingﬁlters
Typicalcontrolproblem:
"Decreasetheinﬂuenceofalow-frequencyprocessdistur-
bancedespitehigh-frequencymeasurementnoise."
•Frequencyseparation
•Preﬁlter
ω
N
?
Bessel,Butterworth,ITAEﬁlters
•Postsamplingﬁlters
?
Avoidexcitingmechanicalresonances
?
Higherorderhold
Example–Preﬁltering
0
10
20
30

0
1
(a)
0
10
20
30

0
1
(b)
0
10
20
30

0
1
Time
(c)
0
10
20
30

0
1
Time
(d)
ω
d

0.9,
ω
N

0.5,
ω
alias

0.1
(6thorderBesselﬁlter)
Consequenceofusingpreﬁlter
Pre-andpostﬁltershouldbeincludedintheprocessmodel
Exception:Fastsampling
0.1
1
10





0
Phase
0.1
1
10
0.01
1
Gain
6thorderBessel(solidline),timedelay(dashedline)
Unsamplingsignals
•Shannon
f
D
tE
[
X
k[
f
DkhE
sinD
ω
s
Dt

khE
2E
ω
s
D
t

khE
2
•Zeroorderhold
•Firstorderhold
•Predictiveﬁrstorderhold
c
&
Dept.ofAutomaticControl,Lund3
Shannonreconstruction
f
DtE
[
X
k[
f
D
khE
sin
D
ω
sDt

khE
2E
ω
s
Dt

khE
2
Theexactformulaisnotcausal!
Approximationwithinformationfrom
d

f
Dnh

τ
E
n
d
X
k[
f
D
khEhDnh

τ

khE
hD
τ
E
sin
ω
s
τ

2
ω
s
τ

2


0
10
0
1
Time
sin
π
t
π
t
Zeroandﬁrstorderhold
t
0
t
1
t
2
t
3
t
4
t
5
t
6
Time
t
0
t
1
t
2
t
3
t
4
t
5
t
6
Time
Predictiveﬁrstorderhold
uDkh

τ
E
uDkhE
τ
h
DuDkh

hE
uDkhEE
•Usemodelofthecontroller.
t
0
t
1
t
2
t
3
t
4
t
5
t
6
Time
Sinusoidalsignalwith
h

1
and
h

0.5
0
5
10

0
1
Zero order hold
h=1
0
5
10

0
1
First order hold
0
5
10

0
1
Predictive hold
Time
0
5
10

0
1
Zero order hold
h=0.5
0
5
10

0
1
First order hold
0
5
10

0
1
Predictive hold
Time
c
&
Dept.ofAutomaticControl,Lund4
Discretetimeapproximationof
continuoustimecontroller
—Frequencydomain
Implementingacontrollerusingacomputer
Algorithm
Clock

ukh
()
{}
ykh
()
{}

H(z)G(s)

y(t)
u(t)
A-DD-A
Wanttoget
A/D+Algorithm+D/A
G
DsE
Methods:
•Approximate
s
i.e
G
DsE0
H
Dz
E
•Pole-zeromatching
•Usesample/holdtoget
H
Dz
Efrom
GDsE
Matlab
SYSD=C2D(SYSC,TS,METHOD)convertsthecontinuous
sampletimeTS.ThestringMETHODselectsthe
discretizationmethodamongthefollowing:
'zoh'Zero-orderholdontheinputs.
'foh'Linearinterpolationofinputs
(triangleappx.)
'tustin'Bilinear(Tustin)approximation.
'prewarp'Tustinapproximationwithfrequency
prewarping.
ThecriticalfrequencyWcisspecified
lastasinC2D(SysC,Ts,'prewarp',Wc)
'matched'Matchedpole-zeromethod
(forSISOsystemsonly).
Approximationmethods
Forwarddifference(Euler’smethod)
dxDtE
dt

xDt

hE
xDtE
h

q

1
h
xDtE
Backwarddifference
dxD
tE
dt

xDtE
x
D
t

hE
h

1

q
1
h
xDtE
Trapezoidalmethod(Tustin,bilinear)

xDt

hE

x
DtE
2

xD
t

hE
xDtE
h
c
&
Dept.ofAutomaticControl,Lund5
Mini-problem
Comparethedifferentialequation

y
D
tE
10yD
tE
0
totheEulerapproximation
yD
k

1E
yD
kE
10yD
kE
0
Isthereanyqualitativedifference?
Whatisthesourceoftheproblem?
Propertiesoftheapproximation
H
D
z
E
GDsE
s

z

1
h
DForwarddifferenceorEuler'smethodE
s

z

1
zh
DBackwarddifferenceE
s

2
h
z

1
z

1
DTustin'sorbilinearapproximationE
Wheredostablepolesof
G
getmapped?
Forward differencesBackward differencesTustin
Prewarpingtoreducefrequencydistortion
Approximation
s
z

i

i

e
i

e
i

Chooseoneﬁx-point
ω
1
s

ω
1
tanD
ω
1h
2E

z

1
z

1
Thisimpliesthat
H
e
i
ω
1
h

GDi
ω
1ETustinisobtainedfor
ω
1

0
since
tan

ω
1
h
2

ω
1h
2
forsmall
ω
.
Pole-zeromatching
1.Allpolesof
GDsEaremappedaccordingto
z

esh
2.Allﬁnitezerosarealsomappedas
z

esh
3.Thezerosof
G
DsEat
s
[aremappedinto
z
1.One
ofthezerosof
G
DsEat
s
[ismappedinto
z
[,i.e.
z
E
degB
Dz
E
1
4.Thegainof
H
D
zEismatchedthegainof
G
DsEatone
s

0
c
&
Dept.ofAutomaticControl,Lund6
Comparisonofapproximations
GDsE
Ds

1E2
Ds2

2s

400E
D
s

5E
2Ds2

2s

100ED
s2

3s

2500E
h

0.03
gives
ω
N

105
100
101
102



0
Phase
100
101
102
10

10

10

10

Magnitude
G
Di
ω
E(full),zoh(dashed),foh(dot-dashed),Tustin(dotted)
Selectionofsamplinginterval
TheZero-Order-Holdhasthetransferfunction
GZoH
D
sE
1

e
sh
sh
Forsmall
h
1

esh
sh

1

1

sh
D
shE2
2
⋅⋅⋅
sh

1

sh
2
⋅⋅⋅
expDsh
2E
1

sh
2
⋅⋅⋅
G
ZoH
h
2
Assumethephasemargincanbedecreasedby
5'
to
15'
then
h
ω
c

0.15

0.5
ω
N
5–20largerthan
ω
c
G
D
sE
4D
s

1E
Ds

2Efortheprocess
P
D
sE
1
D
s2

sEgives
ω
c

1.6.Hencechoose
h

0.1
0.3.
Euler’smethod:
HE
DzE
4
z1
h

1
z1
h

2

4
z
D1

hE
z
D1

2hE
0
10

0
2
4
Input
Time
0
10
0
1
Output
h
=0.1(dash-dotted),0.25(full),0.5(dotted),
GDi
ω
E(dashed)
Discretetimeapproximationof
continuoustimecontroller
—Statespace
c
&
Dept.ofAutomaticControl,Lund7
State-feedbackredesign
Thesystem

x

Ax

Bu
withcontinuous-timestatefeedback
uD
tE
Mu
cD
tE
LxDtE
gives

x
D
A

BLE
|
{z
}
Ac
x

BMuc

Ac
x

BMuc
Samplinggives
x
D
kh

hEΦ
c
xDkhEΓ
c
Muc
DkhE
Alternatively,samplingﬁrst,thenapplyingdiscrete-timestate
feedback
uDkhE

Muc
D
khE

LxDkhE
gives
xDkh

hEDΦΓ

LE
x
D
khEΓ

Mu
cD
khE
Statefeedbackredesigncont’d
With

L

L0

L1
h
2
thetwosystemmatrices
Φ
c

I
DA

BLE
h

A2

BLA

ABL
DBLE2

h2

2
⋅⋅⋅
ΦΓ

L

I
DA

BL0
Eh

A2

ABL0

BL1

h2
2
⋅⋅⋅
areidenticaloforder
h2
providedthat
L0

L,
L1

A

BL.

M

M0

M
1
h
2
andcompare
Γ
c
M

BMh
DA

BLE
BMh2
2
⋅⋅⋅
Γ

M

BM0h
DBM1

ABM0
Eh2
2
⋅⋅⋅
Theexpressionsareidenticaloforder
h2
providedthat
M
0

M
,
M
1

LBM
.
State-feedbackredesign–Example
Doubleintegratorwith
h

0.5,
L
F11G,and
M

1
0
10
0
1
Position
0
10



0
0.5
Velocity
0
10

0
1
Time
Input
0
10
0
1
Position
0
10



0
0.5
Velocity
0
10

0
1
Time
Input

L

8
:
1

0.5h1
9
;

M

1

0.5h
c
&
Dept.ofAutomaticControl,Lund8