Pages: [1]   Go Down
Author Topic: Help with running a Stepper Motor with L293D IC  (Read 1842 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have been having a heck of a time getting this simple stepper motor script to run the motor. We have the bi-polar stepper motor ( http://www.sparkfun.com/datasheets/Robotics/SM-42BYG011-25.pdf ) connected to the L293D controller chip in this fashion: http://arduino.cc/en/Reference/StepperBipolarCircuit (4-pin setup) and when it all gets plugged in, the motor shakes pretty hard, and kinda does some random turning back and forth (very hard to describe)... it also seems to do a few steps in any direction I start to force it to go...

I have tried all the combos of the motor wired, thinking I had those connected in the wrong order...

Anyone have any suggestions?

I have tried the two following sketches with the same results:

1:

#include <Stepper.h>
Stepper stepper = Stepper(85, 2,3,4,5);

void setup()
{
  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(30);

}
 
  void loop(){
  
   stepper.step(9000);
  }


2.


/*
 * MotorKnob
 *
 * A stepper motor follows the turns of a potentiometer
 * (or other sensor) on analog input 0.
 *
 * http://www.arduino.cc/en/Reference/Stepper
 */

#include <Stepper.h>

// change this to the number of steps on your motor
#define STEPS 100

// create an instance of the stepper class, specifying
// the number of steps of the motor and the pins it's
// attached to
Stepper stepper(STEPS, 8, 9, 10, 11);

// the previous reading from the analog input
int previous = 0;

void setup()
{
  // set the speed of the motor to 30 RPMs
  stepper.setSpeed(30);
}

void loop()
{
  // get the sensor value
 // int val = analogRead(0);

  // move a number of steps equal to the change in the
  // sensor reading
  stepper.step(500);

  // remember the previous value of the sensor
 // previous = val;
}
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

well, I got it working... there were some bad connections to the motor and only one coil was energizing...

thanks anyways...
Logged

Pages: [1]   Go Up
Jump to: