DRV8835 Strange Problem with DC Motors Direction!

Hey all,

I have 2 DC Motors connected to DVR8835.

I am using PHASE/ENABLE Mode, so MODE pin is HIGH.

The motors will always run at common speed, so the port from arduino that produces the PWM is common to both Aenable and Benable.

The phase (direction) of motors is controlled from Aphase pins and Bphase pins from arduino.

PWM seems to be working good. I have tried different output compare values (that alter pwm speed etc) and the speed changes accordingly.

However here is the strange fact:

Say for example I want to run my vehicle forwards at a certain speed with this pseudocode:

aphase_pin = 1
bphase_pin = 1
PWM = X //connected to Aenable and Benable

The vehicle at this point will continue to move accordingly, however if I want to change it’s direction
aphase_pin=0
bphase_pin=0

Then only one motor will obey.

The strange fact is that if I run FROM THE BEGINNING this:

aphase_pin =0
bphase_pin =0
PWM = x

The motors will behave good but then again if I want to change the direction
aphase_pin =1
bphase_pin =1

They won’t behave accordingly.

So to sum up, If I “initialize” the phase pins at a certain direction, then the motors will obey and will move to that particular direction, however if I want to change the direction then they won’t obey!

Any thoughts?

Hello.

I am sorry you are having trouble controlling that motor driver. Can you tell me more about your system? What motors are you using? How are you supplying power? Which Arduino are you using to control the driver? You mentioned that only a single motor will change direction when commanded; can you try swapping the motors to see if the issue follows the motor? Can you measure the voltage on the motor outputs without the motors attached before and after switching direction to see if they are actually switching? Additionally, can you post pictures of your connections or a video that shows the behavior?

-Jon