Hi, i bought a kit of NEMA 17 and pololu a4988. The motors are used, but they seem to be ok.
The problem was when I tried to test them. I conected the motors one by one, and I looked for a code to test them as well as the diagram to make the connections.
At first it started working fine, but after 2 cycles the motor began to fail, it got stuck, and then it began to work fine again, and then fail again. and repeat that loop over and over.
I figured that the failure just happens in the same direction. At beggining I thought the motor was the problem, but then i tried with the other 2 and they had the same fail, then i thought about pololu, but then again I tried with other and the same happened.
The motor is a Nema 17PM-K356-01VS, pololu a4988 driver and Arduino MEGA 2560.
I am using a 12V and 500 mA power Supply as well as arduino’s power supply for a4988.
This is the code I found:
//////////////////////////////////////////////////////////////////////////////////////////////////
#define VELOCIDAD 2000
int steps = 3;
int direccion = 8;
int reset = 7;
int pasos = 1000;
void setup() {
pinMode(steps, OUTPUT);
pinMode(direccion, OUTPUT);
pinMode(reset, OUTPUT);
}
void loop() {
digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
digitalWrite(direccion, HIGH);
for (int i = 0; i<pasos; i++)
{
digitalWrite(steps, HIGH);
digitalWrite(steps, LOW);
delayMicroseconds(VELOCIDAD);
}
digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
digitalWrite(direccion, LOW);
for (int i = 0; i<pasos; i++)
{
digitalWrite(steps, HIGH);
digitalWrite(steps, LOW);
delayMicroseconds(VELOCIDAD);
}
}
///////////////////////////////////////////////////////////////////////////////////////////////
PLEASE I NEED HELP!!