Announcement

Collapse
No announcement yet.

HV temporal sampling ?

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

  • HV temporal sampling ?

    I came across this page "Pulse induction metal detector with DSP" by Lammert Bies.
    https://www.lammertbies.nl/electroni...metal-detector
    It includes this diagram of three decay curves :
    - no target
    - ferro target
    - non ferro target

    Click image for larger version

Name:	pi_decay.png
Views:	208
Size:	15.1 KB
ID:	436881

    If this diagram is correct, it looks like the "easiest" way to cleary discriminate between targets is by measuring the pulse width of the top of the flyback pulse. Hence the title "HV temporal sampling".
    The top width of the flyback may only be a couple of microseconds, but with eg an ESP32 running at 240 MHz, we have a resolution of 4.1 ns to measure the pulse width using XTHAL_GET_CCOUNT(). This gives us the number of CPU clock cycles at 240 MHz.

    I am not an analog electronics specialist and tried to capture the top 10V of the flyback with a 10V zener diode:



    Click image for larger version

Name:	HV_samping.jpg
Views:	201
Size:	200.2 KB
ID:	436882


    However, as soon as a load is added to the HV peak detection, it drops. Maybe a bigger HV tank capacitor would help? Or a higher pulse frequency? I tested it with a pulse frequency of 500 Hz / 2 ms from a Pickini detector.
    As long as there is no load on the peak HV, it is around 400V - resulting in a nasty shock when the electrolytic tank capacitor is touched, as I experienced first hand...

    Can someone with more PI analog front end experience answer these questions:

    1/ Is this decay diagram correct - is there really a time shift depending on the type of metal near the flyback top ?
    2/ If so, are there examples of PI detectors taking advantage of this property ?
    3/ If so, is there a better way to sample the top N Volts and interface it to a microcontroller / SOC at 3.3V ?

    Thanks in advance for having a look
    - Bernard


  • #2
    Click image for larger version

Name:	20250423_164557.jpg
Views:	174
Size:	431.8 KB
ID:	436892 Click image for larger version

Name:	20250423_164617.jpg
Views:	176
Size:	415.7 KB
ID:	436893 Click image for larger version

Name:	20250423_164606.jpg
Views:	176
Size:	401.5 KB
ID:	436894 I've got the same diagram. I haven't noticed the same effect though. I have been working on a PI detector for about six months. It uses an ESP32 and samples the return waveform at 10 points using the inbuilt 12 bit A/D. I've tried a few different configurations of trigger pulse duration and curve damping and none have shown any difference I can discern between steel and copper. Still early days though. Maybe when I get down to the nuances, I might spot something. It has taken me ages just to get it working. The three traces are no target, steel and copper. The steel is a pair of pliers and the copper a piece of plumbing pipe, hence the stronger response from the more solid steel object.

    Attached Files

    Comment


    • #3
      Your questions:
      1/ Is this decay diagram correct - is there really a time shift depending on the type of metal near the flyback top ?

      I would say the diagram is wishful thinking but will be happy if proven wrong because I really want it to be true. I've seen a few comments on being able to identify the target by getting the measurement point as close after the pulse as possible. The A/D on the ESP32 takes approx 13μs and I've tweaked and tweaked my circuit to get as close as possible. I'm currently on 14μs for the first sample. It hasn't helped me with target identification.

      2/ If so, are there examples of PI detectors taking advantage of this property ?

      No idea. Looks like everything is IB nowadays.

      3/ If so, is there a better way to sample the top N Volts and interface it to a microcontroller / SOC at 3.3V ?​

      I have a 2 opposing diode clamp feeding an NE5532 with a gain of a few million. I then have a resistor based voltage divider to feed 3.3V max to the A/D.
      Last edited by NigelLeeming; 04-23-2025, 07:22 PM.

      Comment


      • #4
        Decay curves are based on the timeconstant of the target.
        Unfortunately, ferro targets play with eddy currents and with their high magnetic permeability, so they can have practically any time constant depending on the size, shape, orientation to the coil, etc.
        In short, the curves shown are correct only for two specific objects, but they have no practical application in metal detection, i.e. it is impossible to make real ferro/nonferro discrimination only with passive samples.​

        Comment


        • #5
          Originally posted by boilcoil View Post
          Decay curves are based on the timeconstant of the target.
          Unfortunately, ferro targets play with eddy currents and with their high magnetic permeability, so they can have practically any time constant depending on the size, shape, orientation to the coil, etc.
          In short, the curves shown are correct only for two specific objects, but they have no practical application in metal detection, i.e. it is impossible to make real ferro/nonferro discrimination only with passive samples.​
          The above is correct. Sampling the decay curve will only provide discrimination by conductivity.
          To reject ferrous targets, you need a different approach.

          Comment


          • #6
            The OPs diagram is correct however only for large selected targets as pointed out above.
            Note also the diagram is a "diode clamped" voltage waveform ... this is extremely bad in a PI detector for the following reasons.

            1. The clamping process effectively demodulates to DC the target signal which is fundamentally an AC signal ( DC cant travel through magnetic couplings ). The clamping process is very crude and it effectively mixes or remodulates all the low frequency noise present at the time of clamping and this will appear as sidebands on the wanted AC signals ... this noise inludes mains hum, atmospherics , EMI , earth field modulation due swinging of the search coil in static EF etc etc. Additionally the coil inductance / the capacitance / the resistance / the target / the front end circuitry all form a complex impedance where current and voltage are not in phase .... and you are trying to resolve something from a voltage only waveform .... not ideal.

            2. Worst of all the clamping circuit mixes the frequency components of the decay curve itself with the target signal.

            3. Usually the front end preamp is overloaded by the clamped voltage going in ... as the preamp will have high gain. This causes further non linear distortion and modulation products.

            4. Then you take some samples which is now a further demodulation however now you are demodulating the distortion products listed above in addition to the target signal.

            Its really a wonder that PI detectors work at all. Imagine if radios had all this distorting circuitry at the input before detection of the wanted signal.

            For a metal detector the frontend wants to establish two things ( channels ?? ).

            A. Magnetic permeability
            B. Target conductivity

            Ideally you should separate these two measurements so one does not conflict the other ... and it can be done.

            The principles are shown below and well known. ( and there is more than one solution for each here )

            Permeability.

            Click image for larger version

Name:	image.png
Views:	163
Size:	5.5 KB
ID:	436916

            Conductivity ( eddy current )

            Click image for larger version

Name:	image.png
Views:	157
Size:	222.6 KB
ID:	436917

            Can this be done without frontend clamping circuitry ?? ( avoiding signal distortion) : YES ( removes EF / mains / EMI )
            Can permeability be determined in isolation : YES ( Ferrous non ferrous and ground balance)
            Can Conductivity be determined in isolation : YES ( target detection and salt rejection )

            Can it be done for MONO coils ... YES
            Can it be done for IB coils ... YES

            Can it be done for PI type detectors ... YES
            Can it be done for CW detectors ... YES

            Can it all be done in one detector ... YES.

            Keep pluggin .. you are asking the right questions.

            moodz


            Comment


            • #7
              Thanks for all the input so far !
              I am fully aware that discrimination based on the decay curve is not exact science. But then again, even my Deus2 gets it "wrong" "sometimes"...
              The question was mainly triggered because I made the Pickini temporal sampling detector almost 10 years ago. It measures the decay pulse width at low voltage - after amplification - with a PIC microcontroller running at 32 MHz.
              Now that I was playing with the ESP32 running at 240 MHz, this increases the resolution almost 8x.
              Which should be enough to measure pulse width at the top of the decay curve at around 5 microseconds --- this should result in a value of around a 1000 clock cycles on the ESP.
              When the decay curve timing shifts in one direction or the other, the value should be more / less --> giving an idea about conductivity.
              But so far I was not able to extract / sample the decay pulse at its highest point yet -- the schematic diagram was just an attempt.
              The only thing that works well is charging the HV capacitor to the peak of the flyback voltage -- around 400V.

              As most PI designs stick to voltage sampling at low voltage of the decay curve, I don't understand how it is possible to "discriminate" when curves for ferrous and non-ferrous cross each other at a certain point.

              Comment


              • #8
                I misclaimed 13μs as my A/D read time. I thought I'd better recheck it and found it to be between 40 and 60μs. I've been looking at a few ways of making it read faster using lower level calls.

                Comment


                • #9
                  I misclaimed 13μs as my A/D read time. I thought I'd better recheck it and found it to be between 40 and 60μs. I've been looking at a few ways of making it read faster using lower level calls.
                  ??
                  On the old PIC 16F1824 I used for the Pickini project, running at 32 MHz, a 10 bit AD conversion took 1 microsecond...

                  The idea of temporal sampling is to measure the pulse width, not sampling any voltages.

                  Comment


                  • #10
                    For one complete sample at 10-bit ADC, 11.5 TAD + TACQ is required.
                    The TAD is determined by the frequency of the ADC, which is not the frequency of the processor. The minimum TAD duration for this type of processor is not recommended to be less than 1us.
                    So the time is a bit longer.​

                    Comment


                    • #11
                      On the old PIC 16F1824 I used for the Pickini project, running at 32 MHz, a 10 bit AD conversion took 1 microsecond...

                      The idea of temporal sampling is to measure the pulse width, not sampling any voltages.
                      I'm not familiar with the PIC16F1824, but a little hunting says the max ADC clock is 4MHz, so 1 TAD is 250ns. TACQ is 8 clock cycles, so one A/D measurement (according to boilcoil's equation) would be 11.5 x 250ns + 2μs = about 5μS. Still a lot faster than mine. I'm using an ESP32. I need to dig further.

                      Temporal sampling for the pulse width, I don't need as it's set in code using delayMicroseconds() which I hope is accurate.

                      Comment


                      • #12
                        ..there are many ways to measure pulse width ... the Lammerby graph in post #1 is for frying pans and horseshoe sized targets .. you will never see that response for coke cans at 1 meter from the coil.

                        The proposed circuit is similiar to snubber circuits used to control or limit the peak flyback voltage. -- it wont work for your stated desire.
                        The peak flyback will change as targets / ground change the inductance of the coil ...


                        A simple voltage divider / currrent sensor is all that is required. ( see pics below )
                        Scale the voltage/ current first then process it.
                        To measure change in pulse width ... you just clamp pulse to a known voltage then integrate it ..... a change in voltage on the integrator will indicate a change in pulse width and will be way more less sensitive to noise ( phase noise ) than trying to measure the width of each pulse on the fly.

                        Click image for larger version

Name:	image.png
Views:	80
Size:	6.4 KB
ID:	436961Click image for larger version

Name:	image.png
Views:	80
Size:	21.6 KB
ID:	436962​​​
                        Attached Files

                        Comment


                        • #13
                          I think of something else:
                          Let's take two identical samples using the classic way for PI metal detectors, but with a very small delay (immediately after the saturation time of the op-amp). Let one sample be energized with a sufficiently long pulse and the other with a very short pulse.
                          If we take into account the difference in these two samples, will it not be smaller for ferro targets (they should be energized faster because of their high magnetic permeability), and greater for the other targets?

                          Comment


                          • #14
                            Originally posted by boilcoil View Post
                            I think of something else:
                            Let's take two identical samples using the classic way for PI metal detectors, but with a very small delay (immediately after the saturation time of the op-amp). Let one sample be energized with a sufficiently long pulse and the other with a very short pulse.
                            If we take into account the difference in these two samples, will it not be smaller for ferro targets (they should be energized faster because of their high magnetic permeability), and greater for the other targets?
                            That will work ... similiar to minelab patent US5576624 ??

                            Where longer and shorter transmit pulses are used.

                            Click image for larger version

Name:	image.png
Views:	99
Size:	171.8 KB
ID:	436965

                            Comment


                            • #15
                              ... I was not suggesting that measuring the flyback pulse width in the manner described would lead to a worthwhile improvement in discrimination or anything else for that matter. I was only trying to help the OP with a method to do it. In practice there are alot of error signals that will mess up this type of measurement.
                              1. changing amplitude of the flyaback due to inductance changes in the coil due to ground, ferrous.
                              2. same again due to losses in the ground, targets etc.
                              3. Phase changes ( this is a major problem ).... eg mains hum and EMI which is allover the place due to earth currents will cause "jitter" in the pulse width much greater than small targets will.
                              4. Even Earth Field will modulate this measurement.
                              5. Internal noise from the detector itself and thermal drift ( voltage regulators are particularly prone to this ).
                              6. Noise from the damping resistor.
                              7. Random / non random EMI.

                              ... the list goes on.

                              Comment

                              Working...
                              X