全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TemperatureControlUsingaMicrocontroller:AnInterdisciplinaryUndergraduateEngineeringDesignProjectJamesS.McDonaldDepartmentofEngineeringScienceTrinityUniversitySanAntonio,TX78212Abstract.ThispaperdescribesaninterdisciplinarydesignprojectwhichwasdoneundertheauthorssupervisionbyagroupoffourseniorstudentsintheDepartmentofEngineer-ingScienceatTrinityUniversity.Theobjectiveoftheprojectwastodevelopatemperaturecontrolsystemforanair-filledchamber.Thesystemwastoallowentryofadesiredcham-bertemperatureinaprescribedrangeandtoexhibitover-shootandsteady-statetemperatureerroroflessthan1de-greeKelvinintheactualchambertemperaturestepresponse.Thedetailsofthedesigndevelopedbythisgroupofstudents,basedonaMotorolaMC68HC05familymicrocontroller,aredescribed.Thepedagogicalvalueoftheproblemisalsodis-cussedthroughadescriptionofsomeofthekeystepsinthedesignprocess.Itisshownthatthesolutionrequiresbroadknowledgedrawnfromseveralengineeringdisciplinesinclud-ingelectrical,mechanical,andcontrolsystemsengineering.1IntroductionThedesignprojectwhichisthesubjectofthispaperorigi-natedfromareal-worldapplication.Aprototypeofamicro-scopeslidedryerhadbeendevelopedaroundanOmegaTMmodelCN-390temperaturecontroller,andtheobjectivewastodevelopacustomtemperaturecontrolsystemtoreplacetheOmegasystem.Themotivationwasthatacustomcon-trollertargetedspecificallyfortheapplicationshouldbeabletoachievethesamefunctionalityatamuchlowercost,astheOmegasystemisunnecessarilyversatileandequippedtohan-dleawidevarietyofapplications.ThemechanicallayoutoftheslidedryerprototypeisshowninFigure1.Themainelementofthedryerisalarge,insulated,air-filledchamberinwhichmicroscopeslides,eachwithatissuesampleencasedinparaffin,canbesetoncaddies.Inorderthattheparaffinmaintaintheproperconsistency,thetemperatureintheslidechambermustbemaintainedatade-sired(constant)temperature.Asecondchamber(theelectron-icsenclosure)housesaresistiveheaterandthetemperaturecontroller,andafanmountedontheendofthedryerblowsairacrosstheheater,carryingheatintotheslidechamber.Thisdesignprojectwascarriedoutduringacademicyear199697byfourstudentsundertheauthorssupervisionasaSeniorDesignprojectintheDepartmentofEngineeringSci-enceatTrinityUniversity.ThepurposeofthispaperistoSlideChamberSlideChamber161.756.2510.254.5HeaterFanElectronicsenclosureTopView8888TemperaturecontrollerFrontView4.5Figure1.Slidedryermechanicallayoutdescribetheproblemandthestudentssolutioninsomede-tail,andtodiscusssomeofthepedagogicalopportunitiesof-feredbyaninterdisciplinarydesignprojectofthistype.Thestudentsownreportwaspresentedatthe1997NationalCon-ferenceonUndergraduateResearch1.Section2givesamoredetailedstatementoftheproblem,includingperformancespecifications,andSection3describesthestudentsdesign.Section4makesupthebulkofthepaper,anddiscussesinsomedetailseveralaspectsofthedesignpro-cesswhichofferuniquepedagogicalopportunities.Finally,Section5offerssomeconclusions.2ProblemStatementThebasicideaoftheprojectistoreplacetherelevantpartsofthefunctionalityofanOmegaCN-390temperaturecontrollerusingacustom-designedsystem.Theapplicationdictatesthattemperaturesettingsareusuallykeptconstantforlongperi-odsoftime,butitsnonethelessimportantthatstepchangesbetrackedina“reasonable”manner.Thusthemainrequire-mentsboildownto#0Fallowingachambertemperatureset-pointtobeentered,#0Fdisplayingbothset-pointandactualtemperatures,and#0Ftrackingstepchangesinset-pointtemperaturewithac-ceptablerisetime,steady-stateerror,andovershoot.Table1givesamoreprecisestatementofspecifications.Table1.TemperaturecontrollerspecificationsSet-pointtemperatureentryRange6099#0ECPrecision1#0ECSet-pointtemperaturedisplayRange6099#0ECPrecision1#0ECChambertemperaturedisplayRange6099#0ECPrecision1#0ECAccuracy#061#0ECChambertemperaturestepresponseRange(steadystate)6099#0ECAccuracy(steadystate)#061#0ECMaximumovershoot1#0ECSettlingtime(to#061#0EC)120sAlthoughnotexplicitlyapartofthespecificationsinTa-ble1,itwasclearthatthecustomerdesireddigitaldisplaysofset-pointandactualtemperatures,andthatset-pointtem-peratureentryshouldbedigitalaswell(asopposedto,say,throughapotentiometersetting).3SystemDesignTherequirementsfordigitaltemperaturedisplaysandset-pointentryaloneareenoughtodictatethatamicrocontroller-baseddesignislikelythemostappropriate.Figure2showsablockdiagramofthestudentsdesign.RelayHeaterTemperatureSensorSlideChamberMicrocontrollerKeypadDisplays&DriversElectronicsEnclosureFigure2.TemperaturecontrollerhardwareblockdiagramThemicrocontroller,aMotorolaMC68HC705B16(6805forshort),istheheartofthesystem.Itacceptsinputsfromasimplefour-keykeypadwhichallowspecificationoftheset-pointtemperature,anditdisplaysbothset-pointandmea-suredchambertemperaturesusingtwo-digitseven-segmentLEDdisplayscontrolledbyadisplaydriver.Allthesein-putsandoutputsareaccommodatedbyparallelportsonthe6805.Chambertemperatureissensedusingapre-calibratedthermistorandinputviaoneofthe6805sanalog-to-digitalinputs.Finally,apulse-widthmodulation(PWM)outputonthe6805isusedtodrivearelaywhichswitcheslinepowertotheresistiveheateroffandon.Figure3showsamoredetailedschematicoftheelec-tronicsandtheirinterfacingtothe6805.Thekeypad,aStorm3K041103,hasfourkeyswhichareinterfacedtopinsPA0#7BPA3ofPortA,configuredasinputs.Onekeyfunctionsasamodeswitch.Twomodesaresupported:setmodeandrunmode.Insetmodetwooftheotherkeysareusedtospecifytheset-pointtemperature:oneincrementsitandonedecre-ments.Thefourthkeyisunusedatpresent.TheLEDdisplaysaredrivenbyaHarrisSemiconductorICM7212displaydriverinterfacedtopinsPB0#7BPB6ofPortB,configuredasoutputs.Thetemperature-sensingthermistordrives,throughavoltagedivider,pinAN0(oneofeightanaloginputs).Finally,pinPLMA(oneoftwoPWMoutputs)drivestheheaterrelay.7-segLEDdisplay2x2-digitABCDA1A2E1ICM7212RelaylineHeaterVddKeypadVdd28ThermistorMC68HC705B16PA0PA1PA2PA3PB1PB2PB3PB4PB5PB6PLMAAN0PB0Figure3.SchematicofmicrocontrollerboardSoftwareonthe6805implementsthetemperaturecon-trolalgorithm,maintainsthetemperaturedisplays,andalterstheset-pointinresponsetokeypadinputs.Becauseitisnotcompleteatthiswriting,softwarewillnotbediscussedinde-tailinthispaper.Thecontrolalgorithminparticularhasnotbeendetermined,butitislikelytobeasimpleproportionalcontrollerandcertainlynotmorecomplexthanaPID.SomecontroldesignissueswillbediscussedinSection4,however.4TheDesignProcessAlthoughessentiallytheprojectisjusttobuildathermostat,itpresentsmanynicepedagogicalopportunities.Theknowl-edgeandexperiencebaseofaseniorengineeringundergrad-uatearejustenoughtobringhimorhertothebrinkofasolu-tiontovariousaspectsoftheproblem.Yet,ineachcase,real-worldconsiderationscomplicatethesituationsignificantly.Fortunatelythesecomplicationsarenotinsurmountable,andtheresultisaverybeneficialdesignexperience.Theremainderofthissectionlooksatafewaspectsoftheproblemwhichpresentthetypeoflearningopportunityjustdescribed.Section4.1discussessomeofthefeaturesofasimplifiedmathematicalmodelofthethermalpropertiesofthesystemandhowitcanbeeasilyvalidatedexperimentally.Section4.2describeshowrealisticcontrolalgorithmdesignscanbearrivedatusingintroductoryconceptsincontrolde-sign.Section4.3pointsoutsomeimportantdeficienciesofsuchasimplifiedmodeling/controldesignprocessandhowtheycanbeovercomethroughsimulation.Finally,Section4.4givesanoverviewofsomeofthemicrocontroller-relatedde-signissueswhichariseandlearningopportunitiesoffered.4.1MathematicalModelLumped-elementthermalsystemsaredescribedinalmostanyintroductorylinearcontrolsystemstext,andjustthissortofmodelisapplicabletotheslidedryerproblem.Figure4showsasecond-orderlumped-elementthermalmodeloftheslidedryer.Thestatevariablesarethetemper-aturesTaoftheairintheboxandTboftheboxitself.Theinputstothesystemarethepoweroutputq#28t#29oftheheaterandtheambienttemperatureT.maandmbarethemassesoftheairandthebox,respectively,andCaandCbtheirspecificheats.1and2areheattransfercoefficientsfromtheairtotheboxandfromtheboxtotheexternalworld,respectively.Ta;ma;CaT1#28Ta,Tb#292#28Tb,T#29q#28t#29Tb;mb;CbFigure4.Lumped-elementthermalmodelItsnothardtoshowthatthe(linearized)stateequationscorrespondingtoFigure4aremaCaTa=1#28Ta,Tb#29(1)mbCbTb=1#28Ta,Tb#29,#28Tb,T#29(2)TakingLaplacetransformsof(1)and(2)andsolvingforTa#28s#29,whichistheoutputofinterest,givesthefollowingopen-loopmodelofthethermalsystem:Ta#28s#29=K#28z+1#29#28#29Q#28#29+1#28s#29T;whereKisaconstantand#28s#29isasecond-orderpolynomial.K,z,andthecoefficientsof#28s#29arefunctionsofthevariousparametersappearingin(1)and(2).Ofcoursethevariousparametersin(1)and(2)arecom-pletelyunknown,butitsnothardtoshowthat,regardlessoftheirvalues,#28s#29hastworealzeros.Thereforethemaintransferfunctionofinterest(whichistheonefromQ#28s#29,sincewellassumeconstantambienttemperature)canbewrittenGaq#28s#29=Ta#28#29Q#28#29=K#28z+1#29#28p+#29#28p2s+1#29(3)Moreover,itsnottoohardtoshowthat1=p1#3C1=z#3C1=p2,i.e.,thatthezeroliesbetweenthetwopoles.Bothoftheseareexcellentexercisesforthestudent,andtheresultistheopen-looppole-zerodiagramofFigure5.,1=p1ImRe,1=p2,1=zFigure5.Pole-zerodiagramofGaq#28s#29Obtainingacompletethermalmodel,then,isreducedtoidentifyingtheconstantKandthethreeunknowntimecon-stantsin(3).Fourunknownparametersisquiteafew,butsimpleexperimentsshowthat1=p1#1C1=z;1=p2sothatz;p2#190aregoodapproximations.Thustheopen-loopsys-temisessentiallyfirst-orderandcanthereforebewrittenGaq#28s#29=+(4)(wherethesubscriptp1hasbeendropped).Simpleopen-loopstepresponseexperimentsshowthat,forawiderangeofinitialtemperaturesandheatinputs,K#190:14#0E=Wand#19295s.14.2ControlSystemDesignUsingthefirst-ordermodelof(4)fortheopen-looptransferfunctionGaq#28s#29andassumingforthemomentthatlinearcon-troloftheheaterpoweroutputq#28t#29ispossible,theblockdia-gramofFigure6representstheclosed-loopsystem.Td#28s#29is1Ofcoursethesystemisnotactuallylinear,sotheapparentparametervaluesvarywithinitialconditionsandinputmagnitude.Theeffectonclosed-loopperformanceisnottooserious,butitgivesthestudentagoodideaofwhatnonlinearitymeansandhowfeedbacktendstomitigateitseffects.thedesired,orset-point,temperature,C#28s#29isthecompensatortransferfunction,andQ#28s#29istheheateroutputinwatts.Td#28s#29C#28s#29Ks+1Ta#28s#29Q#28s#29Figure6.Simplifiedblockdiagramoftheclosed-loopsystemGiventhissimplesituation,introductorylinearcontroldesigntoolssuchastherootlocusmethodcanbeusedtoarriveataC#28s#29whichmeetsthestepresponserequirementsonrisetime,steady-stateerror,andovershootspecifiedinTa-ble1.Theupshot,ofcourse,isthataproportionalcontrollerwithsufficientgaincanmeetallspecifications.Overshootisimpossible,andincreasinggainsdecreasesbothsteady-stateerrorandrisetime.Unfortunately,sufficientgaintomeetthespecificationsmayrequirelargerheatoutputsthantheheateriscapableofproducing.Thiswasindeedthecaseforthissystem,andtheresultisthattherisetimespecificationcannotbemet.Itisquiterevealingtothestudenthowusefulsuchanover-simplifiedmodel,carefullyarrivedat,canbeindeterminingoverallperformancelimitations.4.3SimulationModelGrossperformanceanditslimitationscanbedeterminedus-ingthesimplifiedmodelofFigure6,butthereareanumberofotheraspectsoftheclosed-loopsystemwhoseeffectsonperformancearenotsosimplymodeled.Chiefamongtheseare#0Fquantizationerrorinanalog-to-digitalconversionofthemeasuredtemperatureand#0FtheuseofPWMtocontroltheheater.Bothofthesearenonlinearandtime-varyingeffects,andtheonlypracticalwaytostudythemisthroughsimulation(orexperiment,ofcourse).Figure7showsaSimulinkTMblockdiagramoftheclosed-loopsystemwhichincorporatestheseeffects.A/Dconverterquantizationandsaturationaremodeledusingstan-dardSimulinkquantizerandsaturationblocks.ModelingPWMismorecomplicatedandrequiresacustomS-functiontorepresentit.A/DConverter0.392ScaleFactor+Sum80SetpointTemperaturePIDCompensator0.05Thermistor0.137295.2s+1G_aq(s)pwm.mPWMSFunctionSaturation/HeaterFigure7.Simulinkblockdiagramofclosed-loopsystemThissimulationmodelhasprovenparticularlyusefulingaugingtheeffectsofvaryingthebasicPWMparametersandhenceselectingthemappropriately.(I.e.,thelongerthepe-riod,thelargerthetemperatureerrorPWMintroduces.Ontheotherhand,alongperiodisdesirabletoavoidexcessiverelay“chatter,”amongotherthings.)PWMisoftendifficultforstudentstograsp,andthesimulationmodelallowsanex-plorationofitsoperationandeffectswhichisquiterevealing.4.4TheMicrocontrollerSimpleclosed-loopcontrol,keypadreading,anddisplaycon-trolaresomeoftheclassicapplicationsofmicrocontrollers,andthisprojectincorporatesallthree.Itisthereforeanexcel-lentall-aroundexerciseinmicrocontrollerapplications.Inaddition,becausetheprojectistoproduceanactualpackagedprototype,itwontdotouseasimpleevaluationboardwiththeI/Opinsjumperedtothetargetsystem.Instead,itsnecessarytodevelopacompleteembeddedapplication.Thisentailsthechoiceofanappropriatepartfromthebroadrangeofferedinatypicalmicrocontrollerfamilyandlearningtouseafairlysophisticateddevelopmentenvironment.Fi-nally,acustomprinted-circuitboardforthemicrocontrollerandperipheralsmustbedesignedandfabricated.MicrocontrollerSelection.Inviewofexistinglocalexper-tise,theMotorolalineofmicrocontrollerswaschosenforthisproject.Still,thisdoesnotnarrowthechoicedownmuch.Afairlydisciplinedstudyofsystemrequirementsisneces-sarytospecifywhichmicrocontroller,outofscoresofvari-ants,isrequiredforthejob.Thisisdifficultforstudents,astheygenerallylacktheexperienceandintuitionneededaswellastheperseverancetowadethroughmanufacturersselectionguides.Partoftheproblemisinchoosingmethodsforinterfac-ingthevariousperipherals(e.g.,whatkindofdisplaydrivershouldbeused?).AstudyofrelevantMotorolaapplicationnotes2,3,4provedveryhelpfulinunderstandingwhatbasicapproachesareavailable,andwhatmicrocontroller/peripheralcombinationsshouldbeconsidered.TheMC68HC705B16wasfinallychosenonthebasisofitsavailableA/DinputsandPWMoutputsaswellas24digitalI/Olines.Inretrospectthisisprobablyoverkill,asonlyoneA/Dchannel,onePWMchannel,and11I/Opinsareactuallyrequired(seeFigure3).Thedecisionwasmadetoerronthesafesidebecauseacompletedevelopmentsystemspecifictothechosenpartwasnecessary,andtheprojectbudgetdidnotpermitasecondsuchsystemtobepurchasedshouldthefirstproveinadequate.MicrocontrollerApplicationDevelopment.Breadboard-ingoftheperipheralhardware,developmentofmicrocon-trollersoftware,andfinaldebuggingandtestingofacustomprinted-circuitboardforthemicrocontrollerandperipheralsallrequireadevelopmentenvironmentofsomekind.Thechoiceofadevelopmentenvironment,likethatofthemicrocontrolleritself,canbebewilderingandrequiressomefacultyexpertise.Motorolamakesthreegradesofdevelop-mentenvironmentrangingfromsimpleevaluationboards(ataround$100)tofull-blownreal-timein-circuitemulators(atmorelike$7500).Themiddleoptionwaschosenforthisproject:theMMEVS,whichconsistsof#0Faplatformboard(whichsupportsall6805-familyparts),#0Fanemulatormodule(specifictoB-seriesparts),and#0Facableandtargetheadadapter(package-specific).Overall,thesystemcostsabout$900andprovides,withsomelimitations,in-circuitemulationcapability.ItalsocomeswiththesimplebutsufficientsoftwaredevelopmentenvironmentRAPID5.Studentsfindlearningtousethistypeofsystemchal-lenging,buttheexperiencetheygaininreal-worldmicro-controllerapplicationdevelopmentgreatlyexceedsthetypicalfirst-courseexperienceusingsimpleevaluationboards.Printed-CircuitBoard.Thelayoutofasimple(thoughdefinitelynottrivial)printed-circuitboardisanotherpracti-callearningopportunitypresentedbythisproject.Thefi-nalboardlayout,withpackageoutlines,isshown(at50%ofactualsize)inFigure8.Therelativesimplicityofthecir-cuitmakesmanualplacementandroutingpracticalinfact,itlikelygivesbetterresultsthanautomaticinanapplicationlikethisandthestudentisthereforeexposedtofundamen-talissuesofprinted-circuitlayoutandbasicdesignrules.Thelayoutsoftwareusedwastheverynicepackagepcb,2andtheboardwasfabricatedin-housewiththeaidofourstaffelec-tronicstechnician.Figure8.Printed-circuitlayoutformicrocontrollerboard5ConclusionTheaimofthispaperhasbeentodescribeaninterdisciplinary,undergraduateengineeringdesignproject:amicrocontroller-2pcbisfreelydistributablesoftwareforUNIX/X11.ItiswrittenbyThomasNau,AssistantDirectorofComputingatUniversitatUlm,Germany.HecanbecontactedatURLmailto:Thomas.Naurz.uni-ulm.de,thesoftwareisavailableatftp:#2F#2Fftp.uni-ulm.de#2Fpub#2Fpcb,andanemaillistcanbesubscribedtoatmailto:pcbmajordomo.uni-ulm.de.basedtemperaturecontrolsystemwithdigitalset-pointen-tryandset-point/actualtemperaturedisplay.Aparticularde-signofsuchasystemhasbeendescribed,andanumber
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年幼儿园继续教育培训心得体会(32篇)
- 初中入学个人军训心得体会(21篇)
- 会计实训心得体会1000字(35篇)
- 大学生如何奋进新征程建功新时代心得
- 岗前培训的心得体会500字(30篇)
- 女生军训心得体会范文(32篇)
- 高二学生军训心得体会范文(32篇)
- 2024智能联接白皮书
- 2024年襄阳高新区七里河街道办事处综合治理岗招录1人《行政职业能力测验》模拟试卷(答案详解版)
- 2024年襄阳市经济责任审计局财务审计岗招录1人《行政职业能力测验》模拟试卷(答案详解版)
- 汽车电动助力转向系统电机选择及控制系统设计
- (论文)金安区江淮分水岭地区水稻高产栽培技术
- WT数字功率计操作手册
- 高速公路设计
- 基坑坍塌事故现场处置方案(完整版)
- 阿里巴巴的股权激励制度
- 轴的常用材料及其机械性能
- 最新人教版五年级数学下册全册单元教材分析
- 上海对外经贸大学机关“定编、定岗、定责”实施方案
- 计算机网络 江南大学现代远程教育考试大作业
- 各种局部通风机选型计算
评论
0/150
提交评论