Stepper motor vibrating without turning

Hello ,
I lately tried to make a stepper motor works with an a4988 driver, but it is vibrating and not turning, i can feel that it is "turning inside".
The stepper i am using is : Moteur 17HS15-0404S - Moteurs pas-à-pas | GO TRONIC
i have configured the potentiometer to 217 mV.
and i have used this code that i found online for test :
const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 200;

void setup()
{
	// Declare pins as Outputs
	pinMode(stepPin, OUTPUT);
	pinMode(dirPin, OUTPUT);
}
void loop()
{
	// Set motor direction clockwise
	digitalWrite(dirPin, HIGH);

	// Spin motor slowly
	for(int x = 0; x < stepsPerRevolution; x++)
	{
		digitalWrite(stepPin, HIGH);
		delayMicroseconds(2000);
		digitalWrite(stepPin, LOW);
		delayMicroseconds(2000);
	}
	delay(1000); // Wait a second
	
	// Set motor direction counterclockwise
	digitalWrite(dirPin, LOW);

	// Spin motor quickly
	for(int x = 0; x < stepsPerRevolution; x++)
	{
		digitalWrite(stepPin, HIGH);
		delayMicroseconds(1000);
		digitalWrite(stepPin, LOW);
		delayMicroseconds(1000);
	}
	delay(1000); // Wait a second
}

I am using a power source of 12V . And i have connected the driver to the stepper i am not sure if i did right the 4 coils of the stepper, so what i have done is :

  • Black -> 2B
  • Red -> 2A
  • Green -> 1A
  • Blue -> 1B

Datasheet of the stepper : https://www.gotronic.fr/pj2-31116-1506.pdf

Thanks.

You need to post the complete program.

The Pololu A4988 web page has a good wiring diagram and other tips, including how to set the current limit.

Try this Simple Stepper Code

Always start with a very slow step rate - maybe as low as 2 steps per second.

...R
Stepper Motor Basics

Hello @Robin2
Thanks for the reply, yes i have followed the tuto of polulu . but in wiring the motor i am not sure i have done it well. and that was all the program i have used

Unless you have manufacturers documentation for your particular stepper motor I suggest you don't rely on the wiring colours. Use your multimeter to establish which pair of wires belongs to each coil and connect one coil to the A terminals and the other coil to the B terminals.

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

That s what i was thinking of . i will try it and get back with the results
Thanks

Try:

  • Black -> 2B
  • Red -> 2A
  • Green -> 1B
  • Blue -> 1A

If motor runs reverse, swap Red & Blue.

Hi Dani_lo.

Just try different value of delayMicrosecond() command in "for" loop. ie: 300 or 3000 ...ect.
I had same problem when I used step motor SUMTO & module TB6560.
But when I use delayMicrosecond(200), moto turns smoothly.

I'm trying to figure why, because I'm just beginner. :wink: :wink: .
Hope that it can help you!

You have a high impedance motor and are not providing enough supply voltage to the A4988.
You need 18 or 24V or more to get this thing upto spec from a chopper driver chip, as it has 30 ohm
windings (most bipolar steppers are in the range 0.5 to 4 ohms).

Normally you'd have the supply voltage 5 to 30 times the current-resistance product of the
motor winding to allow good current-drive from a chopper driver. You motor's current-resistance
product is 12V, so for good current drive you are really going to struggle.

This motor is really designed for a dual-H-bridge at 12V, and to go only slowly.

For a current driver like A4988 or DRV8825 choose a motor of about 1.2A to 1.5A current for
good performance without overloading the chip.

MarkT:
You have a high impedance motor and are not providing enough supply voltage to the A4988.

I have a some similar motors and they work reliably with A4988 drivers and a 12v supply.

Of course a higher voltage is needed for higher speeds and I usually power them from a 19v laptop power supply.

...R