




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
Home-MadePIC16F877Microcontroller-BasedTemperatureControlSystemforLearningAutomaticControlKHAIRURRIJAL,MIKRAJUDDINABDULLAH,MAMANBUDIMANPhysicsofElectronicMaterialsResearchDivision,FacultyofMathematicsandNaturalSciences,InstitutTeknologiBandung,JalanGanesa10,Bandung40132,IndonesiaReceived20February2008;accepted20September2008ABSTRACT:Aclosed-looptemperaturecontrolsystem,whichiscomposedofathermalplantandacontroller,hasbeendevelopedtosupportundergraduatestudentsinlearningautomaticcontroldeliveredintheSpecialTopicsinInstrumentationPhysicscourse.Thethermalplantwasmadefromaplasticboxcoveringalampandafan,whichheatsanddrainstheairintheplasticbox,respectively,aswellasatemperaturesensor.ThecontrollerwithaproportionalcontrolactionwasrealizedbyemployingthePIC16F877microcontroller.Thecontrolsignalupdatespulse-widthmodulators(PWMs)inwhichdrivercircuitsturnonoroffthelampandthefan.Amathematicalmodeloftheclosed-loopcontrolsystemwasderivedandatheoreticaltransientresponsewasthenobtained.Itisfoundthattheexperimentaltransientresponseswerealwaysmuchlowerthanthesetpointandthesteady-stateerrorswerehighfortheproportionalsensitivity(Kp)lowerthan10.ForKphigherthan10,thetransientresponsestendtoapproachthesetpointtocausesmallsteady-stateerrors.Thesecharacteristicsareconsistentwiththetheoreticaltransientresponse.Furtherexaminationrevealedthattheclosed-loopsystemisahigherordersystemduetotheactionofthePWMsandthedrivercircuits.@2010WileyPeriodicals,Inc.ComputApplEngEduc19:1017,2011;Viewthisarticleonlineat;DOI10.1002/cae.20283Keywords:controlsystem;instrumentationphysics;microcontroller;proportional;thermalplant1INTRODUCTIONControlsystemscoursesaretraditionallyofferedbyElectricalandMechanicalEngineeringDepartments[13].Fewdepartmentsoutsideelectricalandmechanicalengineeringdisciplinespresentcoursesoncontrolsystemsintheircurricula.SeveralChemicalEngineeringDepartmentsatseveraluniversitiesinUSAhaveintroducedmoderncontrolsystemsteachingtotheirundergraduatestudents[4,5].Theteachingofmodeling,simulation,andcontroltostudentsinDepartmentofAppliedPhysics,FacultyofPhysicsattheUniversityofLaLaguna,Spain,hasbeendone[6].SchoolofPhysicsandAstronomyattheUniversityofNottinghamintheUnitedKingdomhaschangedthecurriculumofthesecondyearpracticallaboratorycoursetoimplementMatlabinteachingundergraduatestudentsaboutinstrumentcontroltechniques[7].PhysicsStudyProgramattheFacultyofMathematicsandNaturalSciencesofInstitutTeknologiBandungofferssomeelectivecoursesinthefourthyearofundergraduateprogram.OneoftheelectivecoursesisFI4172SpecialTopicsinInstrumentationPhysics,whichisa3-creditunitcourse.Itcontainslecturesonadvancedinstrumentationsystemsincludinginstrumentsforcharacterizingmaterials,nuclearandbiophysicsinstrumentsaswellasinstrumentsingeophysicsbecausethePhysicsStudyProgramhasseveralsubprogramssuchasPhysicsofElectronic,MagneticandPhotonicMaterials,NuclearPhysics,Biophysics,andGeophysics.Averyimportanttopicdeliveredinthecourseisautomaticcontrolbecauseitiseasilyfoundintheinstruments.Inordertosupporttheoreticalconceptsonautomaticcontrolthatwereexplainedbyalecturerinclassroom,laboratoryworksthatcanbedonebystudentsmustbeprovided.Byexecutingthelaboratoryworks,itishopedthatthestudentscanlearnthetheoreticalconceptseasilyandthereforegraspthemmore.ThisisreinforcedbythesurveydonebyRickel[8],whofoundthatstudentsretain25%ofwhattheyhear,45%ofwhattheyhearandsee,and70%iftheyusethe‘‘learning-by-doing’’method.Apersonalcomputerormicrocontrollerhasbeenusedinlearningcontrolwithlaboratoryscalemodels[911].Festo[12].andLeybold[13]arethetwoleadingcompaniesineducationaltoolsthatsupplyvariouscontrolsystemsforlearninginlaboratoriesofhighereducation.However,wehavetospendmoremoneyforhavingthecontrolsystemsbecausetheyareexpensive.Inordertoreducethecost,webuiltacontrolsystem.ThecontrollerwasbasedonaPIC16F877microcontrollerbecausethismicrocontrolleriseasilyobtainedfromthedomesticmarketandpopularamongtheundergraduatestudents.NotingthatthermalprocesswaslearnedinthesecondyearwhentakingtheThermodynamiccourse,athermalplantwasselectedtobecontrolled.Inthispaper,wereporthome-madetemperaturecontrolsystemforlearningautomaticcontrol.ThehardwareandsoftwareofthePIC16F877microcontroller-basedtemperaturecontrollerwillbedescribed.Thethermalplantasaphysicalsystemisrepresentedbyamathematicalmodel.Experimentalresultsobtainedbyapplyingthetemperaturecontrollertothethermalplantwillbediscussedthoroughly.2.HARDWAREANDSOFTWAREOFTEMPERATURECONTROLSYSTEMAprocesscontrolledbyacontrollerinaclosed-loopcontrolsystemisschematicallydescribedinFigure1.Aninputandanoutputoftheclosed-loopcontrolsystemareasetpointr(t)andaprocessvariabley(t),respectively.Thesetpointr(t)isthevaluetobereachedbytheprocessvariabley(t),whiley(t)itselfisthevariabletobecontrolled.Ameasuringelementisusedtoquantifytheprocessvariabley(t).Theoutputofmeasuringelementz(t)isgenerallynotthesameasitsinputy(t).Anerrore(t)occursduetothedifferencebetweenthesetpointr(t)andz(t).Theerrore(t)isfedtothecontrollerwithacontrolactiontoresultinacontrolsignalu(t).Finally,thecontrolsignalissuppliedtotheprocesstoinfluencetheoutputy(t)[14].Theclosed-loopcontrolsystemgiveninFigure1hasbeenrealizedbydevelopingahome-madethermalplantandaPIC16F877microcontroller-basedcontrollerasshownbyaphoto-graphinFigure2b.Thethermalplantisverysimple.Itisasmallplasticboxenclosingair.Theinternaldimensionsoftheplasticboxare20,6,and6mminlength,width,andheight,respectively.Thethicknessofeachsideoftheplasticboxis1mm.Inordertocontroltheairtemperatureinthethermalplant,twoactuatorsandasensorareutilized.Theactuatorsareadirectcurrent(dc)lampandadcfan.Thelampactsasaheatertoheattheairandthefandrainsthehotairtotheambient.Thesensor,whichmeasurestheairtemperature,islocatedintheplasticbox.AsdepictedinFigure2a,theheartofthetemperaturecontrolleristhePIC16F877microcontrollerofMicrochipTechnology,Inc.Itconsistsofahighperformanceandreducedinstructionsetcentralprocessingunit(RISCCPU),twopulse-widthmodulators(PWMs),anda10-bitanalog-to-digitalconverter(ADC)[15].Inputsofthetemperaturecontrollerareapotentiometerandtwobuttons,whichareemployedtochangeabset-pointtemperatureandotherprocessparametersforacontrolactionandtosupportsystemoperationmenu.Asanoutputofthetemperaturecontroller,a2*16-characterliquidcrystaldisplay(LCD)[16]isused.TheLCDthereforepresentsthesetpointandthemeasuredplanttemperaturesaswellastheprocessparameters.ThePWM1andPWM2ofthemicrocontrollerareusedtodrivetheactuators.SincecurrentsprovidedbythePWMsareinadequate,drivercircuitsthatturnonoroffthelampandthefanarerequired.TheLM35temperaturesensor,whichmeasurestheairtemperatureintheplant,convertsthemeasuredtemper-atureintovoltage[17].NotingthatthemaximumoutputvoltageoftheLM35sensoris1VandthereferencevoltageoftheADCis5V,asignalconditioningcircuitisneededtoamplifythemaximumoutputvoltageofthesensor.TheRS232serialcommunicationofthecontrollerisprovidedtosenddatatobeprocessedinthecomputer.Consideringthatproportionalintegral-derivative(PID)controlactioniscomplicatedtobeimplementedinthePIC16F877microcontroller,theproportional(P)controlactionwasselectedwithoutreducingorneglectingthepurposeoflearningautomaticcontrol.Thecontrolsignalu(t),whichisgeneratedbythePcontrollerandillustratedinFigure3,ismathematicallygivenbyEquation(1)[14].whereUmaxandUminarethemaximumandminimumvaluesofu(t),respectively,U0isthecontrolsignalwhene(t)?0,andKpistheproportionalsensitivityorthegain.Therefore,thePcontrollerisessentiallyanamplifierwithanadjustablegain.Additionally,theproportionalband(PB)ofthecontrollerisdefinedasFigure4representstheflowchartofaprogramimplementedonthePIC16F877microcontrollertoperformatemperaturecontrolwiththePcontrolaction.Inthefirststep,thecontrollerconfigurationsareinitializedanditsfunctionsarede?ned.InputsofthePcontrollerarethesetpointSP,whichisthedesiredairtemperature,theproportionalsensitivityKp,andthepermissibleerrorA.TheyaresetbypressingthetwobuttonsandrotatingthepotentiometerasshowninFigure2b.ThenextstepsaretomeasuretheprocessvariablePV,whichistheairtemperatureinthethermalplant,tocalculatetheerrore(t),whichisthedifferencebetweenSPandPV,andtoobtainthecontrolsignalu(t),whichistheproductofKpande(t).Thecontrolsignalu(t)updatesthedutycyclesofthePWMsinordertochangetheairtemperatureintheplant.Ife(t)ishighlypositive,thelampisturnedon.Thefanworkswhene(t)ishighlynegative.Otherwise,thelampandthefanarealternatelyactivated.Lastly,theerrore(t)iscomparedtothepermissibleerrorA.Ife(t)isstillhigherthanA,thentheproportionalcontrolactionisrepeated.Otherwise,thecontrolactionstops.3.DESIGNINGANDTESTINGRESULTSOFCLOSED-LOOPCONTROLSYSTEMANDDISCUSSIONThethermalplantbuiltfromaplasticboxisschematicallydrawninFigure5.Theplasticboxconfinesaheaterandair.TheairtemperatureTaisaffectedbyheatQ(t)radiatedbytheheaterandtheambient(atmosphere)temperatureTo.TheplasticboxtemperatureisTb,whichisduetotheheatexchangebetweentheairconfinedbytheplasticboxandtheambientair.Theheattransferrateduetothechangeintemperatureofamaterialiswrittenas[18]wheremmandcmarethemassandthespecificheatcapacityofthematerial,respectively.AheattransferoccursfromtheairtotheplasticboxwiththeratewhereA1isthecontactareabetweentheairandplasticboxandh1istheheattransfercoefficientfromtheairtotheplasticbox.ByfollowingEquation(3),theheattransferrateoftheairintheplasticboxiswheremaandcaarethemassandspecificheatcapacityofair.AftersubstitutionofEquation(5)intoEquation(4),weobtainSincetheheattransfertakesplacebetweentheairandplasticboxaswellasbetweentheplasticboxandtheambient,theheattransferrateisgivenbywhereA2isthecontactareabetweentheplasticboxandambient,andh2istheheattransfercoefficientfromtheplasticboxtotheambient.Again,wehavetheheattransferrateoftheplasticboxdQ/dt?mbcb(dTb/dt)byfollowingEquations(3)and(7)turnsintowherembandcbarethemassandspecificheatcapacityoftheplasticbox,respectively.AfterrearrangingEquation(8),thedifferentialequationoftheplasticboxtemperatureisgivenasBysubstitutingEquations(5)and(6)intoEquation(9)andperformingLaplacetransformation,weobtainEquation(10)inwhichTa(s)istheLaplacetransformofTa(t)Assumingthattheambienttemperatureisconstant,thethermalplanttransferfunctionGth(s)canbesimplywrittenasNotingthatthemassdensitiesofairandplasticboxare1.293and1.18*103kg/m3,respectively,ca?1.006*103J/kgC,cb?8103J/kgC,h1?5.6W/m2C,andh2?0.039W/m2C,thetzandtpare1/(9.248*06)and1/(1.1*103)s,respectively.Therefore,thezerois(9.248*106,0)andthepolesare(1.1*103,0)and(0,0)asdepictedinFigure6.Sincethepoleof(0,0)isveryclosetothezeroof(9.248*106,0),thenwhichisafirst-orderthermalsystem.ItisshowninEquation(12)thattheunknownparameterstobeidentifiedarekandtp.IfthestepinputQ(s)?A/s,whereAistheamplitude,thentheresponsegivesetTTheairtemperatureTa(t),whichisaninverseLaplacetransformofTa(s),isexpressedasIndesigningaclosed-loopcontrolsystem,wereferthesysteminFigure1.Thecontrollerhasthecontrolsignalu(t)inEquation(1).AssumingthatthethermalplantinputQ(t)isproportionaltothecontrolsignalu(t),weobtainwhereKpWMisaconstantduetotheactionofPWMsdrivercircuits.TheLaplacetransformofEquation(15)isthengivenbyQ(s)?KpWMu(s).Furtherassumptionisthatthetransferfunctionofthemeasuringelement(temperaturesensor)H(s)isunity.Thisassumptionisjustifiedbythefactthatthetemperaturemeasure-mentisperformedinanarrowsamplingtime.ThisimpliesthatH(t),whichistheinverseLaplacetransformofH(s),isaunitimpulse.Finally,theclosed-loopcontrolsysteminFigure1.developsintothatdemonstratedinFigure7.Theclosed-looptransferfunctionGcl(s)isthereforegivenbywhereC(s)?KpistheLaplacetransformofu(t)/e(t)inEquation(1),andG(s)istheLaplacetransformofthethermalprocesswrittenasUsingthethermalplantmodeledbyGth(s)inEquation(12),Gcl(s)inEquation(16)becomesSincetheset-pointtemperatureisB,TSP(s)?B/s,theresponseoftheclosed-loopsysteminEquation(18)isTheairtemperatureasafunctionoftimeisthentheinverseofLaplacetransformofEquation(19).Finally,weobtainwhereaisgivenbyKpWMKpk.ItisshownthattheambienttemperatureTa(t)approachesitssteadystateastimetendstoinfinity.Thesteady-stateambienttemperatureTa(t!1)isSinceKpWMandkareconstants,theset-pointtemperatureBisreachedbyincreasingproportionalconstantKpsothattheterma?KpWMKpkbecomesverylargerthanunity.Thesteady-stateerrore(t!1)isthenwrittenaswhichturnsintosmallerastheproportionalconstantKpisincreased.Afterdesigningtheclosed-loopcontrolsystem,thesystemhasbeenexamined.Theset-pointtemperatureTSPwasintherangeof4008CandtheproportionalconstantKpvariedfrom2to60.Theclosed-looptransientresponseswiththeset-pointtemperatureof808CaredepictedinFigure8.Althoughtheclosed-looptransientresponsesforotherset-pointtemperaturesarenotshown,theirtransientresponsesaresimilartothoseforTSPof808C.TheirtransientresponsesarealwaysmuchlowerthanTSPastimerisesforKplowerthan10.ForKphigherthan10,ontheotherhand,theirtransientresponsestendtoapproachTSP.ThesecharacteristicsareexpectedasgivenbyEquation(20).FurtherinspectionofthecurvesinFigure8demonstratessomeripplesonthetransientresponses.ThemeasuredtransientresponsesdifferfromthatinEquation(20).Again,bylookingatFigure8,itisseenthatthesteady-stateairtemperatureTa(t!1)doesnotreachtheset-pointtemperatureforsmallvalueofKp(Kp?2).ThevaluesofKpthatarehigherthan10resultinTa(t!1)comingclosetoTSPof808C.ThesefindingsarepredictedbyEquation(21).Itisalsonoticedthatthesteady-stateerrore(t!1)ishigh(around118C)forKp?2.Furthermore,thesteady-stateerrore(t!1)becomessmallerwithincreasingKp.TheseresultsareinagreementwithEquation(22).InordertoexaminewhetherthethermalprocessG(s)showninFigure7isafirst-ordersystemasassumedindevelopingthemodel,weplotjTa(t)Ta(1)j/jTa(0)Ta(1)jasafunctionoftimeonsemilogpaperbyfollowingOgata[14].ThegraphsaredemonstratedinFigure9.Afirst-ordersystemgivesastraightlinewithanegativeslope[14],whichisrepresentedbythedashedline.Itisclearlyunderstoodthatthethermalprocessisnotafirst-ordersystem.FurtherexaminationofthetransientresponsecurvesinFigure8suggeststhatthethermalprocessisahigherorder(morethansecondorder)systembecausethetransientresponsecurvesisthesuperpositionofanumberofexponentialcurvesanddampedsinusoidalcurveswithaparticularcharacteristicofsmalloscillationssuperimposeduponlargeroscillationsandexponentialcurves[14].SincethethermalprocessG(s)isahigherordersystem,itimpliesthatthetransferfunctionofthePWMsdrivercircuitsQ(s)/u(s)isnotaconstantasexpressedbyEquation(15).Asaresult,thetransferfunctionofthePWMsdrivercircuitsisatleastasecond-orderfunction.4.FEEDBACKFROMSTUDENTSThelaboratoryworksonautomaticcontrolusingthemicro-controller-basedtemperaturecontrolsystemwereinitiatedinthe?rsttermofthe20072008academicyearasareinforcementtothetheoreticallecturesoftheFI4172SpecialTopicsinInstrumentationPhysics.Asabasicassessmentabouttheuseofthemicrocontroller-basedtemperaturecontrolsystem,20stu-dentstakingthecoursewererequiredto?lloutaquestionnaire.Everystatementinthequestionnairehadtobeansweredona?ve-pointLikertscalewithpoints1,2,3,4,and5representing‘‘stronglydisagree,’’‘‘disagree,’’‘‘neitheragreenordisagree,’’‘‘a(chǎn)gree,’’and‘‘stronglyagree,’’respectively.Theygavetheiropiniononthefollowingstatements:a.Iclearlyunderstoodthepurposeandoperationofthetemperaturecontrolsystembeforepracticingwiththemicrocontroller-basedtemperaturecontrolsystem.b.Themicrocontroller-basedtemperaturecontrolsystemhelpsastudenttounderstandtemperaturecontrolconcepts.c.Thepracticalexercisesareeasytoperform.d.Iwouldliketohavehadextratimetodothelaboratoryworksandtounderstandthembetter.Figure10showsquestionnaireresultsforthefourstatementsaskedtothestudents.Itwasfoundthatmostofthestudents,formerly,didnothaveagoodconceptionofthepurposeandoperationofthetemperaturecontrolsystemasillustratedinFigure10a.Theresultsobtainedfromthesecondstatement,inFigure10b,indicatethatthemicrocontroller-basedtemperaturecontrolsystemisanadvantageoustoolinachievingbetterunderstandingoftemperaturecontrolconcepts.AsdemonstratedinFigure10c,mostofthestudentsfoundthatthepracticalexercisesareeasytoperform.Inaddition,only50%ofthestudentswouldliketohavehadextratimetodothelaboratoryworksandtounderstandthembetterassuggestedbyFigure10dduetothecreditsassignedtothecourse.5.CONCLUSIONSWehavedevelopedaclosed-looptemperaturecontrolsystem,whichconsistsofathermalplantandaproportionalcontroller,forfacilitatingundergraduatestudentsinlearningautomaticcontrol.Thethermalplantwasconstructedfromaplasticbox,whichsurroundsadirectcurrent(dc)lamp,adcfan,andatemperaturesensor.Theairintheplasticboxisheatedbythelampandtheheatedairisdrainedtotheambientbythefan.ThePIC16F877microcontrollerwasemployedtorealizethecontrollerinwhichthecontrolactionwasproportional.ThecontrolsignalupdatesthePWMsofthemicrocontrollerinwhichthedrivercircuitsswitchthelampandthefanonoroffwithacertaintime.Amathematicalmodeloftheclosed-loopcontrolsystemwasderivedbyassumingthatthethermalprocessislinearandatheoreticaltransientresponsewasthenobtained.Itisfoundfromtheexperimentthatthetransientresponseswerealwaysmuchlowerthanthesetpointwithincreasingtimefortheproportionalsensitivitylowerthan10.Fortheproportionalsensitivityhigherthan10,ontheotherhand,thetransientresponsestendtoapproachthesetpoint.Thesecharacteristicsareexpectedbythetheoreticaltransientresponse.Furtherexaminationofthetransientresponsecurvesfoundthatthethermalprocessintheclosed-loopsystemisahigherordersystem(morethansecondorder),andtherefore,thetransferfunctionofthePWMsdrivercircuitsisatleastasecond-orderfunction.基于單片機(jī)PIC16F877的自動(dòng)溫度控制系統(tǒng)的自動(dòng)控制學(xué)習(xí)摘要:閉環(huán)溫度控制系統(tǒng)是有一個(gè)控制器和一個(gè)熱源組成的。本科生在儀器儀表的物理課程中已經(jīng)對(duì)此進(jìn)行了專題的學(xué)習(xí)。熱源是有一個(gè)覆蓋著一盞電燈和一個(gè)電扇的塑料盒,通過它們可以加熱,也能將盒中的空氣排出,熱源還包括了一個(gè)溫度傳感器。采用單片機(jī)PIC16F877,可以實(shí)現(xiàn)比例控制??刂菩盘?hào)的脈沖寬度調(diào)制器可以打開驅(qū)動(dòng)電路,關(guān)閉電燈和風(fēng)扇。人們可以通過閉環(huán)控制系統(tǒng)的數(shù)學(xué)模型中,推導(dǎo)得到理論的瞬態(tài)響應(yīng)。據(jù)發(fā)現(xiàn),實(shí)驗(yàn)瞬態(tài)響應(yīng)總是比設(shè)定點(diǎn)低得多,穩(wěn)態(tài)誤差比例(Kp)的靈敏度高,低于10。當(dāng)Kp高于10的時(shí)候,瞬態(tài)響應(yīng)往往接近設(shè)定點(diǎn),造成小的穩(wěn)態(tài)誤差。這些特征剛剛好和理論的瞬態(tài)響應(yīng)是一致的。進(jìn)一步實(shí)驗(yàn)表明,閉環(huán)系統(tǒng)是高階系統(tǒng),這是由于PWM和驅(qū)動(dòng)電路的反應(yīng)動(dòng)作造成的。關(guān)鍵詞:控制系統(tǒng)、儀器儀表、單片機(jī)、比例、熱電廠1.引言控制系統(tǒng)的課程,按照以前的傳統(tǒng),主要是提供給機(jī)電工程專業(yè)學(xué)習(xí)的。但是現(xiàn)在,一些電氣和機(jī)械工程專業(yè)以外的專業(yè)也開了這個(gè)課程。在美國的幾所大學(xué)中,有幾個(gè)化學(xué)工程專業(yè)的也開展了控制系統(tǒng)的課程。學(xué)生們?cè)谶@個(gè)可充中可以學(xué)習(xí)如何建模,仿真和控制。這些在西班牙的拉古納大學(xué)的物理學(xué)院中已經(jīng)完成。而在英國的諾丁漢大學(xué)的物理和天文學(xué)院改變了實(shí)驗(yàn)室實(shí)踐課程中有關(guān)儀器控制技術(shù)的本科生教學(xué),在第二年的教學(xué)中他們就應(yīng)用了Mtalab軟件。萬隆數(shù)學(xué)和自然科學(xué)學(xué)院的物理研究計(jì)劃提供了一些課程選修課給本科生在第四學(xué)年里。FI4172物理儀器專題是這些選修課之一,它是一個(gè)3學(xué)分的課程。其中包含了關(guān)于先進(jìn)的儀器儀表系統(tǒng)的講座,在這里面學(xué)生可以學(xué)習(xí)到工具的材料特性、原子學(xué)、管子材料、生物物理學(xué)和地球物理學(xué)。因?yàn)樵谖锢硌芯坑?jì)劃中,包含了幾個(gè)子課程,例如物理學(xué)、電磁學(xué)、光子材料學(xué)、核物理學(xué)、生物物理學(xué)和地球物理學(xué)。在這個(gè)學(xué)習(xí)過程中,自動(dòng)控制一個(gè)非常重要的課題,因?yàn)閷W(xué)生經(jīng)常會(huì)在書上遇到它。講師在課堂解釋了理論的概念,為了驗(yàn)證并加深學(xué)生對(duì)此的印象,讓學(xué)生在實(shí)驗(yàn)室完成有關(guān)的實(shí)驗(yàn)是非常有必要的。通過實(shí)驗(yàn),學(xué)生能輕松的學(xué)習(xí)理論概念,并且掌握更多的知識(shí)。有里克爾所做的一個(gè)調(diào)查顯示,學(xué)生們會(huì)掌握25%他們所聽到的知識(shí),45%的他們所看到并且聽到的知識(shí),而在學(xué)習(xí)后通過動(dòng)手做實(shí)驗(yàn),他們能掌握70%的知識(shí)?,F(xiàn)在個(gè)人計(jì)算機(jī)和微控制器已經(jīng)普遍用于控制課程的實(shí)驗(yàn)室中。在控制領(lǐng)域上,費(fèi)托斯和萊寶是兩個(gè)全球領(lǐng)先的兩個(gè)機(jī)構(gòu)。他們提供各種各樣的控制系統(tǒng)實(shí)驗(yàn)室在高等教育中。但是,學(xué)生得花更多的錢在這學(xué)習(xí)中,因?yàn)檫@些控制系統(tǒng)都非常昂貴。為了降低學(xué)習(xí)成本,我們建立一個(gè)基于PIC16F877單片機(jī)的控制系統(tǒng),因?yàn)檫@個(gè)單片機(jī)在國內(nèi)市場非常容易購買到,而且大學(xué)生非常流行使用。學(xué)生可以在第二年的課程中學(xué)習(xí)到熱控制過程,在這個(gè)過程中熱電廠作為被控制對(duì)象。在本文中,我們將總結(jié)有關(guān)基于自制的自動(dòng)控制系統(tǒng)的自動(dòng)控制學(xué)習(xí)。我們將該系統(tǒng)分為硬件和軟件分別闡述。我們用一個(gè)數(shù)學(xué)模型來表示熱電廠的物理系統(tǒng),實(shí)驗(yàn)結(jié)果將在溫度控制器應(yīng)用熱電廠的篇幅中進(jìn)行深入討論。溫度控制系統(tǒng)的硬件和軟件圖1描述了在閉環(huán)控制系統(tǒng)中,控制器的控制過程。閉環(huán)控制系統(tǒng)的輸入輸出變量分別為r(t)和y(t)。將變量y(t)的閥值設(shè)為r(t),而y(t)本身也是一個(gè)需要控制的變量。用變量y(t)來表示一個(gè)測(cè)量過程的變化,輸出變量z(t)一般和變量y(t)。變量r(t)和z(t)不一致的時(shí)候就會(huì)產(chǎn)生差量。這個(gè)差量輸入到控制器后,就會(huì)產(chǎn)生一個(gè)控制信號(hào)。最后,控制信號(hào)傳送到處理器,影響輸出量y(t)圖1是閉環(huán)控制系統(tǒng)的結(jié)構(gòu)圖。圖2b是是基于自制的熱電廠和PIC16F877單片機(jī)的控制系統(tǒng)的實(shí)物圖。熱電廠非常簡單,他就是一個(gè)裝有空氣的封閉塑料盒。塑料盒長寬高分別為20mm、6mm和6mm。塑料盒的厚度為1mm。為例控制在熱電廠的空氣溫度,我們使用了兩個(gè)執(zhí)行器和傳感器。執(zhí)行器是一個(gè)直流電燈和一個(gè)直流風(fēng)扇組成的。電燈充當(dāng)加熱器加熱空氣,風(fēng)扇則能將熱空氣排出。傳感器是用于測(cè)量塑料盒中空氣的溫度。如圖2a所示,溫度控制器的核心是單片機(jī)PIC16F877。該單片機(jī)包含了一個(gè)高性能的精簡指令及的中央處理器(精簡指令集CPU),兩個(gè)脈沖寬度調(diào)制器(PWM)和一個(gè)10位的模擬-數(shù)字轉(zhuǎn)換器(ADC)。溫度控制器的輸入是一個(gè)電位器和兩個(gè)按鈕,這是用于改變AB設(shè)定點(diǎn)的溫度和其他工藝參數(shù)和控制行動(dòng),以支持系統(tǒng)的操作菜單。同時(shí)使用液晶顯示器(LCD)作為溫度控制器的輸出。因此,液晶呈現(xiàn)設(shè)定點(diǎn)和廠房溫度測(cè)量以及工藝參數(shù)。PWM1和PWM2的微控制器,用于驅(qū)動(dòng)執(zhí)行器。由于所提供的PWM電流不足,打開或關(guān)閉燈和風(fēng)扇的驅(qū)動(dòng)電路是必需的。LM35溫度傳感器,用來測(cè)量空氣的溫度,并將測(cè)量值轉(zhuǎn)換成電壓。測(cè)量溫度下的。由于LM35傳感器的最大輸出電壓為1V,但是ADC的參考電壓為5V。因此信號(hào)調(diào)理電路需要放大傳感器的最大輸出電壓??刂破饔肦S232總線串行通信,將處理后的數(shù)據(jù)發(fā)送到計(jì)算機(jī)。由于比例-積分-微分控制動(dòng)作在PIC16F877單片機(jī)上實(shí)現(xiàn)是比較復(fù)雜的。因而選中的比例控制動(dòng)作不能減小,也不能忘記學(xué)習(xí)自動(dòng)控制的目標(biāo)。圖3說明了有P控制器產(chǎn)生的控制信號(hào)u(t)。它的數(shù)學(xué)模式就是公式(1)其中Umax是u(t)的最大值,Umin是最小值。U0是當(dāng)比例為e(t)=0時(shí)候的控制信號(hào),Kp是比例的增益或者靈敏度。因此,可以說P控制器本質(zhì)山是一個(gè)具有可調(diào)增益放大器。此外,控制器的帶寬的定義為圖4是當(dāng)做溫度控制器的單片機(jī)PIC16F877,執(zhí)行溫度控制的程序流程圖。第一步,初始化并定義相應(yīng)的控制器功能。如P控制器的輸入時(shí)設(shè)定點(diǎn)SP,這是空氣溫度所需要的。比例量Kv,和允許誤差A(yù)。學(xué)生可以按這兩個(gè)按鈕盒旋轉(zhuǎn)電位器來設(shè)置,如圖2b所示。第二步,測(cè)量變量Pv,這就是是熱電廠空氣溫度。根據(jù)Sp和Pv的差計(jì)算出差量e(t),并產(chǎn)生控制信號(hào)u(t)。控制u(t)的PWM占空比,可以改變工程的空氣溫度。如果e(t)值太大,電燈打開。如果e(t)值太小,也就是溫度太高,打開風(fēng)扇。正常的話,風(fēng)扇和電燈是交易激活的。最后差量e(t)如果仍高于允許誤差A(yù),那么比例控制動(dòng)作繼續(xù)進(jìn)行。否則,控制動(dòng)作停止。3.關(guān)于閉環(huán)控制系統(tǒng)的設(shè)計(jì)和測(cè)試結(jié)果的討論圖5所示是用塑料盒模擬熱電廠的示意圖。充滿空氣的塑料盒內(nèi)裝有加熱器,空氣溫度Ta受加熱器產(chǎn)生的熱量和環(huán)境(大氣)溫度T0共同影響。設(shè)塑料盒的溫度為Tb,塑料盒溫度則是由盒子和大氣的空氣間熱傳遞決定的。材料溫度的熱量轉(zhuǎn)換率可以寫成,mm和cm分別代表材料的體積和比熱容從空中到塑料盒的傳熱速率為其中,A1是控制和塑料盒的接觸面積,h1是空氣和塑料盒的熱傳導(dǎo)率。這個(gè)熱傳導(dǎo)率可以用下面公式表示ma和ca分別代表盒內(nèi)空氣的質(zhì)量和比熱容。將式5帶入方程4,我們可以得到空氣和塑料盒,塑料盒和環(huán)境之間都存在著熱傳遞,我們可以用下列公式表示熱傳
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 分享成功人士的工作習(xí)慣計(jì)劃
- 《貴州圖南礦業(yè)(集團(tuán))有限公司興仁市下山鎮(zhèn)四海煤礦(變更)礦產(chǎn)資源綠色開發(fā)利用方案(三合一)》評(píng)審意見
- 《福泉市鵬盛礦業(yè)有限責(zé)任公司貴州省福泉市陸坪鎮(zhèn)大沙壩鋁土礦(變更)礦產(chǎn)資源綠色開發(fā)利用方案(三合一)》專家組評(píng)審意見
- 人教版初中七年級(jí)下冊(cè)歷史與社會(huì) 5.1.1遼闊的疆域 教學(xué)設(shè)計(jì)
- 財(cái)政與金融基礎(chǔ)知識(shí)課件
- 第二十五教時(shí)小結(jié)本單元內(nèi)容-俗稱“加法定理”教學(xué)實(shí)錄
- 2025年沈陽道路貨運(yùn)駕駛員從業(yè)資格證考試題庫
- 2025年長治a2貨運(yùn)從業(yè)資格證考試
- 2025年淮南從業(yè)資格證應(yīng)用能力考些啥
- 2025年常德貨運(yùn)從業(yè)資格證考試模擬考試
- XX省血液調(diào)配管理辦法
- 科創(chuàng)板問題測(cè)試題庫300題試題及答案
- 微信開放平臺(tái)網(wǎng)站信息登記表
- 商業(yè)銀行員工輕微違規(guī)行為積分管理辦法
- JJG 700 -2016氣相色譜儀檢定規(guī)程-(高清現(xiàn)行)
- 壓力容器安全檢查表
- 供應(yīng)商反向評(píng)估表
- 曲線帶式輸送機(jī)的設(shè)計(jì)
- 《國際關(guān)系學(xué)入門》課件第三章 國際關(guān)系理論
- 五金公司績效考核(共22頁)
- 體育課(軍體拳)教案(共43頁)
評(píng)論
0/150
提交評(píng)論