waspinator / AccelStepper

Fork of AccelStepper
http://www.airspayce.com/mikem/arduino/AccelStepper/
Other
146 stars 86 forks source link

max speed with tcm 16 microsteps #29

Open guestisp opened 1 year ago

guestisp commented 1 year ago

Hi all i've read that the max speed for this library is 4000steps/s to have a reliable movement.

But is this including the 16 microsteps for TMC2209 (or others) or just the full step? Because i'm currently using 9600 steps/mm (200 3 16microsteps) without any visible issue on a ESP32 but i need a little bit more speed, like 12800 (200416 steps/s)

What do you think ?

Rerouter commented 12 months ago

I may have worked out how to make it run at-least faster, the rate of acceleration may change its scaling as a side effect, but it retains the behavior towards direction changes while allowing as high a max speed as you have defined, not saying your device can crunch it, but it allows it to reach it.

_cn could only get slightly lower than the original acceleration, so unless you set a very high value it limited your max speed,

something you can try as a patch is replacing this _cn = _cn - ((2.0 _cn) / ((4.0 _n) + 1)); // Equation 13 with _cn = ((2.0 _c0) / ((4.0 _n) + 1));

and this long stepsToStop = (long)((_speed _speed) / (2.0 _acceleration)); // Equation 16 with long stepsToStop = abs(_n);