Video: Setting the Current Limit on Pololu Stepper Motor Driver Carriers

One of my many roles here at Pololu is overseeing technical support, and I have seen countless cases of customers who have problems with their stepper motor systems because they have not properly set the current limit on their stepper motor driver. To address the issue, we have made a new video that demonstrates how to set the current limit on our stepper motor driver carriers. The video also provides helpful tips and points out a few common pitfalls.

A DRV8825 carrier is used for the demonstration, but the video also applies to our A4988, DRV8824, and DRV8834 stepper motor driver carriers. In the demo, signals for the driver are provided by an Arduino-compatible A-Star 32U4 Prime SV. Here is a simplified version of the Arduino code from the video that can be used to step a motor in both directions:

/* Simple step test for Pololu stepper motor driver carriers 
This code can be used with the A4988, DRV8825, DRV8824, and 
DRV8834 Pololu stepper motor driver carriers.  It sends a pulse 
every 500 ms to the STEP pin of a stepper motor driver that is 
connected to pin 2 and changes the direction of the stepper motor
every 50 steps by toggling pin 3. */

#define STEP_PIN 2
#define DIR_PIN 3

bool dirHigh;

void setup()
{
  dirHigh = true;
  digitalWrite(DIR_PIN, HIGH);
  digitalWrite(STEP_PIN, LOW);
  pinMode(DIR_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
}

void loop()
{
  // Toggle the DIR pin to change direction.
  if(dirHigh)
  {
    dirHigh = false;
    digitalWrite(DIR_PIN, LOW);
  }
  else
  {
    dirHigh = true;
    digitalWrite(DIR_PIN, HIGH);
  }

  // Step the motor 50 times before changing direction again.
  for(int i = 0; i < 50; i++)
  {
    // Trigger the motor to take one step.
    digitalWrite(STEP_PIN, HIGH);
    delay(250);
    digitalWrite(STEP_PIN, LOW);
    delay(250);
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *