Skip to the content
4 layers87 × 103.5 mmMotor Driver Board, the printed circuit board in 3D

Motor Driver Board

sahir-afk/Custom-Actuator

Thrust Vector Control

Size
87 × 103.5 mm
Copper layers
4
Thickness
1.6 mm
Parts
85
Nets
80
Pads
299
Tracks, vias
842, 154
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
10 Jul 2026
Updated
24 Aug 2026

Overview

Motor Driver Board is an open-source printed circuit board by sahir-afk, from the sahir-afk/Custom-Actuator repository on GitHub. It is a 4-layer board of 87 × 103.5 mm with 85 parts on 80 nets, routed with 842 tracks and 154 vias.

It is built around the SN65HVD230D, STSPIN32G4 and BAT48ZFILM, with the STPS1H100A among its other parts. Its parts include 26 resistors, 24 capacitors, 8 diodes, 6 transistors and 6 connectors. It belongs with the robots and motor control boards of this library.

Main components

4

README

README.md

FOC (Field Oriented Control) Actuator

Closed-loop brushless motor control. Custom PCB, firmware, and ground software. AI was used for code review and troubleshooting.

HITL bench

System overview

The project is comprised of three nodes: the motor and encoder, the STM32 and motor driver PCB, and my laptop.

The motor and encoder. A BLDC with an AS5048A encoder magnet glued to the shaft. Three phase leads go to the power stage, and the encoder is wired for SPI.

The STM32 and motor driver PCB. A custom 4-layer board built around the STSPIN32G4, which puts an STM32G4 MCU and a 3-phase gate driver on the same chip. This node handles the whole control problem. It samples the phase currents through shunt amps, reads rotor angle from the encoder over SPI, runs the FOC loop in a hardware-timed ISR under FreeRTOS, drives the MOSFET power stage, and reports back over CAN. An FDIR state machine catches faults. Right now bring-up runs on the B-G431B-ESC1 dev board while the custom board is at fab.

My laptop. A Python/PySide6 HITL bench that stands in for a flight computer, connected through a USB-CAN adapter. It sends commands, plots live angle, velocity, and Iq telemetry, lets me tune PID gains on the fly, and injects faults while the loop runs. Everything talks CAN 2.0 at 1 Mbps.

The board

The schematic and layout are all KiCad. On the board there is the STSPIN32G4, a 3-phase MOSFET power stage, shunt current sensing on each phase, bulk caps, an SPI header for the encoder, and SWD and CAN.

3D renderLayout
PCB renderPCB layout

Schematics

The power stage is three identical half-bridges. Each gate drives through a 33 ohm resistor with a BAT48 Schottky in parallel for a fast turn-off path, bootstrap caps are 1 uF, and each bridge gets a 220 nF cap to VM right at the FETs. Phase current comes off two paralleled 200 mohm 1% shunts per phase, kelvin-routed through net ties so the sense lines see the shunt voltage and nothing else.

Power stage schematic

The controller sheet is the STSPIN32G4 and its support circuitry: the internal buck making VCC through an 18 uH inductor and an STPS1H100A, a 24 MHz crystal, 3x 220 uF of bulk on VM, and a 75k/3.01k divider with a 33 nF filter feeding bus voltage into PA0 for telemetry.

Controller schematic

Control loop

The shunt amps feed the phase currents into the MCU's ADC. From there, Clarke and Park transforms move them into the rotor frame, and PI loops regulate Id and Iq. Rotor angle comes from the AS5048A, and I calibrate it by driving the motor to a known angle and measuring the offset.

FOC control loop

Bring-up

Bench setup

Motor with the encoder wired for SPI, controller board, USB-CAN adapter into the laptop.

Demo run

Demo run

Position step to 90 deg, velocity mode at 800 dps, then the heartbeat gets paused on purpose. The FDIR state machine flags the lost heartbeat, faults, and cuts the drive. The velocity decay after t = 7 is the motor coasting down with the outputs off.

About me

I'm a junior at UIUC studying electrical engineering. I like power electronics, embedded systems, and working on cool stuff. Outside of class I lift weights, play tennis, and like learning about new places and cultures.

sahir.pagey@gmail.com · linkedin.com/in/sahir-pagey · github.com/sahir-afk

Parts

85
QtyValueFootprintReferences
6200m 1% .5WResistor_SMD:R_1206_3216MetricR1, R2, R3, R4, R5, R6
633Resistor_SMD:R_0805_2012MetricR13, R14, R15, R16, R17, R18
6BAT48ZFILMDiode_SMD:D_SOD-123D8, D9, D11, D12, D13, D14
6Q_NMOS_GDSDMotor Driver Board:MCAC60N10Y_DFN5060_GDSDQ7, Q8, Q9, Q10, Q11, Q12
50Resistor_SMD:R_0805_2012MetricR7, R8, R9, R10, R21
4100 nFCapacitor_SMD:C_0402_1005MetricC8, C10, C12, C13
31uF 25VCapacitor_SMD:C_0603_1608MetricC16, C18, C21
3220nF 100VCapacitor_SMD:C_1206_3216MetricC17, C20, C22
3220uF 100VMotor Driver Board:CAP-SMD_BD16.0-L17.0-W17.0-FDC2, C3, C4
3Jumper_2_OpenConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJP1, JP2, JP3
3NetTie_2NetTie:NetTie-3_SMD_Pad0.5mmNT1, NT2, NT3
21 uFCapacitor_SMD:C_0603_1608MetricC9, C11
2100nFCapacitor_SMD:C_0402_1005MetricC5, C6
210kResistor_SMD:R_0805_2012MetricR23, R26
210pFCapacitor_SMD:C_0603_1608MetricC23, C24
222Resistor_SMD:R_0805_2012MetricR24, R25
110 uFCapacitor_SMD:C_0805_2012MetricC7
110k 1%Resistor_SMD:R_0805_2012MetricR12
110uF 25VCapacitor_SMD:C_0805_2012MetricC19
1120Resistor_SMD:R_0805_2012MetricR22
118uHMotor Driver Board:IND-SMD_L5.0-W5.0_FNR50XXSL2
1220 nF 100VCapacitor_SMD:C_1206_3216MetricC14
122k 1%Resistor_SMD:R_0805_2012MetricR11
124.000MHzCrystal:Crystal_SMD_SeikoEpson_FA128-4Pin_2.0x1.6mmY1
13.01k 1%Resistor_SMD:R_0603_1608MetricR20
133 nFCapacitor_SMD:C_0603_1608MetricC1
175k 1%Resistor_SMD:R_0603_1608MetricR19
1BAT30kDiode_SMD:D_SOD-523D1
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ2
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ4
1Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_HorizontalJ5
1Conn_02x05_Odd_EvenConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalJ1
1NMCapacitor_SMD:C_0603_1608MetricC15
1SN65HVD230Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1STPS1H100ADiode_SMD:D_SMAD10
1STSPIN32G4Motor Driver Board:VFQFPN-64_L9.0-W9.0-P0.50-TL-EP4.0U1
1Screw_Terminal_01x03TerminalBlock_MetzConnect:TerminalBlock_MetzConnect_Type073_RT02603HBLU_1x03_P5.08mm_HorizontalJ6
1TestPointTestPoint:TestPoint_Pad_D1.5mmTP1

The 81 most common of 85 parts.

Similar boards

  • 4 layers125 × 80 mmEsc, the printed circuit board in 3D

    Esc

    Electrium-Mobility/esc-w26

    Building an electronic speed controller!🏍️💨

    187 parts4MIT
  • 4 layers46 × 53 mmMotor controller, the printed circuit board in 3D

    Motor controller

    AeroX2/aerox2.github.io

    One repository and npm installation builds the workshop at jamesridey.dev and the professional site at cv.jamesridey.dev.

    137 parts
  • 2 layers78.3 × 129 mmESC, the printed circuit board in 3D

    ESC

    Malyth64/Drone_projekt_2lags

    to lags ECS

    97 parts
  • 4 layers55 × 70 mmBLDC Control Board, the printed circuit board in 3D

    BLDC Control Board

    AlainPiallat/projet-1A-controleur-moteur

    Projet de 1A : Création d'une carte de contrôle de moteur brushless

    62 parts2Apache-2.0
  • 6 layers56 × 56 mmMoteus x1, the printed circuit board in 3D

    Moteus x1

    mjbots/moteus

    Brushless DC motor controller

    187 parts1.4kApache-2.0
  • 4 layers120 × 100 mmIO LINK, the printed circuit board in 3D

    IO LINK

    ucandevices/IO-LINK-Covnerter

    172 parts6MIT
  • 2 layers60 × 60 mmArmpoe, the printed circuit board in 3D

    Armpoe

    zeroping/PoE-STM32F107

    A Power-over-Ethernet board with an STM32F107 for processing and ethernet and a header for all I/O

    119 parts4
  • 4 layers70 × 50 mmFluxdrive g4, the printed circuit board in 3D

    Fluxdrive g4

    alanhpereira/fluxdrive-g4

    Firmware for my graduation thesis

    100 partsMIT

Questions

How big is the Motor Driver Board PCB?

It measures 87 × 103.5 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Motor Driver Board use?

85 parts, built around the SN65HVD230D, STSPIN32G4, BAT48ZFILM and STPS1H100A. 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 Motor Driver Board KiCad files?

From the sahir-afk/Custom-Actuator repository on GitHub, at the commit this page was made from: the board is Motor Driver Board/Motor Driver Board.kicad_pcb and its schematic Motor Driver Board/Motor Driver Board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Motor Driver Board design in my own project?

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