DRV8833 - Problems driving 2 DC motors

Hey guys! I’m kind of new in eletronics (and my english is not very good) and i need help with motor drivers.

I bought the DRV8833 to drive (with an Arduino) a Tamyia tank using this motors/gears kit: pololu.com/catalog/product/114

But I can’t make it work right, here is the problem:

When I drive any motor forward (Pin A = HIGH, Pin B = LOW), it goes full speed forward.
But if I drive both motors forward at the same time, I hear a noise (stall?) and the motors don’t spin.

If I wait some time (like 10-15s), or if “help” the motors spin with my hand, they start spinning, very slowly, then gradually acellerate to full speed.

The possible reasons I thought where:

  1. The wiring of the circuit is wrong.
    But everything work’s right if you drive one motor at a time, so the wiring must be right.

  2. The code is wrong.
    Not likely, is just MOTOR_A_PIN1 = HIGH, MOTOR_A_PIN2 = LOW, and the same for motor B, right? Anyway, the same code works if I drive one at a time.

  3. The batteries can’t deliver enough power to both motors.
    But if I plug the motors directly in the batteries, they spin at full speed.

  4. The gear is too heavy, and the motors can’t spin.
    The motors are “alone”, no gears, they are “free” on my table (it is called no-load right?).

  5. My DRV8833 is faulty.
    I bought 2, and they both behave the same way.

Do you have any clue what am I doing wrong?

Hello,

Have you made sure you’re connecting one motor between AOUT1 and AOUT2 and the other motor between BOUT1 and BOUT2, and that you’re setting the states of the inputs accordingly? I noticed some inconsistency in what you wrote (you have “Pin A = HIGH, Pin B = LOW” when it should be “Pin 1 = HIGH, Pin 2 = LOW”). If you did actually set both of the A inputs high and both of the B inputs low while having the motors connected correctly, neither of the motors would move (motor A would be braking and motor B would be coasting).

If that isn’t the problem, could you tell us more about your setup and post a picture that clearly shows all your connections? What kind of batteries are you using?

- Kevin

Here it is!

On the first picture are the motors:

On this second, the motors wired directly to the battery (2 AA batteries):

You can see on this video how the motors spins very fast at the same time:

This is the wiring with the DRV8833:

And the complete set:

This is the code that I uploaded to my Arduino:

int MA1 = 11; // motor a pin 1
int MA2 = 10; // motor a pin 2
int MB1 = 6; // motor b pin 1
int MB2 = 5; // motor b pin 2

void setup() {
  pinMode(MA1, OUTPUT); 
  pinMode(MA2, OUTPUT);
  pinMode(MB1, OUTPUT);
  pinMode(MB2, OUTPUT);
  
}

void loop() {
  doForward(MA1, MA2); // motor A forward
  delay(3000);
  doStop(MA1, MA2);
  delay(2000);
  
  doForward(MB1, MB2); // motor B forward
  delay(3000);
  doStop(MB1, MB2);
  delay(2000);
  
  doForward(MA1, MA2); // both forward
  doForward(MB1, MB2);
  delay(10000);
  doStop(MA1, MA2);
  doStop(MB1, MB2);
  delay(1000);
}

void doForward(int pin1, int pin2) {
  digitalWrite(pin2, LOW);
  digitalWrite(pin1, HIGH);  
}

void doStop(int pin1, int pin2) {
  digitalWrite(pin2, LOW);
  digitalWrite(pin1, LOW);  
}

An this is the video i recorded. You can notice that they spin very fast when is just A or B, but when both motors run together, you hear a noise, and they stall.
When I “help” them, they spin, but very slowly:

Noticed anything I’m doing wrong?

What is the battery voltage? If it drops below about 2.7 V, the driver won’t work correctly.

I measured the voltage, and the VIN have stable 3V.

I was thinking that probably there is some internal resistance that activates when i drive both motors, and reduce the voltage below 2,7V, and then the driver won’t work right.

So I bought two 6v motors, and I changed the batteries to 4 AA, giving me the 6v, and now the same code, same wiring, but with 6v motors/batteries is working as expected.

Probably the same internal resistance drops the input voltage, but for a value closer to 6v, not making the driver behave odd.

I’m glad to hear you have it working better now. If you still want to use your original motors (which I’m guessing are rated for 3 V) with a higher voltage, you can just run them with a lower maximum duty cycle; for example, 6 V at a 50% duty cycle should be fine.

- Kevin

Hi trevisani,

I know you’ve fixed your problem but just for the sake of anyone who might encounter this same problem, i would like to share my experience, and offer an alternative explanation.

The cause of the problem is very unlikely to be the drop in voltage, but rather, the current. I had used drv8833 in my own shield some time back and experienced the same strange problem. After consulting the DRV8833 datasheet, there is a 1.35ms over current protection time Tocp, meaning, when there is more than 3A for 2.25us, the chip will shut itself down for 1.35ms before retry conducting current.

This means the motor is being turned on and off very fast, which produces a vibration. Thus if you hear a noise around f=1/T=1s /1.35ms = 740Hz, and you see pin nFault being driven low, that means you are facing a over current situation, nothing to do with drop in voltage or internal resistance.

Why does it spin in full speed after a little help? This has something to do with characteristics of a DC motor, the highest current happens when the motor is at stall, aka stopped. But after you start the motor, the current needed to maintain the speed is much lower than when you try to first start it.

Why it is working after you changed to a higher voltage batter and motor set? Motor of the same power who has a higher voltage rating use thinner wires and more windings, thus it takes a lower amount of current to startup. This is also true with the P=VA formula, which P is power, V is voltage, A is the amount of the current. For the same power, when you double the voltage only half of the current is needed.

Regards
Edward