Questions about logic switching.

Started by william, January 17, 2004, 05:45:14 AM

Previous topic - Next topic

william

I'm working on putting two effects in one rack enclosure.  What I've been asked to do is construct a rack mounted distortion pedal with a TS-808 clone circuit and a SD-1 circuit.  It needs to to switch between the two effects, and a third option that bypasses both.  The bypass switch should be able to be defeated by either of the other two.  I've been asked to use an external pedal with switching.  

I'm thinking either NAND or AND gates, but I can't figure out how they would work together.  I know that if A and B are high, then the output would be high as well.  If they are both low, or one high and one low, then the output is low.  But I've been scouring the internet for information on how to make a latching type switching scheme and haven't found anything that explains how to make one.  

Anyone have any good resources for this kind of thing?

Peter Snowberg

If you want a slick solution, you could put your switches and status LEDs into a 1590B and use a stereo 1/4 cable to connect up to the rack.

Connect Vcc to the tip, and ground to the sleeve. Use that power to run status LEDs and to power a voltage divider made of two 10K resistors.  Using latching stompswitches, select ground, Vcc, or 1/2 Vcc and bring that to the ring of the phono plug.

GND = No Effect
1/2 Vcc = Pedal 1
Vcc = Pedal 2



Add one more resistor and you could also have a "both" switch.

Inside the rack case, use an LM339 (or maybe an LM324) to figure out if one or the other fuzz should be switched on.

Now assuming these effects have electronic switching: The effect's flip-flops should have their feedback loops severed so that the LM339 can inject the current state. An alternate method would be to use the open-collector outputs of the LM339 to switch the JFETs directly, removing the effect flip-flops entirely.

Without electronic switching, you could also switch Reed or telco relays. As a bonus you get true bypass. That would take an LM339, two diodes, two transistors, and a few resistors.

I'll help with details if you want to go that route.

Take care,
-Peter
Eschew paradigm obfuscation

william

Yea, thats close to what I was planning.  I was going to use relay's or optoisolators (Vactrols).  The switching scheme I was hoping to use would be Three switches.  One for the TS-808, one for the SD-1, and one bypass.   The thing is it would be best if the bypass could be switched off just by stepping on one of the other two switches.  so that to enable the ts-808 from being bypassed you just have to step on the ts-808 switch.  Rather than switching to the ts-808 then the bypass one.  I was thinking of using a din5 jack so that standard midi cables could be used, incase I needed more wires to achive this.  That way, I'd have 5 wires, V+, GND, channel 1, channel 2, bypass.  

I kind of understand how what you've already suggested would work.  I'll check up on the LM339 to see what it requires.

william

I just checked the datasheet for the LM339 and the LM324.  They look like a quad op-amp chip.  I'm not sure it would be used for switching.

R.G.

QuoteI just checked the datasheet for the LM339 and the LM324. They look like a quad op-amp chip. I'm not sure it would be used for switching

You want buffered-diode logic, which used to be a mainstream computer logic technology but is now so antiquated that I've heard it referred to as MML - Mickey Mouse Logic.

The idea is this - a group of diodes can be connected with all anodes together, or all cathodes together, then a resistor can be attached to the common point and tied to +v or to ground. The free ends are the inputs to the "gate" and the junction of the resistor and all the diodes is the output.

If you tie all the cathodes together and the resistor to ground, then the output goes high when any one of the inputs goes high - this is an OR gate.

If you tie all the anodes together and the resistor to +v, then all of the inputs have to be high or the output is low - this is an AND gate.

The way you do logic with opamps and comparators (one way at least) is to use diode logic gates and then buffer the output with the active device so that the active device can then drive the next stage, either more diode logic, formal logic chips, or your final relay or whatever.

The buffer can be either non-inverting, in which case you get OR and AND gates, or inverting, so you get NOR and NAND gates.

MML is *horrible* for real logic tasks, but it's really cheap and *great* where you need a low speed gate or two.

There is another way to do what you want. Look at GEO for my article on programmable effects footswitching http://geofex.com/Article_Folders/fxswitchr/fxswitchr.htm. This is far more complicated than you need, but down near the bottom (illustration 7) is a trick for using momentary footswitches to set one of eight (or fewer!) latches high with a footpress. The single high output can then be used through MML to do whatever combination of relay drives you like - literally any combination of ons and offs you can think of. It's probably more complicated a solution than you need, but it might give you some ideas.

Use the NEC EA-2 series of relays for bypassing ($2.50 each, Mouser) and drive them with the clickless relay drive circuit, also shown on GEO.
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.

william

Cool, thatks RG, I'll check that right now.  

This is the switching scheme that prompted me to ask.  I was hoping to design one from scratch, but adapting this one might work as well.  But before I can do that, I'd need to understand the circuit.    I understand the LDR portion, and will be chainging that for use with relay's.

I believe what happens is the gates start out all high.  When one of the buttons is closed, it causes the right two gates not used to go high/low status.  They then stop conducting.  The gate that is still open feeds back into the left gate, causing its status on both inputs to go high, and it begins conducting, maintaining the status of the gates.  Am I correct in how this switch works?  One thing I don't know for sure, is whats the status of the gates at startup.  I assumed they were all high, but really don't know.  Also, is it possile to have the third pair of gates defeated by the other two pairs?


Peter Snowberg

Quote from: R.G.You want buffered-diode logic, which used to be a mainstream computer logic technology but is now so antiquated that I've heard it referred to as MML - Mickey Mouse Logic.
...
MML is *horrible* for real logic tasks, but it's really cheap and *great* where you need a low speed gate or two.
I've never heard of buffered-diode logic, however you are describing a DTL NAND gate (Diode-Transistor Logic, a direct ancestor of Transistor-Transistor Logic). While it may be looked at as "sloppy" in some contexts, if attention is paid to impedances it is completely valid and useful. It used to be a whole logic family for heaven's sake. I saw a tube computer at the Computer History Museum which used very few tubes and a massive array of diodes to do the same job that was taking 10 times+ the tubes in more buffered designs.

Well I don't know about horrible. Less efficient power usage, yes.

In all my travels, M2L is any logic that uses "oddball" tricks to minimize part counts be it gates or diodes or transistors. It can also refer to asynchronous "manipulation units" that have to race the clock (literally) to get their task done of attaining the same result with fewer parts.

In any case, I don't see much need for logic here if latching foot switches provide all that logic. :)


Before you build anything, it's best to answer the question, "what am I building?"

Question 1: what do you want for control cable?

I like using 1/4 phone systems where I can. The schematic you posted uses DIN-5 which is common, but they're much less common than 1/4 phone plugs. If you want indicator LEDs, you're talking about needing power, ground, and two or three switch outputs. Normally that eliminates stereo connectors because there are just too many wires.

The shortcut I posted above uses an analog value on a single wire to select which pedal is on, if any at all. The LM339 is a "comparator" which is like an op-amp without a feedback loop. It's job is to watch the voltage on that single analog signaling wire and to switch relays accordingly. Think of it as a mini-voltmeter that tells you when a signal has gone beyond a specific value. An LM324 might be able to be used here too, but only some op-amps make decent comparators. For example, an NE5532 is useless as a comparator. The LM339 is a real-deal comparator.

In the rack, the comparator would signal two conditions depending on the analog switching value. By using this scheme you can switch either pedal on or both, all using a single wire. Two circuits are used, the first is a classic comparator. That just checks to see if the input is above a reference voltage. The second circuit is called a "window comparator" because it only outputs when the voltage is between two reference values.

1/2Vcc to Vcc = Switch effect 2 on
1/5Vcc to 4/5Vcc = Switch effect 1 on

You should only need two relays.

In the remote pedal, it's just a matter of switching resistors to get the value you want. You could even have remotes that behaved in different ways if you wanted. Power is always available for LEDs.

Ground would select nothing
1/3Vcc selects effect 1 only
2/3Vcc selects both effects 1 and 2
Vcc would select effect 2 only

If you can deal with four or five conductor oddball cables, you could always just send relay drive signals back from the switches directly. ;)

Question 2: What do you want for switches?

Two switches, one A/B and one Effect/Bypass, seems to make sense, but you don't get a "both" function that way. You could always add a "both" switch.


The other way I could see it would be individual on/off switches for the effects with a "master bypass" switch. No rhythm/lead flip-flop that way so it seems less useful.

I think it comes down to whether or not you want to use momentary switches.

Take care,
-Peter
Eschew paradigm obfuscation

jplaudio

Quote from: williamI'm working on putting two effects in one rack enclosure.  What I've been asked to do is construct a rack mounted distortion pedal with a TS-808 clone circuit and a SD-1 circuit.  It needs to to switch between the two effects, and a third option that bypasses both.  The bypass switch should be able to be defeated by either of the other two.  I've been asked to use an external pedal with switching.  

I'm thinking either NAND or AND gates, but I can't figure out how they would work together.  I know that if A and B are high, then the output would be high as well.  If they are both low, or one high and one low, then the output is low.  But I've been scouring the internet for information on how to make a latching type switching scheme and haven't found anything that explains how to make one.  

Anyone have any good resources for this kind of thing?

Take a look at Randall Aikens site for a  one of three selector circuit
he used a quad nand gate and a  RS latch to provide the logic. pressing any one switch turns off the others. He also shows how to interface to relays or optos. I think this will do what you want.

Peter Snowberg

Here is the receiver to go with the three button transmitter above. This is untested (!), but it's one of those "it's gotta work" type of circuits. ;) I could easily have something inverted.

The basic theory of operation is that when Vin is above about 77% of Vcc, the upper comparator will trip, turing the first effect off. When Vin is above 50% of Vcc, the center comparator will be untripped, allowing the 2nd effect to turn on. When Vin is below about 13% of Vcc, the bottom compatator will trip, turning the 1st effect off.



You could make remotes that had seperate switches for the effects with a baster bypass too. Just change the wiring a little.

Take care,
-Peter
Eschew paradigm obfuscation

Peter Snowberg

Here's a three button transmitter with 1-on, 2-on, and all-bypass buttons:



-Peter
Eschew paradigm obfuscation