Shop OBEX P1 Docs P2 Docs Learn Events
Achievable absolute precision of A/D conversion using the Delta/Sigma principle — Parallax Forums

Achievable absolute precision of A/D conversion using the Delta/Sigma principle

godzichgodzich Posts: 74
edited 2008-10-05 02:50 in Propeller 1
Hi,

This one would be quite hard to test and breadboard myself, so I think I'd better ask. Someone has probably tackled this question before:

What is the achievable DC-precision in an A/D conversion built around one COG running the appropriate DeltaSigma code, and using the schematic below (please copy-paste it into the propeller tool editor to see it clearly):

·····················································
············································ ┌──────//
···························  +3.3V················
16..24mA························ ┌─────────┤port in
──────────┐·············· 1nF················
·················· 100kΩ······· 100kΩ········
·········· ┣──────┳───────┻─┳────┻───────┤Port out
·············································
······ 82Ω ·· Cf1µF····· 1nF················
······································ └──────//
···············································


The conversion speed can be fairly slow,·50..200 samples a second would do. Assuming that the resistors have 0% tolerance (ok, lets be fair and say they are 0.1%) - what is the best UNCALIBRATED DC-precision that can be achieved? Also assuming that the VCC is really 3.300V (precise to the millivolt).

Or is it so that this type of converision is not usable for high precision (>10 bit) DC-signals?

In my case there is a current flowing into the shunt resistor (16..24mA) that I need to convert with the highest precision to a digital value. How high precision can be achieved using this circuitry and just the propeller hardware? Are my component values optimal for this kind of application? Or should I just forget this and get a real14-bit A/D converter for the task?

Where do I find info about the temperature stability for this type of A/D conversion? ·Isn't this conversion depending of the digital input's complementary CMOS transistors gate tresholds (that vary with temperature, and doesn't track very well)? How much better would the performance be if I used a REAL precision comparator with a reference of VCC/2, so that the input pin sees a real logic levels?

Thanks in advance for any comments or feedback on this! Somehow it wouldbe nice to have a complete application note about this subject with all things related to AD-conversion gathered in one place... [noparse];)[/noparse]

Christian

PS: Wouldn't it be nice if we could use the Propeller font in this Parallax forum...?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The future does not exist - we must invent it!

Comments

  • BradCBradC Posts: 2,601
    edited 2008-10-01 09:40
    godzich said...


    PS: Wouldn't it be nice if we could use the Propeller font in this Parallax forum...?

    An easy way around this is to draw up the schematic in PropTool and then post a snipped screenshot of it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • evanhevanh Posts: 15,545
    edited 2008-10-01 11:50
    The Propellor forum can support the Prop-font. If the style sheet, say, for <CODE> was changed to have the first font entry as the Prop-font it should work for everyone that has the font installed. And the fallback can be the same old list. Although, replacing all the useless proportional fonts in the fallback list would be a smart thing to do while at it.
  • evanhevanh Posts: 15,545
    edited 2008-10-01 11:51
    Speaking of which, how about making the font a standalone download for those that can't install the full package.
  • evanhevanh Posts: 15,545
    edited 2008-10-01 12:14
    Err, hmm, it has installed under Wine. And the editor works too. [noparse]:)[/noparse] I can't see where the font is located though. :/
  • BradCBradC Posts: 2,601
    edited 2008-10-01 14:18
    ls .wine/drive_c/windows/Fonts/Parallax.ttf

    It's b0rked though with bitmaps that are grunge under anything but windows.
    Grab this one http://forums.parallax.com/forums/attach.aspx?a=22474
    From this thread http://forums.parallax.com/forums/default.aspx?f=25&m=225653&p=1

    On Ubuntu 8.04 I just popped it in ~/.fonts and next time I logged in it was golden.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • godzichgodzich Posts: 74
    edited 2008-10-01 14:36
    Hi,

    Sorry, it might be my fault, but aren't we a little of topic here ***grin***

    Anyone that has anything on the A2D conversion precision ???

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The future does not exist - we must invent it!
  • evanhevanh Posts: 15,545
    edited 2008-10-01 22:16
    You beauty Brad. Worked just like you said, thanks. I've set my default font to Bitstream Mono also, to view the drawing correctly.

    I've learnt a little bit about Unicode too I think. It would seem it is very flexible as to which font is used when displaying oddball character like these.


    Cheers,
    Evan
  • evanhevanh Posts: 15,545
    edited 2008-10-01 22:36
    godzich:

    I'd be in for some of those answers also. What I have noticed is there is a lot of people posting about using serially driven A/D ICs instead of the Sigma-Delta method. I'm not sure if there is just a lack of info or there has been tests to show it's not performing well. It must be okay though, otherwise Beau wouldn't be planning on embedding the hardware for it in the PropII, - More Prop II info
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-01 22:42
    The I/O pin circuitry is being "tuned up" for Sigma-Delta ADC use. There are comments by Chip in some of the very long threads on the Prop II. You'll have to dig that out.

    There have been no publicly shared tests on the performance of the Prop I Sigma-Delta ADC other than the contents of the AN001 archive and some comments on using non-adjacent I/O pins to reduce noise coupling from adjacent I/O pins if you want to squeeze out the best possible performance.

    People use external ADCs because they have better performance than using internal Sigma-Delta ADC on the Prop I. These are special purpose chips, optimized for the ADC function. Good ones are not cheap either.

    Post Edited (Mike Green) : 10/1/2008 10:50:28 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-10-01 23:58
    evanh,

    As Mike says, "The I/O pin circuitry is being "tuned up" for Sigma-Delta ADC use"... While the Propeller I is fully capable of performing Sigma-Delta ADC operations, the Propeller II will have a Sigma-Delta ADC that will be better optimized.

    As a side note: If you look at the data sheet for several of the ADC's out there many will use a sigma-delta or successive approximation technique not unlike what will be implemented in the Propeller II.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-10-02 00:02
    I have been one of those guilty of using serial A/Ds instead of trying to use the Propeller itself. If I were to try and use the Propeller I would almost certainly incorporate a voltage reference and a fast comparator back to the input pin. The way it is at the moment the input threshold of approximately 1/2VDD can vary with temperature, batch, etc and so this means the reading will vary for the same input voltage. OK for audio signals for rather limited when working with DC.

    There are also issues with the Prop's input buffer as it is a fairly normal logic input which is not designed to operate with the input voltage sitting right in the middle of the noise margin. Normally the maximum logic low would be around 0.8V and the minimum logic high around 2V so that 1.6V is sitting in no-mans land. Noise margin means just that, there are really no manufacturer guarantees as to which way it will go, it could even oscillate and almost certainly causes more current to flow through the partially conducting CMOS structures forcing them out of their digital mode (I'd hardly call it linear).

    I doubt that the Propeller's structure would be much different. As Mike mentioned the Prop II is taking into account this unforeseen use smile.gif of Sigma-Delta A/D so I guess Chip would have to do something similar internally although he would be constrained by the silicon process.

    One of the advantages of external ADCs is that they allow for reference voltages, separate analog and digital supplies and grounds etc. Plus they are much faster with at 12-bits at 100ksps being fairly easily achieved.

    But go ahead and try the comparator approach if you can as I feel it will work for you in this application (or just spend a couple of dollars on a serial ADC).

    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-02 00:36
    A comparator sounds nice in principle, until you realize it has to switch in less than 12.5ns with almost no input overdrive. That may require a rather exotic part. A cursory search turned up the LT1394, which specs a maximum 14ns propagation delay with a 5mV overdrive over temp. It needs a minimum 5V to operate.

    I'm more tempted to be content with the Prop's input threshold, as-is, and just calibrate the delta-sigma on known voltages at various temps. The input and feedback resistors will make their own contributions to any error, so calibration is necessary anyway.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!

    Post Edited (Phil Pilgrim (PhiPi)) : 10/2/2008 8:05:41 AM GMT
  • rjo_rjo_ Posts: 1,825
    edited 2008-10-02 02:55
    This is a germane question, since similar hardware is going to be built into every pin on the PROPII. As I understand it (which is just barely[noparse]:)[/noparse] the resolution is mostly determined by how long you want to wait and what you are doing to your signal before it gets to the Prop.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-10-02 03:23
    If I recall correctly, I found DC measurements on the current propeller to have maybe 5 or 6 bits of precision, anything beyond that is noise. This was my observation when writing the counters ap note which was a while ago, so my memory may be off. I didn't have any exotic setup, I was just using a Demo Board's P0 and P1 pins. I didn't perform any accuracy tests either since it was not in the scope of the ap note.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • godzichgodzich Posts: 74
    edited 2008-10-02 06:56
    Hi,

    THX for all the good and professional comments. I have to admit that I had little too high expectations, before I had a detailed look how this AD conversion is done. Using a digital input in this very "un-orthodox" fashion (without ANY special circuitry) can never be a good performer. Still I'm a little disappointed, since I thought at at least 8 bits precision would have been the minimum achievable. The D/A conversion can produce quite remarkable signal quality, but the AD is just more like a very poor-mans 5 bit AD. I got the wrong impression reading just the data sheet that mentions AD and DA conversion using SigmaDelta techniques. Normally they perform very well and give you many stable bits...

    I understand that noise from both adjacent pins and the supply voltage will have a big influence. As well as temperature dependence of the input gate.

    I read somewhere that someone had added a third resistor to the AD conversion circuitry, adding a small hysteresis to the input pin. Are there ary studies (theoretical or practical) how this improves the AD conversion precision - or usable bits? Someone's been tackling this thing before...

    I have once used a simple schimtt input inverter (HC14) as an pwm-modulated oscillator (two resistors, one cap), and integrated the high/low periods in an FPGA. I achieved more than·9 useful (noiseless) bits, but the linearity was poor. However, in my application I'm not worried about linearity, just repeatibility and resolution...

    It would be so NEAT to just use two resistors and capacitors.. [noparse]:)[/noparse] I will continue experimenting and will post my results later...

    Christian

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The future does not exist - we must invent it!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2008-10-02 07:58
    godzich,

    You could use the D/A method back into a common LM393 comparator and employ some software to perform successive approximation, that will certainly give you at least 8 bits of usable resolution. A simple voltage divider off VDD can set a reference voltage for the comparator.

    *Peter*
  • evanhevanh Posts: 15,545
    edited 2008-10-02 09:33
    Umm, depending on the nature of the noise - Christian's circuit is a first order IIR active filter resulting in, I think, a large dither. A software FIR filter might be very effective at producing a much higher precision A/D.

    That's a bit of a stab at a possible solution to increasing the bit depth. Don't quote me on it.
  • dbpagedbpage Posts: 217
    edited 2008-10-03 13:36
    Tip:· To substantially improve noise rejection, write your code to average samples over one period of the predominant noise frequency.··For example, if·60 Hertz is the most significant noise frequency, which it is for many applications,·the samples should be averaged over a 16-2/3 millisecond period.

    Also noise increases in direct proportion to input impedance; the higher the impedance, the higher the noise.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dennis B. Page, Page Radio Company
  • godzichgodzich Posts: 74
    edited 2008-10-03 14:34
    Actually its not my circuitry, i just copied it from some application...

    I probably will lower the impendance a bit...

    Most noise to this AD is induced via the VSS 3.3V supply, internally within the Propeller chip. The input treshold varies proportionally with the supply voltage, being roughly half of the supply voltage. This is the reason why there are TWO filter capacitors on the input, to equally divide any high frequency noise on the supply line, and keep the pin centered. Removing either capacitor ruins the AD conversion SNR ratio...

    If there is externally induced noise with a known fundamental frequency (as the mains) - then averaging at a multiple of this frequency would help. But for broadband noise, only a heavy averaging filter (in software) will help. In my first application I'm actually adding 8 consecutive samples, virtually adding three bits of resolution, or if keeping the bits the same, improving the SNR by a factor of almost 3.

    Sadly· I have not had time to put this togheter to test it, but hope to do so soon. Still it would be nice to hear what kind of performance other people have been avle to squeeze from this archaic but beautiful way of converting signals into the dircrete domain...

    Christian



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The future does not exist - we must invent it!
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2008-10-03 17:18
    Take a look at this 5-page thread from one year ago, Troubles with Sigma-Delta ADC. There is good good discussion of the theory, and also practical considerations on how to choose the components, and performance tradeoffs. In particular on page 4 you will find Rayman's description of how he was able to see the response of a thermocouple with a sigma-delta scheme wired for a 12 millivolt full scale range, short term at least. A lot depends critically on circuit layout.

    I usually end up using an external ADC in my projects, for various reasons as mentioned earlier in this thread.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • hippyhippy Posts: 1,981
    edited 2008-10-04 03:14
    Paul Baker (Parallax) said...
    If I recall correctly, I found DC measurements on the current propeller to have maybe 5 or 6 bits of precision, anything beyond that is noise.

    I've been using an external micro for ADC but had been thinking about trying sigma-delta ... if it's such low resolution with all the complexity in getting it better then it doesn't really seem worth the effort to me.

    I don't know exactly what I was expecting but given that ADC chips also use sigma-delta I was expecting more than that, probably also 8-bit minimum.

    Any estimates on what sort of base-line resolution the Prop II will have for a typical unrefined sigma-delta ?
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-10-04 18:29
    I'm not really the person to ask about the next Propeller's performance, but this is my general understanding of the issue. Imagine you're having to steer a car down a road and your only control is turning hard left or hard right. With the current chip setup, the reaction time is somewhat limited. This results in a somewhat erratic trajectory down the road, but this reaction time for the next chip will be much shorter resulting in a finer·left/right control (in the time domain). I have not seen the simulations of the next chip to tell you to what degree it will·be improved.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 10/4/2008 6:35:24 PM GMT
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-10-04 21:38
    Inductive low-pass filter on the input? what kind of frequency range you looking at?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.

    Post Edited (RinksCustoms) : 10/5/2008 2:57:06 AM GMT
  • evanhevanh Posts: 15,545
    edited 2008-10-05 02:50
    It's an 82 ohm resistor for current to voltage conversion.
Sign In or Register to comment.