Documente Academic
Documente Profesional
Documente Cultură
Motor Control
Applications MCU Division
Applications
Features and
benefits
Plan
PWM generation
Speed / position feedback
Multi timer configuration
Analog to Digital converter
Current sensing and ADC synchronization
Field Oriented Control
Motor Control Tools
16-Bit Prescaler
CH1
CH1 CH1N
Capture Compare
CH2 Capture Compare CH2
Capture Compare CH2N
Capture Compare
CH3 CH3
CH3N
CH4
CH4
BKIN
N+1
N
U on underflow
U on underflow
U event during
Comp from N to N + 1 Over & Underflow
Double update
PWM counter
Double update
REP=0 ISR ISR ISR ISR ISR ISR ISR
t
Single update OVF
REP=1 ISR ISR ISR
t
Single update UDF
REP=1 ISR ISR ISR ISR
t
REP=2 ISR ISR ISR
t
REP=3 ISR ISR
t
Motor Control
(6-steps)
T1 T3 T5
T1
T2 T4 T6 T2
T3
Break applications:
If the AOE is Reset, the MOE remains low until you write it to ‘1’ again
Normally used for security with break input connected to an alarm feedback
from power stage, thermal sensors or any security components.
If the AOE (Automatic Output Enable) bit is set, the MOE bit is
automatically set again at the next update event UEV
Typically be used for cycle-by-cycle current regulation
Current regulation can also be performed using External trigger input (ETR)
Hall sensors
Hall Sensor interface (XOR’ed inputs)
Encoder
Encoder modes 1, 2 & 3 (2x, 4x)
Tacho feedback
Clear on capture to measure exact period
Encoder
Interface
TI1
Polarity Select & Edge Controller
TI2
Polarity Select & Edge Controller
IC2
IC1 Up Down
Up
Counter
Hall B
XOR
Hall C Input Filter &
IC1
Edge detector Prescaler Capture/Compare 1 Register
TRC
TIM0
CK_TIM
TRG1
TRG2
Trigger inputs TRG3 Trigger
Controller
TRGO TRG0
Trigger outputs
TI1
TI2
Triggered Mode
Master ARR
Counter reset
Master CNT
Counter enable
Update event Master Trigger
Out
Output Compare signal
When configured as Slave CNT
Gated Mode
OCR1
Gated Master OCR1
Slave CNT
Timer 0
CLOCK
Timer 1
ITR 0
Trigger TRG
prescaler 2
ITR 1 Controller
ITR 2
SLAVE
counter Update
ITR0 Timer 2
ITR 1
prescaler counter
ITR 2
MASTER
Timer 0 SLAVE 1
CLOC
K Timer 1
prescaler Trigger TRG 0 ITR 0
Update Controller
ITR 2
prescaler counter
counter ITR 3
SLAVE 2
Timer 2
ITR 0
slaves
SLAVE 3
PWM
ITR 0
ITR 1
prescaler counter
ITR 2
Timer 1
Hall
ITR 2 ITR 1
counter Update prescaler counter
ITR 2
Up to 18 multiplexed channels:
16 external channels
2 internal channels: Temperature sensor and voltage reference
Interrupt generation
End of Conversion, End of Injected conversion, Analog watchdog
DMA capability
On ADC1, but possibility to transfer also ADC2 result if sync’d
Channels conversion groups:
Up to 16 channels regular group
Up to 4 channels injected group
Trigger
Last channel
Conversion
Last injected channel
Conversion
Last channel
Conversion
Interrupt
VDDA
ADC_IN0
Address/data bus
ANALOG MUX
. Ports to 4
.
Injected Channels Injected data registers
(4x12bits)
ADC_IN15 Up
to 16
Regular Channels Regular data register
Temp Sensor (12bits)
Temp Sensor
…
VREFINT
GPIO
Ports
…
ANALOG MUX
Up to 4 injected channels Up to 16 regular channels
ADC1 ADC2
Analog Analog
External event (Regular group) External event sync
EOC/JEOC
7 ADCCLK cycles
(DMA-based)
Trigger for
regular
channels
Motor
Low side 1
Low side 2
Phase current
Average current
ADC Sampling
Low side 1
Low side 2
Phase current
Average current
ADC
input
0V (Phase 1)
ADC Sampling
MASTER
PWM
CLOC
K
prescaler Trigger TRG 0
Update Controller
counter
PMSM
3 phase
AC Mains Motor
inverter
~
va,b,c
iqs* + vqs
PID REVERSE
PARK & vα’β’s CALC
ids* -
vds
circle SVPWM
PID limitation
+
- θr el
iqs
iαβ s iabc s
CURRENT
ids PARK CLARKE
READING
θr el
ROTOR
SPEED/POSITION
FEEDBACK
DC Domain AC Domain
PMSM
3 phase
AC Mains Motor
inverter
~
va,b,c
iqs*
+ vqs
PID REVERSE
TORQUE AND PARK & vα’β’s CALC
FLUX - circle SVPWM
ids* vds
CONTROLLER limitation
+ PID
- θr el
iqs
iαβ s iabc s
CURRENT
ids PARK CLARKE
READING
-
θr el
+
ωr ROTOR
ωr* SPEED/POSITION
FEEDBACK
DC Domain AC Domain
Ŷ K
Observer
Χ̂
PMSM MOTOR
u (vq ,vd ) + y (iq ,id )
B ∫ C
+
A
x (iqs ,ids ,eQ ,eD )
B ∫ C
+ + -
xˆ (iD , iQ , eQ , eD )
A
K
iqs* + vqs
PID REVERSE
PARK & vα’β’s CALC
ids* -
vds
circle SVPWM
PID limitation
+
- θr el
iqs
iαβ s iabc s 3-SHUNT
ids PARK CLARKE CURRENT
READING
θr el
21 μsec
3.6μsec
1.6μsec
1.6μsec each
2.7μsec
2.6μsec
1.7μsec
5.5μsec SENSORLESS
ROTOR POSITION
FEEDBACK
For reference, Sensored FOC is ~17µs (vs 25µs with ARM7-based STR750, ie ~30%
gain)
16Kb
Preliminary, Code optimized for speed
←→ Move ↑↓ Change
Brushless PM Opto-isolated
Motor with JTAG
encoder
Evaluation
board
Three-phase (final STM32
Power stage version has a
with shunt- color LCD)
based current
reading