Sunday, November 23, 2014

BLDC Motor Timing

BLDC Motors and Timing Adjustments


BLDC motors have a timing adjustments which governs how the controller relates the hall sensor signals to managing the commutation of the drive voltages.

The internal combustion engine (ICE) analogy is close but not exact.  Most distributors (or ignition systems) will vary the timing of the spark based on the speed of the engine and possibly the load (vacuum advance).  The theory being that as the engine speeds up the spark needs to occur earlier in the combustion cycle so that the fuel combustion has time to prior to the Top-Dead-Center (TDC) or the optimal combustion point.   This adjustment is done either electronically or by mechanically rotating the distributor so that the spark is advanced relative to the piston position in the cycle.

With BLDC motors, there is a similar situation, especially if the controller is not designed to advance the timing as load and RPMs increase.  The Kelly KHB72701 does not have such capability where controller costing 2x-3x more do.

After some mechanical testing by rotating the hall sensors mounted in the fan cowl of the Motenery ME0913 two observations were made
1. The motor ran quieter and smoother at lower RPMs
2. At higher RPMs (2K-3K), there was more power available as evident by better acceleration in the 20-35 MPH range in 3rd gear.  This an only be explained by increased efficiency of the motor.
3) In second gear, a top speed increase was observed, increasing from 31 MPH to close to 36 MPH.

The physics behind this is simple:  By energizing the phase coils when the rotating magnets are at the optimal point, will result in the maximum torque being generated by the motor for a given current. Energize too soon and the generated field is opposing the magnets,  Energize too late and the magnets are past their optimal position and thus some of the field is wasted.

The challenge comes in how to best control this timing across the operating range of RPMs.

As inspiration, I saw the board Burtie created called Timing Adjuster which does the necessary phase shifting of the hall signals with great success.  It is a excellent device but he has sold out of the units.  This lead to the need to create one from scratch.

Interface Circuit


This was built on the Uno Prototype shied and placed in a project box along with connectors to intercept the  timing signals coming from the motor to the controller.  A KiCad version will be coming soon.

ChipKit Uno32



Optimal Timing

The software running on the 80MHz Uno took a while to refine and optimize and ended up being fairly straightforward.  The code need to be fast enough so that the board could shift the edges of the timing signals a few microseconds.  Though the absolute shift is in 100s of  microsecond ramge. the board still need to be able to effect the transitions with reasonable accuracy.  In the end, the board is reporting about 1 microsecond accuracy based on loop time with the ability to change the shift time every 10,000 cycles (~10 ms).

Getting the timing right has been a interesting challenge.
1) There is about 2-3 mechanical degrees of shift in the motor's cowl which probably equates to about 10% electrical shift.  Kelly reports the motor has a 6 degree error tolerance, so absolute shift is not know.
2) The shifting scheme is the following
- No shift below 1,000 RPM
- Starting at 1,000 start shifting toward a 30 degrees electrical advance.  Using a smoothing algorithm, this ramps ups slowly and hits about 30 degrees around 2,000 RPM.
- A switch on the dash allows the driver to select different shifts ramps and turn of the shifter all together.
3) The only feedback is a rumbling that is audible with the timing to too advanced.
4) Testing will continue to seek the "best" curve for shifting across all RPMs.
5) Special Note.  When shifting is employed, it also improves the efficiency of the regenerative braking, so the braking had to be turned down since it was quite abrupt at the high phase shifts.  It may be worth trying to link the accelerator switch to the timing shift to turn off all shifting when the accelerator is released and braking starts.  The assumption is the timing will be able to adjust back quickly (currently adjustments are made every 100ms or so) so the driver does not perceive this change.

No comments: