When I set two stepper motors to move counterclockwise at the same time, the motor doesn't respond (it doesn't start) , and when I set two stepper motors to move clockwise at the same time, or when a single motor moves counterclockwise, the bug did not appear.
I am using ESP32 with arduino & TMC2209 driver.
As code below showed, 3 motion type work and only 1 type not work.
Is it a problem with my use or a bug? Please help me analyze it. Thank you all
On 24 May 2023, at 5:45 pm, Woody <edenpho...@gmail.com> wrote:
I am using Arduino CNC shield
--
You received this message because you are subscribed to the Google Groups "accelstepper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelstepper...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/accelstepper/71cc6809-d8a4-4eec-9406-07bdf56ad3dan%40googlegroups.com.
After testing, the problem was not resolved.
1. I modified the speed input to float and the Move input to long, but there is still a problem. And, with the original writing method, C language should be able to complete the correct implicit conversion.
2. I replaced the main control board with ArduinoUNO, and the code was normal, which made me wonder if it was an issue with ESP32 porting.
I have compared the code of the Accelstepper library used by ArduinoUNO and ESP32, and it is completely consistent.
So the problem becomes, ESP32 runs my example code (even with the modifications in # 1) and still cannot achieve simultaneous reversal of two stepper motors. I think this is a bug
PS: I captured through an oscilloscope that the PWM and square waves of the step and dir of the two steppers are normal jumps.
2.Setting PWM pulse width is not a critical factor;
3.Setting the current of TMC2209 to maximum (close to 2A) and adjusting microstep (8 or 16) is not a critical factor;
I am certain that the connection is correct. Please see the following example. I controlled the only variable, which is that when the target position is positive and negative, the expected motor movement cannot be achieved:
I use the ESP32 board wemos_d1_uno32,with Arduino and platformio.
Thank you again for your help. This issue has been bothering me for too long



On 28 May 2023, at 11:48 pm, Woody <edenpho...@gmail.com> wrote: