I am using AccelStepper library but my steppers are not working. Seem like trying to change the step but don't have enough power. I hear the step noise with a frequency like 2-3/second but the best case is when is doing 2 or 3 chaotic steps forward and the same back. I am using A4988 with CNC shield on Arduino Mega2560. I have two NEMA 17 and one NEMA 23 connected. The rated current is 1.68A and 2A. The NEMA 23 I connected in parallel to Y and A axes. I set the current in the beginning. I tested putting it to maximum. I am using full step. Please advise until I break it all!
// Define some steppers and the pins they will use
AccelStepper stepper1(AccelStepper::FULL2WIRE, 2, 5);
AccelStepper stepper2(AccelStepper::FULL2WIRE, 3, 6);
AccelStepper stepper3(AccelStepper::FULL2WIRE, 4, 7);
//////////////////
void setup() {
stepper1.setMaxSpeed(1000.0);
stepper1.setAcceleration(100.0);
stepper1.moveTo(1000000);
stepper2.setMaxSpeed(1000.0);
stepper2.setAcceleration(100.0);
stepper2.moveTo(1000000);
stepper3.setMaxSpeed(1000.0);
stepper3.setAcceleration(100.0);
stepper3.moveTo(1000000);
}
/////////////
void loop() {
stepper1.run();
stepper1.setSpeed(100);
stepper1.runSpeedToPosition();
stepper2.run();
stepper2.setSpeed(100);
stepper2.runSpeedToPosition();
stepper3.run();
stepper3.setSpeed(100);
stepper3.runSpeedToPosition();
}