Hey guys,
I need some help with anyone familiar with stepper motors and motor drivers.
I have a 12v, 1.7amp bipolar gear head stepper motor that I attached to a A4988 Stepper Motor Driver with a 100uf capacitor. I connected these two to an Arduino Uno, a 5v regulated power supply, and a 24v, 1.5amp power supply but was unable to get the motor working properly as it just hummed.
Below is my code and a schematic drawing of how I connected the motor, motor driver, micro-controller, and both power supplies. I know I can apply up to 30v to the motor, which will just increase the torque, and I am aware that the motor driver has adjustable current limiting, chopper control, and can handle up to 35v.
I tested out the voltage of the 24v power supply, and it only jumped up to 27v initially, which is inside the parameters of the motor driver. The Arduino is working properly and my code looks correct. As a result, I’m unsure if it’s the motor or driver that’s faulty.
Best,
kk
[code]int x;
void setup()
{
pinMode(6,OUTPUT); // Enable
pinMode(5,OUTPUT); // Step
pinMode(4,OUTPUT); // Dir
digitalWrite(6,LOW); // Set Enable low
}
void loop()
{
digitalWrite(4,HIGH); // Set Dir high
for(x = 0; x < 200; x++) // Loop 200 times
{
digitalWrite(5,HIGH); // Output high
delayMicroseconds(500); // Wait 1/2 a ms
digitalWrite(5,LOW); // Output low
delayMicroseconds(500); // Wait 1/2 a ms
}
/*delay(1000); // pause one second
digitalWrite(4,LOW); // Set Dir low
for(x = 0; x < 200; x++) // Loop 2000 times
{
digitalWrite(5,HIGH); // Output high
delayMicroseconds(500); // Wait 1/2 a ms
digitalWrite(5,LOW); // Output low
delayMicroseconds(500); // Wait 1/2 a ms
}
delay(1000); // pause one second
*/
}[/code]