SOLVED Nema 17 and A4988 only vibrating no rotation

Hey!
I have a problem to control my stepper motor.

I use the following hardware:

Arduino Uno
A4988 Step motor driver from AZ-Delivery
Nema 17 Motor with the following properties:

When I try to drive the motor, it just vibrates instead of rotating.

I have measured out the coils and these are connected to the stepper motor driver accordingly. (Both coils have around 2 Ohms)

I also tried to change the arrangement here. I swapped the connection of one coil to see if the coil in the motor is the other way around.

The motor part is operated with a 12V 2A power supply. I checked with the oscilloscope whether the voltage breaks down when used. I couldn't see anything here. I exchanged the power supply for a laboratory power supply to really rule out that it is due to the power supply. The power supply is powered by the recommended 100uF capacitor.

I varied the limit current with the potentiometer on the A4988

I also replaced the motor driver (ordered 5 at once) in order to rule out a defect here as well.

RESET and SLEEP are connected to each other.

I tried to play with the breaks (delayMicroseconds) but without success...

Here is the scheme of how the motor is connected. (RESET and SLEEP are connected!)


And this is the code I'm testing with:

void setup()
{
  pinMode(3, OUTPUT); // Step
}

void loop()
{
  digitalWrite(3,HIGH);
  delayMicroseconds(500);
  digitalWrite(3,LOW);
  delayMicroseconds(500);

  delay(1000);
}

The motor should go one step further every second, but it doesn't. He takes a step forward and immediately jumps back again. It just vibrates when I leave out the "delay (1000)".

I have no idea what it could be, does anyone have an idea?

Your diagram shows pin 3 going to the step input.

Post a photo of your wiring, please.

Did you set the coil current according to the instructions on the Pololu A4988 page?

True a copy error, I already corrected it in the post, but that's not the reason. The pin arrangement has to be correct, otherwise the motor would not vibrate but just hold the position.

Swap the A1 and A2 leads.

groundFungus:
Swap the A1 and A2 leads.

I've already tried it, but the motor only vibrates.
I swapped:
A <-> A/
B <-> B/
A/ <-> B

Have you Ohmed out the coils to confirm the actual physical coil wiring?

How about a nice clear photo of your wiring?

Did you set the coil current like the instructions on the Pololu A4988 page?

Robin2's simple stepper code for testing.

I varied the limit current with the potentiometer on the A4988

Set the current limit properly, to 1 Ampere or less.

The correct Vref setting depends on the current sense resistance value, which in your knockoff is probably not the same as the value used by Pololu in their modules. In that case their instructions won't apply. See the A4988 data sheet for the details.

I have created a video that shows the whole thing:

In the Datasheet from AZ-Delivery is not mentioned how to set the current limit.

In my previous tests I assumed 0.05 ohms and calculated the nominal current.

But even that without success. Therefore the test to set the maximum current during operation.

The Pololu A4988 web page has good advice about setting the current limit. Just be careful to check if your A4988 has the same values for the current sense resistors. If not you need to adjust the formula.

...R

Robin2:
The Pololu A4988 web page has good advice about setting the current limit. Just be careful to check if your A4988 has the same values for the current sense resistors. If not you need to adjust the formula.

...R

I used this page first and calculated my maximum current from it. But neither with 0.05 ohms nor any other value in the calculation, the motor moves correctly.

Therefore, as shown in the video, I turned the potentiometer very slowly to see whether the motor was turning with a different setting. But it does not turn in any position.

As I understand it, I only set the maximum current using the potentiometer. If the current threshold for the movement is reached, it would have to start rotating. I only limit the current to avoid overloading the motor.

I have just tested that I have pulled all pins that are not needed to ground via a resistor. In order to rule out that there is any interference on the inputs. But even that is not successful...

4k__:
I have just tested that I have pulled all pins that are not needed to ground via a resistor. In order to rule out that there is any interference on the inputs. But even that is not successful...

This is just a waste of time.

And so is this

Therefore, as shown in the video, I turned the potentiometer very slowly to see whether the motor was turning with a different setting. But it does not turn in any position.

Controlling a stepper motor with an Arduino and and A4988 is simple, reliable and straightforward.

Adjust the current setting to 1 amp (as suggested in Reply #6) and leave it there. Fiddling with it just causes confusion. And wire up the A4988 and the motor as shown in the Pololu web page.

Use the first code from this Simple Stepper Code (as suggested in Reply #5)

If it does not work then DO NOT change the wiring, or the code or the current setting. Just report to us what happens.

...R

So my wiring is exactly as it is shown on the Pololu page:

I use the exact code from the "Simple Stepper Code" Post and the limit current is set on 1 amp.

Nothing happens, the motor stands still. I only hear click like noises from the motor. When I try to turn it, I feel resistance.

4k__:
So my wiring is exactly as it is shown on the Pololu page:

Please make a drawing of your connections from looking at your project and post a photo of the drawing.

IF you have the connections as in the Pololu diagram AND IF you have the current set to 1 amp AND IF you are using the code from my example with NO CHANGES then the likelihood is that your stepper driver is faulty.

...R

You probably have a counterfeit or reject part. Buy a stepper driver from Pololu, and it will work properly. They guarantee it.

By the way, the A4988 is not suitable for that motor, and could never overload it.

In my limited experience, you may be trying to run the motor too fast and there's not enough torque... try slowing it down and see what happens. Also, check your microstep settings, as this can have a big effect also.
Hope this helps

1 Like

AxeGrinder:
In my limited experience, you may be trying to run the motor too fast and there's not enough torque..

The programs in my Simple Stepper Code run the motor slowly - about 4 steps per second.

...R

I found the problem.

There is a free ebook from AZ-Delivery that actually contains some very interesting things. However, the wiring which is described in the ebook is the same as with Pololu. Here you should connect RESET and SLEEP. But that doesn't work with my controller. When I connected RESET and SLEEP both to + 5V, the motor rotates. Maybe a problem in the batch?! Next time I'll buy directly from Pololu...

By the way: I found an additional solution for setting the maximum current of the motor. The AZ-Delivery ebook said that you can also connect an ammeter in series to a coil and thus set the maximum current without any calculation. (The motor should not rotate, but be in hold mode (STEP and DIR connected to +5V). Here it has the highest current throughput)

Theoretically, the motor should start to turn below the rated current. If you turn the potentiometer from the lowest voltage to the highest, there should come a point when the motor rotates(Except 1A are really not enough). But my 1.5A motor has already started turning well below 1A per phase.

Yes, the motor does not adapt to the controller by itself. I also ordered weaker ones. If a 1A per phase is sufficient, you can theoretically also operate this motor with it. You just don't have the full potential according to the data sheet.