Stepper motor jitter when i use sleep pin

Hi,I want build a turner table that it turn quart of circle after a moment with a high precision.
the problem is when i switch the Sleep pin from LOW to HIGH the stepper motor jittering like the video above , i have try it all microstepping mode and i get the same problem .

https://youtu.be/7qR6HTHJddQ

/*Example sketch to control a stepper motor with DRV8825 stepper motor driver  1/8 microStepping AccelStepper library and Arduino
#include <AccelStepper.h>
//Define stepper motor connections
#define dirPin 8
#define stepPin 7
const int sleepPin = 6;
//Create stepper object
AccelStepper stepper(1,stepPin,dirPin); //motor interface type must be set to 1 when using a driver.
void setup()
{
  pinMode(sleepPin,OUTPUT);
  stepper.setMaxSpeed(1000); //maximum steps per second

}
void loop()
{ 

  digitalWrite(sleepPin,HIGH);
  stepper.setCurrentPosition(0); //set the current position to 0
  while(stepper.currentPosition() != 400)
  {
    stepper.setSpeed(250);
    stepper.runSpeed();
  }
  digitalWrite(sleepPin,LOW);
  delay(1000);
}

Hello.

Can you post pictures that clearly show your current setup and connections? Can you try adding at least a 2 ms delay after you wake up that driver? Does your motor run normally when you do not put the driver to sleep?

-Tony

I have changed the code , i decide to use the enable pin instead of sleep pin , but the motor jitter only one time is when i set the sleep pin to LOW for the first time , after , the motor work perfectly .
But sometimes the motor not jitter even though i restart the power !

/*Example sketch to control a stepper motor with DRV8825 stepper motor driver AccelStepper library and Arduino. More info: https://www.makerguides.com */
#include <AccelStepper.h>

//Define stepper motor connections
#define dirPin 8
#define stepPin 7
const int sleepPin = 6;
const int enablePin = 4;

//Create stepper object
AccelStepper stepper(1,stepPin,dirPin); //motor interface type must be set to 1 when using a driver.
void setup()
{
  Serial.begin(9600);
  pinMode(enablePin,OUTPUT);
  pinMode(sleepPin,OUTPUT);
  digitalWrite(enablePin,HIGH);
  Serial.println("En was set to  HIGH");
  delay(100);
  digitalWrite(sleepPin,HIGH);
  Serial.println("Slp was set to high");
  delay(100);
  digitalWrite(enablePin,LOW);   // The motore jetter here !!!!!
  Serial.println("EN was set to low");
  delay(100);
  stepper.setMaxSpeed(1000); //maximum steps per second
}

void loop(){ 
    Serial.println("Turn");
   digitalWrite(enablePin,LOW);
  delay(5);
  stepper.setCurrentPosition(0); //set the current position to 0
  while(stepper.currentPosition() != 400)
  {
    stepper.setSpeed(100);
    stepper.runSpeed();
  }
    delay(1000); //Wait until the motor stop
   digitalWrite(enablePin,HIGH);
   delay(2000);
}

Hello,

Can you try tying the SLP and RESET pin on that board to the 5V output of your Arduino? Can you clarify whether you think it is the SLP or the EN pin is causing the jitter? The comment in your code implies it is the EN pin but you mention it jitters after you set the SLP pin in your post. Does your jitter look the same as it did in the video you posted before? If not can you post an updated video?

Separate from your jitter issue, I recommend adding a 100uF capacitor over VM and GND to help protect the driver from any destructive LC voltage spikes. You can read more about LC voltage spikes on the “Understanding Destructive LC Voltage Spikes” support page.

-Tony

I connected the SLP and RST pin to the 5V but when I enable the board using the EN pin, the motor jitter, also when I only connect RST pin to 5v and I set the SLP pin to HIGH, the motor jitter. So the problem appears when to internal board of the board is energized.
I have already connected the 100uF to the circuit, it’s not showing in the picture because it’s below the board.

Unfortunately, it is not really obvious why you are seeing that behavior.

Also, I took a closer look at your connections and noticed that the stepper motor driver you are using is not one that we make. In general, if you want help troubleshooting devices like these, we recommend contacting the manufacturer of the device you are having trouble with.

-Tony