1

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 < 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)

enter image description here

and video: (Google Video link is dead @ 2017-02-09)

zx485
  • 246
  • 4
  • 15
haxscramper
  • 143
  • 4

1 Answers1

1

Add a second delay after:

digitalWrite(X_STEP_PIN , LOW);

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

Andre Courchesne
  • 676
  • 5
  • 11