Skip to content

ChrGri/FastNonAccelStepper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastNonAccelStepper

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.

Features

  • 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

Installation

Using Arduino IDE

  1. Download the library
  2. Add library to Arduino IDE

Using PlatformIO

In Visual Studio Code, add the following to your platformio.ini file under lib_deps:

lib_deps =
    https://github.com/ChrGri/FastNonAccelStepper.git

Example usage

Please refer to examples for basic usage.

Support

If you like this library, feel free to support via

ko-fi

Thank you ❤️

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages