In this example, we will look at how to effectively simulate light sources that have transparent materials in front. This is an advanced method to reduce the size of the simulation and improve convergence by first capturing the glass cover into the source itself. This is especially important for camera/LiDAR applications, where the sensor and source lie on the same side of the lens.
Overview
When a source is placed behind one or more materials, it can increase the ray-tracing convergence time, especially for camera and LiDAR simulations. Hence, using up valuable simulation time that does not give us results. To reduce this time, we precalculated the glass cover into the source and hence only the output from the glass surface is our effective source. These emitted rays that exit the cover glass will only interact with the environment and reach the sensor, thereby reducing the time it takes to run the full simulation and getting us a response on the sensor surface. In this example, we have a Speos simulation of a Camera and a static LIDAR module with IR illuminators that use cover lenses. More generically, this is also useful when having a larger simulation system with a light source having a cover lens like a headlamp cover, a windshield, or any other type of light-transmitting cover.
A light source having a lens cover can be reduced by capturing the output from the cover by creating variable exitance or IES which reduces overall simulation time.
Prerequisites:
- Ansys License Manager 2021 R1 or later.
- Ansys Speos 2021 R1 or later. The license needed is the Ansys Speos with OST add-on.
- From Ansys learning hub: The Speos getting Started ALH training with Camera/LiDAR sensor.
In this example, we have a module that consists of both a camera and a LiDAR system, each of which has its own integrated light source. The model is already set up with the proper materials, sources, and sensors, and we will focus on the best-practice to achieve optimal ray-convergence for each system.
Open the project file, [[camera with source behind lens-start.scdocx]] from the start folder.
We have a camera and LiDAR setup with an IR LED illuminator in the middle. We will be using this example to understand how this method of variable exitance is helpful in reducing simulation time.
Example 1: Source for Camera
Let's start by looking at the camera system, which has an integrated infrared (IR) light source and camera. It is required to pre-compute the light source propagation through the cover lens, before simulating what the camera would see.
Step 1: Create an irradiance right in front of the glass
Before we proceed with the sensors let's run a test simulation without the variable exitance technique, to capture the "before scenario."
Double-click on the “sim with glass” direct simulation from the simulation panel. Understand the current setup, and make note of the number of passes (15 passes). Compute the simulation. The result you see will have no light convergence and only a few spots. This indicates that the simulation will require more rays (500 or more passes) to get us a high-fidelity result.
Now, to capture the light from the LED right as it exits the glass cover, we will need to create an irradiance plane and capture the exitance.
Start by creating an axis system at the center of the source but with 0.5mm offset to the glass cover.
Create an irradiance sensor with parameters as shown in the diagram below.
Step 2: Compute simulation with source on the irradiance sensor to capture exitance.
Create a direct simulation, but only include the glass cover in the geometries. For the source, choose the “SurfaceIR” surface source. For the sensor, choose the “Irradiance.1” sensor. Then, compute the simulation with 2e+7 rays.
The irradiance result will appear in the 3D workspace, and the exitance of the Source is captured. Note the file name [[Direct irradiance.Irradiance.xmp]].
Step 3: Creating a source with variable exitance.
We will now create a new source with the same parameters as the original source, but we will have variable exitance by adding the XMP result from the previous direct simulation.
Create a new surface source and name it “SurfaceIR_variable exit”. Set the “variable exitance” to “true” and browse for the file [[Direct irradiance.Irradiance.xmp]] in the output folder which was the result from the previous step. Use the same axis system to orient this as per the irradiance sensor from the previous step.
Use the Radiant Flux of 4 W and also the Spectrum from the original source as shown below.
Once the source setup is complete you should be able to see the rays emit from the exitance created in front of the cover glass.
Step 4: copy and create sim with variable exitance source.
Copy the simulation “sim with glass” and rename it to “sim with variable exit”. Change the source to “surfaceIR_variable exit” (created in step 4).
Compute the simulation and open the [[sim with variable exit.CameraIR.png]] file.
We are able to see that for the same time we did the simulation in step 1, we are now able to see a higher convergence of rays onto the camera sensor.
Example 2: Source for LiDAR
We can use a similar technique to create LiDAR sources that have lens covers. Using the same setup, we will now see how to create a LiDAR source easily by creating an IES file instead of an Irradiance sensor. This IES file will then be the input to the LiDAR sensor.
Step 1: Create an Intensity sensor
Click on the Intensity sensor in the Light Simulation toolbar.
Change the format to IESNA type C
Assign the origin and axes the same as the irradiance axis system which is right outside the glass cover in front of the source.
Step 2: Capture source Intensity using direct simulation.
Create a direct simulation with the LED source, intensity sensor, and the cover glass as geometry.
Compute the simulation and note the resultant file [[XXXXX.ies]].
Step 3: Use the IES file for LiDAR simulations
We will now create a LiDAR sensor and use the IES file created in step 2 as the source.
Important Model Settings
Generally, there are no Speos settings to change. They are all set to default. For the inverse simulation, we want to make sure of the following:
Meshing
Meshing is proportional to face size unless we are looking at very large surfaces such as windshields. They may require a fixed mesh. This can also be done separately with Local meshing.
Inverse Simulation Properties
- The Monte Carlo algorithm is activated, to perform a probabilistic simulation with a randomized algorithm.
- Fast transmission gathering is off (default) since we want to consider light refraction as it passes through the transparent materials.
Taking the model further
Packaging a LiDAR/camera from this is one stage, however, chances are that this is placed in another housing such as behind a windshield or inside a headlamp. We would then have to repeat the above steps to consider the next level of light propagation if the windshield or headlamp lens covers the entirety of the source and sensor. These layers of cover glasses add distortion and act as filters to the LiDAR/camera to avoid noise from any other source that might be within the sensor wavelength range.
Additional Resources
Ansys Learning Hub courses
- Speos Getting Started
- Speos Workflow and Geometry Management
- Speos Camera Sensor Visualization
- Speos LiDAR sensor