Shop OBEX P1 Docs P2 Docs Learn Events
Analog to digital: Sigma-delta or external hardware? — Parallax Forums

Analog to digital: Sigma-delta or external hardware?

kolyurkolyur Posts: 43
edited 2011-09-20 02:46 in Propeller 1
I've been tinkering with the Prop for awhile and finally have my first "real" project to dive into. This forum has been a great resource.

I have two analog signals to read: a load cell and string (distance) potentiometer. The conditioning circuitry for the load cell is already complete and working. My first thought was to use an external ADC for both signals, as I have done this in the past with other MCUs, but I've been reading about the ability to use cog counters as ADCs. Before I start experimenting with this, how would the two methods compare when it comes to resolution / accuracy / repeatability / linearity ?

Some other details: I need a minimum of 12-bit resolution. My choice for external hardware would probably be the Microchip MCP330x which is 13 bits. Cost is not a factor. Speed is also not a concern, as the sampled values are just being displayed on an LCD. I'm not using much I/O so pin count is not an issue.

Thanks in advance for pointing me in the right direction.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-18 21:09
    kolyur,

    Welcome to the forum!

    My advice would be to obtain a Propeller QuickStart board (cheap or even free, but currently out of stock), which has properly-positioned pads for the sigma-delta circuitry. Populate those pads, and try it out before deciding one way or the other. Another alternative is the Propeller Backpack (somewhat more expensive, but currently in stock), which has the sigma-delta components already in place. With the Propeller Backpack, you will probably also want to obtain a Proto-DB for your interface connector and circuitry.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-18 21:13
    To get good accuracy with the sigma-delta technique, the resistors and capacitors have to be mounted close to the chip. As Phil mentioned, the QuickStart board has solder pads in the proper position for good results.
  • MicksterMickster Posts: 2,753
    edited 2011-09-19 02:52
    I need a minimum of 12-bit resolution.

    Not had any experience with this but from what I have read, I don't think you'll achieve 12-bit resolution using the Sigma-Delta ADC.spin object because (I believe) it is too slow. Whether there is a PASM object that does any better, I don't know.

    Mickster
  • kolyurkolyur Posts: 43
    edited 2011-09-19 08:26
    Thanks for the tips. I think I'll go with the external ADC just to be on the safe side.
  • ChrisGaddChrisGadd Posts: 310
    edited 2011-09-19 11:17
    Following the application note and with components placed as close to the IO pins as I could get them on a breadboard, I found a 12-bit sigma-delta ADC to have a quite a bit of variation on the count.

    Since you mentioned speed isn't a concern, you could try sampling at say 20 bits and discarding the low byte. The upper 12 bits should be pretty stable. Of course at 20 bits you only get approximately 76 samples per second, or one sample every 13ms if I've done my math right.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2011-09-19 19:15
    ChrisGadd wrote: »
    Following the application note and with components placed as close to the IO pins as I could get them on a breadboard, I found a 12-bit sigma-delta ADC to have a quite a bit of variation on the count.

    Since you mentioned speed isn't a concern, you could try sampling at say 20 bits and discarding the low byte. The upper 12 bits should be pretty stable. Of course at 20 bits you only get approximately 76 samples per second, or one sample every 13ms if I've done my math right.

    IIRC using a breadboard for sigma delta didn't work that well for Chip, ..said something about the metal contact rows introducing additional capacitance @ high frequencies. HTH.
  • altosackaltosack Posts: 132
    edited 2011-09-19 23:20
    If there are issues with additional capacitance at high frequencies, would it work to just reduce the counter frequency to 20 MHz (or lower) and be able to use a DIP chip, assuming of course that speed is not really an issue ?
  • TubularTubular Posts: 4,726
    edited 2011-09-19 23:51
    Altosack I think you raise an interesting point. There's a lot of fear/uncertainty/doubt about what exactly the sigma delta propeller circuit can and cannot do. Surely it should be able to measure battery voltage (low sampling rate) but how far beyond that?

    I for one would like to see the sigma delta block 'characterized' - for at least for a standard setup such as the Quickstart board with recommended components loaded into its sigma delta pads. How many effective bits at a few different sampling rates?

    Oh and Altosack, welcome to the forums, and Kolyur too.
  • ManAtWorkManAtWork Posts: 2,183
    edited 2011-09-20 02:46
    I successfully use the sigma delta method for the current feedback in brushless servo motor controller. The PID loop runs at a cycle time of 42µs and samples a current sensor with ~11 bits resolution. Works great and costs almost nothing.

    I think 12 or even more bits resolution is no problem if you have 4096 or more clock cycles of time. Linearity is excellent but there is a considerable offset and gain error and also noise. In my case, gain error is not critical because it is compensated by the velocity control loop. I do an auto offset adjust procedure by measuring the (known zero) current before I switch on the power stage.

    If you need the sifgma delta ADC for precise measuring you have to calibrate it. You could switch the input to a known reference voltage with an analogue multiplexer for that purpose.

    Another advantage is that the sigma delta ADC cancels out EMI noise if you choose the sampling frequency to be equal to the noise source (for example 60Hz or in my case 24kHz from the PWM stage).
Sign In or Register to comment.