Ramping a stepper motor I at the moment trying smoothly move a stepper motor. The problem with the stepper motor, is that it makes a high pitch noise while it moves, or sometime a crackling noise from the motor. 

So i tried ramping up the frequency of the step signal, which seemed to help a bit but not perfect. Then I tried micro stepping rather than  full stepping, which also helped a bit but still, the noise is very clear. 

The motor I am using is a PK244-01A
And the driver it is connected to is this one

I am not at all sure if the ramping I do is either too steep, or completely  incorrect, but here is the code that controls the motor. 

void stepper_motor::step_pwm()
{

    digitalWrite(en_pin,HIGH);

    delay(0.005);

    digitalWrite(dir_pin,HIGH);
    //LOW  - Move towards the sensor
    //HIGH -  Move away from the sensor

    delay(0.005);
    int increment = 0;
    int step_count = 0;
    while(step_count &lt;= max_step)
    {
      digitalWrite(step_pin,LOW);
      delayMicroseconds(2000);
      digitalWrite(step_pin,HIGH);
      delayMicroseconds(2000-increment);
      step_count++;

      if(step_count &gt;= 1)
      {
        increment++;
        step_count = 0;
      }
    }

}


Anything I could do to make the noise of the motor less significant?
I had a similar issue once before. It actually matters a lot to properly ramp up your stepper motor. Especially under load if you ramp up too steep you can loose steps.

Since you are already using the arduino environment I suggest you could use the AccelStepper library.

I lets you set the acceleration and max. speed parameters nicely and uses a properly calculated ramp.