Running NEMA 17 stepper at high speed

200 steps in 200ms with acceleration would be accellerating 100 steps in 100ms and decelerating for 100 steps in 100ms.

With x=1/2at^2 rearranged to a = 2*x/t^2 = 2*100/0.1^2 = 20000steps/sec^2 and a top speed of v=at=20000*0.1=2000steps/sec. That seems within AccelStepper's 400Hz limit on a Uno.

Look into the Accelstepper bounce example:

Or the more adaptable MobaTools example:

A problem you might be having with stepper.h is that it doesn't accelerate, so you might be stepping or slowing faster than the hardware can keep up with as it instantly goes to 1000steps/sec. You could tune an acceleration-aware library to match your hardware, and it shouldn't lose steps.

1 Like