HELP! PWM RC Low Pass Filter

Thread Starter

jameseraymond

Joined Oct 25, 2012
18
I have been given some PWM specs from a customer:
500Hz (+/- 5%)
0-5V
0-100% duty cycle (The duty cycle with change the speed of a pump).

I need to convert the PWM signal to an analog signal for my controller. I have been told to try an RC Filter.

The RC Filter response needs to be < 1 second, as the pump speed will change frequently. I would also like to get the RC Filter output to be as close to 5V as possible at 100% duty cycle. If it matters, the device has an internal resistance of 36k Ohms.

Im assuming this an easy multi-stage RC low pass filter. I do not have the time and/or resources to get this done by myself. Is anyone around that has some filter experience that could give the some tips and/or RC values to try?

Does all this make sense? Any ideas, questions, concerns?
 

crutschow

Joined Mar 14, 2008
34,280
For a higher degree of filtering you can use an active filter. The free FilterPro program from Texas Instruments makes the design of such filters quite simple. The order of filter required is determined by the amount of ripple you can tolerate at the controller input.
 

Ron H

Joined Apr 14, 2005
7,063
A simple RC with a cutoff of 5Hz would reduce the ripple by 40db (to 50mV), is that good enough?

Bob
True for sine waves. For a square wave, the p-p ripple will be about 78mV.
For settling to better than 99% in 500mS, a single pole (single RC) filter with a 100mS time constant (F3dB=1.6Hz) could be used. This has a ripple of 25mV p-p when the duty cycle=50%.

A passive or active 2 pole filter can, obviously, achieve much lower ripple while maintaining the same settling time.
 

BobTPH

Joined Jun 5, 2013
8,806
Ron_H,

Not questioning your result, but how did you calculate that? I was just going by 5V down by 40db, which is the response of the filter for the 500Hz component. Is it that the harmonics add that much?

Bob
 

Ron H

Joined Apr 14, 2005
7,063
Ron_H,

Not questioning your result, but how did you calculate that? I was just going by 5V down by 40db, which is the response of the filter for the 500Hz component. Is it that the harmonics add that much?

Bob
You can attribute it to the harmonics, and to the relative phases of the harmonics, but it's easier to calculate in the time domain.
It is an easily verifiable fact that the ripple will be highest at 50% duty cycle when the DC voltage on the capacitor=2.5V.
If the ripple is low compared to the 5V p-p signal, then it will approximate a triangle wave, i.e., the magnitude of the current through the resistor will be approximately constant, and will change direction on each half cycle. We can calculate the ripple by calculating the change in voltage across the capacitor during a half cycle:

V=2.5v (the 50% voltage)

\(\Delta v=\frac{It}{C}\)

\(I=\frac{V}{R}\)

substituting,

\(\Delta v=\frac{Vt}{RC}\)

but

\(RC=\frac{1}{\omega_{3dB}}\)

therefore,

\(\Delta v=Vt \omega_{3dB}=Vt \times 2 \pi f_{3dB}\)

At 50% duty cycle,

\(t=\frac{1}{2F}\)

where F is the square wave frequency.

Substituting,

\(\Delta v=V \times \pi \times \frac{f_{3dB}}{F}\)

Now, if V=2.5, F=500Hz, and f3dB=5Hz, then

Δv=2.5*3.14*5/500=78.5mV

It was actually easier than that when I first did it, because I simply calculated R and C from the 5Hz cutoff freq, then calculated the current (2.5/R), then calculated V=It/C.
 
Top