Page 1 of 1

Improvements to my Lock in Amplifier implementation with PyRPL

Posted: Thu Aug 02, 2018 9:22 am
by mkphuthi
Disclaimer: I am not an expert in electronics so forgive me (and correct me) if I use the wrong terms here and there.

I managed to implement a basic lock-in amplifier using the pyrpl python framework for the RP found by searching PyRPL. This was to perform a frequency sweep on a quartz tuning fork and was able to resolve the resonant frequency up to 1Hz because the Pyrpl module (and I assume the RP) is limited to specifying frequencies only up to 1Hz accuracy.

I used the iq2 module to both produce the reference (The iq module does not allow any other reference to be used) and the driving signal (the output signal was unstable when I used any other signal generator, even the internal pyrpl module). The code I used is shown in the python script below.
resonator_sweep - Copy.txt
I have also attached the results of my frequency sweep, which still fall short of what one would produce with an SR830 and DS345 combination to perform the sweep which would produce very good fits to the Lorentzian plot shown.
sweep.png
I would like to know how I could improve this implementation, hardware, software or otherwise. I am still unsure what the limiting spec is but I suspect it is that the frequency can only be specified with 1Hz accuracy. Is this the limit of the RedPitaya or is it the limit of PyRPL? Would an external clock source help at all with the frequency stability?

Re: Improvements to my Lock in Amplifier implementation with PyRPL

Posted: Thu Aug 23, 2018 8:39 pm
by Ste_Trat
Ok Mr. mkphuthi

never heard of PyRPL, just read a few lines and i must say that things now really start getting interesting...

Thank you for that!

Re: Improvements to my Lock in Amplifier implementation with PyRPL

Posted: Fri Aug 24, 2018 9:57 am
by mikkelvl13
I'm not sure I understand your setup. But have you tried to optimize the iq-parameters?

If not:

As I understand, you use the iq2 to demodulate a modulated signal?
In that case, the phase of the modulation and demodulation signal has to be fixed, and thus you need to use the modulator inside iq2 for both modulation and demodulation (there is a phase drift between the PyRPL asgs and the modulators in the iqs). Also, you need to optimize the phase to compensate any delays in your setup. Finally you should optimize the bandwidth (a LPF) and the acbandwidth (a HPF preventing saturation in the iq-module). For the LPF you can also try out higher order filters supported by the PyRPL iq-moduls.

To optimize the iq-parameters, I recommend the PyRPL GUI! Then you can the optimize until you see nice quadrature signals of the iq.