Driving a Stepper Motor with A4988

Hey Everybody,

I recently purchased a bipolar stepper motor from Jameco ([https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10001&freeText=2158531&langId=-1&storeId=10001&productId=2158531&krypto=7QuTBIeAvehd%2BfNIxtC1o6GgeKn5dPXjF4JcB7nZJKGGDhdX42T%2FtuI%2BFD3noOZsU2BcjJYHWfJlE2ZT5bjsPOsbK9dCIYL5IoY6TG4MSAM%3D&ddkey=https%3AStoreCatalogDrillDownView](http://Jameco P/N 2158531)).

I also purchased the A4988 Stepper Motor Driver from Pololu.

I am trying to figure out how fast I can turn the motor output shaft in RPM’s. I am currently driving the motor in FULL steps.

Going strictly by the code, and the 750 microsecond time delay between trigger, delay, pull low, then delay for a total of 1500 microseconds per step, I calculate a shaft speed of 200RPM. When I manually timed this, I got about 160RPM(attributable to overhead in my code)…I should probably look at this in my oscilloscope for the actual RPM’s.

I see a few facts and figures I the A4988 data sheet like:
–5000 hour bearing life at 1000 full steps /sec
–max starting pulse rate of 1600 pps half step no load

With all of this being said, HOW fast should I really be able to drive this motor at no load?

In order to drive the device, I wrote some very basic code in C for an Arduino Uno:

#define STEP 2
#define DIR  3
#define MS1  4
#define MS2  5
#define MS3  6
#define EN   7

int t = 750;

void setup()
{
  //set inputs/outputs
  pinMode(STEP, OUTPUT);
  pinMode(DIR, OUTPUT);
  pinMode(MS1, OUTPUT);
  pinMode(MS2, OUTPUT);
  pinMode(MS3, OUTPUT);  
  pinMode(EN, OUTPUT);

  //initialize stepper for full step and direction
  digitalWrite(MS1, LOW);
  digitalWrite(MS2, LOW);
  digitalWrite(MS3, LOW);
  digitalWrite(DIR, HIGH); //Pull direction pin low to move "forward"
  digitalWrite(EN, LOW);
}

void loop()
{
  while(1)
  {
    digitalWrite(STEP,HIGH); //Trigger one step forward
    delayMicroseconds(t);
    digitalWrite(STEP,LOW); //Pull step pin low so it can be triggered again
    delayMicroseconds(t);
  }
}

TIA,
–Neal

Hello, Neal.

Since that 1600pps maximum starting pulse rate is when half stepping under no load, it sounds like it you might be able to achieve a starting pulse rate of 800pps when doing full steps, which is about 240 RPM. The speed that the bearing life specification was obtained at makes it sound like it can achieve speeds of around 300 RPM (though it cannot run this quickly from a standstill).

In general, there are a few things you can do to increase the speed of your stepper motor; you can read about those things in this forum post. In particular, increasing your supply voltage and gradually ramping up the speed can probably help your system, but the top speed you can get might be limited by the driver you are using. The coils of your stepper motor are rated for 1.7A per phase and our A4988 carrier cannot handle that without sufficient additional cooling.

-Jon