Skip to the content
4 layers75 × 57 mmBench stm32 esc, the printed circuit board in 3D

Design and firmware for a high-performance STM32G474 brushless motor controller using field-oriented control and the DRV8353S gate driver.

Size
75 × 57 mm
Copper layers
4
Thickness
1.66 mm
Parts
184
Nets
139
Pads
616
Tracks, vias
752, 666
Pours
22
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
12 Apr 2026
Updated
24 Sep 2026

Overview

Bench stm32 esc is an open-source printed circuit board by JamesGossy, from the JamesGossy/STM32-Brushless-Motor-Controller repository on GitHub. It is a 4-layer board of 75 × 57 mm with 184 parts on 139 nets, routed with 752 tracks and 666 vias.

It is built around the TCAN1462VDRBRQ1, DRV8353SRTAR and AP2112K-3.3, with the TPD1E05U06DYAR, USBLC6-2P6 and IAUCN08S7N019ATMA1 among its other parts. Its parts include 73 capacitors, 56 resistors, 9 ICs, 7 connectors and 6 transistors. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

10

README

README.md

STM32 Brushless Motor Controller

A custom four-layer motor controller with bare-metal field-oriented control on an STM32G474. The project includes the PCB design, C firmware, a motor simulator and a live control dashboard.

Bench demo of a real motor running alongside the live telemetry dashboard

Real motor bench test with the live telemetry dashboard.

Engineering overview

  • Hardware: a 57 × 75 mm PCB with six MOSFETs, three low-side current shunts, absolute encoder feedback and CAN connectivity.
  • Control: 20 kHz d/q current loops and SVPWM, a 2 kHz speed loop, decoupling feedforward and field weakening.
  • Firmware: bare-metal C using CMSIS headers, with register-level peripheral drivers and no STM32 HAL dependency. The application code also runs in the software-in-the-loop simulator.
  • Calibration and protection: current-sense polarity and encoder calibration, stored settings, and checks for current, voltage, temperature, encoder and communication faults.
  • Tools: a browser dashboard for commands and telemetry, plus unit tests and simulated motor/fault scenarios.
mermaid
flowchart LR
    control["STM32G474<br/>Field-oriented control"]
    power["DRV8353S & MOSFETs<br/>Three-phase bridge"]
    motor["BLDC / PMSM motor"]
    control -->|PWM| power --> motor
    motor -->|Current & rotor position| control

    classDef controller fill:#eef2ff,stroke:#6366f1,color:#1e1b4b
    classDef drive fill:#ecfdf5,stroke:#059669,color:#064e3b
    class control controller
    class power,motor drive

Hardware

Top of the assembled board showing the MCU, gate driver and bulk capacitors Bottom of the assembled board showing the MOSFET bridge and current shunts

ItemDesign
MCUSTM32G474RET6, 170 MHz
Gate driverTI DRV8353S, configured over SPI
Input range12–60 V design target
Phase current25 A continuous design target; firmware defaults to a 20 A limit
MOSFETsSix IAUCN08S7N019ATMA1, 80 V
Current sensingThree 2 mΩ shunts with Kelvin connections
Position feedbackMA730 SPI encoder; external quadrature interface
PWMHRTIM, 20 kHz, 200 ns dead time
InterfacesCAN, USB CDC, UART and SWD
PCB57 × 75 mm, four layers

The layout keeps gate-drive loops short, separates current-sense connections from power routing, and uses copper pours and via arrays to distribute current and heat. KiCad sources and manufacturing files are in controller_hardware/.

Live dashboard

Browser dashboard controlling the simulated motor and plotting telemetry

The dashboard connects to either the simulator or a board over USB. It shows motor telemetry and accepts commands for speed, torque, calibration and fault handling. The GIF above shows the simulator.

Try the simulator

On Windows, run controller_firmware\tools\setup.bat to install missing tools, build the simulator and run tests. Then run controller_firmware\tools\dashboard.bat to open the dashboard.

For a manual build, install CMake, Ninja, a host C compiler and Python:

sh
cd controller_firmware
cmake --preset sim
cmake --build --preset sim
ctest --preset sim
python -m pip install -r tools/dashboard/requirements.txt
python tools/dashboard/plot_motor.py --sim

Open localhost:8988. In the dashboard console, run calibrate, then motor 3000 to request 3,000 rpm. Use motor off to stop. Simulator commands such as sim load 0.1 and sim lock on exercise load response and fault handling.

Build for the board

Install STM32CubeCLT and put its Arm compiler, CMake, Ninja and STM32 programmer on PATH. From controller_firmware/:

sh
cmake --preset default
cmake --build --preset default
cmake --build build --target flash

Flashing uses ST-Link over SWD. To connect the dashboard to the board:

sh
python tools/dashboard/plot_motor.py --serial COM5

Set the motor parameters and limits in app/config.h before running hardware. Start with a current-limited supply and an unloaded motor, then run calibration before requesting motion.

Validation and limits

C tests cover control maths, SVPWM, configuration, commands and telemetry. Software-in-the-loop tests exercise calibration, torque and speed response, field weakening, CAN control and fault handling. CI builds the firmware and runs simulator and dashboard tests on Linux and Windows.

The electrical ratings above are design targets; simulation does not establish continuous-current capability or thermal performance. This board revision has no on-board reverse-polarity protection, fuse or bus TVS.

Code guide

LocationContents
controller_hardware/KiCad schematics, PCB layout and manufacturing files
controller_firmware/app/FOC, control loops, calibration, commands and telemetry
controller_firmware/hal/stm32g474/HRTIM, ADC, encoder, gate-driver, CAN and USB drivers
controller_firmware/sim/Simulated hardware interface, motor model and TCP server
controller_firmware/tests/Unit and motor simulation tests
controller_firmware/tools/dashboard/Browser dashboard and Python bridge

MIT licensed. Copyright © 2026 James Goss.

Parts

184
QtyValueFootprintReferences
20100nFPCM_JLCPCB:C_0402C5, C11, C12, C20, C22, C30, C31, C33, C41, C46, C47, C48, C49, C50, C53, C64 +4
111uFPCM_JLCPCB:C_0402C13, C14, C15, C29, C36, C37, C42, C43, C45, C52, C93
10100ΩPCM_JLCPCB:R_0402R1, R2, R42, R44, R45, R46, R47, R48, R49, R56
9TestPointTestPoint:TestPoint_Pad_1.5x1.5mmTP1, TP6, TP7, TP8, TP9, TP10, TP11, TP12, TP13
610ΩPCM_JLCPCB:R_0402R25, R26, R27, R28, R31, R32
61nFPCM_JLCPCB:C_0402C21, C24, C25, C51, C66, C67
64.7uFPCM_JLCPCB:C_1206C68, C69, C70, C71, C72, C73
6IAUCN08S7N019ATMA1Package_TO_SOT_SMD:TDSON-8-1Q1, Q2, Q3, Q4, Q5, Q6
6NetTie_2NetTie:NetTie-2_SMD_Pad0.5mmNT1, NT2, NT3, NT4, NT5, NT6
510kΩPCM_JLCPCB:R_0402R22, R24, R43, R50, R53
52.2nFPCM_JLCPCB:C_0402C18, C26, C32, C39, C40
5EEHZC1K470Veasyeda2kicad:CAP-SMD_BD10.0-L10.3-W10.3-FDC1, C2, C3, C4, C7
41kΩPCM_JLCPCB:R_0402R34, R36, R41, R55
4MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
3100kΩPCM_JLCPCB:R_0402R6, R23, R51
31053141104easyeda2kicad:CONN-TH_4P-P2.50_MOLEX_1053141104CN1, CN2, CN3
310nFPCM_JLCPCB:C_0402C56, C57, C58
31uFPCM_JLCPCB:C_1206C23, C27, C28
32.7ΩPCM_JLCPCB:R_0805R7, R10, R13
32mΩResistor_SMD:R_2512_6332MetricR8, R9, R12
3330ΩPCM_JLCPCB:R_0402R3, R4, R5
3383kΩPCM_JLCPCB:R_0402R33, R35, R37
347nFPCM_JLCPCB:C_0402C61, C62, C63
347uFPCM_JLCPCB:C_1206C10, C17, C19
356ΩPCM_JLCPCB:R_0402R15, R16, R20
39.76kΩPCM_JLCPCB:R_0402R38, R39, R40
218pFPCM_JLCPCB:C_0402C85, C87
22.2uFPCM_JLCPCB:C_0402C54, C55
220kΩPCM_JLCPCB:R_0402R52, R54
24.7kΩPCM_JLCPCB:R_0402R17, R21
247nFPCM_JLCPCB:C_0603C6, C38
25.1kΩPCM_JLCPCB:R_0402R29, R30
2Tactile Button, 160gfPCM_JLCPCB:SW_TS-1088-AR02016S1, S2
2Thermistor_NTCPCM_JLCPCB:R_0603TH1, TH2
2~PCM_JLCPCB:FB_0603FB1, FB2
1120ΩPCM_JLCPCB:R_0402R14
119.1kΩPCM_JLCPCB:R_0402R11
1383kΩPCM_JLCPCB:R_0805R18
14.7uFPCM_JLCPCB:C_0402C44
19.76kΩPCM_JLCPCB:R_0805R19
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U6
1Conn_02x01Connector_PinHeader_2.54mm:PinHeader_2x01_P2.54mm_VerticalJ1
1Conn_ARM_SWD_TagConnect_TC2030-NLConnector:Tag-Connect_TC2030-IDC-NL_2x03_P1.27mm_VerticalJ3
1DRV8353SRTAReasyeda2kicad:WQFN-40_L6.0-W6.0-P0.50-TL-EP4.5U4
1FNR4020S8R2MTeasyeda2kicad:IND-SMD_L4.0-W4.0_FNR40XXSL1
1GRM32EC72A106KE05Leasyeda2kicad:C1210C9
1GreenPCM_JLCPCB:D_0805D2
1LM66200DRLReasyeda2kicad:SOT-583-8_L2.1-W1.2-P0.50-LS1.6-BLU5
1LMR51635YDDCReasyeda2kicad:SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BLU1
1MA730Package_DFN_QFN:QFN-16-1EP_3x3mm_P0.5mm_EP1.75x1.75mmU2
1NetTie_2NetTie:NetTie-2_SMD_Pad2.0mmNT7
1PESD2CAN,215easyeda2kicad:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRD3
1RedPCM_JLCPCB:D_0805D4
1STM32G474RETxPackage_QFP:LQFP-64_10x10mm_P0.5mmU7
1Screw_Terminal_01x05footprints:CUI_TB005_-762-05BEJ4
1TCAN1462VDRBRQ1easyeda2kicad:DFN-8_L3.0-W3.0-P0.65-TL-EP2.4U8
1TPD1E05U06DYAPCM_JLCPCB:D_SOD-523U3
1USBLC6-2P6Package_TO_SOT_SMD:SOT-666U20
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J2
1WhitePCM_JLCPCB:D_0603D1
1X322524MOB4SIeasyeda2kicad:CRYSTAL-SMD_4P-L3.2-W2.5-BLX1
1YellowPCM_JLCPCB:D_0805D6

Similar boards

  • 4 layers99 × 76 mmSuspension load daq, the printed circuit board in 3D

    Suspension load daq

    rcyaon/suspension-board

    suspension arm force logger for olin baja

    256 parts
  • 8 layersFoc control, the printed circuit board in 3D

    Foc control

    sujaygouda123/foc-control

    BLDC field-oriented-control board for a humanoid robot actuator. KiCad 10, Ø80 mm, 8 layers, 1.6 mm.

    104 parts
  • 4 layers50 × 40 mm2026 C AV FDR, the printed circuit board in 3D

    2026 C AV FDR

    EPFLRocketTeam/2026_C_AV_HARDWARE

    Repository containing PCBs files of FH2 Avionics

    101 parts
  • 4 layers110 × 59.1 mmMPPT Controller, the printed circuit board in 3D

    MPPT Controller

    lukatrisic/MPPT-Controller

    Full MPPT Controller with schematics, PCB layout and code

    92 parts
  • 4 layers209 × 100 mmCarControllerV3, the printed circuit board in 3D

    CarControllerV3

    Stefanhg/CarControllerV3

    Kewet/Buddy CarController unofficial V3

    233 parts1
  • 6 layers56 × 56 mmMoteus x1, the printed circuit board in 3D

    Moteus x1

    mjbots/moteus

    Brushless DC motor controller

    187 parts1.4kApache-2.0
  • 6 layers170 × 172.2 mmEsc rev b, the printed circuit board in 3D

    Esc rev b

    iamdarshg/drone-arm

    Reworked cheaper, maybe faster but less redundant drone controller.

    681 parts2
  • 6 layers56.7 × 54.7 mmBetter md80, the printed circuit board in 3D

    Better md80

    darshp848/bldc-controller-60v

    60 V, 20 A / 80 A peak BLDC motor controller that fits the MD80 v3.0 mounting. KiCad 10, 6 layers.

    144 parts1

Questions

How big is the Bench stm32 esc PCB?

It measures 75 × 57 mm and has 4 copper layers, 1.66 mm thick.

What parts does the Bench stm32 esc use?

184 parts, built around the TCAN1462VDRBRQ1, DRV8353SRTAR, AP2112K-3.3 and TPD1E05U06DYAR. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Bench stm32 esc KiCad files?

From the JamesGossy/STM32-Brushless-Motor-Controller repository on GitHub, at the commit this page was made from: the board is controller_hardware/bench_stm32_esc.kicad_pcb and its schematic controller_hardware/bench_stm32_esc.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Bench stm32 esc design in my own project?

Its repository states no licence, so its author keeps all rights: ask JamesGossy before reusing the design.