I'm trying to control two Nema 23 stepper motors and DM542 drivers using FastAccelstepper library by the Mega2560. The problem is that only one of the motors runs and the other one doesn't move at all.
Any help or suggestion is appreciated.
Fault is in hardware or external components. Usual debugging technique applies, swap known good components with suspected faulty ones to isolate source.
Thanks for your response. I've checked the hardware. Everything is ok, i.e. when I change the order of motors, now stepper2 rotates but stepper1 doesn't move.
As I said both motors and drivers are fine. With other libraries such as accelstepper both work fine. But in Fastaccelstepper it depends on the order of motors in the code.
with the previous code, stepper1 rotates and stepper2 doesn't move.
but with the following code, stepper2 rotates and stepper1 doesn't move.
It seems there is a programming issue with the Fastaccelstepper library.
The code appeared to work correctly when I tried it, but I only looked at the output with a scope, I didn't try actual motors. If I have a moment I can try with some real motors.
Thank you guys for your helping me. Actually, there was a thoughtless mistake in the main code of my project since I was trying to turn the motors with the max speed and acceleration. In this way, the Mega controller is not able to support both motors at the same time. As mentioned in the library documentation, it allows up to 50000 generated steps per second for single stepper operation, 37000 for dual stepper, and 20000 for three steppers.