Author |
Message |
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 3:43 am Post subject:
R/2R - Me Heartys - Yo Ho Ho |
|
|
Unlike 2 days ago, I now understand what an R/2R network is, how to build one, and how to implement it, but I'm wondering does anyone know of a place I could find a description of how it works? I'd like to understand it properly. _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
crazeydazey
Joined: Feb 15, 2007 Posts: 303 Location: England
Audio files: 4
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
|
Back to top
|
|
|
crazeydazey
Joined: Feb 15, 2007 Posts: 303 Location: England
Audio files: 4
|
Posted: Mon Jun 18, 2007 5:11 am Post subject:
|
|
|
Blue Hell wrote: | Edit : had some links messed up, fixed it. |
yeah it did that to me too.. |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 5:32 am Post subject:
|
|
|
Okay,...
I get the feeling I'm going to implement this long before I fully understand it.
Thevanin Shmevanin! I reckon he was a trickster who specialised in making complicated voltage, ohm & current calculations (which is what I wanted) disappear in a flash of smoke and mirrors simplification! _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 5:41 am Post subject:
|
|
|
My next most pressing question is,
How do I implement this "virtual earth" in my connections to the data source, if I'm doing a "roll your own" style DAC?
I could switch a reference voltage with the data by using a CD4066, but does an open switch in a 4066 act as an earth?
Could I simply connect the diode based OR gates which are the outputs from my data? Can we "see" the virtual earth of an AND gate through a reverse biased diode?
Or do I take these diode gates into a simple buffer? Surely a logic 0 on the output of a buffer acts as a "virtual earth".
Does Thevanin theory negate all these fears?
Does it make them real?
Damn you Thevanin!! _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Mon Jun 18, 2007 5:47 am Post subject:
|
|
|
Virtual ground .. no wonder you feel a bit dizzy
What DAC construction did you have in mind exactly?
It's Thevenin BTW _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Mon Jun 18, 2007 6:10 am Post subject:
|
|
|
In that case an open switch acts as "nothing", ideally, and it would be reasonably ideal with those resistor values.
But I guess you want to modify this for an R2R ladder? In that case the signals going into the ladder should be hard switched between ground and Vcc. So it would be impossible to directly use a diode OR or AND function - there should be buffers in between.
Edit: and the CMOS switches are not needed then.
Did I get the question right? _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 6:14 am Post subject:
|
|
|
You can't get a linear output by shorting resistors in series like this. I've been trying heaps of ways, it' just mathematically impossible.
Yes, I'm gonna take the diode gates through a buffer and into an R/2R network. It'll be nice new ground to plow! _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Mon Jun 18, 2007 6:17 am Post subject:
|
|
|
Uncle Krunkus wrote: | t'll be nice new ground to plow! |
Hear hear, and nothing virtual about it, your hands really will get dirty _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
bearblock
Joined: Sep 27, 2006 Posts: 90 Location: uk
Audio files: 1
|
Posted: Mon Jun 18, 2007 12:56 pm Post subject:
|
|
|
i wonder if you could cobble together a 4-bit ADC in a similar way? then add a rotary encoder to scramble the data lines, so you'd have a bunch of 'wild' wavetables to drive with a saw VCO (or whatever)... |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 4:08 pm Post subject:
|
|
|
The "problem" is that at these kind of frequencies (160-160000Hz) with only a 4bit word, scrambling the data lines tends to create a lot of extra clicking and noise. It's kind of difficult to explain the effect I'm after until the circuit is fixed and I can post some pics/samples, but the main reason I want to fix up the DAC part is so I can get smooth ramps controlling the individual time slices.
I do see what you're getting at, and have been thinking about some interesting bit-wise operators which could be dialled up for each time slice. If these operators create sudden jumps in the timbre, I've then thought about the ability to use an external trigger to clock the counters, thereby making the shifts in timbre synced to the tempo/drums/sequencer steps etc.
But the original idea, and the thing I want to master first, is a sub oscillator who's harmonics are slowly, smoothly and yet unpredictably shifting in amplitude, number and phase relationship. _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
toppobrillo
Joined: Dec 10, 2005 Posts: 766 Location: oakland, ca
G2 patch files: 1
|
Posted: Mon Jun 18, 2007 5:33 pm Post subject:
|
|
|
it's not linear because your resistor values are exponentially related.
you should take a look at something like this-
http://www.cyndustries.com/synapse/synapse.cfm?pc=43&folder=march1977&pic=33
you've got the resistor values already- 5-40k right? thats all you need for 4 bits.
why not go 8 bit and get an integrated DAC? they are pretty cheap these days.
or how about addressing a MUX/DEMUX like the 4051, 4067 etc. with a current source tied to a series string of the *same* value resistor... this works pretty well, so long as you filter it a bit. i did a coupla things this way.
josh |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Tue Jun 19, 2007 3:32 am Post subject:
|
|
|
topp wrote: | it's not linear because your resistor values are exponentially related. |
The idea of shorting out series resistors was bound to create a non linear result, which I was trying to counter by using exponential resistor values. The problem has more to do with the method, than the values.
Well, yes, I now realise that I could just switch the four resistors to a summing amp using the 4066. But I think buffering into a tiny R/2R will be more fun.
Quote: |
why not go 8 bit and get an integrated DAC? they are pretty cheap these days. |
Cos then I'd have to re-build all my counters, and I'd need twice as many AND gates and ORing diodes.
Quote: |
or how about addressing a MUX/DEMUX like the 4051, 4067 etc. with a current source tied to a series string of the *same* value resistor... this works pretty well, so long as you filter it a bit. i did a coupla things this way.
josh |
And I'm not sure what you mean by that last 'bit'. (said the parity checker to the shift register) _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Wed Jun 20, 2007 9:05 am Post subject:
|
|
|
Hmm .. you ran into a classical example of the law of conservation of misery I'm afraid.
The R2R output goes from zero to Vcc, the opamp circuit has to at least amplify a factor of one, it can't attenuate. And so it has to be able to drive it's output up to the positive or down to the negative supply voltage (depending on wether you use an inverting or a non inverting buffer), and it can't do that, it needs some headroom.
Well I think, that's the problem ...
So how you're going to solve it ...
BTW, the pull downs are OK and really needed, assuming you want a logic OR function there. Anyway, after diodes there should always be a pullup or pulldown, depending on the diode direction. _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Wed Jun 20, 2007 4:21 pm Post subject:
|
|
|
So why has it converted 0 -> +Vcc into -Vcc/2 -> -Vcc? And why is it on -Vcc for half the steps? Why did it start at -Vcc/2?
I'm not expecting you to come with the answers Jan, I'm just miserying out loud. (and laughing out loud)
I'm using a proper dual PSU by the way. Do I have to do anything with the offset pins on the TL071?
I just realised that what I'm getting is as if I had shifted the output down by V/2. That would explain why (0000) gives -V/2, and of course it would stop at -V for the other half of the count, 'cos it can't go any further. I know you can shift the voltage level using an op-amp, maybe I've done it by accident.
I'll check the exact bit values vs. output, and get back later. _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Thu Jun 21, 2007 8:56 am Post subject:
|
|
|
I have the answer!!
First, it didn't start at -V/2 at all. It was just -1.6V (Don't exaggerate readings!)
I made a little de-bouncer and checked all the output voltages for every input. Starting at -1.6V it goes roughly 1.5V into the negative with each step. Now 12V divided by 16 steps is .75V (hmm,.... factor of 2) Of course it stops at -10.6V cos it's got nowhere else to go.
I read on a web page that "Thevenin analysis shows that looking back towards the LSB from each data line always equals a resistance of R" The circuit I copied had 2R as the feedback resistor! That gives the op-amp a gain of -2!!!
So replacing it with R should bring the results back into what the op-amp can deliver.
My next question is: -
Can I change the Gnd on the +ve input so the output gets shifted up by V/2?
Or should I do that with a separate buffer so I don't mess up the R/2R decoding?
An output of 10Vp-p swinging around Gnd would be the best outcome yeah?
BTW, it's already sounding heaps more "musical" than before. Very tasty drone sound. _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
blue hell
Site Admin
Joined: Apr 03, 2004 Posts: 24079 Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320
|
Posted: Thu Jun 21, 2007 9:39 am Post subject:
|
|
|
Uncle Krunkus wrote: | I have the answer!! |
Right, so I was wrong
Why not just use a non-inverting buffer ? _________________ Jan
also .. could someone please turn down the thermostat a bit.
|
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Thu Jun 21, 2007 4:13 pm Post subject:
|
|
|
Apparently, when buffering an R/2R network, you can't. According to an article I found on the net. I'll sit down and have a few more beers with my good friend Leon Thevenin and find out why. You know he's lost a lot of weight since he died. It's turned him into a bit of a two pot screamer. _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
|
Back to top
|
|
|
DrJustice
Joined: Sep 13, 2004 Posts: 2114 Location: Morokulien
Audio files: 4
|
Posted: Fri Jun 22, 2007 2:43 am Post subject:
|
|
|
Hey Uncle, check out this thread where bigtex is getting into some R2R stuff.
Have you considered using laser trimmed R2R networks? At least if you want CV with musical tuning it's a good idea. Nonetheless, for scratch building one!
DJ
-- |
|
Back to top
|
|
|
Uncle Krunkus
Moderator
Joined: Jul 11, 2005 Posts: 4761 Location: Sydney, Australia
Audio files: 52
G2 patch files: 1
|
Posted: Sun Jul 01, 2007 8:48 am Post subject:
|
|
|
I've had some ideas about how to improve this circuit and I'm just going to throw some of them out there and see what you dudes think okay?
Obviously, one of the first things I'd like to sort out is getting it to track another wave. For that I'm going to experiment with Scott Gravenhorsts Frequency Multiplier for the Fat Man. It's based on a 4046 PLL.
http://home1.gte.net/res0658s/fatman/4046pll.html
This also should give the option of driving the timeslices with a frequency which is 1, 2, or even 3 octaves up. (with other possibilities as well)
But the main idea I had the other day is this: -
When I was playing with the counters, I found I could make an automatic up/down 4 bit counter by XORing the 5th bit with the first 4. So XORing bits gives the inverted version of the original.
I realised I could double the resolution of the wave by adding a 5th bit, which not only acted as the new MSB, but could be XORed with the first four to create a mirror of the Less Significant Bits.
While we're doubling the voltage resolution, why not double the sample frequency too? 16 steps. For the first 8 we have something similar to what's happening now, except it's being purposely held in the "positive" going side of the wave by the MSB being set to 0. As the second set of 8 outputs starts, the MSB is set to 1. This not only shifts the same bit pattern into the negative side of the wave, XORed with those bits flips them upside down. And by having these timeslices addressed in reverse, we complete the process of presenting to the DAC the same shape, mirrored, reversed and shifted. Note that the MSB is not part of the 4bit words coming from the counters. It's generated by the timeslicer and fed straight to the DAC. So I don't need to rebuild my 8*4bit counters.
We end up with a wave that has twice the resolution in both directions.
This rotational symmetry about the 0 crossing is something common to many naturally occurring waves, and I think it will help to reduce the "buzzy" digital sound which the original suffers from.
Of course PWModulated waves do not share this rotational symmetry, and to address that possibility, the other feature is to include a method of controlling which step (1-16) activates the MSB. I'm actually thinking I'll stick with choosing step 1 to 8. I don't think the other half will matter, as it would just be an inverted, phase shifted version of the first 8.
Symmetry around 16 steps means that the dominant frequency will be 4 octaves below the timeslice clock. This is why I like the idea of a frequency multiplier which puts out 3 octaves up. This also improves the possibility of then removing the "carrier".
Does that make sense to anybody else? Or have I just completely lost the plot? _________________ What makes a space ours, is what we put there, and what we do there. |
|
Back to top
|
|
|
|