# Increase motor speed x limit

Hi guys,
I have being reading about stepper motors and would like to know:

Can I not set "delay" to increase the speed? Delay is just to control the speed or if I don't set the speed can damage my motor?

I have a code there is a delay of "500ms", I would like to increase the speed, so I think to change to 200ms or less.

Can I do it? What is the limit that I can use delay value?

Motor model is: 17HS8401

Without seeing your code it's hard to say. Try it.

There may come a point as you reduce the delay where the stepper will just buzz and you will know that you made it too small.

Depending on the stepper though, you may not see a problem until you are using microseconds for delays.

Can I do it?

Yes. The beauty of Arduino is that you can very quickly change the program and see what happens.

Which step motor driver are you using? 500 ms is only 1 step per second or 0.3 RPM.

JCA34F:
Which step motor driver are you using? 500 ms is only 1 step per second

When I was going to school it would have been 2 steps per second

I was thinking 500ms HIGH, 500ms LOW = 1 rising edge per second. I went to school in the 1950s, so long ago.

This is a snippet code that I was reading:

``````      while (steps<=targetSteps) {
digitalWrite(stepPin,LOW);
delayMicroseconds(micropasso); //Pausa
digitalWrite(stepPin,HIGH);
delayMicroseconds(micropasso); //Pausa

digitalWrite(stepPin,LOW);
delayMicroseconds(micropasso); //Pausa
digitalWrite(stepPin,HIGH);
delayMicroseconds(micropasso); //Pausa

digitalWrite(stepPin,LOW);
delayMicroseconds(micropasso); //Pausa
digitalWrite(stepPin,HIGH);
delayMicroseconds(micropasso); //Pausa

digitalWrite(stepPin,LOW);
delayMicroseconds(micropasso); //Pausa
digitalWrite(stepPin,HIGH);
delayMicroseconds(micropasso); //Pausa

steps++;
}
``````

I am afraid of decrease delay number and spoil the motor.

So, If I do not use delay, it will use it's max rpm and have no problems? I am right?

Thanks a lot, I will study those libs.

spoil the motor

You can't damage the motor that way. It just won't spin above a certain commanded speed.

JCA34F:
I was thinking 500ms HIGH, 500ms LOW = 1 rising edge per second. I went to school in the 1950s, so long ago.

Most stepper drivers are content with a very short HIGH pulse of about 10µsecs or less which has very little impact on the step timing.

...R

The only way you can damage a stepper is set the stepper driver for more than the motors rated current,
causing it to overheat. There's nothing else to break really (except perhaps the bearings).

I'd strongly advise trying the AccelStepper library for easy control of a stepper, it does the work for you
so long as you call the run() method frequently.