i have a NEMA 17 Stepper Motor with 12V 0.4A, a A4988 Driver and an Arduino Nano.
For the motor I use a 12V 2A power supply.
All cables are connected correctly but the motor does not turn.
Sometimes it makes some steps but then it jumps back and sometimes the motor does nothing.
The poti on the A4988 is at 0.4V *2 = 0.8A for the motor.
Is there something wrong with the PSU or with the driver?
The motor wire colours are meaningless unless you have a datasheet for that specific motor. Even then I would check them with your multimeter. The wires from one motor coil go to 1A and 1B and the wires from the other coil go to 2A and 2B.
Have you tried using #include.<Stepper.h> library, you’ll still need to have correct wiring but it might simplify thing for you. then declare a stepper, its direction and step pins, steps per revolution. then just set its speed, then all you have to do it tell it how many steps you want any where in your code. Just a thought
ScoobyDoo:
Have you tried using #include.<Stepper.h> library,
That library is not a good idea for stepper motor drivers (like the DRV8825) that take step and direction signals. The OP’s code is fine for testing.
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Can you please tell us your electronics, programming, Arduino, hardware experience?
i have a NEMA 17 Stepper Motor with 12V 0.4A, a A4988 Driver and an Arduino Nano.
For the motor I use a 12V 2A power supply.
All cables are connected correctly but the motor does not turn.
Sometimes it makes some steps but then it jumps back and sometimes the motor does nothing.
The poti on the A4988 is at 0.4V *2 = 0.8A for the motor.
Is there something wrong with the PSU or with the driver?
Thanks for your help
You problem is you are trying to drive a high impedance stepper constant-current.
To do that you need substantially more voltage - 24V for instance.
Alternatively set the A4988 for less current (say 0.25A), and put up with lower torque.
30 ohms is a high impedance motor, low impedance ones are usually in the range 0.4 to 3 ohms
and are designed to be high performance from constant current drivers.