http46sw.com
46sw.com 时间:2021-04-08 阅读:(
)
FreescaleSemiconductor,Inc.
,2006.
Allrightsreserved.
FreescaleSemiconductorApplicationNoteAN2958Rev.
1,05/2006TableofContents1IntroductionTheenhancedtimeprocessingunit(eTPU)isaprogrammableI/Ocontrollerwithitsowncoreandmemorysystem,allowingittoperformcomplextimingandI/OmanagementindependentlyoftheCPU.
TheeTPUmoduleisaperipheralfornew32-bitdevicesontheindustrialandautomotivemarkets(currently,theColdFireMCF523xandPowerPCMPC5500families).
TheeTPUfeaturescanbeadvantageouslyappliedinvariousmotorcontrolapplications.
TheeTPUmoduleiscapableofhandlingmotorspeedandpositionsensing,closedloopcontrolofcurrent,speed,and/orposition,PWMmodulation,etc.
TheeTPUrunsindependentlyoftheCPU,makingtheCPUavailableforhigh-leveltasks.
WhentheeTPUisutilizedfortime-criticalmotorcontroltasks,itbecomesamotorcontrolcoprocessor.
FreescaleSemiconductorprovidesalibraryofmotorcontroleTPUfunctions.
ThelibraryconsistsofeTPUfunctions,whichserveasbuildingblocksforvariouseTPUapplications.
1Introduction.
12FunctionSetOverview23FunctionSetUsage.
54FunctionSetDescription85SummaryandConclusions23UsingtheDCMotorControleTPUFunctionSet(set3)CoverstheMCF523x,MPC5500,andalleTPU-EquippedDevicesby:MilanBrejlSystemApplicationEngineer,RoznovCzechSystemCenterUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetOverviewFreescaleSemiconductor2Thelibraryisdividedintwofunctionsets:DCmotorcontroleTPUfunctionsetACmotorcontroleTPUfunctionsetTheDCmotorcontroleTPUfunctionssetincludeseTPUfunctionsdedicatedtoDCandbrushlessDC(BLDC)motorcontrolapplications.
TheACmotorcontroleTPUfunctionsetisdedicatedtopermanentmagnetsynchronousmotors(PMSM)andACinductionmotors(ACIM).
ThisapplicationnoteisintendedtoprovideadescriptionoftheDCmotorcontroleTPUfunctionset.
2FunctionSetOverviewTheDCmotorcontroleTPUfunctionsetincludesthefollowingmotorcontroltechniques:GenerationofPWMsignalsDecodingofsignalsfromHallsensorsDecodingofsignalsfromashaftencoderCommutationofPWMphasesPositioncontrolSpeedcontrolTorque(current)controlDC-busbreakcontrolAmotorcontroldrivewhichutilizesseveralofthelistedtechniquescanbefullyhandledbytheeTPU.
TheDCmotorcontroleTPUfunctionsetconsistsof12eTPUfunctions:GPIO-generalpurposeinput/outputPWMMDC-PWMmasterforDCmotors—PWMF-PWMfullrange—PWMC-PWMcommutatedHD-halldecoderQD-quadraturedecoder—QD_Home-quadraturedecoderhome—QD_Index-quadraturedecoderindexASDC-analogsensingforDCmotorsCC-currentcontrollerSC-speedcontrollerBC-breakcontrollerTheeTPUfunctionsareconfigurableandadjustableusingvariousparametersandoptions,givingtheusertheabilitytocustomizethesefunctionstotheirspecificapplication.
FunctionSetOverviewUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor3ThefollowingparagraphsbrieflydescribethepurposeofeacheTPUfunctioninamotorcontrolapplication.
2.
1GeneralPurposeInput/Output(GPIO)ThisfunctionoriginatesfromthegeneraleTPUfunctionset(set1),andisincludedintheDCmotorcontroleTPUfunctionsetaswell.
ItcanbeassignedtoaneTPUchannelthatisnotusedbyanyothereTPUfunctions,inordertousetheassociatedpinforgeneralpurposes.
InmotorcontrolapplicationsontheMCF523xdevices,theGPIOfunctionscanbeusedtogenerateaninterruptonafault.
Thefaultsignal,whichisusuallyconnectedtotheeTPUoutputdisableinput,canbealsoconnectedtotheeTPUchannelassignedaGPIOfunction.
Whenthefaultsignalturnsactive,selectedoutputchannelsareimmediatelydisabledbytheeTPUhardware.
Atthesametime,theGPIOfunctiongeneratesaninterruptinordertonotifytheCPUaboutthefaultoccurrence.
2.
2DCMotorControlPWMGenerator(PWMMDCwithPWMForPWMC)ThePWMMDC,PWMF,andPWMCfunctionsenabletheeTPUtogeneratePWMsignalsforavoltagecontrolledinverter.
ThePWMmaster(PWMMDC)functionsynchronizesandupdatesuptothreePWMphases.
ThephasesmaybedriveneitherbythePWMfullrange(PWMF)functionthatenablesafull(0%to100%)duty-cyclerange,orbythePWMcommutated(PWMC)functionthatenablesswitchingthephaseONandOFF.
TheDCmotorcontrolPWMgeneratorcangenerateone,two,orthreePWMphases.
EachphasemayberepresentedbyasinglePWMchanneloracomplementarypairofPWMchannelswithdead-time.
Theoutputsignalpolarityisselectable,andbothedge-alignedandcenter-alignedPWMaresupported.
Additionaloptionsareavailableforspecialcommutationpatterns.
ThePWMduty-cycleiscontrolledbyaninputparameterwhosevaluecorrespondstothegeneratedvoltage.
Optionally,thephaseduty-cyclescanbesetdirectly.
Forafulldescriptionofallfeatures,referto"UsingtheDCMotorControlPWMeTPUFunctions,"AN2840.
2.
3HallDecoder(HD)TheHDeTPUfunctionisintendedtoprocesssignalsgeneratedbyHallsensorsinmotioncontrolsystems.
Itusesone,two,three,orfourchannelstodecodeHallsensorsignals,andtoproducepositionalanddirectionalinformationfortheCPU.
AHDmeasuresperiodsbetweendetectedHallsignaltransitions—revolutionperiodandsectorperiod—whichcanbeusedbythespeedcontrollerforactualmotionsystemspeedcalculation.
AHDalsoprovidestheusertheabilitytocommutatemotorphasesdrivenbythePWMCfunction.
Forafulldescriptionofallfeatures,referto"UsingtheDCMotorControlPWMeTPUFunctions,"AN2841.
UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetOverviewFreescaleSemiconductor42.
4QuadratureDecoder(QD,QD_Index,QD_Home)TheQDeTPUfunctionsareintendedtoprocesssignalsgeneratedbyashaftencoderinmotioncontrolsystems.
Itusestwochannelstodecodeapairofout-of-phaseencodersignalstoproducea24-bit,bi-directionalpositioncounter,togetherwithdirectionalinformation,fortheCPU.
AQDcountsdetectedtransitionsandstorestransitiontimes,whichcanbeusedbythespeedcontrollerfunctionforactualmotionsystemspeedcalculation.
Additionalinputchannelscanbealsoprocessed.
Theindexchannelreceivesapulseoneachrevolution.
Basedontheactualdirection,arevolutioncounterisincrementedordecrementedontheindexpulse.
Furthermore,additionalinputchannelcanindicateahomeposition.
Whenthispositionisreached,appropriateactionsaretaken(aresetofthepositioncounterandtherevolutioncounter).
Forafulldescriptionofallfeatures,referto"UsingtheQuadratureDecoder(QD)eTPUFunction,"AN2842.
2.
5AnalogSensingforDCMotors(ASDC)TheASDCfunctionisusefulforpreprocessinganalogvaluesthataremeasuredbyanADconverterandtransferredtotheeTPUdatamemorybyaDMAtransfer.
TheASDCfunctioncantriggertheADconverter,requesttheDMAtransfer,andsynchronizewithothereTPUfunctions.
Forafulldescriptionofallfeatures,referto"UsingtheAnalogSensingforDCMotors(ASDC)eTPUFunction,"AN2846.
2.
6CurrentController(CC)ThepurposeoftheCCfunctionistocontrolanothereTPUfunction'sinputparameter.
TheCCfunctionincludesaPIDcontrolleralgorithm.
Thecontrollercalculatesitsoutputbasedontwoinputs:ameasuredvalueandadesiredvalue.
ThemeasuredvalueisusuallyprovidedbytheASDCfunction,whichpreprocessesthemeasuredanalogvalues.
ThedesiredvaluecanbeprovidedbytheCPUoranothereTPUfunction.
IntheDCmotor-controleTPUfunctionset,thisfunctionmostlyprovidesthecurrent-closedloop.
TheCCcanbealsousedasageneralPIDcontroller;forexample,inpositionalclosedloop.
Forafulldescriptionofallfeatures,referto"UsingtheCurrentController(CC)eTPUFunction,"AN2844.
2.
7SpeedController(SC)ThepurposeoftheSCfunctionistocontrolanothereTPUfunction'sinputparameter.
TheSCfunctionincludesaPIDcontrolleralgorithm.
Thecontrollercalculatesitsoutputbasedontwoinputs:ameasuredvalueandadesiredvalue.
Themeasuredvalue—theactualmotorspeed—iscalculatedbasedoninputsprovidedbytheQDorHDfunctions.
Thedesiredvalueisanoutputofaspeedramp,whoseinputisaSCfunctionparameter,andcanbeprovidedbytheCPUoranothereTPUfunction.
IntheDCmotor-controleTPUfunctionset,thisfunctionmostlyprovidesthespeedclosedloopForafulldescriptionofallfeatures,referto"UsingtheSpeedController(SC)eTPUFunction,"AN2843.
FunctionSetUsageUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor52.
8BreakController(BC)TheBCfunctionisusefulforcontrollingtheDC-busbreak.
TheDC-busbreakisrequiredwhenamotorisdrivennotonlyinthemotoringmode,butalsointhegeneratingmode.
TheDC-busbreakswitchcanbecontrolledinanON/OFFmodeoraPWMmode.
Forafulldescriptionofallfeatures,referto"UsingtheBreakController(BC)eTPUFunction,"AN2845.
3FunctionSetUsageTheDCmotorcontroleTPUfunctionsetreleaseconsistsofthefollowingitems.
3.
1eTPUFunctionSourceCodeandBinaryImageTheeTPUfunctionsourcecodeandthecompiledbinaryimageareincludedinthefollowingpackage,whichisavailableontheFreescalewebsite(http://www.
freescale.
com/etpu):AN2958SW-DCmotorcontroleTPUfunctionsetsourcecodeandcompiledbinaryimageItisnotnecessaryfortheusertocompiletheeTPUfunctionsourcecode.
OnlyadvancedeTPUusersshouldmodifytheeTPUfunctionsandthenrecompile,usingtheByteCraftETPU_Ccompiler.
TheCPUapplicationneedstoloadthecompiledeTPUcodeintoeTPUCODERAM.
TheeTPUcodebinaryimageisincluded,togetherwithotherinitializationitems,intheetpu_set3.
hfile.
TheeTPUmoduleinitializationcanbehandledbythefs_etpu_init(.
.
.
)function,whichisoneofthestandardeTPUutilities(etpu_util.
c/.
h).
TheeTPUutilitiesareavailableontheFreescaleweb("GeneralCFunctionsfortheeTPU,"http://www.
freescale.
com/etpu,AN2864SW).
3.
2eTPUFunctionAPIsTheeTPUfunctionAPIsenabletheuseofeTPUfunctionsinapplications.
TheeTPUfunctionAPIsourcecodeisincludedinthefollowingpackages,whichareavailableontheFreescalewebsite(http://www.
freescale.
com/etpu):AN2840SW-PWMMDCwithPWMForPWMCeTPUfunctionsAPIAN2841SW-HDeTPUfunctionAPIAN2842SW-QDeTPUfunctionsAPIAN2843SW-SCeTPUfunctionAPIAN2844SW-CCeTPUfunctionAPIAN2845SW-BCeTPUfunctionAPIAN2846SW-ASDCeTPUfunctionAPITheeTPUfunctionAPIsincludeCPUmethodsthatdemonstratehowtoinitialize,control,andmonitortheeTPUfunction.
TheCPUapplicationdoesnotneedtoaccesseTPUchannelregistersand/orfunctionparametersdirectly.
Rather,theCPUapplicationcanusetheeTPUfunctionAPIsinstead.
UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetUsageFreescaleSemiconductor63.
3eTPUApplicationAPIsTheeTPUapplicationAPIsenabletheuseofeTPUasamotorcontrolcoprocessor.
TheeTPUapplicationAPIsourcecode,togetherwithexampledemoapplications,areincludedinthefollowingpackages,whichareavailableontheFreescalewebsite(http://www.
freescale.
com/etpu):AN2892SW-"BLDCMotorwithHallSensorsandSpeedClosedLoop"eTPUapplicationAPI,anddemotargetedatMCF523xAN2954SW-"BLDCMotorwithHallSensors,SpeedClosedLoopandDC-BusBreakControl"eTPUapplicationAPI,anddemotargetedatMCF523xAN2955SW-"DCMotorwithSpeedandCurrentClosedLoops"eTPUapplicationAPI,anddemotargetedatMCF523xAN2957SW-"BLDCMotorwithQuadratureEncoderandSpeedClosedLoops"eTPUapplicationAPI,anddemotargetedatMCF523xAsetofeTPUfunctionsconfiguredtocooperatetogetheriscalledeTPUapplication.
AneTPUapplicationAPIcapsulizesseveraleTPUfunctionAPIs.
TheeTPUapplicationAPIincludesCPUmethodswhichshowhowtoinitialize,control,andmonitoraneTPUapplication,andtoeasilyusetheeTPUasamotor-controlcoprocessor.
TheeTPUapplicationAPIisdeviceindependentandhandlesonlytheeTPUtasks.
WhereanADconvertorisusedtogetherwithaDMAtransfertodriveamotor,boththeADconverterandtheDMAmustbeinitializedseparately.
TheirinitializationisnotcoveredbytheeTPUapplicationAPI.
FunctionSetUsageUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor7Figure1.
eTPUProjectStructureEachofthereleaseitemsaboveisdescribedindetailbyanapplicationnote,whichhasacorrespondingnumberandisavailableontheFreescalewebsite(http://www.
freescale.
com/etpu).
ExamplesofcompleteeTPUinitializationcodecanbefoundinthedemoapplicationslistedin3.
3.
ThisinitializationcodewascreatedusingtheeTPUGraphicalConfigurationTool(eTPUGCT),whichisalsoavailableforfreeontheFreescalewebsite(http://www.
freescale.
com/etpu,ETPUGCT).
CPUCodeeTPUFunctionSourceCode,compiledbyByteCraftETPU_Cetpuc.
hetpuc_common.
hCodeGeneratedbyeTPUCompileretpu__auto.
hetpu_set3.
hetpuc_.
cetpuc_set3.
cetpu_util.
c/.
hetpu_struct.
hStandardeTPUUtilitiesetpu_.
c/.
heTPUFunctionAPIetpu_app_.
c/.
heTPUApplicationAPI_etpu_gct.
c/.
hUsereTPUInitializationCodeUserApplicationmain.
cInitializationMethods:my_system_etpu_init();my_system_etpu_start();Run-TimeMethodsRun-TimeMethodsAN2940-46SWgeneratedbyeTPUGCTtheonlycodewrittenbytheuserAN2892AN2954-57SWAN2864SWAN2958SWSoftwareLevelSourceCodeFilesOrigineTPUCodeUserwrittencodeFreescalesuppliedcodeGeneratedcodeByteCraftsuppliedcodeUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor84FunctionSetDescription4.
1eTPUFunctionInteractionsFigure2.
InteractionsBetweenDCMotorControleTPUFunctionsFigure2depictsallpossiblewaysofinteractionbetweentheDCmotorcontroleTPUfunctions.
MostoftheeTPUfunctionseithergenerateanoutputorprocessaninputsignal(BC,ASDC,PWMF,PWMC,HD,QDs).
Theotherfunctionsarededicatedtodataprocessingandsynchronization(PWMMDC,CC,SC,andalsoASDC).
4.
1.
1DataFlowThesolidlinesdepictdataflowbetweeneTPUfunctions.
TheBCfunctioninput,actualvalueofDC-busvoltage,canbeprovidedbytheASDC.
ThePWMMDCfunctionpassesPWMduty-cyclestoPWMForPWMCfunctions,whichgeneratePWMsignals.
ThePWMMDCinputisanappliedvoltage,whichcanbeprovidedbytheSCorCC.
WheretheCCfunctionisusedforacurrentclosedloop,theactualDC-buscurrentvalueisprovidedbytheASDC,andtherequiredvaluecanbeprovidedbytheSC,ordirectlybytheCPUintermofrequiredtorque.
Incasethecurrentclosedloopisnotused,SCprovidestheappliedvoltageforthePWMMDC.
TheSCrequiredspeedinputisprovidedbytheCPU,orbytheCCfunctionHDPWMCPWMFQDQD_IndexQD_HomeASDCBCPWMMDCSCCCrequiredtorqueappliedvoltagerequiredspeedrequiredpositionrequiredcurrentappliedvoltagerequiredspeedsector/revolutionperiodpositiondifference&timedifferencepositionpositionADCTriggerDC-BusBreakShaftEncoderHallSensorsMotorInverterDC-buscurrentDC-busvoltageCPUeTPUHardwareMotorInverterduty-cyclesCCcommutationFunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor9usedforpositionalclosedloopcontrol.
TheSCcalculatestheactualspeedusingeitheraHDparametersectorperiodorrevolutionperiod,orQDparametersposition-differenceandtime-difference.
IftheCCisusedforpositionalclosedloopcontrol,therequiredpositionvaluemustbeprovidedbytheCPU,whiletheactualpositionisreadfromeithertheHDorQD.
SeeFigure2.
4.
1.
2SynchronizationThewhitedottedlinesdepictsynchronizations.
Thereareseveraltypesofsynchronization.
ThePWMMDCfunctionsynchronizesandcoherentlyupdatesupto6PWMsignals,generatedbyeitherthePWMForPWMCfunctions.
TheASDCfunctioniscapableofstayingsynchronizedwiththePWMperiodframes,evenifthePWMperiodchanges.
Furthermore,theASDCfunctionisabletosynchronizeoneinnerloopandoneouter-loopcontroller.
Theinner-loopcontrollerisrequestedforanupdateeverytimetheASDCfunctionprocessesnewdata.
Theouter-loopcontrollerisrequestedforanupdateonceperadefinednumberofASDCupdates.
TheCC,SC,andBCcontrollerscanberuninmastermodeorslavemode.
Inmastermode,thefunctionexecutesitsupdatesperiodically,independentlyoftheotherfunctions.
Inslavemode,theupdatesareexecutedbyaneTPUlinksentfromanothereTPUfunction,usuallytheASDC,asdepictedinFigure2.
TheASDCfunctioncanberuninperiodicmodeorPWM-synchronizedmode.
Inperiodicmode,liketheCC,SC,andBCinmastermode,theASDCexecutesitsupdatesperiodically,independentoftheotherfunctions.
Insynchronizedmode,theASDCschedulesitsupdatessynchronouslywithPWMperiods.
TheeTPUlinksareusedforotherpurposesaswell.
TheCCorSCfunctionmaysendalinktothePWMMDCinordertonotifythatanewappliedvoltagevalueisready.
ThePWMMDCfunctionprocessesthenewvoltagevalue,resultinginnewphaseduty-cyclesandedgetimes,andsendsalinktoeachsubordinatePWMForPWMCfunction,toforcethemtoupdateonthenextPWMperiodedgetime.
4.
1.
3CommutationControlThelasttypeofinteractionbetweentheDCmotorcontroleTPUfunctionsisthecommutationcontrol.
TheHDfunctionisabletodrivecommutationsofthePWMphasesgeneratedbythePWMC.
4.
2eTPURequestsGeneratedtotheCPU4.
2.
1InterruptRequestMostoftheDCmotorcontroleTPUfunctionsgenerateaninterruptrequesttotheCPU.
Noapplicationwouldhandlealloftheseinterrupts.
ThoseinterruptswhichareusefultotheCPUapplicationcanbeenabledusingtheeTPUchannelinterruptenableregister(CIER).
Theotherinterruptsshouldstaymasked.
ThePWMMDCfunctionrequestsaCPUinterruptperiodicallyeachPWMperiod.
Inthedemoapplication,thisinterruptisusedtoactivatetheFreeMASTERrecorder.
Thankstothis,timebehaviorsofanyeTPUinternalvariablecanbetrackedanddrawnintheFreeMASTERrecorderwindowonaPC,withatimestepequaltoonePWMperiodlength.
UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor10TheCC,SC,andBCfunctionscanbeconfiguredtorequesttheCPUinterruptperiodically,onceperadefinednumberofupdates.
TheASDCfunctionrequestsaCPUinterruptperiodicallypriortoeachupdate.
ThisinterruptcanbeusedbytheCPUtopassdatafromanADconvertertoeTPUDATARAM,incaseaDMAtransferisnotutilized.
TheHDfunctionrequestsaCPUinterruptonceperdetectedHallsignaltransition.
TheQDfunctionrequestsaCPUinterruptiftheQDpositioncounterreachesoneoftwodefinedvalues.
TheGPIOfunction,ifconfiguredforaninput,requestsaCPUinterruptwhenadefinedtransitionisdetected.
4.
2.
2DMARequestSomeoftheDCmotorcontroleTPUfunctionsalsogenerateaDMArequest.
TheDMArequestswhichareusefultotheapplicationmustbeenabledusingtheeTPUchanneldatatransferrequestenableregister(CDTRER).
TheASDCfunctionrequestsaDMAtransferperiodicallypriortoeachupdate.
Dependingontheconfiguration,theDMAtransfercantriggeranADconverterortransfertheconvertedsampledatatotheeTPUDATARAM.
TheGPIOfunction,ifconfiguredforaninput,requestsaDMAtransferwhenadefinedtransitionisdetected.
4.
2.
3GlobalExceptionAlloftheDCmotorcontroleTPUfunctionsgenerateaglobalexceptionifthefunctionrunsintoanunhandledstate.
TheglobalexceptionisaglobaleTPUinterrupt,whichcanbeassertedinthefollowingways:eTPUcodeRAMmultipleinputsignaturecalculator(MISC)errorDetectionofanillegaleTPUinstructionGenerationbytheeTPUmicrocodeitselfThesourceoftheglobalexceptioncanbecheckedintheeTPUmoduleconfigurationregister(MCR).
Iftheglobalexceptionwasassertedbythemicrocode,theinterrupthandlerroutinemaydecodea32-bitwordlocatedattheeTPUdataRAMbaseaddress.
Thewordincludesadditionalinformationusefulinlocatingthesourceoftheerror.
FunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor11Figure3.
GlobalErrorDecoding4.
3eTPUTimingandEngineLoadTheeTPUfunction,ingeneral,isaneventdrivenstatemachine.
TheeTPUfunctionhandleseventscomingfromthechannelhardware(inputtransitionsandoutputmatches),fromanotherchannel(links),orfromtheCPU(hostservicerequests).
TheeTPUfunctionusestheeTPUenginetoexecutetheeventhandler.
AsthereareseveraleTPUfunctionsrunningsimultaneouslyoneTPUchannels,andonlyoneeTPUenginefor32channels,itmayhappenthatmanyeTPUchannelsrequestaserviceatthesametime.
BasedonthechannelprioritiesandeTPUscheduleralgorithm,onlyonechannelisgrantedaservice,whiletheotherchannelshavetowait.
Thewaitingtimeextendstheservicelatency.
Ifthelatencyistoolong,amalfunctionmayoccur.
TheworstcaselatencyofoneeTPUchannelisdependentupontheactivityontheothereTPUchannels.
ForaparticulareTPUconfiguration,ithastobeensuredthatnochannel'sworst-caselatencyislongerthenanallowablemaximum.
Thecalculationoftheworst-caselatenciesisnotatrivialtask.
AslightlyspecializedapproachcanbeusedforthemotorcontroleTPUapplications.
Themotorcontrolfunctions,ifusedinastandardmanner,followatimingschemewhichiseasytounderstand.
Basedonit,anaverageandapeakeTPUtimeloadcanbecalculated.
Ifthepeaktimeloadislowerthan100%,aproperfunctionoftheparticulareTPUconfigurationisensured.
4.
3.
1CalculationofeTPUTimeLoadinMotorControlApplicationsForcalculationoftheeTPUtimeload,performancevaluesofalltheeTPUfunctionsinuseareneeded.
Theperformancevaluesareincludedwiththefunctionsetrelease,inthereadme.
txtfile,andalsointheeTPUfunctionapplicationnotes.
eTPUfunctionperformanceisusuallyexpressedintermsofmaximumeTPU-busytimeperaspecifiedunit,ineTPUcycles.
Theunitcanbeexpressedasaparticulartimeperiod,alsoineTPUcycles,withknowledgeoftheapplication.
Then,aquotientofthesevaluesexpressesthecontributionoftheeTPUfunctiontotheoveralleTPUtimeload.
AsumofallactiveeTPUfunctioncontributionsgivestheaverageeTPUtimeload.
ThepeakeTPUtimeloadisusuallyachievedwhenalleTPUfunctionactivitieshappentocumulateinonePWMperiod.
ThemaximumeTPU-busytimesofallactiveeTPUfunctionsmustbesummedatfirst,andthendividedbythePWMperiod,expressedineTPUcycles.
TheresultisthepeakeTPUtimeload.
TransitionBLatchedTransitionALatchedMatchBLatchedMatchALatchedNotUsed111013120NotUsed31Bit:1615ChannelNumber798LinkServiceRequestLatchedUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor12ThefollowingexamplesshowacalculationofaverageandpeakeTPUtimeloadsforacoupleofparticularapplications.
4.
3.
1.
1Example1:BLDCMotorwithHallSensorsandSpeedClosedLoopTheapplicationrunsona150MHzColdFireMCF5235.
OnMCF523xdevices,theeTPUmoduleclockisequaltotheperipheralclock,whichisahalfoftheCPUclock,hence75MHz.
Note,thattheeTPUmoduleclockisequaltotheCPUclockonPowerPCMPC5500devices.
ThisapplicationutilizesthefollowingeTPUfunctions:PWMMDCwithPWMCHDSCThereadme.
txtfileoftheDCmotorcontroleTPUfunctionset,release1.
01,statesthefollowingperformancevalues:Funct.
|Modeofoperation|maxeTPUbusytimeper|eTPUcyclesPWMMDC|modulation:voltagesign/unsign|oneperiod|946with|update:normal|period-updatetime|216PWMC|numberofphases:3|Minimumupdatetime|816phases|phasestype:compl.
pairs|Longestthread|398HD|commutationprocessingenabled|onesector|308SC|Mastermode,HD,PIcontroller|oneupdate|244ThecontributionofthePWMMDCwithPWMCfunctionstotheoveralleTPUtimeload(CPWMMDC+PWMC)isdependentonthePWMperiod.
ThePWMperiod,ineTPUcycles,isequaltoaquotientoftheeTPUfrequency(75MHz)andPWMfrequency(20kHz).
ThecontributionoftheHDfunctiontotheoveralleTPUtimeload(CHD)isdependentonthesectorperiod.
Thesectorperiodisonesixthoftheelectricalrevolutionperiod.
Thenumberofmotorelectricalrevolutionsperonemechanicalrevolutionisgivenbythenumberofmotorpolepairs(4).
Theshortestmechanicalrevolutionperiodiscalculatedusingthemaximummotorspeed(10000rpm).
ThecontributionoftheSCfunctiontotheoveralleTPUtimeload(CSC)isdependentontheupdateperiod.
TheSCupdateisexecutedeverysecondPWMperiod.
TheSCupdatefrequencyis10kHz.
TheaverageeTPUtimeloadresultsin30%,whichisthesumofallactiveeTPUfunctioncontributions:CPWMMDCPWMC+94675MHz20kHz-0.
252==CHD30875MHz60()10000rpm64()-0.
016==CSC24475MHz10kHz-0.
033==eTPULoadaverageC=PWMMDCPWMC+C+HDCSC+0.
2520.
0160.
033++0.
301==FunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor13ThepeakeTPUloadcomesupinthesituationwheretheSCupdateandalsooneHDtransitionareprocessedwithinthesamePWMperiod,togetherwiththePWMgeneration:ThepeakeTPUtimeloadresultsin40%.
Thereisupto60%ofeTPUperformanceleftforadditionaltasks.
4.
3.
1.
2Example2:DCMotorwithShaftEncoder,SpeedandCurrentClosedLoopsTheapplicationrunsagainona150MHzColdFireMCF5235witha75MHzeTPUmoduleclock.
ThisapplicationutilizesthefollowingeTPUfunctions:PWMMDCwithPWMFQDSCCCASDCThereadme.
txtfileoftheDCmotorcontroleTPUfunctionset,release1.
01,statesthefollowingperformancevalues:Funct.
|Modeofoperation|maxeTPUbusytimeper|eTPUcyclesPWMMDC|modulation:voltagesign/unsign|oneperiod|854with|update:normal|period-updatetime|248PWMF|numberofphases:2|Minimumupdatetime|720phases|phasestype:compl.
pairs|Longestthread|286HD|commutationprocessingdisabled|onesector|56QD|Slow-PhaseA+PhaseB|oneencoderpulse|624||Longestthread|226|Normal-PhaseA+PhaseB|oneencoderpulse|672||Longestthread|244|Fast-PhaseA+PhaseB|oneencoderpulse|246||Longestthread|246SC|Slavemode,HD,PIcontroller|oneupdate|232CC|Slavemode,PIcontroller|oneupdate|138ASDC||one1stASDCedge|42|onesampleisprocessedonly|one2ndASDCedge|80eTPULoadpeak946308244++75MHz20kHz-0.
399==UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor14ThecontributionofthePWMMDCwithPWMFfunctionstotheoveralleTPUtimeload(CPWMMDC+PWMF)isdependentonthePWMperiod.
ThePWMperiod,ineTPUcycles,isequaltoaquotientofeTPUfrequency(75MHz)andPWMfrequency(20kHz).
ThecontributionoftheQDfunctiontotheoveralleTPUtimeload(CQD)isdependentonthenumberofshaftencoderpulses(1024)andthemotorspeed(maximum1800rpm).
ThecontributionoftheSCfunctiontotheoveralleTPUtimeload(CSC)isdependentontheupdateperiod.
TheSCupdateisexecutedevery10thPWMperiod.
TheSCupdatefrequencyis2kHz.
ThecontributionoftheCCfunctiontotheoveralleTPUtimeload(CCC)isdependentontheupdateperiod.
TheCCupdateisexecutedeveryPWMperiod.
TheCCupdatefrequencyis20kHz.
ThecontributionoftheASDCfunctiontotheoveralleTPUtimeload(CASDC)isdependentontheupdateperiod.
Duringanupdate,boththefirstandthenthesecondedgesareprocessed.
TheASDCupdateisexecutedeveryPWMperiod.
TheASDCupdatefrequencyis20kHz.
TheaverageeTPUtimeloadresultsin58%,whichisthesumofallactiveeTPUfunctioncontributions:ThepeakeTPUtimeloadcomesupduringthePWMperiodinwhichtheSCupdateisprocessed.
TheothereTPUfunctionsconsumeaconstanteTPUtimeeachPWMperiod,whiletheSCfunction,whoseupdateisexecutedevery10thperiod,consumesinthisperiod10-timesmorethanonaverage:ThepeakeTPUtimeloadresultsin64%.
InordertoensureanefficientusageofeTPUenginetime,andthecorrectfunctionalityoftheQD(whichmeansensuringthatallencodertransitionsarehandled),additionalcalculationsneedtobedone.
Thiswillbedescribedinthefollowingchapter.
4.
3.
2eTPUTimingConfigurationUptonow,eTPUaveragetimeloadandpeaktimeloadrelatingtoonePWMperiodhavebeendiscussed.
Now,thetimingwithinonePWMperiod,anditsconfiguration,willbeexplained.
MostoftheDCmotorcontroleTPUfunctions(SC,CC,BC,andASDC,inmastermode,aswellasPWMMDC)haveaparameterstartoffsetandaparameterperiod.
TheseparametersareusedtoCPWMMDCPWMF+85475MHz20kHz-0.
228==CQD67275MHz60()1800rpm1024()-0.
275==CSC23275MHz2kHz-0.
006==CCC13875MHz20kHz-0.
037==CASDC4280+75MHz20kHz-0.
033==eTPULoadaverageC=PWMMDCPWMF+C+QDCSCCCCC++ASDC+0.
2280.
2750.
0060.
0370.
033++++0.
579==eTPULoadpeakC=PWMMDCPWMF+C+QD10CSCCCCC++ASDC+0.
635=FunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor15synchronizethefunctions.
ThePWMMDCperiodparameterdefinesthePWMperiod.
TheSC,CC,BC,andASDCperiodsshouldbesettoanintegermultipleofthePWMperiod,inordertokeepallthefunctionssynchronized.
ThestartoffsetdefinesthetimefromthestartoftheeTPUtimebasestothefirstfunctionaction,whichisanupdateonCC,SC,andBC,firstedgeonASDC,andPWMperiodedgeonPWMMDC.
ThedifferencesbetweenthestartoffsetsofeachfunctiondeterminetherelativetimeshiftsbetweentheeTPUfunctionactions.
IftheSC,CC,orBCfunctionsruninslavemode,itsupdateisexecutedonalinkfromanotherchannel(usuallytheASDC),whichdeterminesthetiming.
IftheASDCfunctionrunsinPWM-synchronizedmode,itstimingisdeterminedbytheedgeoffsetparameter,whichdefinestheoffsetbetweenthePWMperiodedgetimeandtheASDCfirstedge.
ThereisaPWMMDCparameter,calledupdatetime,whichisveryimportantformotorcontroleTPUapplicationtiming.
TheupdatetimeisthetimeperiodneededtocoherentlyupdateallPWMphasesbynewduty-cyclevalues.
Iftheupdatetimeiscorrectlyset,andanewPWMMDCinputvoltageiswrittenbeforetheupdatetimepriortothePWMperiodend,thePWMphasesarecoherentlyupdated,applyingthenewdutycyclesfromthenextPWMperiod.
Ifthenewinputvoltageiswrittenlater,thePWMphasesarenotupdatedfromthenextPWMperiodbutfromthefollowingone.
TheminimumupdatetimeforeachconfigurationofPWMMDCwithPWMForPWMCiswritteninthetableofperformancevalues,includedwiththefunctionsetreleaseinthereadme.
txtfile.
ThisvaluecanbeappliedinthecasewhennoothereTPUfunctioncouldinterfereinthesequenceofupdatethreads.
TheeTPUfunctionsrunningsynchronouslywiththePWMperiods(SC,CC,BC,ASDC)canbeconfiguredtoexecuteinotherpartsofthePWMperiod,andhencenotinterfereinthePWMupdateprocess.
TheeTPUfunctionsrunningasynchronouslywiththePWMperiods(HD,QD)caninterfere,andtheeTPUupdatetimeneedstobeprolonged.
ThefollowingexamplesshowtheconfigurationofeTPUtimingforacoupleofparticularapplications.
4.
3.
2.
1Example1:BLDCMotorwithHallSensorsandSpeedClosedLoopLet'srecall,theapplicationutilizesthePWMMDCwithPWMC,HD,andSCeTPUfunctions.
ThePWMperiod,accordingto4.
3.
1.
1,is75MHz/20kHz=3750eTPUcycles.
Thereadme.
txtfileoftheDCmotorcontroleTPUfunctionset,release1.
01,statesthefollowingperformancevalues:Funct.
|Modeofoperation|maxeTPUbusytimeper|eTPUcyclesPWMMDC|modulation:voltagesign/unsign|oneperiod|946with|update:normal|period-updatetime|216PWMC|numberofphases:3|Minimumupdatetime|816phases|phasestype:compl.
pairs|Longestthread|398HD|commutationprocessingenabled|onesector|308SC|Mastermode,HD,PIcontroller|oneupdate|244UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor16Figure4.
Example1TimingDiagramAtfirst,thePWMupdatetimeshouldbecalculated.
Asstatedabove,theminimumupdatetimeis816eTPUcycles.
TheHDprocessing,whichisasynchronoustothePWMperiodframes,couldinterfereinthePWMupdate.
Hence:ThePWMupdatetimemustbesetto1124eTPUcycles,ormore.
NOTETheupdatetimeisnotassignedineTPUcycles,butinTCR1cyclesinthePWMMDCAPIinitializationroutine.
Formotorcontrolapplications,thefastestTCR1clock,whichishalfoftheeTPUclock,isrecommended.
Inthiscase,theupdatetimeis1124/2=562TCR1cycles.
ThePWMMDCstartoffsetdefinesthetimeofthefirstPWMperiodedge.
Itcouldbealmostanynumber,becauseit'snotthenumberitself,butthedifferencebetweenfunctionstartoffsets,thatdefinestheeTPUapplicationtiming,therelativepositionsbetweenfunctionactions.
Let'ssetthePWMMDCstartoffsetto20000eTPUcycles,whichis10000TCR1cyclesinthecaseofthefastestTCR1clockconfiguration:SCisrunninginmastermode.
TheSCperiodmustbesetasanintegermultipleofthePWMperiod.
TheSCstartoffsetdefinesthetimepositionoftheSCupdateexecution.
ItshouldbesetsothatthePWMMDCcantakeovertheupdatedappliedvoltagevalueatthePWMupdatetimepriortothePWMperiodend,evenintheworsttimingcase.
PWMperiodPWMupdatetimePWMMDCPWMCPWMCPWMCPWMCSCeTPUengineisbusyeTPUchannelisservicedchannelservicelatencylinkservicerequestbetweenchannelsPWMCPWMCHDHDHDSCstartoffsetPWMMDCstartoffsetupdate_timePWMMDC816≥308+1124eTPUcycles=start_offsetPWMMDC20000eTPUcycles=FunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor17Inordertoensurethis,let'scountalltheeTPUchannelactivitieswhichcouldappearinthisperiod:TheSCupdateitselftakes244eTPUcycles.
TheprocessingofthePWMMDCandPWMCfunctionscouldtakeupto216eTPUcycles.
TheHDprocessing,whichisasynchronoustothePWMperiodframes,couldinterfereanytimeandlasts308eTPUcycles.
TheSCstartoffsetmustbesetto21858eTPUcycles,orslightlyless,whichis10929TCR1cyclesincaseofthefastestTCR1clockconfiguration.
ItdefinesthepositionoftheSCupdateexecutionasslightlybeforethemiddleofthePWMperiodframe.
ThedescribedtimingconfigurationisshowninFigure4.
4.
3.
2.
2Example2:DCMotorwithShaftEncoder,SpeedandCurrentClosedLoopsLet'srecall,theapplicationutilizesthePWMMDCwithPWMF,QD,SC,CC,andASDCeTPUfunctions.
ThePWMperiod,accordingto4.
3.
1.
2,is75MHz/20kHz=3750eTPUcycles.
Thereadme.
txtfileoftheDCmotorcontroleTPUfunctionset,release1.
01,statesthefollowingperformancevalues:Funct.
|Modeofoperation|maxeTPUbusytimeper|eTPUcyclesPWMMDC|modulation:voltagesign/unsign|oneperiod|854with|update:normal|period-updatetime|248PWMF|numberofphases:2|Minimumupdatetime|720phases|phasestype:compl.
pairs|Longestthread|286HD|commutationprocessingdisabled|onesector|56QD|Slow-PhaseA+PhaseB|oneencoderpulse|624||Longestthread|226|Normal-PhaseA+PhaseB|oneencoderpulse|672||Longestthread|244|Fast-PhaseA+PhaseB|oneencoderpulse|246||Longestthread|246SC|Slavemode,QD,PIcontroller|oneupdate|312CC|Slavemode,PIcontroller|oneupdate|138ASDC||one1stASDCedge|42|onesampleisprocessedonly|one2ndASDCedge|80start_offsetSCstart_offsetPWMMDCperiod+PWMupdate_timePWMMDC244216308+++()eTPUcycles–≤start_offsetSC200003750+1124244216308+++()21858eTPUcycles=–≤UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor18Figure5.
Example2TimingDiagramAtfirst,thePWMupdatetimeshouldbecalculated.
Asstatedabove,theminimumupdatetimeis720eTPUcycles.
TheQDprocessing,whichisasynchronoustothePWMperiodframes,couldinterfereinthePWMupdate.
Thetimeofone1024-pulseshaftencoderpulse,atthemaximummotorspeed(1800rpm),is:TheQD,whilenotrunninginfastmode,process4transitionsperoneshaftencoderpulse.
Approximatelyevery610eTPUcycles(2441/4)onetransitionmustbeprocessed.
Therefore,amaximumoftwoQDtransitionscouldinterfereinthePWMupdate.
Thetwotransitionscantakeupto400eTPUcycles(244+(672-244)/3=approx.
400).
Hence:ThePWMupdatetimemustbesetto1120eTPUcycles,ormore,whichis560TCR1cycles,inthecaseofthefastestTCR1clockconfiguration.
ThePWMMDCstartoffsetcanbe,again,setto20000eTPUcycles,whichis10000TCR1cyclesinthecaseofthefastestTCR1clockconfiguration:TheASDCfunctionisrunninginPWMsynchronizedmode.
TheASDCfirstedge,whichistheADconvertortriggeredge,isalwaysscheduledrelativetothePWMperiodedge.
ThebestDC-buscurrentsamplingtimepointislocatedataquarterofthePWMperiod.
So,theedgeoffsetshouldbesetto:PWMperiodPWMupdatetimePWMMDCPWMCPWMCPWMCPWMCQDQDCCASDCSCmeasuretimeeTPUengineisbusyeTPUchannelisservicedchannelservicelatencylinkservicerequestbetweenchannelsPWMMDCstartoffsetmin_pulse_timeQD75MHz60()1800rpm1024()2441eTPUcycles==update_timePWMMDC720≥400+1120eTPUcycle=start_offsetPWMMDC20000eTPUcycles=edge_offsetASDCperiodPWM437504937eTPUcycles===FunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor19whichis468TCR1cyclesinthecaseofthefastestTCR1clockconfiguration.
TheASDCmeasuretimeisthetimeafterwhichtheconvertedsamplevalueisreadyineTPUDATARAM.
ItmustbesetaccordingtotheADconverterandDMAtransferconfiguration.
TheSCfunctionisrunninginslavemode.
TheSCupdatesareexecutedbylinkfromtheASDC,onthefirstASDCedge,everydefinednumberofPWMperiods.
TheCCfunctionisalsorunninginslavemode.
TheCCupdatesareexecutedbylinkfromtheASDC,onthesecondASDCedge,everyPWMperiod.
ThedescribedtimingconfigurationisshowninFigure5.
4.
3.
2.
3CheckingeTPUTimingUsinganOscilloscopeTheeTPUfunctionswhicharenotintendedtoprocessaninputoroutputsignal(SC,CC,PWMMDC)supportcheckingtheeTPUtimingusinganoscilloscope.
Thefunctionsturntheoutputpinhighandlow,sothatthehigh-timeidentifiesthetimeperiodinwhichaneventserviceisexecuted.
Generally,thesefunctionscanbeassignedtochannelswhicharenotconnectedtoanydevicepin,becausethegeneratedsignalsarenotneededtodriveamotor.
Butiftheyare,thegeneratedsignalscanbeusedtochecktheeTPUtimingfortheparticularapplicationusinganoscilloscope.
TheoscilloscopeshouldbesynchronizedwiththePWMperiodframes.
Thiscanbeachieved,forexample,bysettingatriggeronthesignalgeneratedbytheASDC.
IncasetheASDCisnotinuse,asignalgeneratedbytheSC,runninginmastermode,couldalsoserveasthetrigger.
ThesignalpulsegeneratedbytheCC,SC,orPWMMDC,determinestheperiodoftimeinwhichafunctioneventserviceisexecuted.
Thepulsewidthdeterminestheservicetime.
Thepulsewidthvariance,whichiswellseenonananalogoscilloscopeoradigitaloscilloscopewiththesignalenvelopefeature,determinestheservicetimevariance.
Thepulseposition,relativetothePWMperiodframes,determinestheeTPUapplicationtiming.
Ifthetimingisnotasdesired,thestartoffsetsshouldbecorrected.
Andfinally,thepulsepositionvariancedeterminestheservicelatencyvariance.
Thetimingcanbecheckedinvariousconditions:overthewholerangeofthemotorspeed,inafaultstate,inthecaseofactivityonothereTPUchannels,etc.
UsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor20Figure6.
OscilloscopeCheckofExample1ApplicationTimingFigure7.
OscilloscopeCheckofExample1ApplicationTiming—PulseVariancesPWMperiodPWMperiodPWMupdatetimeSCSCupdatePWMupdatetimePWMMDCPWMMDCtakesovernewappliedvoltagePWMMDCprovidescoherentupdateofallPWMphasesPWMMDCdoesnotupdatePWMphasesPWMMDCSCPWMperiodPWMperiodPWMupdatetimePWMupdatetimeFunctionSetDescriptionUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor21Figure8.
OscilloscopeCheckofExample2ApplicationTimingFigure9.
OscilloscopeCheckofExample2ApplicationTiming—PulseVariancesASDCSCCCPWMMDCPWMperiodPWMperiodPWMupdatetimemeasuretimeSCupdate,executedonASDCfirstedgeCCupdate,executedonASDCsecondedgePWMMDCtakesovernewappliedvoltagePWMMDCprovidescoherentupdateofallPWMphasesADCtriggeranalogsamplevaluepreprocessingPWMupdatetimeASDCSCCCPWMMDCPWMperiodPWMperiodPWMupdatetimePWMupdatetimeUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FunctionSetDescriptionFreescaleSemiconductor224.
3.
3SettingChannelPrioritiesPropersettingsofeTPUchannelprioritiescanimprovetheeTPUapplicationperformance.
InmotorcontroleTPUapplications,itisrecommendedtokeepthefollowingpriorityassignment:Prioritylow:SC,CC,BCPrioritymiddle:PWMMDCwithPWMCorPWMF,ASDCPriorityhigh:HD,QDTheHDfunctionshouldbeassignedthehighpriorityinordertoensureaminimumcommutationlatency.
IfHDistheonlyfunctionassignedthehighpriority,withinaparticulareTPUconfiguration,thenitisensuredthattheHDwillbegivenserviceimmediatelyafterthecurrentservice,ifany,hasfinished.
TheQDfunctionshouldbetheonlyfunctionassignedthehighpriorityinordertoachieveamaximumQDperformance,andenableeasycheckingofthemaximumallowedmotorspeed.
InnormalmodeofQDoperation,upto3otherfunctionthreadscouldinterferebetweentheQDthreadsduringoneencoderpulseprocessing.
InfastmodeofQDoperation,onlyoneotherfunctionthreadcouldinterfere.
ThelongestthreadofalltheDCmotorcontroleTPUfunctionstakes414eTPUcycles(PWMMDC),thesecondlongest334(SC),andthen160(CC)eTPUcycles.
Hence,intheworstcase(maximumallowedspeed),oneencoderpulseprocessingtakesuptoinnormalmode,andinthefastmodeofQDoperation.
Then,themaximummotorspeed,atwhichitisensuredthatallQDpulsesareprocessed,is:fornormalmodeofQDoperation,and:forfastmodeofQDoperation.
Let'senterthevaluesoftheeTPUmoduleclockandthenumberoftheshaftencoderpulsesfromexample2:TheQDfunctioncanoperateinnormalmodeuptoaspeedof2781rpm,whichshouldbesetasathresholdforswitchingtothefastmode.
Infastmode,itcanoperateuptoaspeedof6658rpm.
OnsomePowerPCMPC5500deviceswithtwoeTPUengines,abetterperformanceofQDcanbeachievediftheQDfunctionrunsontheothereTPUengine.
min_pulse_timeQDnormal672414334160++()+1580eTPUcycles==min_pulse_timeQDfast246414+660eTPUcycles==max_speedQDnormaleTPU_clock_freq60number_of_encoder_pulses1580=max_speedQDfasteTPU_clock_freq60number_of_encoder_pulses660=max_speedQDnormal75MHz6010241580-2781rpm==max_speedQDfast75MHz601024660-6658rpm==SummaryandConclusionsUsingtheDCMotorControleTPUFunctionSet(set3),Rev.
1FreescaleSemiconductor235SummaryandConclusionsThisapplicationnoteprovidestheuserwithadescriptionoftheDCmotorcontroleTPUfunctionset(set3),anditsusageinapplications.
References:eTPUGeneral:1.
"TheEssentialsofEnhancedTimeProcessingUnit,"AN2353.
2.
"GeneralCFunctionsfortheeTPU,"AN2864.
3.
EnhancedTimeProcessingUnitReferenceManual,ETPURM/D.
4.
eTPUGraphicalConfigurationTool,http://www.
freescale.
com/etpu,ETPUGCT.
eTPUFunctions:5.
"UsingtheGeneralPurposeInput/Output(GPIO)eTPUFunction,"AN2850.
6.
"UsingtheDCMotorControlPWMeTPUFunctions,"AN2840.
7.
"UsingtheHallDecoder(HD)eTPUFunction,"AN2841.
8.
"UsingtheQuadratureDecoder(QD)eTPUFunction,"AN2842.
9.
"UsingtheSpeedController(SC)eTPUFunction,"AN2843.
10.
"UsingtheCurrentController(CC)eTPUFunction,"AN2844.
11.
"UsingtheBreakController(BC)eTPUFunction,"AN2845.
12.
"UsingtheAnalogSensingforDCMotors(ASDC)eTPUFunction,"AN2846.
eTPUDemoApplications:13.
"BLDCMotorwithHallSensorsandSpeedClosedLoop,drivenbyeTPUonMCF523x,"AN2892.
14.
"BLDCMotorwithHallSensors,SpeedClosedLoopandDC-BusBreakController,drivenbyeTPUonMCF523x,"AN2954.
15.
"DCMotorwithSpeedandCurrentClosedLoop,drivenbyeTPUonMCF523x,"AN2955.
16.
"BLDCMotorwithQuadratureEncoderandSpeedClosedLoop,drivenbyeTPUonMCF523x,"AN2957.
17.
"BLDCMotorwithHallSensorsandSpeedClosedLoop,drivenbyeTPUonMPC5554,"AN3006.
18.
"BLDCMotorwithHallSensors,SpeedClosedLoopandDC-BusBreakController,drivenbyeTPUonMPC5554,"AN3007.
19.
"DCMotorwithSpeedandCurrentClosedLoop,drivenbyeTPUonMPC5554,"AN3008.
20.
"BLDCMotorwithQuadratureEncoderandSpeedClosedLoop,drivenbyeTPUonMPC5554,"AN3005.
HowtoReachUs:HomePage:www.
freescale.
comE-mail:support@freescale.
comUSA/EuropeorLocationsNotListed:FreescaleSemiconductorTechnicalInformationCenter,CH3701300N.
AlmaSchoolRoadChandler,Arizona85224+1-800-521-6274or+1-480-768-2130support@freescale.
comEurope,MiddleEast,andAfrica:FreescaleHalbleiterDeutschlandGmbHTechnicalInformationCenterSchatzbogen781829Muenchen,Germany+441296380456(English)+46852200080(English)+498992103559(German)+33169354848(French)support@freescale.
comJapan:FreescaleSemiconductorJapanLtd.
HeadquartersARCOTower15F1-8-1,Shimo-Meguro,Meguro-ku,Tokyo153-0064,Japan0120191014or+81354379125support.
japan@freescale.
comAsia/Pacific:FreescaleSemiconductorHongKongLtd.
TechnicalInformationCenter2DaiKingStreetTaiPoIndustrialEstateTaiPo,N.
T.
,HongKong+80026668080support.
asia@freescale.
comForLiteratureRequestsOnly:FreescaleSemiconductorLiteratureDistributionCenterP.
O.
Box5405Denver,Colorado802171-800-441-2447or303-675-2140Fax:303-675-2150LDCForFreescaleSemiconductor@hibbertgroup.
comInformationinthisdocumentisprovidedsolelytoenablesystemandsoftwareimplementerstouseFreescaleSemiconductorproducts.
Therearenoexpressorimpliedcopyrightlicensesgrantedhereundertodesignorfabricateanyintegratedcircuitsorintegratedcircuitsbasedontheinformationinthisdocument.
FreescaleSemiconductorreservestherighttomakechangeswithoutfurthernoticetoanyproductsherein.
FreescaleSemiconductormakesnowarranty,representationorguaranteeregardingthesuitabilityofitsproductsforanyparticularpurpose,nordoesFreescaleSemiconductorassumeanyliabilityarisingoutoftheapplicationoruseofanyproductorcircuit,andspecificallydisclaimsanyandallliability,includingwithoutlimitationconsequentialorincidentaldamages.
"Typical"parametersthatmaybeprovidedinFreescaleSemiconductordatasheetsand/orspecificationscananddovaryindifferentapplicationsandactualperformancemayvaryovertime.
Alloperatingparameters,including"Typicals",mustbevalidatedforeachcustomerapplicationbycustomer'stechnicalexperts.
FreescaleSemiconductordoesnotconveyanylicenseunderitspatentrightsnortherightsofothers.
FreescaleSemiconductorproductsarenotdesigned,intended,orauthorizedforuseascomponentsinsystemsintendedforsurgicalimplantintothebody,orotherapplicationsintendedtosupportorsustainlife,orforanyotherapplicationinwhichthefailureoftheFreescaleSemiconductorproductcouldcreateasituationwherepersonalinjuryordeathmayoccur.
ShouldBuyerpurchaseoruseFreescaleSemiconductorproductsforanysuchunintendedorunauthorizedapplication,BuyershallindemnifyandholdFreescaleSemiconductoranditsofficers,employees,subsidiaries,affiliates,anddistributorsharmlessagainstallclaims,costs,damages,andexpenses,andreasonableattorneyfeesarisingoutof,directlyorindirectly,anyclaimofpersonalinjuryordeathassociatedwithsuchunintendedorunauthorizeduse,evenifsuchclaimallegesthatFreescaleSemiconductorwasnegligentregardingthedesignormanufactureofthepart.
FreescaleandtheFreescalelogoaretrademarksofFreescaleSemiconductor,Inc.
Allotherproductorservicenamesarethepropertyoftheirrespectiveowners.
FreescaleSemiconductor,Inc.
2004.
Allrightsreserved.
AN2958Rev.
105/2006
搬瓦工vps(bandwagonhost)现在面向中国大陆有3条顶级线路:美国 cn2 gia,香港 cn2 gia,日本软银(softbank)。详细带宽是:美国cn2 gia、日本软银,都是2.5Gbps~10Gbps带宽,香港 cn2 gia为1Gbps带宽,搬瓦工是目前为止,全球所有提供这三种带宽的VPS(云服务器)商家里面带宽最大的,成本最高的,没有第二家了! 官方网站:https...
瓜云互联怎么样?瓜云互联之前商家使用的面板为WHMCS,目前商家已经正式更换到了魔方云的面板,瓜云互联商家主要提供中国香港和美国洛杉矶机房的套餐,香港采用CN2线路直连大陆,洛杉矶为高防vps套餐,三网回程CN2 GIA,提供超高的DDOS防御,瓜云互联商家承诺打死退款,目前商家提供了一个全场9折和充值的促销,有需要的朋友可以看看。点击进入:瓜云互联官方网站瓜云互联促销优惠:9折优惠码:联系在线客...
进入6月,各大网络平台都开启了618促销,腾讯云目前也正在开展618云上Go活动,上海/北京/广州/成都/香港/新加坡/硅谷等多个地区云服务器及轻量服务器秒杀,最低年付95元起,参与活动的产品还包括短信包、CDN流量包、MySQL数据库、云存储(标准存储)、直播/点播流量包等等,本轮秒杀活动每天5场,一直持续到7月中旬,感兴趣的朋友可以关注本页。活动页面:https://cloud.tencent...
46sw.com为你推荐
中老铁路一带一路的火车是什么火车psbc.com95580是什么诈骗信息不点网址就安全吧!www.228gg.comwww.a8tb.com这个网站该如何改善125xx.com高手指教下,www.fshxbxg.com这个域名值多少钱?sesehu.comwww.hu338.com 怎么看不到啊baqizi.cc和空姐一起的日子电视剧在线观看 和空姐一起的日子全集在线观看官人放题求日本放题系列电影,要全集越多越好,求给力莱姿蔓圣诗蔓有祛痘功效吗chudian365最近触电会的员工在抖音上好像挺火的,听说是触电会创始人龚文祥指导他们玩的弗雷德疯哈利波特大结局谁谁谁还是活的,谁死了???全部都要,只要出现的求大神帮助
国内免备案主机 秒解服务器 海外服务器 128m内存 卡巴斯基官方免费版 双线主机 hostloc vip购优惠 免费私人服务器 防cc攻击 华为k3 宿迁服务器 黑科云 云销售系统 葫芦机 nnt 重庆联通服务器托管 香港博客 湖南铁通 碳云 更多