DRV8833 Operation Issue

hi
I’m using two ESP32-C3 one in the hand piece which a a three way joy stick and the other one as a receiver which controls a model crane through PWM.
The crane unit has a DRV8833 Dual H bridge and it controls the Slew and the Jib motors. There is a second DRV8838 Single H bridge controls the Winch.
The major processing is done in the hand piece and the commands are sent to the crane.
My problem is that the commands sent to the H bridges are monitered and are correct however the Winch works perfectly but the DRV8833 only sends the motor drive corectly in one direction.
The fault is the correct side sends a + 0-7Volt but when reversed it sends a - 7-0volt rather then a - 0-7volt.
The command software is the same for all three motors but the Winch works perfectly. I have wired the H bridges correctly.
Question has anybody else had issues with DRV8833 dual H bridges?

Alan

This is a little confusing. What exactly do you mean by the voltage levels ?? positive / negative
The levels you have stated look correct to me.

The DRV8833 chip simply swaps which AOUT or BOUT pin has VM the other having GND. This determines the direction of the motor. If the motor turns one way and not the other it is possible one of the mosfets inside the chip has become damaged . (see below) Does the same thing happen for both AOUT & BOUT ??

The AISEN & BISEN pins are used to limit current. The default connection is to GND; to use current limiting you need to cut tracks on the board and install resistors. (see the CE web page documentation)

If I remember right I managed to kill a motor driver chip by excessive current. I don’t think it was this one. It should have shutdown but it did not, I put it down to excessive current.

Regards
Jim

1 Like

Hi Jim,

The senairio is xIN1 HIGH and xIN2 0-255 PWM give positive 0-7v out. When xIN1 LOW and xIN2 255 PWM gives negative as it should but 7-0 volts out instead of 0-7volts. The ramp should stays the same and the voltage reversed but the voltage reverses (as it should) but the ramp is wrong and starts at 7volts and decreases as the ramp goes from 0 to 255.

Hope this makes it clearer.

Thanks Alan

2 Likes

That sounds like the MCU is inverting the PWM signal at some stage in the processing.

If the commands that are sent to the H-bridge are correct then in reverse mode you would be seeing high voltage when the PWM duty cycle is low, and low voltage when the duty cycle is high, and that doesn’t seem likely. What exactly are you measuring at the DRV8833 inputs and outputs when the controller is at (for example) low speed reverse?

2 Likes

Hi Alan,

Thanks for explaining. Makes sense now.
I think @Jeff105671 is on the money sounds like the PWM is inverted.
Cheers
Jim

2 Likes

Hi Jeff,

Thanks for you reply but I have fixed the ramp issue (typo) surprising when you walk away and come back with a clear mind.

However there still appears to be a problem. When the joystick returns to neutral and the xIN1 sits HIGH I get full voltage output, if I jiggle the joystick so xIN1 sits LOW the voltage drop to the correct neutral position voltage of 0V.

Monetoring but xVal1 and xVal2 shows

Attached is the script:

const byte xdeadBand = 40; // adjust for desired Winch deadband
const int xneutral = 525; // ADC reading with Winch stick in neutral position
delay(2);
if (xVal < (xneutral - xdeadBand)) { // Jib motor speed control - xIN2
xVal2 = 0;
xVal1 = map(xVal, 0, 511, 0, 255);
} else if (xVal > (xneutral + xdeadBand)) {
xVal1 = 0;
xVal2 = map(xVal, 513, 1023, 0, 255);
} else xVal1 = xVal2 = 0;

if (xVal1 > 0) { // bridge reversal - xIN1
motorx = 1;
} else if (xVal2 > 0) {
motorx = 0;
}
1 Like

Thanks Jeff,

Yes it was I just had to walk away for some time however there is still a problem.

When the joystick returns to neutral and the xIN1 sits HIGH I get full voltage output, if I jiggle the joystick so xIN1 sits LOW the voltage drop to the correct neutral position voltage of 0V.

Monitoring but xVal1 and xVal2 shows 0

Attached is the script:

const byte xdeadBand = 40; // adjust for desired Winch deadband
const int xneutral = 525; // ADC reading with Winch stick in neutral position
delay(2);
if (xVal < (xneutral - xdeadBand)) { // Jib motor speed control - xIN2
xVal2 = 0;
xVal1 = map(xVal, 0, 511, 0, 255);
} else if (xVal > (xneutral + xdeadBand)) {
xVal1 = 0;
xVal2 = map(xVal, 513, 1023, 0, 255);
} else xVal1 = xVal2 = 0;

if (xVal1 > 0) { // bridge reversal - xIN1
motorx = 1;
} else if (xVal2 > 0) {
motorx = 0;
}
1 Like

According to your code, this can never happen (else xVal1 = xVal2 = 0;), unless xVal1 and xVal2 somehow aren’t getting written to the correct GPIO. Or, are you including code for the case of (0,0) that disables PWM for both ports? You might be making an assumption about the state of a GPIO port when PWM is set to 0. I know that some MCUs require special handling for PWM of 0.

I would also recommend monitoring the values you are getting from the joystick, before and after mapping.

(PS: mark your code as preformatted - it makes reading it much easier).
1 Like

Hi Jeff,

Thanks for your thoughts, I did include the motor direction in the offending output so ((else xVal1 = xVal2 = 0;) became ((else xVal1 = xVal2 = motorx1=0;). The other curved ball was that the PWM in one direction was standard but when the other direction was chosen it became inverted so 255=0Volts and 0= 7volts. these things are sent to try us. It’s all sorted now. Thanks again.

1 Like

Check the DRV8833 datasheet. Make sure your wiring matches IN/IN or PHASE/ENABLE mode consistently. Check power supply. DRV8833’s H-bridge can’t source negative voltage; the “negative” voltage is just a sign flip due to the pin configuration. Make sure the motor is connected correctly (check polarity and H-bridge outputs). Here is a similar example featuring ESP8266 and DRV8848 Motor Driver.

1 Like

Hi ahsrab,

The DRV8833 has the xIN1 used as digital input from a ESP32-C3 to set the polarity of the output while the xIN2 is feed a PWM signal from the same ESP32-C3. The supply voltage is 7 Volts applied to to Vin (pin 15). The digital voltmeter is across the output to measure the output volt compared to the PWM signal. This voltmeter will show a reversal of polarity when xIN1 changes. There is no negative voltage being applied to the DRV8833, sorry if there was a misunderstanding.

1 Like