2 phase motor help

I am using an Arduino 2560 with a L298N motor drive to drive a motor. I am attempting to increase the speed of the motor but once i hit a certain threshold the motor starts to sputter and doesn't spin anymore.

I am curious if this is due to a an insufficient amount of current or something to do with the motor. Any thoughts or suggestions would be greatly appreciated.

Motor: http://www.digikey.com/product-search/en?keywords=1460-1076-ND

volatile long stepsPerRevolution = 200;
volatile long motor_speed = 220; //Changing this value to increase motor speed

if (digitalRead(inButton) == HIGH) {
digitalWrite(Motor_EN_A, HIGH);
digitalWrite(Motor_EN_B, HIGH);
digitalWrite(Motor_EN_A, LOW);
digitalWrite(Motor_EN_B, LOW);

Can we assume you are using 24 volts on the stepper motor, as listed in the motor data sheet?


I did not realize from your title that you are using a stepper motor.

An L298 is a poor choice for driving a stepper motor. That motor seems to need 1 amp so you could drive it with a Pololu A4988 or DRV8825 stepper driver. They will allow the motor to be powered with a much higher voltage which is essential for high speed performance.

Have a look at Stepper Motor Basics


Its a low impedance bipolar stepper designed for current control, not voltage control.

The datasheet (you read it right?) suggests a minimum of 10V and a maximum of 110V
for that motor using a chopping driver. It gives usable torque up to around 500rpm when
run from 24V looking at the curve in the datasheet, so quite slow (because its not
low enough impedance, its 5 ohm - you'd normally expect 1 to 2 ohms for this
class of motor.