SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By Jrodenba
#199415
I'm testing out a stepper motor with a 100:1 reduction gear box attached.
The stepper is 42-H250B08, 24v, 0.8A, 200 steps/rev
The motor driver is a L298N breakout board
I'm using the standard "stepper_oneRevolution" example sketch just to test out the motors.
I changed the "stepsPerRevolution = 200" to "stepsPerRevolution = 20000" to account for the 100:1 reduction.
I also changed "myStepper.setSpeed(60);" to "myStepper.setSpeed(.6);" so as not to run the motor above it's max rpm

Within 10 sec it had overheated the L298N and burned it out...
Any ideas why it would do this?
Code and Pics below
Code: Select all
/*
 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 = 20000;  // 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(.6);
  // 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);
}
Image
By jremington
#199427
Note that setSpeed() takes a long integer argument, not floating point. https://www.arduino.cc/en/Reference/StepperSetSpeed

A loose connection on a motor lead, or attempt to connect/disconnect the motor while the driver while powered, will destroy any motor driver instantly.

The L298 has overtemperature shutdown, so did the motor move at all during those 10 seconds?