New CMOS design, help much appreciated

Started by earthtonesaudio, May 04, 2008, 09:50:09 PM

Previous topic - Next topic

earthtonesaudio

I think I've hit a ceiling due to unshielded input/output wiring.  My limit for high gain (greater than 4x gain) stages is 3 without interstage negative feedback.  I'll have to redesign my prototyping board to accommodate shielded signal leads. 

However, I find it interesting that I can use all 6 stages with tolerable amounts of noise as long as they're not all high gain. 

Another interesting observation: I had a setup with an input buffer, some odd number of gain stages and then an output mixer, and noticed that using a cap for negative feedback around the gain stages also passed unaffected highs through to the output mixer.  Kinda like having a clean blend...  It isn't what I'm going for with this project, but could be useful for something else.

gez

Quote from: WGTP on May 08, 2008, 10:03:28 AMThe additional compressorator stage(s) have added a new element to the possible designs.   All the recorded guitars we hear have compression after the distortions stages.  6 inverters may not be enough.   :icon_cool:

The compression isn't really the same.  Compression pedals/FX even out amplitude over time, whereas Brett's idea instantly starts to reduce the size of an AC signal as it increases in voltage (in either direction). 
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

brett

Thanks Gez.
That's right.  The "inverter-compressor" relies on linear and non-linear responses in the inverter to "depress" the sides and especially the "top" of *every* excursion in the signal.  In this respect it seems to be similar to valve amp compression.  It doesn't "turn the volume down" for a while during louder notes, which is the method used by most compressors.
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

WGTP

I tried the "stage" this weekend, and it worked as reported.  Thanks for the tip.

Question:  When connecting 2 inverters together with only a cap, what impedance value would be used to calculate the gain of the second inverter or the roll off of the cap?  Thanks again.   :icon_cool:
Stomping Out Sparks & Flames

earthtonesaudio

Quote from: WGTP on May 12, 2008, 12:29:55 PM
Question:  When connecting 2 inverters together with only a cap, what impedance value would be used to calculate the gain of the second inverter or the roll off of the cap?  Thanks again.   :icon_cool:

Well, you could calculate the impedance of the capacitor at whatever frequency you're interested in, but you probably know that it's very large at low/DC frequencies, and very small at higher frequencies.   And if there's any negative (resistive) feedback I think it adds to the impedance value (whether in series or parallel, I'm not sure).

And by the way, the cap going in with a resistor in the feedback loop is the circuit for a differentiator, if that helps.

(edit): found it:
Input Z... Zin=1/(j*w*Cin) (if "w" = lowercase omega)
Gain equation is the same: gain = Zf/Zin ...or the feedback resistor divided by input Z.
Link: http://images.google.com/imgres?imgurl=http://www.nhn.ou.edu/~bumm/ELAB/Lect_Notes/Op_Amps_v1_2_1_files/image055.jpg&imgrefurl=http://www.nhn.ou.edu/~bumm/ELAB/Lect_Notes/Op_Amps_v1_2_1.html&h=172&w=298&sz=6&hl=en&start=1&um=1&tbnid=dxEYFtDRuD4G6M:&tbnh=67&tbnw=116&prev=/images%3Fq%3Ddifferentiator%2Bimpedance%26um%3D1%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DG

earthtonesaudio

Quote from: WGTP on May 12, 2008, 12:29:55 PM
I tried the "stage" this weekend, and it worked as reported.  Thanks for the tip.

Did you take any measurements?  I have yet to dig my scope out of the closet and do it myself... :)

gez

#26
Quote from: WGTP on May 12, 2008, 12:29:55 PM
Question:  When connecting 2 inverters together with only a cap, what impedance value would be used to calculate the gain of the second inverter or the roll off of the cap? 

As a rule of thumb, the input impedance of the 2nd stage is determined by its input resistor in conjunction with the coupling cap.  In practice, the feedback resistor of the second inverter has some impedance too, but for back-of-envelope calculations it can be ignored.  Cut off determined by the usual formula: 1/(2 X pi X R X C).  End results will be slightly out-of-whack (inverter output impedance is also in series with the feedback resistor's effective resistance), so tweak to compensate.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

WGTP

Thanks for the answers, but that is my question.  What is R if there is only a capacitor between the 2 stages and no resistor? 

Also, would using an even number of stages be more likely to oscillate since the output will be in-phase with the input, rather than out-of-phase with an odd number of stages?  Thanks again.   :icon_cool:
Stomping Out Sparks & Flames

gez

#28
Quote from: WGTP on May 14, 2008, 09:40:16 AM
Thanks for the answers, but that is my question.  What is R if there is only a capacitor between the 2 stages and no resistor? 

Oh, I see.  In that case you have to take into consideration the effective resistance of the feedback resistor.  Assuming AC feedback hasn't been decoupled, it can be pretty low.  I'm going by memory here, but if I recall AC feedback 'magnifies' the amount of current that flows through the feedback resistor so it behaves as though it were much smaller

If you think of a small signal raising the voltage on an inverting amp's input (with no input resistor, that is) by a few millivolts, you'd expect only a slight current to flow through any large-value bias/feedback resistor (say 1M) as only a slight potential difference occurs across said resistor.  However, the output is an amplified version of the input signal and the output will swing in the other direction until the original voltage change at the input is 'neutralised'.  In practice, this is instant and a negative earth/ground effect is achieved at the input (it doesn't shift a jot, only the output does).  As there's now a large potential difference between the input and output (probably a few volts: all depends on the open-loop and closed-loop gain of the amp), substantially more current is going to flow than was at first expected.  It's as if the feedback resistor were much smaller, and all due to negative feedback.

Now I'm really going by memory (years since I did all this)!  You should be able to find a mathematical analysis of an inverting amp model online or in a text book.  After a lot of tedious maths you'll end up with the equation for input resistance/impedance.  As a rule of thumb, the feedback resistor's value is effectively reduced by the open-loop-gain of the amplifier (divide the resistor value by gain).  In an op-amp, this means that effective resistance is practically 0 ohms as gain is so high.  Not so in an inverter, however, where gain is comparatively low.

How to calculate open loop gain?  Set up a circuit, decouple feedback, take empirical measurements.  That's basically how it's done in data-sheets (or was done).  Said data sheets may, or may not, tally with your findings, which is why I tend not to trust their figures (when it comes to CMOS amps).  Problem is that gain will vary from chip-to-chip.  Also, different supply voltages will produce different open-loop gains from the same device/chip.  Not only that, but what size is you test signal?  It makes a difference.  Onset of compression/distortion is quick when it comes to inverters.  Once the output swings past a certain level compression kicks in.  So, for small signals, there might well be gains of 20 (as quoted in data sheets) at 9V.  However, if the input signal is in the magnitude of volts, you might see attenuation of the signal if it compresses it to an amplitude a volt or two short of the rails.  Another thing to consider is that as distortion sets in, feedback is lost.  The impedance/effective resistance of the feedback resistor starts to shoot up again.

In short.  Stick a cap in there, see how it sounds, tweak to taste.   :icon_lol:
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

gez

Quote from: WGTP on May 14, 2008, 09:40:16 AMAlso, would using an even number of stages be more likely to oscillate since the output will be in-phase with the input, rather than out-of-phase with an odd number of stages?  Thanks again.   :icon_cool:

Excuse the delay in answering your second question (had to prepare this evenings meal).

Once you have three or more stages then it's possible to get a 180 degree shift due to a 60 degree phase shift in each stage.  That assumes that each stage has the same components/set-up.  Different cap and resistor values will probably mean one stage will be providing more shift than another.  Either way, at some frequency it's possible to get a 180 degree phase shift throughout a three stage amp.  Feed this back to the input, either intentionally (feedback resistor), or unintentionally (stray capacitance/bad layout/whatever), and it's possible to get oscillation if closed-loop gain is set high enough.  So, having an odd number of stages isn't any guarantee that your circuit won't oscillate. 

If you do experience this problem in a design, all you can do is keep gain at a moderate/low level in each stage and hope for the best.  Basically, see what you can get away with.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

WGTP

Thanks Gez.  It looks like fairly large caps need to be used between stages to keep from getting a lot of low end roll off. 

It seems that using smaller resistors between stages and in the feeback loop in a 1:10 ratio (10k between and 100k in the fbl) results in more treble contient than the same ratio (100k between and 1M in the fbl).  Is that my imagination?   :icon_cool:
Stomping Out Sparks & Flames

gez

#31
Quote from: WGTP on May 14, 2008, 04:44:13 PM
It looks like fairly large caps need to be used between stages to keep from getting a lot of low end roll off. 

As a rule of thumb, you could use the figures quoted in data sheets to give you some idea of the effective resistance of the feedback resistor.  Page 6 shows a little chart of voltage gain vs supply:

http://www.matrixrunner.net/pdf/hef4069.pdf

At 9V it's around 25.  OK, not a 4049 chip (not sure I've ever seen stats for that one), but similar.  Divide the feedback resistor by 25 (though the formula might be Av + 1, in which case divide by 26...best to check that one online somewhere as I'm a little hazy on all this) and use that as 'R' in the standard formula used to calculate roll off.  Not an exact science, for reasons explained in my previous post, but it helps get you in the right area.  Actually, it'll probably be miles off, but would be interested to hear what your finding are.  :icon_smile:


QuoteIt seems that using smaller resistors between stages and in the feeback loop in a 1:10 ratio (10k between and 100k in the fbl) results in more treble contient than the same ratio (100k between and 1M in the fbl).  Is that my imagination? 

Although the figure might be slightly different from manufacturer to manufacturer, according to the data sheet I'm looking at now the max gate/input capacitance of each inverter is only 20pF for the 4049.  So, it shouldn't make much difference.  There might be something I've overlooked.  I'll sleep on it...
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

earthtonesaudio

Don't know about treble bleed, but lower value resistors means less thermal noise.

+1 to Gez's comments.  3 stages does not guarantee zero oscillations. 

I'm using a breadboard, and my in/out leads are unshielded, plus they're pretty close together at the bypass switch (not sure how you'd get around that problem).  So my setup is perfect for magnifying oscillations and feedback.  The most distortion I can get out of 3+ stages without squealing is somewhere around "maxed out tube screamer."

I've been approaching this process with the goal of getting a little distortion out of many stages, adding up to a lot of distortion.  I think a good test would be to get a "high gain distortion/fuzz" sound from 2 stages, then replicate that sound as precisely as possible from 4 (or 6!) stages.  Then repeat the process for a "medium distortion/overdrive" tone.  That would let you get a feel for noise vs. tone for the cascaded stages.

Next step for me is shielded signal leads though.  Gotta tame the squeals.

Thanks to everyone for sharing what you know!  Inverters aren't "supposed" to be used this way, so this knowledge is hard to find!

gez

Quote from: gez on May 14, 2008, 06:20:00 PMDivide the feedback resistor by 25 (though the formula might be Av + 1, in which case divide by 26...best to check that one online somewhere as I'm a little hazy on all this)

Yes, it would be 26:

http://wiki.answers.com/Q/Input_impedance_of_current_shunt_feedback_amplifier

Google "shunt feedback amplifier" and you'll probably find a mathematical analysis (if that's what you want).  Even though I can follow a lot of the maths when it comes to basic analysis, it often doesn't tell you much (they usually prove a phenomenon rather than explain it), so I prefer to take the big-picture/intuitive approach and try to figure out just where the hell electrons are flowing, and why!
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

Mark Hammer

Not to be a wet blanket, but I seem to recall a discussion involving Jack Orman and RG some years back that had 3 overdrive stages as the point of diminishing returns.  Or rather, 3 stages as the point of maximum returns and everything after that as diminishing returns.  Not a hard and fast rule, mind you, but a consideration that bears considering.

earthtonesaudio

Quote from: Mark Hammer on May 14, 2008, 07:54:00 PM
Not to be a wet blanket, but I seem to recall a discussion involving Jack Orman and RG some years back that had 3 overdrive stages as the point of diminishing returns.  Or rather, 3 stages as the point of maximum returns and everything after that as diminishing returns.  Not a hard and fast rule, mind you, but a consideration that bears considering.

Because I'm so contrary, the first thing I thought of was: rangemaster into fuzz face into cranked tube amp.  At the very least that's 4 gain stages, all exhibiting some distortion/overdrive.  I've never had any of these things (unless a tube mic pre counts), but still, I have heard that they should sound good together.

Uh... Unless the discussion you're referring to was about CMOS based distortions (which it probably is... in which case sorry for the above comment).  :)


But pedals like the BSIAB and others have 3, 4, and more stages cascaded... I don't really know if that makes them better or not.  Is this point of diminishing returns in the subjective "tone" terms or in something more objective like signal to noise ratio?


gez

#36
Quote from: gez on May 14, 2008, 11:46:42 AM

If you think of a small signal raising the voltage on an inverting amp's input (with no input resistor, that is) by a few millivolts, you'd expect only a slight current to flow through any large-value bias/feedback resistor (say 1M) as only a slight potential difference occurs across said resistor.  However, the output is an amplified version of the input signal and the output will swing in the other direction until the original voltage change at the input is 'neutralised'.  In practice, this is instant and a negative earth/ground effect is achieved at the input (it doesn't shift a jot, only the output does).  As there's now a large potential difference between the input and output (probably a few volts: all depends on the open-loop and closed-loop gain of the amp), substantially more current is going to flow than was at first expected.  It's as if the feedback resistor were much smaller, and all due to negative feedback.

I was getting a bit muddled there and forgetting that there's no input resistor (mixing my models!)  In the shunt-feedback model only open-loop gain would enter the equation.  Having thought about this a little, I don't think there would be a virtual earth effect either if gain is only moderate and not ideal ("infinite"), and assuming the AC generator is ideal (can source infinite current).  That would account for the Av + 1 bit of the input resistance equation.  If gain is, say, 100 and you have a 10mV swing positive then output swing is 1V in the other direction.  The input is still 10mV above the input's quiescent position, though, so total voltage drop across the feedback resistor is now 1.01V, or 101 times the original input signal.  In other words Av + 1 times bigger.

The voltage drop across the feeback resistor is much larger than the initial 10mV, so the resultant flow of current is much greater than origionally anticipated.  Av + 1 times larger (use ohms law to do the calculation).  Seen from the input's point of view, then, it's as if the feedback resistor were much smaller.  Av + 1 times smaller.

In practice, CMOS inverters aren't ideal: they have high output impedance.  The above is only a model, so the equation for calculating cut off is going to be slightly out.

Well, that's my take on it.  Buyer beware...
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

WGTP

From my limited experience with the 4049, I'm thinking the 3 stage deal referrers to S/N ratio, oscillation, etc.  I'm pretty sure R.G. Jack, Mark, etc. would have no problems using more stages if the gain in tone vs. problems warrented it.  I'm not having much luck using 4 stages of gain and distortion before the down side sets in quickly.  Might be less of a problem if it wasn't on a breadboard sitting on top my amp with no shielding.  Using the 3 stages of gain with the compresOverter stage is promising at this point.  On to the EQ.   

Thanks again for all the explainations.  :icon_cool:
Stomping Out Sparks & Flames

earthtonesaudio

WGTP, if you check out the 4-stage circuit on the previous page, you'll notice the absence of coupling caps.  I've found that using a resistor to couple instead of a cap is sorta like using a really large value cap.  Caps smaller than .1uF start cutting bass in a noticeable way. 

The gain of each stage is low-ish (x10) and the noise is not bad at all using a regulated supply.  Also no oscillations/feedback.

Another trick for cutting down on squealing is to use neg. feedback from stage 3 to stage 1 or something similar.  Helps a little bit; not a cure-all.

WGTP

#39
I new that, but forgot about it and didn't think of it in terms of being like a large cap.  The other night I realized I had left out a cap in a cap/resistor combination.  I guess you can do it all the way thru to the end and only use caps at input and output.  I think first stage in the design only has a gain of X2.  My first stage is like the 22/7th's.  I guess that could be why 4 stages are giving me trouble.  I use a smaller cap to ground for bass reduction.  Back to the breadbaord.   :icon_cool:
Stomping Out Sparks & Flames