Another Ambassador Moment: BLDC Motor Control
The motor controller manages the speed and direction of the motor by modifying the amount of current flowing through the three coils of our brushless DC motor. The main objective is to make the motor run with high efficiency, which is achieved by maximizing the torque applied to the magnetic rotor.
MC - motor controller
BLDC - brushless DC motor
FOC - field-oriented control
FET - field effect transistor, treat as an electrical switch
IC - integrated circuit, semiconductor circuit that performs some task
Driver - integrated circuit that provides the necessary current to drive a motor
uC or MCU - microcontroller
PCB - printed circuit board
VESC - VESC project is an open source BLDC motor controller project that includes a circuit board and a software GUI. The VESC software is designed to work with a wide variety of hardware, from very low power to very high power
Design Requirements and Key Parameters
We used a Koford Motor (model 129H42A), which is a 24 V, 10 pole BLDC motor. This motor is supplied with 3 hall sensors. It has a max no load speed of 1040 rpm and peak power output of 390 W. For our purposes, we have estimated a max current of 20 A, meaning the MC must have output power of 480 W.
The motor controller can be broken into hardware and software components. The hardware component has 3 main stages. In the first stage, we have a microcontroller which generates the necessary PWM signals needed to spin the motor. It also processes feedback from the power stage and inputs from the hall sensors and throttle. Since the microcontroller can only generate output signals with current on the order of milliamps, we need a driver stage that amplifies the current so that it is large enough to drive a motor. Lastly, we have a power stage with 3 pairs of high/low-side FETs. The connections between the FETs in each pair are taken as the phase signals to the motor. Our software is in charge of using inputs to generate the proper PWM signals.
Hardware & Schematic
There are 3 primary methods of BLDC motor control: trapezoidal, sinusoidal, and field oriented control. Trapezoidal is the easiest; it applies a high voltage to one phase, a low to another and floats the third phase. There are 6 possible states and it changes a state every 60 degrees. Sinusoidal requires a continuous rotor angle estimate rather than knowing within 60° what the rotor angle is. It knows the specific angle by sensing the specific feedback current. You also use a rotor angle estimation in FOC. In FOC, first you transform the 3 measured phase currents into a 2D representation using the Clarke transform. Then, you transform these into a rotating coordinate frame with the Park transform using the rotor angle. Since we cannot configure the Koford motor with sensorless or sensored mode, we can only use FOC. After we increase the ramp time, we are able to achieve smooth spinning. We use the code from the VESC gui, firmware version 3.33.
We used an incremental testing plan. For assembly, we tested connections after each component was soldered. For each IC, we tested that each pin had a good connection to the pad. We tested the connection of the thermal pad to ground later on when powering the chip. After testing the soldering, we powered the chip, and checked that the fault pin on the driver was not low. We then worked to upload the bootloader to the MCU. After doing so, we worked to upload the firmware. We verified that it was successful by connecting our board to the GUI, and updating the configuration from there. We then worked on receiving a motor detection result. The motor seems to move a bit, but gets stuck. We are currently working to debug the issue, which may be because of a power surge and ill-rated FETs. When choosing our FETs, we did not account for ripple, which could push the voltage above 30 V when we supply 24 V. We plan to test our motor controller on a lower voltage motor.
Key Parts and Components