Announcement

Collapse
No announcement yet.

VDI-RODERICO

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

  • good to know that works well, the pictures would help to have a better idea...

    Originally posted by waltr View Post
    Running everything from 3.3V works perfectly with no changes to the code.

    For a 10-bit ADC you have 3.3V/2^10 = 3mV of resolution vs 5V/2^10 = 5mV, however you can only have signals of 3.3V peak-to-peak after the MCP602, so you might need to adjust the gain or it would saturate very quickly. Signals of 5mV could be considered as noise (3mV in your case).


    Originally posted by waltr View Post
    Adjust the pot that is across the op-amps was not helping and was having a hard time understanding what the pot does.

    it is for calibrating the VDI values, if vdi values do not change when adjusting the pot then you need to change the pot, in your case it seems you don't need any.

    Originally posted by waltr View Post
    These large iron object did give varying VDI from 45 to -80 so just the VDI number was not enough to say to dig or not.

    This is something expected, since iron quickly saturates the mcp602, if one channel saturates then the vdi cannot be reliable because it is extracted from the amplitude ratios of both channels and one is always constant (e.g. Vdd), you can see it in the scope view or XY view (graph edges).

    The more stable the pic power supply is the better the ADC readings, since it uses Vdd and Vdd/2 as references. If Vdd or Vdd/2 fluctuates then ADC values fluctuates and so does the vdi. Using two linear regulators as in the IDX, i.e. +8V to the 78l05 instead of the battery should be more stable, it would be better to change it back or to improve the pic power supply e.g. using a zener diode for Vdd/2 or using external Vref+ and Vref-. PIC18F25K22 can also use an internal voltage reference of 1, 2 or 4V for the ADC.

    Comment


    • The gain seems fine and I can get a reasonably VDI on fairly weak signals. Strong signal may over load but easy enough to lift the coil a little to reduce signal level.

      I've used PICs for many years and with the 10-bit ADC running the ADC reference from Vdd works quit well. The 3.3V regulator powers the PIC the op-amps and the display. Maybe a separate reg for the ADC reference would give more consistent VDIs. Something to try.

      With the pot between the op-amp outputs the bottom channel, one off the pot wiper, was never large enough for good VDI. This was seen in the Scope graph. That is why I tried removing the pot connection and then the scope graph showed equal amplitude signals in All Metal Mode and good VDI numbers in Disc mode.

      Ok, off to get the camera batteries charged.

      Comment


      • I guess you have then 3K between the op-amp outputs when removing the pot, 3K+5K pot could be replaced by just one pot e.g. 10K or greater until the vdi values change and if it is between the op-amp inputs then you would have the same saturation levels for both channels, in any case it would be better when you have the pictures...

        Comment


        • Originally posted by waltr View Post
          Running everything from 3.3V works perfectly with no changes to the code.
          the code needs to be changed as Vref+ = 3.3V for the ADC, vdi values are not affected because Vref+ cancels out in the ratio, the adc offset and the battery can be adjusted in the menu, the only one that would be affected is the strength, you would have more accurate values replacing the #define VREF to 3 (no decimals). For a fixed internal Vref one only needs to change that define, ADCON1 = 0x08; and VREFCON0 to e.g. 2V, the voltage divider in the pcb should be changed to 1V instead of 3.3V/2 to center the ADC offset in the graphs.

          Comment


          • Even the ADC offset is still ~511 due to op-amps are run at 3.3V and non-inverting (op-amp ref) is half. No signal from TGSL = 3.3V/2 and since ADC ref = 3.3V values are the same.

            I used a different resistor divider ratio for the battery. A 38.2k/10k for a 4.82:1 and adjusted the Battery in the menu.

            I did not see the #define VREF in the code so I need to change it. Thanks.

            Comment


            • it would be good to check directly the effect of a noisy power supply, it might be of a few degrees depending on the noise. You can see how the ADC offset changes in the main menu, mine oscillates 1 or 2 values, i.e. 2*5V/2^10 = 10mV you need to add another 5mV for the Vdd change, i.e. 15mV and then scale by Vref, 5*15mV = 0.075V e.g. if X=2V and Y=1V then atan(1/2)=26.6, atan(1.075/2)=28.3, atan(1.075/1.925)=29.2, ...

              I recompiled the firmware removing the Vref scaling for the vdi and changed Vref+ for the ADC to the internal voltage reference of 4V that is independent of the power supply (the changes for the SD1305 are in the previous post). The other voltage reference is the ADC offset which is Voltage range/2 connected to + of the MCP602. This voltage needs also to be stable, e.g. with a lower noise regulator than the 78l05 or maybe just connecting the 78l05 to the voltage regulator of the main board (+8V for IDX) instead of the battery. With this firmware you will see a displacement of the origin in the vdi graphs since the ADC offset is not 512 = 2^10/2, to cure this you only need to change the voltage divider R7, R8 to 4V/2 = 2V, e.g. R7=150K and R8=100K for Vdd = 5V, and adjust the adc offset and levels in the menu, if the improvement is not significant then it is fine as it is.
              Attached Files

              Comment


              • Sounds like some good ideas. If memory is good the ADC offset values in the menu flicker by 3-5 counts. With your ideas this should be reduced.
                Since using Vdd for ADC Vref seems to work I never looked at the data sheet for use of the internal Vref. It does make the analog circuit a little more complex.

                It is too bad that the PIC's internal Vref can not also be brought out to a pin. Then it could have been used as the op-amp reference.
                A possibility is to enable the PIC's DAC running from the internal reference and setting to half scale then output to the op-amps. Now the ADC and Op-amps have the same Vref.
                Lots to experiment with.

                I ran at 3.3V due to the display being 3.3v. Then the PIC does not need level converters and the op-amps at 3.3V can not Over Voltage the PIC's ADC inputs.

                Comment


                • I guess you have up to 5 counts because your resolution is 3mV and then you would have up to 15mV due to the ADC offset. RA2 and RA3 pins can be used as external Vref- and Vref+ for the ADC, however it needs also some external circuit to provide these fixed voltages + the ADC offset to the op-amp, the external oscillator can be removed to have two additional digital inputs, but I think this is only if first it is proved that the improvement is significant because these changes are not backwards compatible...

                  Comment


                  • I run the PIC's internal oscillator and already freed those two pins.
                    Your source code is excellent and easily changed.

                    The 5 counts of flicker could be due to external 'noise'. I will make the changes to use internal Vref. If the count flicker does not reduce then I will attribute it to external source.
                    This would also need to be checked out in the field where I am away from AC Mains and other electrical noise. My shop can get very noisy due to the furnace and heater circulating pumps, etc running. When those are running the X-Y Graph shows a circle which is magnetic motor field from AC Mains.

                    Comment


                    • I think you also need to fix the ADC offset, maybe just replacing R7 and R8 with another resistor + 2-2.5V zener diode, mine doesn't disappear by using only the internal Vref.

                      Comment


                      • Ok, finally some photos.

                        Note the circle on the X-Y graph from the AC Mains.
                        Attached Files

                        Comment


                        • this looks pure noise to me maybe because you are using very long unshielded wires before and after the MCP602 (more EMI/RFI), could you also post a picture of the scope view for the last picture (the one with a big circle) to see if this comes from the long wires or from the coil? You might also increase the trigger level e.g. to 15mV or 20mV (losing some depth)

                          Comment


                          • Originally posted by roderico View Post
                            this looks pure noise to me maybe because you are using very long unshielded wires before and after the MCP602 (more EMI/RFI), could you also post a picture of the scope view for the last picture (the one with a big circle) to see if this comes from the long wires or from the coil? You might also increase the trigger level e.g. to 15mV or 20mV (losing some depth)

                            It is coming into the Coil not the wires. As I pointed out this is completely due to EM interference in my work shop when the furnace and circulating pumps are running.
                            I was simply pointing out that EM interference does exist and the need to ensure one does not try troubleshooting non-existant issues and the need to test away from AC Mains and EM interference. In my workshop when none of the heating equipment is running the detector output is quiet and the sensitivity as well as the X-Y plot is good.

                            Further, when first building the TGSL it was difficult to determine if the circuit had a issue or if it is EM interference. Many people on the forum building detectors have issues with low sensitivity and excessive noise due to EM in their workshops. The VDI X-Y display is very helpful to 'see' what might be going on. On the X-Y plot a Circle is AC MAINS interference. This makes the VDI graphic display more useful than simply helping ID a target in the field.

                            The photos I posted are only to show construction.

                            Comment


                            • This clarifies very well the issue but I would like to see if possible the scope view to understand better how the circle is generated I guess they would be random values. As there is no much improvement using the internal voltage reference the other option was to test a 2.5V voltage reference for the ADC offset (both would be better), I took an example from the LM336 (https://www.ti.com/lit/ds/symlink/lm336-2.5-n.pdf)
                              Attached Files

                              Comment


                              • Ok. I'll do a Scope View photo with the AC MAINS interference tonight.

                                I haven't gotten to reworking the code or hardware for internal Vref, etc yet. I would like to get the ADC offset flicker values measured from a quiet location first.
                                I plan to get out Sunday since prediction is 39F (4C) and sunny so will be a nice day. Saturday is predicted snow and rain.

                                Comment

                                Working...