I've been trying to make a simple two axis cnc. I am just in the beginning phase to I just wanted to check out the accelStepper library. With the help of constantSpeed and Bounce sketch example I got some idea and wrote the following code.
#include <AccelStepper.h>
AccelStepper stepperX(4, 4, 5, 6, 7);
AccelStepper stepperY(4, 8, 9, 10, 11);
unsigned int X = 800;
unsigned int Y = 600;
void setup(){
stepperX.setMaxSpeed(200);
stepperX.setSpeed(10);
stepperY.setMaxSpeed(200);
stepperY.setSpeed(10);
stepperX.move(200);
stepperY.move(200);
}
void loop(){
stepperX.runSpeed();
stepperY.runSpeed();
}
When I upload this sketch the motor does not run. But when I change runSpeed() to run() and add setAcceleration() the motor then runs but with acceleration. I don't want acceleration. So, is there any way to do this without acceleration.