Vibrating NEMA 17 Stepper with L298N

Yellow,

I've been trying to control a NEMA 17 stepper motor (from Stepperonline) with a L298N driver (Sparkfun) with an Arduino Mega following instructions from the Sparkfun manual and other forums, but it doesn't seem to work. Schematic with connections attached below.

Once I upload the code to the board, the motor starts vibrating and making short, incomplete rotations. I already verified to be using continuous coils on each side, inverted connections of digital PWM, tested for voltage/amperage, 4 different L298N drivers, and still the same problem. Code attached below if it's worth anything.

// Include the Arduino Stepper Library

#include <Stepper.h>

// Number of steps per output rotation

const int stepsPerRevolution = 200;

// Create Instance of Stepper library

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(stepsPerRevolution);

delay(1000);

// step one revolution in the other direction:

Serial.println("counterclockwise");

myStepper.step(-stepsPerRevolution);

delay(1000);

}

Please I need help I'm about to lose it ;(

1 Like

That looks like a serious mismatch combining that driver with that stepper.
Please post a link to the datasheet of the stepper. NEMA 17 is a mechanical specification telling absolutely nothing about the electrical needs.

That's not schematics. It's a Fritzing picture.

I'm getting started with drivers and steppers, read through a few forums and pages that made this combination work, didn't knew it was that awful.
Stepper motor specs: https://www.omc-stepperonline.com/download/17HS16-2004S1.pdf

That's a 1.3ohm 2 Amp stepper for which the L298 is totally inadequate.

You need something like a TB6600 for that motor, and a 24volt supply if you want performance.
Leo..

Is there any other driver that you'd recommend for these specs? The TB6600 is too bulky for the applications that I need the motor for.

The devil is reading the bible, his way, people say. You missed the data about amps. How would You control the amps with a driver having no current control?
You're not the first guy committing that mistake. Luck if nothing was destroyd.

A recent paranthesis from real life....
Normally yes, but..... Using eBay, or similar, TB6600 and 24 volt supply I got 30% extra steps! Using 12 volt worked perfectly.

If You want to use 2 Amp You need something extra. Some small matchbox sized drivers might manage but they need both heat sink and fan cooling, occupying space.

1 Like

Polulu is often mentioned here. Not used them yet.

1 Like

Thanks for the help, will evaluate on these options!

You have bought a motor that is meant to be used for high speed.
If you only have the room for a matchbox-sized driver, then you should have bought a different motor, with specs about 1Amp and about 3volt.
If you must use a small driver, then use the DRV8825, set to 1.5Amp. Expect lower performance.
Leo..

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.