Stepper motor jittering I'm trying to make a nema17 stepper motor work using ramps1.4 and A4988 driver.
But when I'm trying to rotate motor, it spins with almost no torque and constant shaking.


Motor 2-phase nema17 , Step Angle 1.8° .
Power supply 12v/60w.


Here is the sketch:
(I copied it from RepRap wiki , and removed everything except X Motor)

#define X_STEP_PIN         54
#define X_DIR_PIN          55
#define X_ENABLE_PIN       38

void setup() 
{
  pinMode(X_STEP_PIN       , OUTPUT);
  pinMode(X_DIR_PIN        , OUTPUT);
  pinMode(X_ENABLE_PIN     , OUTPUT);
  digitalWrite(X_ENABLE_PIN, LOW);
}

void loop () 
{    
  if (millis() % 10000 &lt; 5000) 
  {
    digitalWrite(X_DIR_PIN    , HIGH);
  }
  else
  {
    digitalWrite(X_DIR_PIN    , LOW);
  }

  digitalWrite(X_STEP_PIN     , HIGH);
  delay(1);
  digitalWrite(X_STEP_PIN     , LOW);    
}


The wiring diagram:
(I have only X Motor plugged in)



and video: (Google Video link is dead @ 2017-02-09)
Add a second delay after:

digitalWrite(X_STEP_PIN    , LOW);

Also try increasing the delay maybe you are pulsing the step pin too fast.