Stepper motors -- Ticking, but not moving!

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! :slight_smile:
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 :slight_smile: )

You need to CAREFULLY set the current limit on the A4988 driver appropriately for your motors, in any case less than 1.5 amperes/winding and drive the motors at an appropriate speed.

The Pololu web page has a video on how to set the current limit on their A4988 drivers.

Welp, tried it, things blew up. Electrical smoke. Fun!

I'll get back to you on if things are salvageable. Thanks for letting me know, It'll be useful!

Man I'm clumsy! :o

IT'S OKAY EVERYTHING'S FINE :slight_smile:
Just a motor driver blew up, had three extra, got someone more careful to do it!

The solution to my problem:
As it turns out, the steppers were in 1/16th microstepping mode. I didn't know this as I had followed a build guide which had set it up this way. So, with my testing, I had it step once every half second or so. However, in order to achieve noticeable rotation, under 500 microseconds was needed.

3 days of research to fix such a simple issue ;-;

Did you follow @jremington's advice to (carefully) adjust the current limits for your steppers?
If you haven't done that yet, the "current" current could be too high and fry your motor(s) if they are driven beyond their limits.

I have written a kind of manual how to deal with the current settings of A4988 and DRV8825 drivers.
You can find it here: http://forum.arduino.cc/index.php?topic=415724.0

#define stepPin 5
#define dirPin 6

  int pauseje2Schritte = 400;
  int zahlderSchritte = 1000;
  
void setup() { 
  Serial.begin(9600); 
  Serial.println("Starting stepper exerciser."); 

  pinMode(stepPin, OUTPUT); 
  pinMode(dirPin, OUTPUT); 

  digitalWrite(dirPin, HIGH); 
  digitalWrite(stepPin, LOW); 
  

} 

    void loop() { 
 
      digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction 
      // Makes 200 pulses for making one full cycle rotation 
      for(int x = 0; x < zahlderSchritte; x++) { 
        digitalWrite(stepPin,HIGH); 
        delayMicroseconds(pauseje2Schritte); 
        digitalWrite(stepPin,LOW); 
        delayMicroseconds(pauseje2Schritte); 
      } 
      delay(1000); // One second delay 
      
      digitalWrite(dirPin,LOW); //Changes the rotations direction 
      // Makes 400 pulses for making two full cycle rotation 
      for(int x = 0; x < zahlderSchritte; x++) { 
        digitalWrite(stepPin,HIGH); 
        delayMicroseconds(pauseje2Schritte); 
        digitalWrite(stepPin,LOW); 
        delayMicroseconds(pauseje2Schritte); 
      } 
      delay(1000); 
      
      digitalWrite(stepPin,LOW);
      delay(3000);
      
    }

Here is the code that can change the direction and speed of a stepper motor, my hardwares are:steppermotor, motor controllerL297,arduino mega2560. I hope it helps.

These links may be useful
Stepper Motor Basics
Simple Stepper Code

...R