Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Driver ignores direction

After my first DRV8825 was dead (getting hot just when connecting motor power) the second one now ignores the direction. What the… sigh

I’ve used the the exact setup from here. My impression was the the state of DIR selects the direction. That’s why I wrote this code:

void setup()
{
  pinMode(LED, OUTPUT);
  pinMode(DIR_PIN, OUTPUT);
  pinMode(STEP_PIN, OUTPUT);
}

void loop()
{

  digitalWrite(LED, HIGH);
  digitalWrite(DIR_PIN, HIGH);

  for(int i=0;i<STEPS;i++) {
    digitalWrite(STEP_PIN, HIGH);
    delayMicroseconds(1000);
    digitalWrite(STEP_PIN, LOW);
    delayMicroseconds(1000);
  }

  delay(2000);

  digitalWrite(LED, LOW);
  digitalWrite(DIR_PIN, LOW);

  for(int i=0;i<STEPS;i++) {
    digitalWrite(STEP_PIN, HIGH);
    delayMicroseconds(1000);
    digitalWrite(STEP_PIN, LOW);
    delayMicroseconds(1000);
  }

  delay(2000);

To make sure it’s not my code, or connecting the wrong arduino pin is at fault, I even manually connected DIR to GND or +5V. But that still does not clearly define the direction.

By manually giving a short connection of DIR to HIGH/LOW, I sometimes manage to switch the direction - and it then just keeps turning that way.

What is going on?

All worked fine with an A4988. I then compared the wiring of the two.
After setting FAULT to HIGH (basically the same wiring as for the A4988) it worked.

So much for that.

Hi, tcurdt.

I’m glad to hear your driver is working for you now. On our DRV8825 carrier, it should not be necessary to connect anything to the nFAULT pin if you have nRESET and nSLEEP tied high as recommended in our standard minimal wiring diagram (from the product page), which seems to match what your guide suggests:

However, as that product page explains, the board also includes circuitry that allows you to pull nSLEEP and nRESET up by tying them together and connecting a logic voltage to nFAULT instead, which makes it easier to use this board as a drop-in replacement for an A4988:

So if driving nFAULT high got your driver working, it’s possible there was an issue with the nRESET and/or nSLEEP connections in your original setup (although it’s not clear to me why that would have affected the behavior of the DIR pin only). If you are interested in troubleshooting that further, please post some pictures of your setup showing your driver and connections, and we can check if anything looks problematic.

Kevin

Hey Kevin,

I did have RESET and SLEEP directly connected to VDD.
So I am not sure what I could have gotten wrong on that end.

But on the other hand I could no longer reproduce the problem either.
RESET and SLEEP on VDD and not connecting FAULT works too, now.
The only difference I am aware of is that I adjusted the driver current.

Not sure how any of that would affect the DIR though.
Anyway - it might stay a mystery.

Thanks for your answer.