Introduction and a couple of questions

Hi everyone

I am new here so be gentle on me. I am retired and thought I would get started with Arduino to keep the grey matter active. I am having a problem and if I had any hair left I would be pulling it by now.

I am trying to control a bipolar stepper motor using an A4988 stepper driver and an Arduino Uno. I am using the information on the following site to get me started:

The stepper I am using is an Usongshine US-17HS4401 and the data sheet is here:

The stepper is using 24V.

The first problem I am finding is to set the appropriate current on the driver. I have wired it up as shown on the above-mentioned tutorial and am using a digital multimeter to measure the current. The maximum I can get from the driver is 1A whilst the stepper is rated for 1.5A. I have tried four different driver boards with the same effect. Also measuring the resistance of the stepper coils with the digital multimeter I am reading 3.7 ohms when the data sheet specifies 1.5 ohms. Does this mean that the stepper is faulty?

So thinking that a stepper taking less current should still work I continued with the tutorial and wired it up to the Arduino and loaded the code in the tutorial.

 // Define pin connections & motor's steps per revolution
const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 200;

void setup()
{
  // Declare pins as Outputs
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
}
void loop()
{
  // Set motor direction clockwise
  digitalWrite(dirPin, HIGH);

  // Spin motor slowly
  for(int x = 0; x < stepsPerRevolution; x++)
  {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(2000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(2000);
  }
  delay(1000); // Wait a second
  
  // Set motor direction counterclockwise
  digitalWrite(dirPin, LOW);

  // Spin motor quickly
  for(int x = 0; x < stepsPerRevolution; x++)
  {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin, LOW);
    delayMicroseconds(1000);
  }
  delay(1000); // Wait a second
}

The stepper turns in one direction but "hunts" in the opposite direction. I also noticed that if I reduce the coil current to around 300mA than the stepper behaves as it should but with this low current it seems to be to weak.

Help please. What am I doing wrong apart from the fact that I suspect the stepper could be faulty.

Thanks in advance

Vince

This Pololu page on their A4988 module describes how to set the coil current by setting the Vref.

vcutajar:
I have wired it up as shown on the above-mentioned tutorial and am using a digital multimeter to measure the current. The maximum I can get from the driver is 1A whilst the stepper is rated for 1.5A. I have tried four different driver boards with the same effect. Also measuring the resistance of the stepper coils with the digital multimeter I am reading 3.7 ohms when the data sheet specifies 1.5 ohms. Does this mean that the stepper is faulty?

First, do you have confidence that your multimeter can measure low resistances accurately?

If you do then perhaps the motor is different from the specification and maybe the higher resistance also accounts for the lower current.

You should be measuring the current when the motor is stationary and in that situation the stepper driver may automatically reduce the current to reduce the wasted energy and excessive heat. You need to study the A4988 datasheet.

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
Stepper Motor Basics
Simple Stepper Code

vcutajar:
The first problem I am finding is to set the appropriate current on the driver. I have wired it up as shown on the above-mentioned tutorial and am using a digital multimeter to measure the current. The maximum I can get from the driver is 1A whilst the stepper is rated for 1.5A.

Tutorial is wrong alas... Many stepper drivers startup at 45 electrical degrees, so that the if
the nominal current is 1A, each winding sees 0.7A. The nominal current is the rms of both coils,
so it might be (1A, 0A), (0.7A, 0.7A), (0.86A, 0.5A), depending on the current microstepping phase.

Measuring the current by breaking the circuit to the windings is fraught with danger, as if the circuit isn't
solid any intermittency can take out the driver completely. Never power up a stepper motor driver without
the windings correctly and solidly in circuit (or completely disconnected).

Just use the recommended method of setting the voltage on the trimmer output. This works always and
is unambiguous, and can be done before frying the motor windings (ie the motor doesn't need to be in circuit yet), but you do need to know which driver board you have to know the calibration of trimmer output voltage to nominal current output.

Also measuring the resistance of the stepper coils with the digital multimeter I am reading 3.7 ohms when the data sheet specifies 1.5 ohms. Does this mean that the stepper is faulty?

What value do you read shorting the multimeter leads together? Subtract that from your measurement. If its
still 3.7 ohms or so you have the wrong version of the motor and you'll need to set its current differently.

Thank you gentlemen for your replies. Just an update.

I got a refund on the stepper motor as it was out of spec and got myself a new and more powerful (2A/phase) Nema 17 stepper and it is working much better now. I am also experimenting with the AccelStepper library as I think it is a good idea gradually accelerate the stepper to speed.

The only problem that I have at the moment is that the stepper is not powerful enough for my needs. I cannot use a Nema 23 stepper because it does not fit. The only option that I see is to use a geared stepper motor but I still need to do some reading on them as there are so many gear ratios to choose from. I also have to keep in mind that the stepper has to turn faster to get the same RPM from the gearbox.

Vince

vcutajar:
The only problem that I have at the moment is that the stepper is not powerful enough for my needs.

Are you driving the 2 amp motor with an A4988? The A4988 cannot supply 2 amps continuously. 2 amps is also probably too much for a DRV8825 stepper driver. IMHO you need to get a driver that can supply 3 amps or more to give yourself some headroom. It is never good to work electronic components at their limit. The drivers with the TB66xx chips will probably be the cheapest.

Until you have a driver that is providing 2 amps for the motor you cannot know if it has too little torque for your project.

...R