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