I need to drive a DC motor with PWM, through a H-bridge.

The controller can't generate PWM at ultrasonic frequencies with resolution I desire, and the low-end of the spectrum (~100Hz) may be too slow for my needs (plus still create a 'hum').

There's a question about driving a fan and the answers suggest 1-4.7uF ceramic + some 100-1000uF electrolytic caps at the output as solution (plus a fast diode to clear reverse current). This works well for a fan, which only turns in one direction. In my case, the motor will operate in both directions, so I can't depend on fixed polarity of the output - the moment I reverse polarity the cap will be fried.

How do I go about silencing the motor in this case?

  • 1
    \$\begingroup\$ Please excuse, but why will the cap be fried? EDIT: That is, a ceramic one. \$\endgroup\$
    – Dzarda
    Commented Sep 2, 2014 at 11:13
  • \$\begingroup\$ @Dzarda: Not the ceramic one, the electrolytic one. \$\endgroup\$
    – Dave Tweed
    Commented Sep 2, 2014 at 11:21
  • \$\begingroup\$ If your controller can't generate high enough frequency to not cause whine, get or make one that can. Plenty of microcontrollers come with built-in PWM that still has lots of resolution at 24 kHz. Think of this as having used the wrong part in your first version of the circuit and fix it. \$\endgroup\$ Commented Sep 2, 2014 at 12:45
  • \$\begingroup\$ @Dzarda: The 4.7uF ceramic won't do much good with a fried 1000uF electrolytic in parallel... \$\endgroup\$
    – SF.
    Commented Sep 2, 2014 at 15:28
  • 1
    \$\begingroup\$ All that stuff you mention doesn't have to come from a single micro. If you have that many things going on, then offloading the cycle by cycle motor control to a micro optimized for that is probably a good overall architecture. The main micro that runs the GUI sends high level commands to the motor controller, like "go to position xxxx" and the like. \$\endgroup\$ Commented Sep 2, 2014 at 16:54

2 Answers 2


Putting a large electrolytic capacitor across the motor obviously won't work in reverse, but even if that wasn't a problem it's still not a good idea.

When PWM turns the bridge transistors on they will charge the capacitor as quickly as they can, but when turned off it will discharge more slowly through the motor. This has two undesirable side effects:-

  1. It will destroy the accuracy of your PWM. With the capacitor 'filling in the gaps' between PWM pulses the motor will spin faster than expected at lower PWM ratios, but less so when heavily loaded.

  2. High current spikes will occur as the capacitor charges, putting stress on the bridge transistors and increasing electrical noise in the circuit. There may also be audible effects.

You can eliminate these problems by inserting an inductor in series with the motor/capacitor. However if your PWM frequency is low enough to be audible then the inductance required will be quite large (since you can't use an electrolytic capacitor the amount of capacitance you can apply to the filter is limited, so the inductance must be larger). Also the inductor must pass the relatively high DC motor current without going into saturation, and its resistance must be low to keep losses down.

If space is not a problem then simply use a choke with appropriate inductance and current rating. Then the only problem will be keeping it quiet!

The LC filter's cutoff frequency should be much lower than the PWM frequency, eg. if the PWM frequency is 1kHz then the filter should cut off at 500Hz or lower. If you used a 10uF capacitor then you would need about 10mH of inductance.

  • \$\begingroup\$ so how would I go about finding the right choke? \$\endgroup\$
    – SF.
    Commented Dec 13, 2014 at 15:08
  • \$\begingroup\$ It must be rated for higher current than your motor will draw, have resistance low enough to drop insignificant voltage at that current, and inductance high enough to filter out your PWM frequency. Filter calculator at sim.okawa-denshi.jp/en/RLClowkeisan.htm \$\endgroup\$ Commented Dec 13, 2014 at 18:49

Are you restricted to a shunt cap only? Is this high voltage? Why do you need 1000uF?

Usually a shunt cap is used to divert high frequency noise: think "smoothing the pwm edges." A bunch of parallel ceramic caps may be just fine.

Make it an LC filter may improve your filtering since you can smooth out the current ripple a well. You then have two degrees of freedom in the filter design.

Just make sure the LC resonant frequency is different from any pwm harmonic you have.

  • \$\begingroup\$ It's something up to 32V though more likely it will be 12V; I'm not restricted except with budget or availability (...or - to a degree - space; the device should not require a forklift to move it...) \$\endgroup\$
    – SF.
    Commented Sep 14, 2014 at 12:42

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.