Accelstepper on NEMA 17 with CNC shield v3 and drv8825 driver

Hello Forum,

I can’t seem to figure out how to define my stepper motor(NEMA 17 1.33kg.cm 0.9deg per step) in the Accelstepper library. I do not fully understand why I cannot use this simple code to make my stepper run:

#include <AccelStepper.h>

AccelStepper Xaxis(1, 2, 5); // pin 2 = step, pin 5 = direction

void setup() {
  Xaxis.setMaxSpeed(12800);
  
  Xaxis.setSpeed(10000);
  
}

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

I am using the CNC shield v3 with a 1/32 microstep. That means 12800 microsteps per revolution.
Also I am using the drv8825 driver.
Everything works fine with my other codes but I want to use the acceleration of the Accelstepper library.
I feel like I am doing something wrong with the definition in this line AccelStepper Xaxis(1, 2, 5); but I am not sure what.
My code uploads without problems but I do not get any response from my stepper motor.

I hope I have explained my problem sufficiently.

On the CNC shield the enable pin [pin 8] is pulled high so that the motors drivers are disabled by default.
Like this to add the enable pin and enable the motors:

#include <AccelStepper.h>

AccelStepper Xaxis(1, 2, 5); // pin 2 = step, pin 5 = direction

const byte enablePin = 8;

void setup()
{
   pinMode(enablePin, OUTPUT);
   digitalWrite(enablePin, LOW);

   Xaxis.setMaxSpeed(12800);
   Xaxis.setSpeed(1000); // had to slow for my motor
}

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

AccelStepper has a speed limit.

The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno etc

From the AccelStepper reference.

Dear Tesla Member,

Thank you for your response. I should have thought of the enablePin. I just did not really know how and were to write it. I have my motor working now so now I can start testing acceleration. Again thanks a lot!

groundFungus:
The fastest motor speed that can be reliably supported is about 4000 steps per second at a clock frequency of 16 MHz on Arduino such as Uno etc[/url].

Does that mean that microstepping rather is slow for Accelstepper? At least when you have a 12800 micro steps per revolution configuration?

Does that mean that microstepping rather is slow for Accelstepper?

I don't know how to answer that. Micro stepping a motor will make its maximum speed slower in terms of RPM, but the positioning will be that much finer. A trade off.