# Setting current limit using NEMA17 + Pololu A4998

Hi everyone,

I am trying to set a current limit for the stepper motor (full step mode), but not sure if this is the right way I am doing it. I just want to be sure that I get everything out of this motor that i can.

I use LDO-42STH47-1684AC stepper motor and the specifications of this motor can be found here: http://i00.i.aliimg.com/img/pb/573/914/609/609914573_464.jpg

Stepper motor I use have a maximum current rating of 1.68A/phase. In full step mode, the current through the coils is limited to 70% of the current limit, so to get a full step coil current of 1.68A, the current limit should be 1.68/0.7 = 2.4A, which corresponds to a VREF of 2.4A/2.5 = 0.96V

I used potentiometer on the board to set a VREF to 0.96V and I checked it from the + probe on the turnpot and - on a ground pin with multimeter.

Is the right way of setting the current limit?

The Pololu web page for its A4988 explains the process of setting the current limit.

The simplest way is to measure the voltage at the reference pin and adjust the potentiometer according to the formula they give Current Limit = VREF × 2.5

In that case your calculations should use 1.68 amps as the current limit.

If that is set correctly and if you measure the current in a coil while the motor is powered but stationary it should be 1.68 * 0.7 = 1.176 amps.

Be very careful not to disconnect the motor from the driver when the driver is powered up. You will instantly fry the driver.

...R

Robin2:
The Pololu web page for its A4988 explains the process of setting the current limit.

The simplest way is to measure the voltage at the reference pin and adjust the potentiometer according to the formula they give Current Limit = VREF × 2.5

In that case your calculations should use 1.68 amps as the current limit.

If that is set correctly and if you measure the current in a coil while the motor is powered but stationary it should be 1.68 * 0.7 = 1.176 amps.

Be very careful not to disconnect the motor from the driver when the driver is powered up. You will instantly fry the driver.

...R

And how to measure the current in a coil?

1. switch all power off
2. disconnect one end of one coil and connect it to your Multimeter (amp/ current measuring mode)
3. connect the second wire of your multimeter with the driver (where the wire to the motor was before)
4. select the range your max current is expected (e.g. If you expect 1.2A, select 2A range)
5. power your arduino, driver and test

In all seriousness, run the motor for a while then press your finger on it. If it's too hot to hold your finger on it for a few seconds then you have too much current. And of course if the motor feels quite cool and it's still capable of powering your project then there's no need to increase the current.

The maximum current rating is all about the heat tolerance of the motor. Too much current and it gets too hot and starts burning the insulation on the windings.

You can also measure the power from the supply (VI), and compare to the power the motor expects (I-squared-R) - expect something like 60 to 80% efficiency in the A4998.

For instance if motor is 2 ohms and 1.5A, then it ought to get 4.5W, so with a 12V supply you
might expect around 0.5 to 0.7A drawn from the supply.

If you want to measure current in the winding you have to step one step at a time till the highest
reading is obtained, that's the current amplitude. You also have to rig the multimeter properly with
screw terminals or croc-clips so you can't accidentally break the circuit and push inductive spikes back
at the driver.

sidlauskas:
And how to measure the current in a coil?

It is not really necessary to do that.

...R

In all seriousness, run the motor for a while then press your finger on it.

I like your pragmatic engineering approach !!
Was close to give a similar answer below but then I remembered having been corrected by some precisely calculating physicists, that this is not the way to solve such a problem.

Next time I will be an engineer again ...

rpt007:
Next time I will be an engineer again ...

Back in the day when car engines sometimes overheated I had a simple philosophy. If the temperature gauge stops rising things will be OK.

...R

I have one more question to you guys. Right now I use AccelStepper library to control the stepper motor and it works great except that the motor skip steps on higher speed & acceleration rates. What could be the reason of that?

The motor won't skip steps only on very slow speed/acceleration rate like in this example: AccelStepper: Bounce.pde

But it starts skipping them when I set maxSpeed and acceleration to 500.

BTW. The motor won't skip steps at that speed without acceleration.

sidlauskas:
except that the motor skip steps on higher speed & acceleration rates. What could be the reason of that?

I don't think you have told us what power supply you are using (volts and amps).

Generally speaking higher voltages facilitate higher speeds.

If you have max speed at 500 and acceleration at 500 does that mean that it goes from 0 to max speed instantly? If so that would partly explain the problem.

...R

Steppers always(*) skip if you try to drive too fast or accelerate too fast. The mechanical load
is a strong controlling factor so you have to measure the maximum speed and accelerations
that allow reliable operation. Little thing called the laws of physics at work there.

(*) Having said that I have an ultra-miniature (6mm diameter!) stepper than can go from 0 rpm
to 2400 rpm instantly, but its moment of inertia is many orders of magnitude smaller than even
a 28BYJ-48....

MarkT:
Steppers always(*) skip if you try to drive too fast or accelerate too fast. The mechanical load
is a strong controlling factor so you have to measure the maximum speed and accelerations
that allow reliable operation. Little thing called the laws of physics at work there.

(*) Having said that I have an ultra-miniature (6mm diameter!) stepper than can go from 0 rpm
to 2400 rpm instantly, but its moment of inertia is many orders of magnitude smaller than even
a 28BYJ-48....

How I can calculate those maximum speed & acceleration rates? Or I should just try different rates combinations and find which works best?

I don't think there is any alternative to experimentation - unless you are super good at engineering maths.

...R

There are far too many factors to calculate other than very roughly, its not like a DC motor with
a single torque/current ratio. Resonance and winding inductance are both big issues here.

2.5 is wrong!!!!

Vref = Ilim * (8*Rs)
then you have to set 70% of the value if you use full steps configuration

Rs -> the resistor in the board , usually Rxxx like R100 = 0.1ohm

peekpt:
2.5 is wrong!!!!

Vref = Ilim * (8*Rs)
then you have to set 70% of the value if you use full steps configuration

Rs -> the resistor in the board , usually Rxxx like R100 = 0.1ohm

What are you referring to?

...R

I am building a test station to set the current on different TMC2208, DRV8825, and A4988 driver cards. I know how to use the Vref method. The problem is, I can’t find a Vref value for many no-name cards.

It seems that measuring the motor current directly skips over the driver card Vref problem, but the motor must not be stepping to do the measurement. The video (Pololu - Video/ Setting the Current Limit on Pololu Stepper Motor Driver Carriers.webarchive) shoes all the connections but doesnt say how to properly power the motor in a no step condition.

Is there an Arduino program to do this?

ardbtg:
but doesnt say how to properly power the motor in a no step condition.

Is there an Arduino program to do this?

I'm not sure what you have in mind for the Arduino program to do. You can easily set up a program that holds the step and direction pins LOW which will keep the motor stationary while you do your tests.

You should adjust the potentiometer to the lowest current setting before connecting everything and then gradually adjust the current upwards to whatever level you want.

Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

...R

Robin2:
Be VERY CAREFUL never to disconnect the wires between the motor and the stepper driver while the driver is powered up. The driver will be instantly destroyed.

Connect or disconnect in fact, as contact bounce will mean any connect operation is also multiple disconnects.
Any kind of dodgy connection between driver and motor is also a no-no. Use soldered connections or screw
terminal block if possible. Never change the wiring unless all power is off.

With a breadboard be very careful that the contacts are not stretched or worn, as unreliable contacts will
again destroy the motor driver through arcing. Some flimsy hook-up wires designed for breadboards are
really poor - use only high quality ones for the motor windings, or 0.6mm single core wire.