Author Topic: Silent Switching with 4066 / 4053 CMOS Switches  (Read 4126 times)

amptramp

Silent Switching with 4066 / 4053 CMOS Switches
« on: March 30, 2018, 08:16:00 PM »
SILENT SWITCHING WITH FAST SWITCHES

Typical CMOS switches as exemplified by the 4016, 4066 or 4053 are not normally used since the switching action cannot be slowed down.  You can apply a slow signal to the select input, but it is squared up to a fast signal internal to the device, which causes the switching to occur suddenly – with a switch pop.  The only exception is the 4007 where you have access to the gates of the internal CMOS devices.

There is a trick that can be used to make a 4066 / 4053 CMOS switch work with minimal switch pop.  Suppose the switching is delayed until the voltage at the bypass and effect output was the same – then switching between them would create a slight noise due to the change in the slope of the signal, but not a pop due to the signal suddenly going in a step function between one voltage and another.  The 4066 is set up as four SPST switches and the 4053 is set up as a 3PDT switch, permitting the other sections to be made available for effect input grounding or other purposes.  It can be made bipolar with switch transfer occurring as the output approaches the input from either direction or monopolar, saving one gate package and one comparator.  Since many cycles of music frequencies take place in a small time, the bipolar unit may switch earlier by one half of a signal cycle half of the time but this is usually not an issue, so the simpler method is recommended.

The circuit is split into several parts.  There is a comparator that determines whether the bypass signal is above or below the effect output and uses hysteresis to stabilize the crossover point.  This goes to a pulse stretcher that provides a usable narrow pulse from the crossover.  This goes to a flip-flop that clocks a single low-to-high transition when the pulse occurs for as long as the mechanical switch is closed and a D-type flip-flop connected as a toggle.  You could use an offset control on the comparator to anticipate switching so the logic output can come at exactly the time the signals cross over.

The comparator can be set up with capacitive hysteresis that ensures that only a single state transition occurs without affecting DC levels.  The pulse stretcher is a CMOS gate set up with two inputs, one being an undelayed signal and the other being delayed by an R-C lag.  The pulse stretcher outputs a 1 when the undelayed signal occurs and this returns to 0 when the delayed input occurs.  The narrow pulse is applied to a D-type flip-flop clock to clock a 1 through to the output.  When the mechanical switch is off, the flip-flop is held in a cleared state.  The flip-flop output goes high once the pulse arrives and it stays high regardless of the number of pulses that occur because it is clocking a high through on the D input.  This output goes to a toggle flip-flop that changes position on the positive signal from the first flip-flop.  The output of the toggle controls a 4066 / 4053 switch and the rapid switching does not matter because the voltages at the bypass and effect output happen to be the same at that time.  There may be a change in slope but that is not the same as having a step function in the output.


Rob Strand

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #1 on: March 30, 2018, 08:39:36 PM »
I like it because it's thinking outside of the box. 

The DC coupled switches might cause their own glitches as each side of the switch can be at a different DC voltage.   This type of glitch isn't caused by the switches as such it's caused by connecting things at a different DC levels.   In normal operation there's a minimum glitch level set by the comparator offset and any input currents.  If everything was AC coupled it would get around that provided everything was floating over the same Vref.

BTW: You can slow down 4066 etc transitions to some degree.  It's not like a JFET.
« Last Edit: March 30, 2018, 08:41:17 PM by Rob Strand »
Plopping around the pot since an early age.

amptramp

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #2 on: March 30, 2018, 08:59:32 PM »
My thought was the buffer would be referenced to Vcc/2 and so would the effect core but it doesn't really matter - if the comparator sees identical voltages and switches output, the voltages are the same at that point and there is no pop.  The Vcc/2 reference guarantees that the signals will cross over at some point.  If the effect is inverting, this is obvious.  If the effect is non-inverting, there should still be a point near Vcc/2 where the voltage paths have to cross as shown in the diagram.  I would expect AC coupling into and out of the box with the output levels referenced to GND externally but Vcc/2 internally.

You could have equal impedances at each comparator input to eliminate the offset current bias and just leave the input bias but we are only talking about a few millivolts here.  This is not far above the noise level and you could add an offset pot to the comparator.

You could also momentarily collapse the voltage on a 4066 to slow it down but if you want a slow CMOS switch, I have a 4007 design that can be slowed to a crawl.

Rob Strand

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #3 on: March 30, 2018, 09:20:35 PM »
Quote
y thought was the buffer would be referenced to Vcc/2 and so would the effect core but it doesn't really matter - if the comparator sees identical voltages and switches output, the voltages are the same at that point and there is no pop.  The Vcc/2 reference guarantees that the signals will cross over at some point.
The connection at the output stage is fine as it has the comparator.   To be entirely noise free you need to use that scheme at each switch.

Suppose the input buffer has a 5mV input offset and the Effect Core has it's input connected to Vref.  When you close the input switch a 5mV DC glitch is injected into the Effect Core input.

One angle is if the input switch was switched on immediately you can hope that there is a delay before the output switch closes, which may hide the input glitch.  However when you switch the input off the output switch is released late so it inherently lets the glitch cause at the input get through.

Quote
You could also momentarily collapse the voltage on a 4066 to slow it down but if you want a slow CMOS switch, I have a 4007 design that can be slowed to a crawl.
Yes the 4007 is more like a JFET.

A nasty way to forcefully slow 4066 switches is to use a dummy switch in a feedback loop using an opamp.   The input to the switching opamp is an exponential waveform (the target response).  The output of the opamp drives all switch control inputs of the same polarity.   The output of the opamp follows a slow trajectory which controls the switch input.   It only works if there is good matching.    BTW I didn't come up with this idea  it's a generic idea of making one dodgy thing follow another dodgy thing using feedback.   For example it's used with optos' and rms converters:
http://www.vishay.com/docs/83708/appn50.pdf
Plopping around the pot since an early age.

amptramp

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #4 on: March 30, 2018, 10:11:25 PM »
OK, here are a couple of analog switch implementations using the CD4007 / MC14007 and another using diodes that is probably usable only for distortion/fuzz/overdrive circuitry.





and the actuators:




ACTIVE BYPASS IMPLEMENTATION

The active switch implementation depends on having a bistable multivibrator set up to toggle, that is, change state every time the input is pulsed.  This is used to generate switching signals for switching elements that connect and disconnect the signals.  The multivibrator can be made from discrete transistors or CMOS gates or a CMOS D-type flip-flop.  Discrete transistors are used in most commercial pedals.  The commercial switches are JFET but a MOSFET or a diode bridge can be used.

The effect circuitry can also be designed to eliminate the input switching.  If the input impedance is sufficiently high, there would be negligible loading, so it would not have to be disconnected.  A buffer is usually used to ensure low-impedance drive to the output switch and high input impedance for the effect circuitry.  A bipolar emitter follower is the most common although a JFET source follower or non-inverting op amp would preserve gain better.  In this case, the designer only needs to provide a switch to the output from the input buffer or the output of the effect.

Most commercial pedals use JFET switching between input and effect.  Since the JFET junction never needs to be forward-biased, there is no current in the gate circuit and the gate switching can be delayed by R-C networks.  The delays are applied to both the input and output switch and give the effect of panning from one to the other.  This eliminates any switch pops or clicks and the time constant of the gate R-C network can be set to provide a defined speed of switching.  Equally important is the fact that the switching signal is not injected into the signal path because the capacitance of the gate to channel is quite low and is swamped by the source impedance.  However, the JFET gate turn-on voltage must be compatible with the signal levels in the effect and this requires a low gate turn-on voltage.  Similarly, the gate voltage must never become forward-biased by the signal in the channel.  Although this implementation is usually simple and takes the smallest footprint on the circuit board, it may require some selection of devices, especially if operating from batteries.  Add to this the fact that the JFET distorts the signal by changing channel resistance with signal voltage and you can see that maybe the standard circuit as used by Boss and Ibanez can be improved.

CD4007 / MC14007 CMOS SWITCH

There is an implementation that uses a CD4007 / MC14007 MOSFET array.  The actual series pass element gates are available externally.  This allows the input of slow switching signals that permit panning from one input to the other without any switch pop.  You may need two 4007's, one to switch the output and the other to disconnect the input and switch it to ground if necessary.  The advantages of the CMOS switch are:

1. the changes in series resistance are symmetrical for positive and negative variations about the half-voltage point.  Depending on power supply voltage, the resistance can drop below 100 ohms in the “on” state although at lower voltages, the several hundred ohms when on and its variation with applied voltage is not much of a disadvantage.

2. The gate voltage required to switch the FETs is rail-to-rail and well characterized.

3. The switching signal injected into the channel capacitively by the gate for the N-channel device is nominally equal and opposite to the switching signal injected into the channel by the gate for the P-channel device.

4. There is no need for an output buffer if you choose your impedances wisely.

DIODE BRIDGE SWITCH

A less obvious switch can be made from diode bridges.  This has been used for synchronous detection in TV colour demodulator and FM stereo demultiplexing and also in fast sample-and-hold circuitry.  It relies on the forward voltage of diodes matching at the same current so that a signal can be shut off by diode bias.  Behaviour of the diode bridge during switching is less like panning and more like signal peak detection and may sound like clipping or crossover distortion at some point as signal transfers from one channel to the other during the switching.  It uses a lot of parts, but 1N4148 diodes are available in packs of 1000 for $15 locally and although there are a lot of connections for the minimum of 8 diodes (costing $0.12), the board area is actually pretty small.  You have to have a source impedance that is sufficiently low that you can drive the diode bridge and a sufficiently high load impedance that the several hundred ohms of diode resistance is negligible.  This usually requires an output buffer and selection of the resistive drive to the diode bridges – sufficiently high impedance so the input voltage is not affected but high enough to maintain output impedance below that of the load.  There will be some distortion as the bridges go through zero because the diode bias may cause clipping or crossover distortion, so this may only be suitable for distortion/fuzz/overdrive stages that provide enough noise to cover the switching noise.  As indicated in the pictures, you can add speed-up diodes to ensure either make-before-break or break-before-make operation where the outputs from the combined bridges either overlap (make before break) or are separated with dead space (break before make).  You can do this with the CD4007 design as well.

ACTUATORS

The same actuators can be used for the 4007 and diode bridge switches and these can be based on individual gates or a CMOS flip-flop.  Note that current drive capability is low so a MOSFET switch is used to drive the LED that indicates the effect is in use.  Its gate is connected by a resistor to isolate the gate drive capacitance so it will not cause excess loading of the drive lines.  The bipolar transistor flip-flops are not capable of providing the rail-to-rail drive needed here.  Speedup and slowdown diodes can be used in the R-C drive to the switches to allow make-before-break or break-before-make switching as required.
« Last Edit: March 30, 2018, 11:21:03 PM by amptramp »

diffeq

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #5 on: March 31, 2018, 02:53:17 AM »
Thanks for sharing these. Just about one month ago I was contemplating silent electronic switching and came up with a design based on CD4053, with output signal being muted before and during transition.

I like the first comparator-based design a lot. Is LM393 precise enough for this task?

amptramp

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #6 on: March 31, 2018, 06:59:16 AM »
The LM393 has a typical offset voltage of ± 1.0 mV and a maximum of ± 5.0 mV and an input bias current of typically 25 nA and typically 250 nA.  If you have a low DC resistance in the source that you are getting the signal from (like the output of an op amp) in both the input buffer for the bypass signal and the output of the effect, you should be OK for bias current acceptance.  You have to decide whether your system is sensitive to the offset voltage.  If this is a problem, an comparator with an external offset pot may be a better idea and if source resistance is a problem, a FET input device may be a good idea.  An LM311 used with an offset pot would be ideal but there may be other devices on the market that you would prefer.

I had envisioned this scheme for switching the output only and added input switching as an afterthought but as Rob Strand has pointed out, there is nothing saying that achieving noiseless switching at the output will guarantee the inputs are also at the same voltage so a delay would need two of these switches.  The design should be OK for devices that do not need input switching.  The 4007 switch would be better for a delay because it can use one switching input to pan between inputs at both the input and output of a core such as a delay where switching at both ends is necessary.

Rob Strand

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #7 on: April 02, 2018, 11:02:47 PM »
Wha ever you use for DC connected stuff the offsets are going to cause some glitches.

The diodes never quite make it for audio.  For RF it works if you set things up correctly.  Once I wanted switch a high Q resonant with a varactor diode.  It wasn't as simple as the fixed LC stuff on the TV tuners would imply.

The old Fluke 1900 counter had a nice example of BJT and diode switching.   Not glitch free but it elegantly demonstrates when you can use certain types of switches:

Fig 8.2 p 84
http://www.qsl.net/n9zia/test/Fluke-1900A.pdf

Q3 and Q4 select the gain.  CR7 and CR8 select the filter.
« Last Edit: April 02, 2018, 11:07:12 PM by Rob Strand »
Plopping around the pot since an early age.

amptramp

Re: Silent Switching with 4066 / 4053 CMOS Switches
« Reply #8 on: August 07, 2018, 08:01:55 PM »
There have been several threads about switch popping, so I am bumping this thread and correcting the postimage wipeout that happened in the spring.  There is a reason Boss and Ibanez have gone away from the 3PDT switches that so many DIY'ers like.  The 3PDT switch is a solution that needs a solution.

Here are the pictures again: