Speeding up NEMAs?

Hi - so I know this is probably a frequent question, but I want to present my specific scenario because I’m not sure if one of the parts I’m using is limiting me or what.

The issue is that I’m driving a NEMA motor and it’s maxing out very early (100rpm or something silly). I raise the maxSpeed ceiling (AccelStepper) but the motor just doesn’t go any higher. I’m hoping someone here can point to something (or multiple things) that’d bring my speed up closer to 1000rpm. I know that’s the higher side of a NEMA motor’s capabilities, but I don’t seem to be coming anywhere near that right now.

These are the items I am using (amazon product pages):

I have the TB6600s set at 4x microstep (I had it on full before, no difference in speed) and the current at 2.0a (2.2a peak) to match the motors.

I saw someone suggesting that the 12v supply should be bumped up to 24v, which can be done, but I’m just hoping I can get a thorough look from someone more experienced before I start buying new parts.

This is the code I’m using to test things, standard AccelStepper loop:

#include <AccelStepper.h>

// 2 = PUL, 3 = DIR, 4 = ENA
AccelStepper stepper(AccelStepper::DRIVER, 2, 3);


void setup()
{  
  
  stepper.setMinPulseWidth(20);
  stepper.setMaxSpeed(8000); //the motor's top speed is around here somewhere
  stepper.setAcceleration(5000);
  // stepper.setSpeed(22000); // this is me trying to figure out the AccelStep commands...this didn't help
  stepper.moveTo(16000);
  stepper.setEnablePin(4);
  stepper.setPinsInverted(false,false,true);
  stepper.enableOutputs();
}

void loop()
{
    // If at the end of travel go to the other end
    if (stepper.distanceToGo() == 0){
      stepper.moveTo( -stepper.currentPosition() );
    }
    
    stepper.run();
}

Any insight here would be greatly appreciated. I’m sorry if it’s a frequent question, but I really would like to have some guidance in respect to my specific parts and code :}

Thank you

For highest step rate, use power supply voltage a few percent under the highest voltage that the stepper driver allows.

jremington:
For highest step rate, use power supply voltage a few percent under the highest voltage that the stepper driver allows.

Apparently it’s 5v - 24v. I should just get a 24v power supply then I’m assuming?

edit: woops that’s the stepper motor voltage. I think the driver allows 42v - is that still OK to up the power supply to 36v or so even though the stepper motor itself only takes 24v?

Voltage ratings for stepper motors, if given, can usually be ignored. The current rating is important, and that is absolute maximum steady state, per coil.

If the driver takes 42V, I would use a 36V power supply, to avoid problems with inductive spikes in power leads. The average current drawn from the power supply is not the average coil current, and the average current drawn from the supply will go down as the power supply goes up.

Hint: "NEMA" is simply an abbreviation for the National Electrical Manufacturers Association, a collection of industry representatives who agree upon and set certain standards, among other things. NEMA 17, applied to a step motor, defines the mounting plate size and hole location; nothing more.

Use of the abbreviation NEMA does not suggest "stepping motor" to anyone but a few uninformed hobbyists.

Are you using full steps or microsteps on the stepper driver. If you are using a high level of microstepping the AccelStepper library may not be able to produce pulses fast enough.

You might like to experiment with this Simple Stepper Code and this Simple acceleration code.

...R
Stepper Motor Basics

NEMA17 is a 1.7 inch motor flange size description, nothing to do with the kind of motor.

Stepper motors are commonly available in NEMA11/17/23/34 sizes. Some steppers are
not in NEMA sizes, and industrial induction motors are commonly in NEMA sizes. "NEMA motor"
thus doesn't tell you anything useful.

In fact despite NEMA being a US thing, most stepper motors are actually sized metrically, very close to
the "true" NEMA sizes, and are thus not NEMA at all!

OK great thank you everyone - I just ordered a 36v power supply so hopefully that'll do the trick. I'm generally pretty good at reading and figuring things out, but when it comes to power/current ratings and knowing what's suitable, I just have no basic understanding to draw from.

This Calculator will help you select a power supply and stepper motor to reach the speed and torque specification you require.

You might also like to consider other options including

  • fast io - quicker than the standard digitalWrite (I haven't tried using this myself) - digitalwritefast is one example
  • review pulse width - I have seen an example with I think 1 uS
  • minimise/eliminate any delay()
  • there should be a considerable difference in speed with full steps / half steps etc. Experiment in these places
  • there may be difference in the stepper driver abilities - just something to think about

Good luck

RBat:
You might also like to consider other options including

  • fast io - quicker than the standard digitalWrite (I haven't tried using this myself) - digitalwritefast is one example
  • review pulse width - I have seen an example with I think 1 uS
  • minimise/eliminate any delay()
  • there should be a considerable difference in speed with full steps / half steps etc. Experiment in these places
  • there may be difference in the stepper driver abilities - just something to think about

Good luck

I have my pulse width at 20 now (and I'm using the AccelStepper library), and things are working out much better, but I find as my code gets more complex and I have more calculations / arrays to calculate and store movements, the whole things slows down some more. I'm running on a standard Mega 328 (R3 arduino) and I believe that the processing speed is just too slow for what I'm wanting it to do.

Either that or I'm not smart enough to make the code more efficient and pull some weight off the looping segments. Technically all the math gets done before the loop, but it still has to cycle through multiple 20-space long arrays, so perhaps it's a memory issue?

Either way, I ordered an ESP32 to see if that can help. I plugged the thing into an ESP8266 yesterday and the motors seemed to jump up to speed much quicker, so I'm sure I'll be making an improvement (the 8266 pinout made 2 motors impossible unfortunately).


Anyway, thank you for all the help - I'll be coming back to this thread to improve things if the new 36v power supply and ESP32 can't solve all my problems.