Sensorless BLDC Motor Control with Back-EMF Filtering Using a Majority Function

By Daniel Torres

Contributed By Convergence Promotions LLC


This article discusses a sensorless technique to control Brushless Direct Current (BLDC) motors using a majority filter implemented on a Digital Signal Controller (DSC). The algorithm utilizes a majority function for digitally filtering the Back-Electromotive Force (BEMF). Each phase of the motor is filtered, in order to determine when to commutate the motor drive voltages.

This control technique excludes the need for discrete, low-pass filtering hardware and off-chip comparators. Sensorless trapezoidal control has five main parts:
  1. Sampling trapezoidal BEMF signals using the Analog-to-Digital Converter (ADC) peripheral on a DSC
  2. Reconstructing the Motor Virtual Neutral Point
  3. Comparing the trapezoidal BEMF signals to the reconstructed motor virtual neutral point, in order to detect the zero-crossing points
  4. Filtering the signals coming from the comparisons, using a majority-function filter
  5. Commutating the motor driving voltages

Sensored control vs. sensorless control

The BLDC motor is used for both consumer and industrial applications, owing to its compact size, controllability, and high efficiency. Increasingly, it is also used in automotive applications as part of a strategy to eliminate belts and hydraulic systems, to provide additional functionality, and to improve fuel economy. The continuing reduction in the cost of magnets and the electronics required for the control of the BLDC motor has contributed to its use in an increasing number of applications, and at higher power levels.

The BLDC motor is usually operated with one or more rotor-position sensors, since the electrical excitation must be synchronous to the rotor position. For reasons of cost, reliability, mechanical packaging and especially if the rotor runs immersed in fluid, it is desirable to run the motor without position sensors, which is known as sensorless operation.

It is possible to determine when to commutate the motor-drive voltages by sensing the BEMF voltage on an undriven motor terminal during one of the drive phases. The obvious cost advantage of sensorless control is the elimination of the Hall position sensors. If low cost is a primary concern and low-speed motor operation is not a requirement, and the motor load is not expected to change rapidly, then sensorless control may be the better choice for your application.

Six-step (trapezoidal) commutation

The method for energizing the motor windings in the sensorless algorithm described in this article is called six-step trapezoidal, or 120°, commutation. Each step, or sector, is equivalent to 60 electrical degrees. Six sectors make up one electrical revolution. Figure 1 shows the commutation process.

3 Phase BLDC

Torque Firing

Figure 1: Six-step commutation.

For every sector, two windings are energized and one winding is not energized. The fact that one of the windings is not energized during each sector is an important characteristic of six-step control that allows for the use of a sensorless control algorithm. When a BLDC motor rotates, each winding generates BEMF, which opposes the main voltage supplied to the windings according to Lenz’s law. The polarity of this BEMF is in the opposite direction of the energizing voltage. Figure 2 shows ideal BEMF waveforms and the zero-crossing points.

The BEMF waveform of the motor varies as both a function of the rotor’s position and its speed. Detection of rotor position using the BEMF at zero and very low speeds is, therefore, not possible. Nevertheless, there are many applications (e.g., fans and pumps) that do not require positioning control or closed-loop operation at low speeds. Likewise, there are many different methods of using the BEMF. The majority of these methods can be summarized as follows:
  • Motor-terminal voltage sensing
  • Mid-point voltage sensing
  • Bus-current gradient sensing

The selected technique utilized the Mid-point voltage reconstruction, and it is based on detecting the instances when the BEMF of an inactive phase is zero. The sensorless zero-crossing technique is suitable for a wide range of applications where closed-loop operation near zero speed is not required.

Zero-crossing detection

Figure 2: Zero-crossing detection.


Assuming that only three motor leads are available for sensing the BEMF, then the voltage at the star point of the motor must be determined because the BEMF waveform will be offset by the star-point voltage.

Most of the time, motor manufacturers do not wire the motor neutral point. However, it can be generated by software. Three networks are connected in parallel with the motor windings to sense the voltage at each phase. The neutral voltage is equal to the average of the phase signals. Figure 3 shows how the voltage is measured at each phase, using six resistors.

The reconstructed motor neutral voltage is compared to each BEMF signal to determine the zero-crossing events. A zero-crossing event exists when the BEMF signals are equal to the motor neutral point.

DSC-based system

Figure 3: DSC-based system.


Implementing the algorithm

The first task is sampling the BEMF signals. To achieve this, the DSC’s ADC is configured in such a way that it simultaneously samples the BEMF signals at a sampling rate equal to the DSC’s Pulse-Width Modulator (PWM) reload frequency. Hence, the ADC is synchronized with the PWM reload event.

The ADC samples at the PWM ON time, with the purpose of avoiding the ringing noise produced by the electronic switches. The point at which the signals are sampled is variable across the PWM ON time, depending on the motor speed.

The motor neutral point is then reconstructed and compared to the BEMF signals. The produced signals with these software comparisons still have some noise, which will be filtered out using a majority function.

Digital filter: the majority function

This BEMF filtering method is a non-linear digital filter called a majority function. The majority function is a Boolean function that takes a number n of binary inputs and returns the value that is most common among them. It can be expressed as follows:



The first stage of the majority-function filter is achieved by two logic operations; the first operator (AND) detects the active BEMF signal. The second operator (XOR) detects the falling and rising edges on the active BEMF signal. The output of these two operations is then called the “active-masked BEMF” signal.

The active-masked BEMF signal is then filtered using the majority-detection filter. This filter is implemented with an array compounded by 64 values and a special logic test condition, which is used to modify the pointer of the next data value.

There are 64 values that represent the 26 possible combinations that the six-sample window could have for the active-masked BEMF signal. Each value in the look-up table is a pointer to the next possible six-sample window. Figure 4 shows how the six-sample window is updated according to the BEMF signal.

The filter is always looking for a true-to-false change at the output of the logic test condition. If this true-to-false condition is detected, then the filter looks for three consecutive false states to validate that a zero-crossing event occurred. A true-to-false condition at the output of the logic test condition represents a commutation on the motor; hence a new BEMF signal is then monitored.

Six-sample window

Figure 4: Six-sample window.


There are 16 unique index values that represent the true-to-false condition. These values are 24, 25, 26, 28, 40, 41, 42, 44, 48, 49, 50, 52, 56, 57, 58, and 60. These unique values are replaced by 1, in order to indicate that a true-to-false condition occurred.

Sixteen unique values are selected using the following majority-function criteria. A number is a unique value when its binary representation contains a majority of one in the three most significant bits, followed by a majority of zeros.

The 48 remaining numbers are pointers to the unique values, in case a true-to-false condition occurs. There are some values that never point to any of the unique values because they are not multiples of any of the 16 unique numbers. Those numbers are then pointed to their multiples and trapped into a loop in such a way that the filter is waiting for a new value that points to one of the 16 unique numbers. Figure 5 shows a block diagram of the complete majority filter.

Filtering the BEMF signals

Figure 5: Filtering the BEMF signals.

An interesting property of BLDC motors is that they will operate synchronously, to a certain extent. This means that for a given load, applied voltage and commutation rate, the motor will maintain open-loop lock with the commutation rate; provided that these three variables do not deviate from the ideal by a significant amount. In real implementations, Proportional Integral and Differential (PID) control loops are utilized to control these variables.

Powerful and cost-effective DSP engines have made it possible to efficiently control the torque and speed demands in sensorless applications. Digital Signal Controllers are very well suited in applications where efficiency, high performance, and cost are key requirements.

This article is intended for the developer who wants to drive a sensorless BLDC motor using a new motor-control technique. This technique eliminates the use of discrete, low-pass filtering hardware or off-chip comparators, while providing high efficiency and excellent performance.
Convergence Logo

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Corporation or official policies of Digi-Key Corporation.