Hello, all!
I have not been working with steppers for long, and I don't have a clue what I am doing!
I am driving a stepper with the A4988 controller (Datasheet) and I have read (And seen from a working example) that they are very easy to drive:
Set pin ENABLE low, set pin DIR to the direction, pulse STEP pin and there ya go!
I have done every possible combination of pulses to the step pin, HIGHs and LOWs to the dir pin and all I get is a changing tone out of the steppers.
I can hear out of the steppers a tone when the ENABLE pin is LOW (Of course, because they are active!) and I can hear a slight change in the tone whenever the STEP pin is set high (of course, because it's changing active coils!)
The shaft is locked, and will not move (unless I set ENABLE high to disable the steppers)
I have messed about with the potentiometer attached to the driver (no clue what it actually does) and that didn't help (I returned them back to their original position now).
Please help! I know these drivers are supposed to make things easier, but I just cannot figure it out!
FULL SETUP:
--Arduino Mega 2650
--RAMPs 1.4 board (Information Page) TL;DR: Connects a lot of steppers.
--A4988 Controller (Datasheet)
--3.4V 1.8deg 1.5A 5.3kg/cm stepper (Page)
--12V 3A ac/dc adapter (generic - I've made sure it provides 12V and works in my area[60Hz 110V])
CODE:
#define motStep 54
#define motDir 55
#define motEnable 38
void setup() {
// put your setup code here, to run once:
pinMode(motDir, OUTPUT);
pinMode(motStep,OUTPUT);
pinMode(motEnable, OUTPUT);
digitalWrite(motEnable, LOW);
digitalWrite(motDir, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(motStep, HIGH);
delay(500);
digitalWrite(motStep, LOW);
delay(100);
digitalWrite(motDir, HIGH);
digitalWrite(motStep, HIGH);
delay(500);
digitalWrite(motStep, LOW);
delay(100);
digitalWrite(motDir, LOW);
}
Yes, I have tried simpler code -- this is the one I had on hand. Many people have posted "Working" code, which, Surprise, when tested out on my system, doesn't work (same issue)
I have tried a different motor, and I have tried a different driver. The results are the same, so I doubt I've let out the blue smoke.
Please help! I have been trying desperately to get these things working for the past 3 days!
Any replies are appreciated!
Video available, if needed.
(Also, any solutions to stop the stepper whistle would be great. 20kHz tones aren't the most pleasant thing in the world, however helpful in solving this issue )