A4988 Driver Issues

Hi, hope you can help me…

A year or so ago I bought a few extra nema 17 and A4988 driver boards whilst building a 3D printer, all went fine, everything worked.

Recently I’ve pulled out the spares, but am having issues getting the motors moving other than twitching (but currently no twitching even!).

I’ve followed the common circuit diagrams online (I’ll draw up if really need). I’m using a 150uF capacitor, have common ground, the external power is 12V 1A, the A4988 potentiometer currently reads 500mA.

Oh, using a Nano board!

The current code reads as follows and indicates pins used:

const int pin_step = 5;  //  use 5 as its PWM
const int pin_dir = 4;  //  use 4

void setup() {
  // put your setup code here, to run once:

  pinMode(pin_step, OUTPUT);
  pinMode(pin_dir, OUTPUT);

  digitalWrite(pin_step, LOW);
  digitalWrite(pin_dir, LOW);
  
}

void loop() {
  // put your main code here, to run repeatedly:

  digitalWrite(pin_dir, HIGH);

  for(int x = 0; x < 200; x++)
  {
    digitalWrite(pin_step, HIGH);
    delayMicroseconds(500);
    digitalWrite(pin_step, LOW);
    delayMicroseconds(500);
  }
  delay(1000);
  /*
  digitalWrite(pin_dir, LOW);

  for(int x = 0; x < 400; x++)
  {
    digitalWrite(pin_step, HIGH);
    delayMicroseconds(500);
    digitalWrite(pin_step, LOW);
    delayMicroseconds(500);
  }
  delay(1000);
  */
}

I’ve tried 3 different motors, 3 different a4988 boards and two different Nano boards.

Thing is, I know I had these same items running last year.

Any suggestions or ideas of how to diagnose (problems with motors

Many thanks

Pauzed: the A4988 potentiometer currently reads 500mA.

That does not make sense. I would expect you to be measuring a voltage rather than a current. If you really are measuring a current then please post a diagram showing how you are doing it.

The Pololu A4988 web page has info about setting the current limit. See also see this current adjustment Thread

Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

...R Stepper Motor Basics Simple Stepper Code

Sorry, yes you are correct it was meant to be 500mV...

Is there any way to test the driver if it has blown in that way?

Cheers

Hi, found some references to that, will check soon and report, many thanks

digitalWrite(pin_step, HIGH);
    delayMicroseconds(500);
    digitalWrite(pin_step, LOW);
    delayMicroseconds(500);

That is expecting the motor to go from 0 to 1000 steps per second instantaneously. Try a much slower speed (longer delays like 20ms).

Thanks GroundFungus, that really does the trick in many situations, but many of my A4988 drivers seem to be defunct.

I did buy some TB6612FNG boards, but to be honest I've not set up for stepper drivers even though it's supposed to be possible.

However since, I've settled on using TB6600 Stepper Motor Drivers and still have not had any issues.