DevBriX
Embedded Hardware · Firmware

Custom BLDC Motor Controller

Designed and built a custom BLDC motor speed controller from power board and MOSFET driver to PID firmware, touchscreen UI, and calibrated validation.

Custom BLDC Motor Controller

Overview

This project delivered an end-to-end BLDC motor controller combining a 2-layer control PCB, STM32G473 motor-control MCU, 3-phase MOSFET bridge, QSPI flash, touchscreen interface, and FreeRTOS-based firmware.

Highlights

  • Closed-loop PID speed control
  • Touchscreen and physical-button interface
  • Hardware-level brake, STOP, and over-speed safety
  • Validated against a laser tachometer reference

Challenges

  • Stabilize PID speed control against noisy frequency feedback.
  • Synchronize motor, display, and button tasks without race conditions.
  • Design a clean 3-phase MOSFET driver with gate-drive, switching-noise, and isolation considerations.
  • Boot firmware from external QSPI flash using a custom External Loader.

Solutions

  • Integrated MCU, driver, power, display, and inputs on one compact 2-layer PCB.
  • Separated motor, screen, and button workflows with FreeRTOS tasks protected by mutexes and semaphores.
  • Used TIM2 input capture, low-pass speed estimation, bounded PID output, and anti-windup control.
  • Cross-checked commanded RPM, on-screen RPM, and non-contact laser tachometer measurements.

Features

  • Manual hold, auto ramp with countdown, recalibration, STOP, and over-speed brake modes.
  • ST7796 LCD with FT6336 capacitive touch.
  • 24V/12V power input with integrated motor-control electronics.

Key Results

  • Working prototype built and tested on real hardware.
  • Closed-loop accuracy validated against calibrated reference measurements.
  • Hardware, driver electronics, and firmware delivered under one roof.

This project delivered an end-to-end BLDC motor controller combining a 2-layer control PCB, STM32G473 motor-control MCU, 3-phase MOSFET bridge, QSPI flash, touchscreen interface, and FreeRTOS-based firmware.

Integrated MCU, driver, power, display, and inputs on one compact 2-layer PCB.

Separated motor, screen, and button workflows with FreeRTOS tasks protected by mutexes and semaphores.

Working prototype built and tested on real hardware.