-
Quentin Bolsee authoredQuentin Bolsee authored
MachineKit BLDC Driver
See: Circuit Development, and Code Development
Background, Motivation
This project is largely a follow-on to my Teensy-Powered Brushless Motor Controller, and with this new work, may the TESC project RIP. A moment of silence.
TESC, April 2016 - August 2016
As the world turns,
so did those motors.
Once around is never enough
Eulagies aside, I am still motivated to do this. Brushless motors are the go-to motive force for electromechanical systems. By that I mean that just about any time you see a robot-like thing, or machine, moving about, there's a big likelihood that the thing doing-the-moving has a brushless motor in it's guts - or some variant thereof (stepper motors count as BLDCs in my books). See this characterization of actuators to get a sense for why.
An Overview of BLDC Drive
Electric Motors actuate with a rotating a magnetic field.
In relation to Ashby's fundamental actuator types, brushless or brushed electric motors are effectively continuously-rotating solenoids.
We have something with magnets, and something else with electromagnets, we use the electromagnets to rotate the field, we pull the magnets along. Rotating the field is called Commutating the motor, and can be done mechanically or electrically. With mechanical commutation, we have Brushed DC Motors, with electrical, Brushless DC Motors.
Brushed Motors rotate the magnetic field using 'brushes'
Brushes are mechanical switches that use the motor's own rotation to change the magnetic field. Super neat. Here's a link to Sparkfun's explanation.
And a GIF. While the rotor rotates, different switches are connected to current, and the coils - to - pads relationship is set up such that the current will cause the motor to rotate. Pardon my abbreviated explanation.
Brushes make motors very simple. You just pump voltage (in time, current) through the rotor, and things happen. However, there are resistive losses at the brushes, as well as friction losses.
Brushless Motors rotate the magnetic field with switches.
Power transistor technology means that we can do this electronically - use a computer (or simple timer) to switch the phases.
So we can make the coils stationary, and 'artificially' switch the direction and timing of current flowing through them.
Here's an example of '6-step' commutation. This is incredibly common for speed control, and simpler devices, as it requires very little processor work. It can also be done in an open-loop fashion, where we blindly switch currents at a set rate to control for speed.
Here's a nice GIF of sinusoidal commutation (where phase currents follow a nice, smooth wave). This is more ideal than 6-step commutation for a number of reasons, some of which are discussed in the next section. Mostly, we get to use more of each coil (we have all three on simultaneously) and we have finer control over the magnetic vector.
We can see the three current vectors (that translate into a combined magnetic field vector). The permanent magnetic field of the rotor follows this electromagnetic field around.
Digikey has a nice article on sinusoid control here.
Control
Control of Brushed DC motors is straightforward, we use one Full H-Bridge to drive current in both directions across the coils.
However, a brushless motor requires a bit more thinking. We use three Half H-Bridges to source and sink current between the three coils, each having a common connnection to one another.