天津工业大学2015届毕业论文
III.SYSTEMHARDWAREDESIGN
A.Thehardwaredesignoftheterminalnode
Inthebackgroundofindoorenvironmentalmonitoringapplications,forthedesignofsensornodethesefactorssuchaslow-cost,lowpower,stability,andreliabilityarespeciallyconsidered.ThehardwareblockdiagramofterminalnodeisshowninFigure2.
Figure2.Terminalnodehardwaredesign
TheCC2430istheprocessorandwirelesscommunicationunitofsystem,whichisarealZigBeewirelessSOC(System-on-Chip),equippedwithahighperformance2.4GHzDSSS(DirectSequenceSpreadSpectrum)RFtransceivercoreandanenhancedindustry-standard8051MCU.TheCC2430convertsthedatacollectedfromtheterminalnodeintodigitalsignalsusingADconverter,thenthedataaretransmittedtothegatewaynodebywirelessmulti-hopmode.
Takingintoaccountthespecifictaskofthegatewaynode,thatistoprocessand
30
天津工业大学2015届毕业论文
transmittheinformationcollected,aswellasthecharacteristicofitsstoragecapacityandcommunicationsrequirementsformonitoringtemperatureandhumidity,thegatewaynodecanstillusetheCC2430,whichissimilartothesensornodes.Thefunctionofgatewaynodeistocompletethecorrectionandfusionofdata,sendingthedatatothemonitoringcenter,gettinginstructionsandsendingtheinstructionstothecontrolequipmentafterprocessing.
B.Thehardwaredesignofsensormeasuringcircuit
Theterminalnodesneedtocompletetheacquisitionofvariousenvironmentalfactorsandtheinformationacquisitionisdonebythesensor,requiringsensorswithhigheraccuracyandlowerpowerconsumption.Inthisdesign,digitalsensorchipSHT71isselected,whichchieflyconsistsoftemperatureandhumiditysensor,amplifier,AIDconvertercircuitandmemory.Thesalientfeaturesofthischipareasfollows:operatingcurrentis550f.JA,standbycurrentisonly0.3f.JA,temperatureaccuracyis±0.3'Crespectivelyandhumidityaccuracyisnotmorethan1.8%,two-wiredigitalinterface,fullydigitaloutput,whichisI2CbusandcanbedirectlyconnectedwiththeMCU.
IV.FuzzyPIDCONTROLSTRATEGYANDDESIGN
A.FuzzyPIDcontrolstrategy
Inviewofthecharacteristicsoftheindoorairtemperatureandhumiditycontrol,thatis,multi-variable,largeinertia,nonlinear,couplingparameter,puredelayandalongertimespentinthecontrolandregulationandproducingsignificantovershoot,aprecisemathematicalmodelcannotbeestablishedandusingtheclassicalcontrolmethodisdifficulttoachievesatisfactorycontrolprecision.Fuzzycontrolstrategyisagoodchoiceandasanimportantbranchofthefieldofintelligentcontrol,itmimicsthehumanthoughttocontrol,withsimpledesignandrobustadvantages.Therefore,selectingafuzzycontrolalgorithmistocontroltheenvironmentalfactorsofthesystem.
B.TheimplementationofFuzzyPIDControl
Thefuzzycontrollerisnotrequiredtomastertheprecisemathematicalmodelofthecontrolledobject,andaccordingtothemanualcontrolrulestoorganizecontroldecisiontable,andthenthesizeofcontrolamountisdeterminedbythistable.CombiningfuzzycontrolwithPIDcontrolhastheadvantagesofflexibleandadaptableofthePIDcontrol,butalsohastheadvantagesofhighaccuracyofthePIDcontrol.Parameteradjustmentiscarriedoutbycalculatingthetemperatureerroranderrorchangerateecofthecurrentsystem,usingfuzzyrulesforfuzzyreasoningand
31
天津工业大学2015届毕业论文
queryingfuzzyruletable.ThestructureoffuzzyPIDcontrollerisshowninFigure3.
Figure3.FuzzyPIDtemperaturecontrollerstructure
AfuzzyPIDcontrollerisappliedtotemperaturecontrolinthisdesign,andtheinputlinguisticvariablesofthetemperaturefuzzycontrolleraretheerroreanditschangerateetc,whiletheoutputlinguisticvariableisthechangeofcontrollingamount,whichwillhelptoensuresystemstability,reducetheovershootofresponseprocessandweakentheoscillation.CombiningfuzzycontrolwithPIDcontrol,expressingtheconditionsandoperationoftherulebyfuzzyquantityintermsofthebasicprinciplesandmethodsoffuzzymathematics,thesefuzzycontrolrulesarestoredintothecomputerknowledgebaseandthenusingfuzzyreasoning,thecomputercouldtoachievethebestadjustmentofthePIDparametersbasedontheactualcorrespondingcircumstances.
Tomeetthedifferentrequirementsofcontrolparametersfromdifferenterroreanditschangerateetc,thefuzzyrelationsbetweenthe3parametersofPIDcontrolleranderroreanditschangerateetcareidentifiedandthe3parametersareadjustedaccordingtothefuzzycontrolprinciple,sothatthecontrolledobjecthasagooddynamicandstaticperformance.
TABLE!.FuzzyCONTROLQUERYTABLEOFTEMPERATURE
Bysummarizingthetechnologyandoperatorexperience,thecontrolrulestatements
32
天津工业大学2015届毕业论文
areaccessedandthetemperaturefuzzycontrolruletableisestablished.Butmicro-controllercannotdosuchalargeamountofcomputation,sothesolutionistoproduceafuzzycontrolquerytableshowninTable1andtocarryoutfuzzycomputingbysoftwarequery.
TheimplementationmethodofsoftwareistostorerespectivelythefuzzycontroltableofMp,MiandMdcalculatedoff-lineinthememory,thenevery30msperiodicinterruptcallsthesubroutineofqueryingfuzzycontroltable,thatis,accordingtothequantitativevalueofeandectoqueryfuzzycontroltableandtoobtainquantitativevaluesofMp,MiandMd'TheprogramflowchartisshowninFigure4.
Figure4.FuzzyPIDTemperaturecontrolflowchart
V.SYSTEMSOFTWAREDESIGN
A.Thesoftwaredesignofterminalnode
33
天津工业大学2015届毕业论文
ThedevicecomplyingwithZigBeeprotocolcanautomaticallyadjustthetransmitpowerandcanconsumeminimumequipmentenergyonthepremiseofensuringthecommunicationlinkquality.Inthisdesign,wirelesssensornetworkusingatreetopologystructurehastheadvantagesofbetterfunctionandlargercoveragethanthestarstructure,whileeasiertoimplementandmaintainthanthemeshnetwork.Inthesoftwaredesignofnodes,bycallingtheAPIfunctionsprovidedZigBeeprotocolstacktocompletetheinitializationofdevice,theconfigurationofthenetworkandthestartingupnetworkofnetworkmanagementlayer,thewirelessadhocnetworkconsistedofwirelesssensornodesdistributedinanumberofgreenhousesareachieved.Tofurtherreducenodepowerconsumption,thesystemalsohasthefunctionoftheregulardatacollectionandregularsleepandwake-up,whichfunctionisflexibleanddynamicallyconfigurable.ThemainprogramflowchartoftheterminalnodesisshowninFigure5andtheflowchartofinterruptserviceroutineisshowninFigure6.
Figure6.Flowchartofinterruptserviceroutine
Figure5.Mainprogramflowchartoftheterminalnodes
B.Thesoftwaredesignofthemonitoringcenter
Themonitoringcentermanagementsystemisinchargeofsendingacquisitioncommand,receivingcollecteddata,whilereleasingdataontheservertomeettheclient'sbrowsing.Itsmaintasksincludesynchronousmonitoringofallflowmeterstoachievetheonlinemonitoringfunctionofexcessivealarmetc,collectingdataandperformingcyclicredundancycheck(CRC)toensurereliabledata,storingautomaticallythemonitoringdataandtimeinformationinthedatabaseserver,andsoon.theprogramflowchartisshowninfigure7.
34