In this example, we demonstrate the design and optimization of an eye-tracking optical system. Eye-tracking systems in AR/VR and HMD applications provide a dynamic and immersive experience by adapting the graphics to the user’s center of view by calculating their interpupillary distance. Their potential value makes it critical that eye-tracking systems can be analyzed accurately and optimized efficiently. We will demonstrate the simulation of such an eye-tracking system that utilizes the latest optical technologies of a system with two pancake lenses and a lens with two meta-surfaces. Both these optical components reduce the total mass of the systems compared to previous technologies. As this system contains a combination of nano and macro-scale optical components, both Ansys Zemax OpticStudio and Ansys Lumerical software are used for the simulation.

[[NOTE:]] This application gallery example requires Ansys Zemax Optic Studio versions 2024 R1.00 or newer and Ansys Lumerical FDTD package versions 2023 R2.3 or newer.

## Overview

* Understand the simulation workflow and key results *

### Step 1: Phase design in OpticStudio

After optimizing the pancake lens, in the first step OpticStudio is used to design the ideal phase profiles on the two surfaces of the metalens. These are optimized to deliver the best image quality.

### Step 2: Meta-atom optimization in Lumerical

Lumerical is used to optimize the meta-atom profiles so the metalens produces a close match to the phase profiles produced in OpticStudio. This is achieved by varying the radii of the individual nano-rods while keeping their height fixed.

### Step 3: Import meta-atom map (.h5) back to OpticStudio

In the final step, the meta-atom phase map is imported into OpticStudio where a comparison of the results, using the full metalens simulation, is made with the results from the first step. A range of analyses are used for the comparison including: spot diagram, geometric MTF, image simulation and the optics layout plots. We consider the results fall in with expected error variations.

## Run and results

* Instructions for running the model and discussion of key results *

### Step 1: Phase design in OpticStudio

- Open “eye tracking through pancake VR (binary 2, 0.85um) v7.zar” ZOS project file
- Observe the optics layout and merit function editor
- Observe the phase, phase slope tan and phase slope sag diagrams

The optical system is restricted based on the most common specifications of the technological applications it is intended to be used. More specifically, the optimization is targeted for central wavelength of 0.85μm, the eye-box is expected to be of 16 x 32mm dimensions, while the metalens should not be of higher than 2mm diameter and 4 mm length. The two metalens surfaces were built using a user defined DLL file, where the phase of the two meta-surfaces is described based on the following equation:

$$\phi = Order\times\frac{2\pi}{\lambda}\left(\sum_{i=1}^N A_i\ r^i+\sum_{i=1}^N\sum_{j=1}^M\ B_(i,j)\ x^i\ y^j\ \right)$$

The merit function is built using the standard Image quality Spot operands with the addition of the phase slope operands. The rate of phase change for the first meta-surface is restricted only to the tangential orientation and its absolute value should not be higher than 250 mm-1 . While for the second meta-surface the quadratic sum for both tangential and sagittal phase slopes should not exceed the 250 mm-1. Considering the distortion can be digitally corrected on these systems, it is not studied during the optical design and optimization. Below are the optics layout built in ZOS and the resulting phase and phase slope (Tangential and Sagittal) graphs after optimization.

### Step 2: Meta-atom optimization in Lumerical

- Open find_range.fsp with find_range.lsf and run the script
- Observe the creation of the “find_range.mat” file on the same folder
- Run matlab script find_range and observe the results of the phase cycles for different nano-rod heights (Optional)
- Open “amp_phase_vs_theta_phi.fsp” with “amp_phase_vs_theta_phi.lsf” and run the script
- Observe the creation of the “amp_phase_vs_theta_phi.mat” file on the same folder
- Run matlab script amp_phase_vs_theta_phi (Optional)
- Observe the Phase vs. Radius and Transmission vs. Radius graphs

The meta-surfaces for the metalens are simulated using Rigorous Coupled-Wave Analysis (RCWA) Lumerical’s solver. The simulated geometry is a nano-rod (with n=2.04) and a substrate (with n=1.45), while the height of the nano-rod is determined by scanning over a range of 0-3 μm. The period of the nano-rods is 0.4 μm for avoiding second order diffractions. Below is an image of the nano-rod built in RCWA:

By analyzing the results of the height scan it is determined that the height should be fixed at 1.7357μm. The criterion is for the height to cover a full phase cycle (0-2π) for angle of incidence up to 40°, since it is considered that the angle of incidence for the first and the second meta-surfaces are 36° and 30° respectively.

After fixing the height of the nano-rod a scanning on the radius is performed for both meta-surfaces. The Phase vs. Radius and the Transmission vs. Radius for the meta-surfaces are represented after the simulation on RCWA. Additionally, two .h5 files are exported as meta-atom maps to be used on the next step in ZOS.

### Step 3: Import meta-atom map (.h5) back to OpticStudio

- Open “unit_cell_multiangle_MC_1st.fsp” with “unit_cell_multiangle_updated_MC.lsf” to generate “amp_phase_vs_theta_phi_radius_period_400nm_from_substrate.mat” file (run the radius sweep and run the script)
- Open “unit_cell_multiangle_MC_2nd.fsp” with “unit_cell_multiangle_updated_MC.lsf” to generate “amp_phase_vs_theta_phi_radius_period_400nm_from_air.mat” file (run the radius sweep and run the script)
- Open “generate_metalens_data_MC.lsf” and check on the script that “lens index” is equal to 1 and run change the lens index to 2 and run again
- Observe the creation of 2 .h5 files in the same folder (metalens_1st.h5, metalens_2nd.h5)
- Copy the .h5 files into \DLL\Surfaces\, local ZOS folder
- Open “eye tracking through pancake VR (metalens_RCWA_0.85um) v7.zar” file observe and compare the results

The optical design of the system is completed when the two .h5 files produced from RCWA for the meta-surfaces are imported into ZOS:

To determine whether the final optical design is successfully concluded, a comparison of the initial “ideal” optical design with this latter one is performed. Below are images of the optics design layout, the spot diagrams, the geometric MTF and an Image simulation:

## Updating the Model with Your Parameters

* Instructions for updating the model based on your device parameters *

- The optimization of the optical system as well as the phase function on Step 1 may be customized to on users’ requirements/preferences
- Different unit cells and parameters may be defined to generate the .h5 files at the final step

## Additional Resources

* Additional documentation, examples, and training material *

- Jens Niegemann, Dan-Nha Huynh, Adam Reid, Han-Hsiang (Michael) Cheng, Erin Elliot, Federico Gomez, and James Pond, “Design and Simulation of Large-Scale Metalenses” in Frontiers in Optics + Laser Science 2023 (FiO, LS), Technical Digest Series (Optica Publishing Group, 2023), paper FTu6D.5. https://doi.org/10.1364/FIO.2023.FTu6D.5

### See Also