Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

motor_driver

Three-phase BLDC gate driver firmware for the ESP32, using the hardware MCPWM unit and IR2110 half-bridge drivers.

C++

last commit repo size top language language count


What this is

Firmware for driving a three-phase brushless motor from an ESP32, written against the ESP-IDF MCPWM peripheral rather than software PWM. Each phase is switched through an IR2110 high and low side gate driver.

Built with PlatformIO.

Pin map

Taken from src/main.cpp. Check this against your board before you power a bridge, because a mismatch here shorts a half bridge through both FETs.

Phase High side Low side Gate driver
1 GPIO 23 GPIO 22 IR2110 #1
2 GPIO 21 GPIO 19 IR2110 #2
3 GPIO 18 GPIO 5 IR2110 #3

Current sense inputs are defined in the same file alongside the gate pins.

Why MCPWM

The ESP32 MCPWM unit generates complementary pairs with a hardware dead time. Dead time in hardware is not a convenience here: if both FETs of a half bridge conduct at once, even briefly, the bridge shoots through. Doing it in software means a scheduling hiccup can destroy hardware.

Building

pio run                 # build
pio run --target upload # flash
pio device monitor      # serial output

Board and framework settings are in platformio.ini.

Safety

Bring the bus up on a current-limited supply the first time, and keep the motor uncoupled. A wrong phase order is recoverable; a shoot-through is not.

Part of

The Voltaris electric vehicle project, alongside AKS for vehicle control and dashboard for telemetry.

Repository layout

motor_driver/
├── .vscode/
├── src/
├── platformio.ini

4 tracked files · 0.0 MB · 1 languages · last pushed 2025-07-06

About

ESP32 three-phase BLDC motor driver firmware using hardware MCPWM and IR2110 gate drivers

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages