Announcement

Collapse
No announcement yet.

My Pulse Oscillation detector project.

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

  • #16
    Originally posted by joop View Post
    ah, the clipping diodes, of course... But amplitude could still be measured after a time delay when amplitude is below the clipping voltage...
    No, the ADC would be too slow. For the most of the time, the coil voltage would be at high levels and clipped therefore.

    There is a 1 bit ADC implemented: lo/hi input line detection.
    You can sample the bit very fast (just read the input line). Mix it with a reference nearby the resonance frequency. (The easiest and fastest mixer would be an exor operator).

    Aziz

    Comment


    • #17
      Originally posted by Aziz View Post
      No, the ADC would be too slow. For the most of the time, the coil voltage would be at high levels and clipped therefore.

      There is a 1 bit ADC implemented: lo/hi input line detection.
      You can sample the bit very fast (just read the input line). Mix it with a reference nearby the resonance frequency. (The easiest and fastest mixer would be an exor operator).

      Aziz
      Note that Teemo has labelled pin 3 of the PIC as "RA4/C1IN1", which probably tells us that he's using the built-in comparator.

      Comment


      • #18
        Originally posted by Qiaozhi View Post
        Note that Teemo has labelled pin 3 of the PIC as "RA4/C1IN1", which probably tells us that he's using the built-in comparator.
        I'm not familiar with the PIC pins.
        But I personally wouldn't use the comparator (IRQ).
        The continious down mixing is simpler and faster.
        Aziz

        Comment


        • #19
          What I mean is the following:
          Sampled Coil "bits": 000111100011100011110000111000.....
          Reference "bits": 011100001111100001110000...
          XOR: 011011101100000010000000...
          Low-pass: 111111111100000000000000.. -> output (down mixed and filtered output beat frequency)

          Very simple to implement and very effective. Can be implemented in an endless loop.
          Aziz

          Comment


          • #20
            Thanks for explaining...

            Comment


            • #21
              Nice design !
              You can probably omit D2/D3 clipping diodes as they are already inside the PIC ?
              I also have had problems in the past using the MCLR pin 4 as a pushbutton input. The controller would sometimes reset when holding the search coil near a damp grass surface. The solution is to add a 100nF to ground (in parallel with the pushbutton).

              Best regards,
              - Bernard

              Comment


              • #22
                Originally posted by F117 View Post
                Nice design !
                You can probably omit D2/D3 clipping diodes as they are already inside the PIC ?
                I also have had problems in the past using the MCLR pin 4 as a pushbutton input. The controller would sometimes reset when holding the search coil near a damp grass surface. The solution is to add a 100nF to ground (in parallel with the pushbutton).

                Best regards,
                - Bernard
                Thanks,
                Still I think it is better not to omit D2,D3 because PIC internal diodes are not strong enough. There is 150V, maybe more, at the coil!

                Comment


                • #23
                  Here's my educated guess of how it works ->

                  1. The digital port RA5 (pin 2) pings the MOSFET, and starts the LC network into oscillation at an approximate frequency of 77kHz. The result is a decaying sine wave, which is initially clamped to +/- 0.3V (due to the Schottky diodes).

                  2. Timer 1 is reset and started running.

                  3. RA4/C1IN1 (pin 3) is a comparator input that is used to count the number of transitions through 0V during the period when the timer is active. This is probably done under interrupt control.

                  4. Eventually Timer 1 reaches the limit and generates an interrupt.

                  5. The number of transitions is then used to set the PWM output on RA2 (pin 5) to drive the piezo speaker with an audio frequency.

                  6. The cycle repeats.

                  Although this design superficially resembles a PI, it appears to be measuring frequency changes due to metal targets altering the inductance of the coil.

                  Teemo - am I close?

                  Comment


                  • #24
                    Originally posted by Aziz View Post
                    What I mean is the following:
                    Sampled Coil "bits": 000111100011100011110000111000.....
                    Reference "bits": 011100001111100001110000...
                    XOR: 011011101100000010000000...
                    Low-pass: 111111111100000000000000.. -> output (down mixed and filtered output beat frequency)

                    Very simple to implement and very effective. Can be implemented in an endless loop.
                    Aziz
                    HI Aziz,

                    OK I see how this works (I think) can you explain the processes involved (HOW this filters)? I've tried to learn and don't know much about DSP, plus I'm not bvery good at "seeing" things at the moment due to the medication I'm on (seems to make me dumb-er than I normally am) .

                    Regards

                    Sean G.

                    Comment


                    • #25
                      Eventually Timer 1 reaches the limit and generates an interrupt.
                      One of the nice features of these PICs is that you can gate the free running timer1 with the output of the comparator. Very easy to measure incoming pulse widths !
                      So, no timer interrupts needed and reading the timer value is also not critical since it automagically stops counting when the gate signal goes low(/high)

                      Comment


                      • #26
                        Originally posted by Qiaozhi View Post
                        Here's my educated guess of how it works ->

                        1. The digital port RA5 (pin 2) pings the MOSFET, and starts the LC network into oscillation at an approximate frequency of 77kHz. The result is a decaying sine wave, which is initially clamped to +/- 0.3V (due to the Schottky diodes).

                        2. Timer 1 is reset and started running.

                        3. RA4/C1IN1 (pin 3) is a comparator input that is used to count the number of transitions through 0V during the period when the timer is active. This is probably done under interrupt control.

                        4. Eventually Timer 1 reaches the limit and generates an interrupt.

                        5. The number of transitions is then used to set the PWM output on RA2 (pin 5) to drive the piezo speaker with an audio frequency.

                        6. The cycle repeats.

                        Although this design superficially resembles a PI, it appears to be measuring frequency changes due to metal targets altering the inductance of the coil.

                        Teemo - am I close?
                        Hi Qiaozhi.
                        Some points you got right some not.
                        1. RA5 pings the mosfet and resonance fereq. 77kHz is correct. But resulting decaying sine wave is not clamped. Clamped is signal that reaches PIC through R4, and to supply rails, between 0V and 5V
                        2. correct
                        3. correct, and comparator output drives timer 1 gate function
                        4. no, Timer 1 do not reach limit, it is started and stopped at every sine wave period that reaches over comparator treshold level, using PIC timer1 gate function. Download PIC12F1840 datasheet for details how this function works. Timer1 count is therefore proportional to the decay time.
                        5. output audio is not pwm, it is just beep or no beep.

                        So it do not measure the ferequency for detecting metal, only the decay time.

                        Aziz, you are getting it way too complicated.
                        Here is link for PIC1840 datasheet
                        See timer1 Gate function
                        http://ww1.microchip.com/downloads/e...Doc/41441B.pdf

                        Also my block diagram on my web:http://www.digiwood.ee/images/metal_...matic_copy.png

                        Comment


                        • #27
                          Originally posted by F117 View Post
                          One of the nice features of these PICs is that you can gate the free running timer1 with the output of the comparator. Very easy to measure incoming pulse widths !
                          So, no timer interrupts needed and reading the timer value is also not critical since it automagically stops counting when the gate signal goes low(/high)
                          F117, you got it right here.

                          Comment


                          • #28
                            Nice work Teemo!

                            Here's a similar idea, US patent 6,650,111
                            http://www.google.com/patents/US6650...ed=0CDsQ6AEwAA

                            Comment


                            • #29
                              *LOL*
                              Nice Teemon. You know how to do it more complicated now.

                              Aziz

                              Comment


                              • #30
                                Thanks Altra and Aziz,

                                Comment

                                Working...