MCE441: Intr. Linear Control Systems

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

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

104 εμφανίσεις

MCE441:Intr.LinearControlSystems
Lecture18:DigitalImplementationofContinuous-Time
Controllers
ClevelandStateUniversity
MechanicalEngineering
HanzRichter,PhD
MCE441p.1/10
Digitalvs.Continuous(Analog)Control
Supposewefoundasatisfactorycontroltransferfunctionbyclassicaldesign
techniquesfollowedbysimulationstudies:
K(s)=2+
3
s
SincethisisaPIcontroller,wemayjustbuyananalogPIDboxofftheshelf
andtunetheproportionalgainto2andtheintegralgainto3.
Internally,theanalogPIDismadeofresistors,inductors,capacitorsandother
physicaldevicescapableofmaterializingthecontrolTF,fromerrortocontrol
input.
Whatifthecontrollerwas
K(s)=
2s
5
+3s
4
+s
3
+s
2
+2s+1
s
2
(s
2
+s+1)(s+8)
Canwendoff-the-shelfanalogcircuitrywhichhasthisTF?
MCE441p.2/10
Digitalvs.Continuous(Analog)Control
Ontheotherhand,wemaywanttouseadigitalcomputertorealizethe
behaviorofourcontroltransferfunctionbetweenerrorandcontrolinput.
Thisaffordsalotofexibility,sincechangestocontrolparameters(or
mathematicalform)aresimplydonebyeditinglinesofcode.
Sincedigitalcomputersoperateondiscretetime(adenedpacedcycle
forsensing,computationandactuation,whichcannothappensimulta-
neously),certaincontinuousmathematicaloperationslikedifferentiation
andintegrationmustbeperformedbyapproximation,inwhatiscalled
discretization.
MCE441p.3/10
Discretizingderivatives
SupposeweareusingaPIDlawwhichcontainstheterm˙e.Onewayto
approximate˙eistousethebackwarddifferencerule:
˙e≈
e(t)−e(t−T)
T
Inotherwords,thecyclicpartofthecodemightlooklike:
readcurrent_r%fromtheusercommand
readcurrent_y%fromthesensor
current_e=current_r-current_y;
edot=(current_e-previous_e)/T;
.....
.....
previous_e=current_e
MCE441p.4/10
Discretizingintegrals
Theintegraltermcanbeapproximated(crudely)byusingthe
rectangularrule:
readcurrent_r%fromtheusercommand
readcurrent_y%fromthesensor
current_e=current_r-current_y;
current_eint=previous_eint+current_e
*
T;
.....
.....
previous_eint=current_eint
MCE441p.5/10
Discretizationofstatederivatives
SupposeourcontrolTFisconvertedtostate-spaceformat:
˙x
1
=a
11
x
1
+a
12
x
2
+...+a
1n
x
n
+b
1
e
˙x
2
=a
21
x
1
+a
22
x
2
+...+a
2n
x
n
+b
2
e
.
.
.
.
.
.(1)
˙x
n
=a
n1
x
1
+a
n2
x
2
+...+a
nn
x
n
+b
n
e
u=c
1
x
1
+c
2
x
2
+....+c
n
x
n
+d
1
e
1
+d
2
e
2
+...+d
n
e
n
Thenwecandiscretizeeachoneofthederivativesandcreaterecursive
expressionsoftheform
u_ctrl=h(x_1,x_2,...x_n,e);
x_1_next=f_1(x_1,x_2,...x_n,e);
...
x_n_next=f_n(x_1,x_2,....x_n,e);
MCE441p.6/10
Zero-OrderHoldDiscretization
D/A
Sample-and-hold
(ZOH)
Continuous
System
A/D
Sample-and-hold
(ZOH)
u(k)u(t)y(t)y(k)
Clock
MCE441p.7/10
Zero-OrderHoldDiscretization
Adiscretizationmethodthatmatchesthetimedsample-and-hold
processinadigitalprocessoristheZero-OrderHold(ZOH)method.
Inthisintroductorycourseweareonlyconcernedwithobtainingthe
ZOHdiscretizationofagivencontinuous-timeTForSSsystembyusing
Matlab:
>>sysK=tf(numK,denK)%supposeyouhaveacontrol
%transferfunction[numK,denK]
>>Ts=1e-3;%definethesamplingperiod
>>sysK_d=c2d(sysK,Ts,'zoh');%wegofromcontinuousto
%discreteusingtheZOHmethod
>>[Ad,Bd,Cd,Dd]=ssdata(sysK_d);%extractthestate-space
%matricesforastate-spaceimplementation
MCE441p.8/10
AWordofCaution
Designingthecontrollerincontinuous-time,followedbydiscretization
anddeploymentiscalledemulationdesign.
Manyfactorsoutsidethescopeofthiscourse,includingsamplerate
selection,determinewhethertheimplementedcontrollerwilloperate
withaperformancesimilartotheoneseenincontinuous-time
simulations.
Ideally,oneshoulddiscretizetheplantTFandconductthedesignusing
digitaltechniques(directdesign).(MCE603/703)
Itcanbesafelysaid,however,thatusingahighsamplerateinthecontrol
implementationreducesthepossibilitiesoffailurewhenusingemulation
design.
MCE441p.9/10
Demonstration-DCServomotorControl
WenowdemonstratetheoperationsofdiscretizingaTFdesignedin
continuous-time,conductingasimulationtovalidatetheemulationdesign
underdigitaloperationandnallydeployingthecontrollerinrealtime.
MCE441p.10/10