Implementing FPGA-Based Feedback Control of a Single Atom With LabVIEW and NI FlexRIO

 Read in  |   Print
  |   PDF  |  

"Using NI FlexRIO, we created our own high-performance custom hardware. With LabVIEW FPGA, we were able to quickly develop our FPGA code because of its high level of abstraction, while also integrating VHDL IP when applicable."

- Christian Sames, Max-Planck Institute of Quantum Optics

The Challenge:
Developing a custom time digitizer to study fundamental quantum properties of light-matter interaction.

The Solution:
Using NI FlexRIO and the NI LabVIEW FPGA Module to build a powerful and versatile custom instrument that allows us to implement real-time execution of time-critical tasks in hardware. This makes it possible to implement feedback control for systems as small as a single atom interacting with single photons.

Christian Sames - Max-Planck Institute of Quantum Optics
Markus Koch - Max-Planck Institute of Quantum Optics
Haytham Chibani - Max-Planck Institute of Quantum Optics
Maximilian Balbach - Max-Planck Institute of Quantum Optics
Tatjana Wilk - Max-Planck Institute of Quantum Optics
Gerhard Rempe - Max-Planck Institute of Quantum Optics

Feedback is one of the most powerful techniques to control a dynamic system. The system investigated in our laboratory consists of a single neutral isolated atom interacting with single photons – the fundamental excitations of the quantized electromagnetic field – surrounded by highly reflecting cavity mirrors (see Figures 1 and 2). With this system, we can study fundamental quantum properties of light-matter interaction, which require an atom to be localized in the center of the cavity. Inherent heating processes, however, tend to drive the atom away to different positions. Our goal is to suppress this motion with fast electronic feedback techniques, applying a restoring force counteracting this escape motion. Its underlying principle is depicted in Figure 3. The unpredictability of the motion makes it necessary to react quickly, but the quantum character of the system limits the amount of information that can be extracted. Thus, we have to perform a fast decision-making process on time scales of the order of a hundred nanoseconds based on the detection of single photons; we show that our feedback scheme [1,2] performs very well in this respect.

The key electronic component to solve this demanding task is an NI PXI-7954R NI FlexRIO FPGA module in combination with the NI 6581 high-speed digital input-output adapter module; the main purpose of the adapter module is to prevent damage by buffering the digital inputs and outputs of the exposed FPGA pins. The NI FlexRIO module is installed in an NI PXIe-1075 chassis with an NI PXIe-8130 integrated host controller. FPGAs are special reconfigurable integrated circuits; thus they can achieve the high performance of a hardware implementation while also being highly customizable throughout the design process. This, in conjunction with their inherent parallelism allows fast and deterministic execution and makes them a universal and powerful tool in science and industry. The NI FlexRIO module combines two main advantages. First, it permits easy programming of the FPGA via the LabVIEW FPGA Module, a graphical design language that we can use to design the FPGA circuitry at a high level while also integrating custom, low-level VHDL code when necessary. The FlexRIO module also directly exposes the FPGA pins to the user, enabling highly customizable I/O. Therefore, it allows the creation of custom-made, high-performance hardware. In our application, we developed a custom time digitizer that samples multiple digital channels with one nanosecond resolution, processes the data in real-time, applies a feedback algorithm, and outputs important information to the user.

Four-Channel Time digitizer With 1 ns Resolution and 64-bit Dynamic Range

Working with extremely low light intensities requires the use of a device capable to detect single photons. These devices, called Single Photon Counting Modules (SPCM), are based on avalanche photodiodes and emit a digital electronic pulse (see Figure 4) whenever a single photon is detected. We use a device fabricated by PerkinElmer® (AQR-14). The rising edge of the pulse reflects the arrival time of the photon with an accuracy of 350 picoseconds. For our application a resolution of 1 ns is desirable requiring the FPGA to sample each digital channel connected to a SPCM at 1 GHz.

The high sampling rate is accomplished by making use of the built-in data deserializer capabilities of the Xilinx Virtex-5 devices which we use to convert a data stream at 1 Gbit/s into eight synchronous data streams at 125 Mbits/s each. Each represents a part of the original stream offset by 1 ns with respect to one another (see Figure 5). This functionality is implemented in LabVIEW through a custom socketed CLIP (Component-Level Intellectual Property), allowing the integration of VHDL code to access the input/output pins of the FPGA.

Every rising edge corresponds to a photon click and has to be time stamped with a dynamic range of at least 36 bits; this is necessary to record datasets of up to one minute while avoiding an overflow of the internal counter. This is achieved by running an edge-detection unit, which is scanning each of the 8-bit wide, “deserialized” streams outputted by the “iserdes” primitive. Whenever a rising edge is detected an event flag is asserted. A 3-bit pattern representing where in this 8 ns interval the event occurred is furthermore generated. This value is joined with a 61-bit counter running synchronously on the 125 MHz clock. In total, this gives a 64-bit timestamp, which is then – along with the event-flag – passed on to LabVIEW FPGA. From that point on a LabVIEW VI is responsible for handling the rest.

The time stamps of the photon clicks of each of the four detectors are buffered in FIFOs. Subsequently, they are sorted and merged into one common data stream, which also holds control information. Before the stream is transferred via a DMA channel to the host PC memory it is buffered in the DRAM of the NI FlexRIO module. Overall, this architecture allows peak count rates of up to 125 million events per second for each channel for less than 2,000 events. Furthermore an average rate of 100 million events per second is achieved. This can be sustained for roughly 16 million events and is caused by size- and speed-limitations of the DDR2 memory. Finally, a sustainable count rate of 25 MHz is accomplished, which is given by the bandwidth limitations of the PXI bus. Upgrading to an NI PXIe-796x NI FlexRIO module would significantly improve the average rate due to the increased PXI Express bus speed, and the faster and larger DDR2 memory, respectively.

Please note that despite using the DDCA port of the NI 6581 adapter module, which is specified to handle data rates of up to 200 Mbit/s, it is still possible to detect rising edges with a resolution of 1ns as long as the count rates do not exceed 100 MHz. The proper mode of operation has been verified by intensive testing with an Agilent 81150A pulse function generator.

Photon-by-Photon Feedback on a Single Atom

The major task the FPGA has to perform is the actual control of the atomic trajectory in real time. We used an NI FlexRIO FPGA module to control the motion of a single atom trapped in an optical dipole trap inside an optical cavity. By detecting only a few photons we gain enough information about the actual position of the atom in the trap to steer its motion. Here, the FPGA module is used to record the arrival times of the photons, estimate the atom trajectory, and change the trapping potential of the atom based on this information. Upon detection of a single photon, a digital electrical pulse is emitted by one of the photodetectors and the arrival time is registered by the FPGA with 1 ns resolution on multiple channels. Based on the change in rate with which photons are detected, the FPGA estimates if the atom is moving toward the center of the trapping potential or outward and decides to decrease or increase the trapping potential, respectively.

The NI FlexRIO module sorts the arrival time of the photons scattered by our atom one-by-one into bins. Typical binning intervals consist of a few microseconds, referred to as exposure time, and are updated every few nanoseconds. The variation of the scattered photon rate is evaluated by comparing the current bin to the preceding one, which is delayed by a time equivalent to the exposure time; the delay is achieved by using FIFOs. In our case, a decreasing flux of photons indicates that the atom is moving toward the centre of the cavity, whereas an increase indicates that an atom is moving outward. As the trapped atom is sensitive to a variety of different forces its motion consists of a regular oscillation superimposed by a chaotic motion. This mechanism makes the atomic trajectory unpredictable on a timescale larger than its oscillation frequency, which is typically around 5 kHz. Once the kinetic energy accumulated by the atom exceeds the depth of the potential valley the atom is in, it is lost. The time the atom spent in the trap is referred to as storage time. Furthermore, the flux of scattered photons for a trapped atom is typically on the order of only one photon every 10 µs, making it very difficult to implement efficient feedback schemes due to the lack of information available. One possible scenario involves digitally switching the trap depth of the potential valley between a high and a low value depending on whether the number of clicks in the current interval surpasses the previous one by a certain number. As simple as this may seem, it still yields a 30-fold increase in the average storage time of the atom, compared to the situation in which no signal is fed back. Storage times of more than seven seconds with an average value of one second have been achieved, making this technique competitive to laser-cooling schemes, which require a much more complicated optical setup. Currently more sophisticated feedback strategies are under investigation.


Besides storing the information about the transmitted photon stream and feeding back into the system, it also crucial to display important information to the experimentalist.  For the initial set-up, this is especially important. To accomplish this, we have integrated a fast digital-to-analog converter (DAC) as well as two video graphic array (VGA) connectors to the FPGA.

The DAC is an Analog Devices TxDAC (AD9744) allowing sample rates of 210 Ms/s while having 14-bit resolution. In the current design it runs on a 125 MHz clock and outputs a voltage proportional to the number of detected photons. The data as well as the clock-pins of the DAC are connected to the NI 6581; 22 Ω resistors are installed in series to reduce reflections from the digital DAC inputs. The remaining pins of the module are used to interface with two VGA displays. Every VGA connector basically consists of three signal lines and two data lines. The signal lines are carrying the red, green, and blue color information. The VGA specifications require them to be 75 Ω terminated and assume values between 0 V (black level) to 0.7 V (full color intensity). The synchronization is achieved by two high-impedance TTL data lines specifying the horizontal and vertical retrace period. If only 8 color values (3-bit color depth) are needed, it suffices to connect the signal pins of the VGA connector to the NI 6581 adapter module (in 3.3 V configuration mode) via 270 Ω resistors. The data lines are connected with a 22 Ω resistance in series. We chose to divide the display in two parts: one showing text-based information and one graphics part. For the text-mode an 8 by 16 pixel black/white font is loaded into one of the internal block RAMs of the FPGA. It is addressed by another block RAM holding the character encoding. The graphics part shows trend diagrams for the transmission of the detectors or the evaluation of the feedback algorithm; these diagrams are also stored in the internal block RAM. Display modes of 1280 by 1024 pixel running on a 108 MHz pixel clock can easily be achieved.


Using NI FlexRIO, we were able to create our own high-performance custom hardware. The time digitizer is a very powerful and versatile tool to be used in many different areas of science and industry, and it offers benefits over many commercially available products. The computational power of FPGAs further helps us to implement real-time execution of time-critical tasks in hardware, which makes it possible to implement feedback control for systems as small as a single atom interacting with single photons.

With LabVIEW FPGA, we were able to quickly develop our FPGA code because of its high level of abstraction, while also integrating VHDL IP when applicable. In addition, using the PXI platform enabled us to take advantage of triggering and synchronization with other PXI instruments in our system, allowing us to integrate our custom instrument into a larger system without having to implement a fully custom design.


[1] A. Kubanek, M. Koch, C. Sames, A. Ourjoumtsev, P. W. H. Pinkse, K. Murr, and G. Rempe, Photon-by-photon feedback control of a single-atom trajectory, Nature 462, 898-901 (2009)

[2] M. Koch, C. Sames, A. Kubanek, M. Apel, M. Balbach, A. Ourjoumtsev, P. W. H. Pinkse, and G. Rempe, Feedback Cooling of a Single Neutral Atom, Phys. Rev. Lett. 105, 173003 (2010)

[3] P. W. H. Pinkse, T. Fischer, P. Maunz, G. Rempe, Trapping an Atom with Single Photons, Nature 404, 365-368 (2000)

[4] P. Maunz, T. Puppe, I. Schuster, N. Syassen, P. W. H. Pinkse, and G. Rempe, Normal-Mode Spectroscopy of a Single-Bound-Atom–Cavity System, Phys. Rev. Lett. 94, 033002 (2005)

Author Information:
Christian Sames
Max-Planck Institute of Quantum Optics

Bookmark and Share

Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community

Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI