A4988 + NEMA 17 (17HS4401) = Smoke!

I am building a wheeled robot platform using a custom PCB, 4x A4988 and 4x NEMA 17 stepper motors. I am using steppers purely for precise speed and position control.

I recently had a PCB made, I was doing some testing today. I was able to successfully run one stepper motor from it. The power supply is a 16v lion battery pack. When I tried to run two, it ran briefly before I see a puff of smoke and notice that a PCB trace appears to have burnt up and come loose from the board. You can see the brown trace on the photo of my PCB I posted. It was the GND trace which is connected to each A4988, the power supply and an Arduino Nano.

I attempted to repair this fried trace by soldering an external jumper cable, when I ran circuit again, I was struggling to get the stepper to run consistently from the driver. I began troubleshooting with a voltmeter and another poof of smoke!

I have fried all four of my drivers as well as two Arduino Nanos. Feeling rather frustrated as I can seem to figure out exactly what’s going wrong.

I have a feeling that I need to put a resistor between the GND of the main power supply and the Arduino GND, that’s the best I could come up with for the fried Arduino.

As for the PCB traces exploding…I think the maybe there is too much current going through a PCB trace of that width?

I’m attaching a photo of my PCB. All help is appreciated. I’m a bit lost at this point.

If any more info is required let me know (diagrams etc).

Here is a link to my steppers (17HS4401)

Here is the code I was using. Bear in mind I have two A4988 drivers connected to same GPIO pins for each side of the robot

// defines pins numbers
const int stepPin = 6; 
const int dirPin = 7; 
 
void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(50); 
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(50); 
  }
  delay(1000); // One second delay
  
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 400; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(50);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(50);
  }
  delay(1000);
}

Most likely a wiring (PCB) error.

I have a feeling that I need to put a resistor between the GND of the main power supply and the Arduino GND

That is never necessary or desirable.

Okay thanks for clearing up about the GND resistor. If it is a PCB error, would that not have fully prevented the steppers from working? What I'm asking is, is it the PCB itself or is it the way I have assembled it?

The A4988 is a current limiting driver, and if used correctly won't pass more than about 1 Ampere (less if adjusted properly). Did your design take into account the rules for trace thickness and width at that current?

To what value did you set the A4988 current limit? It cannot handle the full rated current for that motor.

Have you checked every single trace on the board for proper connections, and ruled out shorts, possibly due to solder blobs?

Note: disconnecting a motor lead from a powered circuit, intentionally or unintentionally, is the very fastest way to destroy a motor driver.

I had been using a 24mil trace thickness. Is there a specific formula/rule you know that I could Google to calculate required thickness and width?

I have not actually set the current limit. So should I be setting it to 700ma? I think that is something I need to read into. I had been playing around with the Pot, noticing the motor get smoother or more jittery sounding depending on how I turned it.

I had a look over and couldn't diagnose any connection issues. I will solder a fresh board just to be sure.

Note noted! Can I ask, would disconnecting the motor power supply as the motors are turning before the arduino power supply do anything? Because it was at that point that I noticed my second arduino popping.

Thanks a million for the help. If I post my circuit would you be able to glance over for me and let me know if there's any issues you see? Or even any suggestions?

Seems like you are missing out on some pretty important fundamentals.

At the moment, you are not ready for PCB design.

Okay, have you some suggested topics for me to read up on for this particular project?

A good general rule is to get your circuit working properly, piece by piece, before even thinking about a PCB.

Learning something about stepper motors and drivers is a good place to start. Pololu has excellent tutorials on properly adjusting and using their stepper drivers.

The A4988 is not a good choice for your motors, and those motors may not be a good choice for the robot.

Did not see the recommended electrolytic caps for the A4988 on your board.

The A4988 can't handle the nominal 1.7A of your motors. You could adjust for a lower current, or switch to DRV8825's which may get to 1.5A or so with heatsinks. The 17HS4602 1.2A motor would have been a better fit to available driver chips.

You board needs a ground-plane - then you'll never blow the driver's ground supply (which automatically fries the Arduino as all the driver pins rise to the motor supply voltage).

Blowing the V+ to the drivers is much less likely to cascade into fry-every-chip-in-the-system mode.

You appear to be using 24mil for the supply to all 4 drivers, 70 or 100mil is more reasonable. 24mil would handle 1.7A OK, but would fuse at a modest number of amps, so for a single driver its skating on thin ice. The fuse in your supply is what should fuse first, not the wiring/traces.

Do you have a fuse?