PWM Compressor Optimized and Simplified

Started by rring, September 09, 2013, 11:05:00 AM

Previous topic - Next topic

rring

I was able to improve the range of compression some and increase input head room quite a bit by using a analog switch instead of the original PFET switch. Also, I eliminated the full wave rectifier stage and I am just using a simple compensated diode peak detector which works just fine. This eliminates one dual Op Amp stage. I wasn't sure you could make a PWM compressor this simple when I started - so I am happy with the result.

original post here for reference:
http://www.diystompboxes.com/smfforum/index.php?topic=103833.msg927246#msg927246



Demo Clip (set at about 1/2 max compression level): no compression, then compression, finally quick  back and forth at the end, hitting some chords really hard

http://circuitsaladdotcom.files.wordpress.com/2013/09/scrapple-from-the-apple-comp-demo.mp3

samhay

Sounds really good - as do your chops.
Haven't come across the TS12A before - any reason you chose this rather than something like a CD4053, and is there a DIP version?
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

rring

Yes lots of switches could work - just happened to have this one. It is one switch in a 8 pin DIP or SOIC which takes up less space than a multi switch IC. The only important issue is it has to be normally "on" and a high pulse turns it off.

samhay

Sounds like something I should add to the next order - thanks.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

PRR

> a PWM compressor this simple

I believe, for simplicity *and* better headroom, you could repace C6 C8 with shorts, R8 with open.

Also that the switch could be CD4066 with little change of action. (Depending what's handy.... most of my life the '16/'66 was our go-to, while the TS12 is less than a decade old....)

The C6 C8 R8 change puts the switch midway between its supply rails. The way you have it, input signal "could" swing below the negative supply. Negative 0.3V is specced as Absolute Max; guitar signals are of this general size so it may work "clean" for one player and "dirty" for another.

And of course losing 3 parts is 6 less legs to solder.

I won't argue the better specs of the TS12. The switching speed is amazing, far more than this circuit needs. The 4066 will round-over a bit at 9V and 1MHz, but not a lot; and isn't very critical. The lower R(on) can be approximated by wiring the four (yes 4) switches in 4066 parallel. Gain-flatness of 4066 is still not as good, but hardly bad. If you have fat eyes, 4066 is available DIP. It can also be had for 1/10th the price of TS12; irrelevant for one-off of course.
  • SUPPORTER

rring

Yes that all makes sense. To be honest I just didn't want to use  the space for bigger than a 8 pin DIP and the 4066 is normally open - so I did not want to change to a shunt topology for the switch. The low on R of the TS12A4515 is also nice.  You could create an inverter out of one of the switches on the 4066 by tying it to a pull up resistor and then drive the other switches with the output of the pull up resistor/switch combo. So yes you could use a 4066. This will use a little more current (extra inverter) but that's ok. Right now the current draw is about 7 mA.

Normally, I would not include C6 or C8 and would just switch the signal DC bias and all. Why, I am not completely sure, but if there is DC bias across the switch - I get horrible noise artifacts from the PWM action. With R8 I need C8 because tying the output to a DC ground reference causes the distortion problem. So then perhaps I can get rid of R8?......... maybe now I can. Early on, inclusion of this resistor was required at the breadboard stage because of sorts of High Z noise leakage to the audio stages. I am doing a final cleaned up layout.
So.... I need C6 (not sure why but because of switching noise)- because of C6 and because of R8, I need to float the output with C8. With it the way it is I get about 6V Pk to Pk headroom on the scope.
I will give it a try maybe I can eliminate R8 and C8.  I think C6 will be required - though I will confirm this with the final layout.

merlinb

#6
I love streamlining! It's looking really good!  :icon_biggrin:

BTW, it is customary to put R16 before R15, so tweaking the attack/decay doesn't affect the voltage across the smoothing cap C14.

rring

Duh, yes that totally makes sense- I just sort dialed it in for my taste and did not think of that issue. I will make that change in the schematic, once I look at PRR's suggestions in more detail and test the layout I am working on. Perhaps, I can eliminate yet more parts.
Thanks for the suggestion.

PRR

If you omit caps, you *must* tie the load resistor to mid-voltage; else it sure will be unhappy.

Without C8 C9 R8, this whole node hangs on the steady Vref at IC1b input. It won't change DC level with duty cycle.

The switch does need a load. At the rate it works, I think the 4k7 and 1000pFd will work OK against the >1Meg of the open switch.
  • SUPPORTER

rring

Yes that makes sense - So the bottom line if I can determine the cause of the PWM noise when the switch is DC biased (and correct) - I can implement all of the suggestions you have described. I will have to dig a little deeper. Maybe with a decent board layout this issue will be mitigated.

rring

 I was able to hack out more components. Once I got the circuit on to a decent board layout - I was able to find the source of the noise - which was high Z leakage from the PWM chip oscillator resistor to the output amplifier stage. With a little physical separation and low Z termination at the amplifier/switch mid supply bias, the noise issues were resolved and I was able to eliminate all of the AC coupling through the switch and into the amp stage. I did have to add a capacitor on IC2 to eliminate DC gain creating a large DC offset voltage - which created duty cycle attenuation with no signal. Its a pretty simple design now - with nothing difficult or critical to adjust. If you look at the completed board in the video.... its not very complicated. I got it all on a single sided board - with a couple of jumper wires.



Did this quick video on the bench - which shows the laser printer board I created using the HP laser jet presentation paper as transfer media. That paper is absolutely the best thing I have used for toner transfer.

samhay

Well this became to compelling not to try - nice job Ray. Have ordered an TL5001, and will, in the first instance, try to hack a CD40xx switch into service.
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

rring

Yes the 4066 should work fine. You will just end up with just a little extra current to use one of the 4066 switches as a inverter. I probably should have implemented this in the first place but was worried about board real estate. Now with less parts, there is plenty of room for a 14 pin DIP or SOIC and still fit in the 1590B footprint.