[music]
Hi, I'm Claire from Pololu Robotics and Electronics, and today I'm going to show you how to set
the current limit on our stepper motor driver carriers using the VREF voltage.
It's important to note that we don't preset this to any particular value,
so you should always follow these steps to set the current limit of your driver
before connecting it to a motor.
To do this, you'll need an appropriate power source, a multimeter, a small screwdriver,
and of course your stepper motor driver system.
Here I have a DRV8825 carrier connected according to its minimal wiring diagram,
but I've left the motor disconnected until we set the current limit to a safe value.
I'm using an A-Star 32U4 Prime SV to provide a regulated 5 V for the logic power supply,
and later I'll use it to get the motor stepping.
The first step in setting the current limit is determining the amount of current
you want to use to run the motor.
A good place to start with this is finding the rated current per phase of the motor.
This is the maximum amount of current that the motor was designed for.
For our stepper motors, this can be found in many places, including the datasheet
and even the product name itself.
The stepper motor I'm going to use is product number 1209,
which has a rated current of 1 A per phase.
To get the full torque from your motor, you would want to choose a driver
with a continuous current rating higher than the rating of your motor,
and then set the current limit to match the rating of the motor.
You can set the current limit lower than this if you want the system to run cooler,
take less power, and generally avoid the problems that come from running a system at its limits.
However, you should typically not set the current limit higher than the rating of your motor
since doing that could damage the motor.
You can find the ratings for your driver on the Specs tab of its product page.
The DRV8825 has a maximum continuous current per phase of 1.5 A.
Since the continuous current rating of the DRV8825 is above the 1 A rating of my motor,
I'm not limited by the driver, and I can set a current limit as high as the rating of my motor.
For this demo, I'm going to set my current limit to match the rating of my motor,
since a current limit of 1 A makes some of the calculations I'm going to do
a little bit later easier to follow.
Once you know what current limit you want, you can use the equation found in
the "Current limiting" section of your particular driver's product page to calculate
the appropriate VREF voltage setting.
For the DRV8825, the current limit in amps equals VREF in volts times two.
This means I will set VREF on my DRV8825 to 0.5 V to get a current limit of 1 A.
If you are using an A4988 or other type of driver, the equation will be different.
The next step is to locate the VREF measurement point.
This point is in a different spot on each carrier and is marked on each carrier with a white circle.
Now you can turn on the power supply
and connect it to the board.
Then, measure the voltage at the VREF via.
You can also measure this voltage from the top of the potentiometer.
To make it really easy to see how changing the potentiometer affects the VREF voltage,
I'm going to change my multimeter's probe
and clip it directly to my screwdriver.
Even though the top of the potentiometer looks like it's meant for a Phillips-head screwdriver,
we've found that often a small flat-head screwdriver works better.
As I turn the potentiometer clockwise, the VREF voltage increases,
and as I turn it counterclockwise, the VREF voltage decreases.
As we previously calculated, I want to set VREF to approximately 500 mV
to get our desired current limit of 1 A.
Once you're done adjusting the potentiometer, you can disconnect the power
and then connect your stepper motor.
Since this is just a quick demo, I'm going to plug my tinned motor wires directly into the breadboard,
but I wouldn't recommend doing this for a more permanent setup.
It's important to make sure that the power is off while you do this since disconnecting
or connecting your stepper motor while it's powered could damage it or the driver.
Now, if you load a simple program onto your controller and reconnect the power,
you can see the motor step.
For most cases, you are now ready to start using your motor and driver in your application.
But I'm going to take it a step further and verify that setting VREF to 500 mV
really did give us a current limit of 1 A.
To do this, I'm going to disconnect the power
and then reconnect my multimeter in series with one coil of my motor.
It's difficult to measure the current through the stepper motor's coils while it is stepping
since the current is constantly changing, so I'm going to change to a program
that doesn't step the motor.
Now we can see the amount of current flowing through one coil.
We set the current limit to 1 A, so why does the multimeter only read about 600 mA?
This is because I have the DRV8825 set to operate in full-step mode.
In full-step mode, the driver only energizes both coils at about 70% of the current limit that we just set.
This is shown in the "Relative Current and Step Directions" table in the DRV8825's datasheet.
So, in full step mode, with the current limit set to 1 A, each coil of the motor will actually
only draw a maximum of 700 mA.
Here on the multimeter, we see closer to 600 mA because of several factors
like averaging and tolerance of the components and meter.
Since the current through one coil is only 70% of the current limit,
if you only plan to use your motor in full step mode, you can increase the current limit
until the actual current through the coils equals the rated current.
However, in the same table from the datasheet, we can also see that for each microstepping mode,
the DRV8825 does set the winding current to 100% of the current limit on key steps.
So if you plan to use microstepping, you should not set the current limit higher than
the current rating of your stepper motor.
The A4988, DRV8824, and DRV8834 stepper motor drivers all have similar tables in their datasheets.
Like the DRV8825, in full-step mode, they will only allow the winding current to reach
about 70% of the current limit.
You might have noticed that the power supply is only reporting a current draw of about 300 mA,
even though around 600 mA is flowing through each coil,
meaning the total draw of the motor is about 1.2 A.
That doesn't seem right. How can the motor be drawing more current than the supply is outputting?
Let's take a step back and think about what we're missing here.
There is also the voltage to consider.
We can see that the supply is outputting 12 V, but how much voltage is across the motor's coils?
Let's measure it!
Looks like it's about 2 V.
Now let's look at the voltage and current together by calculating the power drawn from the supply
and the power delivered to the stepper motor.
We can see on the supply that the current is about 300 mA and the voltage is about 12 V,
so the power is about 3.6 W.
For the motor, the current is about 600 mA, times 2 coils, and the voltage is about 2 V,
so the power is about 2.4 W.
The power drawn from the supply is greater than the power delivered to the motor,
which is consistent with conservation of energy, and intuitively what we would expect.
The lost power is likely going into heat in the motor driver, which is why it can get very hot.
The current drawn by the motor is higher than the supply current because the driver is converting
the higher voltage of the supply down to a lower voltage for the motor.
This is why you should always use VREF or the actual coil current when setting your current limit,
not the power supply current.
Learning how to set the current limit on your stepper motor driver
puts you one step closer to perfecting your project.
For tips, tricks, and help, check out the links in our video description and visit our forum.
[music]