Nema 17 Stepper Motor Issue

Hi, I'm currently completing my first arduino project which involves using stepper motors with an L298 motor driver and an arduino uno board.

I'm using the example arduino code for the stepper motors but, for some reason my motor only rotates about 20° using the default code. If I change the rpm or steps per revolution it doesn't move at all and only vibrates.

Nema 17 100:1 Stepper Motor
Power Supply: 12V 2.5A
Link to stepper motor datasheet: https://www.omc-stepperonline.com/download/17HS15-1684S-HG100.pdf

FYI I'm very new to arduino but, I'm guessing there's a problem with the code or power supply...

Wiring

Setup:

Diagram of wiring is attached and code can be found below, any suggestions would be greatly appreciated!

Watch it here:

Code

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {
 // set the speed at 60 rpm:
 myStepper.setSpeed(60);
 // initialize the serial port:
 Serial.begin(9600);
}

void loop() {
 // step one revolution  in one direction:
 Serial.println("clockwise");
 myStepper.step(1000);
 delay(500);

 // step one revolution in the other direction:
 Serial.println("counterclockwise");
 myStepper.step(-1000);
 delay(500);
}

Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask).


we would need to know what are the electrical requirements of your motor and how you power the system and what YOUR setup looks like exactly.

Thank you - updated the post to make it more forum friendly

thanks for the effort

Do you have the electrical specs of your motor? seems you have a reductor on top of it as well

also hard to say what's connected where in this

Ask it to do more steps than 1000.

The L289 has;

  • Motor Supply Voltage (Maximum): 46V
  • Motor Supply Current (Maximum): 2A

The DC power supply is 12V 2.5A and are the two black wires (Voltage and GRD).

Hope this image helps:

o

Also, anymore over 1000 steps and it vibrates with no movement - for some reason 1000 steps seems to be the sweet spot...

but what does the motor require ?
Nema 17 just tells us about the physical size.

That's odd. What happens if you change the -1000 to 1000?

Using an L298 ought to produce lots of heat and possibly ruining the L298.
Use a driver having current limiting. That motors spec say 1.6 Amp. 12 volt supply ought to give almost 8 Amps, if the power supply hangs on. I think the current limiting in the power supply kicks in.

Hi @bananacream

Be careful, you are feeding the arduino with +5V through the USB, but you are also feeding the arduino with +5V coming from the L298 module because the J5 jumper is connected.

See images and diagrams below with red arrows.

RV mineirin


The L298 incompatible with this kind of stepper motor. You need a current controlling stepper driver such as DRV8825.
You may damage the driver or your stepper with this combination.

Thanks for the reply - the stepper motor just always rotates the same direction but, the amount of rotation lessens every time?

Thank you! I thought this was weird (I was going off a youtube tutorial) and I've unplugged it - unfortunately no change to the stepper motor

Thanks for the help, I'm actually just copying a past project using the exact same tools so unless the driver has been damaged by the previous owners I'm fairly sure they're compatible.

According to: https://www.omc-stepperonline.com/nema-17-stepper-motor-l39mm-gear-raio-1001-high-precision-planetary-gearbox-17hs15-1684s-hg100.html

The electrical specs are:
2.7V
1.68A

How can that be compatible, if the motor specs says 2.7V and you operate it with 12V through a simple H-bridge which will give (nearly) the whole voltage to the coil without limiting the current?

Sorry I'm a arduino noob. So, should I try and limit the power supply voltage to 2.7V? The stepper motor and motor driver must work together (my particular setup may need some adjustment) as I have seen the past project utilise them together.

This is not an arduino problem. It is simply electrical basics. This motor is designed to operate with a current limiting driver. The L298 cannot do that.

The L298 has a fairly high voltage drop, that must be taken into account.
And the rated current of 1.68A is per coil. So the complete current flow will be twice as much ( when operating with 2.7V at the coils ).
You should switch to a suitable driver or use a stepper with a higher rated voltage.

1 Like

Its a 1.6 ohm (ie low impedance) stepper, so requires current drive, not voltage drive. You need something like a DRV8825 module to drive this motor, an L298 is completely unsuitable.

Nope, sqrt(2) times as much as coils are driven in quadrature and the nominal current is for one coil full on and the other off. Anyway this isn't really relevant as stepper driver chips do all the work and act as buck converters anyway so the current from the supply is different again... At power up stepper drivers send 71% of nominal current to each winding, corresponding to 45 electrical degrees of quadrature - at least many of the chip's I've used do this (consult datasheet for DRV8825 etc).

Where do you see that in the datasheet of the stepper? It only states 1.68A per phase and both coils engaged in full step. There is nothing with one coil full on and the other off. ( I know the microstep table of the DRV8825, but that's something different. You can see related values of the motor only in the datasheet of the motor ).