Announcement

Collapse
No announcement yet.

Please review: "improved" Mark Stuart's PI detector

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

  • Please review: "improved" Mark Stuart's PI detector

    Hi,

    I've been thinkin of building my own metal detector for a little while now. After browsing through a whole bunch of different designs, I decided to start with Mark Stuart's PI detector.

    http://www.geotech1.com/cgi-bin/pages/common/index.pl?page=metdet&file=/projects/stuart2/index.dat

    However, I don't have tools to work with old PIC's, neither do I really care much about assembler programming , so I decided to give a try and modify his circuit to better suit my needs, and while being there also try to improve it a bit.
    The basic principles of the circuit are still exactly the same. However, I've tried reducing the component count with some modifications;
    -Instead of a charge pump IC, use PWMoutput of the micro to generate the +12V (from 9V input)
    -Use ADC to sample the final output voltage, and use another PWM channel for creating the output to headphones.
    -Mayby add buttons & potentiometers for fine adjusting the timings on the field, or setting zero points.

    What do you think, would the circuit still perform equally with these modifications? Also, since analogue design isn't really my area of expertise, would there be better choises for the main amplifying opamp, than the LM318?

    After finishing the schematic, I'll then design a proper SMT pcb, to be fit into as small space as possible.
    Attached Files

  • #2
    Some quick observations:

    - 9v to VCC pin is going to fry your Atmega chip

    - Max voltage read via ADC pin is 0-5v

    - Are you going to do a direct port? if so, 4mhz crystal is unnecessary. AVR architecture is 4X faster than PIC, so you can get away with an internal 1MHZ reference. Otherwise your timings are going to be out of whack

    -

    Comment


    • #3
      Hi,

      As the circuit works with a low side FET for the coil, all the measurements are referenced to 9V.. Hence I also decided to put the microcontroller on the high side. There is the 79L05 for providing the negative voltage to the AVR.

      I decided to keep the xtal in place, for precise timing and increased resolution (1 instruction per clock cycle on AVR)in timing generation. Don't know if high precision / resolution is necessitaded here, but it doesn't cost much extra, and I don't feel good about using the internal RC clock for this kind of use.

      I also did some research regarding the opamp. I think it will be fine as it is, with the input offset compensated anyway with the trimpot.

      I'll let you know how the board & the machine turns out.

      Comment


      • #4
        Hi
        is this bit proven to work ?
        if so thanks
        Attached Files

        Comment


        • #5
          You might also eliminate that transistor if you use a logic level fet like STP40NF10L for switching. The Mega shouldn't have any issues driving it.

          ...You're going to need one with very low capacitance numbers though.

          Comment


          • #6
            6666,

            I haven't tried it before. I see no reason, why it would not work.. But come to think about it, it's not very power efficient. As to keep the FET off, constant current needs to be fed through T1, and with those component values it equates to 9mA.. I think I'll be better off replaceing T1 with a small N-channel FET. Thanks for bringing that one up.

            Mario,

            I don't know if using a logic level fet would help much.. The AVR is still on the high side, it would need some sort of level switching, and I'm not sure if the 20mA available from an I/O will be enought to turn it off fast enough.

            Comment


            • #7
              Originally posted by Janne View Post
              6666,

              I haven't tried it before. I see no reason, why it would not work.. But come to think about it, it's not very power efficient. As to keep the FET off, constant current needs to be fed through T1, and with those component values it equates to 9mA.. I think I'll be better off replaceing T1 with a small N-channel FET. Thanks for bringing that one up.

              Mario,

              I don't know if using a logic level fet would help much.. The AVR is still on the high side, it would need some sort of level switching, and I'm not sure if the 20mA available from an I/O will be enought to turn it off fast enough.
              ..hmh..all the megas can drive at least 40mA, which should be more than enough to saturate those gates. Having said that, if it ain't broke, why fix it, no? And the beuty of the original design is that you have a larger selection of fets with different specifications to experiment. It seems like the logic level fets are more limited in selection and more expensive.

              You definitely want a flexible design if you ever want to play with different configurations.

              good luck and do let us know once you get your board working. It looks like a project worth pursuing.

              Comment


              • #8
                I think I'll be better off replaceing T1 with a small N-channel FET.
                Please keep us informed as to the cct
                thanks

                Comment


                • #9
                  Hi,

                  I've finished the RevB of the schematic and laying out the board. Going to order the boards tomorrow, hopefully I found all the mistakes built into it .

                  I changed the transistors to fets, fixed some small problems, like filter capacitors going to VSS instead of common 9V, and also added a voltage divider from supply voltage. This might be usable for low battery warning, and also for compensating the decreasing battery voltage. By keeping the FET gate open longer, constant search coil current can be maintained with decreasing battery. Don't know if it's useful or not, but including it to the pcb is free =)

                  The PCB together with all the controls, plus the 6x AA battery holder should all just fit into this box from hammond; http://www.hammondmfg.com/dwg2c.htm 1591C

                  Can anyone comment on the licensing part.. Is it possible to release this as an open source hardware project? As it uses another design (with unspecified licensing) as it's inspiration and starting point for the schematic..
                  Attached Files

                  Comment


                  • #10
                    If its different and modern design why not release it for education purposes ?

                    Comment


                    • #11
                      Proto boards from ITead arrived today, 10 boards for 50$ delivered. I hope the capacitor pump arrangement I have will provide enough juice for the amplifiers and switches.. From the fear of it I actually routed the one remaining PWM pin to a second cap pump array, to make a 2-phase capacitor pump Should be fun I think.




                      Comment


                      • #12
                        Looks nice

                        Comment


                        • #13
                          Haven't had much time lately to muck around with this metal detector project, but I managed to populate the PCB and write some test code. It seems using the 2x pwm pins to drive the charge pump was a good idea, they bump the voltage up about 3.5V, should be plentiful.

                          It might have had been a good idea to incorporate more filtering (LC or mayby RC) into the 12V line, as of now I'm getting about 30mV of ripple in the 12V supply. It seems to show as 40mV spikes on the output of my opamp, with 2M feedback resistor.. Mayby I'll need to go down a bit with the gain, 2000x gain might be pushing it. But before I do that I'll try suspending the charge pump for the time of coil sampling, to prevent any spikes from messing up with the measurements.

                          Another problem I noticed, is that using P and N-fets for level shifting the control signal causes quite a bit of delay.. about 70µs, with the 220k pull down resistors. I may need to re-think that part too, but for now I think I'll try and compensate for that in software. One problem with that approach is, that the delay certainly will drift with the changing battery voltage, so the battery voltage will need to be compensated as well. It might be a good idea to include an LDO regulator on the next design, to avoid problems with dimishing battery voltages.

                          Next I think I'm going to need a test coil to see how well the dampening works, and to see if the thing will actually be able to measure any metal

                          Comment


                          • #14
                            Been a while since I've worked with this project, but today I had time to further program & test the board.

                            I did some tweaks to the hardware; switched the coil damping resistor from 1k to 2k, and fiddled with the driver circuits to decrease dead times.. Dead times are now down to about 2µs, so it's acceptable and possible to compensate on software.

                            Even with the 2k damper resistor, and coil voltage peaking at about 600V I'm not still able to sample as soon as I would like.. Sampling is now possible at about 30-35µs from the time the FET is closed. It takes 15µs for the signal to decay enough, to unsaturate the primary amplifier. Wonderf how you guys are able to squench the coil so fast?

                            Practical performance seems to be promising still. I've currently programmed it to average the measured signal for 400mS, and I'm able to reliably detect a 50c coin (€ type) from about 30-35cm away. By tweaking the sampling time & delay it might be possible to improve it slightly more.

                            Other things to try out include trying to increase the sampling rate for example. Currently, I'm turning off the charge pump during waveform sampling & A/D conversion, to reduce noise. The downside is, that I now need extra 2ms of delay between sampling cycles, to allow time for the charge pump to fill up the reservoir capacitor again. It might be better to opt for higher sample rate, and ditching the low-noise approach.

                            Current consumption is 50mA at the moment, so the AA batteries should last for a while with this setup.

                            Comment


                            • #15
                              Originally posted by Janne View Post
                              Been a while since I've worked with this project, but today I had time to further program & test the board.

                              I did some tweaks to the hardware; switched the coil damping resistor from 1k to 2k, and fiddled with the driver circuits to decrease dead times.. Dead times are now down to about 2µs, so it's acceptable and possible to compensate on software.

                              Even with the 2k damper resistor, and coil voltage peaking at about 600V I'm not still able to sample as soon as I would like.. Sampling is now possible at about 30-35µs from the time the FET is closed. It takes 15µs for the signal to decay enough, to unsaturate the primary amplifier. Wonderf how you guys are able to squench the coil so fast?

                              Practical performance seems to be promising still. I've currently programmed it to average the measured signal for 400mS, and I'm able to reliably detect a 50c coin (€ type) from about 30-35cm away. By tweaking the sampling time & delay it might be possible to improve it slightly more.

                              Other things to try out include trying to increase the sampling rate for example. Currently, I'm turning off the charge pump during waveform sampling & A/D conversion, to reduce noise. The downside is, that I now need extra 2ms of delay between sampling cycles, to allow time for the charge pump to fill up the reservoir capacitor again. It might be better to opt for higher sample rate, and ditching the low-noise approach.

                              Current consumption is 50mA at the moment, so the AA batteries should last for a while with this setup.
                              What is the inductance value of your coil?

                              Also, if I'm not mistaken, you have twisted the wire going to the coil (top of picture) which will increase the capacitance and slow down the receive signal.

                              Comment

                              Working...
                              X