Hi,
I’m working with a robot project which need to drive 3 NEMA 17 stepper motors. First of all, I bought 3 A4988 drivers (green ones with Pololu logo) and hooked up to the Arduino uno as the provided scheme. Everything works fine until… 2 days ago.
Now to the problem. 1 of the drivers is not working anymore, seem dead. I checked all the connection, measure the voltages, everything is matching with the working ones except 1A, 1B, 2A, and 2B. Bought a new one, exactly the same problem, worked fine the first test, took the breadboard with everything home and back to the school the day after. 1 dead again. It doesn’t get hot either like the working ones.
I never disconnect or connect motors when power is on. Always hooked up the driver with VDD and GND first to adjust the to the right current. 12V battery is the last thing I toggle on to power up.
With the provided motors specs, code and picture of the breadboard, have I missed something? Am I doing something wrong?
Motor specs:
Holding torque: 0.41 Nm
Phase: 2 (bipolar)
Angle: 0.9 degrees
Voltage: 3V
Current: 1.7A
Form: NEMA 17
/*
* With A4988 driver
*/
const int motor1_dir_pin = 4;
const int motor1_stepper_pin = 5;
const int motor2_dir_pin = 8;
const int motor2_stepper_pin = 9;
const int motor3_dir_pin = 10;
const int motor3_stepper_pin = 11;
int K1;
void setup() {
Serial.begin(9600);
pinMode(motor1_dir_pin, OUTPUT); // motor 1
pinMode(motor1_stepper_pin, OUTPUT);
pinMode(motor2_dir_pin, OUTPUT); // motor 2
pinMode(motor2_stepper_pin, OUTPUT);
pinMode(motor3_dir_pin, OUTPUT); // motor 3
pinMode(motor3_stepper_pin, OUTPUT);
pinMode(2, INPUT);
}
void motorpair_step(bool motor1_dir, bool motor2_dir, int motor1_steps) {
digitalWrite(motor1_dir_pin, motor1_dir);
digitalWrite(motor2_dir_pin, motor2_dir);
delay(50);
for(int i=0; i<motor1_steps; i++) {
digitalWrite(motor1_stepper_pin, HIGH);
digitalWrite(motor2_stepper_pin, HIGH);
delayMicroseconds(500);
digitalWrite(motor1_stepper_pin, LOW);
digitalWrite(motor2_stepper_pin, LOW);
delayMicroseconds(500);
}
}
void motor2_step(bool motor3_dir, int motor3_steps) {
digitalWrite(motor3_dir_pin, motor3_dir);
delay(50);
for(int i=0; i<motor3_steps; i++) {
digitalWrite(motor3_stepper_pin, HIGH);
delayMicroseconds(1500);
digitalWrite(motor3_stepper_pin, LOW);
delayMicroseconds(1500);
}
}
void loop() {
K1 = digitalRead(2);
delay(10);
if(K1==1){
motorpair_step(false, false, 100);
delay(2000);
motorpair_step(true, true, 100);
delay(2000);
motor2_step(true, 300);
delay(4000);
motor2_step(false, 300);
delay(4000);
}
}