Hi,
I'm trying t o connect my ESP32 to this stepper motor(17HS19-2004S1): https://www.amazon.pl/STEPPERONLINE-kro ... B00PNEQKC0
using a driver (drv8825): https://www.amazon.pl/dp/B07CNJR2Z6?ref ... tails&th=1
I'm following this instruction: https://www.makerguides.com/a4988-stepp ... -tutorial/
- setting up Vref to 1V
- Green and Black go to 1A 1B
- Red and Blue go to 2A, 2B- Dir goes to GPIO12
- STP goes to GPIO14
- Logic is powered by esp32 5v
- Motor is powered by 12V DC
- I don't have capacitor
When I power everything driver are getting hot, and motor is "jumping". It doesn't want to do one full rotation. It's going two-three step forward and then one-two step back.
I was even trying to connect in different configuration wires from motor to the drive and result is similar.
Could you advise? I guess "jumping" motor is a quite common problem. I don't understand what could be wrong.
Thanks!
Esp32 + stepper motor
Re: Esp32 + stepper motor
Can you post your code?
-
- Posts: 4
- Joined: Fri Apr 07, 2023 10:46 pm
Re: Esp32 + stepper motor
Code is 1:1 as in the example https://www.makerguides.com/a4988-stepp ... -tutorial/
I have tried both - vanilla and accustepper solution
Thanks!
I have tried both - vanilla and accustepper solution
Thanks!
Re: Esp32 + stepper motor
No, "jumping" motor is not a common problem
post your code AND wiring diagram
post your code AND wiring diagram
-
- Posts: 4
- Joined: Fri Apr 07, 2023 10:46 pm
Re: Esp32 + stepper motor
That is the code:
Code: Select all
#include "AccelStepper.h"
// Define stepper motor connections and motor interface type.
// Motor interface type must be set to 1 when using a driver
#define dirPin 12
#define stepPin 14
#define motorInterfaceType 1
// Create a new instance of the AccelStepper class:
AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
// Set the maximum speed in steps per second:
stepper.setMaxSpeed(1000);
}
void loop() {
// Set the speed in steps per second:
stepper.setSpeed(400);
// Step the motor with a constant speed as set by setSpeed():
stepper.runSpeed();
}
Dir and step go to gpio 12,14.
I was trying manipulate vtef, using weaker stepper motor (0,4A) but without success.
Thanks
Re: Esp32 + stepper motor
Wiring looks ok, assuming you correctly identified the beginning of each motor winding. However i wouldnt let DRV8825 inputs unconnected, even they are internally pulled down.
I cannot say how accelstepper library works, but arduino loop() function it loops forever.
Hence setSpeed() and runSpeed() are executed on each loop pass. It might be they do some state reset of DRV8825.
I would move at least setSpeed() in the setup() section.
I cannot say how accelstepper library works, but arduino loop() function it loops forever.
Hence setSpeed() and runSpeed() are executed on each loop pass. It might be they do some state reset of DRV8825.
I would move at least setSpeed() in the setup() section.
Who is online
Users browsing this forum: No registered users and 116 guests