StepperHub: STM32 Stepper Control and a Serial Test Bench

StepperHub: STM32 Stepper Control and a Serial Test Bench — photograph from the project archive.

The StepperHub folder brings together STM32 motion-control firmware, a desktop serial-control experiment and photographs of the motor test bench. It is a useful study of how timer-generated step pulses and a serial command interface fit into a motion system.

How the project works

The included StepperHub firmware targets a NUCLEO-F446RE with three step/direction channels. Its README describes a CNC shield with A4988 or DRV8825 drivers, timer-based pulse generation and an acceleration update loop. The local bench photographs show another driver arrangement, so the pictures and the upstream shield configuration should be read as separate references.

The firmware command syntax uses operations such as get, set, add and reset. Field names include targetPostion and currentPostion: those spellings are part of the supplied implementation. The C# controller in the same folder sends a different command vocabulary, including ACCF, AMOV and POSN; it is not automatically a compatible client for the StepperHub parser.

Hardware and configuration

ItemIn the supplied code
ControllerSTM32 NUCLEO-F446RE
X step / directionPA10 / PB4
Y step / directionPB3 / PB10
Z step / directionPB5 / PA8

Working with the supplied code

Start with the StepperHub README and the selected STM32 project configuration. Check the driver enable, step and direction wiring against that firmware before powering a motor. The minimum and maximum pulse-rate settings in the source are configuration limits, not measured performance results for this bench.

To reuse the desktop program, first map its transmitted strings to the firmware actually installed on the board. The controller screen recording and the motor recordings document both sides of that experiment; they are listed separately in the video upload checklist.

StepperHub: STM32 Stepper Control and a Serial Test Bench — photograph from the project archive.
StepperHub: STM32 Stepper Control and a Serial Test Bench — photograph from the project archive.

Video demonstrations

StepperHub STM32 — Serial Controller Demonstration — Ovidiu Carstea on YouTube
StepperHub STM32 — Motor Test Bench — Ovidiu Carstea on YouTube

Source code and project files

Browse this project on GitHub. The files below are useful starting points for the sketches and references discussed in this post.

Download the used libraries (ZIP, 14.7 MB).

StepperHub firmware is by omuzychko; retain the attribution and license included in its source.

These notes describe the archived source and project media. The sketches have not been rebuilt or tested on hardware for this article.

Scroll to Top