A non-blocking stepper motor control library for the ESP32 using MCPWM. This library allows for precise control of stepper motors by utilizing the hardware MCPWM module on the ESP32, which offloads the work from the CPU for smoother, higher-frequency operation.
The library is inspired by the awesome FastAccelStepper library. The FastAccelStepper is perfectly suited for applications which require smooth position/velocity trajectories. For my application, see DIY-Sim-Racing-FFB-Pedal, acceleration patterns aren't needed, as the trajectories are intriniscly smoothed by the servo control-loop. Instead, the focus was to reduce the libraries complexity by removing the trajectory/ramp planner and focus on faster update intervals for super-fast control loops. In other words, the library will tell the servo its target position via the pulse/dir interface as fast as the servos interface will allow. For the iSV57 servo (affiliate link) for instance, the pulse/dir interface allows pulses of up to 300kHz.
- Non-blocking stepper motor control on ESP32
- Uses MCPWM hardware for high-frequency pulse generation
- Provides functions to set target position, speed, and current position
- Efficient CPU usage for real-time applications
- Download the library
- Add library to Arduino IDE
In Visual Studio Code, add the following to your platformio.ini
file under lib_deps
:
lib_deps =
https://github.com/ChrGri/FastNonAccelStepper.git
Please refer to examples for basic usage.
If you like this library, feel free to support via
Thank you ❤️