Hi, as per your advice, I purchased a DRV8825 driver and connected it to a motor with a 220 UF capacitor in full-step - mode, When I operate the motor by toggling the STEP pin on and off, it works properly. However, when using library functions such as AccelerateStepper, even for the simplest commands, it simply vibrates and does not rotate. I'm attaching a video of the motor's response to the following code
#include <AccelStepper.h>
#define pul1 2
#define dir1 3
AccelStepper stepper1(1,pul1,dir1);
void setup() {
// Set the speed of the motor
stepper1.setMaxSpeed(200); // Adjust this value as needed
stepper1.setAcceleration(100);
}
void loop() {
stepper1.runToNewPosition(0);
stepper1.runToNewPosition(200);
stepper1.runToNewPosition(100);
}
Please show the sketch that works with exactly the same wiring.
The wiring in your picture doesn't fit to your sketch. We need a schematic how exactly YOUR project is wired.
Yes, although looking at your diagram, it might be done implicitly through the two GND connections to the motor driver. I would do it externally, regardless.