StepperDriver icon indicating copy to clipboard operation
StepperDriver copied to clipboard

Not smooth movement

Open guestisp opened this issue 3 years ago • 5 comments

I'm the only one seeing a not smooth movement ? There is a little jerk in the rotation , something a small delay... The same happens on TMC2208 and TMC2209 (in legacy mode, so they are drop-in replacement for A4988 and similiar)

This is the simple code I use:

    this->Stepper.enable();
    this->Stepper.stop();
    this->Stepper.setRPM(50);
    this->Stepper.rotate(3650);
    this->Stepper.disable();

guestisp avatar Jun 13 '22 19:06 guestisp

What processor are you using ? wifi or bluetooth processing may preempt the main program on chips supporting those, especially single core with the stack implemented on the same cpu.

laurb9 avatar Jun 16 '22 05:06 laurb9

esp32. the stepper code is running in a separated task on a different CPU core. seems that adding priority to the stepper task fix the issue but kills everything else (ie the webserver). now i'm testing with the non blocking code (i did a simple while loop on nextAction) and works a little bit better but still slow down when the webserver is sending the webpage

slowing down is not an issue, as long the exact amount of steps asked is done (maybe in a little bit more time). could you comfirm this?

any raccomandations for tmc2209?

guestisp avatar Jun 16 '22 06:06 guestisp

The movement is based on step counter, so it will send the exact number of pulses requested, which translates most of the time to the same number of motor steps. Reversing direction, moving too fast, too much load etc may cause missed steps.

Some ESP32 versions are single core and some are dual core. Can you check which one is yours ?

There is a dedicated library for TMC, worth a try.

laurb9 avatar Jun 21 '22 05:06 laurb9

it's dual

guestisp avatar Jun 21 '22 05:06 guestisp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 19:09 stale[bot]