Quote from: dewster on 12/4/2024
The 90 degree shift allows for the use of a quadrature multiplying (XOR) phase detector, which rejects noise but is sensitive to harmonic locking and duty cycle variation. Staggering the edges in the XOR case also helps to isolate edge related disturbances in the AFE circuitry.
This is what I got when I tried to use the DPLL of D-Lev: when it starts, it locks to 1/3 of the resonance frequency, and drives the LC circuit with the 3rd harmonic. It moves to the fundamental if I touch the antenna or set dither left shift to 7. Not sure if I made a mistake somewhere or if this is a compatibility issue. (I'm using a different FPGA and AFE)
Quote from: dewster on 12/4/2024
In-phase detectors compare edges rather than entire waveforms, and so are susceptible to edge noise, but they aren't harmonic or duty cycle sensitive.
By edge noise, you mean something similar to the bouncing of mechanical switches or buttons, right? This, in my experience, mainly happens when the amplitude of the sense signal is too low, otherwise it's generally fine, and it may be filtered out using analog or digital filters, similar to debouncing.
For XOR, as long as we keep the duty cycle of one of the waveforms to ≈1/2, the duty cycle of the other waveform shouldn't matter much. If A have 2/1 duty cycle, XOR will detect 0 phase error when the center of each pulses in B is aligned with edges in A, regardless the duty cycle of B.
Quote from: dewster on 12/4/2024
It should be noted too that the phase detector in this case is just that, whereas in true PLL situations it must function as a phase & frequency detector. This is because the I/O phase difference of an LC filter can only vary by 180 degrees - the LC can't change the frequency. So a DLL (delay locked loop) would in theory also work as stimulus, but a precision NCO (numerically controlled oscillator) is trival to construct, provides constant stimulus (the starting / stalling issue), and naturally integrates the phase error over a long period.
One limitation of DLL is that it doesn't directly provide a high precision measurement of the frequency. We may need additional circuit for frequency measurement, similar to when using standalone oscillators. One advantage of it over using standalone oscillator is it may be able to provide better phase alignment.
In my experience, the oscillation generally start more easily when using a delay, and it does not need a relatively accurate estimation of the resonance frequency, and will not lock to harmonics. So I'm thinking about using a delay (locked, constant, or sweep) to start the oscillation, and then switch to PLL.
Quote from: dewster on 12/4/2024
In the FPGA one could generate a quadrature output from the DPLL and use this as the reference, but it wouldn't travel the same route as the other signals, and so would be sensitive to timing variations due to voltage and temperature. Unfortunately, when measuring femto-Farads every sensor becomes a thermometer.
Another method Buggins and I mentioned and is used in his latest circuit is to use an integrator to provide the phase shift. This also has the problem that the signals don't travel the same route. (And so does the original CFOA based circuit that uses the amplifier to provide the shift!) Though I guess phase drift is somewhat less problematic than frequency drift?
Alternatively, we can digitally delay one of the inputs by 1/4 period. This shouldn't introduce additional drift, but the resolution of the delay is limited. This may be mitigated by dithering, and considering that the input is already temporally quantized, it shouldn't be too much of an issue.
Yet another way is to use some sort of "signed xor" like what buggins described here.
In your reply to that post:
Quote from: dewster on 1/9/2022
Consider the scenario where a glitching B is centered on A (without error averaging):A=0, B=0 : state=0, error=0
A=1, B=1 : state=1, error=0
A=1, B=0 : state=1, error=-1
A=1, B=1 : state=1, error=0
A=1, B=1 : state=1, error=0
A=1, B=0 : state=1, error=-1
A=1, B=1 : state=1, error=0
A=0, B=0 : state=0, error=0
The phase error is -2 but it should be zero.
If B also glitches when A=0, the error should cancel out. It's unlikely that it will only glitch in half of the cycle and not the other half. Otherwise, B effectively has non 1/2 duty cycle.
The most simple way, of course, is not using current sensing with DPLL. The ≈0°/180° phase shift of it is desirable for standalone oscillators, but doesn't seems to be beneficial to DPLL, and the 1pF capacitor (or the lack thereof) is likely not going to make a huge difference.
By the way, is there documentations about porting D-Lev to another FPGA and different external circuit? The FPGA I'm currently using is ZYNQ 7020.
I know that D-Lev doesn't contain a lot of manufacturer specific things, the few things I'm currently aware of are input and output DDR, PLL, ram init files, and, of course, project files. Is there something else?
Currently I extracted the lc_dpll and timing module, connected the DPLL to APB then to AXI through a bridge, connected sq_48k_o to an interrupt source, then read the frequency using the built-in ARM cores. As I mentioned before, it's not working correctly and locks to 1/3 of the resonance frequency, but if I make it lock to the fundamental, apply a 20ms averaging, then I get a result with about 1-2ppm noise/uncertainty (absolute), which is about the same as when using MCU with a standalone oscillator. I wonder what's the absolute precision of the original D-Lev.