Author Topic: Playing with R2R ladders  (Read 1471 times)

0 Members and 1 Guest are viewing this topic.

Offline jgalakTopic starter

  • Regular Contributor
  • *
  • Posts: 237
  • Country: us
  • KQ2Z
    • Blog, mostly about learning electronics.
Playing with R2R ladders
« on: February 03, 2018, 05:50:48 pm »
So I built a poor-man's 4-bit DAC by using some resistors to form an R2R ladder.  Worked well - I could create something that looked like a stair-step sine wave which, after being buffered with an op-amp and fed through a low-pass filter, gave me a decent sine wave.

I kind of arbitrarily chose 12k and 24k resistors (1%) for the ladder, and it worked well.  Whole thing was built up on a solderless breadboard, but since the speeds were low (under 3kHz) the breadboard capacitances and resistances, and the lead inductances, didn't really matter.

I then got to thinking - the actual resistor values don't matter, and higher resistor values would mean lower current draw, right?  So I swapped out for some 1.8M and 910k resistors.  The resultant waveform went all over the place.  Jagged, not resembling any reasonable sinewave, etc. 

I'm wondering why.  I can see two possibilities:  1) with resistances that high, the poor connections of the solderless breadboard are enough to throw the tolerances all over the place or 2) the very low currents through these resistors (microamps) aren't enough to drive the op amp in a stable fashion (or even the scope probe when I probe upstream of the amp). 

I'm tending towards #1, in which case a properly built up PCB should resolve the issue, but before I start soldering I was hoping for a sanity check.  Thoughts?
Blog, mostly about learning electronics: http://kq2z.com/
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5877
  • Country: de
Re: Playing with R2R ladders
« Reply #1 on: February 03, 2018, 06:27:15 pm »
Think about bias current and offset current for the opamp inputs. Contact resistance is quite certainly not an issue.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Playing with R2R ladders
« Reply #2 on: February 03, 2018, 06:42:54 pm »
Post a scope image!

Besides the problem of non-ideal op amps, consider just the high impedance of the revised circuit and the amount of electric field surrounding everything.  Can a fluorescent lamp with an electronic ballast influence a high impedance circuit?  Sure!  To try it, just touch one of the resistor junctions and see what happens to the trace.

Are you using x10 on your scope probes?  x1 will be a problem because it is only has about 1 Mohm of input impedance and that's lower than the 2R value.

 

Offline Damianos

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: gr
Re: Playing with R2R ladders
« Reply #3 on: February 03, 2018, 07:35:56 pm »
...
I then got to thinking - the actual resistor values don't matter, and higher resistor values would mean lower current draw, right?  So I swapped out for some 1.8M and 910k resistors.  The resultant waveform went all over the place.  Jagged, not resembling any reasonable sinewave, etc. 
This thought is wrong for real circuits. With increasing resistance values, any effect of leakage and bias currents becomes significant.
Quote
I'm wondering why.  I can see two possibilities:  1) with resistances that high, the poor connections of the solderless breadboard are enough to throw the tolerances all over the place
This is the opposite: with hight higher values of the resistors, the resistance of the contacts becomes less important (it is a less percentage of the total value.
Quote
or 2) the very low currents through these resistors (microamps) aren't enough to drive the op amp in a stable fashion (or even the scope probe when I probe upstream of the amp).
These both have their roles to produce difficulties. I don't know which op-amp you use, so I can't say more about it. For the oscilloscope probe think what is the percentage of the error due to the resistance, even if it is a 10X one.
Also keep in mind that high resistance circuits are more susceptible to interference.
Quote
I'm tending towards #1, in which case a properly built up PCB should resolve the issue, but before I start soldering I was hoping for a sanity check.  Thoughts?
You had a good start, so I think that is better to analyse what is going on, before proceeding to the "final product".
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Playing with R2R ladders
« Reply #4 on: February 03, 2018, 07:40:57 pm »
Higher values of resistance make the effects from capacitance, leakage, and bias current greater.  You can certainly build a working high resistance R2R ladder but extra consideration needs to be given to these issues.
 

Offline jgalakTopic starter

  • Regular Contributor
  • *
  • Posts: 237
  • Country: us
  • KQ2Z
    • Blog, mostly about learning electronics.
Re: Playing with R2R ladders
« Reply #5 on: February 03, 2018, 09:24:54 pm »
Even ignoring the opamp currents (which you are right, I didn't consider), it's not working right - I've disconnected the amp and filter, and used a 10x passive scope probe. 

Don't have a photo of this with the smaller resistors, but it looked like a well behaved "stairstep sine wave" with 3.3Vpp and offset so as to fit between ground and 3.3V. 

So assuming this is the high impedance output picking up various leakages, stray capacitances/inductances, noise, etc - Is there a way to estimate what the highest value resistors will be that will give me a clean output?  I can just try different values until I'm happy, but wondering if there's a more scientific way... :)

As to the opamp, I'm using an LMC6482 (http://www.ti.com/lit/ds/symlink/lmc6482.pdf) in a DIP package.   Only using one half of it atm, may use the other half to do an active filter instead of the plain RC filter I am using now.
Blog, mostly about learning electronics: http://kq2z.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf