Skip to the content
PCBKitNew board
6 layers48.9 × 46.6 mmClosed Loop Driver, the printed circuit board in 3D

Closed Loop Driver

Ali-M0/EDrive1

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

3

README

README.md

CLS-Motor: A compact solution for stepper motors



Screenshot 2025-07-10 at 8 18 01 PM

License: MIT Open Source: Yes


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
QtyValueFootprintReferences
7TestPointConnector_Wire:SolderWirePad_1x01_SMD_1x2mmTP1, TP2, TP7, TP8, TP9, TP10, TP11
6100nFCapacitor_SMD:C_0402_1005MetricC2, C3, C5, C6, C8, C32
410µFCapacitor_SMD:C_0603_1608MetricC1, C14, C19, C31
4MountingHole_PadMountingHole:MountingHole_3.2mm_M3_PadH1, H2, H3, H4
4TestPointConnector_Wire:SolderWirePad_1x01_SMD_5x10mmTP3, TP4, TP5, TP6
210kResistor_SMD:R_0603_1608MetricR1, R2
210pFCapacitor_SMD:C_0402_1005MetricC4, C7
2Conn_01x02Connector_JST:JST_ZH_S2B-ZR-SM4A-TF_1x02-1MP_P1.50mm_HorizontalJ2, J3
2SW_PushButton_Switch_SMD:SW_SPST_SKQG_WithStemSW1, SW2
10.1µFCapacitor_SMD:C_0402_1005MetricC13
11.8KResistor_SMD:R_0603_1608MetricR3
1100µFCapacitor_SMD:C_1210_3225MetricC18
1120RResistor_SMD:R_0402_1005MetricR13
11µFCapacitor_SMD:C_0402_1005MetricC33
1Conn_01x05Connector_JST:JST_ZH_S5B-ZR-SM4A-TF_1x05-1MP_P1.50mm_HorizontalJ7
1Conn_01x06Connector_JST:JST_ZH_S6B-ZR-SM4A-TF_1x06-1MP_P1.50mm_HorizontalJ6
1Crystal_GND24Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm16MHz1
1D_FilledDiode_SMD:D_SOD-123D3
1D_TVSDiode_SMD:D_SMP_DO-220AAD4
1LOGOLOGOG***
1LP2992AIM5-3.3LP2992_3_3:SOT95P280X145-5NU3
1MT6816CTPackage_SO:SO-8_3.9x4.9mm_P1.27mmU6
1REDDiode_SMD:D_0603_1608MetricD6
1SN65HVD232Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU5
1STM32F103CBTxPackage_QFP:LQFP-48_7x7mm_P0.5mmU1
1SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mmJP4

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 mmDrChibi, the printed circuit board in 3D

    DrChibi

    joewa/ChibiESC

    Free electric speed controller software using ChibiOS

    284 parts10GPL-3.0
  • 2 layers83.5 × 45 mmArducon, the printed circuit board in 3D

    Arducon

    OpenARDF/Arducon

    A transmitter controller for Amateur Radio Direction Finding (ARDF). Based on the Arduino Pro Mini.

    114 parts7MIT
  • 2 layers21 × 17 mmEncoder SPIABZ MT6816, the printed circuit board in 3D

    Encoder SPIABZ MT6816

    runger1101001/Magnetic_Encoders

    Small (21x17mm) board for the SC60228 magnetic absolute angle sensor.

    11 parts11
  • 4 layers49.5 × 29 mmXESC2, the printed circuit board in 3D

    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 mmQuadcopterMain, the printed circuit board in 3D

    QuadcopterMain

    vedderb/QuadcopterSystem

    The hardware and software for our quadcopter system

    95 parts30GPL-3.0
  • 4 layers96 × 172 mmServo cpu, the printed circuit board in 3D

    Servo cpu

    wiciu15/servo2

    Servo inverter for 3-phase AC motor with/out encoder feedback

    167 parts29
  • 4 layers52.1 × 55.6 mmFOCdriver, the printed circuit board in 3D

    FOCdriver

    I-M-Robotics-Lab/Curl-Drive-Hardware

    Brushless Motor FOC Controller

    168 parts14GPL-3.0