Pololu Blog »
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); } }
50 comments
-Claire
PS. cool shirt too :)
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
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
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
It's more comprehensible for me. Have a nice day.
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
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
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 for the feedback. We are glad you found the video helpful!
-Claire
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
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?
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
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?
https://www.adafruit.com/categories/575
https://www.sparkfun.com/categories/54
-Jon
-Claire
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
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.
I can save an entire hand now !! ha ha
After the change multimeters's probe and clip red cable to screwdriver,where you connect the black cable?
You can connect the black probe to any of the GND connections on the stepper motor driver carrier.
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
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
Great video! You may have saved me many hours of debugging my project. Thanks!
Flavio
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
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
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
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
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 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?
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
What is the capacity of the capacitor connected to driver?
Thanks,
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
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 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.
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