Announcement

Collapse
No announcement yet.

Cow PI

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

  • Cow PI

    I wanted to make a PI detector for the beach (though my modified TGSL can be used there now);

    http://www.geotech1.com/forums/showt...-Quad-Sampling

    I have a Hammerhead I board half built up so will using that for initial development. I searched around checking out various PIC's and software's to use on this project and came up with this;

    I don't know C and it will take a long time to learn so assembler or Basic would be better. I found the Great Cow Basic compiler;

    http://gcbasic.sourceforge.net/index.html

    It will allow faster development and outputs assembler with Basic commands and comments in it so you could then optimize the assembly or work totally in assembler once the framework is written.

    Thus the name "Cow PI".

    I will use the 18F4550 as it's newer and has lots of features. Carl had already designed a board. See the attachment for Carl's schematic and and ExpressSCH schematic I drew with some mods. We won't be using USB yet as the software is difficult unless your using C.

    No display on this one either as it adds complexity and cost and uses more battery.

    I envision a couple of push buttons and some LED's to set it up. I need to figure out what a typical PI timing might be for shallow/deep and small large targets.

    One mode might be a button and a pot. Press the button and adjust the pot and the PIC will widen the sample pulses and move them apart to set the working pulse pattern.

    Another might continuously vary the pulses from shallow to deep then stop when a target is found.

    Later we might add wide and narrow pulses like the big guys use or other fun things.

    Most of these projects die quickly or progress to high end hardware and go commercial.
    I hope to keep this one as a hobby detector and just use it for my own personal use.

    I will be using Microchip's MPLAB IDE and the Great Cow Basic. I have a IDC3 programmer and can program the PIC in circuit (most PIC programmers can do the same). The 40 pin 18F4550 might be easier to work with but these schematics are based on the 44 pin TQFP as I obtained a board already designed for this. The programming pins attach differently on the 40 pin (see 40 pin version). You can use the same pins on the 44 pin but the alternate ones free up some pins for circuit use...

    I could use some input on typical timing for a beach PI for small/shallow and large/deep targets and any other suggestions for capabilities or implementation help.

    I'll be back in my lab in a few days to start working on the hardware.
    Attached Files

  • #2
    According to the Hammerhead article we should shoot for the following specs;

    TX rep rate 900hz to2300hz
    TX width 10us to 75us
    TX to first sample 10us to 75us
    First sample to Second sample 75us to 350us This one seems a bit funny...
    RX pule widths (both same) 3us to 50 us

    On another project I found them using port B for the pulses. You can have up to 8;

    0 - MOSFET control
    1 - MOSFET 2
    2 - Ch1 - 1
    3 - Ch1 - 2
    4 - Ch2 - 1
    5 - Ch2 - 2
    6 - Gnd Ch1
    7 - Gnd Ch2

    I'd like to have a button and some LED's for mode select, and a button and pot for data entry and
    possibly a bargraph like display to show relative value being input and finally a save button.

    We need to figure out what resources we need on the PIC before starting the code.

    I need to study some more to figure out how to make the pulses. There are some PWM's
    available and some timers. We could trigger the TX off a PWM and then generate the pulses
    in reference to that. We might use a timer and a PWM to generate them too...

    Comment


    • #3
      Originally posted by Silver Dollar View Post
      First sample to Second sample 75us to 350us This one seems a bit funny...
      The second sample is sometimes referred to as a "late sample". The idea here is that the majority of the target response will have died away by the time the second sample is taken (e.g. at 200us), so any signal detected here will be due to an external source such as movement of the coil through the Earth's magnetic field. By subtracting this signal from the first sample, the Earth Field Effect (EFE) can be eliminated. Without this second sample, there will be an audio response at the end of each sweep of the coil.

      Comment


      • #4
        Well still looking for info. I found another source that gave some typical timings;

        TX rep rate 100hz to 1000hz
        TX width 50us to 150us
        TX to first sample 10us to 100us
        RX pule widths (both same) 15us to 50 us
        First sample to Second sample 200us + - Set to as close to new TX pulse as possible

        I'm still trying to figure out how the fancy multiple pulse timing could be used.

        I thought we might be able to use the ADC and take one sample at each RX and see if we
        can find any metal. There is the other method and just measure from TX start to a specified
        comparitor level, different metals will give different times.

        I found a cheap LCD so might look into adding that to this project;

        http://www.ebay.com/itm/Serial-UART-...:X:RTQ:US:1123

        Comment


        • #5
          Look for autozero amplifiers and you'll get some ideas. Trouble with small signal in baseband is that it is prone to various offsets, including 1/f noise. Late sample provides the autozero function for just about any influence, be it earth field, op amp drift or 1/f noise.
          VLF could benefit from some chopper configuration as well, as the most of the chatters are in fact 1/f noise.

          Comment


          • #6
            Well I find there is still some disagreement over whether varying the TX on time is useful or not.
            I am unsure whether to vary the TX pulse and snub the flyback or try for the highest voltage at
            flyback.

            Also the TX rep rate is a question as higher rates cancel noise better but slower rates illuminate
            targets better.

            Using the PIC processor will allow for experimenting and having a multitude of programs but I want to
            decide on the rest of the circuit and which possible inputs I need to reserve so I don't need to be
            rebuilding it over and over again.

            The goal is to work good on the beach and favor gold if possible. I don't need to find pinpoint size
            gold dust but earings, bracelets, necklaces and rings would be nice.

            People talk of the tau of different targets and TC but I haven't seen a list of different gold objects.
            Anybody have some numbers for these?

            Comment


            • #7
              earings, bracelets, necklaces and rings would be nice.
              They would be nice
              I have some PI timings I think they are from Carl
              F=1Khz
              Tx pulse width 100us
              duty factor 10%
              1st delay 15us
              1st sample width 45us
              sample inter delay 200us
              2nd sample 45us
              8 or 10 inch coil

              Comment


              • #8
                Thanks for the info! I did my own investigations and came up with this;

                TC for different targets ---------Max response is TC x5 but we can use 1/2 that and we want 1TC between 1st and 2nd samples

                Nickel + Small gold 20 us -------------- x5 100 us --------------------------- 1/2 50 us --------------------------------20 us
                New Penny ---------35 us -------------- x5 175 us --------------------------- 1/2 86 us --------------------------------35 us
                Gold Ring -----------50 us -------------- x5 250 us --------------------------- 1/2 125 us -------------------------------50 us
                Dime -----------------55 us -------------- x5 275 us -------------------------- 1/2 137 us --------------------------------55 us
                Old Penny ----------70 us --------------- x5 350 us ---------------------------1/2 250 us -------------------------------70 us
                Silver Dollar -------200 us ------------- x5 1000 us -------------------------- 1/2 500 us ------------------------------200 us
                Silver Cob ---------500 us ------------- x5 2500 us -------------------------- 1/2 1250 us -----------------------------500 us

                To narrow down to 4 ranges we could use

                TXwidth - 1st to 2nd

                50 - 20
                150 - 60
                300 - 150
                600 - 225

                To play with the numbers a bit we could say 1st to 2nd = 1/2 TXwidth

                40 - 20
                80 - 40
                160 - 80
                320 - 160
                640 - 320

                Comment


                • #9
                  The plan is to have a waterproof version with minimal controls and a full feature one with all the bells and whistles.
                  I'll call them Mini Cow PI and Maxi Cow PI or Mini and Maxi for short.

                  The difference would be some pots and switches. On the Mini these could be attached for programming and detached for use.
                  On the Maxi these would be permanently attached.

                  I thought of using 3 jumpers on the PIC 18F4550 board to control tuning.

                  1. Coil Min Delay
                  2. Tune
                  3. Write to EEROM enable

                  You would attach all jumpers to make changes.

                  The front panel (or temp panel) would have Prog 1, Prog 2 switches TXWidth and 1st to 2nd Delay pots and a Write enable switch.
                  (Hmm prog 1 = 2 switches would need to be permanent on mini).

                  Comment


                  • #10
                    Here's some initial code. It init's the ports and optionally writes 4 banks of prog data to EEROM.
                    It continuously loops reading the 2 prog switches and loads program data for the equivalent bank.
                    The wait x us command will wait for x microseconds so the program values are just the required
                    microseconds. I need to solder the chip on my board in order to run this code and see how close
                    we are on timing.

                    We still need code to use the pots and do tuning and light the LED's but it's a start!
                    Attached Files

                    Comment


                    • #11
                      Here's the program a little more fleshed out. It allows for if the jumpers are set on the
                      board you can reprogram the min delay for all 4 programs and also set TXWidth and the
                      1stTo2nd delay for each one.
                      Attached Files

                      Comment


                      • #12
                        Here's an updated code file. Fixed some coding errors and added padding to make pulsetrains
                        add up to some standard values. I'm not sure about leaving the calibration/delay reprogramming
                        in the code. Without a display they might be like working in the dark.

                        I'm having trouble finding an oscillator. It's a bit confusing on the PIC's on how to choose one.
                        I'd like to run at 48 mhz for possible future mods but most 48 mhz moduals seem to be 3.3V.

                        I found a 10 or 20 mhz oscillator in my junk pile (the label is missing) but I'm not sure how to
                        set the config bits to get it to work...
                        Attached Files

                        Comment


                        • #13
                          I removed the calibration code for now. I think I figured out the OSC settings. You can use a 4 mhz oscillator
                          and run the CPU and USB on 48 mhz through some magic in the chip!

                          We now have 4 modes;

                          1. Low Range - 50 us TX
                          2. High Range - 150 us TX
                          3. Minelab Mode - 250 us TX then 3 - 50 us TX and repeat
                          4. Multi mode - Cycle through 3 ranges 250 us, 150 us, 50 us

                          It compiles OK but not sure if it runs correctly. I included the ASM output.
                          There is a way to get more info in the ASM output but I still have to figure that out.

                          I can solder a board up today as the 4 mhz oscillator I got with it will work. It might be
                          tricky to add the programming pins to it without a microscope but we'll give it a go...
                          Attached Files

                          Comment


                          • #14
                            Well I got the comments in the ASM file to work and also discovered the PulseOut command.

                            I'm looking for a simulator to check the code before I download it. The Microcode IDE has one but
                            I'm not sure you can see a pin output in oscope format. I'd like to check the timing on the pulses.

                            I need to add a programming port to the board I have and wire up a different regulator. I worked
                            out all the wiring yesterday so need to fire the soldering iron up today. Though I just put a turkey
                            in the oven so it might have to wait until Christmas is over...

                            I found a cheap audio codec PCB ($20) ; http://www.mikroe.com/add-on-boards/...o-codec-proto/

                            It might allow you to sample the input directly though this PIC might not have enough horsepower...

                            Attached Files

                            Comment


                            • #15
                              Well I got the MPLAB IDE simulator running and found my IF statements for reading the program select
                              switches doesn't work. I also looked at the EEROM code and decided it is very slow so I will put the data
                              in an array to speed things up a bit. The simulation I ran showed just 1us of overhead for the pulse timing.
                              It will be easy to fudge in a -1us from each time period and we should be pretty accurate...

                              Comment

                              Working...
                              X