Audio Routing: Optocoupler VS relay

Started by burningman, March 10, 2009, 11:19:38 PM

Previous topic - Next topic

flo

#20
About FET switching: I see this being used a lot (for instance my J&H from Visual Sound) but my main concern is the signal distortion that they can introduce. I read that this distortion is related to the signal amplitude so as long as the amplitude is kept small, the distortion is also small. But how small does the amplitude need to be and how much distortion will occur? So I guess I'm looking for a graph of the Signal-Amplitude against Total-Harmonic-Distortion of a "typical" FET or a CMOS switch.
How much THD is acceptable (=unnoticed)? The "acceptable" THD figure is probably for the whole system (pedals amps speakers etc) so if a signal goes through many FET switches, this THD adds up. My Marshall 9001 preamp for instance has at least 4 switch points, each made with two discrete FETs so that's already 8 FET switches that the signal goes through.
(Hmmm ... this must have been discussed many times before ... I'll do a search)

R.G.

Quote from: oldschoolcharlie on March 14, 2009, 05:49:26 AM
Stay in the past.
I do. It's where I get my best technical information.  :icon_lol: It is ...very... hard to get info out of those books that haven't yet been printed.  :icon_wink:
Quote from: flo on March 14, 2009, 08:01:53 AM
About FET switching: I see this being used a lot (for instance my J&H from Visual Sound) but my main concern is the signal distortion that they can introduce. I read that this distortion is related to the signal amplitude so as long as the amplitude is kept small, the distortion is also small. But how small does the amplitude need to be and how much distortion will occur? So I guess I'm looking for a graph of the Signal-Amplitude against Total-Harmonic-Distortion of a "typical" FET or a CMOS switch.
How much THD is acceptable (=unnoticed)? The "acceptable" THD figure is probably for the whole system (pedals amps speakers etc) so if a signal goes through many FET switches, this THD adds up. My Marshall 9001 preamp for instance has at least 4 switch points, each made with two discrete FETs so that's already 8 FET switches that the signal goes through.
(Hmmm ... this must have been discussed many times before ... I'll do a search)

There are a lot of issues hidden in that.

First, you have to figure out whether you're talking single JFETs, single MOSFETs, JFET ICs or MOSFET ICs. They're all going to be different because the distortion mechanisms are different.

Single JFETs are a good place to start. A JFET with nothing connected to the gate is a piece of somewhat-conductive silicon - a resistor, at least for very small signals. The only way a JFET causes distortion of signal sent through its channel is when the signal either approaches the maximum current the JFET can pass (Idss) and the device starts limiting current, or else by the voltage drop along the channel from drain to source affecting the source-to-gate voltage, thereby making the JFET go into active operation and start distorting the signal. The Idss stuff is quite a bit of current for an audio signal at high impedances, so we'll ignore it for a while. The active operation is much more serious because effectively, the signal is causing the JFET to modulate the signal.

MIT has put a lot of its course lectures on line, and this one http://whites.sdsmt.edu/classes/ee322/class_notes/322Lecture31.pdf is a good explanation of this, with graphs. There is a region of the JFET characteristic where the JFET acts resistive, (the triode region) and this has a variable boundary. The trick to using a JFET switch is to keep the JFET either turned really, really off (Vgs>>Vgsoff) or as on as it can by by shorting the gate to the source. This lets you switch signals up to a volt or two dropped across the JFET. Since you can control the voltage dropped across the JFET by keeping the impedance it feeds very high, the trick with JFETs is to make it feed a load impedance that's very high compared to the on-resistance "rds", which is in turn tens to hundreds of ohms. So a load from hundreds of K upward keeps the distortion low. It's the amplitude of the signal dropped across the switch that makes distortion with a single JFET switch.

Single MOSFETs are similar, but the have the added problem that there is a parasitic substrate diode in parallel with the source-drain which will cause distortion even if the MOSFET is biased off; so you're fighting "how much signal can I put across a diode and not have it conduct". The general answer is on the order of 25mV of AC. In those ranges, MOSFETs can do signal switching well.

To correct the MOSFET's diode issues, if you build an IC you can connect the substrate diode to a voltage far away from the drain. In particular, the N-channel devices can have the diode's cathode connected up at V+ and the P-channel devices can have their diodes' anode connected down at V-. That means the diodes can't conduct until the signal gets to levels near the power supplies, so the diode distortions are effectively removed, and signal level is raised up to about the power supply. This is how all CMOS switches are made, in one elaboration or another.

With such large signal levels now open, we can see smaller distortions. There is a secondary effect of the signal modulating the channel itself too, just like in the single JFET, but it's complicated by the fact that there are two MOSFETs connected in parallel, and one conducts best near ground (the Nchannel) and the other (P channel) conducts best up near V+.  The channel resistance flatness is a kep parameter of CMIS switches, and is listed in the datasheets of all CMOS switches. This is the number where if you make the load resistance high, the current through the switch is kept low, and the variable channel resistance can't distort the signal very much. You control how much by (a) what CMOS device you pick and how well the maker controls channel resistance flatness and (b) how big a resistance the CMOS drives, which keeps the current in the switch low.

Give that background, you're out of luck. You won't find a graph of signal level versus distortion for a typical switch, not least because there's not a typical switch. However, if you keep the current through the switch low by only allowing it to drive a high impedance (like, say a 1M resistor) then any distortion it generates is kept small.

How small? We can bound that by taking a look at the resistances. Say that our switch, JFET or CMOS, has an on-resistance of 400 ohms. This is probably higher than you'll run into. Let's also say it varies by 50%, which is grossly larger than it actually will as long as you don't run the JFET into the active region and don't run the CMOS near the power supplies. Into a 1K load, the current into the load is bounded by the voltage divided by either 1K+500 ohms or 1K+300 ohms, 1500 ohms in one case and 1300 in the other. The voltage seen by the load is 1k/(1.5K) one way and 1K/(1.3K) the other. So the voltage proportionately varies in the ratio of 0.667 to 0.769, or 1.153. That is, the voltage as seen at the load can vary about 15% from being an accurate (no distortion) replica of the input. If instead we use the same FETs and run them into a 1M load, the same numbers come out to about 0.0002%. So the variance in the signal due to switch nonlinearity is down in the golden-ears category.

How much is audible? It depends on the distortion. Up to about 2% of pure second harmonic on a pure tone may be inaudible. The hifi tweakos swear they can hear differences between audio signal depending on the oxygen content of the copper wire the signals go through. I have proven to myself that with my old, abused ears I can't hear less than about 0.05% for certain. You ears may be better; in fact, this is more a test for ears than for switches.

The trick with FET switching is to use the huge off-resistance to truly cut off a voltage-only signal to a high-ish impedance of 100K on up. The FET distortion becomes trivial then. Alternatively, you can use FETS to switch currents as long as the signal providing the current has a much higher source impedance (i.e. is a good current source) than the variation in the switch on-resistance for the FETs.

How badly did that confuse thing?
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

flo

That reply clarifies a lot about the FET and its distortion. Thanks for taking the effort!

cheezit

R. G., it's clear that this topic involves actual engineering (rather than poking clipping diodes into circuits to see what happens  :)).  So for stuff like that, I always look around for DIY cookbook examples.  And there are three that I know of:
- the GEOFEX articles on the CD4053
- the Tone God articles on the Wicked Switch.  (same basic approach as the GEOFEX article)
- the relay driver circuits on GEOFEX, plus relay driver curcuits aren't hard to find

So that covers CMOS and relay, but there you listed some other options: optocoupler, FET and MOSFET.  (noob question: does CMOS count as MOSFET?)  Setting aside optocoupler, do you know of any cookbook examples of the other two?

Boy, if someone came up with a well-designed small daughterboard PCB for electronic switching---perhaps a biased version of the wicked switch---i'd buy it!