Home
AP32289 - XMC1000/XMC4000 - Position Interface(POSIF)
Contents
1. CCU40 MODULE PTR CCU40 CCU40 MODULE NUMBER OU CCU40 SLICEO PTR CCU40_CC40 CCU40 SLICEO NUMBER OU CCU40_SLICEO OUTPUT P1_0 Macros CCU80 MODULE PTR CCU80 CCU80 MODULE NUMBER OU CCU80 SLICEO PTR CCU80 CC80 CCU80 SLICEO NUMBER 0U CCU80 SLICEO OUTPUTOO PO O CCU80 SLICEO OUTPUTO1 PO 1 CCU80 SLICEO OUTPUTO2 PO 2 CCU80 SLICEO OUTPUTO3 PO 3 CCU80 SLICE1 PTR CCU80 CC81 CCU80 SLICE1 NUMBER lU CCU80 SLICE1 OUTPUT10 PO 7 CCU80 SLICE1 OUTPUT11 PO 6 CCU80 SLICE1 OUTPUT12 P0_5 CCU80 SLICE1 OUTPUT13 PO 4 Project Variables Definition volatile uint16_t PWMPATTERN 0 Application Note 37 Infineon V1 0 2015 07 Position Interface POSIF AP32289 Multi Channel Multi Phase Control 4 4 2 XMC Lib Peripheral Configuration Structure XMC System Clock Unit SCU Configuration PWM period is calculated based on PCLK which is eguivalent to 64 MHz XMC System Clock Unit SCU Configuration PWM period is calculated based on PCLK which is eguivalent to 64 MHz XMC SCU CLOCK CONFIG t clock config pclk src XMC SCU CLOCK PCLKSRC DOUBLE MCLK rtc src XMC SCU CLOCK RTCCLKSRC DCO2 fdiv 0 idiv 1 y XMC Compare Unit 4 CCU4 Configuration XMC Compare Unit 4 CCU4 Configuration XMC CCU4 SLICE COMPARE CONFIG t CCU40 SLICE config Infineon
2. prescaler mode XMC CCU4 SLICE PRESCALER MODE NORMAL prescaler initval uint32 t 5 in this case prescaler 2 5 float limit uint32 t O timer concatenation uint32 t 0 y XMC CCU4 SLICE EVENT CONFIG t start event0 config off time capture mapped input XMC CCU4 SLICE INPUT E CAPTURE on POSIFO OUTO edge XMC CCU4 SLICE EVENT EDGE SENSITIVITY RISING EDGE level XMC CCU4 SLICE EVENT LEVEL SENSITIVITY ACTIVE HIGH duration XMC CCU4 SLICE EVENT FILTER DISABLED XMC CCU4 SLICE EVENT CONFIG t capture event0 config off time capture mapped input XMC CCU4 SLICE INPUT F CAPTURE on POSIFO OUTl edge XMC CCU4 SLICE EVENT EDGE SENSITIVITY RISING EDGE level XMC CCU4 SLICE EVENT LEVEL SENSITIVITY ACTIVE HIGH duration XMC CCU4 SLICE EVENT FILTER DISABLED he XMC Position Interface Unit POSIF Configuration Configuration for POSIF Hall Sensor Mode Application Note 16 V1 0 2015 07 Position Interface POSIF AP32289 Triple Hall Commutation Control for 3 Phase motor XMC POSIF CONFIG t POSIF HALL config mode XMC POSIF MODE HALL SENSOR lt POSIF Operational mode input0 XMC POSIF INPUT PORT B lt Choice of input for Input 1 inputl XMC POSIF INPUT PORT A lt Choice of input for Input 2 input2 XMC POSIF INPUT PORT
3. Event Hall glitch vj OK Sy Correct Hall Error Wrong Hall Event Idle Stop Capture for LL LM lt Revolution i Monitoring lt Figure5 _ Triple Hall Input Samples Verification and Administration of Expected Samples z o Er o mple Trigger W Edge Aligned p gg E Lu Compare Mode Service 5 Next Hall Event o Request 1 Shadow Update a SR a 5 B Shadow Update Trigger i E Current 101 X01 O11 gt lt 010 TOO 100 7 T Expected 00T O11 gt lt O10 gt lt 110 100 TOT s T cc xpected x u y nat 2 n 3 n 4 mS o n oi ne n 5 i z Reference Hall Events gt V V CC4y By o Shadow Current Expected Samplen x n Transfer o 4 i m Capture Mode Trigger I e B p Z r O Sample Sample e E lt x o LL jam Ww gt AP32289_POSIF_02 vsd Application Note 8 V1 0 2015 07 face POSIF Tn Position Interface POSIF i O Cinfineon Triple Hall Commutation Control for 3 Phase motor 2 3 2 Administration Shadow Transfer of Pattern Compare Values On each successful Correct Hall Event CHE there is a Shadow Transfer of the next pattern compare values The compare registers Current Pattern HALP HCP and Expected Pattern HALP HEP are reloaded from the Currenta Expected shadow registers HALP HCPS HALP HEPS that are shadow up
4. Increment and prepare for the next PWM pattern PWMPATTERN Write new multichannel pattern XMC POSIF MCM SetMultiChannelPattern POSIF PTR PWMPATTERN 4 4 4 Main Function Implementation Before the start and execution of timer slice software for the first time the CCU4 must have been initialized appropriately in the following sequence e Clock setup Ensure clock frequency is set at 64MHz 2 MCLK XMC SCU CLOCK Init amp clock config e Enable clock enable pre scaler block and configure global control Enable clock enable prescaler block and configure global control XMC CCU4 Init CCU40 MODULE PTR XMC CCU4 SLICE MCMS ACTION TRANSFER PR CR XMC CCU8 Init CCU80 MODULE PTR XMC CCU8 SLICE MCMS ACTION TRANSFER PR CR Start the prescaler and restore clocks to slices XMC_CCU4 StartPrescaler CCU40 MODULE PTR XMC_CCU8 StartPrescaler CCU80 MODULE PTR Ensure fCCU reaches CCU40 CCU80 XMC CCU4 SetModuleClock CCU40 MODULE PTR XMC CCU4 CLOCK SCU XMC CCU8 SetModuleClock CCU80 MODULE PTR XMC CCU8 CLOCK SCU Application Note 40 V1 0 2015 07 Position Interface POSIF i AP32289 In In eon Multi Channel Multi Phase Control e Configure Slice s Functions Interrupts and Start up Configure CCU8x CC8y slice as timer XMC CCU4 SLICE CompareInit CCU40 SLICEO PTR amp CCU40 SLI
5. Figure7 Example Setup for POSIF in Hall Sensor mode to measure motor speed Application Note 12 V1 0 2015 07 Position Interface POSIF AP32289 Infineon Triple Hall Commutation Control for 3 Phase motor 1 Read the initial motor position Once the position is determined set Hall Input 1 up the current and expected hall patterns into the POSIF module Hall Input 2 1 2 Once the Hall pattern is setup start the motor application If the motor application is not directly Hall Input 3 controlled via the MCU a signal E could be given to the external motor application to synchronize HALP HCP 5 Ke X T x the starting 3 POSIFx OUTO is generated on detecting an input transition edge HALP HEP 1 x 3 a x i x i from the Hall input To reject noise at these points OUTO is connected y 3 to the CCU40 slice to start a timer POSIFx OUTO A The ST signal of this slice is E connected to the HSDA to delay the POSIFx OUT1 4 POSIF sampling PIFHP_CHE E 4 A correct Hall event is detected and generates a shadow update of CCU40 STO the next expected pattern A CHE event is triggered to update the Hall attern CCU40 Slice1 i y 5 A A j t ha EOAS 5 The OUT1 signal is used to 2 trigger a capture event on CCU40 Motor E slice 1 This captures the time Applicati
6. POSIFx MSET H A Multi channel mode multiple PWM signals modulation Figure1 POSIF module block diagram 1 1 Function selector The POSIF module has flexible configuration schemes In order to cover the complete range of motion control applications the Pin Connections have alternative functions which are activated dependent on the bitfield PCONF FSEL setup e 00 Hall Sensor Mode e 01 Quadrature Decoder Mode e 105 Stand alone Multi Channel Mode e 11 Stand alone Multi Channel amp Quadrature Decoder Mode Application Note 4 V1 0 2015 07 face POSIF Tn Position Interface POSIF i oe Cinfineon Introduction to POSIF 1 2 Hall Sensor mode The Hall Sensor Control Unit is used for direct control of brushless DC motors Features include a simple built in mode for brushless DC motor control a shadow register for the multi channel pattern and complete synchronization with the PWM signals and the multi channel pattern update The control unit provides an easy plug in for Motor Control application using Hall Sensors e 20r 3 Hall sensor topologies e Extended input filtering to avoid unwanted pattern switch due to noisy input signals e Synchronization with the PWM signals of the Capture Compare Unit e Active freewheeling synchronous rectification with dead time support link with Capture Compare Unit e Easy velocity measurement by using a Capture Compare unit Timer Slice 1 3 Quadrature Decode
7. Connect period match even to SRO MSETA CCU40 SLICEO PTR IRO ID COMPARE MATCH UP XMC CCU4 SLICE SR ID 0 t to SRI connect as input to MSYNC XMC CCU8 SLICE SetInterruptNode CCU80 SLICE1 PTR XMC CCU8 SLICE IRO ID PERIOD MATCH XMC CCU8 SLICE SR ID 1 Set NVIC priority NVIC SetPriority CCU40 0 IROn 3U Enable IRO NVIC EnableIRO CCU40 0 IROn Initializes the GPIO XMC GPIO Init CCU40 SLICEO OUTPUT amp CCU40 SLICE OUTPUT config XMC GPIO Init CCU80 SLICEO OUTPUTOO amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICEO OUTPUTO1 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICEO OUTPUTO2 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICEO OUTPUTO3 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICE1 OUTPUT10 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICE1 OUTPUT11 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICE1 OUTPUT12 amp CCU80 SLICE OUTPUT config XMC GPIO Init CCU80 SLICE1 OUTPUT13 amp CCU80 SLICE OUTPUT config e Configure POSIF in standalone Multi Channel Mode POSIF Configuration Standalone mode XMC POSIF Init POSIF PTR amp POSIF config XMC POSIF MCM Init POSIF PTR a
8. Enable Trigger i i i PIPxOUT6 e AS i 1 1 i i 1 i Multi Channel y le Pattern Multi i f f f i i 2 6x 0 Yr 6 Channel Pattern H T y l E PIFMST 4 Control 8 Input ooo o Interrupt A 2 Service A i Pattern Update _ Trigger LITH HN HT Ta 6x Pattern Output Multi channel Pattern Update Sync PIFXMSYNC D A AP32289_POSIF_02 vsd Figure 6 Application Note 10 Triple Hall BLDC Motor Commutation Control using CAPCOM units in Multi Channel mode V1 0 2015 07 face POSIF Tn Position Interface POSIF i O Cinfineon Triple Hall Commutation Control for 3 Phase motor 2 5 Example Use Case Using POSIF in Hall Sensor Mode to measure the speed of the motor This example uses the POSIF in Hall Sensor Mode to measure the speed of the connected 3 Phase motor The 3 Phase motor is driven using a selected motor control algorithm in this example a Space Vector Modulation algorithm using a DAVE PWM_SVM APP The hall inputs Hall1 P0 13 Hall2 P1 1 and Hall3 P1 0 are connected to the POSIF module POSIF OUTO provides a detection and delay stage for the inputs sampling after any edge detection This signal is connected to a CCU40 slice to start a 1us timer configured in single shot mode The status signal is connected to POSIF HSDA to delay the input sampling to reject noise that might appea
9. PSy Pattern Set request PSy H __ MCly Multi Channel Input Pattern MCly OUTy Output Pattern CC4yOUT i MC Input Pattern valid extended by 3 CCU4xSCLK Module Clocks CC4y x 0 3 Synchronization host y 0 3 OUTy Multi Channel i pa de R ee i x 0 POSIFX MSET H A Next Pattern i MOR PSL y N Update Set up true PSL is the PASSIVE ACTIVE Level b output control bit CC4yPSL PSL Lh PCONF MSES 0 EF Multi Channel Multi Channel POSIFx OUT6 Update Tri Pattern Update gt Mcss CCU40 pdate Trigger REUSS McME rae gt ccusi_Mcss yN Slice CC40 MCO POSIFx MSYNC D A ee gt CCU42 MOSS MRI o i UTO a AL true gt MCSS ccu43 Shen K Multi Channel MOM eee OUT Slice CC40 MCIO Pattern Update LI MSEO OUTO Synchronization l L MCI2 MCSS CCU80 ferl voer ES MCME1 2 22 sig gt D X Slice CC80 MCl00 MCI3 SW IN etn a Pattemn MSEO OUTOO e AL Lo y lucss ccust o i MOME1 2 2 np 2 ba MCSM MCMPS ps Wen T i i Em o SW MC Pattern Leone onan o WE Shadow E i i Transfer To Iaca o 1 1 E i i dn ESSEER a 1 i o bd Multi Channel E UU Pattern OUT y iw 1 WT fs A um w a Patternns X Pattern O gt F i POSIFx MOUT 15 0 E E AP32289 POSIF_04 vsd Figure 18 The POSIF to CCU Slices Multi Channel Pattern Transfer Profile Example Application Note 29 V1 0 2015 07 infir Position Inte
10. Infineon HALL INPUT SAMPLES CC4y External Start Stop Edge Aligned Compare Mode DETECTION amp DELAY CC4y In Capture Mode VERIFICATION amp ADMINISTRATION CCU4 8xMCSS CCU4 8xMCly CC4 8x Slices In Multi Channel Mode CCU4 8xPSy CCU4 8xOUTy OUTPUT PATTERN CONTROL Delayed Sample Current Position Expected Hall Event POSIF Hall Multi Channel Mode gt gt gt Hall Input 3 LSB Hall Input 2 Hall Input 1 MSB amp Timer 4 Hall Inputs Edge indis Detection Trigger Pattern Noise Rejection by delayed Hall elaia Inputs Sampling Status ST Delayed Bit Sampe Trigger V Hall Event yer Compare _ L Compare Trigger Me eh e PEA mmm 4 i Service r SR Next Hall Event a d l I Shadow Update s A a N 5 A Shadow Update Trigger i a Current lt 101 X 001 011 010 lt 110 100 i DOI KOT lt 1 lt lt 110 TOO TOT bet e Expected Ki ia a a E T n i nal n n 3 n n i Reference Hall Events i d z l E By Shadow i Current Expected Sample Transfer i o i gt Trigger El El p i i Sample Sample E de n n 0 Hall glitch y OK Capture for i Correct Hall Revolution
11. PWM1 MSYNC ke 4 Update Sync PS Eo Tu ur 4 n n n n n n 1711 S rs RE o 4 Viil O ZS fF 3f LP LP Lr to t r ll wl A A i Polarity1 POSIFx C 6 _ L174 CCU8x 1 I 1 1 i 1 PWM2 EX 16 fold J MOUT 9 Multi Channel MCI f i i Ny ey Pattern a alli Fi aa ee il li A wll pis FL 5 i Polarity2 Ele I unr iin AP32289_POSIF_04 vsd Figure 16 Multi Channel mode Use Cases 4 1 Principle of Operation The Multi Channel mode sub unit has an input and output port pair The input port pair is used for the Next Pattern Update Set and Synchronization The output port pair is used for the Pattern Update Request MCSS and Pattern Out for up to 16 CAPCOM slices This Hardware protocol provides the multi pattern flow that is required to support a maximum 16 fold channel phase control loop 4 1 1 Multi Channel Next Pattern Update Set Input An Update Set request by software or from a selected CAPCOM slice to one of the POSIFx MSET H A inputs will set if enabled a Flip Flop F F the MCMF MSS bit This bit is a Multi Channel Update Trigger that enables a Set Shadow Transfer Request for the POSIF Next Pattern Out and a MCSS for each CAPCOM slice involved 4 1 2 Multi Channel Pattern Update Synchronization Input After a Next Pattern Update Set has been asserted by setting the Multi Channel Update Trigger Flip Flop F F the pattern update can be synchronized wi
12. e Direction Count Mode The Direction Count Mode is used when the external encoder only provides a clock and a direction signal 3 1 1 Ouadrature Clock Generation Basics Each Ouadrature Clock Cycle is a 4 state 4 clocks pulse train that is generated by two phase shifted signals from a sensor pair A and B Since the state order determines which sensor is in the sense position of the leading phase each state transition is unigue for the motion direction clockwise or counterclockwise pL o E o Phase A Phase B 0 0 1 1 Guadrature clock Guadrature Cycle Clockwise AB 00 10 11 01 00 10 11 01 00 Quadrature Decoder States Counterclockwise AB 00 01 11 10 00 Ol 11 10 00 AP32289_POSIF_03 vsd Figure10 Standard Quadrate Clock Decoding Application Note 21 V1 0 2015 07 Position Interface POSIF AP32289 Ouadrature Decoder Infineon 3 1 2 Standard Quadrature Mode Position encoders that work in Standard Quadrature Mode provide two phase signals Phase A Phase B and encoders with or without an index top marker signal e Theinputs should be mapped to POSIFx INO D A POSIFx IN1 D A POSIFx IN2 D A e The output pins are POSIFx OUTO to POSIFx OUT5 for Quadrature Clock Direction Period Clock Index Occurrence Index revolution and
13. input falling edge a Multi Channel Pattern Shadow Transfer is performed to the POSIFx MOUT 15 0 output This pattern may control via the input MCly the output OUTy of all slices that are Multi Channel Mode Enabled by MCME and Slice Shadow Transfer Enabled globally by GCTRL MSEy Application Note 28 V1 0 2015 07 infir Position Interface POSIF AP32289 Infineon Multi Channel Multi Phase Control 4 1 5 POSIF to CCU Slices Multi Channel Pattern Transfer Synchronization A slice in Multi Channel Mode prolongs its status bit CCST by 3 module clocks to be valid even after a Pattern Set PS reguest has been asserted Therefore the OUTy operation of such a slice will include the requested Multi Channel Input Pattern MCly and CCST and so the POSIF to CCU Slices pattern transfer will be provided Example using a Top Level Before MC Update After MC Update CCU4xCCy Slice Interconnect Matrix Shadow Transfer Period Match Compare Timer TRy Counting Scheme Tae MA yd Here Edge Aligned counting up by CC4yTCLK clocks from Prescaler gt t lt A CCST O Status Bit CCST i Multi Channel Mode HW Protocol E E lt MCSS MC Set Shadow Transfer Request lt v lt PSy i
14. or Top Mark Detection ccccsssssssssssesssessseessecseecssecssecssecsseceeeserssereseeeenes 25 3 2 1 5 SynchronoUus Startai eiii Wedi eii T en FwR rae ar Rp K E EEKE Errei nnd RT EER 25 3 2 2 Motion Tracking plus Velocity Monitoring based on Ticks within Time T cccesecsseereeeeeees 26 3 2 2 1 Position Revolution Tracking cccesccssessssescesecseesscesecseeesceseceseesessecsecseseneesecseeeseeseceseeaeeas 26 3 2 2 2 Velocity based on elapsed Tick N T Profile 2 cccscesccsseeseesecsseeseeeecesesseeescesecseeereeseenes 26 4 Multi Channel Multi Phase Control scccsscssscsssccssccsscccsccccsccesccescccscscsscccsscesscesscess 27 4 1 Principleof Operaatio Msiri iE Y EE FD ef yen 27 4 1 1 Multi Channel Next Pattern Update Set INDUt cc ceccsesscssecseesseeseceseseeseceeeeseeeseseecseeeneneeenes 27 4 1 2 Multi Channel Pattern Update Synchronization INPUt eee cseeseeseeeeeceseeeceeesecaeeaeeeeeaeenenaees 27 4 1 3 Multi Channel Pattern Update Request Output ooccoccconcconoconanonanannnonnnonnnonn nono nono nono naco nconononnnons 28 4 1 4 Multi Channel Pattern Shadow Transfer and Pattern Output ccesecsseesceseeseeescesecseeeeeeseeaes 28 Application Note 2 V1 0 2015 07 oo Position Interface POSIF In fi neon AP32289 Table of Contents 4 1 5 POSIF to CCU Slices Multi Channel Pattern Transfer Synchronization 9 nn 29 4 2 Multi Channel Unit in Stand Alone
15. uint8 t HALL POSIF MCM 1 3 uint8 t HALL POSIF MCM 6 4 uint8 t HALL POSIF MCM 4 5 uint8 t HALL POSIF MCM 2 6 uint8 t HALL POSIF MCM 0 0 y uint32_t hall 3 0 0 0 uint32 t initialhallposition 0 uint32 t hallposition 0 uint32_t motorspeed onerev 0 Application Note 15 V1 0 2015 07 ifi Position Interface POSIF 1 AP32289 In In eon Triple Hall Commutation Control for 3 Phase motor 2 5 3 XMC Lib Peripheral Configuration structure XMC Compare Unit 4 CCU4 Configuration XMC Capture Compare Unit 4 CCU4 Configuration for Capture XMC CCU4 SLICE COMPARE CONFIG t delay config timer mode uint32_t XMC CCU4 SLICE TIMER COUNT MODE EA monoshot uint32_t true shadow_ xfer clear uint32 t 0 dither_timer period uint32 t 0 dither duty cycle uint32 t 0 prescaler mode uint32_t XMC CCU4 SLICE PRESCALER MODE NORMAL mcm enable uint32 t O prescaler_initval uint32_t 0 in this case prescaler 2 10 float_limit uint32_t 0 dither limit uint32 t O passive level uint32 t XMC CCU4 SLICE OUTPUT PASSIVE LEVEL LOW timer concatenation uint32 t 0 e Capture Slice configuration XMC CCU4 SLICE CAPTURE CONFIG t capture config fifo enable false timer clear mode XMC CCU4 SLICE TIMER CLEAR MODE ALWAYS Same event false ignore full flag true
16. 07 face POSIF Tn Position Interface POSIF i oe Cinfineon Multi Channel Multi Phase Control 4 2 2 Pattern Update Synchronization Inputs in stand alone mode After the Multi Channel Update Trigger request into Flip Flop F F has been set the pattern update can be synchronized with for example a PWM signal This signal should be mapped to one of the POSIFx MSYNC D A inputs selected by the PCONF MSYNS bitfield which will assert a synchronization event true upon a falling edge 4 2 3 Multi Channel Pattern Update Request Output in stand alone mode The POSIFx OUT6 output pin asserts a Multi Pattern Set Shadow Transfer Request Enable by its pulse to the MCSS inputs of all CAPCOM slices that are selected for Multi Channel Pattern Update in parallel This pulse is the Multi Channel Update Trigger Flip Flop F F status that will be cleared by hardware or software on Update Done 4 2 4 Multi Channel Pattern Shadow Transfer in stand alone mode Upon a POSIFx MSYNC D A input falling edge a Multi Channel Pattern Shadow Transfer is performed from the MCSM MCMPS shadow register to the POSIFx MOUT 15 0 register output pins This output register should be maintained by software and may be cleared at any time by software to stop for example PWM generating units Application Note 31 V1 0 2015 07 infir Position Interface POSIF AP32289 Infineon Multi Channel Multi Phase Control 4 3 Multi Channel Unit in Hall Sen
17. A lt Choice of input for Input 3 filter XMC POSIF FILTER DISABLED lt Input filter configuration XMC POSIF HSC CONFIG t POSIF HSC config disable idle signal 1 sampling trigger 0 HSDA sampling trigger edge 0 Rising edge he XMC GPIO Configuration XMC GPIO CONFIG t HALL POSIF 0 Hall PadConfig mode XMC GPIO MODE t XMC GPIO MODE INPUT TRISTATE XMC GPIO OUTPUT LEVEL t XMC GPIO OUTPUT LEVEL LOW output level e 2 5 4 Interrupt Service Routine Function implementation Infineon The Correct Hall Event CHE interrupt handler function updates the new Hall pattern and reads the captured speed of the motor from the CCU40 Slice 1 Note The processing of the captured speed is not discussed here as this depends on the implementation of the selected motor control algorithm For a typical closed loop system interpolation stages to convert the captured data in to the required data format of the motor control algorithm ar Interrupt handler to setup the next hall pattern and read the capture void POSIFO 0 IRQHandler void uint32 t capturedvalue0 uint32 t capturedvaluel uint32 t motorspeed Read the captured registered capturedvalue0 XMC CCU4 SLICE GetCaptureRegisterValue CAPTURE SLICE Pl capturedvaluel XMC CCU4 SLICE GetCaptureRegisterValue CAPTURE SLICE P1 Che
18. COUNT Period Clock Velocity Ces a s _ we Ae AB A BA BA 5 A COUNT PISHA moks OUT5 i Start MPARE Sync Start Flush e co 7 Start 4 Event Controlled Timer Slices CC4y Functions AP32289_POSIF_03 vsd Figure 15 Quadrature Decoder in Profile 2 Velocity based on Number of Ticks within a certain time T 3 2 2 1 Position Revolution Tracking Timer Slices CC40 41 Position and revolutions are tracked by COMPARE events as in the Profile 1 case 3 2 2 2 Velocity based on elapsed Tick N T Profile 2 Timer Slices CC42 43 The Ticks are counted by CC42 on the External Events Control function COUNT asserted by the Period clock events On CC43 period match Time T an event request is linked to Timer Slice CC42 which will CAPTURE and CLEAR on every negative ST edge so that the capture of N T counts is achieved Application Note 26 V1 0 2015 07 face POSIF Yn Position Interface POSIF 1 oe Cinfineon Multi Channel Multi Phase Control 4 Multi Channel Multi Phase Control A Multi Channel Control B Multi Phase Control C Rotation Monitoring amp Control Parallel Control of Output Pins by single pattern N Phase Power Supplies Tripple Hall Sensor Multi Pattern Control N Phase Motor Control pdate Req Bipolar Stepper with Micro Steps ser ke 8 Update Set MESS POSIFx CCU8x uc
19. Hall Commutation Control for 3 Phase motor Infineon 2 5 2 Macro and variable settings XMC Lib Project includes finclude lt xmc_ccu4 h gt include lt xmc_posif h gt include lt xmc_gpio h gt Project Macro definitions CCU4 Macros define MODULE PTR CCU40 define MODULE NUMBER OU define DELAY SLICE PTR ccu40_cc40 define DELAY SLICE NUMBER 0U define CAPTURE SLICE PTR CCU40_CC41 define CAPTURE SLICE NUMBER 1U POSIF Macros define POSIF PTR POSIFO Application Related Macros Fdefine HALL POSIF MCM EP CP uint32 t EP lt lt 3 uint32_t CP Fdefine ANGLE ONE DEGREE 46603U Fdefine ANGLE SEVEN DEGREF ANGLE ONE DEGREE 7 2 Project Variables Definition Hall pattern of the motor This depends on the type and make of the motor selected uint8_t hall pattern uint8 t HALL POSIF MCOM 0 0 uint8 t HALL POSIF MCM 3 1 uint8_t HALL POSIF MCM 6 2 uint8_t HALL POSIF MCM 2 3 uint8 t HALL POSIF MCM 5 4 uint8 t HALL POSIF MCM 1 5 uint8 t HALL POSIF MCM 4 6 uint8 t HALL POSIF MCM 0 0 uint8 t HALL POSIF MCM 0 0 uint8 t HALL POSIF MCM 5 1 uint8 t HALL POSIF MCM 3 2
20. Multi Channel Pattern A Multi Channel Pattern Update Enable Set MNPS is set to CCU80 OUTOO synchronize the update with the P0 0 PWM CCU80 CC81 CCU80 OUTO1 3 At CCU81 period match the PO 1 new Multi Channel Pattern is loaded This is used to synchronize CCU80 OUTO2 the update of the multi channel PO 2 pattern with the shadow transfer CCU80 0UTO3 The new Multi Channel Pattern is P0 3 used to modulate with the CCU8 output gee 4 Only MOUT O is 1 and i CCU80 0UTO0 output is available CCU80 OUT11 P0 6 5 Only MOUT 1 is 1 and L CCU80 OUTO1 output is available CODODD 6 Only MOUT 0 and MOUT 1 PO 5 are 1 CCUSO OUTOO and CCU80 OUTO1 outputs are e E z i available A ee E eee Application Note 36 Figure 23 Example Using Stand alone Multi Channel mode to modulate PWM signals V1 0 2015 07 Position Interface POSIF AP32289 Multi Channel Multi Phase Control 4 4 1 Macro and variable Settings XMC Lib Project includes include include finclude finclude include lt xmc_ccu4 h gt lt xmc ccu8 h gt lt xmc gpio h gt lt xmc posif h gt lt xmc_scu h gt Project Macro definitions POSIF Macros define POSIF PTR POSIFO CCU4 define define define define define CCU8 define define define define define define define define define define define define define define Macros
21. SCU Global Start Control signal The PWM frequency and duty cycle on the CCU4 and CCU8 slices are 20 kHz and set at 50 It is targeted for the XMC1300 device Synchronously start all CC40 and CC80 slices using SCU GSC signal MSETA SRO CCU40 Slice 0 ST Compare Match ISR Config Edge Aligned 14 Updates the new multichannel pattern POSIF Function Set new Stand alone Multi Channel pattern Multi Channel Mode CCU80 N 4 Slice 0 U Config Edge Aligned 4 Slice 1 CCU80 PS1 MOUTIZO Multi channel pattern gt Config Edge Aligned 727 Function Used for Multi Channel y signal generation MSYNC A Figure 22 Example Setup for Stand alone Multi Channel mode to modulate PWM signals Application Note 35 V1 0 2015 07 Position Interface POSIF AP32289 Multi Channel Multi Phase Control Infineon CCU80 CC81 PMUS PWM_PATTERN MCM MCMP Period SLICE Configuration XMC1300 cv1 System Clock 64 MHz CV2 CCU4 and CCU8 are configured with the same configuration CCU40 CC40 CMUS 2 Frequency 20 kHz CV1 CV2 50 Duty Cycle Mode Edge aligned Counting up 1 CCU4 and CCU8 slices are started synchronously on external event 1 from a rising edge of SCU GSC40 SCU GSC80 2 CCU4 compare match interrupt on SRO is triggered A new SCU GSC40 PWM_PATTERN is written to the SCU GSC80 Shadow
22. and period measurements for new velocity calculations 3 2 1 5 Synchronous Start Timer Slice CC43 By using the Synchronous Start signal a START or FLUSH START reguest can be asserted to synchronize a timer start with the POSIF start This signal occurs when the POSIF Run Bit is set The CC43 should be set for the External Events Control function START or FLUSH START by extended start Application Note 25 V1 0 2015 07 face POSIF Tm Position Interface POSIF i oe Cinfineon Quadrature Decoder 3 2 2 Motion Tracking plus Velocity Monitoring based on Ticks within Time T This is Motion Monitoring Profile 2 Ticks should be understood as Period clocks and T as certain Time T intervals by Time Stamp This velocity monitoring method assumes that the time between the Ticks is negligible due to the high speed level Now the CC42 43 has exchanged CAPTURE COMPARE tasks Zero Mark Index Phase A Phase B POSIFx Standard Quadrature Decoder Mode OUTO CAPCOM Unit CCU4x Typical Profile 2 Ls Count Quadrature Clock Position Pos E COUNT Pos 141 4141 1 1 1 1 1 1 OUT1 Li Yu CC40 Direction Up E ar UP DOWN COMPARE Down OUT4 UP DOWN Index Revolution ae 5 CC41 Y COUNT COMPARE OUT3 Capture Index Occurrence Slip bol Clear 4 CLEAR CAPTURE an Reset CC42 CLEAR i ouT2 kf ate
23. ay timer mode uint32 t XMC CCU4 SLICE TIMER COUNT MODE EA monoshot uint32 t false shadow_xfer clear uint32 t O dither timer period uint32 t 0 dither duty cycle uint32 t O prescaler mode uint32 t XMC CCU4 SLICE PRESCALER MODE NORMAL mcm enable uint32 t 0 prescaler initval uint32 t O float limit uint32 t O dither limit uint32 t O passive level uint32 t XMC CCU4 SLICE OUTPUT PASSIVE LEVEL LOW timer concatenation uint32 t 0 y XMC CCU4 SLICE EVENT CONFIG t CCU40 SLICE event0 config mapped input XMC CCU4 SLICE INPUT I mapped to SCU GSC40 edge XMC CCU4 SLICE EVENT EDGE SENSITIVITY RISING EDGE level XMC CCU4 SLICE EVENT LEVEL SENSITIVITY ACTIVE HIGH duration XMC CCU4 SLICE EVENT FILTER 3 CYCLES y XMC Compare Unit 8 CCU8 Configuration XMC CCU8 configuration structure XMC CCU8 SLICE COMPARE CONFIG t CCU80 SLICE config timer_mode uint32 t XMC CCU8 SLICE TIMER COUNT MODE EA monoshot uint32 t XMC CCU8 SLICE TIMER REPEAT MODE REPEAT shadow_xfer clear OU dither timer period 0U dither duty cycle OU Application Note 38 V1 0 2015 07 Position Interface POSIF i AP32289 In In eon Multi Channel Multi Phase Control prescaler mode uint32 t XMC CCU8 SLICE PRESCALER MODE NORMAL mcm chl enable 1U mcm
24. between 2 correct Hall event i e pplication seul Figure8 Example Setup for POSIF in Hall Sensor mode to measure motor speed Application Note 13 V1 0 2015 07 face POSIF Yn Position Interface POSIF oe Cinfineon Triple Hall Commutation Control for 3 Phase motor 2 5 1 Theory of Operation The setup of the POSIF module makes the assumption that the Hall pattern of the motor is available The motor application is not started before the initial position of the motor is set up Once the starting Hall pattern is determined the motor application can be started Thereafter the control of the motor is based on the selected motor control algorithm In our example we used a Space Vector Modulation algorithm The captured speed of the motor is interpolated into speed and angle inputs to be used in a PI controller The output is then interpolated before using space vector modulation to drive the motor sm Initialize the CCU4 and POSIF module Start POSIF i mr Read port pins for initial motor Hall position Read the port pins that are connected for the initial motor position With this input the current state of motor can be setup Setup the initial current and expected Hall pattern Start motor application Figure9 Program Flow Initialization Application Note 14 V1 0 2015 07 Position Interface POSIF AP32289 Triple
25. ch2 enable 10 slice status uint32 XMC CCU8 SLICE STATUS CHANNEL 1 passive level out0 uint32 XMC CCU8 SLICE OUTPUT PASSIVE LEVEL LOW t t uint32_t XMC CCU8 SLICE OUTPUT PASSIVE LEVEL LOW t t Passive level outl passive level out2 uint32 XMC CCU8 SLICE OUTPUT PASSIVE LEVEL LOW XMC CCU8 SLICE OUTPUT PASSIVE LEVEL LOW passive level out3 uint32 asymmetric pwm Ur invert_out0 Vi invert_outl invert_out3 prescaler initval float limit 0 0 1 invert_out2 OU 1 0 0 dither limit 0 0 timer concatenation XMC CCU8 SLICE EVENT CONFIG t CCU80 SLICE event0 config mapped input XMC CCU8 SLICE INPUT H Connected to SCU GSC80 edge XMC CCU8 SLICE EVENT EDGE SENSITIVITY RISING EDGE level XMC CCU8 SLICE EVENT LEVEL SENSITIVITY ACTIVE LOW duration be XMC CCU8 SLICE EVENT FILTER DISABLED XMC Position Interface Unit POSIF Configuration Configuration for POSIF Multi Channel Mode XMC_POSIF CONFIG t POSIF config mode XMC_POSIF MODE MCM lt POSIF Operational mode input0 XMC POSIF INPUT PORT A lt Choice of input for Input 1 inputl XMC POSIF INPUT PORT A lt Choice of input for Input 2 input2 XMC POSIF INPUT PORT A lt Choice of input for Input 3 filter XMC POSIF FILTER DISABLED
26. lt Input filter configuration y Configuration for POSIF Multi Channel Mode update settings XMC POSIF MCM CONFIG t POSIF MCM config pattern sw update uint8 t false pattern update trigger XMC POSIF INPUT PORT A CCU40 SRO pattern trigger edge XMC POSIF HSC TRIGGER EDGE RISING pwm sync uint8 t XMC POSIF INPUT PORT A CCU80 PS1 y XMC GPIO Configuration XMC GPIO Configuration P1_0 XMC GPIO CONFIG t CCU40 SLICE OUTPUT config 1 T Application Note 39 V1 0 2015 07 Position Interface POSIF i AP32289 In In eon Multi Channel Multi Phase Control mode XMC GPIO MODE OUTPUT PUSH PULL ALT2 input hysteresis XMC GPIO INPUT HYSTERESIS STANDARD output level XMC GPIO OUTPUT LEVEL LOW y Configuration for standard pads Port0 0 7 XMC GPIO CONFIG t CCU80 SLICE OUTPUT config mode XMC GPIO MODE OUTPUT PUSH PULL ALT5 input hysteresis XMC GPIO INPUT HYSTERESIS STANDARD output level XMC GPIO OUTPUT LEVEL LOW be 4 4 3 Interrupt Service Routine Function Implementation The CCU40 interrupt handler function updates the new multi channel pattern CCU40 Compare Match ISR for the new multi channel pattern void CCU40 0 IRQHandler void Acknowledge CCU4 compare match event XMC CCU4 SLICE ClearEvent CCU40 SLICEO PTR XMC CCU4 SLICE IRO ID COMPARE MATCH UP
27. oc nn YH HR Fn Honno 38 4 4 3 Interrupt Service Routine Function Implementation coccocncoonconnnonnnonnnonnnononononononononoconncnnnonos 40 4 4 4 Main Function IMpleMentation cccccscessscsseesecssecssecssecssssesssseseseeessesesaeesaeecssecsaecsaeceasesseenes 40 5 Revision HiStO MY siccssscccsasccsecsseccsescecscaiccedcceccesedecedeesseusescasiccdasssccasasocssosesceseacseceaccecesens 43 Application Note 3 V1 0 2015 07 face POSIF cafn Position Interface POSIF i oe Cinfineon Introduction to POSIF 1 Introduction to POSIF A POSIF is a universal Position Interface unit When used in conjunction with the CAPCOM units CCU4 and CCU8 POSIF offers powerful solutions for motion control systems that use various position sensors or rotary encoders in the feedback loop This enables the building of both simple and complex control feedback loops for industrial and automotive motor applications targeting high performance motion and position monitoring POSIFx Module Function Interrupt selector control Quadrature decoder control x4 clock generation multiple loop profiles POSIFx IN1 D A filtering and error detection POSIFx IN2 D A Address decode Hall sensor control input filtering POSIFxX OUTIS 0 programmable delays link for velocity measurement POSIFx INO D A Device Connections System POSIFx HSDIB A clock lt 4 control POSIFx EWHE D A
28. 1 lt Event Error Monitoring l d Wrong Hall Event Idle Stop Multi Pattern Sync Trigger Shadow Transfer lt Enable Trigger Z a ll oe AE PIFxOUT6 _ Multi Channel Y j A AA Pattern Multi 6x A o Channel Pattern i i 5 PIFMST Control amp Input 7 ee o Interrupt eee i A Service i i i f 1 L 1 1 1 o Pattern Update Ll l f f j f f al Trigger 6x Pattern Output Multi channel Pattern Update Sync PIFxMSYNC D A AP32289_POSIF_04 vsd Figure 21 Triple Hall BLDC Motor Commutation Control using CAPCOM units in Multi Channel mode Application Note 34 V1 0 2015 07 P Interface POSIF ne osition Interface POSIF i ae Cinfineon Multi Channel Multi Phase Control 4 4 Example Use Case Using Stand alone Multi Channel mode to modulate PWM signals This example uses the POSIF in stand alone Multi Channel mode to modulate PWM signals It uses a CCU4 slice CCU40 CC40 to update a new pattern on compare match interrupt The pattern is incremented by 1 each time a compare match is entered and written to the POSIF Multi Channel mode shadow pattern register The update is not immediate but is triggered from CCU80 CC81 PS1 for the update This synchronizes the update pattern with the modulated PWM signals The CCU4 and CCU8 slices are configured to synchronously start on an external event 1 from
29. 1 0 2015 07 Position Interface POSIF i AP32289 In In eon Triple Hall Commutation Control for 3 Phase motor e Set the initial motor position read the IO on P0 13 1 0 1 1 hall 0 XMC GPIO GetInput P0 13 hall 1 XMC GPIO GetInput P1 0 hall 2 XMC GPIO GetInput Pl 1 hallposition uint32 t hall 0 hall 1 lt lt 1 hall 2 lt lt 2 initialhallposition hallposition use the hall pattern XMC POSIF HSC SetHallPatterns POSIF PTR hall pattern hallposition XMC POSIF HSC UpdateHallPattern POSIF PTR hallposition XMC POSIF HSC GetExpectedPattern POSIF PTR XMC POSIF HSC SetHallPatterns POSIF PTR hall pattern hallposition Once the initial motor position is determined the motor application can be started If a DAVE APP is used the appropriate API can be used to start the motor application Otherwise depending on the application a hand shaking signal such as a GPIO or UART command can be issued to the motor to initiate the starting seguence Application Note 20 V1 0 2015 07 face POSIF Yn fir Position Interface POSIF ann Cinfineon Quadrature Decoder 3 Quadrature Decoder 3 1 Principle of Operation Inside the Quadrature Decoder Mode there are two different sub sets available e Standard Quadrature Mode The standard mode is used when the external rotary encoder provides two phase signals and an index marker signal that is generated once per shaft revolution
30. CE config XMC CCU8 SLICE CompareInit CCU80 SLICEO PTR amp CCU80 SLICE config XMC CCU8 SLICE CompareInit CCU80 SLICE1 PTR amp CCU80 SLICE config Set period match value of the timer XMC CCU4 SLICE SetTimerPeriodMatch CCU40 SLICEO PTR 3199U XMC CCU8 SLICE SetTimerPeriodMatch CCU80 SLICEO PTR 3199U XMC CCU8 SLICE SetTimerPeriodMatch CCU80 SLICE1 PTR 3199U Set timer compare match value for channel 50 of period XMC_CCU4 SLICE SetTimerCompareMatch CCU40 SLICEO PTR 1600U XMC CCU8 SLICE SetTimerCompareMatch CCU80 SLICEO PTR XMC CCU8 SLICE COMPARE CHANNEL 1 1600U XMC CCU8 SLICE SetTimerCompareMatch CCU80 SLICEO PTR XMC CCU8 SLICE COMPARE CHANNEL 2 1600U XMC CCU8 SLICE SetTimerCompareMatch CCU80 SLICE1 PTR XMC_CCU8_SLICE_COMPARE CHANNEL 1 1600U XMC CCU8 SLICE SetTimerCompareMatch CCU80 SLICE1 PTR XMC_CCU8_SLICE_COMPARE CHANNEL 2 1600U Transfer value from shadow timer registers to actual timer registers XMC CCU4 EnableShadowTransfer CCU40 MODULE PTR uint32 t XMC CCU4 SHADOW TRANSFER SLICE 0 XMC CCU8 EnableShadowTransfer CCU80 MODULE PTR uint32 t XMC CCU8 SHADOW TRANSFER SLICE O XMC CCU8 SHADOW TRANSFER SLICE 1 Configure events XMC CCU4 SLICE C
31. CU8 POSIF offers powerful solutions for motion control systems that use position sensors in the feedback loop The POSIF Hall Sensors Decoder is one of its main sub units dedicated for 3 Phase motors Example Current Position AP32289_POSIF_02 vsd Figure 2 BLDC Motor Control with Triple Hall Commutation Application Note 6 V1 0 2015 07 ifi Position Interface POSIF H AP32289 In In eon Triple Hall Commutation Control for 3 Phase motor 2 1 Triple Hall Input Pattern The Hall Sensor Decoder mode operates in four successive stages e The Hall Input Samples stage for the commutation signals e The Detection and Delay stage for input sampling after any edge transition e The Verification and Administration stage of expected Hall Patterns The Output Pattern Control and hardware protocol Delayed Sample POSIF Current Expectedn Hall Multi Channel it Hall Event Mode gt Hall Input 3 LSB gt Hall Input 2 HALL INPUT SAMPLES gt Hall Input 1 MSB AP32289_POSIF_02 vsd Figure3 Triple Hall Input Samples stage for a BLDC Motor Commutation Control 2 2 Delayed Hall Input Sampling The sampling of each Hall Input pattern can be delayed a certain time after an input transition edge is detected in order to reject noise that might appear at these positions The Input Edge Detection ou
32. Decoder in Profile 1 Velocity based on Time within a certain number of Ticks 3 2 1 1 Position Tracking Timer Slice CC40 The position information of an object in motion is asserted respectively by the e External Events Control functions COUNT and UP DOWN on the Quadrature Clock edge events e Direction level events Position tracking is achieved by using the COMPARE facilities and watching the status flag ST 3 2 1 2 Revolution Tracking Timer Slice CC41 The update of each entirely elapsed revolution is asserted respectively by the e External Event Control functions COUNT and UP DOWN on the Index Revolution edge events e Direction level events Application Note 24 V1 0 2015 07 face POSIF Tn Position Interface POSIF i ann Cinfineon Quadrature Decoder A trigger for a certain number of revolutions can be achieved with a present COMPARE register value 3 2 1 3 Velocity based on elapsed Time T N Timer Slices CC42 43 The Ticks are asserted to CC42 by the External Events Control function COUNT on the Period Clock edges On COMPARE match N counts an event request for CAPTURE of Time T is linked to Timer Slice CC43 which will FLUSH START on the falling ST edge event request by each CC42 period match 3 2 1 4 Index Z Mark or Top Mark Detection Timer Slice CC42 By using the Index Occurrence Signal a CLEAR reguest can be asserted at the 1st or each time this signal occurs to for example reset the time
33. Infineon XMC1000 XMC4000 32 bit Microcontroller Series for Industrial Applications Position Interface POSIF AP32289 Application Note About this document Scope and purpose This application note provides a brief introduction to the key features of the Position Interface POSIF modules some typical application examples and some usage hints Intended audience Experienced engineers who wish to develop motor control applications with the XMC microcontroller family Applicable Products e XMC1000 e XMC4000 e DAVE References The User s Manual can be downloaded from http www infineon com XMC DAVE and its resources can be downloaded from http www infineon com DAVE V1 0 1 2015 07 face POSIF Tm Position Interface POSIF i oe Cinfineon Table of Contents Table of Contents Aboutthis COCUMENE cccsceseceesssessecescecccesssceccsesscessocessvecceesscecssassecssdoecssessebescesesasescssseedscesesessnsasenes 1 Table Of Contents ic ccccscccecccsctecsctcsscdscceeseescccessecccussccacssecdcccesesccsesecssccsestacscdesesdsccsasececdessseccoessccasses 2 1 Introduction to POSIF ccccscccssccssccssccsscccsccccscecscecsccsscccscccssccesssescsessssscsccsscsccesseesees 4 1 1 Function selecto oss ccsaee Staves cecacvarsecessnadecesceyeccavens decacenvercadaavtecetestaeceuanvdecedcauseaasa sa DAFYDD FR a E a ii 4 1 2 HlalllSensor mhod amp iii ride a a 5 1 3 Quadrature Decoder MOd8 c coooccccncc
34. MOde ccccssesscesecsseescesecseesesseceeesessecaecseeeeeesecaesenesseesasensesees 30 4 2 1 Next Pattern Update Set Inputs in stand alone mode ooconococccoccccncononononnnonacononnnonncn nono nonncnnnnnos 30 4 2 2 Pattern Update Synchronization Inputs in stand alone mode ceseesseesceeeeeescesecsteseesaeenee 31 4 2 3 Multi Channel Pattern Update Request Output in stand alone mode cococonoccnonononoconnconnnnns 31 4 2 4 Multi Channel Pattern Shadow Transfer in stand alone mode 9 99 9999999 99 9cm nn 31 4 3 Multi Channel Unit in Hall Sensor MOdeC cesecssesscssecsseeseesecsseeseeseceeeeseesecaecseeeceaecaeseeeeaecneeenseeees 32 4 3 1 Next Pattern Update Set Inputs in Hall Sensor MOde escssesssesscsseeseseeceseeseeescssecsteseeeaeeaes 32 4 3 2 Pattern Update Synchronization Inputs in Hall Sensor Mode ooocococcccccononacononononncononononncnonnos 33 4 3 3 Multi Channel Pattern Update Request Output in Hall Sensor MOde cococononcnonoconoconnconnonos 33 4 3 4 Multi Channel Pattern Shadow Transfer in Hall Sensor MOdEC cesecssessceeeeeescesecseeeeeeseenes 33 4 4 Example Use Case Using Stand alone Multi Channel mode to modulate PWM signals 35 4 4 1 Macro and variable Settings cssssscssscssesssesscssessessecssecseeecesecseseeesecseeeseseeceaseseeseceaecaeeeneeaeeaes 37 4 4 2 XMC Lib Peripheral Configuration Structure ooooccoccnococnconcnononnnonocnnonnnonncn nono ronca
35. NF ODCM 1 e Theinputs should be mapped to POSIFx INO D A POSIFx IN1 D A e The output pins are POSIFx OUTO 1 5 for Clock Direction Sync Start INO 7 Position Clock Nd Direction Information l i POSIFx i 1 External Event Up to 3 Event Function Target Quadrature Encoder Event Source Profiles Select of Inputs Timer Mode Sources Select Edge or Level Select Slice Module Clock NS L Star OUTS GPO sam FI J stop ush i EROI J capture 0 1 Start POSIF _ capture 2 3 Up OUT1 CAN 7 2 gate clock p i Direction Info ccu4x 7 ta up down Down L J ll e E load Timer j abd al count OUTO W ADC ql override bit Count Position Clock CCU8x trap 41 ai i u 4 3 Events dul scu 4 Control Matrix pega Period Clock N A Event Controlled Timer CC4 8x Functions Index Z Mark N A AP32289_POSIF_03 vsd Figure 13 POSIF in Direction Count mode Application Note 23 V1 0 2015 07 face POSIF Tn Position Interface POSIF i ann Cinfineon Quadrature Decoder 3 2 Motion Monitoring profiles The Quadrature Decoder is dedicated for motion profile monitoring Assume 2 different connection profiles with a POSIFx unit and 4 Timer Slices CC40 41 42 43 of a CAPCOM4 Several motion monitoring functions can be performed in parallel in each profile to cover a va
36. SHA TA UNIX of X Open Company Limited VERILOG PALLADIUM of Cadence Design Systems Inc VLYNQ of Texas Instruments Incorporated VXWORKS WIND RIVER of WIND RIVER SYSTEMS INC ZETEX of Diodes Zetex Limited Last Trademarks Update 2014 07 17 www infineon com Edition 2015 07 Published by Infineon Technologies AG 81726 Munich Germany 2015 Infineon Technologies AG All Rights Reserved Do you have a question about any aspect of this document Email erratum infineon com Document reference AP32289 Legal Disclaimer THE INFORMATION GIVEN IN THIS APPLICATION NOTE INCLUDING BUT NOT LIMITED TO CONTENTS OF REFERENCED WEBSITES IS GIVEN AS A HINT FOR THE IMPLEMENTATION OF THE INFINEON TECHNOLOGIES COMPONENT ONLY AND SHALL NOT BE REGARDED AS ANY DESCRIPTION OR WARRANTY OF A CERTAIN FUNCTIONALITY CONDITION OR QUALITY OF THE INFINEON TECHNOLOGIES COMPONENT THE RECIPIENT OF THIS APPLICATION NOTE MUST VERIFY ANY FUNCTION DESCRIBED HEREIN IN THE REAL APPLICATION INFINEON TECHNOLOGIES HEREBY DISCLAIMS ANY AND ALL WARRANTIES AND LIABILITIES OF ANY KIND INCLUDING WITHOUT LIMITATION WARRANTIES OF NON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY WITH RESPECT TO ANY AND ALL INFORMATION GIVEN IN THIS APPLICATION NOTE Information For further information on technology delivery terms and conditions and prices please contact the nearest Infineon Technologies Office www infineon com
37. Synchronous Start The Quadrature clock gives position up down count information in conjunction with the Direction signal The Period clock contains sequences of AB or BA pulse pairs for velocity detection The Index Occurrence pin asserts Z mark Index on QDC ICM conditions whilst the Index revolution asserts only once per revolution Synchronous Start output POSIFx OUTS is linked with the module run bit can be used together with the CAPCOM units for a complete synchronous start if those CAPCOM units have been preset for External Events Control External Start and Extended Start for Start for example or Flush Start IN2 Zero Mark Index a E LINO ma Phase A E atl l i pl wIN1 N _ o i i POSIFx i T Standard Quadrature r E rt Decoder Mode F Capture oe OUTS CAPCOM Unit CCU4x 8x Clear M Index Signal Occurrence External Event Up to 3 Event Function Target E aur Event Source Profiles Select of Inputs Timer Count Bs Index revolution Sources Select Edge or Level Select Slice Rev rt I E Fl fk JE a OUT1 GPIO JN l Ea Up Direction SSE J capture 0 1 Down m x 7 al capture 2 3 po 1 OUTO CAN 7 28 gate a Count Guadrature Clock position ccU4
38. TECTION amp DELAY CC4y In Capture Mode VERIFICATION amp ADMINISTRATION CCU4 8xMCSS CCU4 8xMCly Ge Slices n Multi Channel Mode CCU4 8xPSy CCU4 8xOUTy OUTPUT PATTERN CONTROL POSIF Hall Multi Channel Mode Hall Input 3 LSB gt i i s Compare of 4 ir gt Hall Input 2 gt Hall Input 1 MSB Hall Inputs Edge Mn Detection Trigger Paten Noise Rejection by delayed Hall H3 H2 H1 Inputs Sampling Status ST Delayed Bit gt Sampie Trigger V Hall Event MY FHRDYT y Compare i l _ L Compare Trigger N a e HI j Service r SR Next Hall Event l l Request 4 Shadow Update 3 SR a irq E i A Shadow Update Trigger i a Current lt 101 X lt 001 011 010 110 100 i Expected 001 O11 O10 110 100 TOT ida AN Eare xpecte i 5 El 1 2 3 4 5i n i n n n n n i Z Z Reference Hall Events gt d E wy Shadow i Current Expected Samplen Transfer i o ii m Trigger E El p i i Sample Sample 5 n n 0 Hall glitch Wy OK Capture for Correct Hall Revolution L lt Event Error Monitoring i P A Wrong Hall Event Idle Stop Multi Pattern Sync Trigger Shadow Transfer J 1 1 1
39. TEMPFET thinQ TRENCHSTOP TriCore Other Trademarks Advance Design System ADS of Agilent Technologies AMBA ARM MULTI ICE KEIL PRIMECELL REALVIEW THUMB pVision of ARM Limited UK ANSI of American National Standards Institute AUTOSAR of AUTOSAR development partnership Bluetooth of Bluetooth SIG Inc CAT iq of DECT Forum COLOSSUS FirstGPS of Trimble Navigation Ltd EMV of EMVCo LLC Visa Holdings Inc EPCOS of Epcos AG FLEXGO of Microsoft Corporation HYPERTERMINAL of Hilgraeve Incorporated MCS of Intel Corp IEC of Commission Electrotechnique Internationale IrDA of Infrared Data Association Corporation ISO of INTERNATIONAL ORGANIZATION FOR STANDARDIZATION MATLAB of MathWorks Inc MAXIM of Maxim Integrated Products Inc MICROTEC NUCLEUS of Mentor Graphics Corporation MIPI of MIPI Alliance Inc MIPS of MIPS Technologies Inc USA muRata of MURATA MANUFACTURING CO MICROWAVE OFFICE MWO of Applied Wave Research Inc OmniVision of OmniVision Technologies Inc Openwave of Openwave Systems Inc RED HAT of Red Hat Inc RFMD of RF Micro Devices Inc SIRIUS of Sirius Satellite Radio Inc SOLARIS of Sun Microsystems Inc SPANSION of Spansion LLC Ltd Symbian of Symbian Software Limited TAIYO YUDEN of Taiyo Yuden Co TEAKLITE of CEVA Inc TEKTRONIX of Tektronix Inc TOKO of TOKO KABUSHIKI KAI
40. Warnings Due to technical requirements components may contain dangerous substances For information on the types in question please contact the nearest Infineon Technologies Office Infineon Technologies components may be used in life support devices or systems only with the express written approval of Infineon Technologies if a failure of such components can reasonably be expected to cause the failure of that life support device or system or to affect the safety or effectiveness of that device or system Life support devices or systems are intended to be implanted in the human body or to support and or maintain and sustain and or protect human life If they fail it is reasonable to assume that the health of the user or other persons may be endangered
41. XMC CCU4 SLICE StartConfig DELAY SLICE PTR XMC CCU4 SLICE EVENT 0 XMC CCU4 SLICE START MODE TIMER START CLEAR XMC_CCU4 SLICE Capture0Config CAPTURE SLICE PTR XMC CCU4 SLICE EVENT 0 XMC_CCU4 SLICE ConfigureEvent CAPTURE SLICE PTR XMC CCU4 SLICE EVENT 0 amp capture event0 config XMC CCU4 SLICE ConfigureEvent DELAY SLICE PTR XMC CCU4 SLICE EVENT 0 amp start event0 config Get the slice out of idle mode XMC CCU4 EnableClock MODULE PTR DELAY SLICE NUMBER XMC CCU4 EnableClock MODULE PTR CAPTURE SLICE NU BER e Setup the POSIF in Hall Sensor Mode POSIF Configuration XMC POSIF Init POSIF PTR amp POSIF HALL config XMC POSIF HSC Init POSIF PTR amp POSIF HSC config XMC POSIF EnableEvent POSIF PTR XMC POSIF IRO EVENT CHE Connect correct hall event to SRO XMC POSIF SetInterruptNode POSIF PTR XMC POSIF IRO EVENT CHE XMC POSIF SR ID 0 Configure NVIC Set priority NVIC SetPriority POSIFO 0 IROn 0U Enable IRO NVIC EnableIRO POSIFO 0 IROn e Start the CCU4 slice for the capture timing Start Timer Running XMC_CCU4 SLICE StartTimer CAPTURE SLICE PTR T e Start the POSIF module Start the POSIF module XMC POSIF Start POSIF_ PTR Application Note 19 V
42. asFiteislesstel tesaseevesdsoiataa ERER EE ETE ee EEE Ese Eer EAE 14 2 5 2 Macro and variable Settings ccsssscssscssesssesscsseeseeecesecseesccesecseseesesecaeeesesseceasesesseeeaecseeenesaeenes 15 2 5 3 XMC Lib Peripheral Configuration structure ccccssesscssscseseeeecesesseeecesecseeeeceaecaeeeeeseeceeeneeeees 16 2 5 4 Interrupt Service Routine Function implementation s ssesssssssssssssessrssrseseerseesessesrsssseserssrseseeees 17 2 5 5 Main Function implementation cccccssesssessecssecsecsecsseceecsesssesesecessesesasesseecsaecsaecsaeceaseeseeaes 18 3 Quadrature Decoder iissccciissecccsciecsccsccsscosescececctiscecesdccessctiecsseesescscecscssceaesscessecsesessceseus 21 3 1 Principl amp of Opera asistene eenn roes eE sis ube cdenddvess DA FD FRYN GAR YN RAA voce ies 21 3 1 1 Quadrature Clock Generation BaSiCS c cccsscccsssscsssseesseceeseecesssecsseeeeesceeasecssseeesaeeeeasecesseecaess 21 3 1 2 Standard Quadrature MOdeC ccccssccsssecsssseessecesscecssseecssececcescesseecsssececseceesteceseeeseeseeasecesetecsaess 22 3 1 3 Direction Count MO imita ia RT dadas 23 3 2 Motion Monitoring protesis 24 3 2 1 Motion Tracking plus Velocity Monitoring based on Time within N TickS oooooconocccccnononncononoss 24 3 2 1 1 Position Taca 24 3 2 1 2 Revolution Track ira 24 3 2 1 3 Velocity based on elapsed Time T N cccescssssescesecssessessecseeeseesecsesenesseceaecseeseeesecseseneeseenes 25 3 2 1 4 Index Z Mark
43. ccoonncononcnonanonnnanonnnnnonanononononnnnnnna no non nn UALL no nr ELLI nn LID Y Finn 5 1 4 Multi Channel ModE oseese erise eoe eener re EEEN e ERE E eE rE oaae YN BN CRYN TH FLYS Sa 5 2 Triple Hall Commutation Control for 3 Phase MOtOr esessesesssssoscososessoseoeeseosessososeoeoses 6 2 1 Triple Hall IMPUt Pattern cossccssccgsicsacessecdscssstuvsecGiectdecdsseeunegsdegevsdGusseavssececsscasedeepiuateedecessveoscevyecsseaewsedees 7 2 2 Delayed Hall Input Sampling iiser eeen eniai ee Eea EE CE REEE EAEE EEES 7 2 2 1 Shadow Update of Expected Patterns cccesccssssssssscsseeseesecesecseececesecsesseesseceeeenesseseaesseeeneeaeenes 8 2 3 Verification and AAMINIStration cscesesssesecsseessesscesesseeecesecseeecsecseeescesecseeesessecesecseseeeaecaesenenaeeaes 8 2 3 1 Verification of Hall Event Input PatternS essssessesseseesssseseserssesesresrssssesersssseseeerseeseseeseseseseesenss 8 2 3 2 Administration Shadow Transfer of Pattern Compare Valu8S oooconncnncnoconoconnnonncrnonnnoononncnnnono 9 2 4 Output Pattern Control Ge YW E E E E NE 9 2 4 1 Triple Hall Output Pattern for 3 Phase Motor Control e sssesssesssssessessesereeerssssessrsssseseeseseeseseeees 9 2 4 2 Output Pattern Control by CAPCOM Slices in Multi Channel Mode cceceseesseescesecseeeeeeseenes 9 2 5 Example Use Case Using POSIF in Hall Sensor Mode to measure the speed of the motor 11 2 5 1 Theory OF OPS atiOn sass sccciseetecseieeec
44. ck if a new value is captured store value to Speed variable if capturedvalue0 amp CCU4 CC4 CV FFL Msk motorspeed capturedvalue0 amp CCU4 CC4 CV CAPTV Msk else Application Note 17 e required d value I R OU I R 1U V1 0 2015 07 Position Interface POSIF AP32289 In In eon Triple Hall Commutation Control for 3 Phase motor motorspeed capturedvaluel amp CCU4 CC4 CV CAPTV Msk Clear pending event XMC POSIF ClearEvent POSIF PTR XMC_POSIF_ IRQ EVENT CHE Set the new Hall pattern hallposition XMC_POSIF HSC_GetExpectedPattern POSIF PTR XMC POSIF HSC SetHallPatterns POSIF PTR hall pattern hallposition Add up the captured timing for each hall event detected motorspeed onerev motorspeed Process the captured speed for the motor update when if one complete motor revolution is detected if hallposition initialhallposition Application code for speed PI to determine the new angle for the motor update PE rari a a BY Reset the motorspeed variable for next revolution capture motorspeed onerev 0 2 5 5 Main Function implementation Before the first start and execution of timer slice software the CCU4 must have been initialized using the following sequence e Initialize the HALL GPIO XMC GPIO Init P0 13 amp HALL POSIF 0 Hall PadConfig XMC GPIO Init Pl1 0 amp HALL POSIF 0 Hal
45. dated by software 2 4 Output Pattern Control The Multi Channel Mode Pattern register MCM MCMP is linked to the output POSIFx MOUT 15 0 Its value will be updated from the shadow register MCSM MCMPS by shadow transfer on the Multi Channel update trigger PIFMST i e the Multi Channel Pattern Update Request POSIFx OUT6 and Pattern Update Sync POSIFx MSYNC D A 2 4 1 Triple Hall Output Pattern for 3 Phase Motor Control The POSIF module in conjunction with the CAPCOM units in multi channel mode or in external modulation mode enables complete synchronicity between the output state update and the application of a new pattern This can be used in Hall Sensor Mode for the direct drive of brushless DC motors with the required motor control commutation patterns 2 4 2 Output Pattern Control by CAPCOM Slices in Multi Channel Mode A CCU4 8OUT pin output level of any slice that has been set in multi channel mode CC4 8yTC MCME 1 can be controlled in parallel by an external level that is present on its Multi Channel Input MCI pin For synchronization a Set Shadow Transfer Enable MCSS and a Pattern Set PSy request complete the hardware protocol Application Note 9 V1 0 2015 07 Position Interface POSIF AP32289 Infineon Triple Hall Commutation Control for 3 Phase motor HALL INPUT SAMPLES Delayed Sample Expected Hall Event Current Position CC4y External Start Stop Edge Aligned Compare Mode DE
46. l PadConfig XMC GPIO Init Pl 1 amp HALL POSIF 0 Hall PadConfig e Setup the CCU40 slices Slice 0 for single shot Slice 1 for capture time Enable clock enable prescaler block and configure global control XMC CCU4 Init MODULE PTR XMC CCU4 SLICE MCMS ACTION TRANSFER PR CR T Start the prescaler and restore clocks to slices XMC_CCU4 StartPrescaler MODULE PTR El Ensure fCCU reaches CCU40 CCU80 XMC CCU4 SetModuleClock MODULE PTR XMC CCU4 CLOCK SCU Configure CCU4 slices as monoshot and capture slice XMC CCU4 SLICE Comparelnit DELAY SLICE PTR amp delay config Application Note 18 V1 0 2015 07 Position Interface POSIF AP32289 In In eon Triple Hall Commutation Control for 3 Phase motor XMC CCU4 SLICE CaptureInit CAPTURE SLICE PTR amp capture config Configure CCU4 delay as lus CCU40 STO is connected to POSIF HSDA XMC CCU4 SLICE SetTimerPeriodMatch DELAY SLICE PTR 127U XMC CCU4 SLICE SetTimerCompareMatch DELAY SLICE PTR 64U XMC CCU4 SLICE SetTimerPeriodMatch CAPTURE SLICE PTR 65535U T T T Transfer value from shadow timer registers to actual timer registers XMC CCU4 EnableShadowTransfer MODULE PTR uint32_t XMC CCU4 SHADOW TRANSFER SLICE 0 XMC_CCU4 SHADOW TRANSFER SLICE 1 Configure and enabl vents
47. mp POSIF MCM config Start the POSIF module XMC POSIF Start POSIF PTR e Enable the CCU80 Slices and start the timers Get the slice out of idle mode XMC CCU8 EnableClock CCU80 MODULE PTR CCU80 SLICEO NUMBER XMC CCU8 EnableClock CCU80 MODULE PTR CCU80 SLICE1 NUMBER XMC CCU4 EnableClock CCU40 MODULE PTR CCU40 SLICEO NUMBER Start the PWM on a rising edge on SCU GSC40 and GSC80 XMC_SCU_SetCcuTriggerHigh uint Application Note 32 t 42 XMC SCU CCU TRIGGER CCU40 XMC SCU CCU TRIGGER CCU80 V1 0 2015 07 Position Interface POSIF AP32289 Cinfineon Revision History 5 Revision History Current Version is V1 0 2015 07 Page or Reference Description of change V1 0 2015 07 Initial Version Application Note 43 V1 0 2015 07 Trademarks of Infineon Technologies AG AURIX C166 CanPAK CIPOS CIPURSE CoolGaN CoolMOS CoolSET CoolSiC CORECONTROL CROSSAVE DAVE DI POL DrBLADE EasyPIM EconoBRIDGE EconoDUAL EconoPACK EconoPIM EiceDRIVER eupec FCOS HITFET HybridPACK ISOFACE IsoPACK i Wafer MIPAQ ModSTACK my d NovalithlC OmniTune OPTIGA OptiMOS ORIGA POWERCODE PRIMARION PrimePACK PrimeSTACK PROFET PRO SIL RASIC REAL3 ReverSave SatRIC SIEGET SIPMOS SmartLEWIS SOLID FLASH SPOC
48. onfigureEvent CCU40 SLICEO PTR XMC CCU4 SLICE EVENT 0 amp CCU40 SLICE event0 config XMC CCU8 SLICE ConfigureEvent CCU80 SLICEO PTR XMC CCU8 SLICE EVENT 0 amp CCU80 SLICE event0 config XMC CCU8 SLICE ConfigureEvent CCU80 SLICE1 PTR XMC CCU8 SLICE EVENT 0 amp CCU80 SLICE event0 config XMC CCU4 SLICE StartConfig CCU40 SLICEO PTR XMC CCU4 SLICE EVENT 0 XMC CCU4 SLICE START MODE TIMER START CLEAR XMC_CCU8 SLICE StartConfig CCU80 SLICEO PTR XMC CCU8 SLICE EVENT 0 XMC CCU8 SLICE START MODE TIMER START CLEAR XMC_CCU8 SLICE StartConfig CCU80 SLICE1 PTR XMC CCU8 SLICE EVENT 0 XMC CCU8 SLICE START MODE TIMER START CLEAR Enable events Enable Compare match event for pattern update XMC CCU4 SLICE EnableEvent CCU40 SLICEO PTR XMC CCU4 SLICE IRO ID COMPARE MATCH UP Enable Period match event for synchronizing the pattern update with the PWM XMC CCU8 SLICE EnableEvent CCU80 SLICE1 PTR XMC CCU8 SLICE IRO ID PERIOD MATCH Application Note 41 V1 0 2015 07 Position Interface POSIF AP32289 Infineon Multi Channel Multi Phase Control Connect compare match event XMC_CCU4 SLICE SetInterruptNode XMC CCU4 SLICE
49. r at those positions POSIF OUT1 generates an output on a correct Hall Event that is used to trigger a shadow transfer of the Currentu and Expectedu pattern This signal is also connected to a CCU40 slice to capture the speed of the motor i e the timing between 2 correct Hall events Each time a correct Hall event is detected an interrupt routine is entered where the next set of current and expected Hall pattern are updated and the captured time between the Hall events are read from the CCU4 capture slice The captured time is the speed of the motor and can be used by the application for feedback into the system This input can be used in the selected motor control algorithm for controlling the motor Note 1 The details of the implementation for the application stage are not covered in this example 2 This example is based on the XMC1300 Application Note 11 V1 0 2015 07 infir Position Interface POSIF AP32289 Infineon Triple Hall Commutation Control for 3 Phase motor Interpolation lt E a Detection amp i Delay Stage Si HSDA CCU40 rn Ss Hall input 1 r i Slice 0 i a a r OUTO i gt r i O N Hall input 2 i Config Edge Aligned y SS A o i i Hall input 3 O Y a EPS 7 7 yS Slice 1 A i gt Config Edge Aligned i Verification amp E t re i Administration Stage P Hall Sensor Mode _ i j Space Vector Amplitude In
50. r mode The Quadrature Decoder Unit is used for position control linked with a rotary incremental encoder It has interfaces for position measurement motor revolution and velocity measurement It provides an easy plug in for rotary encoders e With or without index top marker signal e Gear slip or shaft winding compensation e Separate outputs for position velocity and revolution control matching different system requirements e Extended profile for position tracking with revolution measurement and multiple position triggers for each revolution e Support for high dynamic speed changes due to tick to tick and tick to sync capturing method 1 4 Multi Channel mode The Multi Channel Mode unit is used in conjunction with the Hall Sensor mode to output the required motor control pattern or alternatively it can be used stand alone to perform a simple multi channel control of several control units The mode provides modulation of multiple PWM signals e Parallel modulation controlled via software for N PWM signals for systems with multiple power converters e Generating proprietary PWM modulations e Parallel and synchronous shut down of N PWM signals due to system feedback Application Note 5 V1 0 2015 07 face POSIF Yn Position Interface POSIF 1 oe Cinfineon Triple Hall Commutation Control for 3 Phase motor 2 Triple Hall Commutation Control for 3 Phase motor When used in conjunction with the CAPCOM units CCU4 or C
51. rface POSIF AP32289 Infineon Multi Channel Multi Phase Control 4 2 Multi Channel Unit in Stand Alone Mode Before MC Update After MC Update PCONF MSETS Multi Channel Next Pattern Update Set POSIFx MSET H A PCONF MSES SW Alternative SW Alternative MC Next Pattern Clear MC Pattern Update Set Update Reguest PCONF MCUE SW E E SWS D Multi Channel i aps Multi Channel Update Trigger 4 E gt Pattern Update POSIFx OUT6 i Request i clear i i POSIFx MSYNC D A true Multi Channel Pattern Update Wd Synchronization Ex x F7 E i N Patternn X Patternns MC Pattern Shadow H Transfer Sw SW Alternative Y Clear Clear MC Pattern Multi Channel Pattern OUT TENI gt gt gt i A Patterns X Pattem gt POSIFx OUT 15 0 MC Pattern Shadow Update AP32289_POSIF_04 vsd Figure 19 POSIFx Multi Channel Unit in stand alone mode 4 2 1 Next Pattern Update Set Inputs in stand alone mode A Multi Channel Next Update Set can be asserted either by software selected by PCONF MCUE 1 or via one of the POSIFx MSET H A inputs selected by the PCONF MSETS bitfield on a signal transition selected by PCONF MSES The MCMF MSS bit F F will be set and cleared by synchronization event true or by software Application Note 30 V1 0 2015
52. riety of challenging scenarios including e Motion Tracking plus Velocity Monitoring based on Time within N Ticks e Motion Tracking plus Velocity Monitoring based on Ticks within Time T 3 2 1 Motion Tracking plus Velocity Monitoring based on Time within N Ticks This is Motion Monitoring Profile 1 N Ticks should be understood as a certain number of Period clocks Zero Mark Index Phase A Phase B POSIFx Standard Guadrature 1 1 Decoder Mode ouro Er AN CAPCOM Unit CCU4x Typical Profiles 1 Guadrature Clock Position l l Pos a SOUNT Pos etal ated ated ob me cco a HE OUTI eie i i iW a ar gol Direction Up UP DOWN COMPARE st H i LIFFT Down Rev i Pos Trackihgi OUT4 UP DOWN im 4 bis Index Revolution i as a CC41 Ar cy yl COUNT COMPARE st pr H 1 1 OUT3 Eg Capture Tick Index Occurrence Slip I Clear TJ CLEAR N Alicks compare i i Reset CC42 i OUT2 i a ri count compare y A Peri i Count ST eriod Clock Velocity Period i FLUSH i AB AB AB A BA BA B A J CAPTURE 1 mer ours ae CC43 START is Start TART TIMER M focaa Sync Start Flush 2 1 START TIMER Mode cc43 n capture T T Start i 3 z j t 4 Event Controlled Timer Slices CC4y Functions AP32289_POSIF_03 vsd Figure 14 Quadrature
53. sor mode Before MC Update AfterMC Update PIFHP_CHE Correct Hall Event cone Indication flag i of Correct Hall Event none d Multi Channel 8 Next Pattern Update Set POSIFx MSET H A true gt PCONF MSES SW Alternative SW Alternative MC Next Pattern Clear MC Pattern Update Set Update Request PCONF MCUE I PCONF MSETS J3 sw y _ lt SW l F F Multi Channel SS Multi Channel Update Trigger 4 gt Pattern Update POSIFx OUT6 ia Request PCONF MSYNS POSIFx MSYNC D A Multi Channel Pattern Update f Multi Channel Synchronization x gt Pattern Update POSIFx OUT4 3 Request Done bL Pattern X Pattern lt y MC Pattern Shadow Transfer PIF_IDLE gt 1 SW Alternative Clear MC Pattern ear Multi Channel Pattern OUT Na Patterns K Pattemn gt POSIFx OUT 15 0 MC Pattern Shadow Update AP32289_POSIF_04 vsd Figure 20 POSIFx Multi Channel Unit in Hall Sensor mode 4 3 1 Next Pattern Update Set Inputs in Hall Sensor mode A Multi Channel Next Update Set can be asserted either by software selected by PCONF MCUE 1 or via one of the POSIFx MSET H A inputs selected by the PCONF MSETS bitfield on a signal transition selected by PCONF MSES However the MC Update Trigger MCMF MSS bit F F will only be se
54. t at Correct Hall Events Application Note 32 V1 0 2015 07 face POSIF in Position Interface POSIF i oe Cinfineon Multi Channel Multi Phase Control 4 3 2 Pattern Update Synchronization Inputs in Hall Sensor mode After the Multi Channel Update Trigger request into Flip Flop F F has been set the pattern update can be synchronized with for example a PWM signal This signal should be mapped to one of the POSIFx MSYNC D A inputs selected by the PCONF MSYNS bitfield which will assert a synchronization event true on a falling edge 4 3 3 Multi Channel Pattern Update Request Output in Hall Sensor mode The POSIFx OUT6 output pin asserts a Multi Pattern Set Shadow Transfer Request Enable by its pulse to the MCSS inputs of all CAPCOM slices that are selected for Multi Channel Pattern Update in parallel The POSIFx OUT4 output pin asserts synchronization event true and claims Update done when it is cleared 4 3 4 Multi Channel Pattern Shadow Transfer in Hall Sensor mode Upon a POSIFx MSYNC D A input falling edge a Multi Channel Pattern Shadow Transfer is performed from the MCSM MCMPS shadow register to the POSIFX MOUT 15 0 register output pins The shadow register should be updated by software The output can be reset by software or hardware POSIF Idle to stop PWM generating units Application Note 33 V1 0 2015 07 Position Interface POSIF AP32289 Multi Channel Multi Phase Control
55. terpolation lt PI Controller lt SPee4 Interpolation i Modulation i A Angle Angle i Application Stage Driving the Motor using selected Control Algorithm In a motor control application the POSIF module can be used to determine the speed of the motor by detecting a correct Hall event generated from the motor Once the current speed is determined it can be adjusted based on an appropriate motor control algorithm Detection amp Delay Stage POSIF OUTO provides a detection and delay stage for the inputs sampling after any edge detection This signal is connected to a CCU40 slice to start a 1us timer configured in single shot mode The status signal is connected to POSIF HSDA to delay the input sampling to reject noise that might appear at those positions Verification amp Administration Stage Each Hall input pattern is compared with the current pattern and the expected pattern A correct Hall Event generates an output linked to POSIF OUT1 and it triggers a shadow transfer of the Currentn and Expectedu pattern In addition this signal is connected to a CCU40 slice to capture the speed of the motor i e the timing between 2 correct Hall events Application Stage A space vector modulation algorithm is selected for driving the 3 Phase motor The capture timing can be used by the selected motor control algorithm as a feedback to the system to update the system at run time This stage is not covered in this document
56. th for example a PWM signal This signal should be mapped to one of the POSIFx MSYNC D A inputs which will assert synchronization event true upon a falling edge on this input Application Note 27 V1 0 2015 07 face POSIF Yni Position Interface POSIF i e Infineon Multi Channel Multi Phase Control Before MC Update After MC Update Multi Channel Next Pattern Update Set POSIFx MSET H A true gt F F Multi Channel j Multi Channel Update Trigger gt Pattern Update POSIFX OUT6 i Request POSIFx MSYNC D A true Multi Channel Pattern Update Synchronization SW Da Pattern MC Paitern Shadow Transfer o g 3 o gt z o ga o c cU A o Multi Channel 0 1 1 I 1 1 1 fod Pattern OUT 1 iy A M Patternn 1 Patternn gt 4 POSIFx OUT 15 0 AP32289_POSIF_04 vsd Figure 17 Multi Channel mode sub unit 4 1 3 Multi Channel Pattern Update Request Output The POSIFx OUT6 output pin asserts a Multi Pattern Set Shadow Transfer Request Enable by its pulse to the MCSS inputs of all CAPCOM slices that are selected for Multi Channel Pattern Update in parallel This pulse is the Multi Channel Update Trigger Flip Flop F F status and will be cleared after a multi pattern update 4 1 4 Multi Channel Pattern Shadow Transfer and Pattern Output On a POSIFxX MSYNC D A
57. tput POSIFx OUTO has to start a CCU4 8 timer that after a certain time triggers the sampling via a selected input POSIFX HSD B A o Delayed W Samplen POSIF m Current Expectedn Hall Multi Channel o Positi i Hall Event osition Mode 3 gt Hall Input 3 LSB Er gt gt Hall Input 2 l z ale gt Hall Input 1 MSB siart lt Hall Inputs Edge hb gt Timer i L Detection Trigger Pattern ii J li mM Timer a ere Noise Rejection CC4 Compare AE L 4 by delayed Hall H3 H2 H1 2 Single MU f Inputs Sampling O Edge Aligned Status en T Delayed Z E Compare Mode Bit Sample Trigger 7 O O AE i W 3 5 Lu Hall Event Current Expected Si Hi Compare Y L h pected o Sample i m a Service h i 7 r ES E p Request __ iN oi 1 i 7 SR i Sample Sample e Hall glitch Wy OK Error Shadow Update Trigger for Yv v Current and Expectedns Fe AP32289_POSIF_02 vsd Figure4 Triple Hall Input Samples Edge Detection Application Note 7 V1 0 2015 07 face POSIF Yn Position Interface POSIF i O Cinfineon Triple Hall Commutation Control for 3 Phase motor 2 2 1 Shadow Update of Expected Patterns After each occurrence and sampling of a new pattern Sample n by the delayed Sample Trigger ST and an event verification by a Hall E
58. vent Compare there should be a Service Request SR to Shadow Update the next Expected pattern An update path could be a DMA transfer on the falling edge of the Sample Trigger ST 2 3 Verification and Administration 2 3 1 Verification of Hall Event Input Patterns Each Hall Input pattern Sample is compared to the current pattern Current and the expected pattern Expected by the PIFHRDY trigger The comparison results will be interpreted Hall Glitch Current Correct Hall Event CHE Expected or Wrong Hall Event WHE if Sample is not equal to any of those The Hall Event Verification results in the following outputs e Correct Hall Event CHE linked to POSIFx OUT1 triggers Shadow Transfer of Current and Expectedy41 e Wrong Hall Event WHE linked to POSIFx OUT2 can be used for IDLE control or STOP Run Bit PWM e Glitch Hall Event or Wrong Hall Event both events linked to POSIFx OUTS will generate a STOP signals Delayed Sample Current pe Hall Multi Channel Position NA Mode Hall Input 3 LSB Hall Input 2 HALL INPUT SAMPLES Hall Input 1 MSB 2 Hall Inputs Edge Detection Trigger ST Delayed I Sai imer Start mi Sen q CC4y f External Start Stop Bi i JION TL o n m lt gm
59. x 7 2 ieee Pos usc J E Timer A Pe Be re a A A A 1 J couni Hoi i OUT2 Apc y override bit ee Count Period Clock velocity ccusx 4 trap Per J 3 Events scu Control Matrix is Sai ARA E0 MABA outs de Flush lt Sync Start N Event Controlled Timer Slices CC4y 8y Functions etl E AP32289_POSIF_03 vsd Figure 11 POSIF in Standard Quadrature mode Application Note 22 V1 0 2015 07 Position Interface POSIF AP32289 Infineon Quadrature Decoder Phase A Phase B POSIFx External Event Up to 3 Event Function Target Event Source Profiles Select of Inputs Timer Sources Select Edge or Level Select Slice GPIO di start y stop ERU1 J capture 0 1 POSIF capture 2 3 CAN J gate clock 4x J up down eS y load Timer usic Y count ADC J override bit CCU8x Bevan trap Al modulate SCU q Control Matrix Event Controlled Slice Timer CC4y 8y Functions 1 1 4141 1 1 1 Quadrature Encoder Mode Direction Quadrature Clock position AP32289_POSIF_03 vsd Figure 12 POSIF in Standard Quadrature mode when using position monitoring 3 1 3 Direction Count mode Position encoders that work in Direction Count mode provide just two signals Clock and Direction information e The POSIFx gets the Direction Count mode by setting PCO
Download Pdf Manuals
Related Search
Related Contents
Weider WEBE0914 User's Manual Sun Fire V440 Server Installation Guide - de True RMS-DC/AC- Zangenamperemeter mit Multimeter ST Philips SDW1420 Roof/attic Antenna mount Schema elettrico cablaggio con centralina Samsung SGH-C300 User Manual Avenger® - Blue Heron Citizen SLD-322RG User's Manual Manuale dell`utente Vodafone Smart 4G Copyright © All rights reserved.
Failed to retrieve file