In my quest to build an electric scooter from the ground up, the first step is to build a speed controller for the motor. Given that brushless DC motors (BLDC) are readily available in hobby shops, are high efficiency, and relatively inexpensive, the plan is to build a controller for a BLDC motor.

The brushless DC motor is a high-efficiency motor which uses permanent magnets on the rotor, and electromagnets on the stator to control the rotation of the rotor. The rotor and stator are only attached via bearings which support the rotor as it spins; the small contact area allows for the high efficiency of the motor.

In order to make the rotor spin in a desired direction, the electromagnets must be activated in a certain order to attract the magnets on the rotor to the electromagnets on the stator. This magnetic attraction is what causes the rotor to spin, and the sequence of steps is called the commutation sequence.

Animation showing BLDC commutation

In the animation above. you can see that as the stators are energized in order, the rotor “chases” the magnetic fields. This is the basic commutation sequence for BLDC motors.

In order to maximize torque on the rotor, the field applied by the stator should be at an angle of 90 degrees to the orientation of the rotor. The relationship between torque , magnetic moment of the rotor, and the field supplied by the stator is

The cross product is at is greatest when the vectors are at right angles to each other. The control algorithm used to try to maintain the 90 degree separation is called field-oriented control (FOC).


Design

Common battery packs for hobby electronics don’t usually exceed 60V, so the main parts I chose were:

This is the render after wrapping up the rest of the schematics and laying out the PCB. The PCB has four layers - signal on the top and bottom, and power and ground planes in the middle. The signal layers have copper pours to handle the large current loads the MOSFETs will experience.

Rendering of the v1 ESC

I got the boards made through OSH Park, and one day they finally arrived in the mail. Bare PCBs from OSH Park

After soldering a minimal amount of components to a board and debugging it for a while, I finally got LEDs to blink. Microcontroller on the v1 ESC working for the first time

More coming soon…

last updated June 29, 2020