版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TemperatureControlUsingaMicrocontroller:
AnInterdisciplinaryUndergraduateEngineeringDesignProject
JamesS.McDonald
DepartmentofEngineeringScience
TrinityUniversity
SanAntonio,TX78212
Abstract
Thispaperdescribesaninterdisciplinarydesignprojectwhichwasdoneundertheauthor’ssupervisionbyagroupoffourseniorstudentsintheDepartmentofEngineeringScienceatTrinityUniversity.Theobjectiveoftheprojectwastodevelopatemperaturecontrolsystemforanair-filledchamber.Thesystemwastoallowentryofadesiredchambertemperatureinaprescribedrangeandtoexhibitovershootandsteady-statetemperatureerroroflessthan1degreeKelvinintheactualchambertemperaturestepresponse.Thedetailsofthedesigndevelopedbythisgroupofstudents,basedonaMotorolaMC68HC05familymicrocontroller,aredescribed.Thepedagogicalvalueoftheproblemisalsodiscussedthroughadescriptionofsomeofthekeystepsinthedesignprocess.Itisshownthatthesolutionrequiresbroadknowledgedrawnfromseveralengineeringdisciplinesincludingelectrical,mechanical,andcontrolsystemsengineering.
Introduction
Thedesignprojectwhichisthesubjectofthispaperoriginatedfromareal-worldapplication.AprototypeofamicroscopeslidedryerhadbeendevelopedaroundanOmegaTMmodelCN-390temperaturecontroller,andtheobjectivewastodevelopacustomtemperaturecontrolsystemtoreplacetheOmegasystem.Themotivationwasthatacustomcontrollertargetedspecificallyfortheapplicationshouldbeabletoachievethesamefunctionalityatamuchlowercost,astheOmegasystemisunnecessarilyversatileandequippedtohandleawidevarietyofapplications.
ThemechanicallayoutoftheslidedryerprototypeisshowninFigure1.Themainelementofthedryerisalarge,insulated,air-filledchamberinwhichmicroscopeslides,eachwithatissuesampleencasedinparaffin,canbesetoncaddies.Inorderthattheparaffinmaintaintheproperconsistency,thetemperatureintheslidechambermustbemaintainedatadesired(constant)temperature.Asecondchamber(theelectronicsenclosure)housesaresistiveheaterandthetemperaturecontroller,andafanmountedontheendofthedryerblowsairacrosstheheater,carryingheatintotheslidechamber.Thisdesignprojectwascarriedoutduringacademicyear1996-97byfourstudentsundertheauthor’ssupervisionasaSeniorDesignprojectinthe
DepartmentofEngineeringScienceatTrinityUniversity.Thepurposeofthispaperis
10.25"TopView
Electronicsenclosure( Tempe工苜tuiuizontfuLlut
FigureLSlided/yerwechantcallayoui
todescribetheproblemandthestudents’solutioninsomedetail,andtodiscusssome
ofthepedagogicalopportunitiesofferedbyaninterdisciplinarydesignprojectofthistype.Thestudents’ownreportwaspresentedatthe1997NationalConferenceonUndergraduateResearch[1].Section2givesamoredetailedstatementoftheproblem,includingperformancespecifications,andSection3describesthestudents’design.Section4makesupthebulkofthepaper,anddiscussesinsomedetailseveralaspectsofthedesignprocesswhichofferuniquepedagogicalopportunities.Finally,Section5offerssomeconclusions.
ProblemStatement
ThebasicideaoftheprojectistoreplacetherelevantpartsofthefunctionalityofanOmegaCN-390temperaturecontrollerusingacustom-designedsystem.Theapplicationdictatesthattemperaturesettingsareusuallykeptconstantforlongperiodsoftime,butit’snonethelessimportantthatstepchangesbetrackedina“reasonable”manner.Thusthemainrequirementsboildownto
allowingachambertemperatureset-pointtobeentered,
displayingbothset-pointandactualtemperatures,and
•trackingstepchangesinset-pointtemperaturewithacceptablerisetime,steady-stateerror,andovershoot.
Table1.TemperatureconWollerspecifications
Set-pointtemperatureentiy
Range
Precision
60-99°C
1nC
Set-pointtemperaturedisplay
RangePrecision
60-99°C
1℃
ChambeiLtemperaturedisplay
RangePrecisionAccuracy
60-99°C
1℃±1℃
Chambertemperaturestepresponse
Range(steadystate)Accuracy(steadystate)MaximuinovershootSettlingtime(to±LC)
60-99°C士1℃
1℃
120s
AlthoughnotexplicitlyapartofthespecificationsinTable1,itwasclearthatthecustomerdesireddigitaldisplaysofset-pointandactualtemperatures,andthatset-pointtemperatureentryshouldbedigitalaswell(asopposedto,say,throughapotentiometersetting).
SystemDesign
Therequirementsfordigitaltemperaturedisplaysandsetpointentryaloneareenoughtodictatethatamicrocontrollerbaseddesignislikelythemostappropriate.Figure2showsablockdiagramofthestudents’design.
Themicrocontroller,aMotorolaMC68HC705B16(6805forshort),istheheartofthesystem.Itacceptsinputsfromasimplefour-keykeypadwhichallowspecificationoftheset-pointtemperature,anditdisplaysbothset-pointandmeasuredchamber
temperaturesusingtwo-digitseven-segmentLEDdisplayscontrolledbyadisplaydriver.Alltheseinputsandoutputsareaccommodatedbyparallelportsonthe6805.Chambertemperatureissensedusingapre-calibratedthermistorandinputviaoneofthe6805’sanalog-to-digitalinputs.Finally,apulse-widthmodulation(PWM)outputonthe6805isusedtodrivearelaywhichswitcheslinepowertotheresistiveheateroffandon.
Figure3showsamoredetailedschematicoftheelectronicsandtheirinterfacingtothe6805.Thekeypad,aStorm3K041103,hasfourkeyswhichareinterfacedtopinsPA0{PA3ofPortA,configuredasinputs.Onekeyfunctionsasamodeswitch.Twomodesaresupported:setmodeandrunmode.Insetmodetwooftheotherkeysareusedtospecifytheset-pointtemperature:oneincrementsitandonedecrements.Thefourthkeyisunusedatpresent.TheLEDdisplaysaredrivenbyaHarrisSemiconductorICM7212displaydriverinterfacedtopinsPB0{PB6ofPortB,configuredasoutputs.Thetemperature-sensingthermistordrives,throughavoltagedivider,pinAN0(oneofeightanaloginputs).Finally,pinPLMA(oneoftwoPWMoutputs)drivestheheaterrelay.
Figure3.Schematicof basrd
Softwareonthe6805implementsthetemperaturecontrolalgorithm,maintains
WV
Heater
12TABcDAE
thetemperaturedisplays,andalterstheset-pointinresponsetokeypadinputs.
Becauseitisnotcompleteatthiswriting,softwarewillnotbediscussedindetailinthispaper.Thecontrolalgorithminparticularhasnotbeendetermined,butitislikelytobeasimpleproportionalcontrollerandcertainlynotmorecomplexthanaPID.SomecontroldesignissueswillbediscussedinSection4,however.
TheDesignProcess
Althoughessentiallytheprojectisjusttobuildathermostat,itpresentsmanynicepedagogicalopportunities.Theknowledgeandexperiencebaseofaseniorengineeringundergraduatearejustenoughtobringhimorhertothebrinkofasolutiontovariousaspectsoftheproblem.Yet,ineachcase,realworldconsiderationscomplicatethesituationsignificantly.
Fortunatelythesecomplicationsarenotinsurmountable,andtheresultisaverybeneficialdesignexperience.Theremainderofthissectionlooksatafewaspectsoftheproblemwhichpresentthetypeoflearningopportunityjustdescribed.Section4.1discussessomeofthefeaturesofasimplifiedmathematicalmodelofthethermalpropertiesofthesystemandhowitcanbeeasilyvalidatedexperimentally.Section4.2describeshowrealisticcontrolalgorithmdesignscanbearrivedatusingintroductoryconceptsincontroldesign.Section4.3pointsoutsomeimportantdeficienciesofsuchasimplifiedmodeling/controldesignprocessandhowtheycanbeovercomethroughsimulation.Finally,Section4.4givesanoverviewofsomeofthemicrocontroller-relateddesignissueswhichariseandlearningopportunitiesoffered.
MathematicalModel
Lumped-elementthermalsystemsaredescribedinalmostanyintroductorylinearcontrolsystemstext,andjustthissortofmodelisapplicabletotheslidedryerproblem.Figure4showsasecond-orderlumped-elementthermalmodeloftheslidedryer.ThestatevariablesarethetemperaturesTaoftheairintheboxandTboftheboxitself.Theinputstothesystemarethepoweroutputq(t)oftheheaterandtheambienttemperatureT¥.maandmbarethemassesoftheairandthebox,respectively,andCaandCbtheirspecificheats.四1and四2areheattransfercoefficientsfromtheairtotheboxandfromtheboxtotheexternalworld,respectively.
Figure4.Lmiped-elemeiilthermalmodel
It’snothardtoshowthatthe(linearized)stateequationscorrespondingtoFigure
4are
(〃-㈤
-m~乙j
TakingLaplacetransformsof(1)and(2)andsolvingforTa(s),whichistheoutputofinterest,givesthefollowingopen-loopmodelofthethermalsystem:
whereKisaconstantandD(s)isasecond-orderpolynomial.K,tz,andthecoefficientsofD(s)arefunctionsofthevariousparametersappearingin(1)and(2).Ofcoursethevariousparametersin(1)and(2)arecompletelyunknown,butit’snothardtoshowthat,regardlessoftheirvalues,D(s)hastworealzeros.Thereforethemaintransferfunctionofinterest(whichistheonefromQ(s),sincewe’llassumeconstantambienttemperature)canbewritten
Moreover,it’snottoohardtoshowthat1=tp1<1=tz<1=tp2,i.e.,thatthezeroliesbetweenthetwopoles.Bothoftheseareexcellentexercisesforthestudent,andtheresultistheopenlooppole-zerodiagramofFigure5.
FigurexPole-zerodiagramofGaq(s)
Obtainingacompletethermalmodel,then,isreducedtoidentifyingtheconstantKandthethreeunknowntimeconstantsin(3).Fourunknownparametersisquiteafew,butsimpleexperimentsshowthat1=tp1_1=tz;1=tp2sothattz;tp2_0aregoodapproximations.Thustheopen-loopsystemisessentiallyfirst-orderandcanthereforebewritten
G/s)=含 ⑷
(wherethesubscriptp1hasbeendropped).
Simpleopen-loopstepresponseexperimentsshowthat,forawiderangeofinitialtemperaturesandheatinputs,K_0:14_=Wandt_295s.1
ControlSystemDesign
Usingthefirst-ordermodelof(4)fortheopen-looptransferfunctionGaq(s)andassumingforthemomentthatlinearcontroloftheheaterpoweroutputq(t)ispossible,theblockdiagramofFigure6representstheclosed-loopsystem.Td(s)isthedesired,orset-point,temperature,C(s)isthecompensatortransferfunction,andQ(s)isthe
heateroutputinwatts.
Figure6.Simplifiedblockdiagrctntoftheclosed-loopsystem
Giventhissimplesituation,introductorylinearcontroldesigntoolssuchastherootlocusmethodcanbeusedtoarriveataC(s)whichmeetsthestepresponserequirementsonrisetime,steady-stateerror,andovershootspecifiedinTable1.Theupshot,ofcourse,isthataproportionalcontrollerwithsufficientgaincanmeetallspecifications.Overshootisimpossible,andincreasinggainsdecreasesbothsteady-stateerrorandrisetime.
Unfortunately,sufficientgaintomeetthespecificationsmayrequirelargerheatoutputsthantheheateriscapableofproducing.Thiswasindeedthecaseforthissystem,andtheresultisthattherisetimespecificationcannotbemet.Itisquiterevealingtothestudenthowusefulsuchanoversimplifiedmodel,carefullyarrivedat,canbeindeterminingoverallperformancelimitations.
SimulationModel
GrossperformanceanditslimitationscanbedeterminedusingthesimplifiedmodelofFigure6,butthereareanumberofotheraspectsoftheclosed-loopsystemwhoseeffectsonperformancearenotsosimplymodeled.Chiefamongtheseare
quantizationerrorinanalog-to-digitalconversionofthemeasuredtemperatureand
theuseofPWMtocontroltheheater.
Bothofthesearenonlinearandtime-varyingeffects,andtheonlypracticalwaytostudythemisthroughsimulation(orexperiment,ofcourse).
Figure7showsaSimulinkTMblockdiagramoftheclosed-loopsystemwhichincorporatestheseeffects.A/DconverterquantizationandsaturationaremodeledusingstandardSimulinkquantizerandsaturationblocks.ModelingPWMismorecomplicatedandrequiresacustomS-functiontorepresentit.
Figure7,SiumUnkblockdiagramofclosed-loopsystem
ThissimulationmodelhasprovenparticularlyusefulingaugingtheeffectsofvaryingthebasicPWMparametersandhenceselectingthemappropriately.(I.e.,thelongertheperiod,thelargerthetemperatureerrorPWMintroduces.Ontheotherhand,alongperiodisdesirabletoavoidexcessiverelay“chatter,”amongotherthings.)PWMisoftendifficultforstudentstograsp,andthesimulationmodelallowsanexplorationofitsoperationandeffectswhichisquiterevealing.
TheMicrocontroller
Simpleclosed-loopcontrol,keypadreading,anddisplaycontrolaresomeoftheclassicapplicationsofmicrocontrollers,andthisprojectincorporatesallthree.Itisthereforeanexcellentall-aroundexerciseinmicrocontrollerapplications.Inaddition,becausetheprojectistoproduceanactualpackagedprototype,itwon’tdotouseasimpleevaluationboardwiththeI/Opinsjumperedtothetargetsystem.Instead,it’snecessarytodevelopacompleteembeddedapplication.Thisentailsthechoiceofanappropriatepartfromthebroadrangeofferedinatypicalmicrocontrollerfamilyandlearningtouseafairlysophisticateddevelopmentenvironment.Finally,acustomprinted-circuitboardforthemicrocontrollerandperipheralsmustbedesignedandfabricated.
MicrocontrollerSelection.Inviewofexistinglocalexpertise,theMotorolalineofmicrocontrollerswaschosenforthisproject.Still,thisdoesnotnarrowthechoicedownmuch.Afairlydisciplinedstudyofsystemrequirementsisnecessarytospecifywhichmicrocontroller,outofscoresofvariants,isrequiredforthejob.Thisisdifficultforstudents,astheygenerallylacktheexperienceandintuitionneededaswellastheperseverancetowadethroughmanufacturers’selectionguides.
Partoftheproblemisinchoosingmethodsforinterfacingthevariousperipherals(e.g.,whatkindofdisplaydrivershouldbeused?).AstudyofrelevantMotorolaapplicationnotes[2,3,4]provedveryhelpfulinunderstandingwhatbasicapproachesareavailable,andwhatmicrocontroller/peripheralcombinationsshouldbeconsidered.
TheMC68HC705B16wasfinallychosenonthebasisofitsavailableA/DinputsandPWMoutputsaswellas24digitalI/Olines.Inretrospectthisisprobablyoverkill,asonlyoneA/Dchannel,onePWMchannel,and11I/Opinsareactuallyrequired(seeFigure3).Thedecisionwasmadetoerronthesafesidebecauseacompletedevelopmentsystemspecifictothechosenpartwasnecessary,andtheprojectbudgetdidnotpermitasecondsuchsystemtobepurchasedshouldthefirstproveinadequate.
MicrocontrollerApplicationDevelopment.Breadboardingoftheperipheral
hardware,developmentofmicrocontrollersoftware,andfinaldebuggingandtestingofacustomprinted-circuitboardforthemicrocontrollerandperipheralsallrequireadevelopmentenvironmentofsomekind.Thechoiceofadevelopmentenvironment,likethatofthemicrocontrolleritself,canbebewilderingandrequiressomefacultyexpertise.Motorolamakesthreegradesofdevelopmentenvironmentrangingfromsimpleevaluationboards(ataround$100)tofull-blownreal-timein-circuitemulators(atmorelike$7500).Themiddleoptionwaschosenforthisproject:theMMEVS,whichconsistsof_aplatformboard(whichsupportsall6805-familyparts),_anemulatormodule(specifictoB-seriesparts),and_acableandtargetheadadapter(package-specific).Overall,thesystemcostsabout$900andprovides,withsomelimitations,in-circuitemulationcapability.ItalsocomeswiththesimplebutsufficientsoftwaredevelopmentenvironmentRAPID[5].
Studentsfindlearningtousethistypeofsystemchallenging,buttheexperiencetheygaininreal-worldmicrocontrollerapplicationdevelopmentgreatlyexceedsthetypicalfirst-courseexperienceusingsimpleevaluationboards.
Printed-CircuitBoard.Thelayoutofasimple(thoughdefinitelynottrivial)printed-circuitboardisanotherpracticallearningopportunitypresentedbythisproject.Thefinalboardlayout,withpackageoutlines,isshown(at50%ofactualsize)inFigure8.Therelativesimplicityofthecircuitmakesmanualplacementandroutingpractical—infact,itlikelygivesbetterresultsthanautomaticinanapplicationlikethis—andthestudentisthereforeexposedtofundamentalissuesofprinted-circuitlayoutandbasicdesignrules.Thelayoutsoftwareusedwastheverynicepackagepcb,2andtheboardwasfabricatedin-housewiththeaidofourstaffelectronicstechnician.
Figure&Printed-circidtlayoutformicrocontrollerboard
5Conclusion
Theaimofthispaperhasbeentodescribeaninterdisciplinary,undergraduateengineeringdesignproject:amicrocontroller-basedtemperaturecontrolsystemwithdigitalset-pointentryandset-point/actualtemperaturedisplay.Aparticulardesignofsuchasystemhasbeendescribed,andanumberofdesignissueswhicharise—fromavarietyofengineeringdisciplines—havebeendiscussed.Resolutionofthese
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026河北张家口人才科技发展集团招聘笔试备考试题及答案详解
- 2026重庆市大足区龙岗街道办事处公开招聘公益性岗位工作人员1人笔试备考试题及答案详解
- 2026年安阳市殷都区人民医院招聘合同制工作人员32名笔试参考题库及答案详解
- 2026年综合能力测试(薪酬福利设计)试题及答案
- 2026年广东联通人员招聘笔试备考题库及答案详解
- 2026年大化集团有限责任公司人员招聘笔试备考试题及答案详解
- 2026年朝阳市消防救援局政府专职消防员招聘284人(第一批)笔试模拟试题及答案详解
- 2026年黑龙江省哈大铁路客运专线有限责任公司人员招聘笔试参考题库及答案详解
- 稻城亚丁景区旅游开发有限责任公司招聘笔试参考题库及答案详解
- 2026朔州市事业单位公开招聘急需紧缺高层次人才直接考核(一)笔试备考题库及答案详解
- 《江苏省建筑施工高处坠落预防措施图集》
- 矿区钻探施工方案(3篇)
- 电厂汽机培训课件
- 双电源使用管理制度
- 公司化妆品采购管理制度
- CJ/T 358-2019非开挖工程用聚乙烯管
- 危大工程巡视检查记录表 (样表)附危大工程安全监管及检查要点
- 电子电工产业概论 课件全套 陈芳芳 学习领域1-5 产业基本概况 - 职业岗位
- 2024秋新人教版数学七年级上册教学课件 6.3.2 第1课时 角的比较与运算
- 部编版四年级上册语文《现代诗二首》
- UPVC管粘接施工工艺
评论
0/150
提交评论