AN2267
Application note
Implementation of current regulator for BLDC
motor control with ST7FMC
Introduction
A conventional method of controlling BLDC motors is to implement an inner current loop for
torque / current control. Reference to this inner loop is provided either by an outer speed
loop or by some other means based on application requirement. The linearity of inner
current / torque loop is greatly affected by the faithfulness of current feedback. In the first
section, an outline to various approaches for obtaining current feedback is presented and
analyzed with the limitations of each. In the subsequent sections, a presentation is given of
a simple, linear and cost effective approach of implementing the inner current loop by
sampling the DC link current at the mid-point of PWM “on time” with ST7FMC. Experimental
results are also discussed.
An accompanying software file is available with this application note and can be downloaded
from
www.st.com/mcu
June 2006
Rev 1
www.st.com
1/19
Contents
AN2267
Contents
1
2
3
4
5
6
7
Outline to various approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Obtaining the average current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
BLDC motor control using ST7FMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Implementation using ST7FMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Appendix A Sampling inner current loop procedure . . . . . . . . . . . . . . . . . . . . . 14
Appendix B Event U interrupt service routine . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Appendix C ST7MC 3-phase motor control schematics . . . . . . . . . . . . . . . . . . . 16
2/19
AN2267
Outline to various approaches
1
Outline to various approaches
A BLDC motor driven in a conventional 6-step method greatly resembles a brushed DC
motor. Hence, one may choose to regulate the average DC link current. But this actually
results in constant power operation for the motor because at constant DC link voltage, if the
average link current is regulated at a certain value, it effectively regulates the power at that
point for any variation in motor load, and the average load current / motor torque varies
inversely with speed depending on the load. Any effort to compensate the average DC link
current data with the duty cycle to obtain average phase current will be impaired by a filter
time constant, rendering this option ineffective.
Since the DC link current does not reveal winding currents during PWM “off time”, one may
choose to monitor all 3 winding currents and build a regulator. But this requires two current
sensors to monitor any two phase currents, while the third phase current can be
reconstructed from these two. However, the cost of these sensors makes this option
expensive.
A third option would then be to regulate the peak current per PWM period. Though it is
inexpensive and easy to implement, it is not exactly linear. During PWM on time, at lower
duty cycles, when both speed and BEMF are small, the phase current rises much faster
than at higher duty cycles when the speed and BEMF are large. The same peak currents
per PWM period represent different average currents at different duty cycles. An intuitive
geometric approach will reveal this as shown in
Figure 1.
A typical variation in average
current vs duty cycle at a given peak current reference is shown in
Figure 2.
Figure 1.
I
phase
I
peak
Peak current regulation at different duty cycles with BEMF load
I
phase
I
peak
t
Figure 2.
I
ave
vs duty cycle at a given I
peak
I
ave
t
I
peak
dutycycle
0
0.5
1.0
3/19
Obtaining the average current
AN2267
2
Obtaining the average current
For linear torque control, it is important that we sample the average phase current as
feedback to the current regulator. It is best to get this information from the DC link current
using only a shunt resistor because of its low cost and simplicity. However, the DC link
current is not continuous and is present only during PWM on time. As a simple model for
current control, assume a simple buck converter feeding an RL load as shown in
Figure 3.
Figure 3.
Buck converter feeding an RL load
PWM
CONTROL
SW1
1
2
R1
BT1
D1
V
L
L1
R
sh
I
sh
I
L
The switching frequency, PWM on time and load inductance are such that the load current is
continuous.
Figure 4
shows the load voltage, load current and DC link current waveforms. A
close look at the load current waveform reveals that its average value is equal to its
instantaneous value during the middle of PWM on time or off time. Since the load current
flows through the DC link during PWM on time, sampling the DC link current during the
middle of PWM on time gives the average load current.
Figure 4.
Buck Converter - Waveforms
V
I
L
I
L(ave
I
S
T
o
T
off
4/19
AN2267
BLDC motor control using ST7FMC
3
BLDC motor control using ST7FMC
The main feature of ST7FMC is its powerful motor control macro cell, capable of generating
control signals to drive a sensorless or sensored 3 phase BLDC or AC motor.
STMicroelectronics application notes AN1946 [1] and AN2030 [2] explain, in detail, the
procedure to control a 3 phase BLDC motor using ST7FMC.
Figure 5
shows the simplified block diagram of the hardware motor control macro cell. The
macrocell has multiple timers performing various functions in parallel to generate control
pulses for the motor. An auto scalable 8-bit timer (MTIM) monitors the time difference
between successive phase back EMF zero crossings (Z events) of the motor. When a Z
event occurs, the timer value is captured into MZREG and the timer restarts counting from
zero, and, the previous content of MZREG is transferred to MZPRV. This timer is a part of
what is called DELAY MANAGER that, based on this time difference and a delay coefficient
(MWGHT), identifies the timing for next phase commutation instant (C events). All in
parallel, a 12-bit free running counter generates the PWM carrier for inverter switching.
Figure 5.
Simplified block diagram of Motor control Macro cell for BLDC motors
DELAY
or SPEED MEASURE UNIT (not
WEIGH
CAPTURE
MTI
TIME
BEMF ZERO-CROSSING
BEMF=
[Z
In
DELAY = WEIGHT x
Ex
MCI
MCI
MCI
MCVRE
=
COMMUTE
TACH
Encoder
Vre
INPUT DETECTION
MEASUREMENT
WINDOW
GENERATOR
(I
CURRENT
VOLTAGE
(V
P
H
A
S
MCO
MCO
MCO
MCO
MCO
MCO
U, V,
Phase
CFAV
OAON
+
-
NMCE
MCAO
MCAO
MCAOZ/
MCCFI
Vdd
AD
MOD
PWM
Phase
MCCRE
(V
(I
R
CHANNEL
12-bit
Phase
Phase V
Phase W
[Z] : Back EMF Zero-crossing
Z
n
: Time elapsed between two consecutive Z
[C] : Commutation
C
n
: Time delayed after Z event to generate C
(I): Current
(V): Voltage
C
(V
PCN
12-bit THREE-PHASE
PWM GENERATOR
MCPWM
MCPWM
MCPWM
3
5/19