I have two steppers both of them runs perfect with a single control (a code for one stepper, similar to the following code). But they don't run at the same time, because one of them does more steppes (he runs unround). I think the problem is in the code but I can't find it.
It's probably the delays(). Delays are evil, the Arduino can one do one thing at a time but with a delay you tell the Arduino to just sit and do nothing.
Try both at 1/16th, less resonance effects, if still not happy one of the motors might be
miswired or there could be a faulty connection. Always power down stepper driver before
tinkering with motor wiring, otherwise you can get sparking and burn out the driver.
Oh, and the obvious simple test, swap motors and see if the malfunction moves with
the motor or stays put with the driver. You can swap connections to the Arduino as
well to debug troubleshoot (power down before rewiring of course).
I change the drivers and in the beginning both steppers turn but the left one faster and the right one perfect. After some time(40s) only the right one turns. I reconnected the voltage and first both turns(5s) and then the right one stops and the left one runs perfect. I can not unterstand it:(.
Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
What are you using for power supply to the stepper and control assemblies?
''Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
What are you using for power supply to the stepper and control assemblies?''
Okay, I did it like this with the fabscan shield. I use 9V batterys.
You may be pulling several amps peak from the batteries and AA battery holders
are typically unable to handle that properly, even if the cells are up for it - if the
holder has rivetted construction it is not good for high current.
Measure the voltage under operation, if it drops significantly the power's not adequate.
First of all im not english speaker but i will try to help you anyway.
One of your problem is the Delay and microdelay because during a delay and a microdelay you cant read your inputs, change any output, your code just stop and wait the time pass. But if you use millis for time control, your Arduino is free to do other tasks.
MarkT:
You may be pulling several amps peak from the batteries and AA battery holders
are typically unable to handle that properly, even if the cells are up for it - if the
holder has rivetted construction it is not good for high current.
Measure the voltage under operation, if it drops significantly the power's not adequate.
Thanks, you are right. Have you got some experience about the right choice of batteries? I need at least 9V but how much A I need?