Go Down

Topic: Quick question about low-pass filter and pwm (Read 8070 times) previous topic - next topic

far_1

#15
Oct 13, 2014, 01:51 am Last Edit: Oct 13, 2014, 02:04 am by far_1 Reason: 1
@dlloyd

Haha. Nice one.  :D


P.S. Found a really good explanation video
https://www.youtube.com/watch?v=WZN42JO_kFo

far_1

A few youtube videos later, and I think i'm starting to understand the theoretical operation.

But thanks anyway for the help.

cartoonist

Low pass filters do work a lot like, but not exactly as Grumpy_Mike sayd.

Cuttoff frequency means the amplitude is -3dB
-3dB means half the power (relative power is measured in 10log) but usally we measure voltage and then -3dB means 0.71 of the amplitude (relative amplitude is measured in 20log)
http://en.wikipedia.org/wiki/Low-pass_filter

A single-pole low-pass filter has a rolloff of 6dB/octave which is the same as a rolloff of 20dB/decade.
So 100Hz measured at the output of a simple 10Hz RC lowwpass filter (first order filter) will be 20dB reduced at the output. In voltage -20dB means 1/10th of the amplitude.
For a PWM signal of 100Hz 50-50 duty cycle into a simple 10Hz low-pass filter we will measure a DC output of half the amplitude of the squarewave. On top of this DC there will be 100 Hz and a lot of uneven harmonics like 300Hz, 500Hz, 700Hz and more uneven harmonics at an ever decreasing amplitude.

It is all mathematics. Fourier analyse of a 50-50 square wave of 100 Hz, tells us there will be a 100Hz component of amplitude 4/pi + 300Hz component of 4/(3*pi) amplitude + 500Hz of amplitude 4/(5*pi) etc etc
the 100Hz component will be -20dB so [1/10 of 4/pi] about 0.127 of the amplitude of the square wave
the 300Hz component will be -30dB so [1/30 of 4/(3*pi)] about 0.014 (1.4%) of the square wave amplitude.
the 500Hz component will be -34dB s0 [1/50 of 4/(5*pi)] about 0.005 (0.5%) of the square wave amplitude.
(http://www.allaboutcircuits.com/vol_2/chpt_7/2.html)

Higher order components are lower because fourier analyse says the amplitude is lower combined with the effect of the higher attenuation in the low-pass filter.
So higher order like 7th and 9th harmonics can sometimes be neglected because there amplitude is less than 0.25% of the original square wave amplitude.

When the PWM input signal has not an exact 50-50 duty cycle or varies in duty-cycle then the mathematics really get complicated.
So a long answer for a quick question. I hope my explanation was clear and sorry for the boring mathematics, but electronics aint easy.
You do not need a new P.C., you need a new O.S.  Linux is free, safe, easy, fast and reliable.


Grumpy_Mike

Quote
You have two frequencies...the higher pitched one will be filtered, and the lower will pass.
But if i have just one (unmodulated) frequency, and i apply a filter...i'm going to get just the attenuation of the signal as you described. Am i understanding this correctly?

Yes. That is it for sin signals.

Now you have got that consider a PWM signal.
The whole point about filtering a PWM signal is to remove as much of the AC component as possible and leave just the DC component. That DC component is set by the duty cycle of the square wave, so you want to turn PWM into the appropriate DC voltage level. So the cut off frequency needs to be a long way from the actual frequency of the PWM modulation so that the modulation frequency gets removed. However if you get the cutoff frequency too low then the DC will not be able to change very quickly.
For example suppose you had a cutoff frequency of 0.1Hz  and the PWM duty cycle changed it would be 10 seconds before the DC voltage got to the correct level for the duty cycle.

I know this link has been posted before but look at the animation of the input duty cycle and the DC level.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

cartoonist

"I know this link has been posted before but look at the animation of the input duty cycle and the DC level."

that is a very nice and clear page .

You do not need a new P.C., you need a new O.S.  Linux is free, safe, easy, fast and reliable.

Grumpy_Mike


"I know this link has been posted before but look at the animation of the input duty cycle and the DC level."

that is a very nice and clear page .

Thank you.  :)

Paul__B

21 replies.

And that was a quick question.

Grumpy_Mike

The question is indeed quick. Unfortunately the answer is not.

far_1

Indeed, the answer is far from quick.  :)
But i think, slowly i'm getting a hang of it.

Thanks for the insightful explanations and links.

Go Up