Newbie falls down the 4049 rabbit hole...

Started by ThermionicScott, October 27, 2020, 11:59:47 PM

Previous topic - Next topic

ThermionicScott

#20
Quote from: Rob Strand on November 01, 2020, 09:28:44 PM
QuoteThat reminds me:  I need a 'scope! 
If you have a multimeter measuring the DC voltage on the supply rails and the outputs of the 4049 gates could be useful.

I can do that!  Since it powered up and made sound on my first try, it didn't occur to me to get voltages. 
"...the IMD products will multiply like bacteria..." -- teemuk

Rob Strand

QuoteShould look like this.  A little light did get to the camera when I was recording...
My problem is bigger than just a dark video.  The web page itself is black with nothing on it.  A totally empty page - not even a hint of any video controls!
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ThermionicScott

#22
Battery:  8.55V  (kind of depressing to watch the battery wear out in real time with this effect!)

4049 voltages:

1   8.4V
2   8.4V
3   0
4   8.4V
5   0
6   8.4V
7   0
8   0
9   2.88V with 1M pot @ 0%, 2.77V with 1M pot @100%, 0.75V with 10M resistor
10  2.88V
11  2.77V
12  2.88V
13  0
14  0
15  8.4V
16  0

Pins 9-10 are the input stage, pins 11-12 are the output stage, all other inverter inputs tied to ground.  Anything look unusual?  Thanks.  :)
"...the IMD products will multiply like bacteria..." -- teemuk

edvard

As others have said, try to lower the gain and push the front end with an op-amp boost stage instead of creating gain in the inverter stage itself.  Use cascading stages to get more crunch if you need to.  Do a search for Mark Hammer's take on the Tube Sound Fuzz for more ideas.  Add and subtract parts, change values etc. until you find the sound that's in your head.  Yes, the 4049 rabbit hole is deep; beware. 

Yes, the 'blatty' sound you hear is most likely the bass causing havoc, possibly creating intermodulation distortion.  I recommend you put a resistor at the input like an Inverting Op-amp stage so you can calculate the gain better, but also to give your input capacitor something to work against.  Plug in smaller and smaller input cap values until you find something nice in-between splat and ice pick.  I hate that noise too.

Something interesting I've noticed about inverters and other CMOS abuse circuits is that the output impedance is relatively high, so your effective gain will be lower than calculated if you use lower-value feedback resistors (100k-330k) or follow it with a low-impedance path like a tone stack, BUT you'll get softer clipping (and not just because the gain is lower).  Use higher-value feedback resistors (1-10Meg), follow it with a JFET or Non-inverting Op-amp stage, or run inverters in parallel (yes, that's a thing) and your gain calculations will be more accurate, but the clipping is harder.  I've confirmed this with simulators AND scope on my breadboard.

For traversing the rabbit hole, you probably couldn't have picked a better guidebook than this very forum; welcome!
All children left unattended will be given a mocha and a puppy

ThermionicScott

Quote from: Rob Strand on November 01, 2020, 10:07:19 PMMy problem is bigger than just a dark video.  The web page itself is black with nothing on it.  A totally empty page - not even a hint of any video controls!

Hmm, strange!  I tried to make sure it wasn't "hidden" or "private".  I'd offer to email the video file to you directly, but it would probably be the least satisfying 40 MB download ever.   :icon_lol:

Perhaps there's a better place to host it?  I'm open to suggestions.
"...the IMD products will multiply like bacteria..." -- teemuk

ThermionicScott

#25
Quote from: edvard on November 01, 2020, 10:47:02 PM
As others have said, try to lower the gain and push the front end with an op-amp boost stage instead of creating gain in the inverter stage itself.  Use cascading stages to get more crunch if you need to.  Do a search for Mark Hammer's take on the Tube Sound Fuzz for more ideas.  Add and subtract parts, change values etc. until you find the sound that's in your head.  Yes, the 4049 rabbit hole is deep; beware. 

Yes, the 'blatty' sound you hear is most likely the bass causing havoc, possibly creating intermodulation distortion.  I recommend you put a resistor at the input like an Inverting Op-amp stage so you can calculate the gain better, but also to give your input capacitor something to work against.  Plug in smaller and smaller input cap values until you find something nice in-between splat and ice pick.  I hate that noise too.

Something interesting I've noticed about inverters and other CMOS abuse circuits is that the output impedance is relatively high, so your effective gain will be lower than calculated if you use lower-value feedback resistors (100k-330k) or follow it with a low-impedance path like a tone stack, BUT you'll get softer clipping (and not just because the gain is lower).  Use higher-value feedback resistors (1-10Meg), follow it with a JFET or Non-inverting Op-amp stage, or run inverters in parallel (yes, that's a thing) and your gain calculations will be more accurate, but the clipping is harder.  I've confirmed this with simulators AND scope on my breadboard.

For traversing the rabbit hole, you probably couldn't have picked a better guidebook than this very forum; welcome!

Thanks, edvard!  Google kept pointing me here, so I decided I might as well join and be able to search old threads directly.  Quite the brain trust you guys have here. :)

Earlier today, I experimented with the bass content to test out that hypothesis.  I set up my Boss GE-7 to mimic a high-pass filter with a corner at 400Hz or so and ran it into the breadboard.  That took away a lot of the blat!  So I went ahead and changed caps on the build to turn it into a Red Llama, since trimming a little bass (and treble) seems to have been a goal there, too.  I didn't have a 0.068uF, so I used a 0.047uF for the input cap.  Much better.  The only downside is that some of the overall gain has been lost as well, and I'm starting to get why Way Huge elected to market the RL more as an overdrive/boost rather than a distortion.

Sounds like more stages with less amplification each time is the way to go!
"...the IMD products will multiply like bacteria..." -- teemuk

Rob Strand

QuoteHmm, strange!  I tried to make sure it wasn't "hidden" or "private".  I'd offer to email the video file to you directly, but it would probably be the least satisfying 40 MB download ever.   :icon_lol:
It's probably something simple like my machine doesn't support the video format or the player barfs on my browser.

FWIW, referring to the schem you posted in Reply #1:
You could play with the 100 ohm in series with the power supply R1=100R on the TSF but is as high as 1k on the Red Lama.   Clearly some values suit more people than others.    Try 220R, 470R, 1K to hone-in on the zone you like.   1K should drop the pin 1 voltage down to 5.5V or so.

Also you need the cap C6= 100uF across the power on the chip side (pin 1).
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ThermionicScott

Quote from: Rob Strand on November 01, 2020, 11:52:51 PM
FWIW, referring to the schem you posted in Reply #1:
You could play with the 100 ohm in series with the power supply R1=100R on the TSF but is as high as 1k on the Red Lama.   Clearly some values suit more people than others.    Try 220R, 470R, 1K to hone-in on the zone you like.   1K should drop the pin 1 voltage down to 5.5V or so.

Hmm, I hadn't considered that yet!  Would it soften the clipping or add sag?  Or just drop the headroom?  I was under the impression that resistor mostly existed to help filter the DC when using external power supplies...

QuoteAlso you need the cap C6= 100uF across the power on the chip side (pin 1).

I do have the 100 uF electrolytic in the power supply, between the 100 ohm resistor and the negative rail on the breadboard.  Is there a benefit to sticking it right next to the chip, like the caps in the feedback loops?



Thanks!
"...the IMD products will multiply like bacteria..." -- teemuk

edvard

Quote from: ThermionicScott on November 01, 2020, 11:44:37 PM
Thanks, edvard!  Google kept pointing me here, so I decided I might as well join and be able to search old threads directly.  Quite the brain trust you guys have here. :)

Earlier today, I experimented with the bass content to test out that hypothesis.  I set up my Boss GE-7 to mimic a high-pass filter with a corner at 400Hz or so and ran it into the breadboard.  That took away a lot of the blat!  So I went ahead and changed caps on the build to turn it into a Red Llama, since trimming a little bass (and treble) seems to have been a goal there, too.  I didn't have a 0.068uF, so I used a 0.047uF for the input cap.  Much better.

If you have a 0.022µF cap, you can parallel it with the 0.047 to approximate a 0.068.

QuoteThe only downside is that some of the overall gain has been lost as well, and I'm starting to get why Way Huge elected to market the RL as an overdrive/boost rather than a distortion.

I was going to mention that too, sorry I didn't work it in to my first reply; Yes, taking down the bass has the unfortunate perceptual side effect of lowering the gain.  You didn't actually lower the gain, just the part of your signal that was dominating the input, so now you have a better idea of what it sounds like with a more balanced frequency response.  If you're looking for Malcolm/Angus tones, it might be OK as it is, or maybe one more stage for a bit more chutzpah. 

QuoteSounds like more stages with less amplification each time is the way to go!

I agree.  Multiple lower gain stages, believe it or not, will give you better gain-to-noise ratio than larger feedback resistors in a single stage.  The shot noise of large value carbon comp resistors is part of the reason inverter circuits have a reputation for being noisy.  When choosing noise reduction caps, I would recommend the smallest value that makes an audible difference in the noise level.  I find that with a 100k feedback resistor, 50㎊ - 100㎊ works just fine, but 1㎋ starts rolling off way too much.  There's a fine line between 'hiss' and 'crackle'.
All children left unattended will be given a mocha and a puppy

Rob Strand

#29
QuoteHmm, I hadn't considered that yet!  Would it soften the clipping or add sag?  Or just drop the headroom?  I was under the impression that resistor mostly existed to help filter the DC when using external power supplies...
I believe with 1k the power supply drops to about 5.5V and the clipping is more symmetrical (without losing the cmos softeness).    IIRC the Laney amps power from 5V as well.

QuoteI do have the 100 uF electrolytic in the power supply, between the 100 ohm resistor and the negative rail on the breadboard.  Is there a benefit to sticking it right next to the chip, like the caps in the feedback loops?
It doesn't hurt if but it's probably going to be totally unnoticeable with that circuit.  You would have to do a really bad job of the layout for that to come into play.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

PRR

Quote from: ThermionicScott on October 31, 2020, 07:37:27 PM...how do you calculate the corner frequency when there isn't a resistor to ground...?



R1/Gv, where Gv is the voltage gain of the inverter.

Gv is *very* uncertain here. It is known to vary with supply voltage (and oddly, lower supply is higher gain), with temperature, loading, and various unknowns of foundry chemistry and processing. But using super-rough numbers: Gv=100, R1=1Meg, Rin is 10k.

  • SUPPORTER

Rob Strand

QuoteR1/Gv, where Gv is the voltage gain of the inverter.
An even then only when the inverter isn't clipping.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

anotherjim

Beware of trying to emulate power supply sag. Inverters work backward. Nearly zero current when output hits a rail, maximum current when idle or signal passing thru zero-crossing. The IC power needs to be either well regulated or given a big bypass cap to keep the supply stable and free of signal frequency (it will be x2 signal frequency as it occurs on every peak).

ThermionicScott

#33
Quote from: edvard on November 02, 2020, 01:49:49 AM
If you have a 0.022µF cap, you can parallel it with the 0.047 to approximate a 0.068.

Very true.  Going straight to the 0.047uF sounded just fine, though, and I now have 0.033uF for both coupling caps. (I'd been tentative on trimming bass and treble so far because I don't want to get a honky midrange out of it...)

QuoteI was going to mention that too, sorry I didn't work it in to my first reply; Yes, taking down the bass has the unfortunate perceptual side effect of lowering the gain.  You didn't actually lower the gain, just the part of your signal that was dominating the input, so now you have a better idea of what it sounds like with a more balanced frequency response.  If you're looking for Malcolm/Angus tones, it might be OK as it is, or maybe one more stage for a bit more chutzpah.

Good catch, I should know better than to say "gain" when I meant "distortion"!  :icon_wink:
"...the IMD products will multiply like bacteria..." -- teemuk

ThermionicScott

Quote from: Rob Strand on November 02, 2020, 01:54:57 AMI believe with 1k the power supply drops to about 5.5V and the clipping is more symmetrical (without losing the cmos softeness).    IIRC the Laney amps power from 5V as well.

Quote from: anotherjim on November 02, 2020, 11:31:24 AM
Beware of trying to emulate power supply sag. Inverters work backward. Nearly zero current when output hits a rail, maximum current when idle or signal passing thru zero-crossing. The IC power needs to be either well regulated or given a big bypass cap to keep the supply stable and free of signal frequency (it will be x2 signal frequency as it occurs on every peak).

Oh derp, I just noticed that instead of a 100-ohm resistor, I used a 10-ohm!  No wonder we weren't seeing much voltage drop between the battery and VDD (if I'm using the right term for that.)

I dropped in a 470-ohm resistor (after measuring it just to be sure), and now VDD is right about 6V.



Sound-wise, the blatty/raspy/ugly clipping character (wish I could think of better ways to describe it) seems to be about the same between the E, A, D, and G strings at this point, so I feel like the bass content is about right.
"...the IMD products will multiply like bacteria..." -- teemuk

Rob Strand

QuoteSound-wise, the blatty/raspy/ugly clipping character (wish I could think of better ways to describe it) seems to be about the same between the E, A, D, and G strings at this point, so I feel like the bass content is about right.

Maybe do the high-pass filtering first before you tweak the supply then.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ThermionicScott

Quote from: Rob Strand on November 02, 2020, 05:46:51 PM
QuoteSound-wise, the blatty/raspy/ugly clipping character (wish I could think of better ways to describe it) seems to be about the same between the E, A, D, and G strings at this point, so I feel like the bass content is about right.

Maybe do the high-pass filtering first before you tweak the supply then.

I'm sure you're right, but I'm having a tough time wrapping my head around doing this without making the sound too dark.  I hope these posts don't come across as argumentative!

I installed a free oscilloscope program to my phone, and it was interesting to see how many high harmonics were generated off a single low note, even with the tone on my guitar rolled off.  (No surprise to you folks, but I'm still coming up to speed.)  So I gather it's a matter of filtering out the really high harmonics whenever you can, but without killing too much definition and crunch...
"...the IMD products will multiply like bacteria..." -- teemuk

Rob Strand

#37
QuoteI hope these posts don't come across as argumentative!
Not even close.   Questions are good.

QuoteI'm sure you're right, but I'm having a tough time wrapping my head around doing this without making the sound too dark.
This comes up lot.  It's tricky and the tweaks are best done by experiment.   If you like the mid honky sound it's easy but trying to keep some transparency is where it requires some delicate tweaking.   Moreover, it often turns out nothing is perfect and you have to find the best compromise.    I've spent a whole day tweaking stuff only to come back the next day and go backwards.

(Based on the schematic in your first post)
You have the option to play with C3 and C4.

The high-pass cut-off for C4  is f3 = 1/(2*pi*C4 * 100k).   You might try something subtle like 100Hz, then C4 = 15nF, and keep most of the low cut at C3.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ThermionicScott

#38
I decided to make some big moves to the capacitors to see if that would force a noticeable change in the response:  0.015uF for the two coupling caps, and 500pF for the feedback loop capacitors.  The feedback resistors are still TSF/RL spec: 1M pot + 100k resistor at the first stage, 1M feedback resistor on the second stage.  Battery is holding at about 8.5V, VDD about 6V.

I took another video/sound clip:  https://imgur.com/BheOABW

Still not a lot of damage to bass response, and I can hear the high end rolling off a bit, finally.  But it still sounds buzzy to me with the gain all the way up.  :icon_frown:  So I think my next two experiments will be:

* add a low-gain inverter stage to the front and reduce the gain of the existing stages, then finally
* try a TL072 op-amp stage in front of the whole schmear to see what a clean boost does to the sound


P.S. I should mention that my guitar is a Rickenbacker 330 with single-coil pickups, so it's likely that I'm making this "nice distortion" goal even more of a challenge.  But that's the project.  :icon_cool:
"...the IMD products will multiply like bacteria..." -- teemuk

Rob Strand

QuoteBut it still sounds buzzy to me with the gain all the way up.  :icon_frown:  So I think my next two experiments will be:

The low-pass filters on the output are far more effective for getting rid of buzz when the thing clips.

The feedback caps control the highs more *before* it clips but once the 4049 clips the feedback is lost and the low-pass filtering of the feedback is lost.   The effect is it filters the clean tone more and the clipped tone less - the exactly opposite to what you want.  The separate low-pass filter is passive.  It always filters.   It filters the clipped signal as much as possible  so that means you use minimal filtering and have the least affect on the clean signal.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.