NEMA 11 with A4988 - I only get noise from the motor and erratic movement


This is my first arduino and stepper motor attempt.

I followed the youtoube video

but upon running everything I only get noise and erratic motor response, see this:

What could be the problem?


I do not have time to watch the video.

Did you ohm out the coils so that you know how the motor is wired?

Did you set the coil current?

Post your test code (in code tags).

Stepper basics.
Simple stepper code (for testing).

The problem could be the code you did not post, the wiring (post a wiring diagram), inadequate motor power supply (post a link), the motor (post a link) or failure to properly set the current limit on the A4988 driver.

The motor is NEMA 11 as it came with this linear slide I purchased from Amazon:

The code is this:

const int stepDelay=500;

void stepR()
digitalWrite(dirPin, HIGH);
if(digitalRead(LlimitPin)==HIGH) //this is to check against a limit button that I set up on the slider

void loop() {
for(int i=0;i<6000;i++) //200 steps = 1 rot

Now after adjusting the current with the A4988 potentiometer, the machine works But is there any way to increase the rpm?

As you see I had to use 2 x 500 microseconds delay. So 1 step is 1 milisecond, that means 1 full rotation is about 1/5 of second, which equals to 300rpm.

With stepDelay=500 i get solid response but very slow RPM.
with stepDelay=300 sometimes the motor won’t move at all, or may move only if I help it start turning.

I would like to have like 600rpm but still exhibit reliable operation.


To achieve higher speeds you will need acceleration. See the AccelStepper library. The library is available through the IDE library manager.

Did you measure coil resistance.
What current did you set the A4988 to, and what motor supply voltage.

It seems to be a 12volt/480mA high-impedance (25 ohm) motor from the comments.
If so, then you need more than 12volt to power the motor with that A4988 driver.
An old 19volt laptop supply might do.

For faster step rate use a higher supply voltage, at least 24V (avoid getting close to the maximum of 35V for the A4988).

Also, the motor is rated for 0.95 A/winding, so set that as the current limit.

Also, the motor is rated for 0.95 A/winding, so set that as the current limit.

If the coils are indeed 25 ohm, then 24volt or 0.96A doesn't leave any headroom for the A4988 (24/25 = 0.96A).

From my amazon link we can see motor is 0.95A max current.

however, these A4988s that I ordered from ebay came with no data sheet.

so what I don't really know the value of the resistor on the A4988 to use in the formula. What value should I use?

I am further using a bench power supply capable of supplying 0 .. 30 V dc at up to 30Amps. That should be enough.

I did not see any improvement in increasing the voltage, so I left it around 10 volts. With more volts I only get more noise from the motor.

So what are the next steps to optimize this setup, please? I mean in addition to setting up acceleration.

I don't really know the value of the resistor on the A4988 to use in the formula.

Look on the board and match them up to the IC pins and GND.

They will be physically large compared to other resistors, and in the vicinity of 0.05 to 0.10 Ohms.

You need voltage for speed and current for torque.
Current is controlled by the A4988 (you have to set that).
The A4988 needs enough overhead voltage in case it's needed for speed (with torque).

R3 (010) in the link is the current sense resistor, and seems to be 0.1 ohm.

Steppers make noise. More if you want performance.

You should measure coil resistance. That's the only way to know what minimum voltage you need.
If you stick to minimum voltage, then there is no benefit in using a current controlled stepper driver.

  1. 0.95A for a NEMA14 means its a low impedance motor, not a high impedance one. This is good.

  2. A NEMA14 stepper is weedy, don't expect much torque, this device is for precision movement under light loads only.

  3. You absolute must use speed ramping with a stepper of this size, you will not get any performance if
    you try to jump stright to full speed, it will skip/stall/buzz/vibrate/go backwards/all of the above.
    Try AccelStepper.

  4. 600 rpm isn't implausible, but you may have mid-band resonance issues with a leadscrew system as
    there is no mechanical damping in such a setup (ballscrew is the worst possible mechanical load as its
    pretty much lossless). This means microstepping is mandatory, x16 or so in the first instance.
    24V is probably good enough, higher voltage can give higher speeds though, but watch out for the limit
    of the driver. Its a shame there isn't a visco-elastic damping coupler in the drivetrain.

  • I measured the static impedance of the motor coil, looks like it is 2.9 ohms

  • This device is supposed to operate at 14V maximum, in a car. So I won't be able to provide more than that easily.

  • so what Vref should I be adjusting a4988 for? I'm thinking 0.95 x 8 x 0.1 = 0.76. Cool?

  • I used accelerate and now I get like almost 900rpm with reliable operation and less noise. wow!

  • AccelStepper liabry seems to be synchronous and blocks the thread. So I'll just code my own multithreading routine.

  • I'm thinking to order a two head ballscrew for the slider, to replace the single thread ballscrew and double my speed. I'm only gonna be moving like 500grams (1lb). What do you think about that?

  • why would i need microstepping? just to make it smoother?

  • I never found a manual for the stepper driver. here's what i figured out the stepping look looks like:

  1. step pin HIGH
  2. some_delay_1 //at least 120 microseconds
  3. step pin LOW
  4. some_delay_2 //at least 175 microseconds
  5. goto 1

now do some_delay_1 have to be same as some_delay_2? or what is the relationship between them?


Pololu has instructions and a video on setting the coil current on the A4988.

AccelStepper liabry seems to be synchronous and blocks the thread.

Take another look. The library has non-blocking functions as well.

why would i need microstepping?

Steppers can have resonances. Microstepping can alleviate that. Microstepping yields better precision. A nominal 200 step motor at 16X microstepping would have 3200 steps per rev.

now do some_delay_1 have to be same as some_delay_2? or what is the relationship between them?

Robin2’s simple stepper code may be of interest. It also has an example of non blocking stepper code.

And his stepper basics

More than that, steppers set to full-steps will miss-step at resonance pretty reliably if there's no
mechanical damping. Lead-screws like this aren't damped, so you must use microstepping if you
want to pass through resonance reliably.

BTW the video doesn't show the only thing we needed to know, which is if/how the shaft rotates!

Also have you actually checked the motor winding resistance? The product listing doesn't give motor details so I would have advised "avoid".