Announcement

Collapse
No announcement yet.

Some questions on general PI hw/sw

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

  • Some questions on general PI hw/sw

    I was planning to build a basic PI detector around a Microchip pic controller + simple front end and bumped into some design decisions that people on this forum with far more experience will surely be able to enlighten. Unfortunately, no schematics available yet. Still in the 'thinking' and 'breadboaring' phase.

    1/ Motion/ Non-motion ? In the microcontroller I have a 16-bit result ater each pulse. In the current design there is a 'cal' pushbutton that takes an average of 8 of these values and stores it as a calibration reference. All next samples are compared with this ref value and result in a deviation that is translated into an audio frequency change. This makes it a 'non-motion' detector since I can hover over the target and keep hearing the beep. I have been looking into analog PI designs here on the forum and they mostly end up with an opamp with a long R/C constant as a reference and a short one for the actual value - which makes it a 'motion' detector. Is this assumption correct ? And how to implement this motion into sw -- like a kind of moving average taking into account that RAM in this small PIC (16F616) is very limited ? Or is it better to stick with the calibrated sampling method and hit the pushbutton from time to time ?

    2/ MOSFET gate drive?: Right now I translate the 5V pulse from the microcontroller to 12V using a simple BS170 based inverter. This results in a slow rising pulse at the gate of the IRF740 due to the capacitive nature of the load. What is the advantage of adding a push/pull (BC547/BC557) between inverter and gate of the MOSFET ? In the end, it is just the pulse duration and the fast switch off time that matter, right ?


    3/ Pulse duration? I have read somewhere on the forum that the pulse duration is dependent on the kind of material you want to detect (gold vs iron). In my case I just wanted a 'general purpose' detector since on the fields here you will find all kinds of stuff (especially WW1 shrapnel lead balls...). Is it useful to start with a first pulse of e.g. 100 us and then gradually increase it to 200 us. E.g. a total sweep between these values could be 8 steps. Pulse frequency = 250Hz resulting in an overall sweep time of 8x4ms = 32 ms. The final value would be an accumulation of all 8 values. If one material results in more deviation at 160 us and higher, this would be the way to detect it better than with a fixed 100 us value? 32 ms in total would result in a distance of 3.2 cm when sweeping at 1 m per second. A little coarse if you ask me ? Increasing the pulse frequency would solve this at the cost of higher power consumption. Any comments on this increasing pulse duration ?

    Thanks in advance for your time and effort on this excellent (the best I've seen so far) forum.
    Regards from belgium,
    - Bernard

  • #2
    1. True, most PI designs are motion, either using a stage with a series cap or by using a differential stage with a slow feedback. You can implement this in software by using arrays. I've done this in a PIC using 2 arrays, one for a 16X signal average and the other for a 32X or 64X tracking average, which is actually an average-of-averages. Subtract the signal from the tracking for a response. I think my PIC has 2K. You probably should be doing a minor amount of averaging anyways for better noise suppression, even if you stick with the retune button. Whether or not you want to stay with the manual retune depends on how much drift you have, and can tolerate.

    2. The push/pull driver doesn't buy a lot over a pull-only driver, except that turn-on may be slightly faster.

    3. Generally, the longer the pulse duration the longer it takes the MOSFET to recover, which means a higher minimum sample delay. 100us is a good all-purpose number. If you sweep, you really need to channelize the results, and the PIC doesn't have the memory to do that. Plus, I doubt you will see any real advantage unless you implement constant-current pulsing and get really really aggressive with the design. Put a few pots into the PIC ADC and use them to play with pulse duration, sample delay, and sample width and see what happens.

    - Carl

    Comment


    • #3
      Thanks for the feedback, Carl !

      Comment

      Working...
      X