Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 75
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
All today's birthdays', congrats!
Download (31)
ScottH (37)


Next birthdays
11/03 Electroguy (94)
11/04 nitromarsjipan (2024)
11/04 mb (31)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: General Science and Electronics
« Previous topic | Next topic »   

Filter for my PWM

Move Thread LAN_403
IamSmooth
Mon Mar 08 2010, 04:04AM Print
IamSmooth Registered Member #190 Joined: Fri Feb 17 2006, 12:00AM
Location:
Posts: 1567
I need to filter a PWM (2000hz) into a clean DC signal. I use a passive RC filter (R = 1k, C = 470uf). I find that the higher I go on C the cleaner the DC, but the longer the RC constant. This long RC constant is undesirable.

The DC output controls a VCO. I am finding that the microprocessor's feedback is delayed too long if I want a really clean DC signal. What can I do to get the cleanest DC out of a PWM, but have a short time constant? Would an active filter be a better choice? Attenuation of the signal is not a problem, here.
Back to top
Avalanche
Mon Mar 08 2010, 09:19AM
Avalanche Registered Member #103 Joined: Thu Feb 09 2006, 08:16PM
Location: Derby, UK
Posts: 845
You can cascade several RC filters, to improve the time constant whilst getting a good filter overall. Try a 3 pole RC first, roughly doubling the resistor value each stage, you could try: pwm > 4k7/22n > 10k/47n > 22k/100n > output. This is what I do to make cheap DACs using the PWM output from a microcontroller.
Back to top
hboy007
Mon Mar 08 2010, 11:35AM
hboy007 Registered Member #1667 Joined: Sat Aug 30 2008, 09:57PM
Location:
Posts: 374
If you don't mind building some extra circuity, you could use a low order RC filter, followed by a synchronous sample&hold circuit that captures the filtered level at a given phase of the pwm cycle. The output would be a stable level with a few cycles for settling (some milliseconds). Changes to the PWM cycle would result in voltage steps. You can smooth them out with another lower order filter.

If that's too much work for you, get a I²C DAC like the MCP4725A0T-E/CH which is really simple to use, fast and cheap.
Back to top
GeordieBoy
Mon Mar 08 2010, 12:42PM
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
First of all, push the PWM frequency as high as you can whilst still maintaining the required resolution. This makes the filtering that follows easier because it moves the ripple frequency higher and further away from the low frequency information that you want to preserve.

For many applications a simple first-order lowpass RC filter (one R and one C) will be enough. But if you cant find a combination that gives a satisfactory compromise between adequate supression of the switching carrier frequency and sufficiently fast resposne to changes of duty-ratio then you either need to increase the PWM carrier frequency or use a better reconstruction filter.

As Avalanche said you can use more elaborate passive filters, or something like a butterworth or chebychev active filter using an op-amp to produce a more powerful filter with a steeper transition band.

In the most demanding of circumstances you could even use an elliptic "Cauer" filter where the pass-band is very flat, then it transitions very rapidly into heavy attenuation at the high frequency end. If you design it right you can even place one of the zeros of the elliptic filter response right on top of the PWM switching frequency. This gives you infinite suppression of the carrier frequency, at least in theory!

Link2

-Richie,
Back to top
IamSmooth
Mon Mar 08 2010, 11:50PM
IamSmooth Registered Member #190 Joined: Fri Feb 17 2006, 12:00AM
Location:
Posts: 1567
Thanks for the replies.

With regard to 2nd and 3rd order RC filters:

I did some Bode plots and can see how each tier will add another -3db/decade. If I have two 22uf/1k filters I will get twice the attenuation. My question is how does this affect the RC time constant? Is it additive?
Back to top
radiotech
Tue Mar 09 2010, 01:48AM
radiotech Registered Member #2463 Joined: Wed Nov 11 2009, 03:49AM
Location:
Posts: 1546
IamSmooth wrote "I need to filter a PWM (2000hz) into a clean DC signal"

Could this question be asked like this: The signal is DC pulses which repeat every 500 uSec and a DC voltage proportional to the pulse width , averaged over some time period , greater than 500 uSec, is needed. How long do you want this time period to be?
Back to top
Mattski
Tue Mar 09 2010, 03:26AM
Mattski Registered Member #1792 Joined: Fri Oct 31 2008, 08:12PM
Location: University of California
Posts: 527
The more effective your low pass filter is, the longer your risetime is going to be because a fast risetime must contain high frequency content.

edit: I think time constants add more or less like resistors in parallel: 1/t_tot = 1/t1 + 1/t2 + ...
edit2: That makes no sense, that would reduce your total time constant. But as I recall they add but it's less than t1 + t2 by some amount.
Back to top
IamSmooth
Tue Mar 09 2010, 03:37AM
IamSmooth Registered Member #190 Joined: Fri Feb 17 2006, 12:00AM
Location:
Posts: 1567
Mattski wrote ...

The more effective your low pass filter is, the longer your risetime is going to be because a fast risetime must contain high frequency content.

And there lies the problem...

I seemed to have come with a reasonable filter using a 2nd order low pass with some tantalum capacitors.
Back to top

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.