Announcement

Collapse
No announcement yet.

Let's made a PC-base metal detector with usb interface !!!

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

  • Hi simonbaker,

    Originally posted by simonbaker View Post
    Hi Aziz:

    Would you describe again why you are using a modulator and how it works?

    Regards,

    -SB
    The modulator converts a DC voltage (sample signals) into an AC voltage. The sound card can not be fed by DC voltages. Damn!

    There is some advantage of the modulator: The line noise immunity (only affected on the modulation frequency within small bandwidth) and overall low noise on high modulation frequency (the low frequency noise won't be seen by the demodulation). The DC frequency range will be moved out of the 1/f low frequency region (very high noise level). The 1/f noise generally exceeds the thermal noise. The demodulator can reconstruct the tiny signals buried in much noise levels (lock-in amplifier).

    The modulation (mixer) is very simple:
    Modulation = Continious integral over time of (signal*modfrequency). Modfrequency is a function of changing +1/-1 factor, which changes with the modulation frequency. If you integrate over a periodic polarity changing signal (differential balanced signal), you will get a triangular wave form modulation. This is almost as good as a sine wave, which has odd harmonics. A pure sine wave would be much better of course but it is expensive to implement this.

    The integration is the inverting integrator circuit already shown former. Modfrequency comes from the binary counter with the gate voltages to select the +signal and -signal in the JFET for integration. The integrating capacitor will be alternatively charged or discharged with modulation frequency compensated current. A simplified +signal and -signal buffer is also there, where the most noise is generated from the inverting signal buffer (-signal).

    We have a stereo line. Each line contains two modulated samples with different modulation frequency. We can modulate therefore upto four signals (four channels). The amplitude and phase of the modulated signal represents the DC signal voltage and polarity. If the DC signal is infected with noise, the modulator will also modulate the noise. So the DC signal must be almost "noise-free".

    The sampled DC signal will be quite noisy due to the different circuit stages (pre-amp, PGA, integrator, S&H). I have to make some "crazy" experiments to find a good solution for this problem.

    Aziz

    Comment


    • Originally posted by Aziz View Post
      Hi simonbaker,



      The modulator converts a DC voltage (sample signals) into an AC voltage. The sound card can not be fed by DC voltages. Damn!

      There is some advantage of the modulator: The line noise immunity (only affected on the modulation frequency within small bandwidth) and overall low noise on high modulation frequency (the low frequency noise won't be seen by the demodulation). The DC frequency range will be moved out of the 1/f low frequency region (very high noise level). The 1/f noise generally exceeds the thermal noise. The demodulator can reconstruct the tiny signals buried in much noise levels (lock-in amplifier).

      The modulation (mixer) is very simple:
      Modulation = Continious integral over time of (signal*modfrequency). Modfrequency is a function of changing +1/-1 factor, which changes with the modulation frequency. If you integrate over a periodic polarity changing signal (differential balanced signal), you will get a triangular wave form modulation. This is almost as good as a sine wave, which has odd harmonics. A pure sine wave would be much better of course but it is expensive to implement this.

      The integration is the inverting integrator circuit already shown former. Modfrequency comes from the binary counter with the gate voltages to select the +signal and -signal in the JFET for integration. The integrating capacitor will be alternatively charged or discharged with modulation frequency compensated current. A simplified +signal and -signal buffer is also there, where the most noise is generated from the inverting signal buffer (-signal).

      We have a stereo line. Each line contains two modulated samples with different modulation frequency. We can modulate therefore upto four signals (four channels). The amplitude and phase of the modulated signal represents the DC signal voltage and polarity. If the DC signal is infected with noise, the modulator will also modulate the noise. So the DC signal must be almost "noise-free".

      The sampled DC signal will be quite noisy due to the different circuit stages (pre-amp, PGA, integrator, S&H). I have to make some "crazy" experiments to find a good solution for this problem.

      Aziz
      Ok. I need to do homework to understand pulse detector better. I thought you were digitally sampling the received pulse directly with the audio card, which I assume would not need modulator since very fast.

      I am not clear from this thread: exactly what signals are you sampling (4 channels)? Can you refer to a pulse detector schematic?

      Thanks,

      Cheers!

      -SB

      Comment


      • Hi simonbaker,

        Originally posted by simonbaker View Post
        Ok. I need to do homework to understand pulse detector better. I thought you were digitally sampling the received pulse directly with the audio card, which I assume would not need modulator since very fast.

        I am not clear from this thread: exactly what signals are you sampling (4 channels)? Can you refer to a pulse detector schematic?

        Thanks,

        Cheers!

        -SB
        No, it isn't a direct sampling of the signals. I have four channels (four signals), which they be held on the S&H amplifier. The output of the S&H goes to the modulator input channels. On every cycle, the S&H voltages will be updated (depending on the firmware code of course).

        Comment


        • Hello,

          I have now a different strategy of getting the sample signals with less noise. It requires however radical design architecture changes in the analog front-end. This will kill the huge 1/f noise and low frequency noise. The lectures on low noise design simulations with spice will help to reduce further noise. I want to reduce the noise voltage density from µV/Hz½ into nV/Hz½.

          Now back again to the black board.

          Aziz

          Comment


          • Originally posted by Aziz View Post
            Hi simonbaker,



            No, it isn't a direct sampling of the signals. I have four channels (four signals), which they be held on the S&H amplifier. The output of the S&H goes to the modulator input channels. On every cycle, the S&H voltages will be updated (depending on the firmware code of course).
            Hi Aziz:

            Do I understand correctly: you plan to use hardware to get four voltage samples of the RX pulse in four S&H analog buffers in quick succession. These samples are simply 4 DC voltages held by the S&H circuitry until the next pulse is taken, and represent 4 points in time.

            Are you assuming that 4 samples is enough to represent the decay pulse quite accurately? If the pulse is a simple exponential, that would seem reasonable.

            Then you will "modulate" these four voltage values simultaneously onto four separate carriers in the audio spectrum, sum the signals and feed them into one Audio card input channel. Then using software, you will demodulate the composite signal (using digital filtering?), and recover the 4 sample voltages.

            You have only the time between pulses to do the processing.

            Is that an accurate description of the signal processing?

            Regards,

            -SB

            Comment


            • Hi Aziz:

              You mentioned early in the thread that an Audio card does not have enough bandwidth sample the actual RX pulse directly, which is why you are using the S&H technique with a faster sample rate.

              Can you somehow make an FFT type of spectrum analysis of an actual RX pulse to see what the spectrum really looks like? I guess it would require taking a picture from an oscilloscope and tracing it with a digitizer to get the points into the computer.

              I think it would be interesting to see.

              Regards,

              -SB

              Comment


              • Hi Aziz:

                From your reports, it seems like it is a major challenge to use an audio card to process the fast pulses from a pulse type MD (or GAD) because the pulse is so quick. The Audio card seems like a much more natural fit for the VLF MD types like you were working on before.

                I am wondering if another way to handle the fast pulses would be to use "time stretching" circuitry. In other words, sample fast, then read out slowly. Reconstruct the waveform in analog by clocking the S&H voltages at a slower rate into an analog filter (using multiplexor), then feed into the Audio card. Maybe audio card is the filter, so just multiplex the 4 voltages at the appropriate rate into the audio card and read the signal. Yes there is distortion because DC and low frequencies missing, but you should be able to calibrate for that in software, as long as audio card can settle to zero between pulses.

                But I think you wrote that you plan to operate device at 6000 pulse/second. That seems like not much time for processing or even multiplexing.

                It really seems like on board ADC and digital interface easier and more accurate in long run, but very interesting to see what can be done with audio card.

                What do you think of these kinds of product?

                http://www.akm.com/prodfolder-adc.asp?p=AK5371A

                Regards,

                -SB

                Comment


                • Hi simonbaker and other friends,

                  the objectives of this really experimental and crazy project is as follows:
                  To have a device (measurement instrument), which can make four basic analog pre-processed (sampled) DC signals, which will be processed by an universal computer (PC/laptop) using the high definition sound cards (24-bit). The DC signals, referred as sample channels, can either be:
                  - direct voltage levels on the decay curve at specific time (TX, RX, pre-amp)
                  - integration of signals over some period of time window
                  - integration and/or deintegration of signals over multiple period of time windows
                  - any other sensor signal sources
                  - or zero volt (for calibration)

                  Four samples are just enough to perform different operations. There is no necessity for more samples. The pre-processed signals will therefore be sampled just-in-time and will be hold as long as the cycle period last. This is the reason, why I use sample and hold stages.

                  If we have the DC signals, we need the modulator to transfer these DC signals into the PC/laptop through the sound card (AC coupled). We have two lines in the sound card input (stereo channels left and right). Each line can contain two encoded signal channels (two samples). The firmware implementation decides, whether it wants to use all four channels or not. In case of only two channels, we can have almost the full 24-bit ADC resolution (left and right line encoded). In case of three or four, we can have almost 23-bit ADC resolution. We can also combine left and right channel with same signals and average over the decoded channels to increase the resolution by one bit or a SNR factor of 1.414 (=sqrt(2)) .

                  As the microcontroller does not really know, what it is doing except only controlling the hardware modules, the processing and decoding of the channel signals will be performed only in the PC/laptop (plug-in module). The microcontroller would anyway don't have enough processing power for such high transmit pulse rates (upto 12kHz/4 = 3000 PPS or even 18kHz/4 = 4500 PPS!). We would need a very fast digital signal processor (DSP) clocked at 500 MHz and more to cope with this huge processing task. But the PC/laptop delivers much more number crushing power to do this job in real-time and much more.

                  Remember back, the microcontroller itself performs only a software simulation of an another CPU. It does really not know, what the microcontroller is doing (it is only simulating a cpu). It performs only hardware specific instructions to control the modules. These instructions are coming through the PC/laptop interface and are so-called running in the data SRAM of the microcontroller! Once the firmware implementation is downloaded into the microcontroller, it will then be executed like an assembler code program. The hardware platform is free of any PI/metal detector implementation. I also can omit any flash programming of the microcontroller (no update necessary). The microcontroller firmware will be quite small (startup code, interface protocol and cpu simulation only). This gives the flexibility of changing the measurement firmware implementation just in real-time. It also makes future measurement implementation add-ons possible.

                  The modulator itself isn't any problem causing module. It adds only small amount of noise to the modulated DC signals (won't even detect the huge 1/f noise range). Once the channels are modulated, almost any additional noise can be filtered out by the software demodulation (PC/laptop). Only some frequencies should not be infected: reference clock/2, reference clock/4 and multiple harmonics of these frequencies. Imagine, if we decode the signal on only 1 Hz bandwidth on the modulation frequency, we would detect only the noise density of the modulator and sound card (just in nV range!!!). This is the reason why the modulator is the lowest noise generating module of the whole design. Demodulating the signals with the lock-in amplifier would be very fine (more processing power needed). There are also other methods of decoding: FFT (slow) or Goertzel algorithm (very fast decoding possible -> will save battery power).

                  Now the big challenge is to get four DC samples as "noise-free" as possible from the universal hardware platform. If we add much noise to the DC signals, we will loose lots of ADC resolution bits in the sound card. We can compensate this a bit with increased signal sample rates. If we have 1500 PPS cycle rate and reduce the detection speed to 100 Hz, we would have a oversampling of 15 times (1500/100 = 15) . This would give us log(15)/log(2) = 3.9 bits more ADC resolution at the end. If the decoding is synchronized to a disturbing periodic noise source (mains hum for instance), then this noise source can also be filtered out. It is only a matter of giving the right clock rates and adjusting the software parameters for processing.

                  We will definitely loose some (or much) resolution bits due to the general noise problems of dealing with DC signals (damn, is totally in the 1/f noise region). What we should do is modulating the fresh signal as soon as possible. Copper amplifiers particularly are using this technique before they amplifiying the DC signal and demodulating it then with a synchronous detector (or synchronous rectifier). We would need similar techniques but it would require much architecture design changes. Anyway, copper amplifiers can not be used here. But the knowledge of these amplifiers are very interesting.

                  I will try different strategies to keep the noise as low as possible. The reference clock jitter from the sound cards seems not to be much critical. Maybe a PLL implementation could give more flexibility at more cost. I need an oscilloscope to see soon, what is going on in the internals. What I have done is an almost a "blind development in the dark" so far. The PC software with sound card FFT, lock-in amplifier and scope is quite useful. And the spice circuit simulations were also very helpful.


                  Aziz

                  Comment


                  • Chopper amplifier not copper amplifier!

                    Comment


                    • Aziz: what I'm wondering is this:

                      Because everything is happening so fast, do you really need a modulator at all?

                      Consider this: you have a dc voltage on an S&H buffer. Imagine quickly connecting that dc voltage to the Audio card input, then disconnecting it. If you time it right, you will get a pulse whose amplitude is darn near to the DC voltage level. Like passing a pulse into a bandpass filter, see what I mean? If you know the bandpass filter characteristics, and know the pulse width (controlled by you), you should be able to compute the original DC voltage very accurately. Essentially you did a one cycle "chop".

                      So now you wait until the audio card input settles to zero and move to the next S&H buffer and do it again. In other words, basically all you need is a multiplexer that rotates between the 4 DC voltages, connecting them to the audio card input, creating the pulses. But the trick is to make sure the audio card settles in between, which I think there are a number of ways to compensate for.

                      Just an idea, maybe not practical.

                      Cheers,

                      -SB

                      Comment


                      • Hello all,

                        look at this: Propeller Chip from Parallax
                        http://www.parallax.com/tabid/407/Default.aspx

                        Just found it on the other forum.

                        Comment


                        • Hi simonbaker,

                          Originally posted by simonbaker View Post
                          Aziz: what I'm wondering is this:

                          Because everything is happening so fast, do you really need a modulator at all?

                          Consider this: you have a dc voltage on an S&H buffer. Imagine quickly connecting that dc voltage to the Audio card input, then disconnecting it. If you time it right, you will get a pulse whose amplitude is darn near to the DC voltage level. Like passing a pulse into a bandpass filter, see what I mean? If you know the bandpass filter characteristics, and know the pulse width (controlled by you), you should be able to compute the original DC voltage very accurately. Essentially you did a one cycle "chop".

                          So now you wait until the audio card input settles to zero and move to the next S&H buffer and do it again. In other words, basically all you need is a multiplexer that rotates between the 4 DC voltages, connecting them to the audio card input, creating the pulses. But the trick is to make sure the audio card settles in between, which I think there are a number of ways to compensate for.

                          Just an idea, maybe not practical.

                          Cheers,

                          -SB
                          Sure, this also can be done. A rectangle pulse modulation has an infinite frequency response, which would require more multiple harmonic demodulations to reconstruct the signal to some level of resolution. The triangular modulation requires less multiple harmonics. But the modulator implementation would be much easier and would save some noise level.

                          I should try this next time. I also have planned to modulate directly on the pre-amp output or directly on the RX coil (after the high voltage clipping). I would like to measure the noise density at this stage and it will probably deliver reasonable decay curve reconstruction. Then the hardware could be radically simplified. It could be modulated with 12/18 kHz.

                          Thanks for your ideas.
                          Aziz

                          Comment


                          • Originally posted by Aziz View Post
                            Hi simonbaker,



                            Sure, this also can be done. A rectangle pulse modulation has an infinite frequency response, which would require more multiple harmonic demodulations to reconstruct the signal to some level of resolution. The triangular modulation requires less multiple harmonics. But the modulator implementation would be much easier and would save some noise level.

                            I should try this next time. I also have planned to modulate directly on the pre-amp output or directly on the RX coil (after the high voltage clipping). I would like to measure the noise density at this stage and it will probably deliver reasonable decay curve reconstruction. Then the hardware could be radically simplified. It could be modulated with 12/18 kHz.

                            Thanks for your ideas.
                            Aziz
                            Aziz: I'm talking about time multiplexing rather than frequency multiplexing. You just use the sound card to sample the "pulses" that come from your multiplexer and measure directly, no harmonics involved. The multiplexer is just a switch that selects each S&H voltage for a duration. Do you see what I mean? Just a pulse comes in your sound card, you measure it, and adjust for round-off. Just simple.

                            I do not yet understand the details of your modulator. My intuition is that you cannot get accurate measurement quickly in a narrow band signal (takes time). So depends on how much bandwidth you use and isolation of bands. But theoretically, all modulation methods can probably achieve equivalent accuracy if done optimally (use entire bandwidth), just different difficulty to implement.

                            Regards,

                            -SB

                            Comment


                            • Hi simonbaker,

                              time multiplexing won't work well. Remember, the sound card is AC coupled.

                              ------------

                              I made today some synchronisation clock tests. If the synch clock is synchronized to the transmit cycle period, then the noise from power supply has minimum effects. I was quite surprized, how good the lock-in amplifier works, when it wasn't synchronized at all. There is on some frequency spectrum more noise, which causes some small clocking jitter (not serious).
                              I have lowered the transmit cycle period down to 10 Hz (works). Also on some 50/100 Hz region to test the mains hum. The lock-in amplifier minimizes the noise due to sharp bandwidth decoding (not much problems detected yet).

                              But interesting fact is measureable: The battery voltage decay due to power capacitance diminish causes some drift in the signal strength. A regulated transmit pulse voltage would solve this problem. Also the software part can do this automatically (drift prediction).

                              I will make some direct coil voltage sampling (400 V down to zero) next time. I am sure, there will be enough signals to sample on the decay curve just after transmit off (just at the end of the breakdown voltage of the MOSFET). I will use only a pre-amplifier on the attenuated high coil voltage and maybe use an integrator to stretch the decay curve to sample without the modulator stage (direct ac-coupling to the sound card). Interesting to see the noise density and the clock timings.

                              I think, it is possible to make a very simple PI hardware, which can run without a microcontroller (using triggered NE555, where the reference clock is coming from the sound card). I will check this possibility (makes everything simple to build).

                              With the 96 kHz sampling rate, we have almost on every 10 µs an ADC sample. Two independend amplifier with different amplification would feed the left and right channel simultaneously. The AC coupling will be ensured by rising the slew rate (SR = dU(t)/dt) by amplification or using a simple integrator.

                              Direct sampling could minimize the overall noise as the front-end becames very light and smart. The sound card is capable to detect µV without the need for amplification. If there isn't much signal or we have to sample very late, then we have to boost the amplification to get higher slew rates of the decay curve.

                              Hey, I was able to detect metal today with direct sampling! Lock-in frequency was the transmit pulse frequency.

                              Aziz

                              Comment


                              • Originally posted by Aziz View Post
                                Hi simonbaker,

                                time multiplexing won't work well. Remember, the sound card is AC coupled.

                                ------------

                                I made today some synchronisation clock tests. If the synch clock is synchronized to the transmit cycle period, then the noise from power supply has minimum effects. I was quite surprized, how good the lock-in amplifier works, when it wasn't synchronized at all. There is on some frequency spectrum more noise, which causes some small clocking jitter (not serious).
                                I have lowered the transmit cycle period down to 10 Hz (works). Also on some 50/100 Hz region to test the mains hum. The lock-in amplifier minimizes the noise due to sharp bandwidth decoding (not much problems detected yet).

                                But interesting fact is measureable: The battery voltage decay due to power capacitance diminish causes some drift in the signal strength. A regulated transmit pulse voltage would solve this problem. Also the software part can do this automatically (drift prediction).

                                I will make some direct coil voltage sampling (400 V down to zero) next time. I am sure, there will be enough signals to sample on the decay curve just after transmit off (just at the end of the breakdown voltage of the MOSFET). I will use only a pre-amplifier on the attenuated high coil voltage and maybe use an integrator to stretch the decay curve to sample without the modulator stage (direct ac-coupling to the sound card). Interesting to see the noise density and the clock timings.

                                I think, it is possible to make a very simple PI hardware, which can run without a microcontroller (using triggered NE555, where the reference clock is coming from the sound card). I will check this possibility (makes everything simple to build).

                                With the 96 kHz sampling rate, we have almost on every 10 µs an ADC sample. Two independend amplifier with different amplification would feed the left and right channel simultaneously. The AC coupling will be ensured by rising the slew rate (SR = dU(t)/dt) by amplification or using a simple integrator.

                                Direct sampling could minimize the overall noise as the front-end becames very light and smart. The sound card is capable to detect µV without the need for amplification. If there isn't much signal or we have to sample very late, then we have to boost the amplification to get higher slew rates of the decay curve.

                                Hey, I was able to detect metal today with direct sampling! Lock-in frequency was the transmit pulse frequency.

                                Aziz
                                Hi Aziz:

                                Direct sampling is exactly what I'm saying! You have arrived at same conclusion. My feeling is the original RX pulse dv/dt is sufficient to pass through bandpass filter of audio card. Yes, there will be some distortion, but predictable. You should have enough information to use as metal detector.

                                As an example, I attach spice simulation of feeding pulses into a bandpass filter, approximately same band as audio card. The pulses could be the time multiplexed S&H voltages referred to before. You can see that the pulses are modified a little, and there is a drifting bias that will settle eventually, but otherwise if you measure pulse height, it should be very representative of the input pulse, scaled somewhat.

                                If your audio card can actually get enough samples from the original pulse, then yes, feed that straight in! As for integrating it before sending to audio card -- that sounds like you would have to differentiate later in software, maybe noisy process.

                                I'm just having fun thinking about your project, don't really know anything -- you are making very real and excellent progress -- all experiments and ideas are very interesting to build and test, always something to learn. Thanks again for showing all the progress.

                                Cheers!

                                -SB
                                Attached Files
                                Last edited by simonbaker; 04-09-2009, 01:10 AM. Reason: add images

                                Comment

                                Working...
                                X