您好,欢迎访问三七文档
2004MicrochipTechnologyInc.DS00957A-page1AN957INTRODUCTIONThedsPIC30F2010isa28-pin16-bitMCUspecificallydesignedforembeddedmotorcontrolapplications.ACInductionMotors(ACIM),BrushlessDC(BLDC)andDCaresometypicalmotortypesforwhichthedsPIC30F2010hasbeenspecificallydesigned.SomeofthekeyfeaturesonthedsPIC30F2010are:6independentor3complementarypairsofdedicatedMotorControlPWMoutputs.6input,500KspsADCwithupto4simultaneoussamplingcapability.Multipleserialcommunications:UART,I2C™andSPISmallpackage:6x6mmQFNforembeddedcontrolapplicationsDSPengineforfastresponseincontrolloops.InthisapplicationnotewediscusshowthedsPIC30F2010isusedtocontrolasensoredBLDCmotor.PleaserefertoAN901fordetailsonhowBLDCmotorsoperateandgeneralinformationonwhatneedstobedonetorunandcontrolBLDCmotors.ThisapplicationnotediscussesthespecificimplementationusingthedsPIC30F2010.IttouchesonlybrieflyonBLDCmotordetailsBLDCMOTORSBLDCmotorsarebasicallyinside-outDCmotors.InaDCmotorthestatorisapermanentmagnet.Therotorhasthewindings,whichareexcitedwithacurrent.Thecurrentintherotorisreversedtocreatearotatingormovingelectricfieldbymeansofasplitcommutatorandbrushes.Ontheotherhand,inaBLDCmotorthewindingsareonthestatorandtherotorisapermanentmagnet.Hencetheterminside-outDCmotor.Tomaketherotorturn,theremustbearotatingelectricfield.Typicallyathree-phaseBLDCmotorhasthreestatorphasesthatareexcitedtwoatatimetocreatearotatingelectricfield.Thismethodisfairlyeasytoimplement,buttopreventthepermanentmagnetrotorfromgettinglockedwiththestator,theexcitationonthestatormustbesequencedinaspecificmannerwhileknowingtheexactpositionoftherotormagnets.Positioninformationcanbegottenbyeitherashaftencoderor,moreoften,byHalleffectsensorsthatdetecttherotormagnetposition.Foratypicalthree-phase,sensoredBLDCmotortherearesixdistinctregionsorsectorsinwhichtwospecificwindingsareexcited.TheseareasshowninFigure1.FIGURE1:BLDCCOMMUTATIONDIAGRAMByreadingtheHalleffectsensors,a3-bitcodecanbeobtainedwithvaluesrangingfrom1to6.Eachcodevaluerepresentsasectoronwhichtherotorispresentlylocated.Eachcodevalue,therefore,givesusinformationonwhichwindingsneedtobeexcited.Thusasimplelookuptablecanbeusedbytheprogramtodeterminewhichtwospecificwindingstoexciteand,thus,turntherotor.Notethatstate‘0’and‘7’areinvalidstatesforHalleffectsensors.SoftwareshouldcheckforthesevaluesandappropriatelydisablethePWM.ChangeNotificationInputsTakingthistechniqueastepfurther,theHalleffectsensorscanbeconnectedtodsPIC30F2010inputsthatdetectachange(ChangeNotification(CN)inputs).Aninputchangeonthesepinsgeneratesaninterrupt.IntheCNInterruptServiceRoutine(ISR)theuserapplicationprogramreadstheHalleffectsensorvalueandusesittogenerateanoffsetinthelookuptablefordrivingthewindingsoftheBLDCmotor.Author:StanD’SouzaMicrochipTechnologyFIRING60oHALLRHALLYHALLBHALLSTATERYB546231546Q1,Q5Q1,Q6Q3,Q5Q1,Q5Q1,Q6Q2,Q6Q2,Q4Q3,Q4Q3,Q5SensoredBLDCMotorControlUsingdsPIC30F2010AN957DS00957A-page22004MicrochipTechnologyInc.MOTORCONTROLPULSEWIDTHMODULATION(MCPWM)Usingtheabovemethod,youcangetfullspeedrotationoftheBLDCmotor.However,togetvariablespeedoftheBLDCmotor,youmustapplyavariablevoltagetotheterminalsofthewindings.Puttingthisindigitalterms,thevariablevoltagecanbeobtainedbydifferentdutycyclesofaPWMsignalgoingtothewindingsoftheBLDCmotor.ThedsPIC30F2010hassixPWMoutputsthatcanbedrivenwiththePWMsignal.AsshowninFigure2,thethreewindingscanbedrivenONHigh,drivenONLowornotdrivenatallbyusingsixswitches,IGBTsorMOSFETs.Whenonelegofthewindingisconnectedforexample,tothehighside,thevariabledutycyclesignalPWMcanbeinjectedonthelowsidedriver.ThishasthesameeffectashavingaPWMsignalonthehighsideandconnectingthelowsidetoVSSorGND.WhendrivingthePWMsignal,lowsidedriversarepreferredoverhighsidedrivers.FIGURE2:BEMFSENSINGHARDWAREEXAMPLEPWMisprovidedbythedsPIC30F2010’sdedicatedMotorControl(MC)PWM.TheMCPWMmodulehasbeendesignedspecificallyformotorcontrolapplications.(PleaserefertoFigure3asyoufollowthisdiscussionoftheMCPWMmodule.)TheMCPWMhasadedicated16-bitPTMRtimebaseregister.Thistimerisincrementedbyauserdefinedclocktick,whichcanbeaslowasTCY.TheuseralsodecidestheperiodrequiredforthePWMbyselectingavalueandloadingitinthePTPERregisters.ThePTMRiscomparedtothePTPERvalueateveryTCY.Whenthereisamatch,anewperiodisstarted.Thedutycycleiscontrolledsimilarly,byloadingavalueinthethreedutycycleregisters.Unliketheperiodcom-pare,thevalueinthedutycycleregisteriscomparedateveryTCY/2interval(i.e.,twiceasfastastheperiodcompare).IfthereisamatchbetweenthePTMRvalueandthePDCxvalue,thenthecorrespondingdutycycleoutputisdrivenloworhighasdictatedbythePWMmodeselected.Thethreeoutputsfromthedutycyclecomparearechanneledtoacomplementaryoutputpairwhereoneoutputishighwhiletheotherislow,andviceversa.Thetwooutputscanalsobeconfiguredasindependentoutputs.Whendrivenascomplementaryoutputs,adeadtimecanbeinsertedbetweenthetimethehighlevelgoeslowandthelowlevelgoeshigh.ThisdeadtimeishardwareconfiguredandhasaminimumvalueofTCY.Deadtimeinsertionpreventsinadvertentshoot-thruinoutputdrivers.RBQ1Q3Q4Q6Y=VDCzzzz2004MicrochipTechnologyInc.DS00957A-p
本文标题:Sensored BLDC Motor Control Using dsPIC30F2010
链接地址:https://www.777doc.com/doc-3997223 .html