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

Posted by Claire on 14 April 2015
Tags: pololu videos

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

50 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
Maybe add this info (atleast that you need to set the current limit) to the datasheet? haven't found it in any..
Hi, Chris.

The product pages for our stepper motor driver carriers cover most of the same information that is in the video on setting the current limit. What specific information do you think is missing from the product pages?

-Claire
Hi Claire,
First of all kudos for this beautiful and very helpful video. Now coming to the problem. I have the DRV 8225 and I set up the Vref as you instructed. When I upload the sample program(listed on this very website) my motor just makes high pitch sounds. Can you please tell me where I am going wrong?.

Thank you
Hello, Aatif.

I am glad you liked the video! Sorry you are having problems with your DRV8825 carrier. There are several things that could be causing a problem like that, including stepping too fast for your motor or having too heavy of a load. If you would like help troubleshooting the problem in more detail, you can post on our forum with more information about your system as well as pictures of your setup and we would be happy to help.

Brandon
Hello Claire

thanks for this video,It is a great help for me.
could you pease tell me where I could find the electronic circuit you used to set the current limit.
I am a newbee , sorry

regards
Hello, servane.

When setting the VREF voltage, you can connect the driver as shown in the minimal wiring diagram found on the product page for each stepper motor driver carrier, excluding the motor connections. Once the current limit is configured appropriately, you can momentarily remove power and then connect your motor as well.

If you have additional questions about using one of our stepper motor driver carriers, I recommend posting a request for help on our forum.

Brandon
Great post
Claire,

Great video. After connecting components based on the Pololu's "Minimal Wiring Diagram", the VREF reading on the multimeter continually flashes random numbers from zero to a 2.50. Never stops at one number. Impossible to get a reading. Any suggestions?
Hi, Chuck.

Please contact us via email at support@pololu.com for troubleshooting like this.
Hi there, i was wondering if anyone know how can i get maximum rpm speed with full setp setting on driver for my stepper motor? does current setting affect the rpm speed or not? I have Nema17 with 1.5 A rate current/phase, inductance 3.7 mH/phase, rate voltage DC 3.6
Hello, Mike.

The current limit setting is one factor that will affect the maximum speed you can get out of your stepper motor, so to maximize that you should make set the current limit to the maximum allowed by your stepper motor or stepper motor driver, whichever is lower. You can also check out this forum post which lists some other things you can do to maximize the speed you can achieve with your stepper motor:

https://forum.pololu.com/t/increasing-the-speed-of-a-stepper-motor-using-the-a4988-and/5135/3

- Patrick
Hello,
What is the capacity of the capacitor connected to driver?
Thanks,
Mehran
Hello, Mehran.

I am not sure if you are asking about the ceramic capacitors that are part of the stepper driver carrier used in the video, or the additional electrolytic capacitor used in the test setup. The values of the ceramic capacitors used on our many of our stepper motor drivers are shown in their schematics on their product pages. This video was made several years ago, so I am not sure what the exact value of the electrolytic capacitor used in the video is, but we generally recommend adding a capacitor with at least 47 µF of capacitance across motor power (VMOT) and ground somewhere close to the board to protect it from LC voltage spikes.

- Patrick
Thanks Patrick. I have another question. I want to set the reference voltage to 0.2 but using potentiometer the lowest that I could get was 0.8 vol.
The comments of this blog post are not a good setting for troubleshooting. Instead, you might consider making a post about this on our forum:

https://forum.pololu.com/

In your post, I recommend you share more details about your setup (like what driver and power supply you are using) along with pictures that show all your connections, your driver, and how you are measuring VREF.

- Patrick
I am trying to set up a separate test station to set up motor druvers, I have a UNO with a CNC board that I plug my driver cards into.

I can use the Vref to set the current, but I have not been abe to get the motor current method to work. I do not know how to power the motor without steppping. Can you show that program?

Thanks.
Hello, Ben,

To power your motor without stepping, all you need to do is enable the driver. The comments section of this blog are not a great setting for troubleshooting, so if you require further assistance, you might consider making a post on our forum:

https://forum.pololu.com/

- Patrick

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