Discrete MOSFET switching - too good to be true?

Started by mzy12, October 22, 2024, 04:40:23 PM

Previous topic - Next topic

mzy12

Looking for a good solution to switching many contacts at once for a reasonable price, I have come across the method for using discrete MOSFETs for switching, as seen in this website.

In Douglas Self's book (which I am thoroughly devouring right now in case you haven't read my other posts :P), he also describes the same method of using two N-Channel FETs as a series switch and gives impressive THD results regarding the configuration. It can also accommodate both stand and elevated voltage rails and doesn't seem to require a DC path from the previous stage to work properly. Am I missing something or is this the best, cheap way to switch analogue signals?

stonerbox

#1
It's an excellent way of switching analog signals. I have mostly gone with JFETs for mine.
There is nothing more to be said or to be done tonight, so hand me over my violin and let us try to forget for half an hour the miserable weather and the still more miserable ways of our fellowmen. - Holmes

mzy12

Should I be worried about the max VGS parameter? e.g. If I turn gate on at +15V (for convenience sake) and an AC signal passes through the MOSFET that is 30 volt peak to peak, would that exceed a max stated VGS of +/-20V? I imagine those ratings are for DC but the datasheets don't say lol.

R.G.

You should at least give it a thought. A MOSFET gate is separated from the channel by a layer of glass 15-20V thick. More than that, the glass can punch through, ruining the MOSFET.

The trick in using MOSFET switches seems to be either making sure the gate to channel voltage doesn't exceed the spec if you're using a single MOSFET, or to use two MOSFETs source-to-source and float the common gate signals on the sources in the middle. There are chips that do this, either photovoltaicly or by other some other isolated coupling. Toshiba makes a whole range of photo-relays that have an LED on one side for control and two source-to-source MOSFETs on the other to do the specific task. See Toshiba's TLP series at Mouser. They're intended for power switching, but they do audio switching just fine.
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.

Rob Strand

Last year there was this thread, which highlighted the potential for issues with those MOSFET switches with large signal swings.   The problem is difficult to see but is clearly present from measurements on the real circuit,
https://www.diystompboxes.com/smfforum/index.php?topic=130975.msg1272113#msg1272113

The question is does the coupling caps on each side of the switch and the addition of the grounded resistor between the MOSFETs help?   It needs to be checked.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

mzy12

Quote from: R.G. on October 23, 2024, 12:28:21 PMThe trick in using MOSFET switches seems to be either making sure the gate to channel voltage doesn't exceed the spec if you're using a single MOSFET, or to use two MOSFETs source-to-source and float the common gate signals on the sources in the middle.
That makes sense, but after doing more thinking (and fitting the configuration into a pedal schematic), the problem there is that sometimes the resistance between the common source and drive signal attached to the gates (i.e. the thing that 'tells' the MOSFETS to turn on or off) is a bit of a pain to deal with - I'll get onto how I'm driving the FETs when I respond to Rob's post in a bit.

Or, I need the signal I'm switching to to be DC coupled to the preceding or the following parts of the circuit (think switching between different transistors in a FOXX Tone Machine as a bit of a cursed example - yes that is very silly and yes I am designing it as we speak).

Quote from: Rob Strand on October 23, 2024, 02:36:34 PMLast year there was this thread, which highlighted the potential for issues with those MOSFET switches with large signal swings.
I plan on powering the MOSFETs with +/-24V. Yes that is a bit unrealistic for most pedals, but I am planning on building my own pedal power supply that derives its voltages from a medium-high voltage off the shelf smps and multi-pin DIN connector - that's neither here nor there.

Quote from: Rob Strand on October 23, 2024, 02:36:34 PMThe question is does the coupling caps on each side of the switch and the addition of the grounded resistor between the MOSFETs help?   It needs to be checked.

This schematic taken from Douglas Self's Small Signal Audio Design has a source-gate resistor that connects to the 'control voltage' and not ground. I'm assuming the expectation here is that there are coupling caps on either side of this circuit, as you are connecting the signal to +/-18V here, depending on the state of the BJT (i.e. whether the MOSFETs are conducting or not).




Though this does raise the question, for me at least, of how this even works as a switch. If the signal is swinging around +/-18V, surely that means it could be turning either MOSFET on/off? If the signal was grounded and the rest of the circuit only ran on, say, +/-9V, you have, at worst, 9V of headroom either direction with which to turn off/on the MOSFETs. If it was sitting on the same control voltage as the MOSFET, the signal swing could easily toggle the on-state by itself. Maybe I'm looking at this wrong.

I think my solution is genuinely to build a discrete CMOS switch. I don't think those have to be de-coupled with caps and they're cheaper than a good CMOS switch like the DG411. Only thing is, I can't find any good examples of someone building them online, no matter how hard I search for one :P


R.G.

Quote from: mzy12 on October 27, 2024, 12:27:38 PMThis schematic taken from Douglas Self's Small Signal Audio Design has a source-gate resistor that connects to the 'control voltage' and not ground. I'm assuming the expectation here is that there are coupling caps on either side of this circuit, as you are connecting the signal to +/-18V here, depending on the state of the BJT (i.e. whether the MOSFETs are conducting or not).
I believe that the expectation in Self's circuit is that the signal is referenced to ground, and swings +/- mostly symmetrically; further, that it's less than about +/- 12 to 15V peak. Why is below.

[/quote]
Though this does raise the question, for me at least, of how this even works as a switch. If the signal is swinging around +/-18V, surely that means it could be turning either MOSFET on/off? If the signal was grounded and the rest of the circuit only ran on, say, +/-9V, you have, at worst, 9V of headroom either direction with which to turn off/on the MOSFETs. If it was sitting on the same control voltage as the MOSFET, the signal swing could easily toggle the on-state by itself. Maybe I'm looking at this wrong.
[/quote]
I think the idea is that the gates are pulled way, way negative to turn the switch off, and let relax to +18V through R1 to turn the gate on.

MOSFETs are turned on and off depending on the gate voltage relative to the source terminal. They are off (for enhancement mode MOSFETs, the vast majority) when the gate-to-source voltage is less than the threshold voltage ( plus one to a few volts for N-channel, enhancement devices like the 2N7000 Self uses for example). Raising the gate to more than a few volts positive with respect to the source turns them on, and the channel drops to a low resistance.

The issue with source-to-source switches is that the sources are flying around at signal level. A simple gate-to-source resistor turns the MOSFETs off/non-conducting when nothing is messing with the gates. But if you want to turn the MOSFETs on, you have to actively pull the gates more positive (for N-ch, enhancement) than the sources, no matter where the sources happen to be. When the gate-to-source voltage gets less than the threshold voltage, the MOSFET turns off.

Self's circuit uses a sledgehammer drive. It yanks the gates to -18V with the bipolar, which turns the MOSFETs off for all signals of less magnitude than -21V or so. Unless something pulls the sources below the gates' -18V, neither MOSFET conducts. When the bipolar is turned off, the gates are pulled up to +18V, and the MOSFETs start conducting, and the sources now ride along with the signal voltage from the signal negative peaks to the positive peaks. As long as the signal never gets within a threshold voltage of +18V, the MOSFETs stay on.

A more complex but robust technique is to make the gate-to-source voltage ride along with the sources at whatever voltage they rest - a floating gate-source drive voltage. There are a couple of ways to do this. One is to make a transformer-isolated DC supply that has one terminal tied to the sources, and the (floating) driver tied to the gates. The floating supply and driver can follow the sources and turn on/off any amount of voltages on the drains. This is how mains-rated SSRs turn on mains voltages with just an LED drive. They're usually photovoltaic.

There are two other ways to make floating drivers. One is an RF transformer chip that converts a DC logic signal to RF, and uses a microscopic RF transformer to make a drive on/off voltage on the gate-sources. There is another that uses capacitors to couple across an RF signal to make a DC gate drive signal.

These tricks all make a floating gate on/off signal that pulls the gates to above the threshold voltage in spite of the sources going to some arbitrarily high/low signal voltage.

QuoteI think my solution is genuinely to build a discrete CMOS switch. I don't think those have to be de-coupled with caps and they're cheaper than a good CMOS switch like the DG411. Only thing is, I can't find any good examples of someone building them online, no matter how hard I search for one :P

I strongly urge you to look into whether you can use a CD4000 style CMOS switch chip. If you can live with the +/-7.5V signal size, they (reliably) cure many issues you will run into with a roll-your-own CMOS switch. CMOS, as opposed to the source-to-source MOSFET switches, has some issues with matching the P-channel and N-channel devices that make up the switch, and with drive voltages as well. It can be difficult to keep the control signal from coupling through to the FET channels unless you slow it waaaaay down. There are also issues with P to N type matching channel resistances and other secondary effects.
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.

R.G.

You know, it might be that a decent compromise could be using something like the Panasonic AQY280EH costs less than $1 in tens, will switch 350V with a 5ma LED current. It's certainly less complicated than discretes for something that's probably not the major focus of whatever you're doing.

Well, unless what you're doing is entirely the switching, and you just want to be able to claim no ICs inside. Or other.
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.

PRR

> Self's circuit uses a sledgehammer drive.

Sledgehammer is sometimes the right tool.

Self works a lot on "desk consoles" as big as a truck, hundreds of switches. Yes he could put a power-pack on each switch, but there is always a next customer who needs it done for less. The electrons won't stand around appreciating your circuit elegance.
  • SUPPORTER

Rob Strand

#9
Quote from: mzy12 on October 27, 2024, 12:27:38 PMI plan on powering the MOSFETs with +/-24V. Yes that is a bit unrealistic for most pedals, but I am planning on building my own pedal power supply that derives its voltages from a medium-high voltage off the shelf smps and multi-pin DIN connector - that's neither here nor there.

There's many more issues which need addressing before we even get there!

Quote from: mzy12 on October 27, 2024, 12:27:38 PMhis schematic taken from Douglas Self's Small Signal Audio Design has a source-gate resistor that connects to the 'control voltage' and not ground. I'm assuming the expectation here is that there are coupling caps on either side of this circuit, as you are connecting the signal to +/-18V here, depending on the state of the BJT (i.e. whether the MOSFETs are conducting or not).




Though this does raise the question, for me at least, of how this even works as a switch. If the signal is swinging around +/-18V, surely that means it could be turning either MOSFET on/off? If the signal was grounded and the rest of the circuit only ran on, say, +/-9V, you have, at worst, 9V of headroom either direction with which to turn off/on the MOSFETs. If it was sitting on the same control voltage as the MOSFET, the signal swing could easily toggle the on-state by itself. Maybe I'm looking at this wrong.

I think my solution is genuinely to build a discrete CMOS switch. I don't think those have to be de-coupled with caps and they're cheaper than a good CMOS switch like the DG411. Only thing is, I can't find any good examples of someone building them online, no matter how hard I search for on

As drawn it's ambiguous that the circuit can be switched on.   A special requirement is needed in that there must be a DC path to ground on the input.   If you have a series cap on the input that means you would need a resistor to ground at the input (the symmetrical version of the resistor at the output).   With the gate and source tied together with the gate-source resistor the first MOSFET cannot turn on.   You need the gate of the first MOSFET to go higher than the source when the control signal goes high.   By adding a DC path to ground the gate goes high by passing current down the gate-source resistor then through the body diode of the first MOSFET then through the added source-ground resistor on the input.   Quite an elaborate path to get it to turn on.  On the bad side the fact current needs to flow down the gate-source resistor means there is DC current in the audio path.

With the alternative configuration with the source/source resistor going to ground the on and off mechanism is a little more direct.

The Self circuit has the advantage that in the off state, no matter how high the input signal gets we always have two back to back diodes blocking the signal.   The alternative configuration has an insidious behaviour in the off state (zero gate voltage).   When the input swings more than negative more than one diode drop the drain of the first MOSFET swings negative, which then makes the body diode of the first MOSFET conduct via the drain-drain resistor.   As a result there is a rectifying action which charges the input coupling cap.

It's not possible to give an exhaustive analysis of all the cases you need to look at but here's a few major tips:
- swings more than +/- Vd which can cause body diodes to conduct.
- swings more than the MOSFET threshold.   This can affect both
  on an off states but it's quite common for the MOSFETs to turn on
  due to the signal swing when the control signal is off.

Analyse both cases: when the switch is on and off.  Then check for DC glitches in the audio path when changing states.

If you have the audio signal biased at ground then switching the control signal to 0V might seem to work but when the signal level is high the MOSFET can switch off an on due to the *signal*.   If you switch the gate negative instead of ground it can give you more signal swing.   For a single supply circuit that might mean biasing the switch at Vcc/2, a bit like the JFET circuits.

The bottom line is not to underestimate the problems.   AC switching with MOSFETs, especially ones with body diodes is very tricky.   Most configurations have issues.

An interesting twist is in power electronics.   It's common to use MOSFETs as AC switch.  All the weird problems don't show up.   The reason is the gate drive circuit is floating whereas in the audio circuits the switching circuit and audio circuit share a power rail at some point.  Similarly, optical gate MOSFETs don't have issues because the gate drive is essentially isolated.

Forgot to mention.  If you take Self's circuit, then flip both drain and source connections, and remove the gate-source resistor, you can get a much easier to understand on-off behaviour.   You need to have a DC path to ground on sources (which are in the same positions as the drain resistors on the Self circuit).   IIRC, this configuration also avoids the input cap charging up via the body diodes.   It probably needs a negative gate voltage for the off state.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

As a concrete example, for the reverse ds switch:


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