Stepper Motor L298N not Stepping Correctly at Low Speeds

Hello everybody,

I am new to using Arduino and building circuits and I've run into some trouble controlling a stepper motor.

I want to precisely control a NEMA 17 bipolar stepper motor using an L298N Dual H-bridge motor controller connected to an Arduino UNO. I have 12V-2A power source connected to the L298N motor controller, and a 9V battery connected to the UNO. I am also using the Arduino Stepper Motor example, which I have pasted below. I have also included the link to the place I ordered the motor as well.

I have the 8, 9, 10, 11 digital pins connected to IN 1, IN 2, IN 3, and IN 4 on the L298N respectively. I also have the motor A and A\ pins connected to OUT 1 and OUT 2 and B and B\ connected to OUT 3 and OUT 4.

When I use the code that I've provided, despite being the right number of steps per revolution (the motor's step angle is 1.80 degrees), the motor barely moves and does not make a complete rotation. I've been reading through some other threads and looking at guides online but I can't figure out for the life of me what I am doing wrong.

Thank you in advance for your help!


/*
 Stepper Motor Control - one revolution

 This program drives a unipolar or bipolar stepper motor.
 The motor is attached to digital pins 8 - 11 of the Arduino.

 The motor should revolve one revolution in one direction, then
 one revolution in the other direction.


 Created 11 Mar. 2007
 Modified 30 Nov. 2009
 by Tom Igoe

 */

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

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


Link to the Stepper Motor: STEPPERONLINE Nema 17 Stepper Motor Bipolar 2A 59Ncm(84oz.in) 48mm Body 4-Lead W/ 1m Cable and Connector Compatible with 3D Printer/CNC: Amazon.com: Tools & Home Improvement

The L298N is an ancient, extremely inefficient brushed DC motor driver, and is not at all suitable to drive most modern, low impedance stepper motors.

Post a link to the product page or data sheet for the stepper motor, and forum members can advise on a suitable stepper driver.

I had no idea the L298N was out of date, I've included a link to the amazon page I found the motor. It has a link to the company website, but it is all in Dutch.

That is a reasonably powerful stepper, with maximum current draw of 2A and coil resistance of 1.4 Ohms (11 W total). The claim of 1.4 horsepower on the seller's page is utter nonsense, so beware that other details may be incorrect.

To run that motor at full power and torque you need a current limiting stepper driver capable of easily handling 2A per winding continuous duty, and a motor power supply of 12 to 36V, 20 Watts or more for a safe margin.

This motor driver would be suitable. Be sure to follow instructions to set the current limit to 2A or less.

1 Like

Uh, ditto on that. Whoops. I figured old meant "solid."

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