Opamp + digital potentiometer = no zero

Started by JK Sleepling, November 02, 2021, 09:59:22 AM

Previous topic - Next topic

ElectricDruid

Quote from: Vivek on November 03, 2021, 02:30:21 PM
The voltage divider formula is on the next page.

And it shows that in almost all cases, wiper resistance is immaterial in voltage divider application. And it shows you can get 0V on wiper if B is tied to ground.

Sorry Vivek, I don't agree. The text at the top of page 16 above that formula says "If ignoring the effect of the wiper resistance for simplicity..." which is why they left it out. If you look at the full formula on the previous page, you'll see the "3 x Rw" term for the wiper resistance.


Rob Strand

#21
QuoteSorry Vivek, I don't agree. The text at the top of page 16 above that formula says "If ignoring the effect of the wiper resistance for simplicity..." which is why they left it out. If you look at the full formula on the previous page, you'll see the "3 x Rw" term for the wiper resistance.

I re-read the datasheet and found page 16 as well.   The potentiometer is mode is stated is it should give zero output and equation 3 implies the same.  However after looking at fig 27, it has to be an approximation.  That's the cause of Vivek's beef.

The reason you don't get zero output in reostat mode is because there are switches between nodes B and nodes W and those switches don't have zero resistance.   They add up to 3Rw, which agrees with equation 2.

For potentiometer mode, zero output is when the lower three switches are closed.   The current down the pot resistance must pass through two Rw switches before reaching the ground at B.  No current flows through the wiper Rw switch.   So in this mode we save the voltage drop across one switch.

So the minimum output in pot divider mode is approx 2Rw / Rpot.
A feedback connection in Rheostat mode is approx 3Rw / Rin  = 3Rw / Rpot  if we choose Rin = Rpot.    } a bit worse than that as
The connection I suggested gives  2Rw / (Rpot + Rin) = Rw/Rpot  if we choose Rin = Rpot                      } I left off RAB/256
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

ElectricDruid

Classic datasheet nonsense: Even when we all read it, we still don't know exactly what it does!  ::)

Rob Strand

QuoteClassic datasheet nonsense: Even when we all read it, we still don't know exactly what it does! 
A problem which just keeps getting worse over time.

At least now we get the general idea.   The lack of a top switch at A agrees with the potentiometer mode not giving full gain of 1.

If you think about it it's not exactly clear how many 4Rs, 2Rs and 1Rs resistors are *really* there.  All we know is there are three stages.   Maybe they have extra switches and more resistors for tolerance reasons.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek


Rob Strand

QuoteAnalog Device's patent for segmented RDAC by successive approximation:
I look at it as a big string of equal value resistors.  Like the top left divider in this pic,



Imagine 256 resistors R like that.     Now you can reduce the number of resistor by noticing that at any particular setting you can sum-up the individual resistors above and below the tap point into bigger bundles of 4R and 2R.   That way you only need a small number of resistors of value R for fine resolution.    The side effect breaking it down into bundles is you need switches between the bundles.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

JK Sleepling

Quote from: Vivek on November 03, 2021, 03:05:09 AM
You placed digipot after 2 Opamps

If send 2 has a 100K digipot at the very output, maybe the impedance seen by the next stage after wiper is 25K

Maybe that is sufficiently low of an output impedance and will work


However if you place the digipot in between the two opamps, the output impedance will be effectively zero (You might add a 2K in series with right opamp, as current limit resistor)


Please try to simulate :

Leftmost Opamp is input buffer
It feeds digipot(s) as a volume control(s)
wiper of digipot goes to right opamp (buffer + gain). (This Opamp has 2K CLR)


Cool! I think I'm a little lost in the last comments here. Any simple conclusion for a newbee on that?   :icon_confused: :icon_lol:

Your suggested setup works well too. I drew it into SEND3 in CircuitLab. Will test it on the breadboard later today.

The minimum gain is down at -388db, -the same as SEND2 with the volume control last in chain.

The gain increments look different though. Increments get narrower closer to unity. Whereas the SEND2 circuit get narrower closer to max output. 
On SEND2  0-27% of the pot is -388db to unity and the last 73% is unity to +11.4dB.
On SEND3  0-73% of the pot is -388db to unity and the last 27% is unity to +11.4dB.

This is probably ok or maybe even a good thing. Just an observation so far.


SEND2 (pot after amp)


SEND3 (pot before amp)





Vivek



R5 has to be 10 times bigger than digipot
But big R5 will have more noise.


Maybe better to use 10k digipot ?

I'm not sure re DC leakages from digipots and need for DC decoupling cap.

Vivek

#28
Most Digipots are linear

Volume pots are log

One will need to approximate the log curve

Either with some resistors in series/ parallel

Or in your uController.


https://www.maximintegrated.com/en/design/technical-documents/app-notes/3/3996.html

JK Sleepling

Quote from: Vivek on November 04, 2021, 05:31:54 AM

R5 has to be 10 times bigger than digipot


Does this mean my current SEND3 drawing wont work in reallity?

And yes decoupling is needed. Big difference if a put a 10uF after the digipot.

Vivek

Small R5 will work, but graph of pot value versus output will be different.


You can plot output at wiper of digipot when connected /disconnected from R5 and see effect of loading the digipot.

JK Sleepling

Quote from: Vivek on November 04, 2021, 06:55:50 AM
Small R5 will work, but graph of pot value versus output will be different.


You can plot output at wiper of digipot when connected /disconnected from R5 and see effect of loading the digipot.

Got it! Thanks

Thought I could work around this issue by using a non-inverting op-amp circuit, but the phase is getting weird.







Vivek

Quote from: ElectricDruid on November 03, 2021, 04:47:23 PM
Quote from: Vivek on November 03, 2021, 02:30:21 PM
The voltage divider formula is on the next page.

And it shows that in almost all cases, wiper resistance is immaterial in voltage divider application. And it shows you can get 0V on wiper if B is tied to ground.

Sorry Vivek, I don't agree. The text at the top of page 16 above that formula says "If ignoring the effect of the wiper resistance for simplicity..." which is why they left it out. If you look at the full formula on the previous page, you'll see the "3 x Rw" term for the wiper resistance.


Tom, you are right !!

We cannot get 0.0000 at bottom of digipot when used as voltage divider.

for best case on 100K pot, we could get maybe 200 ohms as 3Rw so voltage of 200/100.4k = 0.002 as minimum when D = 0

JK Sleepling

#33
Quote from: Vivek on November 04, 2021, 09:16:40 AM
Quote from: ElectricDruid on November 03, 2021, 04:47:23 PM
Quote from: Vivek on November 03, 2021, 02:30:21 PM
The voltage divider formula is on the next page.

And it shows that in almost all cases, wiper resistance is immaterial in voltage divider application. And it shows you can get 0V on wiper if B is tied to ground.

Sorry Vivek, I don't agree. The text at the top of page 16 above that formula says "If ignoring the effect of the wiper resistance for simplicity..." which is why they left it out. If you look at the full formula on the previous page, you'll see the "3 x Rw" term for the wiper resistance.

Tom, you are right !!

We cannot get 0.0000 at bottom of digipot when used as voltage divider.

for best case on 100K pot, we could get maybe 200 ohms as 3Rw so voltage of 200/100.4k = 0.002 as minimum when D = 0

Sooo. If I understand correctly, if minimum is (at best) 200 ohms I'll end up with a minimum gain at -43dB instead of -388dB. Back to square one?