Title: BLDC Motor Control with ST72141 Microcontroller
1BLDC Motor Controlwith ST72141 Microcontroller
- Motor Control Competence Center Application Team
2ST72141 MicrocontrollerPresentation contents
- Introduction
- A. Permanent Magnet DC Motor Basics
- B. ST72141 description
- - General features
- - Core
- - Motor Control Peripheral
- - Current mode / Voltage mode
- C. Summary of Benefits of ST72141
- D. Appendix - Starting sequence - Speed-up of
demagnetisation - Conclusion
3PMDC Basics (Generalities)
- Main advantages
- High efficiency (up to 98)
- Variable speed
- Silent operation
- Reliable/long life time (no brushes)
- High Size/Power ratio
- High torque at start-up
- Major applications (where above advantages are
required) - Compressor (air conditioner, refrigerator)
- Appliances (washing machine, vacuum cleaner,
food processor) - Industrial fan
- Electric vehicles
- Automotive (fuel and waterpumps, cooling fan,
climate control) - Office Automation (laser printer, copy machine)
4PMDC Basics (1)
- Operating principle
- Synchronous Stator flux and rotor mechanical
rotation speed are same. - Stator description 3 phase winding (1 or 2 or
more pairs of poles) - Rotor description Permanent magnet
- For 1 pair of pole 1 electrical cycle (6 steps)
1 mechanical cycle
2
3
South Pole
1
4
5
6
5PMDC Basics (2)
- Drive mode 6 steps Principle
Current in winding A,B,C
300V DC
T1
T5
T3
A
U
V
B
W
C
2
T4
T6
T2
-
T1 T1 T3 T3 T5 T5 T4 T6 T6 T2 T2 T4
6One pair pole motor
7Two pairs pole motor
A
A
A
T3-T6
1
1
N
N
1
1
S
N
S
S
S
S
2
S
N
N
N
1
B
C
B
C
B
C
3
T1-T6
T1-T4
A
A
5
A
4
T5-T4
N
S
S
S
1
N
N
N
S
N
N
1
1
S
S
B
C
B
C
B
C
6
T3-T2
T5-T2
8PMDC Basics (3)
- Control Method
- It requires to know the position of the rotor at
all timesin order to reach the status of auto
commutation (best efficiency). At least 2 common
ways are available to know the rotor position. - Hall effect sensors (sensor mode)
- Back emf (1) detection (sensorless mode)
- The autocommutation happens when the current in a
winding is in phase with the b-emf in this same
winding. - The control process will be about keeping these
2 signals in phase - Current generated by inverter in the motor
windings - Back-emf Voltage induced (by Permanent Magnet) in
the motor windings
- (1) B-emf is the voltage induced in a winding by
the movement of the magnet in from of this
winding edj/dt. It is independant of
the energy supply to the motor (just by spinning
by hand the rotor for example it is
possible to generate back-emf).
9PMDC Basics (4)
- Signals in one of the 3 phases
Back-EMF
current
t
10Implementation of control B-emf detection
Conventional Method (1)
300V
BUS
BUS
divider filter
N
N
5V
N
N'
N'
POWER GND
POWER GND
POWER GND
virtual ground
weaknesses - Voltage dividers give reduced
sensitivity difficulty for low speed operation
- Filtering is optimised for narrow speed
range
11Implementation of control B-emf zero crossing
Conventional Method (2)
Phase current
Filtered Phase voltage
Filtered voltage of rebuilt reference node N'
filt1.hgl
Zero crossing event
12Implementation of control ST72141 patented
Sensorless method
300V
T1 PWM "ON"
A
V/2
B
C
bemf
T4 always ON
GND
- back-EMF whole signal sensing
- high sensitivity large speed range very
low speed operation starting with full torque - no filtering delay
- high signal to noise ratio
13Implementation of control ST72141 Patented
Sensorless Method
----- phase current ------
------ phase voltage---- --
End of demagnetisation
back-EMF zero crossing
End of demagnetisation
14ST7141 Back-emf detection Patent
ST Method
GE Method
Patent Registration
US 5,859,520 "control of a brushless motor"
US 4,654,566
Principle
full digital - B-emf is clamped to 5V by
on-chip diode. - After end of demagnetisation
of winding to read, and when high side
transistor is off, the N point is at potential
0. - The comparator can then read b-emf zero
crossing.
analog method - need to build an artificial N
(neutral), divide voltage, and filter it. -
need to divide voltage and filter output
voltage of winding to read. - The comparator can
read the b-emf zero crossing.
Drawback
Requires to limit the duty cycle of the PWM below
100.
- Requires a filter and a voltage divider - Low
flexibility voltage and frequency dependent.
Limited speed range - Components need to be
dimensionned for a nominal operation of the
motor
Benefit
Large speed range detection Sensorless, no
external components Cost saving
Sensorless
NO PATENT INFRINGMENT REDUCED COST
15Application Environment (3)Sensorless PMDC, in
current Mode
16PMDC 6 STEPS DRIVE WITH ST72141Saving components
CPU ressources
CPU discharged ofStator commutation Power
drive
M
T3
MCU
T5
DAC
E n a b l e
Hall sensors Bemf detector
Current regulation
Position feedback
17Fuel-Pump Brushless DC-Motor Drive
V Batt
U431
ST72141
5V
VReg.. Reset
Supply
Current Limit
Osc.
Timer 2
Temp.
3-Phase Motor
Diagn.
IO ADC Interface
Timer 1
Gate Drive
Enable
8 bit Core
8 k ROM
TX
Data Transc.
RX
256 B RAM
PWM Gate Drive
Phase Commu- tation
Logic Inter- face
BEMF Cero Crossing
To ECU
18ST72141 MicrocontrollerPresentation contents
- Introduction
- A. Permanent Magnet DC Motor Basics
- B. ST72141 description
- - General features
- - Core
- - Motor Control Peripheral
- - Current mode / Voltage mode
- C. Summary of Benefits of ST72141
- D. Appendix - Starting sequence - Speed-up of
demagnetisation - Conclusion
19ST72141 Synchronous Motor controller
- General Features
- 8K ROM/OTP/EPROM
- 14 multifunctional bidirectional I/Os with -
External interrupt - 13 alternate function
lines - 3 high sink outputs (20mA in open drain) - Two 16bit timers with - 2 input captures -
2 output compares - external clock input - PWM
and pulse generator mode - SPI synchronous serial interface
- 8 bit ADC with 8 channels
- SDIP32 or SO34S packages
- Supply and Safety features
- enhanced reset (onchip) system
- Low voltage supervisor
- 3 power saving modes
- Configurable watchdog reset
20ST72141 CORE for a whole motor system
21ST72141 DEDICATED PMDC DRIVERAutomate
Coprocessor
DELAY MANAGER
BEMF ZERO-CROSSING DETECTOR
MCIA
BEMF0
MCIB
Z
MTIM
DELAY
CAPTURE Zn
MCIC
TIMER
WEIGHT
Internal V
REF
DELAY WEIGHT x Zn
?
COMMUTE C
MCO5
MCO4
(I)
MEASUREMENT
CURRENT
MCO3
WINDOW
GENERATOR
MCO2
VOLTAGE
(V)
MCO1
MCO0
(I)
(V)
MODE
NMCES
MCCFI
(V)
PWM (1)
OCP1A
(I)
PWM MANAGER
CHANNEL MANAGER
Note 1 The PWM signal is generated by the ST7
16-bit Timer Z Back EMF Zero-crossing event Z
n Time elapsed between two consecutive Z
events C Commutation event C n Time delayed
after Z event to generate C event (I) Current
mode (V) Voltage mode
22ST72141 Synchronous Motor controller
Peripheral description (1)
- Back-emf Zero Crossing Detector
- 3 analog inputs for sensorless rotor position
detection.(same inputs -logical-are used in case
of sensor operation) - On chip clamping diodes
- End-of-demagnetisation detection by comparator
output sampling at 800KHz. There are 4
selectable reference voltage for Hardware
Demagnetisationdetection 0.2V, 0.6V, 1.2V,
2.5V - Possibility of implementing simulated
demagnetisation based on last low side
demagnetisation result. - Back-emf zero-crossing detection On-chip phase
voltage comparator is directly refered to the
full b-emfwithout attenuation for zero crossing
detection - 200mV sensitivity and 100mV
hysteresis. - 4 selectable voltages for the
hysteresis comparator (same voltages as
demagnetisation)
23PHASE INPUT Block Diagram (1)
24ST72141 Synchronous Motor controller
Peripheral description (2)
- Delay Manager
- Delay manager automatic and programmable delay
between b-emf zero crossing and next
commutation. - HW coprocessor 88 multiplication and /32
division for automatic computing of delay or - SW calculation/look-up of the delay (no
computation) at motor start-up or for other motor
than PMDC (when no b-emf is available). - Automatic compensation for disymetrical motors
(by use of n-1 time between zero-crossings for
delay computing)
Kf (motor characteristics, application,
speed) 0255
C
Z
Z
T
(TxK)/32
T/32
25Control Principles of PMDC Maximum efficiency
with delay manager
back-EMF
switching time of step n1
current
t
C commutation Z Zero Crossing
Z
D
image of ST72141 Motor control timer (MTIM)
D end of demagnetisation
c
c
Z
t
zero crossing detection times
26ST72141 DEDICATED PMDC DRIVERDELAY MANAGER
27ST72141 Synchronous Motor controller
Peripheral description (3)
- PWM Manager
- On chip comparator for current loop control (see
previous slide) - Current regulation in current
mode - Voltage regulation/Current limitation in
voltage mode - Measurement window generator for b-emf zero
crossing detection.
28ST72141 DEDICATED PMDC DRIVERPWM MANAGER
(I) Current mode
(V) Voltage mode
29PWM manager Current Mode, Voltage Mode
- Current Mode
- Current in windings is imposed
- True DC current in the motor
- Fine control of the current for each of the 6
steps - Allows fine control of torque
- Voltage Mode
- Voltage control by PWM cycle
- no fine control of current (only max current
limitation) - Can be used in applications with high torque
variations
30Current limitation in voltage mode control
31Current loop regulation in current mode control
32ST Solution for compressor control
Current mode control
true DC current in the motor
Acceleration / Torque control
by current reference setting
Speed control
via Torque regulation
Speed range
ratio of a 100
Maximum speed
reach limits of optimum conditions thanks to
real time de-flux control
Starting torque
limited only by motor characteristics
Starting speed
few steps required
Starting time
few tenths of second typical
motor configuration characteristic
accept Star or Delta with no hardware
modification as well as salient or smooth poles
33Control Principles of PMDC B-emf detection and
phase commutation delay
current reference
I
t
t
clock
Motor Voltage
back-EMF
t
step time
step time
switching time of step n1
T1-T4
T1-T6
current
t
C commutation Z Zero Crossing
Z
D
image of ST72141 Motor control timer (MTIM)
D end of demagnetisation
c
c
Z
t
zero crossing detection times
34ST72141 Synchronous Motor controller
Peripheral description (4)
- Channel Manager
- Commutation step control
- 6 PWM output channels - 1 or 2 groups
(oddeven) - multiplexing of PWM output
according to group and phase selected. -
programmable output polarity channel by channel
- 195Hz to 25KHz output - off-time between 5µS
and 30µS (fixed 1.25µS in sensor mode) - acceleration of demagnetisation feature (by
selecting correct transistor to switch). - 1 emergency stop input pin to force all outputs
in Hiz (active at low level) - SW enable bit to force all outputs in Hiz
35ST72141 MicrocontrollerPresentation contents
- Introduction
- A. Permanent Magnet DC Motor Basics
- B. ST72141 description
- - General features
- - Core
- - Motor Control Peripheral
- - Current mode / Voltage mode
- C. Summary of Benefits of ST72141
- D. Appendix - Starting sequence - Speed-up of
demagnetisation - Conclusion
36ST72141 Summary of Benefits(1)
- Reduced cost
- Currently, only available dedicated MCU for PMDC
motor with low pin count (SO34S or SDIP32) - Typically lower cost than available DSP offer
- OTP at 1.5 to 2 times the price of ROM
- Reduced system cost
- ST patented Sensorless rotor positioning (no
sensor/ reduced external components) - On chip current monitoring loop (no external
components) - On chip clamping diodes and high current outputs
- On chip reset circuit
- Reduced power consumption (15-20mA) for small
dimensioning pf P.S
37ST72141 Summary of Benefits(2)
- Fast time to market / High flexibility
- Industry standard 8bit MCU architecture for short
learning time and accessibility (compared to DSP) - MCU Flexibility (compared to ASIC)
- Pin to pin compatible OTP (2weeks L/T) or FastROM
(4weeks L/T) for fast production ramp-up - Most adequate performance and safety
- Powerful 8bit core
- Optimized for scalar control Most adequate
performance for control of PMDC motors in Home
appliances and automotive. - Dedicated Motor Control cell to free CPU
ressources - Emergency input pin (to put driver outputs in
HiZ) - Watchdog, LVD, safe reset
- ESD sensitivity (human body model) Product
passes 3500V
38ST72141 Summary of Benefits(3)
- Technical support
- Dedicated Application Support WW
- High performance C Compiler (Hiware/Cosmic)
- Emulator/programmers
- Application Notes
- Reference SW (generic, compressor control...)
- Reference and quality
- ST7 Core products 400Million units shipped to
leading customers WW. - ST72141 now in design with leading home
appliance and automotive
manufacturers WW.
39ST72141 for Sensorless PMDC controlmain features
(2)
- Applications
- Refrigerator
- Air con
- Washing Machine
- Blower or Fan
- Medical Equipment
- Vending machine
- Automotive (fan, fuel pump, starter...)
- Pump drives
40ST72141 for Sensorless PMDC controlmain features
(3)
- Support
- Emulator/Programmer...............Now
- Demokit with PMDC motor, inverter, PC
interface...............Now- Evaluation of
ST72141 with motor provided- Customisation of SW
for user's own motor- Generation of optimised
SW- On board programming - Standard ASM routine library....Now
- Standard C routine Library.......Q3/00
- Application Notes.....................Q3/00
- Application Support...................Now
41ST72141 MicrocontrollerPresentation contents
- Introduction
- A. Permanent Magnet DC Motor Basics
- B. ST72141 description
- - General features
- - Core
- - Motor Control Peripheral
- - Current mode / Voltage mode
- C. Summary of Benefits of ST72141
- D. Appendix - Starting sequence - Speed-up of
demagnetisation - Conclusion
42CURRENT versus Back EMF PHASE SHIFT
Poor efficiency
High efficiency operation
zero crossing detection available
Starting few tenth of seconds typical.
t
43STARTING SEQUENCE
rotation speed (rpm)
2000
closing the regulation loop
1000
synchronous sequence
waiting for BEMF
1
3
2
enabling auto-commutated mode
time (sec)
44Pre-positioning step
T1-T4-T6
300V DC
A
T1
T5
T3
U
V
N
W
C
S
B
T4
T6
T2
3
6
-
- Put in an intermediary position
- Not an ordinary polarization
- Using the 3 windings generate a more important
flux - Less oscillations around the start position
45Pre-positioning ramp
- The pre-positioning phase lenght can be set by
software
46Acceleration ramp
47back-EMF MONITORING INTERVAL depends on current
amplitude
I2
I1
t
back-EMF monitoring interval
demagnetisation time is increasing when current
is high
48back-EMF MONITORING WINDOWdepends on line voltage
current slope proportional to the line voltage
I1
t
demagnetisation time is increasing when line is
low
back-EMF monitoring window
49Case We want 2 consecutive Z events to valid
auto-switched mode
50SPEED REGULATION STRATEGY
51Demagnetisation Speed Up Principle on High Side
V
V
V
T1
PWM
T1
T1
A
A
A
D3
V/2
B
B
C
C
D2
C
B
GND
bemf
bemf
T6
V/2 --gt GND
T4
T6
Step 2
Commutation 1-2 B Demagnetisation
Step 1
52Demagnetisation Speed Up Principle on Low Side
V
V
V
T5
bemf
T3
T3
D1
A
A
A
B
D6
B
C
C
C
V/2
B
bemf
T2
T2
T2
V/2 --gt V
PWM
Step 2
Commutation 2-3 A Demagnetisation
53BLDC Inverter Air-Conditioner
- Main advantages
- Quick cooling heating
- Temperature regulation
- Energy saving
- Reliable/long life time (no brushes)
- Super quite operation
- High torque at start-up
54Traditional Split Air-Conditioner System
1. Liquid coolant
4. Liquid coolant
(Low temp pressure)
Expansion
(low temp high pressure)
Valve
Outdoor Unit
Indoor Unit
Condenser Air-cooled
Air Cooling Coil
Refrigerant
Evaporator
Outside air
Return air
M
M
Outdoor fan
Indoor fan
Temperature
Absorb heat from room
3. Coolant in gaseous state
Sensing
and deliver cool air
(high temp pressure)
Air is forced through
2. Coolant in gaseous state
- condensation
M
Compressor
(high temp low pressure)
Temperature
Sensing
55ON/OFF Control of Traditional Air-con(Fixed
Motor Speed)
56Continuous Control of Inverter Air-Con(Variable
Motor Speed Control)
T
Setting temperature
Very small temperature fluctuation
Room temperature
Time
t
57ST72141 Regulation loops(simplified diagram)
Target Motor Speed
Step Time
Motor
P.I.D or Fuzzy regulation
b. emf
I
Feedback Speed
Motor efficiency regulation loop
Speed regulation loop
58Close Loop regulation Parameter
- Irefn I0 P en I(?ni0 ?i)
-
STP int - With
- Starting Value I0
- Proportional Element P ?n
- Integer Element I(?ni0 ?i)
- P 1/K1 Proportionnal Coefficient
- I 1/K2 Integer Coefficient
- STPint(0) 0
59PI Principle
- IrefnI0 PEnI(?i0n Ei)
- I0start value
- PEnproportional element
- I(?i0n Ei)integer element
- P4/K1proportional coefficient
- I4/K2Integral coefficient
- STPint(0)0
- Error Stp_moy - Targ_speed
- If motor speed gt target speed then Error lt0
- If motor speed lt target speed then Error
gt0Stp_moy average of step time on one
mechanical cycle
60PI flowchart (1)
61PI flowchart (2)
62PI flowchart (3)
63PI flowchart (4)
64PI flowchart (5)
Is_duty_max
yes
Max_duty-Iclosegt0?
no
IcloseMax_duty
Iclose-Min_dutygt0?
yes
no
Iclose(n)Min_duty
IrefIclose
Prog_Iref
RAZ
IRET
65TIPS
66Timer Data for one targeted speed
- For a 2P poles motor at N(rpm) targeted speed
- Step Time St60/(N6P)
- Ratio is extracted from table depending on
the step time - Timer value (Tv) is extracted from
- Tv(Stf)/eRLn2
- Speed TargetTv6Pk
- With k mechanical rotation number used for
regulation - Example 4 poles motor at 2000rpm regulate on 3
mechanical cycles - Step time St 60/ (200062)2.5ms
- Tv(2.510-32106)/e5Ln2 156
- Speed Target 156623422500
With Step time (St) Ratio (R) MC Clock (f)
67Current regulation
- 60 duty cycle on the timer A. At 100 duty
cycle, we have 5V. So, with 60 we have 50.6 3V
(A) - The divider has a value of 0.7 (70K/(30K70K)).
So after the divider we have 30.7 2.1V (B) - At OCP1A pin we have 2.1V. So, 2.1 V applied on
MCCFI for the current regulation - 2.1V on MCCFI pin means 2.1/10 (amplifier) 0.21
V at C and so with the 0.05 Ohms resistor, this
means 0.21/0.05 4.2A - So, with a 60 duty cycle, 4.2A are applied to
the motor.
68Motor Control Training
- STRATEGY
- BLDC MOTOR CONTROL ST72141
- Microcontroller
- Peripheral
- SW and driving modes
- Kanda kit hand-on
69BLDC Control Strategy
70ST72141 Flow Chart
71Basic Initialization of MC Peripheral
72MC Peripheral Initialization
73Synchronous Starting Ramp up
74Main Program in Speed Closed Loop Mode
75O (Multiplier overflow) E (Emergency Stop)
Interrupt Routine
76C (commutation) D (end of demagnetization)
Interrupt Routine
77C (1) Commutation
78C(2) Synchronous Mode
79C(3) Val_autosw
80C(4) Set_ki_autosw
81C(5) SDM_autosw (a)
82C(6) SDM_autosw (b)
83C(7) Carry_Set
84 C(8) End_C_action
End-C_action
prepare data for next C event
Change Delay (chang_ki 0) ?
no
yes
yes
chang_ki 10 ?
no
restore selected register to compute delay
chang_ki 10
yes
new_ki 0 ?
select synchronous mode clear MCOMP select
auto-swicthed mode
no
write MDREG
select MZREG
C_action_end
85 C(9) C_action_End
86C(10) Crossing
87R (ratio) Z (bemf) Interrupt Routine
88RMI event
89RPI event
90Z event