Someone explain CMOS inverters in linear mode

Started by merlinb, November 10, 2010, 12:29:57 PM

Previous topic - Next topic

merlinb

Can someone explain how it is possible use CMOS inverters as if they were opamps? It really confuddles me! For example, the MXR Envelope Filter:
http://www.tonepad.com/getFile.asp?id=113

I mean, they're supposed to be digital gates, right? They flip their outputs at the first sign of any input. So how are they being used in the MXR? Are they being used as linear amplifiers at all, or am I missing something?
And why use them, rather than opamps? Just because you have fewer pins to deal with?

Lurco

#1
Somewhere there is an application note http://www.fairchildsemi.com/an/AN/AN-88.pdf and a treaty from Ray Marston http://gaussmarkov.net/docs/nuts_n_volts/fetjul.pdf and among others there was a large thread http://www.diystompboxes.com/smfforum/index.php?topic=59383.0

brett

Hi
although I'm no expert, I'll have a go at a simple explanation.
Un-buffered inverters have a wide voltage difference between their "on" state and their "off" state.  For a 9V supply, they may be on (output = 9V) up to 4.4V input.  Above 4.6V, they might be off (output = 0V).  We use the voltages in between.  Note that for a small voltage change at the input (4.4 to 4.6V), there's a large, inverse change in output (9V to 0V).  If the input voltage is kept in a limited range, they are inverting amplifiers.  If the voltage goes outside this range, there is no extra response - they clip the signal - and theat's why they make excellent distortion devices (Tube-sound Fuzz, Red Llama etc).

PS check out the Vin Vs Vout graph in the datasheet.  It shows this effect.
cheers 
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

jasperoosthoek

Consider an opamp with the non-inverting input biased at half the supply voltage. The inverting input is now basically an inverter! Furthermore, an inverter is nothing more than an inverting amplifier with a large gain (30 to 50), albeit not as large as an opamp (say 300000).

Many circuits such as integrating amplifier and more have the non-inverting input tied 'rigidly' to half the supply voltage, usually called Vb(ias). In all these circuits the opamp can in principle be replaced with an inverter.

That's also why not any old inverter can be used. The ones with Schmitt triggers are truly digital and don't work at all. But if you look at the datasheet of the CD4049/69 you can see that it's just two complementary FET transistors. Nothing more than a little high gain amp.

The benefit of an inverter is that its own distortion and clipping sounds nice, quite unlike an opamp. Opamps have too much gain which makes the edges of the clipped signal very sharp. They don't distort and then all of a sudden there is some nasty fizz.
[DIYStompbox user name]@hotmail.com

merlinb

Thanks for the pointers!

SO is there a particular reason why they always seem to be used with enormous values of feedback/input resistor? (Like several megohms). Surely you could come down to a few tens of k-ohms, for less noise?

jasperoosthoek

That's simply because the output impedance of the inverter is very high. So it cannot drive loads much lower than 100kOhms. The feedback resistor from the output to the input is also basically a load. The input will always be kept at around half the supply voltage as the output swings up and down. So basically the input side of the feedback resistor is 'grounded' as seen by the output. For a more exact description you should dive into feedback theory (get a good electronics book).

Then if you add a second inverter stage after the first with a gain of 10 (100k resistor to the input and 1Meg resistor between input and output of the second stage) the first stage has to load the 100k input resistor of the second stage. To get some gain the feedback resistor of the second stage has to be 1Meg. Furthermore, inverters have a huge input resistance and therefore work quite well with large feedback resistors.

[DIYStompbox user name]@hotmail.com

WGTP

http://www.aronnelson.com/gallery/main.php/v/WGTP/CMOSerizer.gif.html?g2_imageViewsIndex=1

I don't understand all this stuff, but they can be abused in a variety of ways for some great distortion.   :icon_cool:
Stomping Out Sparks & Flames

Manny

I've wondered this for some time too.
Thanks for the explanation Jasper!  :)

WGTP

Somewhere, somebody indicated the input impedance for an inverter was 150K.  ;)
Stomping Out Sparks & Flames

jasperoosthoek

It should be in the order of the gigaohms wiith a few pFs connected to the output.
[DIYStompbox user name]@hotmail.com

PRR

Imagine one N-type MOS transistor with a "plate" (drain) resistor to a positive supply. Bias it actively, it can be an amplifier.

Imagine one P-type MOS transistor with a "plate" (drain) resistor to a negative supply. Bias it actively, it can be an amplifier.

Where do we set the gate for "biased actively"? For these MOS parts, 3V to 7V from the source in the direction of drain.

So if we put one N-type and one P-type together, with a 6V to 14V supply, both gates can bias at the same voltage, about halfway between the rails. Gain is approximately Mu which in pentode fashion tends to be 100-500.

If bias is applied by magic, we have very high voltage gain, high current gain (near infinite at DC, declining with frequency due to gate capacitances), and only two low-cost parts (or six such amps in a sub-$1 chip). Simple! Cheap!

Near-magic bias is just a feedback resistor, another 12 cents.

Gain is very very variable, and usually more than we want. Another 12 cents to set the gain.

Resistor hiss-noise is a non-issue: the MOS transistor self-noise is several/many microVolts, more than a 1Meg resistance.

Input impedance is often an issue. If you want gain of 30 and a 10K feedback resistor, you want a 330 ohm input resistor and have a nearly 330 ohm input impedance. That's awful low. In fact a CMOS amp won't drive 300 ohms well.

(Although, at 10V-15V supply, you hardly have open-loop gain of 30 so you can't really NFB-define a gain of 30 without cascading.)

OTOH with 1Meg feedback we get 33K input resistance, managable in many audio systems. For guitar we like over 100K, and 150K is popular. If we wanted gain of 30 (in this case maybe not) then the NFB computes to 4.5Meg. There's no realistic upper limit on the NFB resistor: CMOS gate current is VERY low, and in this case there's some gate current cancellation.

> it cannot drive loads much lower than 100kOhms.

No, it can drive well under 10K. Depending how good it has to be. 12 or 24 simple inverters (two to four 30-cent DIPs) parallel can drive 32 ohm headphones OK, if you cascade two more in front to build-up gain so you can NFB-away the heavy-load nonlinearity.

> inverters have a huge input resistance and therefore work quite well with large feedback resistors.

Yes, very true.

Cascading three stages gives huge gain but is a classic NFB-stability problem. If NFB network were really low impedance, the triple-pole Bode plot is sure to oscillate in the upper audio band. Fairchild's Fig 6 shows a 0.9Meg NFB impedance, which I assume (I never calculated) with gate capacitance adds a low-pole at the input which dominates the phase plot.

Another aspect is that the gain falls "badly" as the output approaches a rail. If worked nearly open-loop it "soft clips". However the open-loop gain is so high, and the output so limited, that we can rarely work this way. (Hasn't stopped us from trying.)

Assuming gain of 30, 30 microvolts input hiss, we have near 1 milliVolt hiss at the output. The linear range for 10V supply is hardly 6V p-p, 2V RMS. The output signal/noise is no better than 66dB. A classic Fender 12AX7 stage has 2uV hiss, gain of 50, 25V output, 86dB S/N. 20+dB lower input hiss and 17dB higher input headroom.

It's a cute trick with some SERIOUS limitations. High hiss. Lowish input impedance. Its main virtue is that it is very cheap, essentially free if you already have a part-CMOS chip in the machine.
  • SUPPORTER

stringsthings

here's an extremely cool distortion/overdrive circuit using CMOS inverters:

http://www.runoffgroove.com/doubled.html

IMO, the rhythm channel (jiggle) gives one of the better amp-like tones of all the DIY circuits i've had the pleasure of building .... and the IC is available and inexpensive ...

secret #76: if you accidentally fry one of those 4049s with static electricity, it will make an excellent stocking stuffer for that oh-so-hard-to-please EE on your xmas list !  :icon_mrgreen:  ... OTOH, it does not, i repeat, make a good valentine's gift !  ;D ( unless something shiny and expensive is attached ! )