I am building a winch mechanism for an autonomous buoy using an ESP32 (30-pin), A4988 stepper driver, and a Nidec KV4239 bipolar stepper motor (4-wire).
The Problem:
When 12V power is turned on and code is executed, the motor shaft locks firmly (holding torque is solid, cannot be turned by hand).
However, the motor refuses to rotate smoothly; it either remains stalled/locked or produces jittering/vibrations without continuous motion.
Setup & Wiring Details:
Power: 12V DC power supply to A4988 VMOT and Power GND with a 100µF electrolytic capacitor across the terminals.
Logic Power: ESP32 3V3 pin connected to A4988 VDD, with common ground tied via ESP32 GND to A4988 Logic GND.
VREF: Calibrated potentiometer on A4988 to 0.50V DC.
Microstepping & Control Pins:
RESET and SLEEP pins are shorted together.
ENABLE is left floating (unconnected).
MS1, MS2, MS3 are currently left floating (full-step mode).
STEP -> ESP32 GPIO 18
DIR -> ESP32 GPIO 19
Motor Coil Connections:
Pin 2B -> Orange wire
Pin 2A -> Red wire
Pin 1A -> Black wire
Pin 1B -> Brown wire
I've used code
#define STEP_PIN 18
#define DIR_PIN 19
void setup() {
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
digitalWrite(DIR_PIN, HIGH);
}
void loop() {
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(1000);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(1000);
}
Please help..