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

Posted by Claire on 14 April 2015

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

33 comments

Really well done. Look forward to more of this type of information on your products.
Thanks, I am glad you liked the video! We would love to hear suggestions for other products or topics you would like to see more videos about.

-Claire
Thanks for the detailed video! Really makes learning much much easier, 10/10! ^.^
Great video, thanks for posting! Made setting up my drivers a cinch. I don't know how many others you've made, but i'd be keen to see them, is nice to see a video where the information is made so clear and simple, definitely makes learning this stuff much easier. also makes me glad i got these drivers (best tutorials and info makes me wanna buy more stuff). The current limiting feature makes things so much more flexible, better than the others i've tried, u guys make awesome stuff!
PS. cool shirt too :)
Hi, ManBearPig.

I am glad you found the video helpful! We do have a few videos for some of our other products. You can find all of our videos on our Youtube page.

-Claire
muchas gracias, primero no me andaba y después de miles de intentos, cambie el driver y anduvo. vi que el primer driver lo queme ;(
Hello Claire,
Thank for your video ! It seems to be very detailed. However I'm French, and I don't understand very well what you say. Is it possible to make a short resume of your video by writing?
I'm interested in your video because I would know if the DRV8825 is good in my case or not.
Thank a lot in advance
Regards
Hi, Pierre.

The video has captions that you can turn on by clicking the CC symbol in the bottom right corner of the video's pop-up user interface. You can also access different settings for the captions (like different languages) by clicking the gear symbol to the right of the CC symbol. If you want to see all of the captions from the video at once, you could select "Transcript" from the "More" menu which can be found just above the video's description if you are viewing the video directly on YouTube.

-Claire
Thank a lot Claire !
It's more comprehensible for me. Have a nice day.
Fantastic video, Claire! Exactly what I'v been looking for. The tip about reading Vref off of the pot was particularly helpful since my board doesn't have a via to read it directly (it's not from Pololu. Don't hate me).
Forgot to ask: are you running the sample stepper motor code above while doing the current limiting test?
Hello, Ross.

I am glad you found the video helpful. When setting the current limit, you do not need have any code running or stepper motor connected. If you are referring to the part in the video where Claire uses the multimeter to measure the current draw of the stepper motor, stepping the motor during this process will make it difficult to measure, since the current through the coil will change as the motor is stepped.

-Brandon
Hello,

I have a pololu 1182 stepper driver. My stepper has 12v/0.4A. Using the instruction in the video I set (without motor connected) the VREF to 0.18V ==> ~0.45A on the coil. I measure the coil current with the STEP input to high and I get ~0.36A. I connect the motor, 12v on the VMOT (I also have a 220uF cap very close to VMOT). On STEP I have a 1kHz signal, duty cycle 50%. The VMOT shows only 0.07A during running. If I try to stop the motor spindle with my hand, the current incresses to 0.15A and it starts losing steps. I almost can stop it....like the torque is too low. What is not right in this setup ? many thanks in advance. D
Hi Claire, could you please point to your video on Youtube about A-Star 32U4 Prime that I've purchased (if there is one specially for this one). Seems to cannot find it anymore. Thanks
Hello.

We do not have a video that focuses on our A-Star Prime. If you remember that video you were thinking of, we would be interested in seeing it.

-Jon
Thank you Claire/Pololu, that was very helpful. I'm more the mechanical type and this provided a clear process for tuning the driver.
Hi, Bob.

Thank you for the feedback. We are glad you found the video helpful!

-Claire
Is there a transcript of the video or a document to set current limit? I have problems with sound in my office computers. So I cant use the video.
Hi, Vijay.

You can enable subtitles for the video by clicking on the settings button at the bottom right corner of the YouTube video's user interface overlay. You might also find it helpful to read the "Current limiting" section of our stepper motor driver carrier product pages, for example:

https://www.pololu.com/product/2133

-Claire
Hi,

Is it possible to use this carrier just as a current limiter for a charging application? I want to build a trickle-charger for a sensor where I can control the provided current, and I have a 3.7V Li-Po as a source. Can I use the carrier to do so by hooking up the A1 and A2 ports to positive and ground?
Hello.

Our stepper motor drivers use current limiting to control stepper motors, but they probably would not be very practical for your application. Instead, we recommend using a dedicated charging IC or circuit, and we do not have any specific recommendations on where to find those.

-Jon
Thanks Jon.

Just curious, why wouldn't it be practical? If A1 and A2 have a particular voltage drop, and is capable of providing a certain amount of current via the limiter, why wouldn't A1 and A2 be able to be hooked up to a battery to charge, given that the voltages are synced?
It might be possible to use a stepper driver as a basic constant-current charger for a battery, but dedicated battery charging circuits often have more advanced features like multi-stage charging (with a different charging strategy for each stage) and protection features. You might consider looking at some of the battery chargers made by Adafruit or SparkFun for your application:

https://www.adafruit.com/categories/575
https://www.sparkfun.com/categories/54

-Jon
The trimmer pot on the DRV8825 is of poor quality. It drifts in its setting and the metal ring on top is very fragile and subject to coming loose. I have made it my practice to remove the trimmer and wire on a larger but better quality trimmer. You use the same type trimmer on your adjustable-output switching regulators. Please consider upgrading these trimmers.
Thank you for the feedback. What potentiometer(s) do you like?

-Claire
hi just got my CNC Shield
http://www.ebay.co.uk/itm/331650096527?euid=e2485a7255604dae9254ee44f71d6c9e&bu=43039331609&cp=1&sojTags=bu=bu

and trying set up for my stepper motor to the A4988 Stepper Motor Driver but unsure on what Current Limit i need
the motor is
Step Angle 1,8°
Rated Voltage 12 V
Rated Current 0.4 A
Phase Resistance 30 Ohm/Phase

and runing on 12v 3.3amp power pack

can some help me on the Current Limit i have to set

david
Hello, David.

It looks like that CNC shield is not using one of our drivers, but in general, you would set the current limit to equal either the maximum rated current of the motor or the driver, whichever is lower. The equation to use for determining what VREF voltage to set on the stepper motor driver board's potentiometer to could be specific to that manufacturer, so you might want to approach them for that information. (The equation for our boards can be found directly on the A4988 carrier's product page.)

-Josh.
that little tip about connecting the voltmeter TO the metal screwdriver was really a great hack.
I can save an entire hand now !! ha ha
Hello,
After the change multimeters's probe and clip red cable to screwdriver,where you connect the black cable?
Hello, Dimitar.

You can connect the black probe to any of the GND connections on the stepper motor driver carrier.
Hello
so you connecting the power (Vmot and GND) to the DRV8825 and measure the Vref ? I see other connections, are they necessary for the process?

Thanks
Hello,

The logic power connections to the reset and sleep pins are needed to measure the Vref voltage. In the video, the DRV8825 carrier is set up following all the connections shown in the minimal wiring diagram from the carrier's product page except the motor connections.

-Derrill
Claire,
Great video! You may have saved me many hours of debugging my project. Thanks!
Flavio

Post a comment

Using your Pololu account allows you to customize your avatar and manage your comments; you can also post anonymously.

Related Products

DRV8825 Stepper Motor Driver Carrier, High Current
A4988 Stepper Motor Driver Carrier
A4988 Stepper Motor Driver Carrier, Black Edition
DRV8824 Stepper Motor Driver Carrier, Low Current
DRV8834 Low-Voltage Stepper Motor Driver Carrier
A4988 Stepper Motor Driver Carrier with Voltage Regulators
A-Star 32U4 Prime SV microSD with LCD
Stepper Motor: Bipolar, 200 Steps/Rev, 35×36mm, 2.7V, 1 A/Phase
170-Point Breadboard (White)

Related Categories

DRV8825 Stepper Motor Driver Carriers, High Current
A4988 Stepper Motor Driver Carriers
A4988 Stepper Motor Driver Carriers, Black Edition
Stepper Motors
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors