default stepper library cannot go beyond 300 RPM ?

Hi All

I am trying to build a linear actuator/slide and powering it up via a Nema 23 stepper motor with the help of pololu DRV8825 high current stepper motor driver which takes two inputs from the Arduino, STEP & DIRECTION. There are two limit switches at both ends of the linear slide. I want the moving block on the actuator/slide to slide left and right until it hits the limit switch .

The problem is when I use default stepper library of arduino it does not drive the stepper beyond 300RPM. At 301 RPM the stepper motor just does not rotate and give a continuous beep sound. Any information how can I increase the speed of my stepper motor upto 1000RPM. Its a very smiple setup but I am stuck at 300RPM which is too slow for me.

Any ways I can get around this problem. Thanks :slight_smile:

I don't know if that's an issue with the library or the stepper motor and load... Is there a load on the motor? Are you accelerating to ~300 RPM, or are you trying to jump instantly to 300?

If there is no load, the [u]Torque-Speed[/u] goes to 40 RPS (which should be 2400 RPM) but at that speed you've lost 90% of the torque.

You might be able to modify the library but at some point you do risk "missing steps" if you try to accelerate too fast or if there is too much load on the motor.

Some general guidelines when using stepper motors.

  • Use a current controlled microstep driver (you got one of these, but what microstepping mode are you using? i recommend 1/8 or 1/16)
  • Use a as high as possible supply voltage for the driver. The higher the voltage the higher rpm you will get. For you driver that would be 45V. Also use a unregulated supply with large reservoir caps. A transformer with 30V secondary will give you the right voltage after rectification
  • AccelStepper is a better solution than stepper if you want some perfomance out of your stepper

@DVDDoug

I tired with aceleration too but the stepper just does not move beyond 300RPM. It works fine at 300RPM but it just does not go beyond that value. And it is running without any load.

I tried with acceleration and without acceleration but the results are the same.

@niltron61

Currently I am using Full step mode. I will try it with 1/8 or 1/16 mode to see if it resolves the RPM problem.

I actually tried the accelstepper library and the stepper was able to go upto 1500 rpm. I used the simple constant speed code.

#include <AccelStepper.h>

AccelStepper stepper(1,2,3);     //2: step pin and 3: direction pin

void setup()
{  
   stepper.setMaxSpeed(1000);
   stepper.setSpeed(300 );	
}

void loop()
{  
   stepper.runSpeed();
}

I liked the way stepper motor worked with accelstepper library . Very smooth and silent. But in this code I cannot control the direction the motor rotates. It just rotates to predefined direction. runSpeed() funtions does not take any arguments which I could use to set the direction. For example runSpeed (-1) for counterclockwise and runSpeed(1) for clockwise or vice versa. Something like that.

As you have a DRV8825 you can easily make the stepper work without using the stepper library. This small piece of code will cause a single step. Repeat as necessary - you can try most any speed you like by varying the interval between steps.

digitalWrite(stepPin, HIGH);
digitalWrite(stepPin, LOW);

You haven't said what voltage you are powering the motor with?
You haven't said what current your motor requires?
Can your power supply provide enough current?
How have you set the current limit for the DRV8825?

...R