Announcement

Collapse
No announcement yet.

ADC Sample Time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ADC Sample Time

    Hi All,

    Been doing a bit of reading regarding PI detectors that use a commonly available microcontroller such as Atmega8 or PIC. Was looking for some clarification of Analogue to Digital conversion time as to me it seems to be one of the factors holding back the amateur PI projects.

    Coming in to this I was thinking these things run at 16-20Mhz it would be relatively easy sample every 1uS along the decay curve to find the difference to the "no metal present" curve and life would be great. To me now it seems you get 1 shot, sample early (getting gold), or sampling later to get (longer lasting) higher conductive targets (silver, iron, coins etc). This being due to the fact that 1 ADC takes about 150-200uS of time.

    Have I got this correct? and if so since the process take such a long time, is the value returned an average of the sampled analogue value over the 150uS or how does that work?

    Is there a way on these MCUs to choose the amount of time the sample is taken over? or is that something we can only do with higher power chips or an external fast ADC?

    Thanks guys, I'm looking for a starting point here like I'm sure alot of others are. I believe the way forward is with a digital solution so wondering what others have done or are doing on the amateur front.

    Cheers, rickodetrader

  • #2
    rickodetrader

    Have I got this correct? and if so since the process take such a long time, is the value returned an average of the sampled analogue value over the 150uS or how does that work?
    what chip where you thinking about?


    Philip

    Comment


    • #3
      Hi Philip,

      My preference is for the Atmega8 or thereabouts... 168 or 328.

      Cheers, rickodetrader

      Comment


      • #4
        rickodetrader

        were you thinking about the arduino?


        Philip

        Comment


        • #5
          rick,

          Most micro-based ADCs are spec'd with an acquisition time plus a conversion time. The acq time may be a few us but that's not necessarily the aperture time (sample window). Unfortunately, most micro ADCs don't include a spec for aperture time, so you would need to sample some fast signals to get a feel for this.

          Also, just because you can sample at 1us doesn't mean you can process that fast. With a 20MHz 8-bit PIC you can only execute a few codes in between. Something like this will probably require some horsepower, like an ARM processor.

          - Carl

          Comment


          • #6
            Carl -> Thank you that explains alot. I will go off now and check out some more info about these times. Great info - I appreciate your response.

            Philip -> Yes an arduino or the similar was what I had in mind being quite easy to program with alot of support and sample code for external modules eg. LCD

            Comment


            • #7
              hello rick

              here's a link to a website you might want to check out:

              http://www.hownottoengineer.com/revi...road-test.html

              even to achive a 1us sample time is pretty tough to do. (with 16 bits or more)

              right now i'm working with the chipkit uno32 and a ads8319 ADC, i'll be posting my results
              soon!

              Philip

              Comment


              • #8
                Yes that board look very good indeed. What IDE do you use to program it?

                How have you been going so far at interfacing the two ICs?

                Have been checking out ADCs for the last 2 hours

                Comment


                • #9
                  hello rick

                  i'm usuing the mpide that is avaible from the digilent website:

                  https://github.com/chipKIT32/chipKIT32-MAX/downloads

                  the software is the same as the arduino mpide ( before the arduino 1.0)

                  with this software, i can have my arduino hooked up and at the same time have my chipkit 32 hooked up, write a small program and download to either of my boards, works great!

                  Philip

                  Comment


                  • #10
                    If you're using a 16Mhz crystal (using a divider of 128 -to stay below the maximum limit of 200khz), the maximum allowed adc clock will be 125khz. Because it takes 13 cpu cycles to complete, the maximum sampling an atmega8, will be 9.6khz.

                    At 9.6khz, the converter is the limiting factor in the atmegas adc processing function since the atmegas can process 1 instrunction/cycle.


                    Realistically speaking, to process a signal with any certain degree of accuracy you want to sample at least 2x its frequency, so any signal up to 4khz should work.

                    A lot of applications use the atmega to capture speech using only the atmega's internal adc because our voice boxes emit a frequency between 80-260hz.

                    With the right op amps, a sampling frequency of 4khz is theoretically usable for our metal detecting applications. I think several projects found on these forums make use of the atmega's adc without additional adc hardware.

                    Ironically, you may sample at the fastest setting (15khz, or a realistic figure of 7khz) if you use a slower crystal than 16Mhz. The key is using a crytal speed that will allow you to use the maximum adc clock of 200khz.

                    The above applies also to atmega48, atmega88,atmega168, or atmega328p (which are derivitives of the classic atmega8 ).

                    There are so many ways to go about this...and if I were to have a choice between adc vs fast cpu, in our application, a fast, accurate, and high resolution adc encoder is much more important. I think Minelab has already made the point that stupidly fast processor are not needed for our metal detectors.

                    Comment


                    • #11
                      I'm keen to do some sampling. Great help guys especially for us noobs

                      rickodetrader

                      Comment


                      • #12
                        I had always assumed that PI used ETS. for example, a 1khz pulse rate where the samples are taken at different delays relative to the pulse. Because the channel is obviously changing, the variance in the samples at the same delay would be used.

                        eg, sampling at +1us, +10us, +100us at 1khz would give a 333hz repetition rate. if the decision rate is 33hz, this gives 10 samples at each time offset. When there is little variation in the values, the meter is not moving. In this case the three samples could be related and used together. for example, an FFT for uniformly spaced samples (the above is exponentially spaced). If there is a high variation, the meter is moving quickly, and the samples must be used independently. (this method still has bandwidth limits based on the analog bandwidth and sample jitter. Deconvolution can be used, but the channel cannot be fully inverted as a lowpass filter is, well, a filter)

                        as for the processing speed and ADC resolution, you might end up chosing a faster CPU/ADC just because it isn't that expensive and might have a better dev environment (or just mean never worrying if something is an int vs a float).

                        Comment


                        • #13
                          ADC, MCU, speed and resolution, is all good.

                          But, how much power do you want to spend on it?

                          Do you want to spend 10% of the total Metal detector power on it or 60%?

                          Does it make more sense to spend the bulk of the power on the TX, where the power can really help generating a signal response of higher amplitude and therefore better S/N?

                          If you have a total amount of 100% of power, what would be a fair distribution?

                          TX- ............................................ x%
                          Audio output-................................x%
                          LCD and other visual indicators-.......x%
                          Pre-amp and analog part-................x%
                          Power supply and it's efficiency-.......X%
                          DSP-.............................................x%

                          With today's low weight and volume re-chargeable LI-ion batteries, the availability of power has much increased, but, still there are limits within reason and cost.

                          How much power should a deep searching detector consume?

                          Is 10W a reasonable number?

                          Tinkerer

                          Comment


                          • #14
                            Originally posted by Tinkerer View Post
                            ADC, MCU, speed and resolution, is all good.

                            But, how much power do you want to spend on it?

                            Do you want to spend 10% of the total Metal detector power on it or 60%?

                            Does it make more sense to spend the bulk of the power on the TX, where the power can really help generating a signal response of higher amplitude and therefore better S/N?

                            If you have a total amount of 100% of power, what would be a fair distribution?

                            TX- ............................................ x%
                            Audio output-................................x%
                            LCD and other visual indicators-.......x%
                            Pre-amp and analog part-................x%
                            Power supply and it's efficiency-.......X%
                            DSP-.............................................x%

                            With today's low weight and volume re-chargeable LI-ion batteries, the availability of power has much increased, but, still there are limits within reason and cost.

                            How much power should a deep searching detector consume?

                            Is 10W a reasonable number?

                            Tinkerer
                            There's so many factors involved in answering that question Tinkerer. First off, whats your market? Professional detectorists are likely to tolerate heavier battery use than a hobbyist. They have the money to invest in a generator at base camp and multiple battery packs so they never have to stop hunting almost regardless of power usage. A hobbyist that wants to travel light and return home when his detector is flat, probably less so.
                            Both groups are going to be interested in return on investment (power, not money) so you have to look at diminishing returns. ie. if a 2w detector gets 80% of the depth of a 10w detector then the 2w looks a lot more attractive than if it only got 20% of the depth. But even in the former case there would still be some people willing to use the 10w and change batteries 5 times as often for that extra 20%.
                            The next big factor is the kind of ground your hunting in. Do you want to go over an old known gold producing patch that's relatively small. There'd be no point in re-searching the top layer that already been cleaned out so you'd be willing to use big power for small increases in depth. Also anything you do find at depth has the potential to be worth a lot so your happy to spend a long time digging.
                            Conversely your searching a huge beach, your never going to run out of ground to search. The goodies are probably quite shallow anyway and quite low value (sure you might get the odd antique piece of jewelry but its going to be mostly loose change) so really not worth digging that deep. Perfect for a low power detector.
                            I know your interested in the higher power area so I would say go nuts. If (that's a big if) you can continue getting increased depth with more power then there would be some people that would happy to use up even 100's of watts of power. Perhaps even kW's, think towed behind a quad bike, powered of an alternator, type detector.

                            Midas

                            Comment

                            Working...
                            X