hi all
i'm trying to control 3 steppers with 3 big easy drivers from an Arduino Uno. with one driver and one stepper all was going fine, using the AccelStepper library to give me acceleration and (seemingly) easy addressing of multiple motors.
however, having hooked up a second driver and second motor i'm getting all sorts of weird jittery results, inconsistent speeds, stopping and starting, etc.
i have pulled MS2 and MS3 low to give me half-stepping, which i read would help, but no good news with that. i have both drivers using common ground and common power, and both steppers using a common ground on the arduino.
the code i'm using is a butchered example from the AccelStepper page.
andy pointers?
thanks
#include <AccelStepper.h>
AccelStepper stepper1(1, 9, 8);
AccelStepper stepper2(1, 7, 6);
void setup()
{
pinMode(4, OUTPUT); //MS3 - stepper2
digitalWrite(4, LOW);
pinMode(5, OUTPUT); //MS2 - stepper2
digitalWrite(5, LOW);
pinMode(10, OUTPUT); //MS3 - stepper1
digitalWrite(10, LOW);
pinMode(11, OUTPUT); //MS2 - stepper1
digitalWrite(11, LOW);
pinMode(8, OUTPUT); //direction
digitalWrite(8, HIGH);
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
pinMode(6, OUTPUT); //direction
digitalWrite(6, HIGH);
pinMode(7, OUTPUT);
digitalWrite(7, HIGH);
stepper1.setMaxSpeed(650);
stepper1.setAcceleration(800);
//stepper.setSpeed(1000);
stepper1.moveTo(5000);
stepper2.setMaxSpeed(400);
stepper2.setAcceleration(800);
//stepper.setSpeed(1000);
stepper2.moveTo(5000);
}
void loop()
{
digitalWrite(8, HIGH);
stepper1.run();
digitalWrite(6, HIGH);
stepper2.run();
}