ok.. had a few minutes to play again..
So I am using this code:
#include <AccelStepper.h>
// Define a stepper and the pins it will use
//stepper(driver, 3(step), 2(dir))
//AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
AccelStepper stepper(1, 3, 2); //stepper(driver, step, dir)
//AccelStepper stepper(AccelStepper::DRIVER, 9, 8);
void setup(){
stepper.setMaxSpeed(500.0);
stepper.setAcceleration(400.0);
}
void loop(){
stepper.runToNewPosition(0);
stepper.runToNewPosition(1500);
delay(1000);
stepper.runToNewPosition(100);
stepper.runToNewPosition(1200);
}
and I noticed, that there is some sort of jerky/stall/glitch movement at the end of the range/target position.
If you watch the video, you will notice that right before the shaft changes direction, there is a brief, glitch/jerk in the shaft (like a brief stall)..
I took a video:
https://www.youtube.com/watch?v=q0wqjO5Pgu0&feature=youtu.be
I changed the code to this to get a bit more range, and test some values.
#include <AccelStepper.h>
// Define a stepper and the pins it will use
//stepper(driver, 3(step), 2(dir))
//AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5
AccelStepper stepper(1, 3, 2); //stepper(driver, step, dir)
//AccelStepper stepper(AccelStepper::DRIVER, 9, 8);
void setup(){
stepper.setMaxSpeed(1500.0);
stepper.setAcceleration(1000.0);
}
void loop(){
stepper.runToNewPosition(0);
stepper.runToNewPosition(2500);
delay(1000);
stepper.runToNewPosition(100);
stepper.runToNewPosition(2200);
}
About the same results.. except more speed..etc..(loger run out..etc)
I then SLOWLY adjusted the pot..
it seems if I went one way.. that clunky/jerky movement at the end softened/disappeared... (but I could then easily stop the shaft with my fingers...so it must have been turning the current DOWN)..
I turned it up.. and the shaft became more difficult to stop with my fingers, but you could then see/hear the jerky movement behavior again (slightly.. but enough to know it was there)..
I settled for a position where it was strong enough and least 'jerk' when changing shaft directions..
Would micro stepping help eliminate this?