Announcement

Collapse
No announcement yet.

Arduino based VDI!

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

  • Going deeper

    I spent last few weeks experimenting with TGLS and Arduino VDI. Here are the findings.

    Deriving VDI from TGLS X,R signals can be improved if we analyze the signals a little more.

    Here is the aluminum foil as seen by the Arduino.
    Click image for larger version

Name:	foil.jpg
Views:	1
Size:	119.2 KB
ID:	341507

    We can see that the angle is all over the place. I we select minimum signal strength then we may get lucky and fall in the right place.

    Here is the copper 1 cent US
    Click image for larger version

Name:	copper.jpg
Views:	1
Size:	143.5 KB
ID:	341506

    The angle is mostly around 80 but is does swing to -80.

    Silver ring
    Click image for larger version

Name:	silver.jpg
Views:	1
Size:	115.9 KB
ID:	341503

    Both of the signals have something in common; when R is positive then the angle is in the phase we want.

    So requirements to get correct angle are:
    - minimum signal level to distinguish the signal from the noise
    - positive R value

    This should get us into the right ballpark. At this point we can assume several approaches to get the better value of the angle. We could monitor the value of the signals X,R and return the angle when the signals are at their peak. (It should work fine, haven't tried). We could cluster angle values and get the biggest cluster (most common angle measured). I used this second approach, I liked it because we base the decision on the larger population of data points.

    There are number of additional tweaks that allow to control the behavior of algorithm; for example we could give more weight in the decision making to the readings that have stronger signal.
    Two last parms in the VDI menu allow to control the R polarity to use and the signal weight. (R polarity may have to be flopped if you take your signals 1 opamp earlier in the signal path than U104/U105)

    (if you going to use software make sure that you set "BPin" correctly; schematic calls for A2, its A3 in code)

    Sound support was added, you can enable/disable it in the menu. Sound does take a lot resources so if you don;t use turn it off.
    I had piezzo buzzer connected and it does not sound that good at all. Real speaker or phones would be better...

    I haven't tried the system in the field since I switched to this new algorithm, but it should be a definite improvement over the old method (laugh with me now...).

    Arduino program:
    MD_V11.zip

    Maybe I should start a new thread... Let me know... I'm not sure what is the proper board etiquette

    Comment


    • hello daren

      looks very good
      would you open a new thread where you can write all details form Arduino vdi with TGSL
      wiring diagram
      signal amplifier shematic (if neccessary)
      pcb layout if you made some extra pcb for this project

      many thanks for your time and work

      Comment


      • For an accurate VDI you need to calculate the arctangent of R/X, not simply take the ratio.
        I've done this in the past using a PIC. Take 25 samples and find the average, then do the arctan calculation. The result is a stable and reliable VDI.

        Comment


        • Originally posted by Qiaozhi View Post
          For an accurate VDI you need to calculate the arctangent of R/X, not simply take the ratio.
          Yeah, the code is using atan for calculating the VDI value. Each internal data point is a deg angle derived from the atan that is in turn derived from the ratio. (Code uses atan2, but its the same thing)
          The interesting part it how to get most information from the right part of the signal and discard the rest.
          The number of data points obtained from the target pulse can vary from 100 (faint signal) to more than a thousand(strong big X,R pulse) (with the target present I collect 3 data point pairs X,R for each millisecond). These data points are collected only when the signal is strong enough and the polarity is the one we want (the second condition is not critical but helps). If you plot angle distribution for collected samples you will realize that they are nicely clustered around one value. This is the value that algorithm returns.

          Comment


          • Bernte,
            makes sense, thanks.

            I'll test in the field and see how it goes.. When all looks good I'll create new thread with a more detailed instructions.
            daren

            Comment


            • Originally posted by Daren View Post
              Yeah, the code is using atan for calculating the VDI value. Each internal data point is a deg angle derived from the atan that is in turn derived from the ratio. (Code uses atan2, but its the same thing)
              OK, that's good. I did have a quick look at the code, but couldn't see the atan function. Also, I'm not familiar with the Arduino.

              Originally posted by Daren View Post
              The interesting part it how to get most information from the right part of the signal and discard the rest.
              The number of data points obtained from the target pulse can vary from 100 (faint signal) to more than a thousand(strong big X,R pulse) (with the target present I collect 3 data point pairs X,R for each millisecond). These data points are collected only when the signal is strong enough and the polarity is the one we want (the second condition is not critical but helps). If you plot angle distribution for collected samples you will realize that they are nicely clustered around one value. This is the value that algorithm returns.
              The way I solved this problem was to only read the X and Y channels if a target has been detected. i.e. when the audio is told to beep by the PIC. Previously I stated that I took 25 readings, but in fact it was 50. So the process is actually quite simple. Whenever the signal is above the threshold (audio oscillator enabled) take a reading from both the X and Y channels. After counting 50 readings for both the X and Y channels, take the average and calculate arctan(Y/X) and display result on the LCD. The VDI number is quite stable, and consistent with variations in depth. It also works for the full detection depth.

              Comment


              • Originally posted by Qiaozhi View Post
                The way I solved this problem was to only read the X and Y channels if a target has been detected. i.e. when the audio is told to beep by the PIC.
                Makes sense; in this implementation above functionality is simulated by watching signal strength. If the either signal exceeds "min sig value" then its OK to collect samples. It never occurred to me that signal that enables audio could be reused to "gate" the sampling. It is much simpler.. Oh, well.. Using "min sig value" does have some benefits, it allows for independent "sens" setting

                Comment


                • Originally posted by Daren View Post
                  I did some experiments with the sound too, there was not enough fluidity.. Yes you can beep while you display the phase and base your pitch on the phase number. But its not good enough. Original audio conveys more info; signal strength, breaking signal, immediate feedback, etc. Using digital audio all this is lost. You can do very nice digital audio, but at this moment I don't how. Low CPU clock and processing power restricts using more fancy stuff.
                  You need to express a lot of nuances in the sound to be useful and analog audio does it naturally.

                  The schematic is basically IDX - VDI front-end with Arduino in the back. Don't mix VCC and RAW on Arduino

                  [ATTACH]30564[/ATTACH]
                  Have you thought about adding another small processor just to perform the audio for example, a small PICAXE 08M for example....

                  Just a thought

                  Andy

                  Comment


                  • Originally posted by Daren View Post
                    I spent last few weeks experimenting with TGLS and Arduino VDI. Here are the findings.

                    Deriving VDI from TGLS X,R signals can be improved if we analyze the signals a little more.

                    Here is the aluminum foil as seen by the Arduino.
                    [ATTACH]30924[/ATTACH]

                    We can see that the angle is all over the place. I we select minimum signal strength then we may get lucky and fall in the right place.

                    Here is the copper 1 cent US
                    [ATTACH]30923[/ATTACH]

                    The angle is mostly around 80 but is does swing to -80.

                    Silver ring
                    [ATTACH]30920[/ATTACH]

                    Both of the signals have something in common; when R is positive then the angle is in the phase we want.

                    So requirements to get correct angle are:
                    - minimum signal level to distinguish the signal from the noise
                    - positive R value

                    This should get us into the right ballpark. At this point we can assume several approaches to get the better value of the angle. We could monitor the value of the signals X,R and return the angle when the signals are at their peak. (It should work fine, haven't tried). We could cluster angle values and get the biggest cluster (most common angle measured). I used this second approach, I liked it because we base the decision on the larger population of data points.

                    There are number of additional tweaks that allow to control the behavior of algorithm; for example we could give more weight in the decision making to the readings that have stronger signal.
                    Two last parms in the VDI menu allow to control the R polarity to use and the signal weight. (R polarity may have to be flopped if you take your signals 1 opamp earlier in the signal path than U104/U105)

                    (if you going to use software make sure that you set "BPin" correctly; schematic calls for A2, its A3 in code)

                    Sound support was added, you can enable/disable it in the menu. Sound does take a lot resources so if you don;t use turn it off.
                    I had piezzo buzzer connected and it does not sound that good at all. Real speaker or phones would be better...

                    I haven't tried the system in the field since I switched to this new algorithm, but it should be a definite improvement over the old method (laugh with me now...).

                    Arduino program:
                    [ATTACH]30922[/ATTACH]

                    Maybe I should start a new thread... Let me know... I'm not sure what is the proper board etiquette
                    Thank you very much Daren for this upgrade!

                    But it don't work well like previous version in my MD.

                    While detecting, sound buzzer work every time, but display not...very rarely it refresh accordingly to detected target, most of time it show zero. But every beep could be listen from arduino. I tweaked params but this can't be solved.

                    With your default params, calibrating to my ADC Max and Zero, buzzer is always on, sounding high note. Display VDI show zero. I have to raise min signal from 20 (default) to about 150 to mute it and sound only with detection.

                    My ADC MAX is about 950. What is yours? Maybe new algorithm need a lower input? (I can tweak amplification and offset with trimmers for the two channels).

                    Reading from battery voltage was very precise in previous version, now it show a decreasing value that stabilize around a wrong (higher) real value. I used my battery params in the SW, like in previous version.
                    Battery icon shows right despite internal battery voltage menu.

                    In this way software is unusable...maybe you have a clue of the problem?

                    Comment


                    • If you start the coversions from the tone trip - fine good science..


                      When to stop converting may be when the tone stops, or when the amplitude dips below the comparator level.


                      This may help? Rather than doing a set number of conversions.


                      Id guess commercial code would, during a hit above threshold, write x,r adc values to arrays.


                      You then have options for which data in the array to use, for simple machines with no gain control - ones who limit with large signals, maxed atod radings could be discarded in simple tests.

                      This would stilll give phase ID on large targets for example.

                      Comment


                      • Attached is a set of instruction of how to build TGSL Arduino VDI including the latest software. This algorithm is watching the X,R signals and after detecting the target it returns ID using the strongest sampled target signal; after trying multiple approaches this is the one that gives most stable results. It was also successfully field tested.

                        There are two params you can adjust but don't have to (min signal and sample averaging). After calibration (only one time after installing software) the VDI should "just work". VDI sound is OK but there is a lot of room for improvement.

                        New feature in this version is graph (yes; graph in the 16x2 LCD) of the signal strength. You will be able to judge object by looking at the graph. One or two nice humps ->small object (coin, ring, pull tab, etc) jagged graph -> foil, can; wide hump -> large object, etc...


                        Click image for larger version

Name:	IMG_2368 (Small).JPG
Views:	1
Size:	83.2 KB
ID:	341747

                        Here is video to some tests; (sorry for poor quality):
                        (I don't use VDI sound, so its turned off on the video)
                        http://youtu.be/q2BznUWwAzs


                        TGSL-Arduino-VDI.zip

                        Daren

                        Comment


                        • Hello,
                          i just see your project: it is wonderfull.
                          do you think i can do for garrett ace 250 ?
                          In case can you help me for it ?
                          regards
                          matteo

                          Comment


                          • I don't know, if it can be done. In any case it will require full reverse engineering of Ace 250. I don't think I can help

                            Comment


                            • Originally posted by Piovra1981 View Post
                              Hello,
                              i just see your project: it is wonderfull.
                              do you think i can do for garrett ace 250 ?
                              In case can you help me for it ?
                              regards
                              matteo
                              Hi Piovra1981!

                              I'm Italian too...

                              Garrett Ace 250 has already a VDI, it shows indicators on display based on internal numbers like Daren's one. Yes it has not graph but I saw it working not bad. My friend has one and he found many interest things! Working principle is the same. I don't think that this project will add something to your already good MD...

                              Anyway Daren Project is really wonderful! It works really really great even if I haven't yet tried in real soil.

                              This is my MD. Built entirely by me. From coil to circuits, boxes, cables, controls and everything else. Hard work from summer 2013 until now. Many many mods, test, experiment and finally this beautiful VDI project, working like a charm. I really like it!

                              Thanks to all Geotech user who contributed to make this project come true! Really kind and wise people here!

                              DIGI-Golden Sabre:

                              http://youtu.be/czV0hs6ikis

                              Comment


                              • Hello,
                                your self made metal is fantastic, is a PI MD ? ( geotech members are mervellous )
                                my ace 250 is a good MD ( i use it from 3 years ) i found a lot of think with it.
                                i know my Ace has VDI (12 segments ), but i like to add one VDI meter 0-99 segments.
                                hope someone can help me ! ( i know it is an hard experiment ).

                                Comment

                                Working...
                                X