

Driver board
A PID-based motor control system for the STM32F411 Black Pill microcontroller, designed to control 4 DC motors with encoders via H-bridge drivers (e.g., TI DRV8874).
- Size
- 67.5 × 71 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 26
- Nets
- 66
- Pads
- 143
- Tracks, vias
- 303, 50
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 14 Dec 2025
- Updated
- 4 Jul 2026
Overview
Driver board is an open-source printed circuit board by jacko465, from the jacko465/stm32_blackpill_pid_controller repository on GitHub. It is a 2-layer board of 67.5 × 71 mm with 26 parts on 66 nets, routed with 303 tracks and 50 vias.
Its parts include 6 resistors, 1 IC and 1 connector.
README
readme.mdSTM32 Black Pill PID Motor Controller
v1 deployment of the PID controller. With Pololu 4035 driver modules
A PID-based motor control system for the STM32F411 Black Pill microcontroller, designed to control 4 DC motors with encoders via H-bridge drivers (e.g., TI DRV8874).
Features
- High-frequency PID control: 1 kHz PID loop running on TIM10 interrupt
- Encoder feedback: 100 Hz encoder updates (quadrature decoding)
- 4 independent motor channels: Each with PWM speed control and direction control
- Configurable PID gains: Kp, Ki, Kd parameters per motor
- Anti-windup protection: Integral clamping to prevent windup
Hardware Configuration
Motor Specifications
- Encoder: 11 PPR (basic) × 4 (quadrature) × 35.5 (gear ratio) = 1562 counts/revolution
- PWM Frequency: Configured via TIM1 = 20kHz
- Control Loop: 1 ms update period (1 kHz)
- Encoder Reading: 10 ms update period (100 Hz)
System Clock
- 84 MHz SYSCLK derived from 25 MHz HSE crystal
- Configured with PLL (PLLM=25, PLLN=336, PLLP=4)
Pinout

| Function | Pin | Timer/Channel |
|---|---|---|
| Motor 1 PWM | PA8 | TIM1 CH1 |
| Motor 2 PWM | PA9 | TIM1 CH2 |
| Motor 3 PWM | PA10 | TIM1 CH3 |
| Motor 4 PWM | PA11 | TIM1 CH4 |
| Motor 1 DIR | PB0 | GPIO |
| Motor 2 DIR | PB1 | GPIO |
| Motor 3 DIR | PB2 | GPIO |
| Motor 4 DIR | PB10 | GPIO |
| Motor 1 Encoder A | PA0 | TIM5 CH1 |
| Motor 1 Encoder B | PA1 | TIM5 CH2 |
| Motor 2 Encoder A | PA6 | TIM3 CH1 |
| Motor 2 Encoder B | PA7 | TIM3 CH2 |
| Motor 3 Encoder A | PB6 | TIM4 CH1 |
| Motor 3 Encoder B | PB7 | TIM4 CH2 |
| Motor 4 Encoder A | PA5 | TIM2 CH1 |
| Motor 4 Encoder B | PB3 | TIM2 CH2 |
| USART2 TX | PA2 | USART2 |
| USART2 RX | PA3 | USART2 |
| LED | PC13 | GPIO (onboard) |
PID Configuration
Default PID gains (defined in motor.h):
- Kp: 0.1
- Ki: 0.125
- Kd: 0.0
- Integral Limit: 5.0 (anti-windup)
- Output Range: -1.0 to 1.0 (bidirectional control)
Motor Control Functions
This project has been coded for EN/PH driver control mode
The motor.c module provides:
Motor_SetTargetRPM(): Set target velocity in RPMMotor_Forward(): Drive motor forward with duty cycleMotor_Reverse(): Drive motor in reverse with duty cycleMotor_Break(): Active braking (both H-bridge outputs high)Motor_Coast(): Free-running coast (both outputs low)
Building
This project uses PlatformIO. To build and upload
Error Handling
The Error_Handler() function provides visual feedback via fast blinking of the onboard LED (PC13) if system initialization fails.
Parts
26| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | R_Small_US | Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal | R1, R2, R3, R4, R5, R6 |
| 2 | Screw_Terminal_01x02 | TerminalBlock:TerminalBlock_MaiXu_MX126-5.0-02P_1x02_P5.00mm | 5V_IN1, VBAT1 |
| 1 | Conn_01x03_Pin | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J1 |
| 1 | M1_C1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | M1_C1 |
| 1 | M1_C2 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | M1_C2 |
| 1 | M2_C1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | M2_C1 |
| 1 | M2_C2 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | M2_C2 |
| 1 | M3_C1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | M3_C1 |
| 1 | M3_C2 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | M3_C2 |
| 1 | M4_C1 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | M4_C1 |
| 1 | M4_C2 | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | M4_C2 |
| 1 | MOTOR1 | Custom_Footprint_Library:Pololu_4035_DRV8874_Motor_Driver | MOTOR1 |
| 1 | MOTOR2 | Custom_Footprint_Library:Pololu_4035_DRV8874_Motor_Driver | MOTOR2 |
| 1 | MOTOR3 | Custom_Footprint_Library:Pololu_4035_DRV8874_Motor_Driver | MOTOR3 |
| 1 | MOTOR4 | Custom_Footprint_Library:Pololu_4035_DRV8874_Motor_Driver | MOTOR4 |
| 1 | ~ | Custom_Footprint_Library:STM32 Black Pill | U5 |
The 22 most common of 26 parts.
Similar boards
- 2 layers57.3 × 19 mm

- 2 layers98 × 59.5 mm

MCP23017 PCB
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
26 parts915 - 2 layers142.9 × 98.5 mm

- 2 layers86.1 × 86.1 mm

- 2 layers103.8 × 50 mm

Galagino pcb set
harbaum/galagino
A Galaga, Pac-Man and Donkey Kong arcade emulator for the ESP32
26 parts558 - 2 layers20.3 × 34.8 mm

L0 ESP32
Luos-io/luos_engine
Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.
26 parts546MIT - 2 layers40.6 × 50.8 mm

WALTsm
google/walt
A device for measuring latency of physical sensors and outputs on phones and computers
26 parts474Apache-2.0 - 2 layers158.5 × 75 mm

Questions
How big is the Driver board PCB?
It measures 67.5 × 71 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Driver board use?
26 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 Driver board KiCad files?
From the jacko465/stm32_blackpill_pid_controller repository on GitHub, at the commit this page was made from: the board is Kicad_PCB/driver_board.kicad_pcb and its schematic Kicad_PCB/driver_board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Driver board design in my own project?
Its repository states no licence, so its author keeps all rights: ask jacko465 before reusing the design.