Microstepping increases resonance with A4983 breakout board

Hi, I have this 12V Stepping motor sparkfun.com/products/9238
and the A4983 stepping motor driver carrier (w/o voltage reg’s) pololu.com/catalog/product/1201/ .

The problem is that resonance increases with microstepping (and it is quite high to start with).

I imagine this is a fault on my part, as I have this setup 3 times and all function the same. Without microstepping, (using the A4983 in full step mode) there is significant noise at every pps rating, the quietest I can manage to make the system, is in full step mode and with 2 millisecond delay between loops.

// ARDUINO MEGA 2560 CODE
void setup() {                
pinMode(48, OUTPUT);       // motor 1 direction
digitalWrite(48, LOW);     // motor 1 direction positive (clockwise facing robot)
pinMode(49, OUTPUT);       // motor 1 step
}
void loop() {
digitalWrite(49, HIGH);    // motor 1 start step
digitalWrite(49, LOW);     // motor 1 cease step
delay(2);  // 2 ms minimum high time
}

If I use delay(1); then the motor will not turn, just resonate loudly with stator locked!

If I make delay(>2); then the motor will turn as expected, but resonate very loudly!

Does anybody have an idea as to what I could be doing wrong?

Hello.

In general, your system will vibrate at your stepping frequency, which is an audible 500 Hz when you are delaying for 2 ms, so you aren’t necessarily doing anything wrong. Do you have the stepper motor integrated into a larger mechanical system or are you presently just stepping the motor by itself?

Note that we have received feedback from customers that our drivers are much quieter than the ones they had been previously using, so I suspect the culprit is your stepper motor itself or the system it’s in. I’m guessing that the frequency response of your system is such that the volume goes up as the frequency goes up; as you use smaller microsteps, you are increasing the frequency to keep the speed constant, which probably makes the noise louder.

By the way, you should insert a delay of at least 1 us between when you drive the step line high and when you drive it low. Arduino digital I/O functions are so slow that you probably don’t need to worry about this much, but it’s bad practice to count on poorly written library code to satisfy timing constraints (e.g. things could suddenly break if Arduino were to rewrite the library functions to be more efficient):

void loop()
{
  digitalWrite(49, HIGH);
  delayMicroseconds(1);
  digitalWrite(49, LOW);
  delayMicroseconds(2000);  // step rate is 500 Hz
}

If you use delayMicroseconds() for your step delay, then you have more resolution at step rates (i.e. you can get step rates between 500 Hz and 1 kHz).

- Ben