基于MCS52兼容微处理器单片机的PWM控制器设计.docx

上传人:b****0 文档编号:10130716 上传时间:2023-05-23 格式:DOCX 页数:15 大小:163.51KB
下载 相关 举报
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第1页
第1页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第2页
第2页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第3页
第3页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第4页
第4页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第5页
第5页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第6页
第6页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第7页
第7页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第8页
第8页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第9页
第9页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第10页
第10页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第11页
第11页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第12页
第12页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第13页
第13页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第14页
第14页 / 共15页
基于MCS52兼容微处理器单片机的PWM控制器设计.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

基于MCS52兼容微处理器单片机的PWM控制器设计.docx

《基于MCS52兼容微处理器单片机的PWM控制器设计.docx》由会员分享,可在线阅读,更多相关《基于MCS52兼容微处理器单片机的PWM控制器设计.docx(15页珍藏版)》请在冰点文库上搜索。

基于MCS52兼容微处理器单片机的PWM控制器设计.docx

基于MCS52兼容微处理器单片机的PWM控制器设计

DesignofPWMControllerinaMCS-52CompatibleMCU

Author:

Yue-LiHu,WeiWangMicroelectronicResearch&DevelopmentCenter

CampusP.O.B.221,149YanchangRd,Shanghai200072,China

Abstract:

Inthispaper,wewilltalksomethingaboutPWMtechnology.PWMtechnologyisakindofvoltageregulationmethodbycontrollingtheswitchfrequencyofDCpowerwithfixedvoltagetomodifythetwo-endvoltageofload.Thistechnologycanbeusedforavarietyofapplicationsincludingmotorcontrol,temperaturecontrolandpressurecontrolandsoon.Thistechniquewillbewidelyusedinmotorcontrol.

Keywords:

PWMtechnology;frequency;motorcontrol

Introduction

PWMtechnologyisakindofvoltageregulationmethodbycontrollingtheswitchfrequencyofDCpowerwithfixedvoltagetomodifythetwo-endvoltageofload.Thistechnologycanbeusedforavarietyofapplicationsincludingmotorcontrol,temperaturecontrolandpressurecontrolandsoon.InthemotorcontrolsystemshownasFig.1,throughadjustingthedutycycleofpowerswitch,thespeedofmotorcanbecontrolled.AsshowninFig.2,underthecontrolofPWMsignal,theaverageofvoltagethatcontrolsthespeedofmotorchangeswithDuty-cycle(D=t1/TinthisFigure),thusthemotorspeedcanbeincreasedwhenmotorpowerturnon,decreasedwhenpowerturnoff.

Fig.1:

TheRelationshipbetweenVoltageofArmatureandFig.2ArchitectureofPWMModule

Therefore,themotorspeedcanbecontrolledwithregularlyadjustingthetimeofturn-onandturn-off.Therearethreemethodscouldachievetheadjustmentofdutycycle:

(1)Adjustfrequencywithfixedpulse-width.

(2)Adjustbothfrequencyandpulse-width.(3)Adjustpulse-widthwithfixedfrequency.

Generally,therearefourmethodstogeneratethePWMsignalsasthefollowing:

(1)Generatedbythedevicecomposedofseparatelogiccomponents.Thismethodistheoriginalmethodwhichnowhasbeendiscarded.

(2)Generatedbysoftware.ThismethodneedCPUtocontinuouslyoperateinstructionstocontrolI/OpinsforgeneratingPWMoutputsignals,sothatCPUcannotdoanythingother.Therefore,themethodalsohasbeendiscardedgradually.(3)GeneratedbyASIC.TheASICmakesadecreaseofCPUburdenandsteadyworkgenerallyhasseveralfunctionssuchasover-currentprotection,dead-timeadjustmentandsoon.Thenthemethodhasbeenwidelyusedinmanykindsofoccasionnow.(4)GeneratedbyPWMfunctionmoduleofMCU.ThroughembeddingPWMfunctionmoduleinMCUandinitializingthefunction,PWMpinsofMCUcanalsoautomaticallygeneratePWMoutsignalswithoutCPUcontrollingonlywhenneedtochangeduty-cycle.Itisthemethodthatwillbeimplementedinthispaper.

Inthispaper,weproposeaPWMmoduleembeddedina8052microcontroller.ThePWMmodulecansupportPWMpulsesignalsbyinitializingthecontrolregisterandduty-cycleregisterwiththreemethodsjustmentionedabovetoadjustthedutycycleandseveraloperationmodestoaddflexibilityforuser.

ThefollowingsectionexplainsthearchitectureofthePWMmoduleandthearchitecturesofbasicfunctionalblocks.Section3describestwooperationmodes.Experimentalandsimulationresultsverifyingpropersystemoperationarealsoshowninthatsection.Dependingonmodeofoperation,thePWMmodulecreatesoneormorepulse-widthmodulatedsignals,whosedutyratioscanbeindependentlyadjusted.

ImplementationofPWMmoduleinMCU

OverviewofthePWMmodule

AblockdiagramofPWMmoduleisshowninFig.3.Itisclearlyfromthediagramthatthewholemoduleiscomposedoftwosections:

PWMsignalgeneratoranddead-timegeneratorwithchannelselectlogic.ThePWMfunctioncanbestartedbytheuserthroughimplementingsomeinstructionsforinitializingthePWMmodule.Inparticular,thefollowingpowerandmotioncontrolapplicationsaresupported:

•DCMotor

•UninterruptablelPowerSupply(UPS)

·ThePWMmodulealsohasthefollowingfeatures:

•TwoPWMsignaloutputswithcomplementaryorindependentoperation

•Hardwaredead-timegeneratorsforcomplementarymode

•DutycycleupdatesareconfigurabletobeimmediatedorsynchronizedtothePWM

Fig.3ArchitectureofPWMModule

Detailsofthearchitecture

PMWgenerator

Thearchitectureofthe2-outputPWMgeneratorshowninFig.4isbasedona16-bitresolutioncounterwhichcreatesapulse-widthmodulatedsignal.Thesystemissynthesizedbyasystemclocksignalwhosefrequencycanbedividedby4timesor12timesthroughsettingthevalueofT3MforPWM0orT4MforPWM1inthespecialregisterPWMCONasshowninFig.4.ToPWM0generator,theclockto16-bitcounterwillbepre-dividedby4timesbydefaultwhenT3Missettozero.Andtheclockwillbedividedby12timeswhenT3Missetto1.ThisisalsotrueforPWM1.TheotherbitsinPWMCONareexplainedindetailinTable1.

Fig.4BitMappingofPWMCON

Table1:

TheBitDefinitioninPWMCON

Channel-selectlogic

ThefollowFig.5showsthechannel-selectlogicwhichisusefulinComplementaryMode.Fromthisdiagram,itiscleartoknowthatsignalCPandCPWMcontrolthesourceofPWMHandPWML.Andthedetailsaboutthetwocontrolsignalswillbediscussedinthesection3,andthearchitectureofdead-timegeneratorwillalsobediscussedinsection5forthecontinuityofComplementaryMode.

Fig.5DiagramofChannel-selectLogic

OperationModeandSimulationResults

Thedesignhastwooperationmodes:

IndependentModeandComplimentaryMode.BysettingthecorrespondingbitCPWMinregisterPWMCONshowninFig.6usercanselectoneofthetwooperationmodes.WhenCPWMissettozero,PWMmodulewillworkinIndependentMode,whereas,PWMmodulewillworkinComplimentaryMode.Inthefollowingofthissection,thetwooperationmodewillbeexplainedrespectivelyindetailandthesimulationresultsofthePWMmodulefromtheSynoposysVCSEDAplatformwhichverifythedesignwillalsobeshown.

IndependentPWMOutputMode

AnIndependentPWMOutputmodeisusefulfordrivingloadssuchastheoneshowninFigure6.AparticularPWMoutputisintheIndependentOutputmodewhenthecorrespondingCPbitinthePWMCONregisterissettozero.Inthiscase,two-channelPWMoutputsareindependentofeachother.ThesignalonpinPWM0/PWMHisfromPWM0generator,andthesignalonpinPWM1/PWMLisfromPWM0generator.Theseparatecaseisachievedbythechannel-selectlogicshowninFig.6.ThePWMI/Opinsaresettoindependentmodebydefaultuponadvicereset.Thedead-timegeneratorisdisabledintheIndependentmode.ThesimulationresultisshowninFigure6asthefollowingFig.6Tr4andtr3arerunbitstoPWM0andPWM1,respectively.Actually,fromthisdiagram,PinP1[5]/P1[4]ofMCUisusedforPWMH/PWMLornormalI/O,alternatively.

Fig6theWaveformofPWMOutputsinIndependentMode

ComplementaryPWMOutputMode

TheComplementaryOutputmodeisusedtodriveinverterloadssimilartotheoneshowninFigure7.ThisinvertertopologyistypicalforDCapplications.InComplementaryOutputMode,thepairofPWMoutputscannotbeactivesimultaneously.ThePWMchannelandoutputpinpairareinternallyconfiguredthroughchannel-selectlogicasshowninFigure7.Adead-timemaybeoptionallyinsertedduringdeviceswitchingwherebothoutputsareinactiveforashortperiod.

Fig7:

TypicalLoadforComplementaryPWMOutputs

TheComplementarymodeisselectedforPWMI/OpinpairbysettingtheappropriateCPWMbitinPWMCON.Inthiscase,PSELisineffect.PWMHandPWMLwillcomefromPWM0generatorwhenPSELissettozero,whenthesignalsfromPWM1generatorisuseless,whereasPWMHandPWMLwillcomefromPWM1generatorwhenPSELissetto1,whenthesignalsfromPWM0generatorisuseless.IntheprocessofproducingthePWMoutputsinComplementaryMode,thedead-timewillbeinsertedtobediscussedinthefollowingsection.

Dead-timeControl

Dead-timegenerationisautomaticallyenabledwhenPWMI/OpinpairisoperatingintheComplementaryOutputmode.Becausethepoweroutputdevicescannotswitchinstantaneously,someamountoftimemustbeprovidedbetweentheturn-offeventofonePWMoutputinacomplementarypairandtheturn-oneventoftheothertransistor.The2-outputPWMmodulehasoneprogrammabledead-timewith8-bitregister.ThecomplementaryoutputpairforthePWMmodulehasan8-bitdowncounterthatisusedtoproducethedead-timeinsertion.AsshowninFigure8,thedeadtimeunithasarisingandfallingedgedetectorconnectedtoPWMsignalfromoneofPWMgenerator.ThedeadtimesisloadedintothetimeronthedetectedPWMedgeevent.Dependingonwhethertheedgeisrisingorfalling,oneofthetransitionsonthecomplementaryoutputsisdelayeduntilthetimercountsdowntozero.AtimingdiagramindicatingthedeadtimeinsertionforthepairofPWMoutputsisshowninFigure8a.

Fig8aDead-timeUnitBlockDiagram

Fig.8btheWaveformsofPWMOutputsinComplementaryMode

TheAT89S52isalow-power,high-performanceCMOS8-bitmicrocontrollerwith8Kbytesofin-systemprogrammableFlashmemory.ThedeviceismanufacturedusingAtmel’shigh-densitynonvolatilememorytechnologyandiscompatiblewiththeindus-try-standard80C51instructionsetandpinout.Theon-chipFlashallowstheprogrammemorytobereprogrammedin-systemorbyaconventionalnonvolatilememorypro-grammer.Bycombiningaversatile8-bitCPUwithin-systemprogrammableFlashonamonolithicchip,theAtmelAT89S52isapowerfulmicrocontrollerwhichprovidesahighly-flexibleandcost-effectivesolutiontomanyembeddedcontrolapplications.TheAT89S52providesthefollowingstandardfeatures:

8KbytesofFlash,256bytesofRAM,32I/Olines,Watchdogtimer,twodatapointers,

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2