Announcement

Collapse
No announcement yet.

Arduino based VDI!

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

  • #91
    http://www.banggood.com/IIC-Or-I2C-O...o-p-88316.html

    is this lcd dicplay ok for use with the vdi project
    without changing tons of code
    i takes only 2 wire for signal transfer from arduino to lcd
    easier to solder or used with a simple pin connector

    Comment


    • #92
      Yes bernte this should be ideal for this project...i'm waiting for a similar display...like daren's one.

      I find two of these for opamp: TS921.
      this is single opamp so i have to use two of them.

      I think that has very nice specifics...for example low noise and rail to rail output. What do you think?

      LM358 is not so good as specifics...probably better TL072. Your opinions?

      Comment


      • #93
        yeah that's what I used. my I2C address was 0x27 I think this one is 0x20 so the device address in the code will have to be updated.

        On another note: I received MCP602 and replaced LM358; To get the circuit to work correctly I had to remove 0.22u caps and change 1M to 47k. After looking at the signal I also realized that it is not symmetrical to the offset voltage does not have to be 2.5V. It can be 1V, so there is 4V upper range. For the opamp "+ input" ref voltage divider I put a 10k + 10K trimmer and adjusted to 1V.
        Software was also updated to allow for ADC calibration of the MAX input. This allows detection of the saturated opamp and flagging it on the VDI as invalid reading. To calibrate you will have generate a big signal while calibrating. I'll post the code later on...
        With 602 and the lower amplification the noise is lower too..

        Comment


        • #94
          Daren:

          On another note: I received MCP602 and replaced LM358; To get the circuit to work correctly I had to remove 0.22u caps and change 1M to 47k.
          So you now are using an inverting buffer without amplification?

          But if you connect VDI opamps "before" U104 and U105, you could use your original preamp scheme:

          http://www.geotech1.com/forums/attac...4&d=1405109615

          ...since it should give a gain like U104 and U105 do... I'm wrong?

          And since those are all inverting opamps, picking signal after one gain block should be different of picking it after two...

          Let me explain better:

          Considering disc channel:

          U103B pin 1 signal rising : _/
          U104 pin 6 signal falling : \_
          Your VDI preamp output, signal rising: _/ (to be readed from arduino)

          Else if I put VDI preamp after U103B pin 1

          U103B pin 1 signal rising : _/
          VDI preamp output, signal falling : \_ (to be readed from arduino)

          ...My toughts are only on the convenience to work with a more clean signal, picking it before a gain block (U104 and U105), to have less noise.

          What do you think?

          Comment


          • #95
            Originally posted by manny77 View Post
            Daren:



            So you now are using an inverting buffer without amplification?

            But if you connect VDI opamps "before" U104 and U105, you could use your original preamp scheme:

            http://www.geotech1.com/forums/attac...4&d=1405109615

            ...since it should give a gain like U104 and U105 do... I'm wrong?

            And since those are all inverting opamps, picking signal after one gain block should be different of picking it after two...

            Let me explain better:

            Considering disc channel:

            U103B pin 1 signal rising : _/
            U104 pin 6 signal falling : \_
            Your VDI preamp output, signal rising: _/ (to be readed from arduino)

            Else if I put VDI preamp after U103B pin 1

            U103B pin 1 signal rising : _/
            VDI preamp output, signal falling : \_ (to be readed from arduino)

            ...My toughts are only on the convenience to work with a more clean signal, picking it before a gain block (U104 and U105), to have less noise.

            What do you think?
            manny77: the angle is calculated as a ratio of the X/R. If you flip signs of both signals it will cancel itself out.

            Comment


            • #96
              Yeah you are right Daren! Hehe!

              Comment


              • #97
                Hi Daren,
                Are you satisfied with your new modification and progress with Vdi?
                I'm curious of the use of it in real soil too. Maybe Don could share his experience with the Vdi he made, finished and mounted on the MD. I hope it is a very useful addiction that work good and stable giving nice indications.

                Probably tomorrow i'll get my display + i2c board...so i should have eveything to start the build of my arduino vdi.

                I hope to not ask too much Daren, could your share your latest software version so we can made directly the project with your new mods? I'gonna make it directly on a matrix board...

                Thanks!

                Comment


                • #98
                  Finally now i've Display and I2C!

                  Already mounted on a matrix board, with LM7805 to power arduino, LCD and opamps (not yet mounted).
                  Connected Pushbutton (i've not encoder with pushbutton...used one apart), buzzer, encoder, voltage divider for battery check.

                  Everything is ok...wow! Great SW you made Daren! Very nice and complex!

                  I changed multiplier of battery check...now precise as a multimeter! Changed tipical values in % to suit to my lead-gel 12V accu. (and resistor tolerance).

                  Find a little mistake on your scheme:



                  3, 4 and 5 indicated as encoder pin A, B, Button are not correct.

                  Accordingly to your SW they are pin 2, 3, 4:

                  Code:
                  #define PIN_ENC1 2   //Arduino 2 -> encoder pin A
                  #define PIN_ENC2 3   //Arduino 3 -> encoder pin B
                  #define PIN_EBTN 4   //Arduino 4 -> encoder button pin 0
                  Another error was in a damn image i used to understand which pin to use on arduino NANO for SDA and SCL...

                  THIS PICTURE IS WRONG:
                  http://www.keywild.com/arduino/gallery/Nano_PinOut.png

                  SDA is NOT D04 and SCL is NOT D05!

                  Wasted time to figure out the problem...

                  THIS PIC IS CORRECT:



                  SDA pin A4
                  SCL pin A5

                  Soon I build operational circuit...if it works i'll enclose everything in a nice box...

                  Please Daren tell me if you made some changes in HW and SW because i really want to come out the best possible from this VDI...
                  I have high expectations...hehe!

                  Comment


                  • #99
                    I'm really grateful to all good people as Daren, Don and many others that share their knowledge in this great forum!
                    Attached Files

                    Comment


                    • manny77: congrats on getting it to work; the credit goes to Don, all contributors to thread "Discrimination + VDI Theory" and others here that described the concepts and built previous implementations. I'm just trying to learn more about the metal detector concepts... I can write software but my hardware knowledge is very limited.
                      Here is the version that I use currently. Make sure that you calibrate the MAX ADC signal. VDI will flag the saturated samples after you do.
                      The strength was redefined to simulate "distance". It is basically square root of proper strength.
                      float strength = sqrt(float(Xstrength)*float(Xstrength) + float(Rstrength) * float(Rstrength));
                      float distance = sqrt(strength);
                      m_lcd->print(int(distance+0.5F));
                      I find it more useful.
                      I did some field testing, but not enough to get a feel for it. There is a lot of params to tweak, and I'm not really sure how they affect the readings in the field.
                      MD_V6.zip
                      Click image for larger version

Name:	IMG_1952 (Small).JPG
Views:	2
Size:	119.9 KB
ID:	341336

                      Here is an idea for sound: Keep the TGSL's analog sound, but mix in the digital sound from the Arduino.

                      Comment


                      • Thank you daren! It works on the bench!
                        Lot of params...really like to have a manual to understand every menu setting....

                        I try and learn but some setting was not so clear...

                        What you get when calibrate max signal? Me about 330...what do you use for it? Ferrite...iron..coin...aluminium?

                        Very responsive beeps now respect first version! I'd like to have a menu voice to active or turn off speaker....

                        My problems are big drain of battery using 7805 external of arduino. I dont know if internal is better...7 volt drop from 12 are a lot... 7805 turn very warm....

                        Other problem is ferrite...it should not give vdi but really it does... A problem in real soil?

                        Seems that sensitivity of vdi and buzzer is more than tgsl itself! It should be used in normal operation to find targets? With right settings now is very fast and responsive!

                        Great work mate!
                        Anyway i hope this thing will be a useful addiction not only a nice thing to see...

                        Comment


                        • "Min signal" - min ADC value for X and R avoce the calibrated ADC "zero" to be considered a valid signal
                          "Calib ADC zero" - "zero" ADC; calibrate no target in the field of coil
                          "Calib ADC max" - ADC value when opamp maxes out; calibrate with waving big target close to coil; metal type does not matter
                          "Sig end count" - number of consecutive samples with the value below "min signal" that flags "end of signal"
                          "Min sample cnt" - min number of samples to be considered a valid reading
                          "Max sample cnt" - max number of samples to be collected before returning a reading
                          "Filter type" - sample filtering; either average or mean
                          "Filter size" - filter size; bigger values smooth the signals more; too big values remove small; short signals
                          "Oversampling" - number of samples X, R interleaved to be used to created single X and R "master" sample; 1 to 10 are useful values

                          with oversample at set to 5 each sample takes about 1 millisecond; so sample counts ("master" sample count) can be thought of as a ms; passing target in the front of the coil takes 300-900ms (very roughly); so if you setup "Max sample count" at 1000 you should be able to catch the whole target signal; It may not be the best; smaller max counts could be better;
                          single ADC conversion takes about 120us (ballpark); so with oversampling at 5 you will get total on 10 samples (5x2 because of X,R) that's ~ 1.2ms

                          manny77; you should get more like 900 for the ADC "max"; 300 means that max opamp output level is low.. (do you have scope?)
                          ferrite jumps from -80 to 80; its like the angle wraps around; it could be -80, -90 or 90, 80.. I don't know what to make of it.. its not a deal breaker
                          You could use VDI's sound; if you optimize amp for the low signals (crank up amplification) you could probably have slightly better sensitivity than original TGSL
                          ; Because you can control "min sample count" you will screen out a lot of small noise spikes even if you lower the "min signal value"
                          I boxed the arduino VDI; I try to do more field testing but I don't plan on putting more time into it; The code could use refactoring; it really was a "quick and dirty"
                          You can easily add voice menu; use "oversampling" value as a template; add something like "int m_voiceOn;" 1 - will be voice on... If you'll have problems I can add it in...

                          Comment


                          • Thank you for the manual Daren! Very well accepted!

                            Oversample is the only thing not very clear...despite that your description is detailed...sorry...

                            Probably I get 330 in max adc because the mod I made on the feedback of U104 and U105, suggested by Silver Dollar here:

                            http://www.geotech1.com/forums/showthread.php?21579-TGSL-EDU-Mod


                            Perhaps the amplification is lower...anyway I add some more gain in vdi preamp, raising feedback resistors, using trimmers to adjust amplification.
                            Now I get about 900 as you... I think that now works even better!

                            Because you can control "min sample count" you will screen out a lot of small noise spikes even if you lower the "min signal value"
                            Yes this is a very valuable setting! I'm finishing the boxing of the board...it's very rainy here in Italy...summer is still not arrived... i wanna try it on the field!

                            You can easily add voice menu; use "oversampling" value as a template; add something like "int m_voiceOn;" 1 - will be voice on... If you'll have problems I can add it in...
                            I'll try Daren...may I count on you otherwise? Thanks!

                            Comment


                            • Originally posted by manny77 View Post
                              Oversample is the only thing not very clear...despite that your description is detailed...sorry...
                              let's say oversample is 2 then the algorithm will:
                              x =0; r =0;
                              x = x + sample ADC channel X
                              r = r + sample ADC channel R
                              x = x + sample ADC channel X
                              r = r + sample ADC channel R
                              x = x/2
                              r = r/2
                              Then we proceed to use x, r as they were simple ADC samples; The idea is to sample signal multiple times thus improving ADC accuracy;
                              I don't think it really adds a lot, but the we would have to use sleep to slow down the sampling. We may as well do something possibly useful; One possible test to find out if its useful is ti set oversampling to 1 and watch "raw signal" note the sigma; then bump oversampling to 10 and repeat; if oversampling makes diff, then sigma should be smaller.

                              I'll probably post a new version at some point; I'll add the sound then..
                              We can add a little scope to the display with the res of 16x80 pixels, and display plots of X,R ADC values; This could be useful to make sure that opamp is setup correctly

                              Comment


                              • Thanks now I understand better. Probably al these settings could make this vdi better than factory made ones, with fixed parameters etc. It is really a good sw...hope in low enough s/n from my tgsl now.

                                I'll probably post a new version at some point; I'll add the sound then..
                                We can add a little scope to the display with the res of 16x80 pixels, and display plots of X,R ADC values; This could be useful to make sure that opamp is setup correctly
                                ...this should be a very very nice addition...hope you'll make it some day...hehe! Great programming skills you have!

                                Comment

                                Working...
                                X