基于单片机的温度控制外文文献及中文翻译.docx
《基于单片机的温度控制外文文献及中文翻译.docx》由会员分享,可在线阅读,更多相关《基于单片机的温度控制外文文献及中文翻译.docx(23页珍藏版)》请在冰豆网上搜索。
基于单片机的温度控制外文文献及中文翻译
TemperatureControlUsingaMicrocontroller:
AnInterdisciplinaryUndergraduateEngineeringDesignProject
JamesS.McDonald
DepartmentofEngineeringScience
TrinityUniversity
SanAntonio,TX78212
Abstract:
Thispaperdescribesaninterdisciplinarydesignprojectwhichwasdoneundertheauthor'ssupervisionbyagroupoffourseniorstudentsintheDepartmentofEngineeringScienceatTrinityUniversity.Theobjectiveoftheprojectwastodevelopatemperaturecontrolsystemforanair-filledchamber.Thesystemwastoallowentryofadesiredchambertemperatureinaprescribedrangeandtoexhibitovershootandsteady-statetemperatureerroroflessthan1degreeKelvinintheactualchambertemperaturestepresponse.Thedetailsofthedesigndevelopedbythisgroupofstudents,basedonaMotorolaMC68HC05familymicrocontroller,aredescribed.Thepedagogicalvalueoftheproblemisalsodiscussedthroughadescriptionofsomeofthekeystepsinthedesignprocess.Itisshownthatthesolutionrequiresbroadknowledgedrawnfromseveralengineeringdisciplinesincludingelectrical,mechanical,andcontrolsystemsengineering.
1Introduction
Thedesignprojectwhichisthesubjectofthispaperoriginatedfromareal-worldapplication.
AprototypeofamicroscopeslidedryerhadbeendevelopedaroundanOmegaTMmodel-390temperaturecontroller,andtheobjectivewastodevelopacustomtemperaturecontrolsystemtoreplacetheOmegasystem.Themotivationwasthatacustomcontrollertargetedspecificallyfortheapplicationshouldbeabletoachievethesamefunctionalityatamuchlowercost,asthe
Omegasystemisunnecessarilyversatileandequippedtohandleawidevarietyofapplications.
ThemechanicallayoutoftheslidedryerprototypeisshowninFigure1.Themainelementofthedryerisalarge,insulated,air-filledchamberinwhichmicroscopeslides,eachwithatissuesampleencasedinparaffin,canbesetoncaddies.Inorderthattheparaffinmaintaintheproperconsistency,thetemperatureintheslidechambermustbemaintainedatadesired(constant)temperature.Asecondchamber(theelectronicsenclosure)housesaresistiveheaterandthetemperaturecontroller,andafanmountedontheendofthedryerblowsairacrosstheheater,carryingheatintotheslidechamber.Thisdesignprojectwascarriedoutduringacademicyear1996一97byfourstudentsundertheauthor5ssupervisionasaSeniorDesignprojectintheDepartmentofEngineeringScienceatTrinityUniversity.Thepurposeofthispaperistodescribetheproblemandthestudents5solutioninsomedetail,andtodiscusssomeofthepedagogicalopportunitiesofferedbyaninterdisciplinarydesignprojectofthistype.Thestudents'ownreportwaspresentedatthe1997NationalConferenceonUndergraduateResearch[1].Section2givesamoredetailedstatementoftheproblem,includingperformancespecifications,andSection3describesthestudents,design.Section4makesupthebulkofthepaper,anddiscussesinsomedetailseveralaspectsofthedesignprocesswhichofferuniquepedagogicalopportunities.Finally,Section5offerssomeconclusions.
Figure1.Slidediyerineclicmicallayoui
2ProblemStatement
ThebasicideaoftheprojectistoreplacetherelevantpartsofthefunctionalityofanOmega-390temperaturecontrollerusingacustom-designedsystem.Theapplicationdictatesthattemperaturesettingsareusuallykeptconstantforlongperiodsoftime,butifsnonethelessimportantthatstepchangesbetrackedina“reasonable”manner.Thusthemainrequirementsboildownto
•allowingachambertemperatureset-pointtobeentered,
•displayingbothset-pointandactualtemperatures,and
•trackingstepchangesinset-pointtemperaturewithacceptablerisetime,steady-stateerror,andovershoot.
Table1.Temperaturecontrollerspecifications
Set-pointtemperatureentry
RanaeJ.
60-99°C
Precision
1°C
Set-pointtemperaturedisplay
RanaeJ.
60-99°C
Precision
1°C
Chambertemperaturedisplay
RanaeJ.
60-99°C
Precision
1°C
Accuracy
±1°C
Chambertemperaturestepresponse
Range(steadystate)
60-99°C
Accuracy(steadystate)
±1°C
Maximumovershoot
1°C
Settlingtime(to±1°C)
120s
AlthoughnotexplicitlyapartofthespecificationsinTable1,itwasclearthatthecustomerdesireddigitaldisplaysofset-pointandactualtemperatures,andthatset-pointtemperatureentryshouldbedigitalaswell(asopposedto,say,throughapotentiometersetting).
3SystemDesign
Therequirementsfordigitaltemperaturedisplaysandsetpointentryaloneareenoughtodictatethatamicrocontrollerbaseddesignislikelythemostappropriate・Figure2showsablockdiagramofthestudents5design.
Figure2.Temperaturecontrollerhardwcuvblockdiagram
Themicrocontroller,aMotorolaMC68HC705B16(6805forshort),istheheartofthesystem.Itacceptsinputsfromasimplefour-keykeypadwhichallowspecificationoftheset-pointtemperature,anditdisplaysbothset-pointandmeasuredchambertemperaturesusingtwo-digitseven-segmentLEDdisplayscontrolledbyadisplaydriver.Alltheseinputsandoutputsareacmodatedbyparallelportsonthe6805.Chambertemperatureissensedusingapre-calibratedthermistorandinputviaoneofthe6805'sanalog-to-digitalinputs.Finally,apulse-widthmodulation(PWM)outputonthe6805isusedtodrivearelaywhichswitcheslinepowertotheresistiveheateroffandon.
Figure3showsamoredetailedschematicoftheelectronicsandtheirinterfacingtothe6805.Thekeypad,aStorm3K041103,hasfourkeyswhichareinterfacedtopinsPA0{PA3ofPortA,configuredasinputs.Onekeyfunctionsasamodeswitch.Twomodesaresupported:
setmodeandrunmode.Insetmodetwooftheotherkeysareusedtospecifytheset-pointtemperature:
oneincrementsitandonedecrements.Thefourthkeyisunusedatpresent.TheLEDdisplaysare
drivenbyaHarrisSemiconductorICM7212displaydriverinterfacedtopinsPB0IPB6ofPortB,configuredasoutputs.Thetemperature-sensingthermistordrives,throughavoltagedivider,pin
ANO(oneofeightanaloginputs).Finally,pinPLMA(oneoftwoPWMoutputs)drivestheheaterrelay.
Figure3.SchematicofinicrocontroUerboard
Softwareonthe6805implementsthetemperaturecontrolalgorithm,maintainsthetemperaturedisplays,andalterstheset-pointinresponsetokeypadinputs.Becauseitisnotpleteatthiswriting,softwarewillnotbediscussedindetailinthispaper.Thecontrolalgorithminparticularhasnotbeendetermined,butitislikelytobeasimpleproportionalcontrollerandcertainlynotmoreplexthanaPID.SomecontroldesignissueswillbediscussedinSection4,
however.
4TheDesignProcess
Althoughessentiallytheprojectisjusttobuildathermostat,itpresentsmanynicepedagogicalopportunities.Theknowledgeandexperiencebaseofaseniorengineeringundergraduatearejustenoughtobringhimorhertothebrinkofasolutiontovariousaspectsoftheproblem.Yet,ineachcase,realworldconsiderationsplicatethesituationsignificantly.
Fortunatelytheseplicationsarenotinsurmountable,andtheresultisaverybeneficialdesignexperience.Theremainderofthissectionlooksatafewaspectsoftheproblemwhichpresentthetypeoflearningopportunityjustdescribed.Section4.1discussessomeofthefeaturesofasimplifiedmathematicalmodelofthethermalpropertiesofthesystemandhowitcanbeeasilyvalidatedexperimentally.Section4.2describeshowrealisticcontrolalgorithmdesignscanbearrivedatusingintroductoryconceptsincontroldesign.Section4.3pointsoutsomeimportantdeficienciesofsuchasimplifiedmodeling/controldesignprocessandhowtheycanbeoverethroughsimulation.Finally,Section4.4givesanoverviewofsomeofthemicrocontroller-relateddesignissueswhichariseandlearningopportunitiesoffered.
4.1MathematicalModel
Lumped-elementthermalsystemsaredescribedinalmostanyintroductorylinearcontrolsystemstext,andjustthissortofmodelisapplicabletotheslidedryerproblem.Figure4showsasecond-orderlumped-elementthermalmodeloftheslidedryer.ThestatevariablesarethetemperaturesTaoftheairintheboxandTboftheboxitself.Theinputstothesystemarethepoweroutputq(t)oftheheaterandtheambienttemperatureT¥.maandmbarethemassesoftheairandthebox,respectively,andCaandCbtheirspecificheats.p1andjj2areheattransfer
coefficientsfromtheairtotheboxandfromtheboxtotheexternalworld,respectively.
Figure4.Luinped-elemeiuthe/刀model
Ifsnothardtoshowthatthe(linearized)stateequationscorrespondingtoFigure4are
〃皿方-
〃坊-
“1(爲r—Tb)
(1)
“1(爲一Tb)_'Tb—TJ
(2)
TakingLaplacetransformsof
(1)and
(2)andsolvingforTa(s),whichistheoutputofinterest,givesthefollowingopen-loopmodelofthethermalsystem:
加)•
K(xzs+1)1T
whereKisaconstantandD(s)isasecond-orderpolynomial.K,tz,andthecoefficientsofD(s)arefunctionsofthevariousparametersappearingin
(1)and
(2).Ofcoursethevariousparametersin
(1)and
(2)arepletelyunknown,butifsnothardtoshowthat,regardlessoftheirvalues,D(s)hastworealzeros.Thereforethemaintransferfunctionofinterest(whichistheonefromQ(s),sinceweJIIassumeconstantambienttemperature)canbewritten
_爲⑸_Kg+1)
力W(^15+1)(^254-1)
Moreover,it'snottoohardtoshowthat1=tp1<1=tz<1=tp2,i.e.,thatthezeroliesbetweenthetwopoles.Bothoftheseareexcellentexercisesforthestudent,andtheresultistheopenlooppole-zerodiagramofFigure5.
Illi
"p2-
-1/g-1/ji
Figure5.PoJe-zerodicigrcimofGaq(s)
Obtainingapletethermalmode