Treść książki

Przejdź do opcji czytnikaPrzejdź do nawigacjiPrzejdź do informacjiPrzejdź do stopki
CHAPTER1EXERCISEL1:PCSEQUENTIALCONTROL
1.1.2
Mooremachine
TheMoorestatemachine[Moo56]isadeterministicmachineinwhichtheoutputvalues
dependsolelyonthestateinwhichthemachineis.Referringtothenotationusedin
combinationalcontrol,assumingthatSisthesetofpossiblestates,wecanwrite
y(k)=fmoore(s(k))
s(k+1)=gmoore(x(k),s(k))
(1.2)
(1.3)
wheres(k)representsacertainstateattimek.
Thefunctionsfmooreandgmooredeterminethecurrentoutputsignalvaluesandthe
nextstate,respectively.Comparedtothefunctionthatdeterminestheoutputvaluesin
thecombinationalapproach,itisworthnotingthereplacementofthedependenceon
inputsignalswiththestateofthemachine,whichallowsfortheintroductionofmemory
intothecontrollerprogram.Thefunctiondefininghowtransitionsbetweensubsequent
statesoccurisequallyimportant.Itdependsonboththevalueofthecurrentstateofthe
machineandtheinputsmeasuredbythecontroller.
Thetimedependenciesareessential.Whiletheoutputchangeswiththestate,the
latterdependsonthepreviousstateandisupdatedwithacertainsamplingperiod.This
periodcanbeveryshort,e.g.,oftheorderofsinglenanosecondsormilliseconds,oritcan
besecondsorminutes,dependingonthesoftwaredesign(thisisrelatedtotheneedfor
speedofthesystemresponse),anditcarriessomenon-obviousimplications.Assuming
thatthestatemachineisinacertainstateS1,andpassestostateS3regardlessofthe
inputvalues(forsimplicity),thetransitionfromstateS3toS1isalsodefinedwithout
additionalconditionsontheinputsignals.Thisoccursintheexamplestatemachinein
fig.1.1ifweassumethatc13=c31=true.Therefore,thefragmentofthegmoorefunction
looksasfollows:
gmoore(x(k),s(k))=
...
S1
S3
,ifs(k)=S3
(1.4)
...
,ifs(k)=S1
Thiscorrespondswithhowitisimplementedinthecontrollercode.However,theabove
fragmentclearlyshowsthatinthecurrentsituation,statesS1andS3areunstablebecause
assoonasthemachineentersthem,animmediatedecisionismadetoleave.Shortstate
updateperiodsmayindicateimplementationerrorsand,dependingonwhetherthereare
othertransitionconditions,maycauseseeminglyrandomcontrollerbehavior.Forlong
updateperiods,thiscanbeawaytoimplement,forexample,LEDblinkingorcounting
thedurationofapulse.Therefore,specialattentionshouldbepaidtotheupdateperiod
andtheimplementationshouldbeadjustedtothecurrentconditions.
1.1.3
Mealymachine
TheMealystatemachine[Mea55]isanotherdeterministicmachine.Inthiscase,however,
theoutputsignalvaluesdependonthestateofthemachineandtheinputsignalvalues.
Therefore:
y(k)=fmealy(x(k),s(k))
s(k+1)=gmealy(x(k),s(k))
12
(1.5)
(1.6)