基于单片机的温度控制外文文献及中文翻译.docx
《基于单片机的温度控制外文文献及中文翻译.docx》由会员分享,可在线阅读,更多相关《基于单片机的温度控制外文文献及中文翻译.docx(29页珍藏版)》请在冰豆网上搜索。

基于单片机的温度控制外文文献及中文翻译
TemperatureControlUsingaMicrocontroller:
AnInterdisciplinaryUndergraduateEngineeringDesignProject
JamesS.McDonald
DepartmentofEngineeringScience
TrinityUniversity
SanAntonio,TX78212
Abstract:
Thispaperdescribesaninterdisciplinarydesignprojectwhichwasdoneunderthe
author'ssupervisionbyagroupoffourseniorstudentsintheDepartmentofEngineeringScience
atTrinityUniversity.Theobjectiveoftheprojectwastodevelopatemperaturecontrolsystem
foranair-filledchamber.Thesystemwastoallowentryofadesiredchambertemperatureina
prescribedrangeandtoexhibitovershootandsteady-statetemperatureerroroflessthan1degree
Kelvinintheactualchambertemperaturestepresponse.Thedetailsofthedesigndevelopedby
thisgroupofstudents,basedonaMotorolaMC68HC05familymicrocontroller,aredescribed.
Thepedagogicalvalueoftheproblemisalsodiscussedthroughadescriptionofsomeofthekey
stepsinthedesignprocess.Itisshownthatthesolutionrequiresbroadknowledgedrawnfrom
severalengineeringdisciplinesincludingelectrical,mechanical,andcontrolsystems
engineering.
1Introduction
Thedesignprojectwhichisthesubjectofthispaperoriginatedfromareal-worldapplication.
AprototypeofamicroscopeslidedryerhadbeendevelopedaroundanOmegaTMmodel
CN-390temperaturecontroller,andtheobjectivewastodevelopacustomtemperaturecontrol
systemtoreplacetheOmegasystem.Themotivationwasthatacustomcontrollertargeted
specificallyfortheapplicationshouldbeabletoachievethesamefunctionalityatamuchlower
cost,astheOmegasystemisunnecessarilyversatileandequippedtohandleawidevarietyof
applications.
ThemechanicallayoutoftheslidedryerprototypeisshowninFigure1.Themainelement
ofthedryerisalarge,insulated,air-filledchamberinwhichmicroscopeslides,eachwitha
tissuesampleencasedinparaffin,canbesetoncaddies.Inorderthattheparaffinmaintainthe
properconsistency,thetemperatureintheslidechambermustbemaintainedatadesired
(constant)temperature.Asecondchamber(theelectronicsenclosure)housesaresistiveheater
andthetemperaturecontroller,andafanmountedontheendofthedryerblowsairacrossthe
heater,carryingheatintotheslidechamber.Thisdesignprojectwascarriedoutduringacademic
year1996–97byfourstudentsundertheauthor'ssupervisionasaSeniorDesignprojectinthe
DepartmentofEngineeringScienceatTrinityUniversity.Thepurposeofthispaperis
todescribetheproblemandthestudents'solutioninsomedetail,andtodiscusssomeofthe
pedagogicalopportunitiesofferedbyaninterdisciplinarydesignprojectofthistype.The
students'ownreportwaspresentedatthe1997NationalConferenceonUndergraduateResearch
[1].Section2givesamoredetailedstatementoftheproblem,includingperformance
specifications,andSection3describesthestudents'design.Section4makesupthebulkofthe
paper,anddiscussesinsomedetailseveralaspectsofthedesignprocesswhichofferunique
pedagogicalopportunities.Finally,Section5offerssomeconclusions.
2ProblemStatement
ThebasicideaoftheprojectistoreplacetherelevantpartsofthefunctionalityofanOmega
CN-390temperaturecontrollerusingacustom-designedsystem.Theapplicationdictatesthat
temperaturesettingsareusuallykeptconstantforlongperiodsoftime,butit'snonetheless
importantthatstepchangesbetrackedina“reasonable”manner.Thusthemainrequirements
boildownto
·allowingachambertemperatureset-pointtobeentered,
·displayingbothset-pointandactualtemperatures,and
·trackingstepchangesinset-pointtemperaturewithacceptablerisetime,steady-stateerror,
andovershoot.
AlthoughnotexplicitlyapartofthespecificationsinTable1,itwasclearthatthecustomer
desireddigitaldisplaysofset-pointandactualtemperatures,andthatset-pointtemperatureentry
shouldbedigitalaswell(asopposedto,say,throughapotentiometersetting).
3SystemDesign
Therequirementsfordigitaltemperaturedisplaysandsetpointentryaloneareenoughto
dictatethatamicrocontrollerbaseddesignislikelythemostappropriate.Figure2showsablock
diagramofthestudents'design.
Themicrocontroller,aMotorolaMC68HC705B16(6805forshort),istheheartofthesystem.
Itacceptsinputsfromasimplefour-keykeypadwhichallowspecificationoftheset-point
temperature,anditdisplaysbothset-pointandmeasuredchambertemperaturesusingtwo-digit
seven-segmentLEDdisplayscontrolledbyadisplaydriver.Alltheseinputsandoutputsare
accommodatedbyparallelportsonthe6805.Chambertemperatureissensedusinga
pre-calibratedthermistorandinputviaoneofthe6805'sanalog-to-digitalinputs.Finally,a
pulse-widthmodulation(PWM)outputonthe6805isusedtodrivearelaywhichswitchesline
powertotheresistiveheateroffandon.
Figure3showsamoredetailedschematicoftheelectronicsandtheirinterfacingtothe6805.
Thekeypad,aStorm3K041103,hasfourkeyswhichareinterfacedtopinsPA0{PA3ofPortA,
configuredasinputs.Onekeyfunctionsasamodeswitch.Twomodesaresupported:
setmode
andrunmode.Insetmodetwooftheotherkeysareusedtospecifytheset-pointtemperature:
oneincrementsitandonedecrements.Thefourthkeyisunusedatpresent.TheLEDdisplaysare
drivenbyaHarrisSemiconductorICM7212displaydriverinterfacedtopinsPB0{PB6ofPortB,
configuredasoutputs.Thetemperature-sensingthermistordrives,throughavoltagedivider,pin
AN0(oneofeightanaloginputs).Finally,pinPLMA(oneoftwoPWMoutputs)drivesthe
heaterrelay.
Softwareonthe6805implementsthetemperaturecontrolalgorithm,maintainsthe
temperaturedisplays,andalterstheset-pointinresponsetokeypadinputs.Becauseitisnot
completeatthiswriting,softwarewillnotbediscussedindetailinthispaper.Thecontrol
algorithminparticularhasnotbeendetermined,butitislikelytobeasimpleproportional
controllerandcertainlynotmorecomplexthanaPID.Somecontroldesignissueswillbe
discussedinSection4,however.
4TheDesignProcess
Althoughessentiallytheprojectisjusttobuildathermostat,itpresentsmanynice
pedagogicalopportunities.Theknowledgeandexperiencebaseofaseniorengineering
undergraduatearejustenoughtobringhimorhertothebrinkofasolutiontovariousaspectsof
theproblem.Yet,ineachcase,realworldconsiderationscomplicatethesituationsignificantly.
Fortunatelythesecomplicationsarenotinsurmountable,andtheresultisaverybeneficial
designexperience.Theremainderofthissectionlooksatafewaspectsoftheproblemwhich
presentthetypeoflearningopportunityjustdescribed.Section4.1discussessomeofthefeatures
ofasimplifiedmathematicalmodelofthethermalpropertiesofthesystemandhowitcanbe
easilyvalidatedexperimentally.Section4.2describeshowrealisticcontrolalgorithmdesignscan
bearrivedatusingintroductoryconceptsincontroldesign.Section4.3pointsoutsome
importantdeficienciesofsuchasimplifiedmodeling/controldesignprocessandhowtheycanbe
overcomethroughsimulation.Finally,Section4.4givesanoverviewofsomeofthe
microcontroller-relateddesignissueswhichariseandlearningopportunitiesoffered.
4.1MathematicalModel
Lumped-elementthermalsystemsaredescribedinalmostanyintroductorylinearcontrolsystems
text,andjustthissortofmodelisapplicabletotheslidedryerproblem.Figure4showsa
second-orderlumped-elementthermalmodeloftheslidedryer.Thestatevariablesarethe
temperaturesTaoftheairintheboxandTboftheboxitself.Theinputstothesystemarethe
poweroutputq(t)oftheheaterandtheambienttemperatureT¥.maandmbarethemassesofthe
airandthebox,respectively,andCaandCbtheirspecificheats.μ1andμ2areheattransfer
coefficientsfromtheairtotheboxandfromtheboxtotheexternalworld,respectively.
It'snothardtoshowthatthe(linearized)stateequationscorrespondingtoFigure4are
TakingLaplacetransformsof
(1)and
(2)andsolvingforTa(s),whichistheoutputof
interest,givesthefollowingopen-loopmodelofthethermalsystem:
whereKisaconstantandD(s)isasecond-orderpolynomial.K,tz,andthecoefficientsof
D(s)arefunctionsofthevariousparametersappearingin
(1)and
(2).Ofcoursethevarious
parametersin
(1)and
(2)arecompletelyunknown,butit'snothardtoshowthat,regardlessof
theirvalues,D(s)hastworealzeros.Thereforethemaintransferfunctionofinterest(whichis
theonefromQ(s),sincewe'llassumeconstantambienttemperature)canbewritten
Moreover,it'snottoohardtoshowthat1=tp1<1=tz<1=tp2,i.e.,thatthezeroliesbetween
thetwopoles.Bothoftheseareexcellentexercisesforthestudent,andtheresultistheopenloop
pole-zerodiagramofFigure5.
Obtainingacompletethermalmodel,then,isreducedtoidentifyingtheconstantKandthe
threeunknowntimeconstantsin(3).Fourunknownparametersisquiteafew,butsimple
experimentsshowthat1=tp1_1=tz;1=tp2sothattz;tp2_0aregoodapproximations.Thusthe
open-loopsystemisessentiallyfirst-orderandcanthereforebewritten
(wherethesubscriptp1hasbeendropped).
Simpleopen-loopstepresponseexperimentsshowthat,forawiderangeofinitial
temperaturesandheatinputs,K_0:
14_=Wandt_295s.1
4.2ControlSystemDesign