Go Down

Topic: drv8825 not rotating, just vibrating (Read 184 times) previous topic - next topic

ivandewolf1


I was following this tutorial:
https://www.makerguides.com/drv8825-stepper-motor-driver-arduino-tutorial/


I altered the source code to make it step very slowly (note that I am using "delay()" not "delayMilliseconds()")
Code: [Select]

#define dirPin 2
#define stepPin 3
#define stepsPerRevolution 200

void setup() {
  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
}

void loop() {

  digitalWrite(dirPin, HIGH);
  for (int i = 0; i < stepsPerRevolution; i++) {
    digitalWrite(stepPin, HIGH);
    delay(20);
    digitalWrite(stepPin, LOW);
    delay(20);
  }
  delay(1000);

  digitalWrite(dirPin, LOW);
  for (int i = 0; i < stepsPerRevolution; i++) {
    digitalWrite(stepPin, HIGH);
    delay(20);
    digitalWrite(stepPin, LOW);
    delay(20);
  }
  delay(1000);
 }



I have this motor:
https://datasheetspdf.com/datasheet/17HS4401S.html


I am using a 12v 2amp switching "wall wart" power supply


the drv8825 looks identical to the Pololu, but does not have their logo.

I followed the advice in the tutorial and cautiously set the potentiometer so that my voltage meter read a vref of .5 volts, and tried an abcd and a bacd wiring; neither rotated.

I tried fiddling with the potentiometer, that did not make it rotate.

I read many people having similar issues , the main advice that I saw was to switch around which of the 4 stepper wires go to which of the 4 pins on the driver. Therefore, I tried all 7 possible combinations:
abcd
bacd
cbad
dbca
acbd
adcb
abdc

none resulted in a rotating motor. I tried swapping my drv8825 for another one (I bought a pack of 5) and got the same result. I tried switching my stepper motor for another from the box, and again, same result.

so, I have adjusted-
* the connections to the motor
* the settings on the potentiometer
* the number of steps per second (now very very slow)
* swapping parts

I have not tried other power supplies. perhaps this is the issue? is 12v 1a wrong? is a switching supply a bad idea?

is there perhaps something else wrong, that I have not tried?
is it possible the circuit in the tutorial needs modification?
anybody have any advice on what I might try?



groundFungus

#2
Feb 17, 2020, 02:38 am Last Edit: Feb 17, 2020, 02:40 am by groundFungus
On the top power rail is the red + rail really ground and the blue - rail Vcc?  The bottom rail (motor power) is red + blue -.   Reset and sleep should go to + and the ground pin to -.

ivandewolf1

the top rail is reversed; I followed the circuit diagram in the makerguides tutorial pretty closely, and he had them swapped there. so, on the top rail, the one marked + is actually attached to ground on my arduino, and the one marked - is attached to vcc.

groundFungus

That just seems to be a recipe for disaster, but it's your circuit.

I have wired up a DRV8825 stepper driver to my Uno and a stepper.  I loaded your code to the Uno and get the motion from the motor that i would expect from reading the code.

At any time during your troubleshooting did you disconnect the motor from the driver with the driver powered up?  That will instantly kill the driver.

groundFungus

I think that I see a problem.  The motor connector needs to move one space to the right (towards the electrolytic cap).  As it is the black motor wire is plugged into the fault output.  See the drawing on the Pololu page.

ivandewolf1

yikes! yes, I did disconnect while powered up, um... oops....

So, to test if this was the issue, I just opened up a brand new DRV8825 and dropped it in, same result. it just vibrates....
I powered it all off, and swapped one pair of connections, and still, it just vibrates...

groundFungus

A couple of tutorials to help your understanding of steppers and drivers.

Stepper basics.
Simple stepper test code.

groundFungus

#8
Feb 17, 2020, 03:16 am Last Edit: Feb 17, 2020, 03:17 am by groundFungus
Did you read reply#5?  Move the 4 motor coil wires over 1 breadboard column to the right.  Look carefully at the Pololu diagram on the page that I linked and compare that to your wiring.

ivandewolf1

DING DING DING DING DING!!! We have a winner! GroundFungus, good eye! I had the motor attached to the wrong pins! pebkac, I was an inattentive nitwit, thank you so much! woohoo!

SOLVED!

groundFungus


Go Up