Relays and Op Amp Damage

Started by mattthegamer463, December 14, 2010, 10:38:30 PM

Previous topic - Next topic

mattthegamer463

Hey guys,

So, I'm building an active mixer pedal of my own design, and I am using two DPDT relays for true bypass switching, and also for power switching.  The way it works is there is a pot with a SPST switch built in, which when closed sends 9V to the coils, triggering the relays to move from bypass (which is actually a passive AB switch mode) to active mixing mode, and using the extra switch in the relays it switches 9V to the op amp and voltage divider.  The relays and switching work great, but the amplifier circuit refuses to work.  I read some stuff about properly using relays and they say when the magnetic field around the coil collapses, it induces a voltage back into the coil which can damage ICs.  I didn't have a protection diode in place when I started testing.  Could I have blown my TL071 op amp?  Should I be isolating the coils from the chip?  Could the relay coils be stealing all the current and essentially shorting out the IC power?  Thanks for any assistance, guys.

- Matt

R.G.

Practically anything could be happening. We can't tell until we see how you have hooked it up. Post a schematic.
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.

mattthegamer463

Thanks R.G. Ill throw one together later today.  I was just thinking maybe there are some steadfast do's and don'ts with relays that I was breaking.

mattthegamer463

Sorry for the horrible horrible schematic but I hope its comprehensible.  All I had to put it together quick was MS Paint and a jpeg of the amplifier portion.  R1-R4 represent two 100k pots.


PRR



That amp/mixer part is not going to work.
  • SUPPORTER

mattthegamer463

I see that I should have two caps instead of just C1, because signal 1 could feed back into the source of signal 2 and vice versa.  If at least no DC can get in there that is a good thing.

From what I see, you are saying that whatever is present at + will be shorted to ground, so it will kill the signal?

I've managed to get a non-inverting setup to work.  I think there was a broken wire in there, I found one later on but I'm not sure if it was always the problem. However now problem with that is that the resistance of the pot will affect the effective Rin, changing the gain based on the pot volume.  I'll need to re-arrange into a non-inverting setup.

PRR

> the amplifier circuit refuses to work.

Circuits don't "refuse".

This one did just what you told it to do. The "- In" is connected to +4.5V through (10K||10K)+1K+1K or 7K, and to Out through 10K. The "+ In" is connected to zero V. Because "- In" is more positive than "+ In", the output will tend to go negative. It will stop when both inputs are the same voltage. Some resistor/voltage math will tell you this happens when Out is at negative 6.43V.

However the opamp can't swing past its supply rails, +9V and zero V. Negative output is impossible. In simple theory, the amp will STICK at zero volts DC output.

A sufficiently large audio input will knock it off the stuck condition. We need to negate the 6.4V/10K or 0.6mA in R5. If the audio input network were a simple 50K resistor, we would need 50K*0.6mA or 31V audio input before the output would move at all. We don't have 31V signals in guitar cords. Actually there's more ways the input current splits, so the required signal is higher.

Another point: unless stated otherwise, an opamps inputs can NOT sit AT either supply rail. That leaves the input transistors UN-biased, not-working(*). Here you have the "+ In" sitting at the negative supply. That is usualy a NO-GO. (*) In fact the LM324 opamp will work with both inputs at the negative supply. But its output must be at least a little bit positive to work, and a volt or more positive to cover gitar-cord signals. That implies some negative bias supply, which we often do not have. So even LM324 is rarely run with inptus at negative supply.

> I see that I should have....

You should study more, plagiarize better.

I'm not sure where you got that inverting mixer, but it is copied imperfectly. And also not scaled suitably for guitar cord work.

Go steal a guitar mixer, not a generic opamp tutorial example. Lock stock and barrel; note ALL the what-connects-to-what. That's actually an excellent way to learn electronics.
  • SUPPORTER

mattthegamer463

Quote from: PRR on December 15, 2010, 11:15:07 PM

I'm not sure where you got that inverting mixer, but it is copied imperfectly. And also not scaled suitably for guitar cord work.

Well it seems that what I was looking at and trying to modify for my circuit was using an implied bi-polar supply, and it slipped past me.  I should known better and have noticed that it would have a problem there.   

As shown in this thread: http://www.diystompboxes.com/smfforum/index.php?topic=76146.0 People refer to RG's mixer circuit and a number of other mixer circuits.  RG's uses 10k pots, 100k Rin resistors and a 100k negative feedback resistor, and then a separate boost stage.  Wouldn't the accumulated resistance of the pots result in less than unity gain (gain of 1)?  I've looked at a lot of mixer circuits on GGG, geofex, and other sites and they are all inverting setups using this same methodology.  Is there a reason why nobody does non-inverting?  I figured that would make the most sense. Why isn't the gain recovery rolled into one stage instead of two?


R.G.

Quote from: mattthegamer463 on December 16, 2010, 06:14:10 PM
RG's uses 10k pots, 100k Rin resistors and a 100k negative feedback resistor, and then a separate boost stage.  Wouldn't the accumulated resistance of the pots result in less than unity gain (gain of 1)? 
No. Resistance does not lower voltages. Resistive dividers do. There's an important difference. Let's consider Ohm's law. The voltage across a resistor is equal to the current through it times the resistance. What happens if you put a signal voltage on one side of a resistor and a sheet of glass 50kV thick on the other end? What is the voltage across the resistor?

The glass lets through zero current (for all practical purposes) and so the voltage across the resistor is zero, too. No matter what the resistance is. (There are special cases to this example, but it's valid for the thought experiment to get the idea.)

QuoteI've looked at a lot of mixer circuits on GGG, geofex, and other sites and they are all inverting setups using this same methodology.  Is there a reason why nobody does non-inverting?  I figured that would make the most sense. Why isn't the gain recovery rolled into one stage instead of two?
One of the maxims I use in my life is that whenever reasonable people are doing things that don't make sense to you, it's usually because you don't understand the rules (or what it is they're trying to do). The objectives someone is trying for shape what they do, a lot.

First, why use an inverting mixer? This is simple. It's because an inverting opamp circuit's negative input is at a virtual ground. The inputs are converted to *currents, not voltages* and summed at the inverting input. This is important because they cannot then interact - turning one input fully down has no effect on others at all. This is a good thing in a mixer, and some thing you can't easily do any other way than by mixing currents. That's why you don't find many or any noninverting mixers. It's because the inverting circuit does the mixing best with a simple circuit.

Second - wanting non-inverting is a reasonable goal. The second gain section is there in most mixers to reinvert the phase from the first mixing section so you get back to noninverting. This is not an economic problem because a dual opamp costs about the same as a single opamp, so you get enough opamps for the same price.

Third - those resistor values are picked for a reason. The series resistors are picked to be 10X the pot value to avoid the input resistors loading down the signal on the pots.
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

> Is there a reason why nobody does non-inverting?

It's just a temporary fad. Last 40-50 years or so.

The summing amplifier has particular advantage for 2 to 10 inputs and you wish to disconnect inputs without changing gain of remaining inputs. However in your application this probably not right: 2 inputs is intrinsically louder than 1, you probably want per-input gain to drop slightly when two inputs are applied. (And I don't see that you ever have less than both inputs going.)

The summing amplifier has advantage when you build a 8 to 64 input console which may sometimes be used as 2 or 4 inputs. Many-input summing tends to be noisy. Disconnecting inputs on a summing amplifier reduces summing noise. However this is no 64-in console. (And it appears it only ever runs as 2 inputs.)

One point to grasp: resistive mixing (active or passive) is "lossy". What comes out is less than you put in. For other reasons, often much less. And the guitar is a fairly weak source, and hiss is often a concern. As a rule of thumb, you would consider boosting before mixing. That's not always necessary, and often annoying.

You CAN mix guitars with two 68K resistors. It's lossy, but you can turn-up. That may not be what you want in the final product. But it sure is a way to get the switch-maze worked out before you wrestle with amplifier issues.

> Wouldn't the accumulated resistance of the pots result in less than unity gain (gain of 1)?

There's an _amplifier_ in there. Simple resistance-counting does not tell the gain. You need to study amplifiers. You are lucky in that opamps can often be analyzed "by inspection" without knowing much about the specific amplifier device.

However you do have a big gain problem for your intended use (guitar pickup).

Points to study:

1) What is the input impedance of an inverting amplifier? (And what is the voltage gain?)

2) What is the impedance of a guitar pickup?
  • SUPPORTER

mattthegamer463

Thank you R.G. and PRR, you guys really know your stuff exceptionally well.

R.G., I've read over your post several times and I'm a little stumped still when you were talking about inverting mixers and why they work:

First, why use an inverting mixer? This is simple. It's because an inverting opamp circuit's negative input is at a virtual ground. The inputs are converted to *currents, not voltages* and summed at the inverting input. This is important because they cannot then interact - turning one input fully down has no effect on others at all. This is a good thing in a mixer, and some thing you can't easily do any other way than by mixing currents. That's why you don't find many or any noninverting mixers. It's because the inverting circuit does the mixing best with a simple circuit.


Looking at the Mini Mixer schematic, is the key to not affecting the other inputs in that 100k resistor which is in series after each pot output?  That would offer high resistance through that area regardless of pot position, and prevent one pot from shorting out all the other inputs.  Because you have these large 100k resistors and 10k mixer pots, equivalent resistance at the op amp inputs won't really change too much and as a result the amount of gain in the circuit won't ever really change.  Is this correct?  I feel like I'm on the right track of understanding.

I managed to get my non-inverting mixer to work finally, I had overlooked an incredibly important capacitor and I am still kicking myself for not knowing better.  I will right up a proper schematic when I get home from work today and post it here, and an explanation of why I did what and see what you guys think.  I would like to offer it to the DIY community as a useful project if you guys think it wouldn't do more harm than good.  Like I said I will post that in about half a day.

Thanks again guys.

It's just a temporary fad. Last 40-50 years or so.


Are you being sarcastic (implying that inverting is almost always better) or being serious that its a misconception? 

R.G.

Quote from: mattthegamer463 on December 17, 2010, 07:28:01 AM
Looking at the Mini Mixer schematic, is the key to not affecting the other inputs in that 100k resistor which is in series after each pot output?  That would offer high resistance through that area regardless of pot position, and prevent one pot from shorting out all the other inputs.  Because you have these large 100k resistors and 10k mixer pots, equivalent resistance at the op amp inputs won't really change too much and as a result the amount of gain in the circuit won't ever really change.  Is this correct?  I feel like I'm on the right track of understanding.
You're close. The key is not particularly the 100K resistors, even though this would help even if you used a non-inverting amplifier.

The key is in how an opamp works. Stay with me if you want to understand this. In a standard opamp, the input at the + and - inputs is assumed to be infinite. That is, no current goes into or out of the input pin. Assume for the moment that you have +/- supplies and the + input is tied to ground. Also assume you have a slight positive signal voltage at the input to one of the (100K in the circuit you're looking at) input resistors to the - input. This would be what comes off the wiper of the pot, or simply from some voltage source. This voltage tries to force the input to a different voltage. Moving the input to a different voltage forces the amplifier's output to move in the opposite direction.

Since the amplifier moves the output by the open loop gain (very, very large) times the difference between the input voltages, the output tries to be way more negative than the signal voltage is positive. The output continues to go negative until the difference between the two inputs drops to zero. This happens through the feedback resistor. The input signal is +, the output is going negative, and the inverting input can't eat any current; therefore, there is a net current going through the input resistor and the feedback resistor; since the inverting input can't eat current, the current in the input resistor and the feedback resistor must be equal - there's no place else for the input current to go except through the feedback resistor.

The amplifier can only stop moving when the output voltage makes enough current go through the feedback resistor to suck away the voltage/current the input signal is putting on the inverting input pin. So, the output moves to a voltage that forces the voltage on the inverting input pin to be equal to the voltage on the noninverting input, within a very small difference. Since the noninverting input is tied to ground, the inverting input is always driven to a voltage very nearly the same as ground. This is the origin of the term "virtual ground". The output of the amplifier and feedback force the inverting input to act like it's being held at ground voltage.

This means (a) the inverting input is never more than a few millivolts away from the noninverting input as long as the amplifier *can* make this true and (b) the inverting input is a low impedance point. Current into the inverting input resistors seems to vanish there.

And it's this last that's the key to mixing. Whatever current comes into the inverting input vanishes there, offset by the current pulled by the output through the feedback resistor. Any number of inputs can be connected there, and the currents can only interact on the output, not at the other inputs because of the virtual ground action. The low impedance of the virtual ground prevents the mixing from letting inputs interact.

A noninverting input cannot do this nearly so well. The only noninverting inputs which can do this are circuits which have quite low input impedances, and this is only an approximation of a virtual ground. That's why you don't commonly see noninverting mixing stages. The performance as a mixer is poorer.

If you do a noninverting mixer, you must necessarily have the input be a voltage divider in an attempt to keep the inputs from interacting. In that case, the series resistances you use have to have a divider resistor, causing signal loss, and worse noise performance because you must then amplify the lost signal level back up, including amplifying any noise. The inverting mixer may have any gain, set by the input resistors and the feedback resistor, including gains down to and below unity, so there is not necessarily the big noise gain built in.

Your reasoning about mixing is getting there, but you're missing how opamps work.
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.

mattthegamer463

Alright, I'm starting to get closer. I'll do some more reading on op amps tonight and see if I can find a bit of a lower-level description, for a more "layman" understanding before I can really grasp what you're saying confidently. 

So, you've convinced me that doing an inverting setup is much more effective than non-inverting.  However, I already have 100k pots.  If I run through a 100k resistor too, the total resistance through that area can swing a possible 50% or so.  In the Mini Mixer it would only swing 10%.  I'm just thinking, maybe this won't work for me with 100k pots.  I'll post my schematic later today to see what you guys think.

R.G.

Quote from: mattthegamer463 on December 17, 2010, 09:23:50 AM
...I already have 100k pots.  If I run through a 100k resistor too, the total resistance through that area can swing a possible 50% or so.  In the Mini Mixer it would only swing 10%.  I'm just thinking, maybe this won't work for me with 100k pots.  I'll post my schematic later today to see what you guys think.
You could just try it with the pots you have and see if you like it. It's simpler.

I've been concentrating on the mix/gain stage, not the input circuits. That's another issue.

The size of your pots depends on what drives them. If you want to mix raw guitar signals, then 100K is not big enough in most case. Generally you need to get to 500K or 1M to avoid loading guitar pickups and losing treble. But 1M pots all by themselves can cause treble loss by parasitic capacitance. So you may need to buffer the guitar inputs.

Or if you only have effects inputs, the effects outputs are much lower impedance, and you can probably go down to 10K pots profitably.

And notice that the impedance of a signal on a pot wiper varies from zero (at full off), up to about 25% of the pot rating (at mid-resistance), to the impedance of the signal source driving the pot in parallel with the pot rating (at full on). This impedance appears to be in series with the input resistor of the mixer. Theoretically, this impedance should be low compared to the input resistor. In practice, it doesn't matter as much to the ear as to the designer.

So try it with your 100Ks. If you don't like it, buy new pots and change values.
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.

mattthegamer463

Ideally I was hoping it would be versatile enough for either guitar or effect inputs.  Obviously testing will prove how it goes for both.  I've only tested with guitar so far and it works great, sounds fine.  I'll try effects as inputs later today.

mattthegamer463

Here is my current setup, which has no audible issues. The only thing I'm not sure about is whether or not the two-mono into one-stereo jack will work or not without the signals interacting somehow.  It will be only available in passive mode.



So, a bit of explanation:

Each input has its own volume control, arranged in such a way that when one volume control is turned to 0 the signal from the other input won't be able to escape to ground.  Biasing voltage is applied to the incoming signal and it is fed into the non-inverting input.  Approximate gain should be 2.2k/1k + 1 = 3.2.  The signal then passes through a 100k output volume control pot, and then to the output.

There are two DPDT relays for true-bypass switching, which turns the mixer into an AB selector box when powered off.  Mixer power is controlled by a SPST inside the output potentiometer. This SPST sends power to the relay coils, the op amp and the voltage divider. The signals are redirected to a DPDT footswitch, which routes one or the other to the pedal output.  The other side of the footswitch is used for an LED indicator, which indicates which channel is being passed.  The AB function works un-powered, but not the indicator. 

I hope I haven't missed anything.

PRR

> no audible issues

If what you have, works, I'm happy.

But it isn't wired like that.

"+ In" is biased to +4.5V. R11 R10 set the output/input ratio (gain) to 3.2. The only way the opamp can be happy is by bringing its Out to 4.5V*3.2= 14.4V. However the opamp is fed with zero and +9V. Like a 9-foot tall room, you can't put up a 14 foot pole, and the opamp gets stuck at something under 9V.

If there is a cap in series with R11, it can work. As you know, such details matter.

R.G. has already typed too much about Basic Opamp Theory. Such information is readily available.

Understanding Basic Analog – Ideal Op Amps is short and decent.

Opamps for Everyone (2MB PDF) sections 1-1 to 4.4 and 18.1 to 18.5 is comprehensive but may strain your dedication and attention span.

Kovaks' slide-show (3MB PDF) has some real goofy stuff and maybe not enough meat without the lecture.

Wikipedia is often a good overview of a topic, with references for more information. Remember that Wikipedia is at best a consensus among unvetted contributors; don't believe it without checking and thinking. Also this article.

The Play-Hookey site site is often fun and illuminating.
  • SUPPORTER

mattthegamer463

#17

If there is a cap in series with R11, it can work. As you know, such details matter.


Unbelievably, in the ten times that I had to go back and fix something in my schematic, I still managed to forget the output cap and the R11 cap.  I'll fix this.

EDIT

Image has been fixed, output cap and R11 cap added.

Also, thanks for those links PRR, I haven't seen a couple of those.  Play-hookey is a great site, I've used that one before.

mattthegamer463

I've noticed now that there seems to be a tone-destroying high-pass filter formed somewhere in this circuit, which I need to iron out.  I'm thinking it might be C6 and R10/11 causing the issue.  All the other capacitances and resistances are high values and most likely would result in filtering outside of the audible range.  I might experiment with an inverting setup to see if it changes the problem.

PRR

> tone-destroying high-pass filter

The input impedance is less than R4 10K. Recall what the output impedance of a guitar is: perhaps 10K for lows and 100K for highs. What is the relative gain for lows and highs?


Why is R4 10K? Could it be some other value?
  • SUPPORTER