Using BLDC Hall Sensors as Position Encoders – Part 1
The anatomy and operation of BLDC Hub Motors with Hall Effect Sensors
The following information is intended to assist in interpreting Hall sensor logical output for the purposes of determining position, direction and speed. Although the output can be used for motor commutation, that aspect of BLDC motor operation is not explained here.
Overview
Some BLDC (Brushless DC) motors are equipped with three internal hall-effect sensors that provide feedback to external circuits that facilitate precise control of the magnetic coils in the stator. Some types of BLDC controllers use the motor’s intrinsic Back EMF leaving the hall-effect sensors unused. In either case, the hall sensors can also be used for accurate position sensing.
A popular BLDC motor is the type used in personal transportation such as motorized skateboards, hoverboards, scooters, and compact bicycles. For this example, a 10-inch diameter, single shaft hub motor commonly found in self-balancing hoverboards is used (Figure 1). This type of motor is a heavy duty out-runner BLDC, meaning that the shaft mounted stator is stationary while the motor housing rotates.
Figure 1
BLDC Anatomy
The BLDC hub motor used in this experiment utilizes 27 electro-magnetic stator coils and 30 permanent magnets (also referred to as 15 pole pairs) (Figure 2). Many diagrams show the Hall effect sensors labeled as U, V, and W spaced equidistant (120 degrees) around the stator coils. Sensors are located equidistant from each other, but most are located on one side of the stator (Figure 3).
Figure 2
Figure 3
Note: The sensor labels (U, V, W) are assigned based on internal wire color code. For this experiment, sensor labeling is arbitrary.
The magic of 3 in BLDCs
As seen in Figure 3, the Hall sensors are centered in the coil faces. The center-to-center span between any two sensors is three coils, which results in 40 degrees of separation.
2 full coils + 2 half coils = 3 coil span
360 degrees / 27 coils * 3 coil span = 40 degrees
This configuration yields the same output values as if the sensors were physically 120 degrees apart. One third of the magnets will pass by each of the sensors resulting in 10 pulses from each sensor. Together, the sensors will deliver 30 pulses per 120 degrees or 90 pulses in one complete revolution.
9/27 (Coils) = 10/30 (Magnets) = 120/360 (degrees) = 30/90 (pulses) = 1/3 (of one rotation). Neat!
Figure 4
Note: Pulses are a transition of output from high to low or vice versa. Although together the sensors deliver 90 pulses per revolution, a total of 15 high and 15 low pulses (15 pole pairs) per sensor results in 6 unique binary combinations (90 pulses / 15 pairs = 6). See Figure 4 for clarification.
The sensor values are determined immediately following any transition from high to low or low to high. In one sensor cycle, each sensor has one high transition and one low transition resulting in six total transitions and six binary combinations. Due to the offset created by having 27 coils spaced across 30 magnets, the sensor outputs are never all high (111) or all low (000) at the same time.
Summary
No matter which single sensor output square wave is examined following a transition, one of the remaining sensors is trailing while the other is leading (one is high while the other is low). It is for this reason that it does not matter which arrangement of sensor outputs you use when reading values. The only effected calculation is direction of rotation.
The animated illustration (Figure 5) shows the sensor output at each transition and the relationship between the ten permanent magnets and the three sensored coils. Non-sensored, intermediate coils are omitted for visual clarity.
Figure 5
Additional Resources:
Using BLDC Hall Sensors as Position Encoders
Part 2 – Using a Digilent Analog Discovery 2 analyzer to visualize BLDC Hall sensor output
Part 3 – Using a Teensy 3.5 microcontroller to calculate position, direction, and distance

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum