Nema 17 just making sound (Peep) and not moving

Hi,
As title says, Servo is not moving just making sound and heating up. I tried to measure Voltage and Current and everything seems fine. Could there be problem with my wiring? Appriciate and help thank you.
Using: DRV8825, CNC shield v3 and Nema 17 42HS34-0404



Black and Green are Coil 1 and Blue and Red and Coil 2 (I hope so)
And this is my wiring:

Code used:

#define EN 8

#define X_DIR 5
#define Y_DIR 6
#define Z_DIR 7

#define X_STP 2
#define Y_STP 3
#define Z_STP 4

int delayTime=30;
int stps=6400;

void step(boolean dir, byte dirPin, byte stepperPin, int steps)

{

digitalWrite(dirPin, dir);

delay(100);

for (int i = 0; i < steps; i++) {

digitalWrite(stepperPin, HIGH);

delayMicroseconds(delayTime);

digitalWrite(stepperPin, LOW);

delayMicroseconds(delayTime);

}

}

void setup(){

pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);

pinMode(Y_DIR, OUTPUT); pinMode(Y_STP, OUTPUT);

pinMode(Z_DIR, OUTPUT); pinMode(Z_STP, OUTPUT);

pinMode(EN, OUTPUT);

digitalWrite(EN, LOW);

}

void loop(){

step(true, X_DIR, X_STP, stps); //X, Counterclockwise
step(true, Y_DIR, Y_STP, stps); //Y, Counterclockwise
step(true, Z_DIR, Z_STP, stps); //X, Counterclockwise

delay(100);

}

How many steps per second are you trying to get the motor to move? Start with a very slow step rate - for example 5 steps per second.

What stepper motor power supply are you using (volts and amps)?

Have you correctly set the current limit on the stepper driver?

Post a link to the datasheet for your stepper motor.

To make it easy for people to help you please modify your post and use the code button </>
codeButton.png

so your code looks like this and is easy to copy to a text editor. See How to use the Forum

...R
Stepper Motor Basics
Simple Stepper Code

Start with something like the AccelStepper examples.

You were expecting the motor to jump instantly to some crazily large RPM. It won't. You
have to ramp the step rate up, which is exactly the job the AccelStepper library will do for you
and make things easy.

Try something like max speed = 400, acceleration = 500.

200 microseconds per step, 5000 steps per second with a high impedance motor? Start with something sane like:

delayMicroseconds(2000);

And work your way up.

No, much slower than that. delay(100) will be a good starting point.

Thank you for helping me out, they work fine after all of the advices. Big THANKS !

OOPS, missed a "0", meant 20000, 25 steps per sec. :stuck_out_tongue:

Dear all,
I am contributing to this post with my experiences because I have a strange issue that I cannot solve and I need your help =)

I have the same hardware of the owner of this post (UNO, cnc Shield, NEMA 17, DRV8825) + 12V 2A power supply.
I am trying to run a veeeery simple code:

#define EN 8

#define X_DIR 5
#define Y_DIR 6

#define X_STP 2
#define Y_STP 3

void setup() {

  pinMode(X_DIR, OUTPUT); pinMode(X_STP, OUTPUT);
  pinMode(Y_DIR, OUTPUT); pinMode(Y_STP, OUTPUT);

  pinMode(EN, OUTPUT);
  digitalWrite(EN, LOW);

}

void loop() {


}

basically, for now, I am just holding the motors to their position to carry some load (with EN pin).

the strange thing is that in this condition the motors are making a ticking noise and I am still able to rotare them.... see attached video below!

what am I missing in your opinion?

thanks!!

What happens if you write the EN pin HIGH?

...R