@jremington I see. I have the limit set at 2.8A. I've tried to use lower limits but still get the same jittery motion. The power supply led stays lit so i do not think its failing.
@MarkT I tried your suggestions. I used a moveTo() call when I receive the input from Serial but still get the jittery motion. Also, I cannot get the motor to move backward. I'm new to using the AccelStepper library. I've used the runToNewPosition() call with a Nema 17 motor and had no issue which is why I used it with the larger motor. I tried two versions of new code. The first is the Random example from the AccelStepper library.
#include <AccelStepper.h>
AccelStepper stepper(1, 6, 5);
void setup()
{
}
void loop()
{
if (stepper.distanceToGo() == 0)
{
delay(1000);
stepper.moveTo(rand() % 200);
stepper.setMaxSpeed((rand() % 200) + 1);
stepper.setAcceleration((rand() % 200) + 1);
}
stepper.run();
}
The second, I used the moveTo() call.
#include <AccelStepper.h>
AccelStepper stepper(1, 6, 5);
void setup() {
Serial.begin(9600);
}
void loop() {
stepper.run();
if (Serial.available() > 0) {
char input = Serial.read();
if (input == '0') {
stepper.moveTo(200);
stepper.setMaxSpeed(200);
stepper.setAcceleration(150);
} else if (input == '1') {
stepper.moveTo(-200);
stepper.setMaxSpeed(200);
stepper.setAcceleration(150);
}
}
}
I found I had to add the setMaxSpeed() and setAcceleration() calls in order to get something out of the stepper. Still get jittery motion and cannot get the stepper to reverse direction.