Hall sensors, encoders, resolvers, or sensorless operation: how does the controller know the motor's position?
A motor with magnets only operates correctly if the controller sends the current to the right place, meaning based on the exact position of the rotor. There are four main ways to determine this position. These methods vary in price, accuracy, and how they react to factors like standstill, high speed, water, or heat.
The essentials
- Hall sensors: These are simple and inexpensive, providing position information in 60° electrical increments, which is sufficient for a good initial start.
- Encoder: Provides precise and continuous position feedback, ideal for vector control at all speeds.
- Resolver: Highly resistant to heat and vibrations, making it the preferred choice for automotive applications.
- Sensorless: The position is calculated based on voltage and current readings; it works well while riding, but can be more challenging when stationary.
Why is position so important?
The torque of a permanent magnet motor is maximized when the magnetic field created by the windings is 90 degrees electrically out of phase with the magnetic field of the magnets. A few degrees of error results in a slight loss of torque; a larger error can cause the motor to "cog" or even brake instead of providing forward motion. Our guide on vector control (FOC) details this mechanism.
Attention: We are talking about *electrical* degrees here. A motor with multiple pole pairs makes multiple electrical rotations per mechanical rotation. On an electric scooter hub motor, which has many poles, a small mechanical error can become a significant electrical error.
Hall effect sensors
Three small sensors, located within the stator, detect the passage of the magnets on the rotor. Each sensor switches between two states; together, they divide each electrical rotation into six sectors of 60°.
- Advantages: very affordable, simple to wire (five wires), known position even when stopped, resulting in smooth starts.
- Limitations: Rough accuracy, sensitive to humidity, heat, and damaged wires.
This is the standard equipment for scooter and bicycle motors. In vector control mode, the controller interpolates the position between two state changes to obtain a continuous angle. A faulty Hall sensor will produce the symptoms described in our guide on motors that jerk or stutter.
Encoders
A sensor measures the rotor angle precisely, often with thousands of steps per revolution. Two main types are commonly used:
- Magnetic encoders: A chip reads the orientation of a small magnet attached to the end of the shaft. Compact and inexpensive, they often provide an absolute position reading as soon as power is applied;
- Incremental encoders, whether optical or magnetic: they count pulses and require a reference to determine the absolute position.
With an encoder, vector control provides precise control from standstill to maximum speed. They are commonly found on motorcycle, kart, robot, and racing machine motors. They require careful installation: an encoder that slips on the shaft will shift the entire control system.
Resolvers
A resolver is a small, rotating transformer located within the motor, without any electronics inside. The controller supplies it with an alternating signal and reads two feedback signals from it, from which it determines the angle.
- Advantages: Highly resistant to heat, vibrations, and electrical disturbances; absolute positioning.
- Limitations: It is more bulky and more expensive, and it requires a dedicated read circuit within the controller.
This is the reference sensor for electric vehicles, where motors get very hot and spin at high speeds.
Sensorless
The controller can also estimate the position without any sensors, based on what it already measures: the voltages it applies and the currents flowing. A calculation called an "observer" reconstructs the voltage produced by the motor as it rotates, and from that, deduces the angle.
- Advantages: No sensors to install, wire, or protect; very precise at medium and high speeds.
- Limitations: When the motor is at a standstill, it does not produce any voltage, so the observer has nothing to measure. Starting under a heavy load is less smooth.
Advanced techniques, such as injecting a high-frequency signal, allow for position estimation even when the motor is stationary, by exploiting the small differences in inductance of the motor depending on the angle. These techniques work best when the motor has a significant saliency, such as internally magnetized motors.
The comparison
| Hall | Encoder | Resolver | Sensorless | |
|---|---|---|---|---|
| Accuracy | Low (60° electric angle) | Raised | Raised | Raised by riding |
| At standstill | Yes | Yes | Yes | Difficult |
| Robustness | Average | Average to good | Excellent | Nothing to break |
| Cost | Very low | Low to medium | Raised | Nothing |
| Typical usage | Scooters, bicycles | Motorcycle, kart, robot, track | Automobile | Drones, fans, and pumps |
The best of both worlds
Many controllers combine these solutions: they use Hall sensors at startup and at low speeds, then switch to sensorless estimation as soon as the motor spins fast enough. This results in a smooth start and precise control at high speeds. This is the typical operation of a VESC controller on a scooter motor, configured during the motor detection process.
Frequently Asked Questions
Is it possible to add an encoder to a scooter motor?
It's challenging with a hub motor: the axle is fixed, and it's the rim that rotates, which makes it difficult to install a traditional encoder. Hall sensors, combined with sensorless estimation while riding, already provide very good results.
Why does my motor start poorly without Hall sensors?
Because when the motor is at a standstill, it doesn't produce any voltage, the controller cannot calculate its position. It has to spin it slightly "blindly" to find it, which results in a hesitant start under load.
Can a Hall sensor become miscalibrated?
It can deteriorate due to heat or humidity, or become dislodged if its adhesive fails. A sensor that malfunctions at the wrong time can cause the motor to be noisy, less efficient, and to overheat.