Stepper motor speed and acceleration control?


#1

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);  
}  
}

@tec_support


#2

Hi yousimxing,

Sorry that we may don’t have enough ability to check the personal arduino program.

But for the issue “when moving the motors, they seem to have a very abrupt movement”, do you have the same problem when you use the example program TestStepperMotors which provided by our R&D guys?
If yes, you may take a video to show us this phenomenon.


#3