switch debounce question

Started by blackieNYC, May 23, 2017, 07:09:45 PM

Previous topic - Next topic

blackieNYC

There's a great article at Geofex on using a 4053 for bypass switching. The following drawing shows how to use schmitt trigger inverters to create a latch from a momentary,but to the right is an instruction on how to use a latching switch to switch the 4053.  Obviously if you have a latching switch to start with, you don't need the alternating logic circuit on the left.  But, if you are switching audio with the 4053, isn't it better to debounce?  If the switch is mechanically latching and audio is passing thru, it will sound like our common TB 2 or 3PDT switch. This isn't silent enough for this particular purpose.  but if that latching switch, or toggle, is controlling a 4053, that 4053 will respond quickly and cleanly, flipping on and off as the mechanical switch "slowly" pushes dust, dirt and other non-conductive toxins out of the way before hitting the contact, then bouncing off a little, then repeat, etc. before settling into its newly toggled contact.
I'm thinking the circuit on the right could need a simple RC debouncer.  any thoughts?

What I'm looking to do is an insert pedal that has latching and momentary mode options.  I'll be biasing the audio path up to 4.5V as RG shows earlier in the article, to get quiet switching in both modes.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

R.G.

Quote from: blackieNYC on May 23, 2017, 07:09:45 PM
Obviously if you have a latching switch to start with, you don't need the alternating logic circuit on the left.  But, if you are switching audio with the 4053, isn't it better to debounce?
Yes. Although as a practical matter, there were some thousands of pedals made and sold using the latching switch without debouncing and we had no field complaints on that score. But if I were doing that design today, I'd use a couple of resistors and a cap and debounce it just to be sure.

QuoteIf the switch is mechanically latching and audio is passing thru, it will sound like our common TB 2 or 3PDT switch. This isn't silent enough for this particular purpose.  but if that latching switch, or toggle, is controlling a 4053, that 4053 will respond quickly and cleanly, flipping on and off as the mechanical switch "slowly" pushes dust, dirt and other non-conductive toxins out of the way before hitting the contact, then bouncing off a little, then repeat, etc. before settling into its newly toggled contact.
I'm thinking the circuit on the right could need a simple RC debouncer.  any thoughts?
Mechanical switches have both bounce issues and "abruptness" issues. You actually get a >clik< by the switching instantly connecting a signal that's at a non-zero voltage when the metal touches or moves apart. It's a small click compared to other more ugly ones, but it's there. The electronic organ industry used to worry about this issue back when they ran organ signal through the actual keyboard switches. Of course switch bounce makes this worse, by introducing many of the little clicks as the mechanical parts settle.

The 4053 and its ilk have much the same abruptness issue, as they switch in sub-microseconds. Although they do not themselves bounce, they are fully fast enough to follow a mechanical switch bouncing.

If your application really can't stand the normal bouncing of a mechanical switch, I'd advise not using a 4053-based switch at all. There are some advanced CMOS analog switches that are specifically set up to switch audio silently. These didn't exist back in 2000 when I was writing up the stuff on the 4053. That would be worth experimenting with, although more expensive. Another alternate is JFET switching as in the Boss/Ibanez switching scheme. JFET switching has its own issues, but they can be set up to actually fade in and out over a few milliseconds, eliminating the source of the abruptness-click. As a bonus, the slow-down networks on the gates of the JFETs will hide mechanical switch bounce pretty well, so you could probably get away with mechanical switches without debounce networks. As a second bonus, if you use P-channel JFETs, the bias voltage needed can be 0V with all the gate switching being above that, so the JFETs don't need biased up at half the power supply voltage with a positive 9V supply. The J174/175/176 family works well for this, and was still in production in TO-92 when last I checked.

Do a lot of breadboarding first.    :icon_lol:
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.

bool

Yeah the jfet switching as in most pedals actually cross-fades the audio.

Groovenut

Quote from: R.G. on May 24, 2017, 10:14:14 AM
There are some advanced CMOS analog switches that are specifically set up to switch audio silently. These didn't exist back in 2000 when I was writing up the stuff on the 4053. That would be worth experimenting with, although more expensive.
R.G., do you happen to have any part numbers for the specialized CMOS analog chips?
You've got to love obsolete technology.....

R.G.

It's  been a few years since I dug through this. I just have a memory that such chips existed. There are probably newer and better ones by now.

Sorry, I'm not current on exact part numbers.
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.

blackieNYC

#5
Latching is inherent in the boss switching system - can you steer me towards a momentary circuit?
And +1 on the audio switches. I'll try to find them.

Good 'ol Maxim seems to have something
https://www.maximintegrated.com/en/app-notes/index.mvp/id/5299

EDIT at a glance, the Max 4622 looks useful to us. 5ohm instead of 200. 9volt compatible (+/- 18v), dip 16. 
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

ElectricDruid

I once built a wah pedal with noiseless switching using a 4053, and I did it exactly as you describe, with a simple RC on the control input. It worked very well as I remember.

The 4053 has level convertors of some type on it's control inputs (so you can switch 0-9V signals with 5V logic) and they may well be schmitt triggers with some hysteresis. Whatever they are, they seem to provide some immunity to bounce.

My advice would be to try it the simple way before you buy any fancy chips ;)

HTH,
Tom

blackieNYC

expensive, yes.  the one I mentioned is 7 dollars.
But there are some for $1.69 but they are all of the surface mount styles I don't want to deal with.  When DIPs are available, they are 45 ohms when on, which is better than the 4053.  but probably not worth the trouble. 
The Boss switching system RG has written up at goofed would probably be best.  But it is way too many parts. This is a one-off and I'm a perf guy.

I think I should take another look at what I want to do. Thanks guys - but stay with me. Look for a new thread.

  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

R.G.

Quote from: blackieNYC on May 24, 2017, 03:24:55 PM
Latching is inherent in the boss switching system - can you steer me towards a momentary circuit?
It is if and only if you use a latch to run it as Boss and Ibanez do in that two-transistor flipflop.

The JFET gate circuits don't care if the controls are latched or not, as long as one goes up when the other goes down. So one could easily drive one gate with a control signal and run an inverter to the other. They both then do as requested whether the control signal is momentary or latched.

QuoteEDIT at a glance, the Max 4622 looks useful to us. 5ohm instead of 200. 9volt compatible (+/- 18v), dip 16.
Switch resistance is the least useful thing on the datasheet, as 4053s work fine with hundreds of ohms in the on state. You're concerned with clicking, which is best summed up in the "charge injection" specification - and, as usual, that it the hardest to use form of that information for a non-professional.

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.

blackieNYC

Right. basic fet switching.  The clicklessness i'm looking for is in a momentary insert application. A simple and debounced fet switch might be best. I'm trying to put something together that has an 8 outcome truth table. Or more specifically, a four outcome truth table (two latching switches)that is then subjected to a momentary N.O. switch. Please look at my other switching thread. If it makes no sense please let me know. I have figured out how to do it with the three switches being 4053s
I only got hung up on the On resistance when discovering the improved analog switches. You got us all excited about it! charge injection indeed.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

PRR

> hung up on the On resistance

In guitar cord work, your loads are typically over 100K.

It hardly matters if your switch is 2 Ohms or 900 Ohms. Even the worst-case is only 1% drop of level. The player will strum 1% harder, or turn a knob 1% higher, or just not notice.
  • SUPPORTER

blackieNYC

I know, Paul.  the math never lies.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

PRR

Usually, *variation* of ON resistance "can" matter. It means distortion.

But math is, as you say, a clue. A ~~900 Ohm switch feeding a 100K load can't make even 0.5% THD, if it varies from zero to near 1K. More likely to be 700-900 Ohms, 200r variation, 0.1% THD. And for most switches this can happen only for "full" swing". Running sub-Volt signals through a 9V supply switch, we are hardly swinging full.

In the highest class gear, large consoles with many switches in the signal path (also typically working nearer 10K), plain CMOS was "fine" at first and "marginal" as consoles expanded. Plain CMOS persisted in improved topology using a buffer at each switch; OK for a console but maybe awkward for a bench-built pedal.

The switch makers want you to get this right (so you will sell a million and they get a share). Read their bumph. Just two hasty hits; there are many more:
https://www.maximintegrated.com/en/app-notes/index.mvp/id/5299
http://www.analog.com/media/en/training-seminars/tutorials/MT-088.pdf
  • SUPPORTER

Groovenut

This one looks interesting and isn't much $. 5 VDC power isn't will require some attention but it appears to be decently thought out for the specific application. SMD only

http://www.mouser.com/ds/2/149/FSA2275-612459.pdf
You've got to love obsolete technology.....

blackieNYC

Hey Groovenut - that one is one of the unfriendly surface mount types - legs all underneath. Here's one for $1.33, it is surface mount - but it is vssop which has solderable exterior legs.  that would be easier to work with, but I'm a perf guy and I would need an adaptor board, which is no big deal.
http://www.mouser.com/ProductDetail/Texas-Instruments/TS5A22362DGSR/?qs=sGAEpiMZZMtxrAS98ir%252bs0%252bWxnYoeZUhRqc7oc8tWx8%3d

The market driving this generation of audio switchers seems to be the earbuds and mini speakers - very low Ron (yes, lower than we need) because they connect little amps to speaker Z loads. 5.5 volt isn't perfect  This might be our best bet, but it's worth continuing our search, no?. 
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

Digital Larry

Quote from: R.G. on May 24, 2017, 10:14:14 AM
You actually get a >clik< by the switching instantly connecting a signal that's at a non-zero voltage when the metal touches or moves apart. It's a small click compared to other more ugly ones, but it's there. The electronic organ industry used to worry about this issue back when they ran organ signal through the actual keyboard switches. Of course switch bounce makes this worse, by introducing many of the little clicks as the mechanical parts settle.
Of course, by the time the DX-7 keyboard sought to emulate a B-3, "key click" had become a desired much sought after feature that absolutely must be emulated to 15 decimal places!   ;D

Also, let's not become complacent, of course I demand < 0.01% THD when I switch my TS/Rat clone running into a 5W class A tube driving 4x12!

Sorry, easing into my first coffee, rubbing crumbs out of my eyes and trying to settle into my average level of snarkiness.   :icon_mrgreen:
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Groovenut

Here's another IC that may prove useful. A quad of SPST with onboard 5V regulator and latches. It would take a bit of experimenting as the app notes are minimal. Comes in DIP too

http://www.mouser.com/ds/2/427/71616-240242.pdf
You've got to love obsolete technology.....

blackieNYC

Quote from: Groovenut on May 28, 2017, 11:51:22 AM
Here's another IC that may prove useful. A quad of SPST with onboard 5V regulator and latches. It would take a bit of experimenting as the app notes are minimal. Comes in DIP too

http://www.mouser.com/ds/2/427/71616-240242.pdf

I don't think so - there 's only one control line and the switches appear to be all NC.  Some ICs come in this NC version, an NO version, and a 2NC 2NO version, which would be our bypass switch.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

Groovenut

Quote from: blackieNYC on May 28, 2017, 11:56:30 AM
Quote from: Groovenut on May 28, 2017, 11:51:22 AM
Here's another IC that may prove useful. A quad of SPST with onboard 5V regulator and latches. It would take a bit of experimenting as the app notes are minimal. Comes in DIP too

http://www.mouser.com/ds/2/427/71616-240242.pdf

I don't think so - there 's only one control line and the switches appear to be all NC.  Some ICs come in this NC version, an NO version, and a 2NC 2NO version, which would be our bypass switch.
Actually I believe each INx is a control line and the Dx/Sx is the in/out of the switch element. Yes they are all NC, but I dont think that matters too much as you can set them to open. I think you could set each switch element to an open or closed state by it's high or low state and then change the states simultaneously by altering the barWR state from high to low and it will latch.

I could be reading it all wrong as it's function is completely new to me.
You've got to love obsolete technology.....

blackieNYC

Oh, sure - IN1 - IN4 are the individual control lines, and barWR is like an all reset.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers