ApplicationNote,V2.0,Sept.2005XC866OptimizedSpaceVectorModulationandOver-modulationwiththeXC866MicrocontrollersAP0803620Neverstopthinking.RevisionHistory:2005-09V2.0PreviousVersion:-PageSubjects(majorchangessincelastrevision)ManyUpdatedfortheXC866SWUpdatedfortheXC866,UsesDAvEandC/AssemblymixControllerAreaNetwork(CAN):LicenseofRobertBoschGmbHXC866WeListentoYourCommentsAnyinformationwithinthisdocumentthatyoufeeliswrong,unclearormissingatall?Yourfeedbackwillhelpustocontinuouslyimprovethequalityofthisdocument.Pleasesendyourproposal(includingareferencetothisdocument)to:mcdocu.comments@infineon.comEdition2005-09-01PublishedbyInfineonTechnologiesAG81726München,Germany©InfineonTechnologiesAG2006.AllRightsReserved.LEGALDISCLAIMERTHEINFORMATIONGIVENINTHISAPPLICATIONNOTEISGIVENASAHINTFORTHEIMPLEMENTATIONOFTHEINFINEONTECHNOLOGIESCOMPONENTONLYANDSHALLNOTBEREGARDEDASANYDESCRIPTIONORWARRANTYOFACERTAINFUNCTIONALITY,CONDITIONORQUALITYOFTHEINFINEONTECHNOLOGIESCOMPONENT.THERECIPIENTOFTHISAPPLICATIONNOTEMUSTVERIFYANYFUNCTIONDESCRIBEDHEREININTHEREALAPPLICATION.INFINEONTECHNOLOGIESHEREBYDISCLAIMSANYANDALLWARRANTIESANDLIABILITIESOFANYKIND(INCLUDINGWITHOUTLIMITATIONWARRANTIESOFNON-INFRINGEMENTOFINTELLECTUALPROPERTYRIGHTSOFANYTHIRDPARTY)WITHRESPECTTOANYANDALLINFORMATIONGIVENINTHISAPPLICATIONNOTE.InformationForfurtherinformationontechnology,deliverytermsandconditionsandpricespleasecontactyournearestInfineonTechnologiesOffice().WarningsDuetotechnicalrequirementscomponentsmaycontaindangeroussubstances.ForinformationonthetypesinquestionpleasecontactyournearestInfineonTechnologiesOffice.InfineonTechnologiesComponentsmayonlybeusedinlife-supportdevicesorsystemswiththeexpresswrittenapprovalofInfineonTechnologies,ifafailureofsuchcomponentscanreasonablybeexpectedtocausethefailureofthatlife-supportdeviceorsystem,ortoaffectthesafetyoreffectivenessofthatdeviceorsystem.Lifesupportdevicesorsystemsareintendedtobeimplantedinthehumanbody,ortosupportand/ormaintainandsustainand/orprotecthumanlife.Iftheyfail,itisreasonabletoassumethatthehealthoftheuserorotherpersonsmaybeendangered.AP0803620SpaceVectorModulation&Over-modulationIntroductionApplicationNote3V2.0,2005-091IntroductionThisApplicationNoteshowshowtheCAPCOM6modulefoundinmanyInfineon8,16and32-bitmicrocontrollerscanbeusedtoimplementspacevectormodulationforthree-phasevoltagecontrolinverterapplications.Asimplealgorithmforovermodulationisalsodemonstrated.ThealogorithmsofthisapplicationnoteareimplementedontheInfineonXC8668051based8-bitmicrocontroller.SpaceVectorModulation(SVM)isamethodofproducing3-Phasesinusoidalvoltages.TheprimaryuseforSVMisinmotorcontrolapplications(mainlyforinductionandbrushlessDCmotors).HoweverSVMcanalsobeusedinUninterruptiblePowerSupply(UPS)applications.SVMispopularbecauseitgenerateshighervoltageswithlowtotalharmonicdistortionthantraditionalsinusoidalPWMtechniques.AnotheradvantageofSVMisthatitworksverywellwithfieldoriented(vectorcontrol)schemesformotorcontrol.Figure1showsatypicalmotorcontrolapplicationwherethisApplicationNotecouldbeuseful.Figure1TypicalMotorControlApplication3-PhaseInverterDriver&IsolationMicrocontrollerwith3PhasePWMPeripheral(e.g.XC866)3-PhaseMotorSpeed/PostionFeedbackCurrentFeedbackAP0803620SpaceVectorModulation&Over-modulationSinusoidalVoltageGeneration&Capture/CompareUnitsApplicationNote4V2.0,2005-092SinusoidalVoltageGeneration&Capture/CompareUnitsThecapture/compareunitsofInfineon8,16&32-bitmicrocontrollers(CAPCOM6)aredesignedtocontrolmanytypesofmotors.Forcontrolling3-phasemotors,thecapture/compareunitcanbeusedtogeneratethe6PWMsignalsneededtodrivea3-phaseinverter,includingthenecessarydead-timeneededtoeliminateshoot-throughcurrentoneachphase.PWMcanbeusedtocreateasinusoidalvoltagebycreatingafixedfrequencysignalandadjustingthedutycycle.Ifthedutycyclevariessinusoidally,sowilltheoutputvoltage.ItisalwaysassumedthattheinductanceofthemotorwillfilterthePWMintoasmoothsignalasshowninFigure2.Figure2UsingPWMtoCreateSinusoidalVoltagesCapture/CompareunitsaredesignedtocreatevariabledutycyclePWMsignals.Actuallyitisonlythe“compare”featureofaCapture/CompareunitthatisusedforPWMgeneration.TheCapture/Compareunitcontainsatimerandseveralcompareregisters.Whenthetimervalueisthesameasthecompareregistervalue,anoutputpiniseitherpulledhighorlow.Sothedutycycleoftheoutputsignalfollowsthecomparevaluelinearly.TheCAPCOM6unithas3compareregistersandatimerthatcancountupfrom0toanyspecified16-bit“period”value.Whenthetimerreachestheperiodvalue,itreversesdirectionandcountsdownto0.ThisisusefulforgeneratingcenteralignedPWMasshowninFigure3.VoltageTimePWMOutputfromMicrocontrollerFilteredVoltageAP0803620SpaceVectorModulation&Over-modulationSinusoidalVoltageGeneration&Capture/CompareUnitsApplicationNote5V2.0,2005-09Figure3CenterAlignedPWMProducedtheCAPCOM6UnitToaidin3-phaseinvertercontrol,theCAPCOM6modulesarecapableofproducing6compareoutputs.Foreeachofthe3CompareChannelsthereare2outputpins.ThepinsareoftenlabeledCCxandCOUTx(wherex=0,1,2).Thepolarityofeachofthesixpinsisindividuallyprogrammabl