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

knownhost西雅图/亚特兰大/阿姆斯特丹$5/月,2个IP1G内存/1核/20gSSD/1T流量

美国知名管理型主机公司,2006年运作至今,虚拟主机、VPS、云服务器、独立服务器等业务全部采用“managed”,也就是人工参与度高,很多事情都可以人工帮你处理,不过一直以来价格也贵。也不知道knownhost什么时候开始运作无管理型业务的,估计是为了扩展市场吧,反正是出来较长时间了。闲来无事,那就给大家介绍下“unmanaged VPS”,也就是无管理型VPS,低至5美元/月,基于KVM虚拟,...

Spinservers美国圣何塞服务器$111/月流量10TB

Spinservers是Majestic Hosting Solutions,LLC旗下站点,主营美国独立服务器租用和Hybrid Dedicated等,数据中心位于美国德克萨斯州达拉斯和加利福尼亚圣何塞机房。TheServerStore.com,自 1994 年以来,它是一家成熟的企业 IT 设备供应商,专门从事二手服务器和工作站业务,在德克萨斯州拥有 40,000 平方英尺的仓库,库存中始终有...

cera:秋季美国便宜VPS促销,低至24/月起,多款VPS配置,自带免费Windows

介绍:819云怎么样?819云创办于2019,由一家从2017年开始从业的idc行业商家创办,主要从事云服务器,和物理机器819云—-带来了9月最新的秋季便宜vps促销活动,一共4款便宜vps,从2~32G内存,支持Windows系统,…高速建站的美国vps位于洛杉矶cera机房,服务器接入1Gbps带宽,采用魔方管理系统,适合新手玩耍!官方网站:https://www.8...

46sw.com为你推荐
空间邮箱QQ邮箱在哪里小度商城小度怎么下载app?杨紫别祝我生日快乐关于“致自己生日”的唯美句子有哪些?www.4411b.com难道那www真的4411B坏了,还是4411b梗换com鑫域明了巫正刚阿迪三叶草彩虹板鞋的鞋带怎么穿?详细点,最后有图解。高分求同ip网站同IP的两个网站,做单向链接,会不会被K掉??www.228gg.comwww.a8tb.com这个网站该如何改善m.kan84.net经常使用http://www.feikan.cc看电影的进来帮我下啊baqizi.cc孔融弑母是真的吗?45gtv.comLETSCOM是什么牌子?
英文域名 ip查域名 哈尔滨服务器租用 qq云存储 google镜像 vps.net 监控宝 tightvnc 阿里云浏览器 最好的免费空间 hkg 免费网页空间 睿云 万网服务器 九零网络 phpinfo windows2008 fatcow cx域名 zencart安装 更多