This is just some remarks about adjusting stepper drivers like DRV8825 and A4988; it might also apply to other motor drivers with internal Vref voltages.
I write these notes as a lot of people are searching for simple recipes to answer the question:
“How to adjust/limit the driver’s motor current?”
Although there is a lot of information in this forum and in the I-Net answering to this question, I think a lot of them are just copying what others said, but if you are really looking for what you should do, step by step - without losing an important step (coming to that later) - then this piece is missing most of the times.
The recipe looks quite simple:
- find the Vref adjustment point of the driver
- use the adequate formula to translate the required max. current (per coil) to Vref
- adjust to that value by turning the adjustment potentiometer
All of these steps are correct.
But the following questions are not answered:
→ under what conditions can I do that adjustment? with the following questions
- Do I need to power only the logic power supply from Arduino to the Vin of the driver?
- Do I need to have Vmot connected and powered?
- Do I need to have the stepper motor connected or not?
- Do I need to turn the motor by running the Arduino’s motor sketch?
- Do I need to turn the potentiometer clock-/or counter-clockwise to raise Vref (and as a result the current)?
If you look at the DRV8825/A4988 CHIP (!) datasheet, it will give us some answers.
- The A4988 does NOT come with an internal power regulator to be used for Vref, so it needs +Vdd (and GND) from the Arduino.
- An exception is a “larger carrier version” of the A4988 breakout board made by Pololu which comes with an internal voltage regulator - in this case you don’t need +Vdd from Arduino
- The DRV8825 has an internal 3V3 regulator (Pin V3P3OUT) which is used by the breakout board to provide this voltage to the reference potentiometer as its max. reference point, so NO need and no connection pin for +Vdd
- If there is no +Vdd from the Arduino needed or possible (the DRV8825 does not come with a “+Vdd” pin), then you will need Vmot to power the chip and use its internal voltage regulator to produce the output voltage to the potentiometer which then can adjust Vref to the appropriate Vref sense pin of the driver.
- Referring to the datasheet of the chips it doesn’t matter if the motor is connected or not as this has no influence on the “production” of Vref
- Same applies to the question, if the motor is turning (getting step and direction information from the Arduino) or not
- If the coil current is raised or lowered by turning the potentiometer CW is a question of how the manufacturer of the breakout board implemented the pot
1a. If you have an A4988 (normal build without voltage regulator on breakout board) you need to connect +5V and GND from Arduino to the driver
1b. If you have an A4988 with voltage regulator then you can omit the +5V connection
1c. The DRV8825 has its own chip internal regulator, so you won’t find a +Vdd connector on board
1a does not need Vmot
1b does not need Vmot
1c needs Vmot (watch the Vmot limits < 45V; recommendation: stay under 40Vmax)
No, but if it is connected, it doesn’t matter
Edit: it DOES matter with some clones (see posts #14/#15) → to be on the safe side: don’t connect the motor yet! Otherwise it could be that you can’t measure any Vref value.
No. So you don’t need to run a sketch while adjusting current limits. But - after you have set the current limit by adjusting Vref to the equivalence of Imax (of one coil) you might lower the current while it is turning under load until it’s close to lose steps (most of the time Imax will result in more torque than your application needs; re-adjusting by lowering the current saves energy and lowers the operating temperature of driver and motor).
Because it’s a question of how the manufacturer set up the board design, there is only one correct answer: for the original pololu breakout boards of A4988 and DRV8825 you turn the potentiometer clockwise to raise Vref and thus the current and CCW to lower the current.
For all other drivers it’s a matter of either your manufacturer provides an information about that or you have to find out on your own (be careful only to turn the screwdriver in very small portions).
Find out the Vref location on the breakout board - Pololu comes with two locations: a via close to the chip and the center point of the potentiometer; clones mostly only provide the center point of the potentiometer
Connect GND with your multimeter “-” probe; connect "+"probe with Vref on the driver board (with an unisolated screwdriver you can attach the “+” wire of the multimeter and then you can adjust while measuring. Be careful not to cause a shortage by sliding around with the tip of the screwdriver
Adjust Vref (=Imax) by turning the potentiometer CW/CCW (see 5.) to a value which follows the driver’s calculation formula.
Find the formula for the current sense circuit for your actual driver. Do not use advice from another driver: they might be different. This should be given to you when you bought the driver. It might be in the product description or on a piece of paper in the box. The formula below (for DRV8825) is based on the very common 0.1 Ohm sense resistors but yours might be different. For A4988, most common Rcs = 0,05 Ohm.
The formula for drivers is often written in a “non expert” way, such as Imax = x * Vref.
For simplification I follow this:
- DRV8825: Imax = 2 * Vref (which means if Imax = 1.5A, then Vref is to be set to 1.5/2 V = 0.75V)
- A4988 : Imax = 2,5 * Vref // with Rcs = 0,05 Ohm
If you want to use another method, have an amp meter and are skilled enough in electronics you could also use the “direct” method to adjust the current:
You will typically want to set the driver’s current limit to be at or below the current rating of your stepper motor. One way to set the current limit is to put the driver into full-step mode and to measure the current running through a single motor coil without clocking the STEP input. The measured current will be 0.7 times the current limit (since both coils are always on and limited to approximately 70% of the current limit setting in full-step mode).
This is a quote from Pololu’s website about the DRV8825 and applies also to the A4988.
######### UPDATE (January 2017): ############
Pls read reply #16 to get updated information on Pololu’s A4988 boards (since Jan 2017).