posif position interface - infineon technologies
TRANSCRIPT
POSIFPosition InterfaceXMC™ microcontrollersSeptember 2016
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 2
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 3
POSIFPosition Interface
Highlights
The POSIF module is the ideal solution
for motor control applications using hall
sensors and quadrature decoders. The
user can configure freely the type and
usage of the resources to perform an
optimized mapping to the wanted
application.
Customer benefitsKey feature
› Application tailored motor position andvelocity measurement
› Tailored solution for 2 or 3 hall sensorapplications. Coupling with PWMgeneration
› Perform multi-level modulation for PWM
› Tailored modulation development
› Interface for linear or quadraturerotary encoder
› Interface for hall sensors
› Stand-alone multi-channel control
Copyright © Infineon Technologies AG 2016. All rights reserved.
POSIF
Modeselection
Output
control
OUT 0
OUT 1
OUT 2
OUT 3
OUT 4
OUT 5
OUT 6
MCP
LPF
IN
IN
IN
IN
IN
IN
IN
IN
...
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
Quadrature/linear interface
2/3 hall sensorinterface
Multi-channelcontrol
INTs
4
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 5
POSIF: interface for linear or quadraturerotary encoder
› Linear or quadrature interface
› Input signal filtering
› Position monitoring (tick counting + direction)
› Velocity monitoring (time between ticks or/and elapsed time for anumber of ticks)
› Revolution monitoring
Copyright © Infineon Technologies AG 2016. All rights reserved.
Phase A
Phase B
Index
Clock
Direction
OR
Motor shaftrevolution
counter
Motor shaftpositionmonitor
Velocitymeasurement
Phase A
Phase B
Phase A
Phase B
Clock/ticks
Configurable resourceorganization
POSIF
Modeselection
rev
dir
clock
speed
LPF
IN
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
Quadrature/linear interface
2/3 hall sensorinterface
Multi-channelcontrol
INTs
Output
control
6
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 7
POSIFInterface for hall sensors
› Current and expected pattern can be easily updated via SW
› Flexible input signal debouncing/ filtering
› Time measurement between Correct Hall Events
› Programmable error handling (Wrong Hall Event)
› Synchronization with the PWM generation
Copyright © Infineon Technologies AG 2016. All rights reserved.
Timer measuring thedistance between
Correct Hall events
PWM generationtimers
Debouncing timer
Configurable resourceorganization
POSIF
Mode selection
edge
CHE
WHE
MCP
LPF
IN
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
Quadrature/ linearinterface
2/3 hall sensorinterface
Expected pattern + currentpattern
Multi-channel control
INTs
Outputcontrol
PWM sync
8
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 9
POSIFStand-alone multi-channel control
› Multi-channel control can work in stand-alone (without any of the other twomodes)
› With multi-channel control it is possible to control a pattern (max. 16-bits) thatis controlling the PWM outputs (of CCU4/CCU8)
› Pattern can be updated on-the-fly completely synchronous with the PWM timers
› The pattern is completely controlled by SW, allowing any type of PWM outputcontrol
Copyright © Infineon Technologies AG 2016. All rights reserved.
POSIF
Mode selection Output
controlLPF
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
INTs
2/3 hall sensorinterface
pattQuadrature/
linear interface
Multi-channel control
INPWM sync
Pattern update request
PWM timers
PWM 0
PWM 1
PWM 2
PWM 3
pattern
SW
HW
IN
update
Next pattern
› Request for a newpattern can bedone via SW or HW
› Synchronization ofthe pattern updatewith the PWMtimers allowsglitchless operation
Current pattern
› Pattern is applied to thetimers PWM outputs in parallel
› Allows multiple timer outputcontrol
1001b 1100b 0110b
10
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 11
POSIFSystem integration
› Target applications
– Motor control
– Power conversion
– Human machine interface
– Connectivity
– General purpose
The POSIF system integration offersseveral advantages:
› Distribution bus from CCU4/CCU8 overthe ERU for complex signal conditioningapplication cases
› Distribution of control logic to all of thetimer units (CCU4/CCU8)
› Connectivity to the ADC to performsignal monitoring (or emulation) formotor control
*Several components may be presented or notdepending on the device
Copyright © Infineon Technologies AG 2016. All rights reserved. 12
Agenda
Overview
Key feature: interface for linear/quadrature rotary encoder
Key feature: interface for hall sensors
Key feature: stand-alone multi-channel control
System integration
Application examples
1
2
3
4
5
6
Copyright © Infineon Technologies AG 2016. All rights reserved. 13
Application exampleHall sensor control BLDC (1/2)
For a standard BLDC motorcontrol application, the POSIF ismonitoring the hall sensoroutputs. In every transition ofthe hall sensors a debouncingtimer is started.
If after the debouncing time thetransition is the expected one,then the hall sensor control logic“informs” the multi-channelcontrol that a pattern update ispossible.
After this, the multi-channelcontrol waits for a sync signalfrom the PWM timers to updatethe multi-channel pattern.
Overview
In brief
Standard BLDC motor control
Copyright © Infineon Technologies AG 2016. All rights reserved.
Hall inputsDebouncing
Stop/TRAPPWM
H1
H2
H3
Transitiondetected
dbt
Debouncingover
Compare hallinputs w/expectedpattern
Wrongtransition
Correcttransition
chet
Time betweenCHE
Sync with PWM
Multi-channel
waiting forPWM sync
2 syncslots
PWM timers outs
Patternupdate
A+
A-
B+
B-
C+
C-
010110b 110100bMCP
14
Application exampleHall sensor control BLDC (2/2)
Application example hall sensor control: detailed block diagram
› The hall sensor logic insidethe POSIF is monitoring theinput pattern against theexpected pattern
Copyright © Infineon Technologies AG 2016. All rights reserved.
C+
C-
B+
B-
A+
A-
+
-
A
C
B
POSIF
Mode selection
Outputcontrol
Edge
CHE
WHE
MCP
LPF
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
Quadrature/linear interface
INTs
2/3 hall sensorinterface
Multi-channel controlPWM sync
H1:
H2:
H3:
Expectedn
Hall event
Error!
1 1 1 0 0 0
0 0 1 1 1 0
1 0 0 0 1 1
A+
A-
B+
B-
C+
C-
IN
Debouncing timer
CHE CHE CHE CHE CHE WHE
Timer 0
Timer 1
Timer 2
MCP
MCP
MCP
WHE
WHE
WHE
Expected pattern +current pattern
Timer measuring thedistance between
Correct Hall Events
A+
A-
B+
B-
C+
C-
Currentn
position
Delayedsamplen
6*
CCU
4/8
xO
UTy:s
Levelevents
input
sig
nals
› Pattern for BLDC isapplied to the CCU8timers in parallel
› CCU8 is then controllinga 3 phase motor scheme
N
S
› A timer is used to debouncethe input signals
› If a CHE occurs,then the PWMtimers willsignalize whenthe POSIFupdates themulti-channelpattern
› Wrong hallevent can beused togenerate aTRAP for thePWM timers
15
Application exampleQuadrature decoder – fixed time stamp (1/2)
Position monitoring plus velocity calculationwithin a fixed timestamp
The quadrature decoder interfaceof the POSIF, together with theflexible set of timers present ineach derivative, can be used to:
› Implement a tailored solutionto monitor the motor shaftposition
› Implement a robust velocitymeasurement algorithm
In this application case, onecounter is monitoring themotor shaft position.
The velocity is monitored bystoring/capturing the elapsednumber of ticks within a fixedtime windows.
Overview
In brief
Copyright © Infineon Technologies AG 2016. All rights reserved.
POSIF
Mode selection Outputcontrol
clock
dirLPFIN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
INTs
2/3 hall sensorinterface
Multi-channelcontrol
Quadrature/linear interface
speedTimer +counter
(for velocity)
Performaction, e.g.
changerotationdirection 0x0000
Counter overflow value
Read backthe numberof elapsed
ticks
Calculatespeed
Timestamp
ISR ISR
Counter (formotor shaft
position)
16
Application exampleQuadrature decoder – fixed time stamp (2/2)
Application example quadrature decoder fixed time stamp: detailed timing diagram
› With this setup it is possible to configure the ISR timestamp for velocitycalculation. Every time that an ISR is triggered by the “Velocity Timer 0” the SWreads back the stored number of ticks from Velocity Counter 0
› The Position Counter can work
completely decoupled from the velocity
calculation. This counter can be used to
trigger an ISR with a certain number of
elapsed ticks or revolutions
Copyright © Infineon Technologies AG 2016. All rights reserved.
Quadrature clock
Period clock
Direction
Fixed time
High speed Low speed
0x0000
0x0000
0x0000
Counter overflow value
Nr.elapsed ticks
Time window
Time between twoconsecutive ticks
Time between last tick
and time window trigger
Captureddata
Captureddata
Captureddata
Velocity timer 0Descr.: Generates a capture triggerfor the velocity counter 0 andvelocity timer 1 with a periodicityequal to the one set in the timewindow
Velocity counter 0Descr.: Captures/ stores theelapsed number of ticks thatoccurred within the time windowdictated by the velocity timer 0
Velocity timer 1Descr.: Captures/ stores the timeelapsed between the last 3consecutive ticksANDCaptures/stores the elapsed timebetween the last tick and the triggergenerated by velocity timer 0
Position counterDescr.: Monitors the motor shaftposition
High speed limit
POSIF
Mode selection Outputcontrol
clock
LPF
IN
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
2/3 hall sensorinterface
Multi-channelcontrol
Quadrature/linear interface
speed
Phase A
dirPhase B
Index
Nr.
ela
psed
ticks
Cap
ture
trig
ger
Cap
ture
trig
ger
Cap
ture
trig
ger
Cap
ture
trigg
er
17
Application example: Quadrature decoder –enhanced position and velocity (1/2)
› Enhanced position and velocitymonitoring
Overview
In brief
The flexible resource utilizationbetween the POSIF and theCCU4/CCU8 modules, gives thepossibility of having multipletimers/counters to monitor differentvariables.
In this application case, a positioncounter is used to monitor the motorshaft position.
Besides that one additional counterand two timers are used to monitor:
› The number of elapsed ticksbetween a fixed timestamp
› The time distance betweenticks
› The jitter between the last tickand the ISR
Copyright © Infineon Technologies AG 2016. All rights reserved.
POSIF
Mode selection Outputcontrol
clock
dirLPFIN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
INTs
2/3 hall sensorinterface
Multi-channelcontrol
Quadrature/linear interface
speed 2 Timers +counter
(for velocity andangle adjustment)
Performaction, e.g.
changerotationdirection 0x0000
› Number ofelapsed ticks
› Distancebetween ticks
› Distancebetween lasttick and ISR
› Calculatespeed
› Informationfor SVM/anglecalculation
Timestamp
ISR ISR
Counter(for motor shaft
position)
Counter overflow value
18
Application example: Quadrature decoder –enhanced position and velocity (2/2)
Application example enhanced position and velocity: block diagram
› With this setup it is possible to configure theISR timestamp for velocity calculation. E.g.calculate the velocity every 2 ms
› In each ISR the SW has available thenumber of elapsed ticks, the time distancebetween two consecutive ticks, thedistance between the ISR and the last tick
› All these variables can be used not only tocalculate the accurate velocity but also forangle calculation that can be feedback to theSVM calculation routine
Copyright © Infineon Technologies AG 2016. All rights reserved.
Quadrature clock
Period clock
Direction
Fixed time
High speed Low speed
0x0000
0x0000
0x0000
Counter overflow value
Nr.elapsed ticks
Time Window
Time between twoconsecutive ticks
Time between last tick
and time window trigger
Captureddata
Captureddata
Captureddata
Velocity timer 0Descr.: Generates a capture triggerfor the velocity counter 0 andvelocity timer 1 with a periodicityequal to the one set in the timewindow
Velocity counter 0Descr.: Captures/ stores theelapsed number of ticks thatoccurred within the time windowdictated by the velocity timer 0
Velocity timer 1Descr.: Captures/ stores the timeelapsed between the last 3consecutive ticksANDCaptures/stores the elapsed timebetween the last tick and the triggergenerated by velocity timer 0
Position counterDescr.: Monitors the motor shaftposition
High speed limit
POSIF
Mode selection Outputcontrol
clock
LPF
IN
IN
IN
IN
Interrupt control
Mode
Phase A
Phase B
Index
Hall 2
Hall 1
Hall 3
2/3 hall sensorinterface
Multi-channelcontrol
Quadrature/linear interface
speed
Phase A
dirPhase B
Index
Nr.
Ela
psed
ticks
Cap
ture
trig
ger
Cap
ture
trig
ger
Cap
ture
trig
ger
Cap
ture
trigg
er
19
– Product Briefs
– Selection Guides
– Application Brochures
– Presentations
– Press Releases, Ads
– Application Notes
– Technical Articles
– Simulation Models
– Datasheets, MCDS Files
– PCB Design Data
– Technical Videos
– Product Information
Videos
– Forums
– Product Support
Support material
Collaterals and
Brochures
Technical Material
Videos
Contact
– www.infineon.com/XMC
– www.infineon.com/XMC
– Kits and Boards
– DAVETM
– Software and Tool Ecosystem
– Infineon Media Center
– XMC Mediathek
– Infineon Forums
– Technical Assistance Center (TAC)
Copyright © Infineon Technologies AG 2016. All rights reserved. 20
The information given in this training materials is given as a hint forthe implementation of the Infineon Technologies component only andshall not be regarded as any description or warranty of a certainfunctionality, condition or quality of the Infineon Technologiescomponent.
Infineon Technologies hereby disclaims any and all warranties andliabilities of any kind (including without limitation warranties of non-infringement of intellectual property rights of any third party) withrespect to any and all information given in this training material.
Disclaimer