

Closed Loop Driver
A closed-loop control system designed to stack with stepper motors and provide real-time feedback using a magnetic encoder. It detects missed steps and corrects them using an onboard STM32 microcontroller while also supplying your communication line through the CAN bus ports to your main microcontroller.
- Size
- 48.9 × 46.6 mm
- Copper layers
- 6
- Thickness
- 1.6 mm
- Parts
- 50
- Nets
- 50
- Pads
- 165
- Tracks, vias
- 377, 75
- Pours
- 8
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 30 Jun 2025
- Updated
- 29 Mar 2026
Overview
Closed Loop Driver is an open-source printed circuit board by Ali-M0, from the Ali-M0/EDrive repository on GitHub, published under the MIT licence. It is a 6-layer board of 48.9 × 46.6 mm with 50 parts on 50 nets, routed with 377 tracks and 75 vias.
It is built around the SN65HVD232D, MT6816CT-AKD and LP2992AIM5-3.3. Its parts include 15 capacitors, 4 resistors, 4 ICs, 4 connectors and 3 diodes. It belongs with the robots and motor control boards and the STM32 boards of this library.
Main components
3SN65HVD232D
SOIC-8-40℃~+85℃ 17mA 1Mbps 3.3V CAN Transceiver SOIC-8 CAN Transceivers ROHSTexas InstrumentsCAN TransceiversMT6816CT-AKD
SOP-8-40℃~+125℃ 0°~360° 1.75mm 10mA 3.9mm 3V~5.5V 5mm Magnetic rotary position sensor No Programmable transmission、Zero position programming、Fault diagnosis、Multi-axis magnetic field detection SPI SOP-8 Position Sensors ROHSNOVOSENSEPosition SensorsLP2992AIM5-3.3
SOT-23-5-40℃~+125℃@(Tj) 1 125uA 16V 250mA 3.3V 30uVrms 45dB@(1kHz) 850mV@(250mA) Fixed Over Current Protection、Over Temperature Protection、Enable Positive SOT-23-5 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSTexas InstrumentsVoltage Regulators - Linear, Low Drop Out (LDO) Regulators
README
README.mdCLS-Motor: A compact solution for stepper motors
Why not improve the capabilities of an already abundant and capable motor.
Key Features
- Real-time closed-loop correction using MT6816 magnetic encoder
- **Communication via CAN bus:** By utilizing a CAN bus communication protocol, you inherently gain several benefits to your system, the main benefits being a robust communication protocol that was made with low EMI in mind, along with a more accurate system that decreases the amount of wires needed and scalability with other CLS-Motor systems.
- **6-layer custom PCB:** Designed in KiCad for signal integrity and thermal performance
- **Onboard STM32F103CBT6:** Handles encoder data and CAN communication
- Power regulation via LP2992AIM5-3.3 linear regulator
- Fully custom C++ to come (CLion environment)
Motivation
In robotic systems—especially robotic arms—accuracy and reliability are critical. While working on my own robotic arm project, I noticed that traditional open-loop stepper motors often missed steps under load, compromising precision.
To solve this, I developed the Closed-Loop Stepper (CLS) Motor system—an integrated hardware/software solution that enables real-time position correction through encoder feedback and control logic.
FUTURE PLANS
Correction Software for CLS Motor
Explanation about my STM32 programming coming soon with demo and visuals.
Implementation of a diagnostic serial output to aid in tuning and debugging the control loop in real-world conditions.
Custom C++ software using a PID control system and FOC controller to detect missing steps, sending signals to then correct the lost steps
Technical Specifications/Overview
A closed-loop control system designed to stack with stepper motors and provide real-time feedback using a magnetic encoder. It detects missed steps and corrects them using an onboard STM32 microcontroller while also supplying your communication line through the CAN bus ports to your main microcontroller.
In the field of robotics, precision and reliability in motor control are essential. During the development of my robotic arm project, I identified the limitations of traditional open-loop stepper systems, particularly their inability to self-correct under load. To address this, I designed and implemented a closed-loop stepper motor driver, combining custom hardware and software to enable real-time position correction.
This project involved designing a 6-layer PCB in KiCad, optimized for signal integrity and thermal performance. At its core is an STM32F103CBT6 microcontroller, chosen for its surprisingly high processing speed, rich I/O capabilities, and the fact that its only main purpose is to power the encoder and CAN transceiver, along with any other I/O necessary within the board. I integrated an MT6816 magnetic rotary encoder on the rear shaft of a NEMA 17 stepper motor to provide high-resolution feedback, enabling the system to compare target and actual positions. Through custom correction software written in C++ using CLion, the CLS system adjusts its actuation based on the previous and current step resolution. The CLS motor system also integrates an SN65HVD232 CAN transceiver that, on the surface, enables communication between the main CAN controller located on the main MCU, that being a Teensy 4.1, and the CAN bus ports, supplying my system with its communication signal.
You also may be wondering how my system is powered. That's done through a cascade power system that cascades through a daisy chain design and supplies power to all motors using the CLS motor system, being ultimately powered by a +5V power supply that's soldered to the PCB's positive and negative solder pads added to the top and bottom of the board. The system regulates the +5V power supply to a +3.3V output rail through an LP2992AIM5-3.3 linear regulator, and this then provides power to all the necessary components within my system.
Parts
50| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | TestPoint | Connector_Wire:SolderWirePad_1x01_SMD_1x2mm | TP1, TP2, TP7, TP8, TP9, TP10, TP11 |
| 6 | 100nF | Capacitor_SMD:C_0402_1005Metric | C2, C3, C5, C6, C8, C32 |
| 4 | 10µF | Capacitor_SMD:C_0603_1608Metric | C1, C14, C19, C31 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_3.2mm_M3_Pad | H1, H2, H3, H4 |
| 4 | TestPoint | Connector_Wire:SolderWirePad_1x01_SMD_5x10mm | TP3, TP4, TP5, TP6 |
| 2 | 10k | Resistor_SMD:R_0603_1608Metric | R1, R2 |
| 2 | 10pF | Capacitor_SMD:C_0402_1005Metric | C4, C7 |
| 2 | Conn_01x02 | Connector_JST:JST_ZH_S2B-ZR-SM4A-TF_1x02-1MP_P1.50mm_Horizontal | J2, J3 |
| 2 | SW_Push | Button_Switch_SMD:SW_SPST_SKQG_WithStem | SW1, SW2 |
| 1 | 0.1µF | Capacitor_SMD:C_0402_1005Metric | C13 |
| 1 | 1.8K | Resistor_SMD:R_0603_1608Metric | R3 |
| 1 | 100µF | Capacitor_SMD:C_1210_3225Metric | C18 |
| 1 | 120R | Resistor_SMD:R_0402_1005Metric | R13 |
| 1 | 1µF | Capacitor_SMD:C_0402_1005Metric | C33 |
| 1 | Conn_01x05 | Connector_JST:JST_ZH_S5B-ZR-SM4A-TF_1x05-1MP_P1.50mm_Horizontal | J7 |
| 1 | Conn_01x06 | Connector_JST:JST_ZH_S6B-ZR-SM4A-TF_1x06-1MP_P1.50mm_Horizontal | J6 |
| 1 | Crystal_GND24 | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | 16MHz1 |
| 1 | D_Filled | Diode_SMD:D_SOD-123 | D3 |
| 1 | D_TVS | Diode_SMD:D_SMP_DO-220AA | D4 |
| 1 | LOGO | LOGO | G*** |
| 1 | LP2992AIM5-3.3 | LP2992_3_3:SOT95P280X145-5N | U3 |
| 1 | MT6816CT | Package_SO:SO-8_3.9x4.9mm_P1.27mm | U6 |
| 1 | RED | Diode_SMD:D_0603_1608Metric | D6 |
| 1 | SN65HVD232 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U5 |
| 1 | STM32F103CBTx | Package_QFP:LQFP-48_7x7mm_P0.5mm | U1 |
| 1 | SolderJumper_2_Open | Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm | JP4 |
Questions
How big is the Closed Loop Driver PCB?
It measures 48.9 × 46.6 mm and has 6 copper layers, 1.6 mm thick.
What parts does the Closed Loop Driver use?
50 parts, built around the SN65HVD232D, MT6816CT-AKD and LP2992AIM5-3.3. 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 Closed Loop Driver KiCad files?
From the Ali-M0/EDrive repository on GitHub, at the commit this page was made from: the board is Hardware/Closed_Loop_Driver.kicad_pcb and its schematic Hardware/Closed_Loop_Driver.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Closed Loop Driver 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).
Similar boards
- 4 layers143.5 × 14 mm

- 2 layers83.5 × 45 mm

Arducon
OpenARDF/Arducon
A transmitter controller for Amateur Radio Direction Finding (ARDF). Based on the Arduino Pro Mini.
114 parts7MIT - 2 layers

MT6816CT encoder breakout
Teslafly/MT6816CT-encoder-breakout
MT6816CT encoder breakout for vesc
12 parts4 - 2 layers21 × 17 mm

Encoder SPIABZ MT6816
runger1101001/Magnetic_Encoders
Small (21x17mm) board for the SC60228 magnetic absolute angle sensor.
11 parts11 - 4 layers49.5 × 29 mm

XESC2
ClemensElflein/xESC
The xESC is an easy to use, low cost electronic speed controller (ESC) design for sensored brushless DC (BLDC) motors.
114 parts378 - 2 layers67 × 50 mm

QuadcopterMain
vedderb/QuadcopterSystem
The hardware and software for our quadcopter system
95 parts30GPL-3.0 - 4 layers96 × 172 mm

- 4 layers52.1 × 55.6 mm
