A4988 Stepper Unsmooth/Not Reaching Destination Movement

I've been working on this dog feeder project. I am facing an issue with my a4988 and stepper motor. I'm feeding motor 12V to VMOT and 5V(from arduino nano). I ruled out unstable power supply(measured and both were solid 12.02 and 5.02 and used variable DC power supply for the 12V), not the code as I used the same exact one as when I test built on breadboard(while also checking many times), the state pins are correct(checked many many times), moved the current limiter on driver around, and tested with spare driver.

I think the issue is either the amps cause the variable DC power supply was showing around 0.13 even when current limiter is on max. Or when I removed the female adapters of the stepper motor in order to solder to my board(in picture I have it straight to circuit board but I also tried putting tinned silver wire before) its an issue with that.

I got a photo of what I got below, but I've been working on this for a couple of weeks but can't figure it out. I was thinking about getting another stepper motor to test whether I need to keep the female adapter but want to make sure thats the issue before buying.

Let me know if you need any more specifics or better photos.

Stepper motors are power-hungry (same or more when not turning),
and are therefore rarely used on battery power.
Leo..

Hi, @kaipo1
Welcome to the forum.

Can you please post your code and a schematic?

Can you please post EXPORTED images of your PCB?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Hi, @kaipo1
Have you checked your solder joints?

These look a bit suspect.
An image of the other side of your PCB would help too.

Tom.... :smiley: :+1: :coffee: :australia:

If everything worked on he breadboard, then there must be something wrong with the PCB design and/or PCB assembly.

How much curent does the stepper use?

The battery is just for the Arduino. I have a 12V power supply plug for the VMOT for the stepper.

Here is my PCB baord design.

Here is my Stepper Testing Code

#include <AccelStepper.h>

AccelStepper myStepper(1, 12, 11);
int enablePin = 13;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);

  pinMode(enablePin, OUTPUT);
  myStepper.setMaxSpeed(100);
  myStepper.setAcceleration(20);
  myStepper.setCurrentPosition(0);
}

void loop() {
  digitalWrite(enablePin, LOW);
  myStepper.moveTo(800);
  myStepper.runToPosition();
  delay(1000);
  myStepper.moveTo(0);
  myStepper.runToPosition();
  digitalWrite(enablePin, HIGH);
}```

That was one part where I think there may be an issue as even when I adjust the potentiometer. On high the current is showing around 0.13.

You need to set the driver current limit correctly, and for the A4988, that must be less than or equal to 1 Ampere/winding, and must not exceed the stepper motor winding current rating. Also, the motor power supply must be able to comfortably handle the total motor current.

Post a link to product page or data sheet for the stepper motor you are using.

The A4988 power and motor traces look more like fuses.
Leo..

Please post a link to the Motor datasheet. Not all steppers are suitable for the A4988. You need a low impedance stepper. Your stepper seems to be a high imedance stepper, but so far you did not tell us anything about your stepper.

No, it must comfortably be able to provide the power the stepper needs. With an A4988 and the appropriate motor, the current from the power supply is always significantly lower than the coil current of the motor.

Common practise is to adjust reference voltage on the pot with the pot before connecting the motor. Measuring motor or supply current is not a good way.

We still know nothing of your motor. Post a link.
The A4988 or the 12volt supply could be the wrong choices.
Leo..

Im using the NEMA 17 Stepper Motor

and heres the amazon listing for the a4988 driver

Ok, this is a low impedance stepper. But it's rated current by far exceeds the limits of the A4988. And there must be something significantly wrong, if the PSU only shows 0.13A. 12V and 0.13A are only ~1,5W - far too low for this stepper.

Not true if current limiting is inactive, in which case, the power supply must be able to comfortably provide the full motor current.

NEMA 17 is the size of the mounting plate (1.7 inch). It tells us nothing about the electrical specs. The link you posted narrows it down to three models, which differ in hight.

But they all require (close to) 2A. 0.13A is far too low as @MicroBahner explained.
Which indicates that you did not set Aref properly.
Pololu has good info for that. Your drivers seem to have 0.1 Ohm sense resistors.
Leo..

You cannot deactivate current limiting at an A4988. And that's true for all current controlling stepper drivers.
If there is no current limiting, you use a simple H-bridge.

You are not considering all the possibilities.

Current limiting drivers do not limit coil current if the trip level is not reached.

There are a variety of errors, incorrect settings, pathological situations or system design mistakes, often found in amateur builds on a hobby forum, that can result in this condition.

My design philosophy is oriented more towards worst case situations, and generously over rating power supplies. End of discussion.

Heres the amazon listing that I bought the Stepper motor from.

I understand that its very likely an Amps issue, but I just can't figure out the reason behind why its so low.

Now you're linking to a different family of six motors.
The first three motors in post#19 are a good match with the A4988,
the last three (thicker) motors could be needing a DRV8825.

Did you adjust the current pot on the driver, and HOW.
Leo..