1
\$\begingroup\$

my problem is the following: I am using two DRV8842 H-bridge ICs to control 2 different brushed DC motors, my intention is to use a PI controller for the current loop. The schematic looks like this: Schematic Motor Driver and low side current sensing

and the pcb layout: Motor Driver Board

For the current sensing i am using the INA301 chip from texas instrument for low side sensing and a shunt resistor of 30 mOhm. To measure the current i use an ADC interrupt at the middle of the PWM pulse in order to take a measurement each time the transistors are closed. I noticed that for low duty cycle my current readings were higher than those when i increased the duty cycle (PWM frequency 20 KHz). When i checked the voltage signal in the resistor and after the INA301, i noticed there were oscillations in the signal as shown in the picture: Current Signal for 10% duty cycle

The blue signal is measured directly at the shunt resistor terminals. And the input signal to the ADC looks like this for the case of 10% and 50% duty cycle:

Current PWM with 10% duty cycle Current PWM with 50% duty cycle

The blue signals are the resistor voltage amplified by the INA301 and low pass filtered with a RC filter with cutoff frequency of ~1.3 MHz. As i am sampling at the middle of the pulse, for low duty cycles i read this peak value and not the steady state value. For a brushed DC motor i would have expected a current signal with a sawtooth like form, what could be causing this oscillations? Maybe my pcb layout is bad and has parasitic inductance and capacitance or is it due to the PWM modulation and i need to use some snubber circuit? Any ideas on what could be wrong or how to solve it will be appreciated. Thank you all in advance!

Regards, Emmanuel

\$\endgroup\$
  • \$\begingroup\$ Brushed DC motors are extremely noisy and draw large amounts of current in short bursts. You will likely need a lower cutoff frequency on your filter. Also, if it doesn't already have them, make sure you add three capacitors directly to the motor (between the terminals and between each terminal and the shell). \$\endgroup\$ – Caleb Reister May 18 '18 at 16:09
  • 1
    \$\begingroup\$ To me like this looks like something couples capacitively to the current sensing signal path. It only happens after a slight delay relative to the yellow trace (the logic level PWM input), because the driver has a propagation delay. Try replacing the motors with a non-inductive dummy load (resistor), do you still see those spikes? I bet you do. \$\endgroup\$ – jms May 18 '18 at 16:12
0
\$\begingroup\$

A wild stab in the dark - your oscilloscope probe does not use one of these: -

enter image description here

Switch mode power supplies are notorious at generating pulsing magnetic fields that can easily be picked up if you only used this: -

enter image description here

It's easily proven - connect earth croc clip to target board earth and connect probe tip to exactly the same spot - what do you see?

\$\endgroup\$
  • \$\begingroup\$ I agree regarding the ringing in the first waveform, but in the others the spike is on the order of 5us long. Isn't that effect a bit long to be caused by bad probing / impedance mismatches? \$\endgroup\$ – jms May 18 '18 at 16:43
0
\$\begingroup\$

I might have missed something, but I don't see any freewheeling diodes in the design. I think what you're seeing is a voltage spike from the inductive effect (L*di/dt) of the DC motor coils.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.