Stepper motor jitter after switching 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 .

/*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);
}

Don's send the stepperdriver to sleep when it's not a full step position.

So how can i reduce power consumption when i use microstepping , because the driver is always powered , all the day ، and the motors turn just for a few time in a day .

Send it to sleep, when the stepper stopps at a position which is a multitide of 8 (as your microstepping setup).

zwieblum:
Send it to sleep, when the stepper stopps at a position which is a multitide of 8 (as your microstepping setup).

I try it but i get the same problem .

Sorry, the videao you posted is not worken (blocked). Try playing with step and dir, there should also be a hint in the stepperdivers datasheet. Also there are known problems with low steprates at high aperage on the 3d stepper drivers.

I have uploaded the video for another time Stepper motor jitter - YouTube

Yes, still looks to me like you stop on a microstep position that is not a full step.

I stop the motor in 400,800,1200 and 1600 steps number (quart of circle)

Have you had a look at the stepper drivers datasheet?

zwieblum:
Have you had a look at the stepper drivers datasheet?

of course Sir