COMP_PWM and SimonK ESC firmware – part 2

COMP_PWM is an option on SimonK ESC firmware for sensorless brushless DC motors (Kirby 2011),

This article looks at the current waveforms resulting from that implementation, and is an expansion of (Duffy 2014).

COMP_PWM-H

Above is a capture of the current waveform into a motor terminal during the time when the high side FET is on for the whole commutation phase. The average motor current is 1A, throttle is low and the short period when current is rising steadily is the PWM ON time.

The shunt resistor used for sensing current is 1mΩ, so each division on the scope is 10A.

COMP_PWM-L

Above is a capture of the current on the ‘other’ motor terminal when it is being modulated with COMP_PWM drive. The short period when the current is decreasing, or growing negatively is the PWM ON time.

During the PWM on time, current flows from the battery via the high side FET on the ‘other’ end of the coil pair, the coil pair and to the motor terminal shown in the figure above. Current out of the coil pair (negative polarity) grows to about 4A when the low side FET is turned OFF.

The coil pair has significant energy stored in its magnetic field, and the collapsing field will develop a back emf in the coil pair that will drive current out of this coil terminal, through the body diode of the high side FET connected to this terminal, then via the + rail to the high side FET at the ‘other’ end of the coil pair and back to the coil pair.

Very shortly (hundreds of ns) after the low side FET is turned OFF, the high side FET connected to this terminal is turned ON, providing a lower resistance path for the coil discharge current discussed in the last paragraph. The energy stored in the coil pair is quickly discharged, about 2µs in this case.

The coil pair voltage also includes a component due to the coil cutting the rotating permanent magnet field of the rotor. This induced voltage continues to drive a current around the same path but in the opposite direction so it produces a retarding or braking torque. Looking at the scope capture, this current grows to about 2A into this coil terminal.

To start the next PWM cycle, the high side FET on this terminal is turned OFF, coil discharge commences via the low FET body diode,  and very shortly afterwards the low side FET is turned ON and current again flows out of this terminal producing  positive torque. At the very start of this phase for a short period, current flows into this terminal (as it changes from about +2A to 0A) and eventually back towards the battery via the high side FET at the other end of the coil pair.  A battery can accommodate this reverse current, some types of power supplies may not.

If you followed the explanation, you should be able to draw out the relevant parts of the H bridge and identify 6 phases / paths of current during a single PWM cycle:

  1. +, LH Hi side FET, coil pair, RH Lo side FET, -;
  2. +, LH Hi side FET, coil pair, RH Hi side diode, +;
  3. +, LH Hi side FET, coil pair, RH Hi side FET, +;
  4. +, RH Hi side FET, coil pair, LH Hi side FET, +;
  5. -, RH Lo side diode, coil pair, LH Hi side FET, +; and
  6. -, RH Lo side FET, coil pair, LH Hi side FET, +.

Phase 1 draws current from the supply, phases 5 and 6 return current to the supply, the other phases (2, 3 and 4) are current loops within the bridge. (The diodes mentioned are within the FET package.)

Phases 2 and 5 occur because of deliberate switching delays to ensure that the Hi side and Lo side FETs do not conduct at the same time. Faster FETs work best.

In the case of COMP_PWM=0, only phases 1 and 2 exist, and there  a zero current wait between substantial completion of phase 2 discharge and the start of the next PWM cycle.

References

  • Duffy, O. 2014. COMP_PWM and SimonK ESC firmware http://owenduffy.net/blog/?p=59 (accessed 30/03/2014).
  • Kirby, S. 2011.SimonK ESC firmware. https://github.com/sim-/tgy (accessed 30/04/2014).