Designing Reliable Sensorless BLDC Controllers
Unlock the secrets of building robust, sensorless BLDC motor controllers in this hands-on guide. From tackling startup challenges with zero back-EMF to precise back-EMF zero-cross detection, practical filtering techniques, and smooth open-loop ramping, this article walks you through every step of a reliable sensorless 6-step drive. Packed with real-world hardware tips, firmware strategies, and oscilloscope diagnostics, it’s the ultimate blueprint for engineers aiming to prototype BLDC drives that start cons
In 120° commutation, two phases are actively driven at a time (one high, one low, the third floating) for each 60° segment of the electrical cycle. The motor’s permanent magnets and winding layout are chosen so that the induced back-EMF in each phase winding is approximately trapezoidal. Its magnitude is directly proportional to rotor speed. Thus at standstill there is no back-EMF and the drive is effectively open-loop; once the rotor spins, back-EMF ramps up and crosses zero predictably.
Va + Vb + Vc = 3·Vn (neutral).
- Rotor Alignment (Lock-in): Apply a DC current (or a low-frequency AC) to two phases to “lock” the rotor to a known angle. For example, turn on Phase A high and Phase C low (Phase B off) for a fixed 50–200 ms. The permanent magnets will settle so that the rotor aligns with the resulting stator field. Current must be enough to overcome friction/inertia, but not so large that the rotor overshoots. After alignment, turn off drive (three-phase off) so the rotor can settle. This guarantees a known starting position (within some degrees). Freescale notes that fan-type loads (light inertia) might only need a brief, moderate current to align, while heavy loads or cogging motors may need more torque or longer pulses. A common implementation is to ramp the PWM duty from 0 up to a set value during the align period to avoid a sudden torque jerk. If done properly, alignment ensures a deterministic initial angle.
- Blind Open-Loop Commutation (Ramping): After alignment, the controller drives the motor in an open-loop 6-step sequence, stepping through commutation sectors at a gradually increasing rate. Essentially the motor is driven like a stepper or synchronous motor. The frequency starts very low (e.g. 0.5–1 Hz electrical, well below where any measurable back-EMF is present) and ramps up. During this phase, the controller applies the standard commutation sequence (A–C, A–B, B–C, etc.) at each step, ignoring feedback. The ramp profile should be gentle enough that the rotor can follow (for example, increasing one step every few tens of ms). Freescale’s guides describe a scheme where a “Ramp” module generates commutation triggers through a mod6 counter until the motor speed is sufficient. By the time the rotation speed reaches a fraction of its rated speed (perhaps 10%), the back-EMF amplitude is high enough to detect.
In open-loop ramp you watch current draw: if the motor stalls (current spikes) or vibrates erratically, the ramp is too aggressive. Adjust the acceleration to match the motor’s mechanical time constant. A useful heuristic is to watch for the first signs of back-EMF (e.g. a small waveform on the floating phase); once it appears, transition to sensorless mode. In practice, the switch-over is often done at a preset RPM or when a solid zero-cross is detected consistently. - Slow First Cycle (“Half-Step Start”): A variation is to drive the first few commutations at half the normal frequency. The idea is to give the rotor a little inertia before full commutation speed. For example, after alignment, you might keep the first commutation length twice as long. This can help avoid the rotor “slipping” out of sync on the first step. It’s a simple tweak: program the first step’s timer to be longer than normal, then resume the planned ramp. Not mandatory, but some builders find it smooths the initial pull-away.
- Initial Position Detection (IPD): Instead of aligning, another approach is to try to sense the initial rotor angle by measuring motor inductances. The rotor’s position affects each winding’s inductance (due to magnet alignment and saturation). In an IPD routine, the controller injects brief current pulses into specific phases and measures the current rise time or voltage response. For example, one pulse is applied to Phase A (Phases B/C off) and the current slope is recorded. Then a similar pulse is applied to Phase B, etc. The rotor position that aligns Phases A and B with the strongest coupling will yield the fastest current rise (lowest impedance). From these timing differences, the controller estimates which sector the rotor is in.
TI explains it as applying current pulses and measuring time to a threshold: a shorter pulse to reach the same current means lower inductance on that phase. The trade-offs: IPD can start the motor faster and avoids the small backward spin risk of alignment. However, it requires that the motor’s L(θ) variation is significant and that the driver can handle high current pulses. It also usually needs a stable stationary rotor (no movement during pulses). In integrated motor-driver ICs (like TI’s DRV10983/987), IPD algorithms in firmware use configurable pulse widths and thresholds. In discrete designs, you can implement it by PWM bursts: e.g. drive Phase A high for 1ms (with current limit), measure ADC, then do Phase B, etc. A lookup or calculation then yields the likely starting sector. - Hybrid Methods: Some systems use both align and a bit of ramp (“align+go”). For example, give a short alignment, then immediately step commutation at moderate speed, and switch to closed-loop once back-EMF is good. Freescale’s app notes describe two “acquisition methods”: Method 1 ramps up and captures ZC events mid-ramp; Method 2 goes to a fixed “ramp end” speed and then looks for the first zero-cross to sync. The first method (ramp until detection) is faster and robust to load, but needs careful tuning of the ramp rate. The second (fixed ramp and then detect) is slower but more controlled (less chance of overshoot). In any case, once you decide the speed and method, you program the firmware to start looking for the first valid zero-cross. Upon capturing it, the software re-synchronizes the timing (calculating the period) and enters closed-loop control.
- Dynamic Commutation Advance: As noted, a fixed ~30° offset works, but many controllers actually vary this advance with speed. At low speeds, a smaller advance may suffice; at high speeds and heavy loads, additional lead (up to 60° or more) can maximize torque. A lookup table or simple proportional rule (e.g. advance = k * speed) is often employed. For example, the DRV10987 (TI) allows programmable advance via registers. In a simple design, one might scale advance linearly from 0° at startup to +45° at maximum rated RPM. The key is to keep the stator field in sync with the rotor’s motion. In practice, tune this by observing the current draw or efficiency at different loads and speeds: if the motor seems sluggish at high RPM, add more advance (within safe bounds). The reference manuals mention up to 60 electrical degrees can be used for high-speed efficiency.
- Overcurrent and Short Protection: Always include fast current sensing. A shunt resistor plus amplifier (e.g. INA240) or a Hall-effect sensor can detect overcurrent. If the sense exceeds a threshold (set for the MOSFETs’ rating), immediately gate-turn-off all switches. Many controllers use a dedicated comparator or the MCU’s built-in analog watchdog on the current sense. A brief comparator blanking during switching may be needed to ignore harmless spikes. For motor drive ICs like the IR2101/2110 gate drivers, ensure undervoltage lockout is enabled, and use their fault outputs. In firmware, you may also implement a slow analog-speed loop that cuts power if the motor fails to spin (a “stall” condition), to avoid runaway current.
- Regeneration and Braking: If the application needs deceleration, implement regen by shorting the phases or directing current back to the supply (if possible). In simple fan drives, often the motor is just allowed to free-wheel with synchronous diode braking. At minimum, ensure all MOSFET body diodes are rated for current. Some motor drivers add extra diodes or dynamic braking resistors. Thermal protection on the FETs (or MCU) is also advisable; measure PCB temperature during prolonged operation.
- Low-Speed and Low-Voltage Issues: At very low speeds or near supply voltage limits, the BEMF signals can get too small. Designs may switch to an observer or add more gain to the ADC sampling. Some controllers automatically increase filter bandwidth (shorter filter time constants) at low RPM to catch the slightest slope. If you observe false commutations at near zero speed, you might add a “min speed lock-out” – simply hold the motor in open-loop or align if speed is under a threshold. For example, once back-EMF crossing intervals become erratic, reset to the alignment routine.
- High-Speed Considerations: At high electrical frequencies, both the controller’s computation and the analog filters must keep up. Ensure the ADC sampling rate is at least a few times the maximum commutation frequency. In hardware, minimize filter capacitors so they don’t excessively delay the signal. Many designs also sample on-time rather than off-time at high speed to ensure the floating phase is relatively steady. Double-check that the gate drivers and MOSFETs can switch fast enough (minimal gate-charge) for the intended RPM.
- Testing Under Disturbance: A rigorous build test involves varying the load abruptly. For a fan, strike the blades or use a dynamometer to change load torque. Confirm the controller remains stable and doesn’t “drop” commutations or overshoot. Also test sensorless transition: for example, pre-spinning the motor then engaging drive, or reversing spin abruptly, and see if the controller can re-sync. Logically, create a table of pitfalls and fixes:
- Failure Mode: Motor fails to start (just hums or vibrates).
Likely Cause: Alignment torque too low or too short; or ramp too aggressive causing slip.
Fix: Increase alignment duty or duration, lengthen ramp steps (slower acceleration). - No Back-EMF Detected: After some speed, commutation never switches to closed-loop.
Likely Cause: Filter or ADC threshold too high; missing virtual neutral reference.
Fix: Verify neutral calculation (for ADC method) or resistor divider. Lower the threshold/hysteresis. Add PWM blanking immediately after switching. - Erratic Commutation (noise): Motor runs but torque is rough at low speeds or under light load.
Likely Cause: EMI/PWM spikes mis-triggering.
Fix: Add more digital filtering, increase comparator hysteresis, or widen ADC sample averaging. Ensure proper grounding of sensors. - Overcurrent Trips: Drive immediately faults when switching.
Likely Cause: Dead-time too short causing shoot-through, or phase short.
Fix: Increase dead-time in gate PWM, check gate driver wiring. Make sure high/low FETs aren’t both on briefly. - Phase Sequence Wrong: Motor turns backward or vibrates despite proper commutation.
Likely Cause: Wiring of phases or mapping of signals is wrong.
Fix: Verify that each “sector” of commutation actually energizes the correct coils. Swap phase wires or code mapping.
- Failure Mode: Motor fails to start (just hums or vibrates).
- MCU: STM32F103 (32-bit, has several synchronized ADCs and timers) or Microchip dsPIC33F.
- Gate driver: IR2110 (two half-bridges) or IR2104, or discrete MOSFET gate drivers. These provide level-shifting for high-side gates.
- MOSFETs: Six N-channel FETs (e.g. 30–100 V, 10–50 A rating) in a 3-phase bridge. Provide adequate heat sinking.
- Current Sense: Shunt resistor + amplifier (e.g. AD8210, INA240) on the DC bus. Monitored by an ADC channel.
- Voltage Dividers: One divider per phase (e.g. 100k/3.9k) to scale 0–Vbus down to MCU’s 0–3.3 V range. Some designs use two large resistors in series per phase for safety (as in ST’s docs).
- PWM and Filtering: A 1–10 nF ceramic cap from each phase sense node to ground for filtering.
- Optional Comparators: If using hardware comparators, tie each phase divider to a comparator input and use a resistor ladder to generate the neutral/reference. Some MCUs have built-in comparators that can switch on PWM events.
- Initialization: Initialize ADCs, PWM timers, comparators. Configure synchronized ADC triggers at PWM center or off-time.
- ALIGN: Set PWM to hold two phases on (e.g. A high, C low). Ramp duty to target (or directly set it), wait a fixed time (e.g. 100 ms). This seats the rotor. Then disable PWM (zero torque) for a brief dwell.
- RAMP (Open-Loop): Enter a loop where at each timer interrupt you command the next commutation sector (advance the 6-step sequence). A “ramp” controller increases the commutation rate gradually. You may use a basic timer or code loop to step through sectors at increasing frequency. Continue until reaching a predetermined speed or until back-EMF detection is enabled.
- SENSORLESS RUN: Now monitor back-EMF. In each sector, watch the floating phase. When its voltage crosses the neutral, capture the time (or set a timer). Compute the next commutation delay as half the measured period (for 30°) minus known offsets (filter lag, CPU time) plus any phase-advance offset. Load this into a hardware timer. When that timer fires, switch to the next sector. Meanwhile, run a speed loop (PID) that adjusts PWM duty or ramp rate to reach the commanded speed.
- Loop: Continually repeat sensing and commutation. Monitor faults (overcurrent, overtemp) and handle accordingly.
This high-level flow shows the core idea: align, open-loop ramp, then zero-cross closed-loop with dynamic timing. The details (e.g. exactly how to measure period, filter values, etc.) depend on your MCU and tools. ST’s MotorControl library and TI’s C2000 examples all follow a similar pattern.
- Prototype Setup: Start with a known motor (e.g. a small BLDC fan motor) and a development board (e.g. STM32 “motor control” board or a dsPIC demo board with gate drivers). Assemble the inverter and sensing networks as per your design. Check gate drive and ADC channels with a multimeter before powering up.
- Alignment Check: Program the code so that on a button press it enters the ALIGN state. Without the rotor attached, scope the phase voltages to ensure you see a steady DC level on two phases and floating on the third. With the rotor installed (but disconnected from any load), run the alignment. You should hear/see the rotor pull to an end-stop. If it doesn’t, increase the align time or current. Refer to the alignment troubleshooting example from ST: in Fig.6 of the reference, insufficient alignment causes rising current but no movement.
- Open-Loop Ramp Test: After a successful align, try the ramp. Gradually increase the target frequency. Use a small sweep (0% to 20% speed) while watching phase voltages. You should see stepped voltages on each phase. The floating phase should begin to show a slight triangular waveform as speed increases. Adjust the ramp slope if the motor jerks or stalls. The ST troubleshooting guide notes that if acceleration is too low, the motor oscillates; if too high, it may slip out of sync.
- Sensorless Switch-Over: Once ramping up, enable the back-EMF detection code. Trigger commutations from ADC interrupts or comparators. On the scope, mark the zero-cross points. You should see the commutation (phase switch) happen roughly 30° after each zero-cross point. If it’s off, adjust your timing offsets. Check that each sector change has the expected phase waveform (Fig.25 in TI’s guide shows PWM-phase-BEMF coordination).
- Closed-Loop Run: Now apply some speed control (e.g. adjust a potentiometer reading in software for speed reference). Verify the drive maintains speed under small loads (press finger on rotor). If it wobbles or hunts, tweak the PI gains. Observe that the zero-cross events stay consistent. At higher speeds, ensure the commutation still locks on (filter delay becomes critical here).
- Fault Testing: Simulate faults. Short one phase by hand (with power off) to test overcurrent trip. Overload the motor (stall it) to see if current limiting works. Sudden loss of supply should gracefully fault (flyback diodes protect the FETs).
- Efficiency Measurement: If you have an oscilloscope and current probe, look at the phase currents and bus current. Check that current is roughly sinusoidal in one step (for a trapezoidal motor). Measure input power (Vbus × Ibus) vs shaft power (if you have a torque sensor) to gauge efficiency. Sensorless control should not significantly change efficiency, but improper timing or dead-time can.
- No Startup (just hums): Increase alignment voltage or time. Check that wiring to align phases is correct. Ensure the rotor is not locked mechanically. (ST advises increasing phase 1 current or duration).
- Stalls on Ramp: Lower acceleration (longer time per step) or increase holding current. If the rotor overshoots during alignment, reduce align current.
- No Zero Cross Detected: Verify neutral reference creation. Scope the floating phase on the oscilloscope to see if it ever crosses 1.65V (midpoint). If noise obscures it, improve filtering or averaging. Confirm the ADC range isn’t saturating.
- Random Commutation: If the motor mis-commutates, noise might be triggering false ZCs. Add comparator hysteresis or digital debounce (e.g. require the signal to stay above neutral for X microseconds). Also ensure sufficient blanking time after switching (ignore the first few microseconds of each sector).
- Motor Runs Backwards: This simply means your commutation table is reversed. Swap any two phase connections or invert the commutation order in code.

Discussion (0 commentaire(s))