I built a simple motor driver circuit using Texas Instrument's DRV8835 motor driver IC.

The IC is driven in IN/IN mode, (the mode pin is left unconnected, pulled down by the internal resistor). VM is 8-9V, filtered with 10uF + 100nF capacitors. VCC is 3.3V regulated, filtered with 10uF + 100nF capacitors. The inputs are driven with a microcontroller through 10K resistors. The outputs connect to the motor directly without any further components. The 100nF capacitors are mounted close to the IC. PWM is applied by pulling down the IC's input through a pair of diodes using a single PWM line.

DVM / oscilloscope measurements on the inputs showed no anomalies.

I'm using the circuit drive LEGO Power Functions motors with it.

I noticed a strange and annoying problem with the circuit: while the servo motor and the two largest motors (XL and L) work fine, the medium motor doesn't work.

I built several circuits and tried several M motors, all of the combination produced the following behaviour:

I switch one of the bridges continuously on using IN/IN mode, but the motor don't start (it was connected before switching the bridge on). An approximately 1KHz noise is audible. The frequency was later confirmed with measurements with an oscilloscope. The problem can also reproduced by switching the bridge on and connecting the motor later.

It seems that the over current protection of the IC engages, despite the fact that the problem only occurs with the smallest motors.

The oscilloscope showed that the IC is trying to drive the motor once in every 1ms, but it quickly turns off. This looks like OCP is engaging, the 1ms time interval fits the behaviour described in the datasheet.

The following changes "fix" the issue:

  • Connecting a 1 Ohm or 0.5 Ohm resistor series with one of the motor leads (too much EMF, and the de-Q-ing helps?)
  • Driving the motor with 125KHz PWM, asynchronous current recycling (I did not try synchronous modes)

My question is:

How on earth the smallest motor seem to trip the OCP even when the chip is simply turned on?

Thank you all in advance.

  • 1
    \$\begingroup\$ The 1kHz is likely the OCP retry - the spec says it is typically 1ms. Does the motor have a specification or data sheet? \$\endgroup\$
    – Andy aka
    Commented May 20, 2014 at 8:53
  • \$\begingroup\$ Yupp, probably that's the case. I found detailed info on the motors: philohome.com/motors/motorcomp.htm \$\endgroup\$
    – netom
    Commented May 20, 2014 at 9:18
  • \$\begingroup\$ The link doesn't seem to work. \$\endgroup\$
    – Andy aka
    Commented May 20, 2014 at 9:41
  • \$\begingroup\$ Must be some temporary network problem, since it works fine for me, click or copy. \$\endgroup\$
    – netom
    Commented May 20, 2014 at 9:44
  • \$\begingroup\$ This works philohome.com/motors/motorcomp.htm I think but which motor is it? I forced the http bit in front of the link. Hee hee now yours works!!! \$\endgroup\$
    – Andy aka
    Commented May 20, 2014 at 9:50

1 Answer 1


I found the answer to the strange behaviour.

The LEGO M motors were built using an unusually large (1uF) capacitor parallel to the windings to reduce noise.

This large capacitor causes to motors to have a large inrush current that exceeds the OCP limit AND duration.

This causes the DRV8835's OCP circuitry to engage, disabling the bridge trying to drive the motor. The OCP circuit retries after 1ms. The capacitor has plenty of time discharging through the motor.

I don't know why the OCP won't engage at higher PWM frequencies. It probably either has no time to engage, or the current won't even reach the OCP level in that short time, because of the stray inductances of cables and PCB traces.

The series resistor helps because it limits the inrush current together with stray inductances and losses of the cable and probably the filter capacitor itself.

A current limiting resistor is actually a very bad idea, because it can prevent the OCP to trip during a short, and burn out very quickly.

An inductor in series with the motor will be the final solution. It won't disable the OCP, but will limit the inrush current.

Reference: http://www.technicbricks.com/2012/11/lego-power-functions-incompatibilities.html

  • \$\begingroup\$ Did the solution with the inductor work and what inductor do you use? \$\endgroup\$
    – user86468
    Commented Sep 13, 2015 at 18:53
  • \$\begingroup\$ It did help during tests, but in production any effective inductor would have been too big. A combination of high frequency PWM (in the 10KHz range) and a smaller inductance would have been kinda acceptable for driving motors, but it didn't work well with the servo motor. The final solution was to use DRV8833 channels paralleled. This chip can drive M motors OK without a choke inductor and at low PWM frequencies. \$\endgroup\$
    – netom
    Commented Sep 14, 2015 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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