3-bit folding flash ADC uses only 3 comparators

Started by earthtonesaudio, February 17, 2011, 09:30:05 AM

Previous topic - Next topic

Taylor

Quote from: Quackzed on July 15, 2011, 12:55:06 PM
QuoteAdding a cap seems to tame some of the glitches.  Link
upping the 10n cap at the end to 1uf (heavy handed lpf-ing) cleans it up nicely... (i know:obviously :P)

But a cap that big completely removes the digital artifacts that ETA worked so hard to get!  ;) So what would be the point of this circuit then?

Quackzed

true. it would be pointless to 'un-digitize' it at this point, but after waveshaping,  manipulating , folding etc while its in the digital domain ... you could 'then' heavy lpf the signal...to er-'un-digitize' it...
i just figured that was one of the possibilities, rather than a/d being the end point.
you know a/d - digital fun -d/a(low pass filter)...
i was just surprised how effective low passing a digital signal is...well, to a point...
nothing says forever like a solid block of liquid nails!!!

Taylor

Ah, you're right. Lots of potential in here! Somebody needs to build this thing...

earthtonesaudio

@PRR: I have a layman's understanding of the generic different ADC/DAC types, maybe just a little more than what can be gleaned from Wikipedia.  While I was working on this I did look up what patent drawings I could find regarding folding flash ADCs but they were mostly for stuff that would be fabricated on a single slab of silicon, way out of my comfort zone.  I'm not really surprised that this ground has been covered before, but I am pleased that I was able to discover it independently. 

@Taylor: There are a couple things to watch out for when going from simulation to real parts with this build.  First, if you use an op-amp it has to tolerate whatever differential voltages may appear at its inputs.  For a small full-scale input range, this differential can be negligible.  For a large full-scale input range, it might be better to use comparators that can handle such conditions gracefully.
Second, the simulation assumes the output can swing from zero to nine volts exactly.  A rail-rail op-amp will be close enough but a general purpose one will at best swing to within a volt or two of the supplies.  This makes the voltage at the resistive divider different so you get a deviation from the expected values; the result is some bits do not appear in the sequence.  I'm still working on a way to calculate these values reliably.  With rail-rail outputs it's just ratios, but with not-quite rail-rail outputs I think there might be actual math involved. 
What I did was use DC input voltage that I could sweep manually (a pot across the rails), and LEDs on the op-amp outputs to monitor the binary output.  Then I subbed resistor values until I got all the binary combinations.  Now, I would start with the values in the sim and tweak with trimpots as needed.

@Quackzed:  ;D

@toneman: I may just have to buy a copy of that issue from PAIA, but I don't know which issue... ???

@all: thanks for the kind words.  :)

I think there is a lot of potential in this thing as an audio mangler or noisemaker, but also as a way for folks to dabble with digital processing in a very raw and intimate way with discrete XOR/AND/OR chips as toneman suggested.

toneman

Quote@toneman: I may just have to buy a copy of that issue from PAIA, but I don't know which issue... Huh

Possibly the july/august 1979 issue  :icon_question: .....

"Digitizer Projects and Software"

http://www.paia.com/Articles/polyphny.htm

suggestion: e-mail PAiA and see how many pages the article is.
And IF it is, in fact, the complete article (more than one page)  :icon_confused:
I have an ACTUAL EK7 but am looking for the documentation   :icon_redface:
afn
:icon_cool:
  • SUPPORTER
TONE to the BONE says:  If youTHINK you got a GOOD deal:  you DID!

loss1234

I hope this is not a stupid question...would it be possible to convert this circuit to have LESS bits instead of more? ( a 2 bit flash ADC )
for controlling CMOS chips that only have an A and B input like the 4052?


any info greatly appreciated!

thanks

Hides-His-Eyes

You can indeed... Take the 2 most significant bits, get rid of the other two and then work out which op-amps have nothing connected to their outputs; delete those. Then see if any of the resistor divider pairs are left unconnected and get rid of those too.

loss1234

"get rid of the other two"

Sorry for the confusion...if there are only three bits (A, B and C) how can I take the two most significant bits and then remove the other two?

Did you mean just remove the third one?

thanks!

earthtonesaudio

@loss1234:
Referring to the schematic from post #1 of this thread, you can get rid of IC1a, R1 and R2 to make it into a 2-bit ADC.  Also, since no current is drawn into the inverting input of IC1B, you can also omit IC1D and do the whole thing with a dual op-amp or comparator package.

I think Hides-His-Eyes was talking about removing the other two sections from the 4-bit version, the most recently linked schematic.

toneman

taylor:
try using real comparators in place of the opamps for the bit conversions. 
Comparators have "built-in snap", whereas opamps need positive feedback to get "snap". 
An LM339 is a quad comparator, same pinout as the MC3302. 

earthtonesaudio:
I FOUND the EK-7 article  :icon_exclaim: ...scanning now.....
If anyone wants a copy send me a PM with your email. 

A further note, I built he EK-7 out to 5bits with 1% resistors and it works fine.  The EK-7 was mainly invented/used for the Paia Proteus, a monophonic synth with saveable presets.  The EK-7, or actually TWO of them, were used to digitize the pot settings of the synth to make an 8bit word to be stored in memory, WITHOUT using any type of processor. It was cool  :icon_cool:

:icon_cool:
  • SUPPORTER
TONE to the BONE says:  If youTHINK you got a GOOD deal:  you DID!

PRR

> Comparators have "built-in snap", whereas opamps need positive feedback to get "snap".

General-purpose comparators (like '339) don't "snap". Hysteresis and positive feedback is left to the user.

Comparators are often (not always) rated for large differential inputs; but so are most common op-amps (such as '074) (and yes, I've blown '709 opamps with excess input diff).

Comparators are generally faster to switch. An op-amp's speed must be controlled so it will be stable under negative feedback. 

What is stunningly elegant about earthtonesaudio's plan is that the "point" of hysteresis is accomplished another way, with threshold shifts. Once any stage switches, all other stages get new thresholds. It is unlikely to "chatter" around a near-threshold level, sweet.
  • SUPPORTER

toneman


QuoteWhat is stunningly elegant about earthtonesaudio's plan is that the "point" of hysteresis is accomplished another way, with threshold shifts. Once any stage switches, all other stages get new thresholds

That's the way the PAIA 4bit digitizer worked.  Each stage fed previous/further stages, setting the biases for a new shift point. I think that is one of the reasons it's called a "folded" A2D.  The output bits are "folded back" to set the new thresholds for the inputs. Simonton used all comparators.  I found that there was still a little chattering just at the thresholds.  It worked OK for the Proteus.  I've included the digitizer page from the Proteus in the scans. I have scanned the EK-7 article and converted to pdf.  It's 6M.

check this article out:
http://www.analog.com/static/imported-files/application_notes/46875282066493AN_849.pdf

:icon_cool:
  • SUPPORTER
TONE to the BONE says:  If youTHINK you got a GOOD deal:  you DID!

Andon

Apologies for reviving a rather old thread, but I've been trying this circuit out over the last couple of days with what seems like random success. I'm trying to use this in a similar way as user slacker did in response #15 on page 1 - that is, using a pot to control the voltages to be able to spell out all eight words in sequence as you turn the knob (000, 001, etc.), which would then feed into the A, B, C pins of a 4051 and be able to select one of eight inputs. When I implement it, I seem to get some words, but not all, and not in order. There are also a lot of images missing from the thread as servers have moved over the years, but here's what I think is the initial schematic:



AGND in the above schematic is 4.5V as user earthtonesaudio points out. PRR says that the buffer is not necessary, but what else can I be doing to ensure that this works? For the input I've tried a variety of pots across 9V-0V with the wiper feeding into the non-inverting inputs of each comparator, and it seems like B10K is the most reliable value. I have tried a variety of values as suggested in this thread, including the 4-bit simulation posted (parred down to 3-bit).

I've also found that standard op amps at least seem to work better than comparators here, contrary to what has been stated here.

So, any advice? Again, I'd be using this to send eight binary words to a 4051 to be able to select from eight inputs. Thanks!
  • SUPPORTER

PRR

Quote from: Andon on October 27, 2023, 08:07:14 AMpots across 9V-0V with the wiper feeding into the non-inverting inputs of each comparator,

Through C1?
  • SUPPORTER

Andon

I've tried that, but I feel like I've had better luck replacing R5 with a pot to vary the voltage for the non-inverting inputs.
  • SUPPORTER

ElectricDruid

Definitely get rid of the C1/R5 combo on the input. Your input voltage from the pot wiper needs to go straight in, not via a HPF - it's DC, so that's not going to work.

As you said "I've had better luck replacing R5 with a pot to vary the voltage". Well, yes! Not surprised!

Andon

#56
Oh yeah, I never even considered it until PRR posted that which made me second guess myself ha. I did some more digging around, and found another implementation of the 3-bit folding flash ADC from Alex (earthtonesaudio) over at the other forum:



The ADC is at the top left. I was happy to see this, because this is exactly how I have been mostly trying to implement it, but issues still persist between different values, using op amps or actual comparators, etc. The notation is a little confusing, however, because that schematic I just posted mentions VREF1 and VREF2 , but no mention of how VREF2 is created - given the other schematics I would assume it's the same, but I could always be wrong.
  • SUPPORTER

ElectricDruid

The circuit seems to be tested and working in plenty of cases, so if it's not working, I'd suspect that it's a question of voltage levels. Especially given the symptoms you mention.

Its correct operation completely depends on the various thresholds and how those change when the outputs switch, and that in turn depends on what those output levels are. So the circuit will *only* work with specific resistor values if they are matched to the hard-to-the-rails output levels of the specific op-amp you're working with.
If the resistor ratios are assuming a op-amp that goes closer to the rails than yours does, it probably won't work the same, and the result of that could well be missing codes.
I was doing a sim to see what happens this afternoon, but LTSpice flaked out on me, so I didn't get anywhere. I'll post again if I get something more useful.


PRR

Quote from: Andon on October 30, 2023, 01:55:49 PMissues still persist between different values, using op amps or actual comparators

There's no hysteresis. It will be incredibly sensitive to layout and chip speed. In that case a smooth roll-off opamp *MAY* be better behaved than a high-strung many-stage comparator.

Can't use a thumb switch? They were hip in the 1970s.
  • SUPPORTER

ElectricDruid

I can only get this "close", rather than working, at least in the sim.

I've used a 9V single supply and TL072 op-amps. I copied values from PRRs sim on page 1 of the thread. The TL072 model, siginificantly, doesn't go to the rails - output is about 1.6V to 7.4V. This seemed more like a "practical" circuit than using ideal op-amps.
Note also that the input voltage is a sine wave of 0.8Vpp around Vref (4.5V), so all the transitions happen in a fairly small range in the centre. Also the output does show some glitches.

How realistic this is I'm not sure, but the part that strikes me as realistic is that the circuit is fussy. Change anything and everything else changes, because it's all linked together!