Shop OBEX P1 Docs P2 Docs Learn Events
Phase error detection question ... — Parallax Forums

Phase error detection question ...

Beau SchwabeBeau Schwabe Posts: 6,557
edited 2014-12-03 12:53 in Accessories
Attached is a simple Set/Reset latch implemented using a few discrete transistors.

[Image Removed]

When you apply two frequencies to this circuit, it can be used to determine the amount of Phase error between the two frequencies.
Notice this only works for the first 0-179 Deg, which is fine for this application. If you want the 180-359 Deg, simply invert the frequency entering the "SET" input.
Also, notice the ERROR pattern when A leads B versus when A lags C.

[Image Removed]

...My Question? I would like to find a cleaver solution to determine which input arrives first using only transistors.... I thought I could use the "snap" at the 180 Deg mark between the Lead and Lag based on previous reads ... sort of like an intervalometer, where a progression in one direction doesn't do anything, but a progression in the opposite direction creates a spike, but I haven't got my head around it yet. Probably been staring at it too long. Sure I could throw a couple of flip flops at this and be done with it, but I need this to be done with discrete components. Any thoughts or ideas would be welcome.

Thanks

Comments

  • DomanikDomanik Posts: 233
    edited 2014-11-26 18:16
    Beau,
    Don't have an answer but maybe this 2 tranny FF and caps could work:

    Transistor RS Flip Flop

    I'd try putting 50pf caps on the RS inputs that can transfer enough energy to overcome the bias resistor on the base. The output would represent the last base that was pulsed. Maybe you already thought of this? But I don't think it will have a 180 problem with small caps because it should only respond to one edge direction and not a DC level. Trying to do anything with transistors makes my head throb-- they have 100's of sneaky little parasitics that have been designed out with cmos.

    Hope this helps,
    Dom..

    Edit: Now I remember doing this years ago. I used a dif-pair with 5k in the emitter to idle the emitter current and 2 Schottky diodes tied to a 100 ohm to turn on hard when 1/2 was driven. Both bases had a 16k / 6k with a 50pf tied to the mid-connection/base. The pulse into & thru the 50pf cap easily drove the base & 2 resistors to switch it. At the time it was a floating RS latch. Sorry, with the new forum I can't post a schematic.
  • BeanBean Posts: 8,129
    edited 2014-12-03 07:59
    Beau,
    I don't know if this helps, but I usually use an XOR gate. I guess you could make an XOR from discreets.

    The output will be a pulse train with a frequency that is the sum of the two inputs. The pulse width is the phase difference. And if you filter the pulses with an RC circuit you will get a triangle wave with a frequency that is the difference between the two inputs.

    Not sure if I am telling you anything you don't already know.

    Bean
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2014-12-03 12:53
    Thanks guys ... I gave up on the discrete transistor approach for now, and decided to go for functionality first.

    What I'm trying to do is create a dynamic tracking PLL (or essentially an NCO) where the input frequency (which can vary) determines the local osc frequency without using a micro. <- Stepping issues and related jitter would degrade the performance in this situation ... even with a fast micro) The design should use as few components as possible. Wide range in input frequency is also desired 10kHz to 10MHz.

    The XOR method mentioned above only indicates error magnitude but does not indicate the direction that the error occurred. I need a way to determine the magnitude and direction of the error ... more importantly the direction of the error. A dual Flip-Flop method does work "sort of", but seems like a bulky solution to what I think should be a simple solution. i.e. the transistor solution is very close to what I am looking for but introduces another issue I can't get my head around at the moment. <- A gated peak detector maybe? not sure.

    Note: The PLL comparison is done between the input frequency and the local osc, so any race conditions due to a circular reference should be avoided also.
Sign In or Register to comment.