Shop OBEX P1 Docs P2 Docs Learn Events
LC Circuit — Parallax Forums

LC Circuit

curtisdcurtisd Posts: 8
edited 2010-12-09 10:25 in Propeller 1
Hello,
I am using a prop pin and the synth object to send a square wave to an inductor (coil) via a capacitor at resonance. I then tap between the cap and coil with a diode and cap going to ground (peak detector). I send the resulting DC (21 volts at resonance) to a voltage divider in order to get about 3.3 volts for use with an adc (3202B 12 bit 2 channel).

My question is:
When I bring the coil (at resonance) close to a metal, it couples and the resonant frequency changes. I want to sweep the square wave until resonance is achieved with the metal in place. The problem is that I have to change the values of the resistors at the voltage divider stage to get the 3.3 V for the ADC. Should I use a digital pot or something else? I bought a digital pot from parallax, but it doesn't have a hih enough value. Are there any suggestions? Thank you.

Comments

  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-12-06 12:16
    Through experimentation, you could generate a lookup table as a calibration source.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-06 12:51
    Instead of measuring the amplitude, why not measure the phase? Put a resistor in series with your RC network. At resonance, the signal measured at the other end of the resistor will be in phase with the driving signal. Better yet, by measuring the sign of the phase difference, you can tell which direction to move the frequency, making a binary search possible.

    Here's an example circuit:

    attachment.php?attachmentid=76130&d=1291668510

    You should probably consider switching to a parallel-resonant LC, though, since it will give you more signal to work with at resonance.

    -Phil
    293 x 247 - 2K
  • curtisdcurtisd Posts: 8
    edited 2010-12-06 13:03
    Thanks Phil,
    Sounds like a great work around. I'll have to research this since my spin skills are not as good as yours. I'll construct the circuit and look at it on my scope. Thanks again.

    Curtis
  • curtisdcurtisd Posts: 8
    edited 2010-12-08 09:21
    Thanks to Phil for the circuit in the post. I breadboarded the circuit and measured the voltage and the phase at resonance at the feedback pin. The phase was -90 and when I changed the source frequency, the phase changed. I also used a simulator and found very little voltage at the feedback pin. My question is: How do I use spin code to measure the phase and sign of the phase at the feedback pin?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-08 09:44
    curtisid wrote:
    I also used a simulator and found very little voltage at the feedback pin.
    That's why I suggested you switch to a parallel-resonant circuit. Either that, or put the sense resistor between the inductor and Vss.
    curtisid wrote:
    How do I use spin code to measure the phase and sign of the phase at the feedback pin?
    See my antenna analyzer post for clues on detecting phase differences:

    -Phil
  • Ed TEd T Posts: 50
    edited 2010-12-08 09:56
    You want to do something like multiply your feedback by the squarewave. With Phil's circuit it looks the feedback as seen in the prop will be high when the feedback is positive and low when the feedback is negative. You could use a counter to accumulate when both the squarewave and feedback are high. If they are in phase you will get the largest count. If they are 180 deg out of phase you will get near zero. I would check how well the high/low transition in the prop matches up with the zero crossing of the analog feedback. If the feedback is small a little offset in the centering will create a difference in the these. Also if your feedback is small you may want to look at the RC time constant of the cap in your feedback combined with the 100k resistors versus your sq wave frequency. They make a high pass filter to the signal. With too small a cap you could really attenuate your signal.

    - Ed
  • curtisdcurtisd Posts: 8
    edited 2010-12-09 10:25
    Hi everyone,
    I have been doing research on this. Phil, I tried to understand your antenna analyzer, but I am not that advanced in spin. I found Beau's post: http://forums.parallax.com/showthread.php?95640-Propeller-Demo-Frequency-Phase-Detector&highlight=beau+phase+detector which I understand a little more, but I am beginning to see the theory. I was thinking of using an LVDT I built to use as a test see if I could create something in spin to measure phase shift resulting in a numerical value. Between Phil's and Beau's work, I may get this after all. Any suggestions help is appreciated. Thanks, Curtis
Sign In or Register to comment.