

Master circuit
FOC driver for a single BLDC motor.
- Size
- 64 × 86 mm
- Copper layers
- 4
- Thickness
- 1.67 mm
- Parts
- 238
- Nets
- 283
- Pads
- 1,185
- Tracks, vias
- 3,460, 370
- Pours
- 4
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 24 Jun 2024
- Updated
- 5 Nov 2026
Overview
Master circuit is an open-source printed circuit board by csiz, from the csiz/hex-single-motor-mini-drive repository on GitHub, published under the MIT licence. It is a 4-layer board of 64 × 86 mm with 238 parts on 283 nets, routed with 3,460 tracks and 370 vias.
Its parts include 100 resistors, 63 capacitors, 30 ICs, 14 transistors and 13 diodes. It belongs with the robots and motor control boards of this library.
README
readme.mdHex Mini FOC driver
Brushless motor driver for mini gear motors and servos. This driver focuses on fine force control using field oriented control (FOC). The motor can be commanded to move to track position, velocity, and/or force. The driver will maintain the current wave exactly 90 degrees out of phase to the EMF wave for maximum efficieny. Position is tracked via hall sensors, EMF feedback and I2C rotary sensors.
Electrical ranges:
- Maximum motor voltage: 28V
- Maximum current: 5A
- Minimum motor voltage: 6V
- Nominal I2C voltage: 3.3V
This project has 4 main components, for details look at the readme.md files in each directory:
- A brushless motor simulator and motor principles explainer; under
motor-sim. - The driver PCB schematic and manufacturing files; under
circuits. - Custom driver firmware with Kalman filter position tracking and FOC driving logic; under
driver-code. - Driver control and monitoring webapp; also under
motor-sim, the page titledmotor-monitor.md. - The interface spec and autogenerated serialization code under
interface; because of this we must use thenpm update --install-linkscommand when updating dependencies formotor-sim. (TODO: this section needs updating to include the master circuit and master code and versioning and media and circuit libraries layout)
Screenshots
Motor monitor should look like this when connected to a motor: 
The motor sim, with GPU rendered soundwaves should look like this: 
Circuit Dev Log
Lessons learnt for driver code v0.4
[ ] VREF must be independent of the reference to the amplifier; and actually well insulated. The v0.2 and v0.3 are too noisy because of this I suspect. [ ] Let's go back to USB with 5V and separate VCC power connector! Also allows us to drop the on-board buck converter and save space. Bonus for easy to control from a computer/phone with any USB cable.
Tasks for v0.3
[v] Maybe switch to a oscillation damping gate resistor of 3ohm. The AO4266E switching parameter uses Rgen = 3ohm, I think this is their recommended gate resistance. Switched to 4.7ohm, closest basic resistor.
[v] Aaaargh!!! BOOT0 pin needs a pulldown resistor on the STM32G4! [x] VREF+ should be tied to VDDA... VREF+ now has the capacitance required and drives the amplifier refrence too.
[v] Think about connectors better. We should either drop or double down on USB-C. It would be very user friendly and the power delivery allows us to pick the 9-24V we need, but might be cumbersombe to control 24 devices. The SPI bus with slim connectors let's us keep it tight and in-house. Would we want a cheap single-sided board with USB-C and also a compact double sided assembly without USB at all. ... Let's go for double sided compact without USB, with the better stm32g4 with 5 opamps (so we can also ditch the opamp). [v] USB-C footprint was correct with the cutouts. What we have now is incorrect!
[v] Need master circuit. [v] Need flexi rotation I2C sensors. [v] Via diameter was too small, should be at least 0.2/0.45
Need to implement in v0.2
Features of current version:
[v] Measure power line voltage.
[x] Re-pick voltage boost capacitor and resistor pair (using P FETS).
[v] Re-pick gate oscillation damping resistor for the inputs to the power MOSFET.
[v] Crystal oscilator and pick matching caps.
[v] Power regulator.
[v] USB-C connector maybe?
[v] Debugging connection with the trace line.
[v] 4 half bridge outputs
[v] 4 voltage inputs for the 4 outputs
[v] 1 voltage input for VCC
[v] 2 (preferably 4) current inputs from the 4 outputs; I chose 4.
[x] maybe 1 current input for total current. It would leave us with a floating ground which is iffy.
[v] SPI connection to main board. Not I2C, it's too slow and consumes too much current. SPI will need
a chip select pin, but allows for parallel devices. SPI has hardware CRC calculation, seems useful.
[v] Spare I2C connection for the magnetic sensors.
[v] Status LED.
Lessons from previous version: [x] Measure gate turn on characteristics of existing circuit... [x] Maybe switch to a oscillation damping gate resistor of 3ohm. The AO4266E switching parameter uses Rgen = 3ohm, I think this is their recommended gate resistance. [x] Definitely need to think about daisy chaining these, maybe use a signal buffer/transciever with an enable pin, and/or mosfet switch for the chip power on. I2C to master board is probably the best and easiest way. [v] Oopsies I flipped the sign of the V phase current measurement lines. [x] The boost gate should maybe be connected to the driver side of the shunt resistor. At the moment we're measuring current used to charge the high gate. [x] There's a summing option for the current measurments. Try outputing U, V, U+V, U+V+W using the 4th spare output. [v] ! Think carefully about the shunt resistor placement, there's big interference going on if we measure during high side. Timing it around ground as common mode voltage seems to fix it. Is that the only way to measure all current going through the motor coils? [v] ! Measure voltage of the motor coils! [x] There's a conflict between i2c and timer 3 channel 2. Choose a different GPIO for the red LED. I2C1 and TIM3_CH2 remapped Description When the following conditions are met: • I2C1 and TIM3 are clocked. • I/O port pin PB5 is configured as an alternate function output there is a conflict between the TIM3_CH2 signal and the I2C1 SMBA signal (even if SMBA is not used). In these cases the I/O port pin PB5 is set to 1 by default if the I/O alternate function output is selected and I2C1 is clocked. TIM3_CH2 cannot be used in output mode. Workaround To avoid this conflict, TIM3_CH2 can only be used in input mode.
[x] Double sided board. Not just yet. [x] Drop voltage regulator and rely on master board for 3.3V; filter it though. We just needed to look for better components, there are cheap and small options that work well for us. [x] Look for thinner IDC connector, and definitely SMD version for easier routing, use of space behind connector. [v] Add voltage probes for the phase connectors so we can measure voltage both during driving and open connections. We need to measure driving voltage to make sure our MOSFETS are turned on and giving us the voltage we command! [v] Use Kelvin sense resistors (or pad hack) for the current measurement to avoid the unknown solder resistance. https://www.analog.com/media/en/analog-dialogue/volume-46/number-2/articles/optimize-high-current-sensing-accuracy.pdf [v] Don't drop the hall sensors, yet! [v] The big problem with our measurements occurs when we switch from continuous 0 output from the low mosfet to mixed output with the high mosfet. Any amount of mixed output seems to add an offset to our current measurement. Might be worth putting the current sense only on the low mosfet branch. [x] Choose a different mosfet driver to lower the minimum voltage under 5V. The undervoltage protection must be there for a reason. Anyway, we chose 6V and up. [v] Make it work with steppers... Neat!
Parts
238| Qty | Value | Footprint | References |
|---|---|---|---|
| 38 | 10kΩ | Library:R0603 | R11, R12, R14, R15, R17, R18, R21, R22, R24, R25, R26, R27, R29, R30, R102, R109 +22 |
| 28 | 1uF | Library:C0603 | C1, C12, C15, C18, C20, C25, C26, C27, C28, C29, C33, C35, C40, C51, C52, C53 +12 |
| 23 | 100nF | Library:C0603 | C2, C4, C5, C13, C16, C22, C30, C31, C34, C38, C39, C42, C43, C44, C45, C60 +7 |
| 12 | 1MΩ | Library:R0402 | R96, R97, R98, R99, R100, R101, R103, R104, R105, R106, R107, R108 |
| 12 | 56kΩ | Library:R0603 | R13, R28, R46, R59, R65, R71, R76, R85, R86, R87, R88, R89 |
| 12 | ~ | Library:WDFN-5_L3.1-W3.1-P0.65-BL_1 | Q8, Q12, Q14, Q16, Q18, Q20, Q21, Q22, Q23, Q24, Q25, Q26 |
| 10 | ~ | Library:SOT-23-3_L3.0-W1.7-P0.95-LS2.9-BR | D1, D2, D4, D5, D6, D7, D8, D9, D10, D11 |
| 9 | ~ | Library:SOIC-8_L4.9-W3.9-P1.27-LS6.0-BL | U17, U41, U43, U44, U45, U46, U47, U48, U49 |
| 7 | 5mΩ | Library:R2512 Shunt with Kelvin connections | R1, R2, R3, R4, R5, R6, R7 |
| 7 | ~ | Library:USB-C-SMD_TYPE-C16PIN | USB0, USB1, USB2, USB3, USB4, USB5, USB6 |
| 6 | 100kΩ | Library:R0402 | R79, R80, R82, R83, R84, R91 |
| 6 | 20kΩ | Library:R0402 | R35, R55, R61, R66, R67, R70 |
| 6 | 4.7Ω | Library:R0603 | R77, R81, R90, R92, R93, R94 |
| 6 | ~ | Library:FPC-SMD_20P-P0.50_XUNPU_FPC-05F-20PH20 | FPC1, FPC2, FPC3, FPC4, FPC5, FPC6 |
| 6 | ~ | Library:SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BR | U7, U23, U26, U28, U30, U32 |
| 3 | 100kΩ | Library:R0603 | R45, R48, R56 |
| 3 | 10uF | Library:C1206 | C17, C21, C32 |
| 3 | 22uF | Library:C0805 | C3, C23, C24 |
| 2 | 1.5kΩ | Library:R0603 | R23, R39 |
| 2 | 15pF | Library:C0402 | C64, C69 |
| 2 | 1nF | Library:C0603 | C10, C11 |
| 2 | ~ | Library:TSSOP-20_L6.5-W4.4-P0.65-LS6.4-BL | U11, U16 |
| 2 | ~ | Library:TSSOP-16_L5.0-W4.4-P0.65-LS6.4-BL | U14, U15 |
| 2 | ~ | Library:SOD-123_L2.7-W1.6-LS3.7-RD-1 | D12, D14 |
| 2 | ~ | Library:SW-SMD_4P-L5.1-W5.1-P3.70-LS6.5-TL_H1.5 | SW1, SW2 |
| 2 | ~ | Library:TSSOP-24_L7.8-W4.4-P0.65-LS6.4-BL | U9, U13 |
| 2 | ~ | Library:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BR | Q9, Q10 |
| 1 | 100pF | Library:C0603 | C6 |
| 1 | 10nF | Library:C0603 | C9 |
| 1 | 10uH | Library:L0805 | L2 |
| 1 | 120Ω | Library:R0603 | R16 |
| 1 | 12kΩ | Library:R0603 | R50 |
| 1 | 13kΩ | Library:R0603 | R62 |
| 1 | 15uH | Library:IND-SMD_L4.0-W4.0 | L1 |
| 1 | 1kΩ | Library:R0603 | R68 |
| 1 | 1mΩ | Library:R2725 Shunt with Kelvin connections | R8 |
| 1 | 20kΩ | Library:R0603 | R40 |
| 1 | 24MHz | Library:CRYSTAL-SMD_4P-L3.2-W2.5-BL | X2 |
| 1 | 47kΩ | Library:R0603 | R41 |
| 1 | 49.9Ω | Library:R0603 | R10 |
| 1 | ~ | Library:WIRELM-SMD_ESP32-S3-WROOM-1 | U1 |
| 1 | ~ | Library:ESSOP-10_L4.9-W3.9-P1.0-LS6.0-TL-EP | U42 |
| 1 | ~ | Library:CONN-TH_S8B-PH-K-S-LF-SN | U19 |
| 1 | ~ | Library:MSP2807 OLED with touchescreen and SD card | U35 |
| 1 | ~ | Library:LED0603-RD | LED1 |
| 1 | ~ | Library:SOT-23-5_L3.0-W1.6-P0.95-LS2.8-BL | U3 |
| 1 | ~ | Library:LGA-16_L3.0-W3.0-P0.50-TL | U18 |
| 1 | ~ | Library:QFN-64_L9.0-W9.0-P0.50-BL-EP4.8 | U24 |
| 1 | ~ | Library:QFN-28_L5.0-W5.0-P0.50-TL-EP3.3 | U10 |
| 1 | ~ | Library:SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BL | U4 |
More from csiz/hex-single-motor-mini-drive
10- 4 layers120 × 70 mm

- 4 layers29 × 51 mm

- 4 layers18 × 48 mm

- 2 layers160 × 70 mm

Extender cable circuit
csiz/hex-single-motor-mini-drive
FOC driver for a single BLDC motor.
80 parts9MIT - 4 layers18 × 46 mm

- 4 layers18 × 50 mm

- 2 layers70 × 70 mm

- 4 layers

- 2 layers6 × 10.5 mm

- 4 layers

Similar boards
- 4 layers99 × 99 mm

PrntrBoardV1
ghent360/PrntrBoard
3D Printer controller board using STM32 NUCLEO-F446 kit TMC2130/2660/2209 drivers
238 parts24 - 4 layers130 × 105 mm

Vm101-inout
mirdej/vmix
Multichannel modular analog PAL video mixer based on the SYNKIE project
238 parts21 - 4 layers70 × 92.8 mm

FE 8CH
osqzss/PocketSDR
The Pocket SDR FE device includes 2, 4, or 8 RF frontend channels, supporting the GNSS L1 band (1525 - 1610 MHz) or L2/L5/L6 bands (1160 - 1290 MHz). For these signal bands, refer to GNSS Signal Bands.
238 parts17 - 4 layers

Led panel 4x5
Draganito/kicad-mcp
Mini MCP server that drives a running KiCad 10 PCB editor from Cursor over the official IPC API. LCSC/EasyEDA footprints for JLCPCB.
238 parts1AGPL-3.0 - 4 layers220 × 160 mm

V4 drone
Jailtonfonseca/drone-4in1-esc-esp32s3
Projeto de uma única PCB que concentra: 4 inversores trifásicos (ESC), gate drivers, sensoriamento de corrente, MCU com WiFi (ESP32-S3), IMU, barômetro, USB e toda a regulação de energia a partir de pack LiPo 6S (25,2 V…
238 parts1MIT - 4 layers86.4 × 68.6 mm

- 4 layers

Round LED Flash
xmyoot/custom-round-pcb-led-flash
Custom circular ring PCB LED flash controller prototype
237 parts - 4 layers90 × 100 mm

8ch v3
saewoonam/8ch_currentsource_jlc_v3
V3 of 8 channel current source for biasing superconducting circuits
237 parts
Questions
How big is the Master circuit PCB?
It measures 64 × 86 mm and has 4 copper layers, 1.67 mm thick.
What parts does the Master circuit use?
238 parts. 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 Master circuit KiCad files?
From the csiz/hex-single-motor-mini-drive repository on GitHub, at the commit this page was made from: the board is master-circuit-v0.2/master-circuit.kicad_pcb and its schematic circuits-v0.1/hex-mini-drive.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Master circuit design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).