基于单片机PIC的温度控制的自动控制系统学习_第1页
基于单片机PIC的温度控制的自动控制系统学习_第2页
基于单片机PIC的温度控制的自动控制系统学习_第3页
基于单片机PIC的温度控制的自动控制系统学习_第4页
基于单片机PIC的温度控制的自动控制系统学习_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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,thecontrollerconfigurationsareinitializedanditsfunctionsaredefined.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,thentheresponsegivesðþÞTheairtemperatureTa(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-basedtemperaturecontrolsystemwereinitiatedinthefirsttermofthe20072008academicyearasareinforcementtothetheoreticallecturesoftheFI4172SpecialTopicsinInstrumentationPhysics.Asabasicassessmentabouttheuseofthemicrocontroller-basedtemperaturecontrolsystem,20stu-dentstakingthecoursewererequiredtofilloutaquestionnaire.Everystatementinthequestionnairehadtobeansweredonafive-pointLikertscalewithpoints1,2,3,4,and5representing‘‘stronglydisagree,’’‘‘disagree,’’‘‘neitheragreenordisagree,’’‘‘agree,’’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.基于单片机PIC16F877的自动温度控制系统的自动控制学习摘要:闭环温度控制系统是有一个控制器和一个热源组成的。本科生在仪器仪表的物理课程中已经对此进行了专题的学习。热源是有一个覆盖着一盏电灯和一个电扇的塑料盒,通过它们可以加热,也能将盒中的空气排出,热源还包括了一个温度传感器。采用单片机PIC16F877,可以实现比例控制。控制信号的脉冲宽度调制器可以打开驱动电路,关闭电灯和风扇。人们可以通过闭环控制系统的数学模型中,推导得到理论的瞬态响应。据发现,实验瞬态响应总是比设定点低得多,稳态误差比例(Kp)的灵敏度高,低于10。当Kp高于10的时候,瞬态响应往往接近设定点,造成小的稳态误差。这些特征刚刚好和理论的瞬态响应是一致的。进一步实验表明,闭环系统是高阶系统,这是由于PWM和驱动电路的反应动作造成的。关键词:控制系统、仪器仪表、单片机、比例、热电厂1.引言控制系统的课程,按照以前的传统,主要是提供给机电工程专业学习的。但是现在,一些电气和机械工程专业以外的专业也开了这个课程。在美国的几所大学中,有几个化学工程专业的也开展了控制系统的课程。学生们在这个可充中可以学习如何建模,仿真和控制。这些在西班牙的拉古纳大学的物理学院中已经完成。而在英国的诺丁汉大学的物理和天文学院改变了实验室实践课程中有关仪器控制技术的本科生教学,在第二年的教学中他们就应用了Mtalab软件。万隆数学和自然科学学院的物理研究计划提供了一些课程选修课给本科生在第四学年里。FI4172物理仪器专题是这些选修课之一,它是一个3学分的课程。其中包含了关于先进的仪器仪表系统的讲座,在这里面学生可以学习到工具的材料特性、原子学、管子材料、生物物理学和地球物理学。因为在物理研究计划中,包含了几个子课程,例如物理学、电磁学、光子材料学、核物理学、生物物理学和地球物理学。在这个学习过程中,自动控制一个非常重要的课题,因为学生经常会在书上遇到它。讲师在课堂解释了理论的概念,为了验证并加深学生对此的印象,让学生在实验室完成有关的实验是非常有必要的。通过实验,学生能轻松的学习理论概念,并且掌握更多的知识。有里克尔所做的一个调查显示,学生们会掌握25%他们所听到的知识,45%的他们所看到并且听到的知识,而在学习后通过动手做实验,他们能掌握70%的知识。现在个人计算机和微控制器已经普遍用于控制课程的实验室中。在控制领域上,费托斯和莱宝是两个全球领先的两个机构。他们提供各种各样的控制系统实验室在高等教育中。但是,学生得花更多的钱在这学习中,因为这些控制系统都非常昂贵。为了降低学习成本,我们建立一个基于PIC16F877单片机的控制系统,因为这个单片机在国内市场非常容易购买到,而且大学生非常流行使用。学生可以在第二年的课程中学习到热控制过程,在这个过程中热电厂作为被控制对象。在本文中,我们将总结有关基于自制的自动控制系统的自动控制学习。我们将该系统分为硬件和软件分别阐述。我们用一个数学模型来表示热电厂的物理系统,实验结果将在温度控制器应用热电厂的篇幅中进行深入讨论。温度控制系统的硬件和软件图1描述了在闭环控制系统中,控制器的控制过程。闭环控制系统的输入输出变量分别为r(t)和y(t)。将变量y(t)的阀值设为r(t),而y(t)本身也是一个需要控制的变量。用变量y(t)来表示一个测量过程的变化,输出变量z(t)一般和变量y(t)。变量r(t)和z(t)不一致的时候就会产生差量。这个差量输入到控制器后,就会产生一个控制信号。最后,控制信号传送到处理器,影响输出量y(t)图1是闭环控制系统的结构图。图2b是是基于自制的热电厂和PIC16F877单片机的控制系统的实物图。热电厂非常简单,他就是一个装有空气的封闭塑料盒。塑料盒长宽高分别为20mm、6mm和6mm。塑料盒的厚度为1mm。为例控制在热电厂的空气温度,我们使用了两个执行器和传感器。执行器是一个直流电灯和一个直流风扇组成的。电灯充当加热器加热空气,风扇则能将热空气排出。传感器是用于测量塑料盒中空气的温度。如图2a所示,温度控制器的核心是单片机PIC16F877。该单片机包含了一个高性能的精简指令及的中央处理器(精简指令集CPU),两个脉冲宽度调制器(PWM)和一个10位的模拟-数字转换器(ADC)。温度控制器的输入是一个电位器和两个按钮,这是用于改变AB设定点的温度和其他工艺参数和控制行动,以支持系统的操作菜单。同时使用液晶显示器(LCD)作为温度控制器的输出。因此,液晶呈现设定点和厂房温度测量以及工艺参数。PWM1和PWM2的微控制器,用于驱动执行器。由于所提供的PWM电流不足,打开或关闭灯和风扇的驱动电路是必需的。LM35温度传感器,用来测量空气的温度,并将测量值转换成电压。测量温度下的。由于LM35传感器的最大输出电压为1V,但是ADC的参考电压为5V。因此信号调理电路需要放大传感器的最大输出电压。控制器用RS232总线串行通信,将处理后的数据发送到计算机。由于比例-积分-微分控制动作在PIC16F877单片机上实现是比较复杂的。因而选中的比例控制动作不能减小,也不能忘记学习自动控制的目标。图3说明了有P控制器产生的控制信号u(t)。它的数学模式就是公式(1)其中Umax是u(t)的最大值,Umin是最小值。U0是当比例为e(t)=0时候的控制信号,Kp是比例的增益或者灵敏度。因此,可以说P控制器本质山是一个具有可调增益放大器。此外,控制器的带宽的定义为图4是当做温度控制器的单片机PIC16F877,执行温度控制的程序流程图。第一步,初始化并定义相应的控制器功能。如P控制器的输入时设定点SP,这是空气温度所需要的。比例量Kv,和允许误差A。学生可以按这两个按钮盒旋转电位器来设置,如图2b所示。第二步,测量变量Pv,这就是是热电厂空气温度。根据Sp和Pv的差计算出差量e(t),并产生控制信号u(t)。控制u(t)的PWM占空比,可以改变工程的空气温度。如果e(t)值太大,电灯打开。如果e(t)值太小,也就是温度太高,打开风扇。正常的话,风扇和电灯是交易激活的。最后差量e(t)如果仍高于允许误差A,那么比例控制动作继续进行。否则,控制动作停止。3.关于闭环控制系统的设计和测试结果的讨论图5所示是用塑料盒模拟热电厂的示意图。充满空气的塑料盒内装有加热器,空气温度Ta受加热器产生的热量和环境(大气)温度T0共同影响。设塑料盒的温度为Tb,塑料盒温度则是由盒子和大气的空气间热传递决定的。材料温度的热量转换率可以写成,mm和cm分别代表材料的体积和比热容从空中到塑料盒的传热速率为其中,A1是控制和塑料盒的接触面积,h1是空气和塑料盒的热传导率。这个热传导率可以用下面公式表示ma和ca分别代表盒内空气的质量和比热容。将式5带入方程4,我们可以得到空气和塑料盒,塑料盒和环境之间都存在着热传递,我们可以用下列公式表示热传

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论