Forums

Dumpy filter

Started by bitrex February 1, 2018
Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output 
proportional to duty cycle, an LM386 as two-pole Sallen Key 
"Busselworth" filter:

<https://imgur.com/a/XcDCC>

Faster settling and better drive current than an RC filter, almost as 
cheap. It's not glamorous but gets the job done
On Thu, 1 Feb 2018 18:14:36 -0500, bitrex
<bitrex@de.lete.earthlink.net> wrote:

>Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >proportional to duty cycle, an LM386 as two-pole Sallen Key >"Busselworth" filter: > ><https://imgur.com/a/XcDCC> > >Faster settling and better drive current than an RC filter, almost as >cheap. It's not glamorous but gets the job done
I'm so-o-o-o unimpressed. At least three (maybe six ;-) of us here could output a DC level proportional to duty-cycle ON A CYCLE-BY-CYCLE BASIS. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | STV, Queen Creek, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | It's what you learn, after you know it all, that counts.
On 02/01/2018 06:58 PM, Jim Thompson wrote:
> On Thu, 1 Feb 2018 18:14:36 -0500, bitrex > <bitrex@de.lete.earthlink.net> wrote: > >> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >> proportional to duty cycle, an LM386 as two-pole Sallen Key >> "Busselworth" filter: >> >> <https://imgur.com/a/XcDCC> >> >> Faster settling and better drive current than an RC filter, almost as >> cheap. It's not glamorous but gets the job done > > I'm so-o-o-o unimpressed. > > At least three (maybe six ;-) of us here could output a DC level > proportional to duty-cycle ON A CYCLE-BY-CYCLE BASIS. > > ...Jim Thompson >
I have a big reel of LM386s I got for about 10 cents per, they're a humble part but the output automatically biasing to around half the supply voltage is a nice perk, their main flaw at the moment is not earning me any money
On 02/01/2018 07:18 PM, bitrex wrote:
> On 02/01/2018 06:58 PM, Jim Thompson wrote: >> On Thu, 1 Feb 2018 18:14:36 -0500, bitrex >> <bitrex@de.lete.earthlink.net> wrote: >> >>> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >>> proportional to duty cycle, an LM386 as two-pole Sallen Key >>> "Busselworth" filter: >>> >>> <https://imgur.com/a/XcDCC> >>> >>> Faster settling and better drive current than an RC filter, almost as >>> cheap. It's not glamorous but gets the job done >> >> I'm so-o-o-o unimpressed. >> >> At least three (maybe six ;-) of us here could output a DC level >> proportional to duty-cycle ON A CYCLE-BY-CYCLE BASIS. >> >> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...Jim Thompson >> > > I have a big reel of LM386s I got for about 10 cents per, they're a > humble part but the output automatically biasing to around half the > supply voltage is a nice perk, their main flaw at the moment is not > earning me any money
When did this part first go on sale, anyway? Likely at least decade before I was born I'd figure
On 02/01/2018 06:14 PM, bitrex wrote:
> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output > proportional to duty cycle, an LM386 as two-pole Sallen Key > "Busselworth" filter: > > <https://imgur.com/a/XcDCC> > > Faster settling and better drive current than an RC filter, almost as > cheap. It's not glamorous but gets the job done
The internal feedback bypass cap is probably too large, I think one could get away with a ceramic there
On Thursday, February 1, 2018 at 6:14:41 PM UTC-5, bitrex wrote:
> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output > proportional to duty cycle, an LM386 as two-pole Sallen Key > "Busselworth" filter: > > <https://imgur.com/a/XcDCC> > > Faster settling and better drive current than an RC filter, almost as > cheap. It's not glamorous but gets the job done
A Butterworth response has ringing in the time domain, Bessel is better. George H.
On 02/01/2018 07:40 PM, George Herold wrote:
> On Thursday, February 1, 2018 at 6:14:41 PM UTC-5, bitrex wrote: >> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >> proportional to duty cycle, an LM386 as two-pole Sallen Key >> "Busselworth" filter: >> >> <https://imgur.com/a/XcDCC> >> >> Faster settling and better drive current than an RC filter, almost as >> cheap. It's not glamorous but gets the job done > > A Butterworth response has ringing in the time domain, > Bessel is better. > > George H. >
It's a Butterworth/Bessel 0.50 transitional filter transfer function; sort of a compromise between the better ideal settling time of the Bessel and ideal steeper frequency domain cutoff of the Butterworth. Bustleworth. With an "open loop" gain of only 200 from the bypassed but still-not-an-opamp LM386 the performance of a strict Bessel in Sallen Key didn't look so ah good.
On 02/01/2018 08:00 PM, bitrex wrote:
> On 02/01/2018 07:40 PM, George Herold wrote: >> On Thursday, February 1, 2018 at 6:14:41 PM UTC-5, bitrex wrote: >>> Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >>> proportional to duty cycle, an LM386 as two-pole Sallen Key >>> "Busselworth" filter: >>> >>> <https://imgur.com/a/XcDCC> >>> >>> Faster settling and better drive current than an RC filter, almost as >>> cheap. It's not glamorous but gets the job done >> >> A Butterworth response has ringing in the time domain, >> Bessel is better. >> >> George H. >> > > It's a Butterworth/Bessel 0.50 transitional filter transfer function; > sort of a compromise between the better ideal settling time of the > Bessel and ideal steeper frequency domain cutoff of the Butterworth. > Bustleworth. > > With an "open loop" gain of only 200 from the bypassed but > still-not-an-opamp LM386 the performance of a strict Bessel in Sallen > Key didn't look so ah good.
BTW the reason for this exercise is the LM386 has a lot of drive current available and can be used to drive small motors/servos directly - even says so in the datasheet!
On Thu, 1 Feb 2018 18:14:36 -0500, bitrex
<bitrex@de.lete.earthlink.net> wrote:

>Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output >proportional to duty cycle, an LM386 as two-pole Sallen Key >"Busselworth" filter: > ><https://imgur.com/a/XcDCC> > >Faster settling and better drive current than an RC filter, almost as >cheap. It's not glamorous but gets the job done
One more RC gets you a 3rd-order filter, and avoids the shoot-through problem of the first cap whacking the opamp output impedance, which is the real problem with Sallen-Key filters. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Friday, February 2, 2018 at 10:58:15 AM UTC+11, Jim Thompson wrote:
> On Thu, 1 Feb 2018 18:14:36 -0500, bitrex > <bitrex@de.lete.earthlink.net> wrote: > > >Filtering 0-5V 1kHz PWM square wave to get ~1 volt to 10 volts DC output > >proportional to duty cycle, an LM386 as two-pole Sallen Key > >"Busselworth" filter: > > > ><https://imgur.com/a/XcDCC> > > > >Faster settling and better drive current than an RC filter, almost as > >cheap. It's not glamorous but gets the job done > > I'm so-o-o-o unimpressed. > > At least three (maybe six ;-) of us here could output a DC level > proportional to duty-cycle ON A CYCLE-BY-CYCLE BASIS.
Use a pair of counters to evaluate the duty cycle over one cycle, digital number crunching to turn that into a number, and a D/A converter to push out that voltage over the next cycle. If the period of waveform being looked at is stable, you can use a phase-locked loop to lock the period-counting clock to some (high) multiple of the frequency of the waveform being looked at, and save yourself the digital number crunching. It's really only practical in an ASIC, which is to say for high volume applications (which are the only ones Jim get to hear about). A fast-settling multi-pole low pass filter can do almost as good a job in most application. Taylor and Williams list some equi-ripple approximations to the perfect fast-settling filter which give better carrier attenuation at the price of small excursions from the ideal phase-versus-frequency plot. -- Bill Sloman, Sydney