Enhanced sensorless startup control of BLDC motors
using ST7FMC
Introduction
The ST7FMC microcontroller is capable of controlling 3 phase brushless DC (BLDC) motors
in position sensorless mode because of its powerful motor control macro cell. It is capable of
monitoring zero crossings of all 3 back EMF (BEMF) voltages using a direct BEMF detection
feature, where the entire motor terminal voltage is directly applied to an onchip zero
crossing detector during the zero crossing period without any attenuation. Hence it is able to
track the BEMF zero crossings even at very low motor speeds.
This direct BEMF detection feature helps to start the motor in auto commutated mode right
from zero speed. In traditional methods, where the motor voltage signals are scaled down at
the comparator input, it is necessary to step the rotor through a few rotations initially to let
the comparator see sufficient levels of BEMF signals to detect zero crossings. The rate at
which the rotor can be stepped through these initial rotations is highly influenced by load
inertia, and hence a step timing table has to be created on the basis of load inertia. This can
be a cumbersome task if the load inertia is not constant. With ST7FMC, because of the
direct BEMF detection feature, this procedure can be avoided completely, thereby saving on
development time as well as code memory space.
In any case, an alignment of the rotor to a known position is mandatory. At the end of
alignment, if a commutation is performed by switching the next set of windings into
conduction, the rotor is forced to turn in the direction of new step. If the winding current is
set close to rated motor current at the end of alignment, then this step change will apply a
rated torque on the rotor. Generally, this torque should be sufficient to kick the rotor to turn in
the right direction at a reasonable rate (or speed), inducing a reasonable BEMF in the
floating winding good enough for the zero crossing detector to identify a zero crossing as the
full BEMF is available at the comparator input without any attenuation. Hence from the very
first step, the device can be set in auto commutated mode like in a Hall position sensor
based control.
Alignment is done by passing current through motor windings corresponding to one of 6
steps of inverter. Let us call it STEP 0. At the end of alignment, the rotor comes to a parking
position that will be a magnetically neutral position on the floating winding.
During alignment, bits DAC(MCRA) and SWA(MCRA) are set to zero and MCOMP is also
set to zero. This has two implications. If DAC bit is zero, then writing to MPHST will only
update the preload registers and become active only during a commutation (or C) event.
With SWA bit being zero, a zero value on MCOMP will retain MTIM at zero and will create a
C event for every clock effectively transferring associated preload registers to active
registers with one clock latency. Hence, at the end of alignment, if the MPHST register is
written with the next step (STEP 1), the inverter switching states will change to the new step
(STEP1) during the next clock cycle and the rotor will turn in the direction of new step. The
CPB(MCRB) bit must also be set appropriately corresponding to the new step to identify
zero crossing for the new step when it happens. To ensure a good starting torque, the
dutycycle may be selected to ensure rated current in the motor windings during this time.
At this instant, the SWA(MCRA) bit should be set HIGH to put the device into autocommutated mode. In this mode, commutation instances are estimated by hardware and its
associated time count is loaded into MCOMP at the time of zero crossing (Z) events, based
on zero crossing periods MZREG/ MZPRV and a coefficient MWGHT. Before setting SWA,
since MCOMP was zero, MTIM was forced to remain at zero generating C events for every
clock. Once SWA is set, the hardware watches out for a D event and the MTIM timer starts
counting from zero in pursuit of D and Z events. After setting up SWA, the CIM(MIMR) bit
should be set to enable C interrupts. At this point, a C interrupt takes place immediately
because its flag was previously set repeatedly when SWA was zero, as explained above.
Inside the C interrupt routine, the MPHST and MCRB registers are updated for the next step
(STEP2). These are only written into preload registers and are not active yet. If simulated
demag option (SDM(MCRB)=1) is chosen, then MDREG must be updated inside the C
interrupt routine. After the generation of a D event, the comparator hardware is set up to
identify zero crossing of the floating winding. The active step on the inverter is STEP 1 yet,
and if the motor current is good enough to produce a good starting torque to turn the rotor at
a good rate, it will generate a reasonable BEMF on the floating winding that will pass
through a natural zero crossing during this inverter step. This event is captured by the
hardware and a Z event is generated. This event buffers MZREG into MZPRV and captures
MTIM into MZREG and also loads MCOMP with a new time value, based on
MZREG/MZPRV and MWGHT, to setup the next commutation event. When a match
between MTIM and MCOMP happens, a C event is generated transferring contents from
preload MPHST to active state setting up next inverter step (STEP 2). Updating of all
relevant registers inside the C routine is repeated as before, and this C event is followed by
D event and subsequently by Z event and thus the cycle repeats continuously. The
sequence of events during starting is captured in Figure 1.
3/9
Experimental resultsAN2502
2 Experimental results
This concept is implemented on a starter kit to run an onboard 24V Ametek BLDC motor.
The captured waveforms are given in Figure 1 and Figure 2.
Figure 1.First two commutation steps after alignment
●Trace 4: Current waveform
●Trace 2: Flag to signify certain
stages in start up
●Trace 1: MCZEM
●Trace 3: MCDEM
The edges of trace 2 have the following significances:
●Before first rising edge
–end of alignement (at STEP 0)
–DAC(MCRA) = 0, SWA(MCRA) = 0, MCOMP = 0
–active step is STEP 0
●During first level HIGH
–write MPHST corresponding to next step (STEP 1)
–MCRB updated for STEP 1
–SWA(MCRA) set
–CIM(MIMR) set
–active step is STEP 1
●first falling edge
–first C interrupt execution
–Inside C ISR, preloads of MPHST and MCRB updated for next step (STEP 2) and
MDREG is updated (if simulated demag option chosen)
–Notice Trace 3 (MCDEM) falling edge (D event instance) happening after this edge
–Notice Trace 1 (MCZEM) falling edge (Z event instance) happening after D
instance
–active step is STEP 1
4/9
AN2502Experimental results
●second rising edge
–second C interrupt execution
–active registers get copied from preloads, first auto commutated step visible
outside
–active step is STEP 2
–preloads of MPHST and MCRB updated for next step (STEP 3)
The pictorial details of the first few steps are shown in Figure 2
Figure 2.First few steps after alignment
●Trace 4: Current waveform
●Trace 2: Flag, toggles at every
C ISR
●Trace 1: MCZEM
●Trace 3: MCDEM
5/9
ConclusionAN2502
3 Conclusion
The need to generate a forced start up stepping sequence and to tune its stepping rate is
completely avoided. The waveforms shown in Figure 2 reveal the excellent starting
performance obtained with a low voltage (24V) BLDC motor that generates a very weak
BEMF at start up. For higher voltage motors, such as 300V DC, this method will be even
more reliable. This was verified by running a blower motor and a washing machine motor
and the performance was found to be satisfactory. Most low cost sensorless control
methods requires initial forced rotation of the rotor. But ST7FMC, because of its direct BEMF
detection method, differentiates itself from the rest by this superior start up performance.
6/9
AN2502Associated software
Appendix A Associated software
To verify this method on the starter kit, download and use the attached software
sup_sensrls.zip file. All motor control modules are written in motcon.c and program start
module is written in main.c. Control board hardware definitions are given in pcboard.h. To
see the waveforms given in this application note, open parameters.h file and set macro
TEST to 1, removing jumpers J15(13:14), J15(11:12) and W10. The evaluation details are
as follows:
For test signals:
●J15 pin 14 --> MCDEM represented by trace 3
●J15 pin 12 --> MCZEM represented by trace 1
●W10 mid pin --> flag signal represented by trace 2
Control set up:
●W12 --> in Fixed mode
●POT1 --> sets current limit reference
●RV2 --> sets dutycycle
●SW1 --> On/Off command to start / stop motor
7/9
Revision historyAN2502
4 Revision history
Table 1.Document revision history
DateRevisionChanges
02-Mar-20071Initial release.
8/9
AN2502
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING
APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,
DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE
GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.