Nema 17 vibration sound

Hi, I made a little robot as a personal project using 3 nema17 motors (17HS8401S) a cnc shield v3, 3 drv8825 drivers (calibrated to 0.8 vref), a arduino uno and a psu that delivers 12V 6A, the drivers are properly cooled, the code I am using will be used in the final version of the robot:
#include <MobaTools.h>

#define step1 2
#define step2 3
#define step3 4
#define dir1 5
#define dir2 6
#define dir3 7

MoToStepper motor1(200, STEPDIR);
MoToStepper motor2(200, STEPDIR);
MoToStepper motor3(200, STEPDIR);

bool movementInProgress = false, no_comment = false;
int step = 0, pos1 = 0, pos2 = 0, pos3 = 0, i;
int rampLen = 20;

void setup() {
Serial.begin(115200);
delay(1000);

motor1.attach(step1, dir1);
motor2.attach(step2, dir2);
motor3.attach(step3, dir3);
motor1.setMaxSpeed(100);
motor2.setMaxSpeed(100);
motor3.setMaxSpeed(100);
motor1.setRampLen(rampLen);
motor2.setRampLen(rampLen);
motor3.setRampLen(rampLen);

Serial.println("Set the Step size using - and + keys.");
}

void loop() {

if (Serial.available() > 0) {
char input = Serial.read();

switch (input) {
  case '+':
    if (step >= 100) {
      Serial.println("Step can't be set higher than 100!");
      break;
    }
    Serial.print("Step set to: ");
    if (step < 5)
      ++step;
    else if (step == 5)
      step += 5;
    else
      step += 10;
    Serial.print(step);
    Serial.print('\n');
    no_comment = true;
    break;
  case '-':
    if (step <= 0) {
      Serial.println("Step can't be set as a negative value!");
      break;
    }
    Serial.print("Step set to: ");
    if (step <= 5)
      --step;
    else if (step == 10)
      step -= 5;
    else
      step -= 10;
    Serial.print(step);
    Serial.print('\n');
    no_comment = true;
    break;
  case '7':
    pos1 += step;
    no_comment = false;
    break;
  case '8':
    pos1 = 0;
    no_comment = false;
    break;
  case '9':
    pos1 -= step;
    no_comment = false;
    break;
  case '4':
    pos2 += step;
    no_comment = false;
    break;
  case '5':
    pos2 = 0;
    no_comment = false;
    break;
  case '6':
    pos2 -= step;
    no_comment = false;
    break;
  case '1':
    pos3 += step;
    no_comment = false;
    break;
  case '2':
    pos3 = 0;
    no_comment = false;
    break;
  case '3':
    pos3 -= step;
    no_comment = false;
    break;
  case '0':
    pos1 = 0;
    pos2 = 0;
    pos3 = 0;
    no_comment = false;
    break;
  case 'o': 
    rampLen += 10;
    motor1.setRampLen(rampLen);
    motor2.setRampLen(rampLen);
    motor3.setRampLen(rampLen);
    Serial.print("Ramp length increased to: ");
    Serial.println(rampLen);
    break;
  case 'p': 
    if (rampLen > 1) {
      rampLen -= 5;
      motor1.setRampLen(rampLen);
      motor2.setRampLen(rampLen);
      motor3.setRampLen(rampLen);
      Serial.print("Ramp length decreased to: ");
      Serial.println(rampLen);
    } else {
      Serial.println("Ramp length can't be decreased further!");
    }
    break;
}

motor1.moveTo(pos1);
motor2.moveTo(pos2);
motor3.moveTo(pos3);

}
} the problem I am facing right now is that the motors make a weird sound when I try and use the setRampLen function, I attached below a video
Robot sound.zip (2.3 MO)
I want to use the setRampLen function in order for the robot to run smoothly.

Perfectly normal! The stepping is making all the long arms vibrate.

How is it done?

setRampLen is used to make starting and stopping of the movement more smooth.
If you want the steppers to make less noise you should use microstepping.
Without microstepping this noise is normal.

I am using 2 fans of 12V 5A, 5000rpm, in a case.

And what would be a good microstepping option 1/16?

Heatsinks used?

Those fans looks like overkill. Surpricingly low airflow cools a lot.

The higher the microstepping the less the noise. But with higher microstepping the max possible speed will drop and you may loose step accuracy ( microstep positions aren't as exact as fullstep positions - if this is important for you). So it's always a compromise.
If you really need silent move of the steppers you could consider changing the DRV8825 to the trinamic drivers ( e.g. TMC 2209 ). These drivers can operate a stepper almost silently.

Yup, I used a heatsink, and I know that is overkill but I like to have more than less airflow.

Ok, good to know but do the TMC2209 drivers work on cnc shield v3 and does that silent noise comes at a trade with low accuracy?

Good question - I never tried that. The pinning of the TMC breakout boards is nearly the same as with the DRV8825. Different are the MSx and Reset and Sleep pins. If you don't use the UART mode of the TMC it may work, but you definitely have to have a closer look.

In silent mode, the TMC uses additional interpolated microsteps between the (micro)steps from the step input. So it will never stop at these interpolated steps, but reduce the noise when moving from step to step.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.