In this article, we introduce a simulation workflow to analyze the optical performance of an Augmented Reality (AR) Heads-Up Display (HUD) using a diffractive waveguide for automative applications. The workflow to design the complete AR Waveguide HUD involves multiple software applications, as the projection lens system is designed in Ansys Zemax OpticStudio, the Surface Relief Gratings (SRGs) of the waveguide are designed in Ansys Lumerical FDTD, and then both the optical system and gratings are integrated together in Ansys Speos to perform system-level optical analysis. This example mainly covers Ansys Speos part of the workflow.
Overview
Understand the simulation workflow and key results
AR HUD provides driver support by displaying useful information directly in the driver’s field of view. Compared to mirror-based AR HUD systems, AR HUD using diffractive waveguides are smaller and thus easier to integrate into various types of cockpits where space is always limited.
This article demonstrates how to use Ansys's complete optical solution to design and analyze an AR HUD formed by a pupil expander waveguide with input and output surface relief gratings; we import the optical lens system information from Zemax OpticStudio and optical grating information from Lumerical into Speos to do system-level performance analysis of these systems, as they will need to operate in the real-world with human perception. This interoperability workflow captures the interplay between the nanoscale structure of the gratings and the macroscale structure of the projection lens system when using Speos to simulate the entire AR optical system within a 3D environment. You can optimize the components and construct an accurate perception of the 3D scene with lifelike illumination and photometric/radiometric physically unbiased rendering.
Here are the steps we will follow to model the complete HUD. Each of these steps will be performed in one of the three software applications from Ansys’s optical solution suite:
Step 1: Projection lens system design in Ansys Zemax OpticStudio (not covered in this article)
Ansys Zemax OpticStudio is used to design the projection lens system and export the optical system to Speos using the " Export Optical Design to Speos ” (*.odx) feature
Step 2: Gratings design in Ansys Lumerical (not covered in this article)
Ansys Lumerical RCWA (Rigorous Coupling-Wave Analysis) or FDTD (Finite Difference Time Domain) can be used to model the diffraction grating surfaces that scatter light to the supported grating orders and export the grating surface model using a JSON file.
Step 3: Integration and system-level analysis in Ansys Speos
We leverage Ansys Speos for in-depth system-level analysis, by seamlessly and accurately integrating the projection lens model via Optical Design Exchange (*.odx) capability, along with incorporating subwavelength diffraction grating surfaces for the couplers via a JSON file. Utilize GPU/CPU computation for accurate non-sequential ray tracing analysis and generation of photometric/radiometric results, including spectral irradiance and radiance maps. Validate the AR system's performance by considering human perception for comprehensive analysis.
This example mainly covers the Ansys Speos part of the complete workflow. Note that the attached Ansys Speos demo data is compatible with Speos 2025R1 or higher.
Run and results
Instructions for running the model and discussion of key results
Step 1: Projection lens system design in Ansys Zemax OpticStudio (not covered in this article)
The design of the projection lens system has been done with Ansys Zemax OpticStudio. This system includes a three-lens system to achieve precise light collimation. The two doublet lenses help reduce chromatic and spherical aberrations, essential for maintaining image clarity across the HUD’s field of view. The field of view is 22° and there is 45mm between the source and the first lens.
For more information regarding lens design techniques and capabilities in Zemax OpticStudio, please visit the
Zemax Knowledgebase
or
Ansys Learning Hub
.
Because the system-level analysis will be performed in Ansys Speos, the lens design needs to be transferred from Ansys Zemax OpticStudio to Ansys Speos. For that, the Optical Design Exchange feature is recommended. The *.odx file generated contains the lens geometries with their position and orientation as well as their optical properties (materials and coatings).
You can use the *.odx file provided in the Zemax Data folder, or follow these steps to export it:
- In Ansys Zemax OpticStudio, open Projector.zmx from the folder named Zemax Data.
- Click on Export Optical Design to Speos button in File/Export menu.
- Save the *.odx file with a custom path and name.
Note: In case you don’t have access to Zemax OpticStudio 24R1, or your lens system is not supported by this feature in Ansys Zemax OpticStudio, you can still export the lens system as a STEP file from Ansys Zemax OpticStudio, import it into Ansys Speos, and apply optical properties.
Step 2: Gratings design in Ansys Lumerical (not covered in this article)
This AR HUD relies on a 1-dimensional diffractive waveguide for which two gratings are needed: the in-coupling grating to make rays enter the waveguide, and the out-coupling grating to make rays exit the waveguide after being propagated thanks to total internal reflection.
In this article, we are using surface relief gratings for both in-coupling and out-coupling gratings. They have been simulated using the RCWA solver of Ansys Lumerical software. The diffraction properties of the in-coupling and out-coupling gratings are saved in JSON data files which are imported into Ansys Speos, in addition to a generic plugin .sop file, as surface properties to model the behavior of the subwavelength structures in a ray tracing simulation.
Both gratings have been optimized for a wavelength of 530nm and a refraction index of 1.52. They have the following properties:
-
In-coupling grating:
- Incident Angles: θ = 65° and φ = 0°
- Output Angles: θ = 43.1° and φ = 0°
- Period: d = 4 µm
- Optimized grating order: m = 1 (θ_1 = 43.1°)
-
Out-coupling grating:
- Incident Angles: θ = 43.1° and φ = 0°
- Output Angles: θ = 0° and φ = 0°
- Period: d = 0.51 µm
- Optimized grating order: m = -1
For more information regarding the generation of gratings as JSON files, please visit
Lumerical Sub-Wavelength Model plugin: Introduction and Data Generation
. For more information regarding the usage of these gratings in Speos, please visit
Lumerical Sub-Wavelength Model plugin: Usage in Speos
Both grating files (*.json) and the plugin file (*.sop) are located in the folder named
Lumerical Data
. These files can be imported into Ansys Speos as a surface property to model the behavior of the subwavelength diffractive optical elements of the AR system.
Step 3: Integration and system-level analysis in Ansys Speos
Now that the projector system and gratings have been designed and exported, we need to use Ansys Speos to assemble the complete AR HUD system and perform system-level analysis. For that, we need to finish the setup by adding additional geometries, such as the windshield and the waveguide, by importing the projection lens system coming from Ansys Zemax OpticStudio, and by applying gratings coming from Ansys Lumerical as optical properties on the waveguide. Once the data preparation is finished, we will be able to analyze the system by setting up and running simulations.
1 – Additional geometries
Regarding the additional geometries, they can be imported or designed in Ansys Speos:
- An automotive windshield has been imported
-
The waveguide has been designed as follows:
- Waveguide Dimensions: 140 mm × 21 mm with a thickness of 2 mm
- In-Coupling Grating Size: 10 mm × 15 mm
- Out-Coupling Grating Size: 120 mm × 15 mm
- Housing geometry has been designed to avoid light leakage around the projection system and around the waveguide
The first step has already been done, and you can retrieve the data from the folder named Speos data and open HUDWaveguide_Start.scdocx file in Ansys Speos.
2 – Import Optical Design Exchange
The next step is to import the *.odx file, containing the projection lens system, coming from Ansys Zemax OpticStudio.
- Click on “Optical Design Exchange” component in Speos ribbon: the component is created, and the definition panel is opened.
- Select ODX.Origin, ODX.X Axis and ODX.Y Axis for the axis system.
- Browse Projector.odx file generated previously (or the one provided in the Zemax data folder).
- Compute the feature: lenses and stop geometries appear in the 3D view and in the Speos tree.
- By editing one lens, you can access to the read-only parameters that have been defined in Ansys Zemax OpticStudio.
3 – Apply grating
The third step is to import the grating files (*.json and *.sop) coming from Ansys Lumerical as optical properties in Ansys Speos.
Creation of the material
-
In-coupling grating:
- Create a new material by clicking on Material from Light Simulation ribbon
- Rename it “Waveguide_InCoupling”
- Select the In-coupling face of the waveguide
- Set Use texture to True
- Edit the Surface layer #1
- Set Plugin as Type Surface properties and select lumerical-sub-wavelength-2024R2-2-20241008-016c7234a8.sop as File and input_new.json as Parameters (you can find the files in Lumerical data folder)
- Set Texture image type to “From file”, select PlainWhite.png file from Speos Input files folder and set width to 1 mm.
-
Out-coupling grating:
- Redo the same steps to apply output_grating_period_0.51.json on the out-coupling face of the waveguide.
Creation of the UV Mapping
UV Mapping features are used to orient the image files defined in textured materials.
-
In-coupling grating:
- Create a new UV mapping by clicking on UV mapping from Light Simulation ribbon
- Rename it “UVMap_InCoupling”
- Select the In-coupling face of the waveguide
- Edit UV map.1
- Select the InCoupling.Origin, InCoupling.Z axis and InCoupling. X axis as Origin, Projection direction and Top direction.
-
Out-coupling grating:
- Redo the same steps to orientate the out-coupling grating.
Gradient Mask
A gradient efficiency can be applied on the out-coupling face of the waveguide to increase the homogeneity of the final result. Another surface layer with a gradient texture is added and acts as a mask.
-
Out-coupling gradient:
- Right click on Waveguide_OutCoupling material and select “Add new surface property”
- Edit the Surface layer #2
- Set Texture image type to “From file”
- Select the gamma mask.png file from Speos Input files folder
- Set Width to 360 mm
- Set UV map index to 2
4 – Set up the simulations
In addition to the geometries and materials, sources and sensors need to be defined to run the simulations.
Three sources have been created:
- A display source which represents the PGU. The source is monochromatic; 530 nm is the wavelength for which the gratings have been optimized. It is a narrow source (12.5 mm in X direction and 0.4 mm in Y direction) because the waveguide is one-dimensional. A 2D version can be designed but, in that case, a third grating is needed.
- An environment source defined by an *.exr file representing the road.
- A natural light source which represents the sun at a critical position.
One sensor has been created:
- A radiance sensor which represents the driver’s vision. The focal has been set to 7 meters, and the field of view is 24° x 13°.
5 – Run the simulations
Three simulations have been created; they are all inverse simulations, which means the propagation is done from the sensors to the sources. All results will be analyzed separately and then merged into a unique result.
-
Inverse_PGU:
- To simulate the Head-Up-Display system
- It contains all geometries and the PGU source
-
Inverse_Env:
- To simulate the exterior environment
- It contains all geometries and an environment source
-
Inverse_Sun: One with a natural light source to simulate the sun
- To simulate a critical position of the sun
- It contains all geometries and a natural light source
As rendering simulations can be long to compute, it is preferable to use GPU algorithm over CPU algorithm to run the simulations included in the project. This step is optional as the results are already available in Speos output files folder.
6 – Analysis of the results
Inverse_PGU
- From Speos output files folder, open Inverse_PGU.Radiance.xmp in XMP Viewer.
By zooming on the generated image, we can observe the distortion coming from the curvature of the windshield as well as the ghost image coming from the inter-reflection between the two surfaces of the windshield.
- Open the Measures tool and adjust the area of interest to perform measurements on the desired area of the sensor, such as luminance or colorimetric values.
Designing an AR system often involves a trade-off between high efficiency, a wide field of view, and good color uniformity. The following explains how these parameters can be measured using Ansys Speos.
With the Measure tool, you can easily retrieve the
efficiency
of the system by calculating the ratio between the input and output luminance which is the ratio of the luminance of the display source (the value entered in the definition is the luminance of the brightest pixel of the image) and the luminance value of a lit pixel on the result.
Field of View
An efficient way to measure the field of view (FOV) is by using the “User line” shape measurement. The approach depends on the radiance sensor type:
- If the sensor is defined "from observer", the XMP represents an angular map. In this case, the "User line" measurement directly provides the FOV in degrees.
- If the sensor is defined "from frame", the XMP is expressed in millimeters. Here, an additional calculation is needed to determine the FOV using the formula: FOV = 2×arctan(x/(2×f)), where x is the image size and f is the focal length.
Rgearding
color uniformity
, the Measure tool allows you to extract values from a wide range of color coordinate systems, including xyY, uvY, and Lab. These values can then be used in formulas—for example, to calculate the ratio between the minimum and maximum values in order to assess uniformity.
Inverse_Env
- From Speos output files folder, open Inverse_Env.Radiance.xmp in XMP Viewer.
If we examine this result closely, we can distinguish a darker area in the lower part, which corresponds to the “non-reflection” of the source on the opening in the dashboard. This opening allows the light coming from the waveguide to pass through the dashboard and generate the virtual image.
In the next part, we will exacerbate this phenomenon by creating a source which represents the sun at an orientation for which the reflection on the dashboard is maximized.
Inverse_Sun
Before analyzing the result of Inverse_Sun simulation, here are the steps that have been followed to find the critical orientation of the sun:
- Create a source on the eye box
- Create a conoscopic intensity sensor with the separation by layer activated
- Run a direct simulation with all the geometries, the source and the conoscopic sensor with Light Expert activated
- Open the *.lpf file: the rays are displayed in the 3D view
- Select the layer for which the rays reflect on the HUD cover and / or waveguide.
- Right click on the simulation and select export rays.
- Use one of the rays to define the axis of the natural source.
With this orientation, the sun will directly light the dashboard then the driver will see the dashboard being reflected on the windshield but not the area which corresponds to the opening of the HUD cover.
More details on the straylight analysis are available on the Ansys Learning Hub:
Head Up Display Straylight Analysis in Ansys Speos Software
.
- From Speos output files folder, open Inverse_Sun.Radiance.xmp in XMP Viewer.
We can distinguish different phenomenon:
- The white area comes from the rays that hit the Lambertian dark leather dashboard and then are reflected by the windshield
- The pure black area comes from the rays that hit the grating defined on the waveguide and are not being reflected
- The grey u-shape area comes from the rays that hit the cover of the HUD and then are reflected by the windshield. A Vantablack material has been applied on the cover which limits greatly the reflection but doesn’t prevent it completely.
Light Expert tool can be used to analyze in the 3D view the light paths of the rays contributing to a measured zone on the result.
Merge of the three results
Thanks to the Photometric Calc Editor , it is possible to merge the results coming from the three simulations. By using the union operation, the three sources will remain independent, allowing the use of Virtual Light Controller to modify the sources in post processing.
- From Speos output files folder, open Radiance_Union.xmp , which corresponds to the union of the three results, in Human Vision Lab.
- Open the Virtual Lighting Controller tool and modify the power of the sources to see the immediate impact on the result.
Important model settings
Description of important objects and settings used in this model
Projection lens system design in Ansys Zemax OpticStudio
The main specifications regarding the projection lens system are:
- The total field of view is 22°
- The total length of the system is 106 mm
- The distance between the source and the first lens is 45mm
- The entrance pupil diameter is 10mm
Gratings design in Ansys Lumerical
The main specifications regarding the input and output coupling gratings are:
-
In-coupling grating:
- Optimized Wavelength: λ = 530 nm
- Refraction index: n = 1.52
- Incident Angles: θ = 65° and φ = 0°
- Output Angles: θ = 43.1° and φ = 0°
- Period: d = 4 µm
- Optimized grating order: m = 1
Notes:
- For a refraction index of 1.52, the total internal reflection appears from an angle of 41.14°.
- Thanks to the following equation, we can calculate the refraction angles of the grating’s orders (m):
$$n_{2}×sin(θ_{m})=n_{1}×sin(θ_{i})+m×λ/d$$
|
Grating Order |
$$θ_{-2}$$ |
$$θ_{-1}$$ |
$$θ_{0}$$ |
$$θ_{1}$$ |
$$θ_{2}$$ |
$$θ_{3}$$ |
$$θ_{4}$$ |
|
Refraction Angle |
24.9° |
30.6° |
36.6° |
43.1° |
50.4° |
59.1° |
70.9° |
|
Propagation? |
x |
x |
x |
✓ |
✓ |
✓ |
✓ |
-
Out-coupling grating:
- Optimized Wavelength: λ = 530 nm
- Refraction index: n = 1.52
- Incident Angles: θ = 43.1° and φ = 0°
- Output Angles: θ = 0° and φ = 0°
- Period: d = 0.51 µm
- Optimized grating order: m = -1
Integration and system-level analysis in Ansys Speos
The main specifications regarding the sources and sensors used are:
-
PGU (surface source):
- Dimensions: 12.5 mm x 0.4 mm – it is a narrow source as the waveguide is 1-dimensional
- Flux: 1000 cd/m² – the flux can be modified in post-processing thanks to the Virtual Light Controller
- Intensity: Lambertian with a total angle to 20°
- Spectrum: a *.spectrum file centered on the 530nm
-
Environment:
- Luminance: 1000 cd/m²
- Image file: a *.hdr file representing a road
-
Sun (natural light source):
- Sun set to a critical orientation
-
Radiance sensor:
- Focal: 7 meters
- Dimensions: 3m x 1.6m
- Resolution: 1mm x 1mm
Taking the model further
Information and tips for users that want to further customize the model
As mentioned before, the waveguide used in this example is 1-dimensional. To take the model further, user can model a 2-dimensional waveguide, including an additional grating that folds the rays. Also, the waveguide is monochromatic, but it possible to model the three RGB layers.
Also, an observer sensor can be used to simulate the perception from different points of the eye box. Then it will be possible to compare the results perceived from different viewpoints.
Finally, to consider the true perception of the eye according to the set depth of field, the radiance sensor can be replaced with
human eye sensor
and further optimizations can then be done to adjust the performance.
Additional resources
Additional documentation, examples and training material
- Augmented Reality Optical System
- How to simulate exit pupil expander (EPE) with diffractive optics
- Lumerical Sub-Wavelength Model plugin: Introduction and Data Generation
- Lumerical Sub-Wavelength Model plugin: Usage in Speos
- Surface Relief Grating for Augmented Reality System
- Curved Waveguide Design with Holographic Couplers – Ansys Optics