Red Pitaya Blog

Home » , »

Linien – A versatile, user-friendly and open-source tool for laser stabilization based on the Red Pitaya STEMlab platform

The frequency stabilization of lasers is one of the most important parts of many atomic, molecular and optical (AMO) physics experiments. The frequency reference used for stabilizing is often provided by Doppler-free saturation spectroscopy of atomic vapor, due to the atoms’ intrinsically stable and universal resonance frequencies. To extract an error signal from the spectroscopic signal, lock-in techniques based on the modulation and subsequent demodulation of the laser’s frequency are employed. Common methods are frequency-modulation (FMS) and modulation transfer spectroscopy (MTS). This error signal is then fed into a proportional-integral-derivative (PID) controller that acts on the laser’s frequency, for example by means of the injection current in the case of a diode laser. Traditionally, these steps – modulation/demodulation and PID control – are realized using analog circuitry. This article will present how the locking of lasers to atomic transitions can instead be realized with digital hardware – namely the Red Pitaya STEMlab platform – with the Linien software packages. This approach is not only more flexible and easier to set up compared to analog circuitry, but also offers advanced features like automatic locking to a desired transition, machine-learning assisted parameter optimization, built-in analysis of the lock performance and data logging.

Linien is an open-source program for the Red Pitaya STEMlab 125-14 platform that aims to make the frequency stabilization as easy as possible. It follows a server-client structure, with the server autonomously running on the Red Pitaya and controlled via a client running on a PC. All components are written in Python, including the custom gateware for the Red Pitaya’s field-programmable gate array (FPGA) using the Migen library. The user can use either a scripting interface or a dedicated graphical user interface (GUI) for interacting with the server. No prior knowledge or installation of Python is required, as the GUI can also deploy the server component.



Figure 1: Schematic of the frequency modulation spectroscopy setup (top right) and representation of the functionality of Linien’s gateware (top left), server (bottom left) and graphical user interface (bottom right).


An example setup for laser locking via spectroscopy of rubidium vapor using the FMS technique is shown in Figure 1. Here, a p-polarized laser beam first passes a polarizing beam splitter before traversing a vapor cell. It then passes a λ/4 plate and is back-reflected on a mirror, passing the λ/4 plate and vapor cell a second time. This setup of counter-propagating beams allows for the resolution of the atomic hyperfine spectrum otherwise obscured by the Doppler background associated with the temperature of the gas. The now s-polarized laser beam is reflected off the polarizing beam splitter before hitting a photodiode. The frequency of the laser is swept over an atomic transition frequency at a rate of typically some 10 Hz. Simultaneously, the laser is frequency-modulated via the laser current, creating sidebands in the laser’s spectrum, typically at several MHz from the carrier. These sidebands will be absorbed by the atomic vapor depending on their frequency relative to the atomic absorption spectrum. By demodulating the signal recorded by the photodiode, i.e. mixing it with the phase-shifted modulation frequency, a so-called error signal as shown in Figure 2 is generated. This error signal is asymmetric with respect to the zero-crossings corresponding to the atomic transition frequencies, and can be used for stabilizing the laser in a PID loop.


Sweep-generation, modulation, demodulation, lock-point selection and PID control are all handled by Linien directly on the FPGA. In order to generate an error signal with a high signal-to-noise ratio, the modulation amplitude, modulation frequency, and demodulation phase for compensating delays in the acquisition circuitry all have to be adjusted. This optimization process can be automated with Linien by simply selecting the desired transition. The optimum demodulation phase is determined by IQ demodulation, while the modulation amplitude and frequency are optimized using the machine-learning algorithm CMA-ES, with the error signal edge steepness as the figure of merit.



Figure 2: Error signal created by frequency modulation spectroscopy of Rubidium 87, as displayed in the Linien GUI.


Once the error signal is optimized the user can then select the desired transition in the GUI and the PID loop will be engaged and stabilize the laser to the corresponding atomic transition. In order to reliably lock to the correct transition even in the presence of large amounts of jitter (for example, due to temperature fluctuations), a novel auto-lock algorithm was conceived. The spectrum and desired lock-point are analyzed and a description of the spectrum is generated, which in turn is translated to a set of instructions that can be executed by the FPGA, e.g. “after a peak of height H1 and a valley of depth H2 wait for time T before engaging the PID loop.” This algorithm is robust against fluctuations in the signal height and shifts in the transition frequencies. In order to find an appropriate set of PID parameters, Linien is capable of analyzing the in-loop error signal by means of extracting its power spectral density (PSD). The PSD can be observed in the GUI as a function of the user-defined PID values. To compensate for larger long-term drifts of the laser, Linien also features an “unlimited” integrator that can be used, for example, to change the grating angle of an extended cavity diode laser (ECDL) via a piezo-driven actuator. The lock status and control parameters can be monitored by logging them to an InfluxDB2 instance, which in turn can be displayed in a Grafana dashboard. The laser locking and parameter logging are performed directly on the Red Pitaya, so there is no need to stay connected to the server after the lock is achieved.


While frequency locking to atomic spectra is the main focus of Linien, it can also be used as a PID controller for other types of experiments. To this end, a bare PID mode was implemented. By bypassing the modulation/demodulation and filtering stages, a control bandwidth of roughly 1 MHz can be achieved, making it suitable for tasks such as the phase-locking of lasers.


Linien was initially developed by Benjamin Wiegand based on redpid, as authored by Robert Jördens. This work is currently being continued by Bastian Leykauf. A more in-depth description of Linien can be found in our article published in Review of Scientific Instruments. While the bulk of the development is done in the Quantum Optical Metrology group at Humboldt University of Berlin, outside contributions to the project’s Github repository in the form of bug reports and code contributions are more than welcome. We thank all contributors to the project, especially Doron Behar and Christian Freier. Furthermore, we thank Matthias Schoch for help with the electronics and Laurenz Reichl for designing Linien’s logo.


This work was supported by the German Space Agency (DLR) with funds provided by the Federal Ministry of Economics and Technology (BMWi) under Grant No. DLR50WM2066.

Subscribe to our newsletter

Related Posts