Announcement

Collapse
No announcement yet.

VLF MD with digital signal processing : Bee-Buzz 1

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

  • Originally posted by Qiaozhi View Post

    Click image for larger version  Name:	fraser.gif Views:	0 Size:	172.5 KB ID:	433550
    I am no expert on coding, that much I can say without reservation. However I asked deepseek : "I would like you to write code in c++ for transmit signal based on patent US6653838"

    That's it.

    It came back with code, which generated a timing sequence as outlined in the patent ( a short and long period) such that "an average transmit coil energy at termination of the long periods is similar to that of an average transmit coil energy at termination of the short periods"

    It produced a waveform just as in fig.1 of the patent. It must have used physics knowlege which lay outside the scope of the patent to arrive at a proper timing sequence in order to satisfy the requirements outlined in the patent, which I thought was astounding, just in a few seconds.

    But now I see deepseek has been sabotaged or hacked.

    Comment


    • Originally posted by Aziz View Post
      it is obviously a C++ wrapper, which is based on opensl (dead!) and AAudio (new).
      Wrappers commonly make things more complex and hurting regularly the KISS-principle.

      I find that C++ wrappers can make coding far easier and easier to maintain. A good example is the STM Cube library, which begs to be written in C++. Until that's done, I'll use a C++ wrapper to make it easy to use.

      I hate wrapper coders too.
      I'm hurt.

      Originally posted by dbanner View Post
      If you'd like to use C++, here's a simple example of how you might structure the same firmware in C++:
      If that's what AI came up with for C++ I think I'll continue to write my own code. Also, if you use the CODE tag (# button on the editor toolbar) then code formatting isn't lost:
      Code:
      class MetalDetector {
      public:
        MetalDetector() {
          HAL_Init();
          SystemClock_Config();
          GPIO_Init();
          ADC_Init();
          DMA_Init();
          TIM_Init();
          LCD_Init();
          arm_fir_init_f32(&fir_instance, FILTER_ORDER, (float32_t*)fir_coeff, fir_state, BUFFER_SIZE);
        }
      
        void Run() {
          HAL_ADC_Start_DMA(&hadc, (uint32_t*)adc_buffer, BUFFER_SIZE);
          while (true) {
            if (HAL_ADC_PollForConversion(&hadc, 100) == HAL_OK) {
              ProcessSamples();
              UpdateDisplay();
            }
          }
        }
      ...
      ​

      Comment


      • Hi all,

        the headphone output of the G6 is really fine. No output amplifier is required at all. As we have 2 channel outputs (stereo), we won't waste one of them for driving the TX coil. A differential output using both channels will get more TX power.
        I have made a TX spice simulation with the specs of the sound card and it delivered at least +/- 1 A TX coil current (TX: L=300 uH, LR=1 Ohm). This is fully enough (even too much!). 150 V peak to peak TX coil voltage is there. No problem, I can go even much more. But this will suck the battery of the app device quickly empty. Due to the high voltage we need a differential capacitive voltage divider to get our low voltage TX coil reference signal. This will be fed into one line in channel. The other input is the RX signal.
        I'm sure, we don't need any RX amplifier too.
        All we need is: the USB sound card, some capacitors and diodes for high voltage protection, TX and RX coil in induction balance (IB) configuration and the DeepSeek software from other space.
        Thats all.

        Cheers

        Comment


        • Hi all,

          it gets better:
          Let's start with a simplified dual frequency VLF/LF detector. To get things easier in the software, both output channels will drive the single ended TX coil to ground. Each channel with its own resonant frequency. Therefore we need a simple mixer. A series resonant LC-tank follows the mixer. Then the parallel resonant LC-tank (TX-coil with parallel capacitor) + the capacitive voltage divider for our TX reference signal. I will post a spice simulation file soon so you get an idea.
          You have to decode the magnitue and phase in each resonant frequency. So 4 parameters for detection.

          In the advanced software version, we will check around the resonant frequencies (max. 500 Hz bandwidth around resonant frequencies) to get 12 parameters (6 magnitudes, 6 phases). A simple narrow band chirp modulation will drive the TX coil in each separate frequency. This makes things easier in the software.
          Cheers,
          Aziz

          Comment


          • I have forgotton to mention, that we have even more parameters for detection.

            Observing additional the magnitude of the TX voltage reference.
            On dual frequeny mode: 2 addtional parameters.

            On narrow band chirp mode: 6 additional parameters.

            A lot of info for good discrimination and ground balancing. Even on hottest mineralized soils. Not any one of the commercial VLF detectors have done such fancy processing.
            Aziz

            Comment


            • Hi all,

              this is a preliminary version of the dual frequency VLF/LF transmitter for Tablet PC + external USB sound card solution. I may reduce the output power for the final version. This is, what is easily possible with the G6 headphone output. You can reduce the TX coil current by reducing the coupling capacitors C1 and C2. The resonant frequencies are defined by Cs, L1 and Cp, LTX. C3/C4 is a capacitive voltage divider to get the TX reference voltage down to reasonable voltage levels for line input of the sound card. C3/C4 has low frequency determining effect to the resonant frequencies. Use zener diodes (D1 .. D4) to clamp the high voltage level to protect the line input of the sound card. Below is the spice simulation file for your convenience. And some pics.

              The dual frequency VLF/LF transmitter schematics:

              Click image for larger version  Name:	DualFrequency-VLF-LF-Transmitter.png Views:	0 Size:	146.8 KB ID:	433587
              Click image for larger version  Name:	DualFrequency-VLF-LF-FrequencyResponse.png Views:	0 Size:	103.8 KB ID:	433588
              Click image for larger version

Name:	DualFrequency-VLF-LF-Timedomain.png
Views:	178
Size:	126.6 KB
ID:	433585
              That's all for now.
              Aziz
              Attached Files

              Comment


              • Click image for larger version  Name:	DualFrequency-VLF-LF-Timedomain2.png Views:	0 Size:	66.2 KB ID:	433590
                The TX coil current was missing.. You can see, that there is enough bang to the TX coil.

                Of course, you may drive the TX on single frequency too (either lower or higher). Just provide same level, frequency and phase on left and right output channel of the headphone output. You can make it chooseable.
                - Frequency 1 (single low),
                - Frequency 2 (single high),
                - Frequency 1 + Frequency 2 (dual)
                No changes required to the transmitter to implement the three modes.

                Aziz

                PS: Choke L1 is a high voltage choke. It must handle voltages up to 200 V and more!

                Comment


                • I am still looking for the range of filter values for separating target and ambient/ground response that are generally used by vlf mds.

                  I have assumed target response to be around 100 hz and ambient/ground around 1 s to 5 seconds.

                  also, what should the target detection threshold value be, and derived from which parameter?
                  Last edited by Atul Asthana; 01-31-2025, 05:02 AM.

                  Comment


                  • Hi all,

                    lets reduce the transmitter power a bit and make things much easier (and low cost). We are leaving the inductive mixer (the mixer choke Lm) and duing the mixing pure capacitive. Reducing the coupling capacitors so the external usb sound card gets not too hot. We really don't need much power to the TX. It is still enough power.
                    See what happens in the following schematics.
                    Click image for larger version

Name:	DualFrequency-VLF-LF-CapMixer.png
Views:	172
Size:	123.1 KB
ID:	433602
                    The TX-coil voltage is still swinging between +50 and -50 V.
                    And we don't need the mixer choke.
                    The capacitive voltage divider must be adapted (increase or lower C4) to get the TX-reference voltage into the reasonable range. In this case, we have to decrease it to 10 nF to be in range of +2.5/-2.5 V.
                    Aziz

                    Comment


                    • Aziz! Let's open a can of worms!
                      https://www.aliexpress.com/item/1005...Cquery_from%3A


                      Comment


                      • Originally posted by ivconic View Post
                        That's a nice radio!!!

                        We don't need a radio.
                        We need a good next gen VLF/LF metal detector. With lots of precise and very sensitive digital decoders. We don't even need DSP functionality. All math can be reduced to simple +, -, *, / operations.
                        Aziz

                        Comment


                        • Hi all,

                          how to calculate the resonant frequencies f1 and f2 of our dual frequency transmitter?

                          That's really a good question. I don't know. It is quite complex. Yeah, you need complex math as we have lot's of complex resistors Z there. In series and in parallel. All mixed together.

                          Best way is tweaking Cs and Cp for given L1 and LTX inductances. In spice simulations using ".step param list" command for instance. Spice simulations are making it really easy for us.
                          For fine tweaking the frequencies in the real circuit add a small capacitor (470pF- 1nF) parallel to Cs and/or Cp to move the resonant frequency to the center of the bin-frequency. Depending on which is tweaked, it affects one frequency more than the other.
                          Best seen in the spice simulations.

                          Note, that the coupling capacitors C1 and C2 and the capacitive voltage divider caps C3, C4 will also have little effect to the resonant frequencies.
                          Aziz

                          Comment


                          • You don't have to calculate the them ...just do a sweep at start up to calibrate

                            Comment


                            • Originally posted by moodz View Post
                              You don't have to calculate the them ...just do a sweep at start up to calibrate
                              This what I usually do.

                              But for the sake of science it is good to know, how it is working.
                              Wolframalpha can solve this. We need only to define all the complex resistors and find the two minimum Z. Then we have the two frequencies.

                              I don't want to do this. I would much like to search my parts, LCR meter and make nice bread board circuit to start with the coding.
                              Can't wait to start with.

                              Aziz

                              Comment


                              • Hi all,

                                I have found my parts, LCR meter, a clean bread board, a ready to solder 2.1 mH choke with iron ring core (for L1), high voltage capacitors (for Cs and Cp). If I find the rest, I'm going to build test board this week end.

                                Comment

                                Working...