controlling 2 bipolar steppers

Hallo everybody,

I hope you can help me. I want to control 2 bipolar steppers. My question is, do I have to use 1 Arduino Uno in combination with 2 Arduino Motor Shield boards?

Thanks a lot.

Niklas

Which stepper motors do you want to drive? Many modern bipolar steppers have low-resistance windings intended for use with chopper-type drivers, and the Arduino motor shield is not suitable for them.

I plan to run 4 stepper motors controlled by 4 Pololu a4988 driver boards from a Uno. I've tested it with 2, I just haven't had a chance to connect the others yet - got distracted by another project.

...R

To the original poster: Which motor shield? There are a few out there, not all different.

Hi, I’m very new to all this but this is what i have found so far. Remember its all about tinkering!! 8) i salvaged half a dozen different stepper motors from old printers and scanners, all require different voltages and currents and steps. first, I put a cable tie (cut to about an inch long) around the motor output shaft gear to use as a pointer, make a pencil to line up under the cable tie, then, carefully rotate the shaft by hand and count the number of steps that you feel until the pointer lines up with the mark again. Do that a couple more times just to make sure you didn’t miss any. Now you know how many steps per rev each motor has (full steps)
If you now load a sketch that will run the motor WITH THE SHIELD, use a current limited power supply set to around 200ma. for initial saftey, or just the usb supply. Connect your motor and it should run. If you follow the instructions on the arduino motor shield page, you can cut the supply from the motor and use a separate power supply just for the motor. I monitor the current into the motor and adjust the voltage to keep it below 1.5amps.
Here is a sketch I found on here that works with the shield, the one in arduino examples will not work with the shield due to pin routing I guess (someone may know better) play around with number of steps and revs.
To run two steppers I expect you will have to use two shields and program the arduino to control them separately

// Include the Stepper Library
#include <Stepper.h>

// Map our pins to constants to make things easier to keep track of
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

// The amount of steps for a full revolution of your motor.
// 360 / stepAngle
const int STEPS = 48;

// Initialize the Stepper class
Stepper myStepper(STEPS, dirA, dirB);

void setup() {
// Set the RPM of the motor
myStepper.setSpeed(30);

// Turn on pulse width modulation
pinMode(pwmA, OUTPUT);
digitalWrite(pwmA, HIGH);
pinMode(pwmB, OUTPUT);
digitalWrite(pwmB, HIGH);

// Turn off the brakes
pinMode(brakeA, OUTPUT);
digitalWrite(brakeA, LOW);
pinMode(brakeB, OUTPUT);
digitalWrite(brakeB, LOW);

// Log some shit
Serial.begin(9600);
}

void loop() {
// Move the motor X amount of steps
myStepper.step(STEPS);
Serial.println(STEPS);
// Pause
delay(2000);

// Move the motor X amount of steps the other way
myStepper.step(-STEPS);
Serial.println(-STEPS);
// Pause
delay(2000);
}

// Include the Stepper Library
#include <Stepper.h>

// Map our pins to constants to make things easier to keep track of
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

// The amount of steps for a full revolution of your motor.
// 360 / stepAngle
const int STEPS = 48;

// Initialize the Stepper class
Stepper myStepper(STEPS, dirA, dirB);

void setup() {
// Set the RPM of the motor
myStepper.setSpeed(30);

// Turn on pulse width modulation
pinMode(pwmA, OUTPUT);
digitalWrite(pwmA, HIGH);
pinMode(pwmB, OUTPUT);
digitalWrite(pwmB, HIGH);

// Turn off the brakes
pinMode(brakeA, OUTPUT);
digitalWrite(brakeA, LOW);
pinMode(brakeB, OUTPUT);
digitalWrite(brakeB, LOW);

// Log some shit
Serial.begin(9600);
}

void loop() {
// Move the motor X amount of steps
myStepper.step(STEPS);
Serial.println(STEPS);
// Pause
delay(2000);

// Move the motor X amount of steps the other way
myStepper.step(-STEPS);
Serial.println(-STEPS);
// Pause
delay(2000);
}

//hope this helps :slight_smile:

Until the original poster tells us which motor shield he is using, there is no way to tell if any of that helps.

Even so... very detailed reply. But which motor shield are you using?

hi, its the arduino R3 motor shield :)

in his first post, he says he is using two arduino motor shields.

Yes, but he didn't say which ones. There are many "Arduino motor shields".

Do you mean this one? http://arduino.cc/en/Main/ArduinoMotorShieldR3

So the L298. Yes, not the latest thing for driving steppers. I have the old Ada Fruit motor shield, it has two L298 ICs on it. I do not like it. Too weird to drive it.

Note that pretty much all of the small 3D printers and many of the small CNC machines use the A4988 stepper driver boards, because they require less programming to drive, and less CPU time.