Hi everyone,
I'm trying to make work a simple code for a stepper motor like this : Nema 17 stepper motor. Whose specifications indicates a 0.9A rated current.
So I bought A4998 drivers A4998, as it says it could drive up to 2A per phase.
I have a 30V/10A power supply for the motors and I control the driver with an Arduino UNO.
I already tried to power the logic voltage of 3.3 to 5V of the driver with both the 5V of the Arduino and with a LM2596 step down to 5V.
I also have several stepper Motors and several drivers of the same type.
My problem is the motors won't turn despite making some noise as if it were turning, so I did some research and the main causes could be :
-> Not enough power : It couldn't be that as I use a 30V/10A power supply
-> A software problem : I don't think either, I tried with both Accelstepper library and to control directly the step and drive pin
-> A wiring problem : I checked multiple time compared to the resources found on the internet, so I hope it's not that (I also tried changing all the wires) : Example of tutorial
-> Phase Inverted of the motor : I measured with a multimeter what phase of the motor are connected and also tried with a LED to turn the shaft (to be sure )
-> Limit current of the driver not properly set : I follow the tutorial and also try to turn the potentiometer on A4998 to increase the limit current.
So, When I try the simple code it makes some noise but won't turn:
digitalWrite(DIR2,HIGH); //Enables the motor to move in a perticular direction[/color]
// for one full rotation required 200 pulses[/color]
for(int x = 0; x < 200; x++){
digitalWrite(STEP2,HIGH);
delay(250);[/color]
digitalWrite(STEP2,LOW);
delay(250);
}
When I connect the Arduino with a separate source not linking the Arduino Ground and power Ground, the motor turns but irregularly.
In conclusion, my only guess is that the A4998 driver is not able to provide enough current to the motor so it can't turn. So I require your opinion on my situation, if you see another problem. And if I need to replace the driver will a DRV8225 be enough for the motor.
[UPDATE] Don't buy HALJIA A4998 on Amazon they were the cause of all the troubles. I received 5 new A4998 from a different brand and 4 of them are working (I start thinking stop buying on Amazon).
Thanks for your response