Hi,
I am using a Me Orion micro controller with two 42BYG Stepper motors attached to it. I am using Arduino to program the motors to move a very small distance continuously (coded like the TestStepperMotors example). When moving the motors, they seem to have a very abrupt movement, is there a way to make the movements smoother, maybe through controlling the acceleration or speed? I am using code that is formatted like this:
void step(boolean dir,int steps) //Controls Step Motor 1
{
digitalWrite(dirPin,dir);
delay(50);
for(int f=0;f<steps;f++)
{
digitalWrite(stpPin, HIGH);
delayMicroseconds(800);
digitalWrite(stpPin, LOW);
delayMicroseconds(800);
}
}
void step2(boolean dir2 , int steps2) //Controls Step Motor 2
{
digitalWrite(dirPin2,dir2);
delay(50);
for(int j=0;j<steps2;j++)
{
digitalWrite(stpPin2,HIGH);
delayMicroseconds(800);
digitalWrite(stpPin2,LOW);
delayMicroseconds(800);
}
}