16th stepping stepper motor with A4988 driver carrier from Pololu

So in an effort to control the stepper motors more accurately I’ve invested in some Pololu Stepper motor driver carrier boards. This gives 2 advantages over a traditional H bridge arrangement,

  • Micro stepping,
  • Current limiting.

Using the diagram from here but with a few changes, I pulled ms1,2,3 to high to enable a resolution of 16 microsteps, and wired it to an Arduino for control.

#define stepPin 2
#define dirPin 3
#define enablePin 4
void setup()
{
pinMode(enablePin, OUTPUT);
digitalWrite(enablePin, HIGH);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
digitalWrite(enablePin, LOW);
delayMicroseconds(10);
digitalWrite(dirPin, HIGH);
}
void loop()
{
digitalWrite(stepPin, LOW);
delayMicroseconds(2);
digitalWrite(stepPin, HIGH);
delayMicroseconds(80);
}

this simple code allowed me to achieve around 3.8 revolutions per second, or ~230rpm. Which is a lot more than in full stepping mode without jumping.

Bookmark the permalink.

Comments are closed.