DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: xorophone on November 30, 2016, 04:37:24 PM

Title: How do I use one pot to mix two signals?
Post by: xorophone on November 30, 2016, 04:37:24 PM
Hello!

I'm doing a small side project where I want two line level stereo audio signals from 2 different computers to be mixed together. I was planning on using ONE potentiometer to change the volume of both audio channels (so that if the pot is all the way to the left you'll only be able to hear one channel, if it was all the way to the right you'd only be able to hear the other channel and if it was in the middle both channels would be mixed equally. Basically like a PAN-knob.)

I tried feeding a signal into pin 1 on the pot and another signal into pin 3. Then I took the output from pin 2 on the pot and connected all of the ground pins together. This kind of worked. It seems to mix the signals together like I wanted it to and I can "sweep" between them, but when I get to a certain value on the potentiometer, the output signal becomes VERY loud and when I recorded it using my audio interface, it got really distorted. When I turned down the gain on the audio interface the distortion actually seemed to go away and it sounded normal again, but it's of course not usable if the signal becomes insanely loud when you turn the pot to a certain degree. I tried using a lower value potentiometer, but it was even worse. The highest I tried was a 1M pot.

I was thinking that you might be able to use a dual gang pot and basically connect them like a normal volume pot with one of the signals going in to pin 1 (on "gang1") and the other going in to pin 3 (on "gang2") and then ground the opposite sides and connect both middle pins together to mix the signal. I'm guessing that would work, but I need to be able to mix stereo signals, which I'm guessing would mean I need a quadruple gang pot. That's not possible because I'll never have space for it and I'm guessing they're really hard to find.

What's the best way to do this? I want to make it passive if possible too. I'm not making any fancy mixer or anything. Just want something very simple to play around with. If it's too hard I guess I'll just use two pots instead, but if possible, I want to do it this way.

Thanks for the help!


Edit: The really loud signal is just a constant distorted sound. You can't hear any of the original two signals in it and it's significantly louder than just the two signals together.
Title: Re: How do I use one pot to mix two signals?
Post by: anotherjim on November 30, 2016, 05:34:43 PM
The basic idea of a balance control is to feed A to pot1 and B to pot3 and ground pot 2. It works by shorting to ground A or B depending which end of the pot wiper (2) is turned to.
Because it shorts, you need resistors in the feeds to prevent damage to whatever is feeding. 10k resistors might be ok with a 100k balance pot. For balance between 2 stereo feeds, a single dual gang pot should do it. One gang balances the left signals and another the right. There will be a little volume loss, but if you want passive it can't be helped.

You might get ground hum between 2 computer audio outs, especially if one or both are laptop.
Title: Re: How do I use one pot to mix two signals?
Post by: Agung Kurniawan on November 30, 2016, 06:41:47 PM
Yep, you may get ground hum. Im prefer to use kind of a triton delay mixing section. Just use setreo pot with pot A be your right chanel and your Pot B your Left. When Pot A3 will be your right input signal, your Pot B1 should be your left input signal.
Both Lug 2 should be you out to opamp. And wire up the other lug to ground.
CMIIW ;)
Title: Re: How do I use one pot to mix two signals?
Post by: xorophone on December 01, 2016, 03:50:28 AM
Quote from: Agung Kurniawan on November 30, 2016, 06:41:47 PM
Yep, you may get ground hum. Im prefer to use kind of a triton delay mixing section. Just use setreo pot with pot A be your right chanel and your Pot B your Left. When Pot A3 will be your right input signal, your Pot B1 should be your left input signal.
Both Lug 2 should be you out to opamp. And wire up the other lug to ground.
CMIIW ;)
Quote from: anotherjim on November 30, 2016, 05:34:43 PM
The basic idea of a balance control is to feed A to pot1 and B to pot3 and ground pot 2. It works by shorting to ground A or B depending which end of the pot wiper (2) is turned to.
Because it shorts, you need resistors in the feeds to prevent damage to whatever is feeding. 10k resistors might be ok with a 100k balance pot. For balance between 2 stereo feeds, a single dual gang pot should do it. One gang balances the left signals and another the right. There will be a little volume loss, but if you want passive it can't be helped.

You might get ground hum between 2 computer audio outs, especially if one or both are laptop.

Great explanations. Thanks!

Jim, where should I put the 10k resistor?

Oh, I didn't think about the ground hum part. That's a shame. Is there a way to eliminate it? I'm guessing it comes from the fact that I'm using multiple ground sources (from both computers).
Title: Re: How do I use one pot to mix two signals?
Post by: anotherjim on December 01, 2016, 05:40:00 AM
Resistors go between each input signal feed wire and the pot lugs 1 or 3.
Normally (in the usual left/right balance control), the outputs are direct from the pot lugs. I think you also need to mix these to one output since one gang has to provide the left and the other the right. That means 2 more resistors.
This is the arrangement...
(http://farm8.staticflickr.com/7282/9741546275_a7b5d04df7_o.gif)

I've been thinking 10k, but soundcard outputs can usually handle lower resistance, since you can also plug 30ohm headphones into them. Try and find the capabilities of yours. So, the values in the diagram might be scaled down by a tenth, giving 1k feed resistors and 4k7 pot and output resistors. The pot type is linear. Lower resistances means it is less loaded by the input impedance of whatever its all feeding.

Ground hum, if a problem... portables are often ok if you can run them only from battery. Otherwise, a low value resistor can be fitted in each ground/screen connection from the inputs. 47ohm might do it.


Title: Re: How do I use one pot to mix two signals?
Post by: ElectricDruid on December 01, 2016, 03:49:32 PM
If you wanted an active solution, you can do this with one 8-pin dual op-amp:

(http://electricdruid.net/wp-content/uploads/2015/06/CrossfaderPot.png) (http://electricdruid.net/single-vca-crossfader/)

Pots 10K, say, Rs all 100K.

The pot controls a mix of the blue signal and an inverted copy of the red signal. At the top of the pot, the red signal is cancelled by the inverted copy, so you get only blue signal. At the bottom, there's no cancellation, and no blue signal, so you get only red signal.

It's a clever trick I saw somewhere once, and I keep finding uses for it.

HTH,
Tom
Title: Re: How do I use one pot to mix two signals?
Post by: xorophone on December 02, 2016, 04:36:42 AM
Quote from: anotherjim on December 01, 2016, 05:40:00 AM
Resistors go between each input signal feed wire and the pot lugs 1 or 3.
Normally (in the usual left/right balance control), the outputs are direct from the pot lugs. I think you also need to mix these to one output since one gang has to provide the left and the other the right. That means 2 more resistors.
This is the arrangement...
(http://farm8.staticflickr.com/7282/9741546275_a7b5d04df7_o.gif)

I've been thinking 10k, but soundcard outputs can usually handle lower resistance, since you can also plug 30ohm headphones into them. Try and find the capabilities of yours. So, the values in the diagram might be scaled down by a tenth, giving 1k feed resistors and 4k7 pot and output resistors. The pot type is linear. Lower resistances means it is less loaded by the input impedance of whatever its all feeding.

Ground hum, if a problem... portables are often ok if you can run them only from battery. Otherwise, a low value resistor can be fitted in each ground/screen connection from the inputs. 47ohm might do it.

Ah thanks! Where do you mean I should place the 47ohm resistor though? Between ground and what? And screen is basically the same as ground, right?

Quote from: ElectricDruid on December 01, 2016, 03:49:32 PM
If you wanted an active solution, you can do this with one 8-pin dual op-amp:

(http://electricdruid.net/wp-content/uploads/2015/06/CrossfaderPot.png) (http://electricdruid.net/single-vca-crossfader/)

Pots 10K, say, Rs all 100K.

The pot controls a mix of the blue signal and an inverted copy of the red signal. At the top of the pot, the red signal is cancelled by the inverted copy, so you get only blue signal. At the bottom, there's no cancellation, and no blue signal, so you get only red signal.

It's a clever trick I saw somewhere once, and I keep finding uses for it.

HTH,
Tom

Thank you! I'll try making it passive first, but otherwise I'll probably use the schematic you shared. :)
Title: Re: How do I use one pot to mix two signals?
Post by: anotherjim on December 02, 2016, 12:28:23 PM
First, try to treat all the ground connections as points of a star, with the output screens at its centre. The 2 pot wipers (lug2) go to the star, the 4 input screens either go to the star or thru low value resistors. The important thing is you get a little resistance between all 3 grounded items - the 2 sources and the destination, but there is no need to fit resistance going to the destination. It is best that the grounds to the pots are well connected to the destination ground.
Title: Re: How do I use one pot to mix two signals?
Post by: xorophone on December 05, 2016, 07:29:56 PM
Quote from: anotherjim on December 02, 2016, 12:28:23 PM
First, try to treat all the ground connections as points of a star, with the output screens at its centre. The 2 pot wipers (lug2) go to the star, the 4 input screens either go to the star or thru low value resistors. The important thing is you get a little resistance between all 3 grounded items - the 2 sources and the destination, but there is no need to fit resistance going to the destination. It is best that the grounds to the pots are well connected to the destination ground.

Sorry for the late reply!

Thanks! I'll start trying this on a breadboard! :)
Title: Re: How do I use one pot to mix two signals?
Post by: noah.vanhaute on June 28, 2018, 03:29:41 PM
So it looks like it has been a year or two since the last post on this thread. But i'd like to know if the passive blend cuircuit actually worked. Thanks!
Title: Re: How do I use one pot to mix two signals?
Post by: merlinb on June 29, 2018, 03:01:33 AM
Quote from: ElectricDruid on December 01, 2016, 03:49:32 PM
If you wanted an active solution, you can do this with one 8-pin dual op-amp:
The pot controls a mix of the blue signal and an inverted copy of the red signal. At the top of the pot, the red signal is cancelled by the inverted copy, so you get only blue signal. At the bottom, there's no cancellation, and no blue signal, so you get only red signal.

There's a better way. It still uses two opamps, but you can use them more independently for whatever you need them to do:

(https://s15.postimg.cc/hohrl47rr/Blend_pot.png) (https://postimages.org/)
Title: Re: How do I use one pot to mix two signals?
Post by: xorophone on June 30, 2018, 06:18:18 AM
Quote from: noah.vanhaute on June 28, 2018, 03:29:41 PM
So it looks like it has been a year or two since the last post on this thread. But i'd like to know if the passive blend cuircuit actually worked. Thanks!

Sorry, but I actually never got around to trying it. I might have a bit of time left over to give it a try next week, but I'll see.
Title: Re: How do I use one pot to mix two signals?
Post by: xorophone on July 03, 2018, 01:59:13 PM
Quote from: noah.vanhaute on June 28, 2018, 03:29:41 PM
So it looks like it has been a year or two since the last post on this thread. But i'd like to know if the passive blend cuircuit actually worked. Thanks!

I can confirm that the circuit does indeed work, but expect a big drop in volume. I tried changing the 10k resistors to 1k, the 50k resistors to 4.7k and the 50k potentiometer to 5k. That greatly increased the output volume, so I suggest making those changes. However, if it's possible for you to use an active circuit I highly recommend that instead.
Title: Re: How do I use one pot to mix two signals?
Post by: noah.vanhaute on July 15, 2018, 03:15:01 PM
Quote from: xorophone on July 03, 2018, 01:59:13 PM
Quote from: noah.vanhaute on June 28, 2018, 03:29:41 PM
So it looks like it has been a year or two since the last post on this thread. But i'd like to know if the passive blend cuircuit actually worked. Thanks!

I can confirm that the circuit does indeed work, but expect a big drop in volume. I tried changing the 10k resistors to 1k, the 50k resistors to 4.7k and the 50k potentiometer to 5k. That greatly increased the output volume, so I suggest making those changes. However, if it's possible for you to use an active circuit I highly recommend that instead.
I'll go for the active solution then, thanks.
Quote from: merlinb on June 29, 2018, 03:01:33 AM
Quote from: ElectricDruid on December 01, 2016, 03:49:32 PM
If you wanted an active solution, you can do this with one 8-pin dual op-amp:
The pot controls a mix of the blue signal and an inverted copy of the red signal. At the top of the pot, the red signal is cancelled by the inverted copy, so you get only blue signal. At the bottom, there's no cancellation, and no blue signal, so you get only red signal.

There's a better way. It still uses two opamps, but you can use them more independently for whatever you need them to do:

(https://s15.postimg.cc/hohrl47rr/Blend_pot.png) (https://postimages.org/)

I assume that I have to use the non-inverting inputs here?
Title: Re: How do I use one pot to mix two signals?
Post by: PRR on July 15, 2018, 07:37:31 PM
> I assume that I have to use the non-inverting inputs here?

Why??
Title: Re: How do I use one pot to mix two signals?
Post by: noah.vanhaute on July 16, 2018, 06:36:15 AM
Quote from: PRR on July 15, 2018, 07:37:31 PM
> I assume that I have to use the non-inverting inputs here?

Why??
Because I'm new to op-amps and don't know which I should use. That's why I asked.
Title: Re: How do I use one pot to mix two signals?
Post by: PRR on July 16, 2018, 01:47:44 PM
> I'm new to op-amps

As are we all.

Explain why you think you "have to use the non-inverting inputs". Others with some more experience may be able to confirm your assumption; or point-out why it is incorrect.
Title: Re: How do I use one pot to mix two signals?
Post by: ElectricDruid on July 17, 2018, 07:14:58 AM
Here's a nice example using that pan/blend circuit with an op-amp to make up the gain:

http://www.geofex.com/Article_Folders/panner.pdf (http://www.geofex.com/Article_Folders/panner.pdf)

You want the circuit in the box on the left.
Title: Re: How do I use one pot to mix two signals?
Post by: Kipper4 on July 17, 2018, 09:56:48 AM
Quote from: PRR on July 16, 2018, 01:47:44 PM
> I'm new to op-amps

As are we all.

Explain why you think you "have to use the non-inverting inputs". Others with some more experience may be able to confirm your assumption; or point-out why it is incorrect.


I on the other hand would assume they are non inverting op amps.
There are many examples on the web.
I assume this because it would be called -A and -B if it was inverting.


Edit.
For what it's worth, my opinion is that the set up advocated by Electric Druid in reply 5 is the way to go.
I wired it up wrong a couple of times before I got it right. It works a treat.
I've tried several times with a passive Pot mixer and was dissapointed with most of them.
Couldnt quite get the mix I wanted.

Title: Re: How do I use one pot to mix two signals?
Post by: ElectricDruid on July 17, 2018, 03:11:28 PM
Quote from: Kipper4 on July 17, 2018, 09:56:48 AM
Edit.
For what it's worth, my opinion is that the set up advocated by Electric Druid in reply 5 is the way to go.
I wired it up wrong a couple of times before I got it right. It works a treat.
I've tried several times with a passive Pot mixer and was dissapointed with most of them.
Couldnt quite get the mix I wanted.

AnotherJim's pan/blend is good too, but it is very lossy in the passive form. It's much better if you use it as the input to an inverting op-amp mixer, so that you get out the same level you put in. That's why I posted the Geofex article - it includes that same circuit, but in an active form without the problems.

T.

Title: Re: How do I use one pot to mix two signals?
Post by: Processaurus on January 16, 2022, 09:29:27 PM
Quote from: ElectricDruid on December 01, 2016, 03:49:32 PM
If you wanted an active solution, you can do this with one 8-pin dual op-amp:

(http://electricdruid.net/wp-content/uploads/2015/06/CrossfaderPot.png) (http://electricdruid.net/single-vca-crossfader/)

Pots 10K, say, Rs all 100K.

The pot controls a mix of the blue signal and an inverted copy of the red signal. At the top of the pot, the red signal is cancelled by the inverted copy, so you get only blue signal. At the bottom, there's no cancellation, and no blue signal, so you get only red signal.

It's a clever trick I saw somewhere once, and I keep finding uses for it.

HTH,
Tom

Hi Tom, I breadboarded this blend circuit and ran into a worrisome problem: Input A didn't null out when the pot is all the way on the B side. I thought it was just because the gain wasn't matched perfectly between the positive and negative versions of the A signal, but even after trimming it in to max rejection, I would get this high frequency bleed on the transients. I tested it with a triangle wave for B and square wave for A, and got these sharp, big spikeys when the square wave would change polarity. I think the problem was a little phase shift between the two copies of A and them not nulling out. I would worry that with the phase shift + mix there's comb filtering to A as it gets blended away.

Have you used this for audio and had a chance to look at it on the scope? I could see it working fine for synth stuff with CV mixing. I used Lm358 opamp, can try something fancier if opamp choice is crucial?
Title: Re: How do I use one pot to mix two signals?
Post by: Rob Strand on January 17, 2022, 12:53:38 AM
QuoteI tested it with a triangle wave for B and square wave for A, and got these sharp, big spikeys when the square wave would change polarity. I think the problem was a little phase shift between the two copies of A and them not nulling out. I would worry that with the phase shift + mix there's comb filtering to A as it gets blended away.
Any phase shift drastically prevents cancellation.   You can get similar problems on circuits like U1 on their own.

Ideally you would put a delay equalization stage in the top part of the circuit which has the same phase-shift characteristics as the U1 stage.  That could be an opamp.

Another method is to add delay by putting a low-pass in the top wire between the input R and input A.  The inverting U1 input resistor needs to connect directly to Input A, before the filter.   This method needs some fiddling to get the gains and phase right.
 
An easy tack-on solution is to use a phase lead-newtork.
(https://i.postimg.cc/sMMrkJ08/Delay-Equalization-by-Lead-Network.png) (https://postimg.cc/sMMrkJ08)

You need to make sure the feed impedance is low enough. 

Notice how the cancellation extends way up in frequency instead of getting progressively worse with frequency.    By the same token the cap needs to be chose to match the delay of the U1 stage.  I've given a formula but that assumes the GBW is exactly known.   I've set the cap for 1MHZ as the GBW for the opamps in the simulation is 1MHz.  Some circuits go so far as to use an adjustable cap for Cx!


Another form of fizz on the LM358 is crossover distortion.  That probably won't cancel.
You can try adding a pull down resistor for single supply ckts.

10k is shown here but people have used lower values depending on the circuit.
https://electronics.stackexchange.com/questions/341843/adding-a-resistor-to-reduce-crossover-distortion-in-an-lm324-lm358

Title: Re: How do I use one pot to mix two signals?
Post by: Processaurus on January 17, 2022, 02:09:33 AM
Quote from: Rob Strand on January 17, 2022, 12:53:38 AM
QuoteI tested it with a triangle wave for B and square wave for A, and got these sharp, big spikeys when the square wave would change polarity. I think the problem was a little phase shift between the two copies of A and them not nulling out. I would worry that with the phase shift + mix there’s comb filtering to A as it gets blended away.
Any phase shift drastically prevents cancellation.   You can get similar problems on circuits like U1 on their own.

Ideally you would put a delay equalization stage in the top part of the circuit which has the same phase-shift characteristics as the U1 stage.  That could be an opamp.

Another method is to add delay by putting a low-pass in the top wire between the input R and input A.  The inverting U1 input resistor needs to connect directly to Input A, before the filter.   This method needs some fiddling to get the gains and phase right.
 
An easy tack-on solution is to use a phase lead-newtork.
(https://i.postimg.cc/sMMrkJ08/Delay-Equalization-by-Lead-Network.png) (https://postimg.cc/sMMrkJ08)

You need to make sure the feed impedance is low enough. 

Notice how the cancellation extends way up in frequency instead of getting progressively worse with frequency.    By the same token the cap needs to be chose to match the delay of the U1 stage.  I've given a formula but that assumes the GBW is exactly known.   I've set the cap for 1MHZ as the GBW for the opamps in the simulation is 1MHz.  Some circuits go so far as to use an adjustable cap for Cx!


Another form of fizz on the LM358 is crossover distortion.  That probably won't cancel.
You can try adding a pull down resistor for single supply ckts.

10k is shown here but people have used lower values depending on the circuit.
https://electronics.stackexchange.com/questions/341843/adding-a-resistor-to-reduce-crossover-distortion-in-an-lm324-lm358

Thanks for the tips, I didn’t know about the crossover distortion in the 324/358 family. I was using it single supply so I’ll try the resistor to ground and see if that improves.  Good idea about copying phase shift on the split off signal A that goes to the second opamp, that makes sense. The cap stuff I’ll give a try, for production circuits a cap is cheaper than an opamp. I might trust the opamp more, because it is going through an identical circuit, but if the A signal nulls out completely it proves it is identical.

Edit: The simulation work is nice. What are the two lines on the graph, the blue and the green?
Title: Re: How do I use one pot to mix two signals?
Post by: Rob Strand on January 17, 2022, 05:32:52 AM
QuoteI might trust the opamp more, because it is going through an identical circuit, but if the A signal nulls out completely it proves it is identical.
Opamps have tolerances like resistors and caps they aren't as exactly equal as you might think.   However, opamps from the same package or batch would be expected to be close.

QuoteEdit: The simulation work is nice. What are the two lines on the graph, the blue and the green?

The simulation shows how much of signal A leaks through to the output when the  "pot" is set to the position where no signal A should come out.  The green is the circuit at it is now, at low frequencies the signal A leakage is low (-89dB) but as the frequency increases more of signal A leaks through (-35dB at 10kHz).  So you would expect to hear highs of signal A coming through a bit.   The reason it gets worse is the phase shift of opamp U1 gets more and more and the two signal A paths don't cancel.   The blue trace is when the phase lead network (Rx+Cx) is added to equalize the phase shift.   The improvement is clear (in theory) as there is very little  signal A leaking through, it stays below -90dB upto 20kHz or so.

This of course assumes the resistors have been tweaked to get good cancellation.  The thing is, even if you adjust the resistors for the best cancellation the unmodified circuit still "mysteriously" leaks some high frequencies through and that's because of phase shift  No matter what you do with the resistors they resistor never quite do it.   With the mod it fixes the underlying problem of the phase mismatch.

There's some really cool tricks people have come up with over the years to reduce opamp phase shift, like this one,

https://www.analog.com/media/cn/technical-documentation/application-notes/an-107.pdf

I think I saw the circuit used in some Hewlett-Packard equipment.
Title: Re: How do I use one pot to mix two signals?
Post by: Vivek on January 17, 2022, 07:19:33 AM
Does a MN pot count as one pot,

And can it be used to do what you want ?
Title: Re: How do I use one pot to mix two signals?
Post by: Processaurus on January 17, 2022, 04:04:24 PM
Quote from: Vivek on January 17, 2022, 07:19:33 AM
Does a MN pot count as one pot,

And can it be used to do what you want ?

Not here, but it is an interesting part. I had to look it up, it is a dual pot that does a full 1:1 blend in the middle:

QuoteM taper: 0% to 100% output voltage from 0% to 50% rotation (linear). 100% output voltage from 50% to 100% rotation.

N taper: 100% output voltage from 0% to 50% rotation. 100% to 0% output voltage from 50% to 100% rotation (linear).

Full output for both outputs at 50% rotation (center detent).
Title: Re: How do I use one pot to mix two signals?
Post by: Processaurus on January 19, 2022, 04:24:00 AM
Quote from: Rob Strand on January 17, 2022, 05:32:52 AM
QuoteI might trust the opamp more, because it is going through an identical circuit, but if the A signal nulls out completely it proves it is identical.
Opamps have tolerances like resistors and caps they aren't as exactly equal as you might think.   However, opamps from the same package or batch would be expected to be close.

QuoteEdit: The simulation work is nice. What are the two lines on the graph, the blue and the green?

The simulation shows how much of signal A leaks through to the output when the  "pot" is set to the position where no signal A should come out.  The green is the circuit at it is now, at low frequencies the signal A leakage is low (-89dB) but as the frequency increases more of signal A leaks through (-35dB at 10kHz).  So you would expect to hear highs of signal A coming through a bit.   The reason it gets worse is the phase shift of opamp U1 gets more and more and the two signal A paths don't cancel.   The blue trace is when the phase lead network (Rx+Cx) is added to equalize the phase shift.   The improvement is clear (in theory) as there is very little  signal A leaking through, it stays below -90dB upto 20kHz or so.

This of course assumes the resistors have been tweaked to get good cancellation.  The thing is, even if you adjust the resistors for the best cancellation the unmodified circuit still "mysteriously" leaks some high frequencies through and that's because of phase shift  No matter what you do with the resistors they resistor never quite do it.   With the mod it fixes the underlying problem of the phase mismatch.

There's some really cool tricks people have come up with over the years to reduce opamp phase shift, like this one,

https://www.analog.com/media/cn/technical-documentation/application-notes/an-107.pdf

I think I saw the circuit used in some Hewlett-Packard equipment.

(https://i.postimg.cc/FYYc85bz/2-D929674-3244-484-F-A0-A8-26929-AA767-B9.jpg) (https://postimg.cc/FYYc85bz)

Thanks for the tips and simulation, I messed with the breadboard some more but no joy.  The phase lead RC combo had no benefit here, at least with my version with 100K R's and 10K pot.  I tried a few versions, 330 ohm + 33pF, 3.3K with 33pF, 330ohm with 330pF, 3.3K with 330pF.  No effect from the smaller capacitors, the larger capacitors just made it oscillate.  I also tried a non inverting opamp follower on the A side, but that didn't help duplicate the phase shift, maybe the phase shift is different using the inverting configuration.  Note, this was all single supply, 9v. I suppose I could have tried two inverting followers in a row, on the A side, but then we have a 4 opamp blend...

The one thing that sort of improved bleed was switching from LM358 to TL082, but it didn't solve the problem, just less phase shift.  Just as much bleed, but a little higher frequency.

(https://i.postimg.cc/2V8ndBV4/DE04900-D-C24-B-4209-8907-4-DF65-C77608-A.jpg) (https://postimg.cc/2V8ndBV4)

I'm giving up on this circuit, because with 10 minutes of breadboarding I got the "dumb" circuit, the simple two opamp followers  feeding each end of a pot, to work beautifully.  Each side ate 1/2 voltage in the center. Interestingly with the LM358 there was some bleed in the form of a little ugly crossover distortion, from the square wave with the pot panned to the triangle side.  I was wondering if this might have something to do with the issue you mentioned, but a 10K load resistor to ground didn't help anything. This distortion doesn't happen with the TL082, it could sink the current from the other opamp through the 10K pot just fine.  I imagine going larger on the blend pot, like 50K, would make less current leak through the pot, so less current for the opposite opamp to fight to keep its output accurate.

Title: Re: How do I use one pot to mix two signals?
Post by: Rob Strand on January 19, 2022, 05:48:21 PM
QuoteThanks for the tips and simulation, I messed with the breadboard some more but no joy. 

QuoteThe phase lead RC combo had no benefit here, at least with my version with 100K R's and 10K pot.  I tried a few versions, 330 ohm + 33pF, 3.3K with 33pF, 330ohm with 330pF, 3.3K with 330pF.  No effect from the smaller capacitors, the larger capacitors just made it oscillate.  I also tried a non inverting opamp follower on the A side, but that didn't help duplicate the phase shift, maybe the phase shift is different using the inverting configuration.  Note, this was all single supply, 9v. I suppose I could have tried two inverting followers in a row, on the A side, but then we have a 4 opamp blend...

It's likely there's an even deeper issue causing it.

FYI:
Upfront, the square wave if quite aggressive and the signal has frequency components outside of the audio range.  So while you can see things getting through on the oscilloscope those frequency components won't be present with audio signals.  With any form of phase equalization it's likely the matching will only go up to some maximum frequency so even if every is working we woul still *expect* to see something getting through on the oscilloscope.  The way to test the phase matching part is working is to use a sinewave say at 10kHz then tune the cap to cancel at 10kHz.   If that works you know the idea is working and it is unrealistic to *expect* full cancellation with the square wave, especially at the edges.

There's a even bigger issue with square wave testing.   Slew-rate limiting.   The output of U1 is an inverted versions of signal A and is at full level.   It's extremely likely U1 will slew-rate will with a square-wave input.   When that happens it's almost like U1 has no output, and then there's no cancellation signal.   No matter what phase-compensation is in place you cannot fix this situation.   Testing at 10kHz [SINEWAVE], and at a level which doesn't cause slew limiting will also prove this.

I really think the issue in your case is slew-rate limiting because all the phase compensation methods did nothing.

So if every thing looks good with at 10kHz [SINEWAVE] but falls in a heap with a square-wave you know it's one of the above cases.  You might expect a very small improvement when you add the extra non-inverting opamp.

As for the oscillation issue.   Yes that can happen.  The 330 ohm resistor helps but you might need to add a cap across the 10k (or 100k) feedback resistor; 330R for 10k feedback is  equivalent 3k3 for 100k feedback resistor.   For 100k feedback resistors you would need very small caps like 3pF to 4pF for the compensation cap.     For the TL074/TL084 the cap is even smaller.  With such small caps the theory falls apart because there's stray capacitances everywhere and things do not work like the schematic.  From that perspective 10k resistors are better.

A faster opamp would be expected to have less problems but it's still possible to cause it to slew-limit with a wide-bandwidth square-wave input.   The same problem is there just on a different time scale.

QuoteI'm giving up on this circuit, because with 10 minutes of breadboarding I got the "dumb" circuit, the simple two opamp followers  feeding each end of a pot, to work beautifully.  Each side ate 1/2 voltage in the center. Interestingly with the LM358 there was some bleed in the form of a little ugly crossover distortion, from the square wave with the pot panned to the triangle side.  I was wondering if this might have something to do with the issue you mentioned, but a 10K load resistor to ground didn't help anything. This distortion doesn't happen with the TL082, it could sink the current from the other opamp through the 10K pot just fine.  I imagine going larger on the blend pot, like 50K, would make less current leak through the pot, so less current for the opposite opamp to fight to keep its output accurate.
Yes, those simple circuits (as jim and merlin posted) are much more robust.   When you set the pot to one side or the other selected signal path has to come out and the non-selected signal is blocked by a voltage divider.   It doesn't need *cancellation* of two signals - that's where the problems creep in because everything needs to match-up for cancellation to occur.   The thing ElectricDruid's circuit gives is a *grounded* single-ganged pot.

For crossover distortion you can try smaller resistors.   You can also try a resistor to +V instead of ground although I'm pretty sure the resistor to ground was a bit better.     You might still be seeing some slew-rate limiting as well, it will be worse on the LM358 for sure.
Title: Re: How do I use one pot to mix two signals?
Post by: PRR on January 20, 2022, 01:37:08 AM
> Interestingly with the LM358

The LM358/LM324 is a terrible audio opamp. Only in pedal-world (where signals are small and loads are light) could you even stand to listen to one. I didn't know better but first time I put audio through a LM324 I knew in a minute that I had a Real Problem (concert that night).

Find the datasheet (https://www.ti.com/lit/ds/symlink/lm158-n.pdf). The output is push-pull emitter followers. With zero bias. The VAS has to slew three Vbes to sing from push to pull. Actually in 9V-world loads 10K and higher will swing from the 50uA current source, but it runs out of juice real fast. NFB tries to make it cross-over quick but it is basically a not-fast process and prone to slewing through crossover for most of the audio band.

Using it as one side of a blend for triangles or squares is bringing-out the worst of the cheap chip's crossover and slew. Just don't do that. As I think you have said, a '072 is same-price and miles better.