Cross fading between two opamp outputs using a DIGIPOT's wiper?

Started by Gurner, September 22, 2010, 03:45:13 AM

Previous topic - Next topic

Gurner

I have two different small AC signals that I'd like to sweep between - each of these signals is presented at the output pin of an opamp.

If I put a traditional pot with the 'A' end at the output of one opamp & the 'B' end attached to the output of the other opamp....all is well on the wiper (ie I can sweep between the two signals & see this happening on a scope).

However, if I put in a digipot & sweep from the A end to the B end....bad stuff happens - it doesn't work - fugly signal seen on scope.

Can anyone put forward a top tip why?

Froma DC perspective, the output of both opamps are biased at 1/2 VCC.

d95err

It's difficult to know what the problem is without a schematic.

The DC level could be the problem. Try coupling caps between the opamp outputs and the pot.

R.G.

+1

In addition, most digipots have a limited voltage range, typically to the DC supply of the logic side of the digital pot. Signals exceeding that range may do ugly things.
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.

Gurner

Thanks gents...I'm not a home right now, so can't immediately check...but I think RG's reaffirmation about the max signal a digipot can handle being limited (to less than the Digipot's VCC) is the line of enquiry to follow when I get home.

1/2 VCC in my circuit is about 4V.....so the output of the opamp is stitting at this DC level quiescently - and as it goes the digipot's VCC is 4V. As soon as an AC signal enters the equation that takes the overall level into the A & B legs of the pot way above 4V  ....kaboom - won't work.

I don't want to put in a decoupling cap in series (ie between the opamp output & DIGIPOT's  A & B ends), so will slap in a potential divider at the output of each opamp, to reduce the DC & the AC aspect of the signal  coming out of the opamps (to keep within the confines of the DIGIPOT's VCC).

hey, it was late, hey I was getting transfixed on another aspect of my circuit., hey I'd swallowed some particularly strong magic mushrooms ***...sometimes you miss the obvious!

Many thanks.


** insert lame excuse of choosing here.

merlinb

Quote from: Gurner on September 22, 2010, 08:56:40 AM
I don't want to put in a decoupling cap in series (into the pot A & B ends), so will slap in a potential divider at the output of each opamp, whcih will reduce the DC & the AC aspect of the signals  coming out of the opamps (to keep within the confines of the DIGIPOT's VCC).
If you do that then you will no longer be able to vary the signal from fully A to fully B; it will always be a mix of the two.
Why don't you want to use coupling caps?

Gurner

Quote from: merlinb on September 22, 2010, 08:59:18 AM
If you do that then you will no longer be able to vary the signal from fully A to fully B; it will always be a mix of the two.
Why don't you want to use coupling caps?

Hmm...(adopts furrowed brow) - let's say the signals are 180 ouf of phase from each opamp. One end of the wiper will therefore have a reduced in phase signal ...the other end of the wiper will have a a reduced 'out of phase' signal - won't the wiper will move from fully in phase to fully out of phase as it gets to each end?


merlinb

Quote from: Gurner on September 22, 2010, 09:05:27 AM
Hmm...(adopts furrowed brow) - let's say the signals are 180 ouf of phase from each opamp. One end of the wiper will therefore have a reduced in phase signal ...the other end of the wiper will have a a reduced 'out of phase' signal - won't the wiper will move from fully in phase to fully out of phase as it gets to each end?
If the signal are identical (except for being out of phase) then yes. I assumed you had very different signals.

Gurner

Quote from: merlinb on September 22, 2010, 08:59:18 AM
Why don't you want to use coupling caps?

Well, indeed it was a level problem - two caps at the input to each digipot l'A' & 'B' legs has got rid of the waveform ugliness... the trouble with the solution is that it has introduced a small phase lead  (which is why I was against using caps!).

For my particular circuit, any phase shift is the spawn of the devil....



(blue trace is original signal - fed to the digipot leg 'A' ...red trace is the digitpot wiper output when it is hard to 'A leg side)

merlinb

Quote from: Gurner on September 22, 2010, 11:59:56 AM
Well, indeed it was a level problem - two caps at the input to each digipot l'A' & 'B' legs has got rid of the waveform ugliness... the trouble with the solution is that it has introduced a small phase lead  (which is why I was against using caps!).
Can't you just use bigger caps? Surely 47uF or 100uF wouldn't cause a problem in the audio region?

Taylor


Gurner

Quote from: merlinb on September 22, 2010, 12:37:30 PM
Can't you just use bigger caps? Surely 47uF or 100uF wouldn't cause a problem in the audio region?

Possibly...but I'd rather not (space is too tight & at higher frequencies, there'd still be discernible phase shift)

Yes Taylor....you're bang on the money!

(in the end I aborted using a digitpot to X fade....but prior to binning the idea I did I manage to eliminate the phase shft above, by using a potential divider into the legs of the pot)

Lurco

Quote from: Gurner on September 23, 2010, 03:56:04 AM
Quote from: merlinb on September 22, 2010, 12:37:30 PM
Can't you just use bigger caps? Surely 47uF or 100uF wouldn't cause a problem in the audio region?

Possibly...but I'd rather not (space is too tight & at higher frequencies, there'd still be discernible phase shift)

Yes Taylor....you're bang on the money!

(in the end I aborted using a digitpot to X fade....but prior to binning the idea I did I manage to eliminate the phase shft above, by using a potential divider into the legs of the pot)
At higher frequencies? I would have guessed at the lower frequencies. Is above a scope image or a simulation? If it is a scopetrace you might as well try to match the values of the caps. Or is the phaseshift a matter of different potsettings with identical capacitors?

Gurner

Quote from: Lurco on September 24, 2010, 01:05:48 PM

At higher frequencies? I would have guessed at the lower frequencies. Is above a scope image or a simulation? If it is a scopetrace you might as well try to match the values of the caps. Or is the phaseshift a matter of different potsettings with identical capacitors?

The scope was a true actual trace (ie from my USB scope)....the output of the digipot digipot feeds an all pass filter ....this phase lead seen  becomes larger as the frequency increases (therefore it's probably more a function of the interaction of the decoupling cap->digitpot->decoupling cap-> all pass

jasperoosthoek

Just a random question about digipots:

Do they produce gliches when you change the values and does this depend on how many steps you 'skip'?

I bought some expensive +/- 15 volts or 30 volts DC digipots years ago (AD7376). They have a DIP package and have the highest supply range I could find . At  the time I wanted to use them in a tube amp as gain pots. Add a PIC chip or Arduino and build a midi controlled amp. At the time I worried too much about what could go wrong and never breadboarded anything.

I'm still wondering if it would have worked.
[DIYStompbox user name]@hotmail.com

Gurner

Quote from: jasperoosthoek on September 24, 2010, 05:35:22 PM
Just a random question about digipots:

Do they produce gliches when you change the values and does this depend on how many steps you 'skip'?

I bought some expensive +/- 15 volts or 30 volts DC digipots years ago (AD7376). They have a DIP package and have the highest supply range I could find . At  the time I wanted to use them in a tube amp as gain pots. Add a PIC chip or Arduino and build a midi controlled amp. At the time I worried too much about what could go wrong and never breadboarded anything.

I'm still wondering if it would have worked.

I'm not sure yet - but will let you know soon(ish!)

Re 'jumping between extreme values' ...yep that'll produce glitches...so I code in a way to 'glide' between digipot values (albeit bloody fast!)

The background here is I previously used 32 step digipots in an AGC type implementation - they sucked (not enough resolution). The trouble is, all the digital pots with decent resolution (& I call 256 steps starting to get towards decent resolution) need a dedicated high-ish speed serial protocol to control them via (I2C or SPI) & I didn't know how that was done (roughly decoded - I had to go & learn an awful lot about PICs, & once I understood PICS, I could then more easily grasp controlling digipots over a serial connection). So now having got to grips with PICs, I've only just learnt how to use SPI (I only revisited interfacing via SPI about a week ago), so can control the 256 step digipots with ease now. Just got to find sufficient time to explore using them in actualy circuits (I'm interested in tehir application within filters).

I'd have to say, I find the potential very exciting - for example a six way digital pot (go get yourself an AD5206 sample from Analog Devices - they'll send you one in DIP24 format for free!), with each of the six pots having 256 discreet values....all this on a SOIC24 package (DIY-able) for about £2.50 ($4.00)...now from a value for money perspective - that's stupidly cheap!!!

Utlimately, it'll depend on their implementation, but I'd be very surprised if each step is audibly discernible wrt 256 step digipots.

jasperoosthoek

Cool, keep me porsted on your progress!

When I was a student about six years ago I learnt to program a PIC18F. My project involved reading two ADCs with SPI then store tho info and send it over a serial port to a computer. I never used the two wire interface. I think it must be more difficult.

At the time I had great plans. I wanted to build all sorts of effects switching devices and midi controlled amps. But I devoted most of my time in playing the old axe. Instead on making random amps I didn't have any need for at then time I built quite a lot of analog effects since then but nothing digital. I've learned a lot from occational builds and even applied a lot of that knowledge to my day time job. As my playing skills improve and because I'm starting t play in a band next week I might start to need a good amp ;). Maybe even digitally controlled.
[DIYStompbox user name]@hotmail.com

Hides-His-Eyes

Bit of confusion about digital pots... Can you pass an audio signal through (within headroom) without distorting it? Could you use them to have say, digital amp channels in an analogue pedal?

Gurner

Sure...I'm passing audio through them without any discernible distortion visible on a scope (re my earlier scope trace further up ....one of those waveforms - the red one - had gone through a digital pot...the blue trace hadn't - no difference!).

So long as you work within their constraints (which in the main is keeping current through them low - eg less than 1mA ....& ensure the signal is within the limits of the digital pot's supply), they work much like a mechanical pot.

Hides-His-Eyes

1mA? So for a gain control in a clipping pedal with silicon diodes at about a volt, you'd need a minimum gain setting of 1k? That's doable :)

Or say for a 10k output control, max signal of 10V?

1mA doesn't sound like much, but I guess it is really!