Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 79
  • 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 »   

High order filters

Move Thread LAN_403
GeordieBoy
Tue Mar 16 2010, 09:03PM
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
> When people want to filter a DC waveform that moves from one value to another...

Perhaps therein lies the problem! DC that moves from one level to another by definition contains more spectral energy than just DC content. It also contains high frequency AC content as well which must be passed by the lowpass filter. (Dr Slack I realise that you already knew this! but mentioned it here for the benefit of others.)

A simple technique that can be used to minimse the ripple from PWM reconstruction is two use two PWM modules running at the same frequency but in anti-phase. You filter both of them seperately with simple RC filters then sum their outputs.

If you think of two PWM waveforms at 50% duty ratio, one starting out high and the other starting out low. Then filter them both. You get two DC signals of 0.5 each with a little bit of triangular shaped ripple. The neat thing is that the two ripple waveforms are complementary triangle waveforms that cancel out when added together. The ripple cancellation is theoretically perfect when the duty ratio is 0.5 but is still worthwhile for other ratios.

Another relatively simple analogue option to eliminate the undesirable ripple that is frequency modulating your VCO is this. Use an I/O line for the PWM that can be tri-stated. Take this line high to charge the filter capacitor when you want to increase the VCO operating frequency, take it low when you want to discharge the cap and lower the frequency. When the frequency is spot on, you tri-state the I/O line (make it a high-impedance input) and this will leave whatever level of charge is on the filter capacitor without incurring ripple from a PWM pulse train. (The PLL's used for FM radio local oscillators use this type of 3-level comparator to eliminate modulation sidebands from the RF output. The 3-level comparator leaves the VCO frequency alone as long as it is doing the right thing! Hence no ripple!)

> I have maxed out my pwm frequency at 4khz. This give me adequate resolution to vary the duty, which will control my voltage to a PLL's VCO. This is for a control-loop.

I'm not sure why you need the VCO to be quite so agile, but if you really want lightening fast response to changes in frequency without any lag or overshoot you might want to look at DDS chips like Analog Device's AD9834.

For those who have not come across these DDS chips before, they are a frequency synthesiser on a chip. They are a self contained digital system that calculates the required output waveform at whatever frequency you tell it to. A typical design running from a 24MHz system clock can generate any frequency from DC to about 8MHz with a programming resolution of maybe 0.1Hz. Because they are a digital system they can be controlled over SPI easily from any microcontroller. They would fit right into your digital control system and eliminate the analogue interface part that seems to be giving you headaches.

I hope this has given you a few ideas,

-Richie,
Back to top
Dr. Slack
Wed Mar 17 2010, 05:43AM
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
I found this active analog chip based on your suggestion, Neil.

Uhh? I didn't make any suggestion, at least not about choosing specific Butterworth hardware.

As a general rule, to optimise the time*bandwidth product, keep the order low, no more than 3rd order. If you want to improve the ripple that gets through from your PWM, then if the ripple is at constant frequency, which should be easy to arrange if you code a constant period PWM, then add a stopband zero to notch out the fundamental PWM freqeuncy. These introduce very little delay into your passband. I feel (engineer's seat of pants here) that used in a control loop, modest overshoot will not be a problem, which is why I'm not going to suggest a Bessel, but something steeper.

So what I would suggest is ...

Design a 3rd order elliptic, play around with the bandwidth parameter until the stopband zero occurs at 4kHz, then simulate it to see what response you've got. The filter design program will ask you for other parameters, like passband ripple and stopband ripple. The former gets traded off against delay, try 1dB to start with. The latter controls how much the other harmonics of the PWM will be attenuated, the ones which aren't killed by being hit by the stopband zero. Only you know how much suppression is needed. Again, suppression gets traded off against delay, try 40dB (you'll struggle to see 1% ripple on a 'scope) to start with.

Just for the experience, see if you can find a high order Bessel design, then simulate it in the time domain. I found it quite freaky when I first did this, that after putting a step into it, nothing happened at the output for a while, then it went woooooomph to the final value without a tremor, just the way that other filters don't.

BTW, I've had this sig line for a few weeks now, but it may suit your application perfectly. With sufficient mucking about, a PWM through a filter into a VCO might do something like what you want, but it might be more appropriate to take a plane, or walk the pig, by using a real DAC to tune the VCO, or digits to drive a DDS, or even (assuming the VCO in question is the back end of a 4046, by generating a low frequency from your uC and multiplying it up with the PLL chip). If you don't have the funds for these more appropriate solutions, then flinging the pig through a filter may be the only option.

Thanks Richie, "DC that moves about" was written quite provocatively wink
Back to top
Steve Conner
Wed Mar 17 2010, 10:10AM
Steve Conner Registered Member #30 Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
I'm going to stick my neck out and guess that Iamsmooth is using an Arduino, and doesn't know how to write a driver for a DAC or DDS, so he's stuck with the PWM module. smile

Douglas Self did a study to see what kind of filter was best for DC offset protection in audio power amps. The task of this filter is to reject loud bass notes, but trigger the protection as quickly as possible on the application of DC.

He usd Spice to study bass rejection vs. triggering delay, with a single RC, dual cascaded RC, and a Bessel active filter. His method was to design the three filters for the required amount of attenuation at 20Hz, so that full power would only just fail to trigger the detector. Then he measured the triggering delay on a step input.

He found that the single RC worked best, then the cascaded one, with the Bessel in third place.

In the context of this application, make of that what you will...
Back to top
Dr. Slack
Wed Mar 17 2010, 12:02PM
Dr. Slack Registered Member #72 Joined: Thu Feb 09 2006, 08:29AM
Location: UK St. Albans
Posts: 1659
He found that the single RC worked best, then the cascaded one, with the Bessel in third place ...
... for the particular undocumented ratios (hence filter stopband rejection) between the 20Hz tolerate level, the DC tolerate level and the post-filter trip point. So results not easily transferred, nor strictly applying to Mr Smooth's problem.

But an interesting result nonetheless.

Perhaps the most important lessons of the *one reply based on actual measurement* on this thread are that

a) It's not intuitively obvious what filter is going to perform best in any application
b) It's difficult to specify the behaviour you want in the real real, and convert that directly to "filter like" specifications
b) high order is not necessarily the way to go
Back to top
Mattski
Wed Mar 17 2010, 10:04PM
Mattski Registered Member #1792 Joined: Fri Oct 31 2008, 08:12PM
Location: University of California
Posts: 527
I happened to be looking at Link2

There's some good resources attached to some posts including a master's thesis that you may find useful as a partial overview of filter design.
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.