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
tmthosting怎么样?tmthosting家本站也分享过多次,之前也是不温不火的商家,加上商家的价格略贵,之到斯巴达商家出现,这个商家才被中国用户熟知,原因就是斯巴达家的机器是三网回程AS4837线路,而且也没有多余的加价,斯巴达家断货后,有朋友发现TMTHosting竟然也在同一机房,所以大家就都入手了TMTHosting家的机器。目前,TMTHosting商家放出了夏季优惠,针对VPS推...
digital-vm,这家注册在罗马尼亚的公司在国内应该有不少人比较熟悉了,主要提供VPS业务,最高10Gbps带宽,还不限制流量,而且还有日本、新加坡、美国洛杉矶、英国、西班牙、荷兰、挪威、丹麦这些可选数据中心。2020年,digital-vm新增了“独立服务器”业务,暂时只限“日本”、“新加坡”机房,最高也是支持10Gbps带宽... 官方网站:https://digital-vm.co...
之前几个月由于CHIA挖矿导致全球固态硬盘的价格疯涨,如今硬盘挖矿基本上已死,硬盘的价格基本上恢复到常规价位,所以,pacificrack决定对全系Cloud server进行价格调整,降幅较大,“如果您是老用户,请通过续费管理或升级套餐,获取同步到最新的定价”。官方网站:https://pacificrack.com支持PayPal、支付宝等方式付款VPS特征:基于KVM虚拟,纯SSD raid...
46sw.com为你推荐
金评媒朱江汪涵在沈阳7进5朱江和巩贺PK完说了句什么啊?摩拜超15分钟加钱首次 微信扫 摩拜单车 需要 付压金吗firetrap牛仔裤的四大品牌是那几个啊?同ip站点同ip站点很多有没有影响?同一服务器网站同一服务器上的域名/网址无法访问haokandianyingwang有什么好看的电影网站www.119mm.comwww.993mm+com精品集!www.vtigu.com如图,已知四边形ABCD是平行四边形,下列条件:①AC=BD,②AB=AD,③∠1=∠2④AB⊥BC中,能说明平行四边形lcoc.toptop weenie 是什么?bbs2.99nets.com让(bbs www)*****.cn进入同一个站
虚拟主机试用 上海域名注册 二级域名查询 抗投诉vps主机 联通c套餐 fdcservers 淘宝双十一2018 轻博 dropbox网盘 免费个人空间申请 卡巴斯基是免费的吗 google台湾 广州虚拟主机 cdn网站加速 可外链的相册 蓝队云 godaddyssl 服务器是什么 kosskeb4 免费论坛空间 更多