Announcement

Collapse
No announcement yet.

Sampling question in PI design

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

  • Sampling question in PI design

    Hi Folks.

    I have a couple questions. Mainly related to direct sampling versus hardware integrator stages in an mcu-based design, and split versus single supply designs.

    For a main sample, i.e reading the voltage after the preamp stages, but before and hardware integration, is it better to sample once per TX cycle, and average over multiple cycles? Or is it better to sample multiple times in the same sample window? In a 20us sample window, I'm limited to a couple samples max. Or is it better to use hardware integrator stages after the preamp stage, and just read the final into an output?

    I want to use direct sampling, since it eliminates a bunch of components, but my ADC is limited to between 100K-200Ksps, which limits the number of samples I can get in on a single pass. If I simply sample over multiple cycles, I don't have that issue, and I can always precisely sample at the exact same sample delay time.

    Another question I have is related to split versus single supplies. I prefer the simplicity of single supplys, which is why I'm considering a seperate TX and RX coil, but I want to know if I lose any benefits from using single supply preamp and integrator stages versus split supply preamp and integrator supplies.

    Thanks in advance.

  • #2
    I'm building an MCU based design and I am using a running average based on the last 16cycles.

    Comment


    • #3
      Originally posted by fixstuff View Post
      For a main sample, i.e reading the voltage after the preamp stages, but before and hardware integration, is it better to sample once per TX cycle, and average over multiple cycles? Or is it better to sample multiple times in the same sample window?
      The highest frequency component in an analog signal determines the bandwidth of the signal. In a PI metal detector, the RX decay curve is modulated by the target signal, and it is this signal that you're trying to extract. The frequency of this signal is much lower than the TX pulse rate of the detector. According to Nyquist's Theorem, the sample rate must be at least twice the maximum frequency, which (in this case) is very low. Hence, it is only necessary to sample once per TX pulse and average the results to reduce noise.

      Originally posted by fixstuff View Post
      In a 20us sample window, I'm limited to a couple samples max. Or is it better to use hardware integrator stages after the preamp stage, and just read the final into an output?
      It really depends on the processing power you have available. Sampling and integrating with discrete hardware will remove a lot of overhead from the processor.

      Originally posted by fixstuff View Post
      I want to use direct sampling, since it eliminates a bunch of components, but my ADC is limited to between 100K-200Ksps, which limits the number of samples I can get in on a single pass. If I simply sample over multiple cycles, I don't have that issue, and I can always precisely sample at the exact same sample delay time.
      I think it's more important to consider the resolution of the ADC, rather than its sampling rate. If (for example) you have a built-in 10-bit ADC with a 5V reference, then the lowest voltage you can resolve is 5/1024 = 4.88mV. If the pre-amp stage has a gain of 1000, then you will be able to detect a change in target signal of 4.88uV. If this good enough? Probably not. You could try using the signal processing technique of oversampling and decimation to increase the ADC's resolution, but this will consume a lot of resources in the processor, and could result in a delay in the audio response.

      Originally posted by fixstuff View Post
      Another question I have is related to split versus single supplies. I prefer the simplicity of single supplys, which is why I'm considering a seperate TX and RX coil, but I want to know if I lose any benefits from using single supply preamp and integrator stages versus split supply preamp and integrator supplies.
      Single supplies will simplify the power supply design, and make it easier to interface analog signals to the processor, but you also need to consider the dynamic range of the input signal. At the end of the day, it very much depends on what you're trying to achieve. Is this going to be a simple detector design with low to average performance, or a high-performance unit? As always happens, it comes down to compromise over size, cost, performance, etc.

      Comment


      • #4
        Thanks for the answers. I will proceed with the once per TX pulse, and use the 16bit resolution capability of the mcu. I will also eliminate the integrator stages, which simplifies the board quite a bit. I'll just do it in software.

        Comment


        • #5
          I'm curious, what MCU are you referring to?

          Comment


          • #6
            It's a Teensy 3.1, which uses an Arm Cortex M4. Wonderful chip, btw.

            Comment


            • #7
              This company appears to be the official distributor in the UK ->
              http://www.hobbytronics.co.uk/teensy-v31

              Comment


              • #8
                Be very careful in your assumptions about the speed, resolution, and accuracy of the adc subsystem. There is a devil or 2 hiding behind the details and the graphs in the Freescale data sheet. All is not as it seems at first glance.

                Has anyone actually seen the spectral response of a representative target decay time signal including noise?

                Comment


                • #9
                  Are you referring to the max usable res of 13bit? I have read this, which would imply making sure you use A10 and A110 diferentially to achieve 16bit.
                  Last edited by fixstuff; 09-16-2015, 08:26 PM. Reason: added 16 bit note

                  Comment


                  • #10
                    Look at the graphs on page 40. 14.5 bits is only achieved with 32 sample averaging on a 100 Hz sine wave. Input signal bandwidth is only 4Khz in 16 bit mode. The implication is, that the time to acquire a sample is so long that the slew rate of a 4Khz sine wave is the best it can do.

                    Compare it to the shutter speed of a camera, if to slow, your picture is blurred.

                    ENOB (Effective Number Of Bits) goes to hell if you use the pga to amplify your signal.

                    Bottom line, it really isn't any better than a good quality ext 12 bit adc.

                    It's still a great buy however, forum members are building PI det. using avrs with 10 bit converters. if you average successive readings it just means slowing the movement of the coil over the ground. It would be interesting to see what it could do with an ext. track and hold chip or go all out and use an ext spi 16 bit adc.

                    PS everything above assumes differential mode
                    Rick

                    Comment


                    • #11
                      I did see something interesting I didn't expect while testing. I was using 16 bit with the single ended inputs, and I expected counts that would jump at least somewhat between counts, based on the extra 3 bits of unusable resolution bit setting. Instead, I actually saw that I had counts, even as low as single increments, i.e. 63386, 63387, etc. I didn't expect that.

                      Using the 16 bit res, on a single ended input, a single sample took about 14us. If I switch back down to 13, it should be quite a bit faster.

                      For now, I will try the 13 bit, and see how that does also. I will probably just use the single ended, and go with the 13 bit resolution.

                      I was really impressed with how easy it was to get the pwm and interrupts going and the sampling with the Teensy. I attached a screenshot of my testing waveform, in case anyone is curious. The sample width was basically the ADC conversion time.

                      Click image for larger version

Name:	teensy_md.jpg
Views:	1
Size:	321.1 KB
ID:	343721

                      Comment


                      • #12
                        Keep in mind that measuring a stable dc source will produce much better results than real world measurements on the return signal of a PI detector.

                        Comment


                        • #13
                          Very true. I'm working on the schematics also, so hopefully I can start breadboarding this up to test how noisy it will look.

                          Comment


                          • #14
                            After engaging a few more neurons in my old brain, I realized that for this kind of application, absolute accuracy isn't that important. Repeatability is. You really aren't concerned with how many uV or mV a particular point in the decay curve is, only that you can get the same reading every time, i.e. when the coil is stationary. You do need the resolution 16 bits provides, and noise will still be an issue.

                            "3 bits of unusable resolution bit setting"
                            You won't loose resolution, only accuracy.
                            Rick

                            Comment


                            • #15
                              You know, that's what I've been thinking also. As long as it's repeatable, that's really what my main goal is. Basically, I will be using some sort of a lookup table anyway to correlate a sample reading with a range of values that correspond to a certain target depth or size. I guess experimenting with it will really let me know what I'm looking at.

                              Comment

                              Working...
                              X