I am running a Pololu A4988 Stepper driver with two (soon to be three) steppers using the AccelStepper library. I have wired 1/8th microstepping on both as smooth running is important.
The motors run fine however, when running simultaneously, if Stepper 1 finishes its move before the Stepper 2, there is a marked increase in speed in the Stepper 2 (evident audibly and visually).
The code I use to run the motors is:
void MoveAccelXY(int Xm, int Ym) // function 6
{
X_Axis.moveTo(Xm);
Y_Axis.moveTo(Ym);
while(X_Axis.distanceToGo() !=0 || Y_Axis.distanceToGo() !=0)
{
X_Axis.run();
Y_Axis.run();
}
Xpos = X_Axis.currentPosition();
Ypos = Y_Axis.currentPosition();
Serial.print("X" + Xpos);
delay(50);
Serial.print("Y" + Ypos);
delay(50);
Serial.print("C");
}
I would like there to be no speed drop on any steppers. Increasing the input voltage does not have an effect.
Is the Arduino clock speed the culprit?
setMaxSpeed()?