Abstract
Automated alignment of optical systems is a critical challenge in experimental physics. We present a reinforcement learning (RL) approach using the Twin Delayed Deep Deterministic Policy Gradient (TD3) algorithm to align a Mach-Zehnder interferometer across five degrees of freedom, including beam divergence. By employing a continuous action space with exponential rescaling and robust domain randomization, our agent successfully transfers from simulation to a physical laboratory environment. The RL agent achieves a mean visibility of 0.98 in 75 steps, outperforming human experts in both speed and alignment quality.
Introduction
In experimental physics, the alignment of complex optical setups like the Mach-Zehnder interferometer (MZI) is a time-consuming task typically requiring expert intervention. Precise alignment involves overlapping two laser beams in position, angle, and divergence to maximize interference visibility. Previous automation attempts often used discrete action spaces, which struggle with the multi-scale nature of optical adjustments—ranging from coarse beam finding to microscopic optimization. This work introduces a vision-based RL agent capable of handling continuous action spaces and beam divergence control.
Experimental Setup
The physical setup consists of a Mach-Zehnder interferometer as shown in Figure 1. A HeNe laser beam is split by a beam splitter (BS 1). One arm serves as the reference, while the other is adjusted using motorized mirrors and lenses. A piezo-mounted mirror oscillates to create a dynamic interference pattern captured by a CMOS camera.
The agent controls five degrees of freedom: two tilt angles for Mirror 2, two tilt angles for BS 2, and the longitudinal position of Lens 2 to control beam divergence.
Methodology
The alignment task is modeled as a Partially Observable Markov Decision Process (POMDP). We utilize the Twin Delayed Deep Deterministic Policy Gradient (TD3) algorithm, which operates in a continuous action space.
Vision-Based Observation
The agent's observation consists of a sequence of 16 frames (64x64 pixels) from the camera. These frames capture the evolving interference pattern as the piezo mirror moves, providing depth and phase information. Figure 2 displays examples of these patterns under different misalignment conditions.
Continuous Action Space and Rescaling
To address the scale problem, we map the agent's raw output $a_0 \in [-1, 1]$ to physical movements using an exponential rescaling function: $a = \text{sign}(a_0) \cdot 1000^{|a_0|-1}$. This allows the agent to perform both large-scale searches and fine-tuned optimizations within the same framework.
Sim-to-Real Transfer
Training is conducted entirely in a high-fidelity simulator. To ensure successful sim-to-real transfer, we employ domain randomization, varying parameters such as beam radius, camera noise, and optical phase noise. Phase noise, representing environmental fluctuations, proved essential for the agent's robustness in a real lab setting.
Results and Discussion
The RL agent, termed the "new Interferobot," was evaluated against a human expert and a previous discrete-action RL model.
- Efficiency: The agent reached a high-quality visibility threshold ($V \geq 0.95$) in an average of 75 steps, significantly faster than the human expert (103 steps) and the discrete model (116 steps).
- Alignment Quality: The agent achieved a superior mean final visibility of 0.98, compared to 0.94 for the human expert.
- Emergent Strategies: The agent autonomously developed "parallel movement" strategies—adjusting two mirrors in tandem to shift beam position without altering its angle—a technique commonly used by human experts.
Conclusion
We have demonstrated a robust RL-based system for the automated alignment of an optical interferometer. By incorporating continuous action spaces and beam divergence control, the agent outperforms human experts in both speed and precision. This modular approach holds promise for scaling to more complex optical systems with higher degrees of freedom.
Summary updated