pkerspe / ESP-StepperMotor-Server

Turn your ESP32 into a complete stepper motor control server with web UI, REST API and serial control interface
MIT License
224 stars 39 forks source link

Port over to FastAccelStepper #46

Open dronus opened 1 month ago

dronus commented 1 month ago

Currently, the used stepper library is CPU-bound and does not cooperate well with other CPU tasks. This results in stepper pulse jitter even on quite low stepping frequencies, making microstepping quite unusable, when for example using the web interface, which puts load on CPU.

On contrast, FastAccelStepper uses ESP hardware units to generate the pulse train, and is quite immune to short CPU load. Especially, using AsyncWebserver over WiFi does not add much jitter, even at 50000 pulses / second (numbers by own experimentation), which is much faster that currently possible with FlexyStepper. This makes microstepping feasable, resulting in much smoother motor operation.

As FastAccelStepper does not provide unit conversion as far as I understand, those would have to be done in ESP-StepperMotor-Server code.

pkerspe commented 1 month ago

Thank you for your input, I am absolutely willing to consider an integration with another stepper library! Please create a pull request for a first POC and we can review jointly.