You can design and simulate a perfect optical system, but without a flawless mechanical support the system won’t focus properly, and you won’t be able to reliably assemble or adjust it. Optomechanical design ensures your optical system performs as designed in the real world. It is also important to analyze how small manufacturing and assembly errors in both optical and mechanical components affect the performance of an optical system. It ensures that even when parts aren't perfect, the system still meets its functional and performance goals such as resolution, beam alignment, or image quality. Optomechanical tolerancing is the process of analyzing and specifying acceptable limits for mechanical and optical components in a system so that the final product performs as intended. Optomechanical tolerancing should be performed following the ideal optical design but before you lock in the mechanical design or start manufacturing. Tolerancing is the bridge between optical design and real-world production.
Ansys optics tools help you perform comprehensive optomechanical tolerancing given your system packaging design.
Overview
Understand the simulation workflow and key results
Ansys Zemax OpticStudio provides you with a powerful optical tolerancing module especially for classical lens systems and imaging optics. It's integrated, statistically robust, and designed to help you bridge the gap between design and manufacturing. Optical tolerancing using Zemax OpticStudio is a crucial process in optical design to ensure that your optical system performs well, even with variations due to real-world manufacturing processes. Tolerancing evaluates how sensitive an optical design is to small deviations in optical specifications such as lens curvature, thickness, spacing, refractive index, wedges, and surface irregularities.
You can read more information about optical tolerancing in Zemax OpticStudio in this knowledgebase article: How to perform a sequential tolerance analysis – Knowledgebase
Zemax OpticStudio has recently introduced an optomechanical tolerancing wizard that allows users to define their tolerances for complex optomechanical setups in a more comprehensive way. This will include defining nested tolerances as well as selecting a specific alignment method with the corresponding accuracies being filled in in the Tolerance Data Editor. Mechanical Pivot Points and nested lens groups can be created without needing to manually define coordinate breaks and user-defined operands.
In this article, however, we use Ansys Speos Optimizer to implement optomechanical tolerancing, considering mechanical features such as mounts, fasteners, and pivots affecting optical alignment, where you can define the tolerance parameters in an interactive CAD-based environment. The Speos Embedded Optimizer is designed to automate and improve optical system designs using intelligent optimization strategies. Supporting multiple optimization algorithms, Speos enables solving complex, multi-variable, non-linear optical problems. Multiple tolerancing criteria including maximum efficiency, minimum hotspots and minimum illumination pattern variation can be defined simultaneously.
Important Model Settings
Step 1: Export the lens design from Zemax OpticStudio using “Export Optical Design to Speos”.
You can use the Export Optical Design to Speos tool to save the OpticStudio lens file to an .ODX file, which can be imported into Speos for advanced stray light analysis or optomechanical tolerancing. The .ODX file is saved to the folder of the active lens, with the same name but an .ODX extension.
- In the Export section of the File tab click "Export Optical Design to Speos" and save the .ODX file in the project folder.
2. In Ansys Speos 2025 R1 click on the “Optical Design Exchange" in the Components group located under the “Light Simulation” ribbon.
3. A new "Optical Design Exchange Component.1" feature will be created in the Simulation panel. Through the “Optical Component” section of the Definition panel navigate to the "Heliar 37mm SEQ.odx" file. You may keep the "Axis System” default (The Global Coordinate Reference will be the same as that of set in the OpticStudio lens file).
4. Meshing parameters can be accessed through the options (right click) on the ODX feature. Meshing quality affects the simulation performance and the quality of the produced results. It is recommended to set the following meshing values for optical imaging systems. Additional information about the meshing can be found in the “Important Speos Model Settings” section.
Tip: You can export the meshing settings of the ODX component as a Speos "Preset" and set them as a default to save time for future projects.
5. Click "Compute" to start the import process. The Optical Design Exchange feature imports the lenses geometries, optical properties and Imagers. The corresponding CAD components will be added to the SpaceClaim Structure tree.
Step 2: Import the mechanical packaging and set up the optical system for optimization.
The optomechanical packaging design can be imported into Speos in either step format or native CAD. It is recommended to export the packaging CAD file using the same coordinate system as the Optical Design Exchange. Otherwise, you may need to Move and Anchor the packaging coordinate system to the ODX global reference to properly position the packaging with respect to the lens stack.
In the next step of simulation, you need to create sources corresponding to field points. A surface source can be defined at the Object plane for each field point as follows. According to the OpticStudio lens file, the Object plane is located 140.5mm before the first lens front face. The off-axis sources are 50.02mm away from the on-axis source, and the off-axis chief ray angle at the object plane is 18.15 degrees (the source surface normal should be aligned with the corresponding chief ray.).
Run and Results
You may run a direct simulation including all the sources, sensors, optical and optomechanical components. The Direct Simulation will propagate the number of rays defined with the stop condition from sources to sensors through the optical system
Step 3: Set up tolerancing parameters and criteria and run tolerancing
Optimization in Speos can be done in 3 different approaches:
- Optimization with Ansys Workbench: Speos building block is directly integrated into Ansys Workbench and can be used to optimize a design or create multi-physics analyses.
- Embedded Optimization: can be implemented in three optimization modes including Random Search algorithm, Design of Experiment, and Plugin.
- Optimization with optiSLang: You can define the criteria in the parametric system and follow up to set up the variation analysis using the available wizards.
In this example we use the embedded optimizer for tolerancing. To implement tolerancing you first need to define the tolerancing parameters according to the system requirements. Optomechanical Tolerancing parameters are mostly related to the mechanical packaging and mounting set up such as tilts and decenters of lens groups with respect to mechanical pivot points, airgaps variations and sensor misalignments.
Tolerancing parameters can be defined as Optimization Variables including Speos Simulation parameters, Speos Design parameters, SpaceClaim Document parameters. You can set the mechanical dimensions of the optical and optomechanical components as input parameters in SpaceClaim to be selected as Document Variables in optimization process. Input parameter can be either a Driving Dimension which is a parameter that has effect on the size or the position of an element, or a Script Parameter that you created and used in a SpaceClaim script.
Tolerancing analysis needs to be implemented according to a criterion. Speos optimizer allows for defining multiple criteria such as spot size and displacement, contrast or system MTF. You can define multiple measures to be used as targets in the optimization. The optimizer creates a merit function given all the weighted measures that can be either minimized or maximized. For tolerancing analysis, you need to maximize the merit function to push the simulation measurement as far as possible from the target values.
Random search algorithm is a global optimization method that can be used to generate a series of random lens files with parameters values within the specified tolerances and assess the criteria. For sensitivity analysis, however, you can use the Design of Experiment mode which allows you to strictly define the values of the variables you define through an Excel File generated after the variables selection.
- Define the tolerance parameters including pivoting tilts/decenters and airgaps. You need to first select the lens group. In the Design tab, from the Edit group click “Move” tool. Select all the lenses in the “Optical Design Exchange”. Anchor the Move handle to the pivot point such as the internal corner of the indentation on the outer surface of the barrel. Click the rotation axis around Y on the move handle and then click Ruler in the Options panel or the mini-toolbar. Select the vertical support face of the barrel face where you want to define the tilt reference. Now click Create Parameter on the Groups panel to define the tilt angle as a parameter.
Using the same approach, you can define tilt/decenter tolerance parameters for all other lens groups with respect to the corresponding mechanical pivot point, considering the mechanical packaging set up, as Driving Dimensions in the Group panel.
2. In the Direct Simulation section click the xmp file to open the irradiance results in the virtual photometric lab. Define a circular Measure area around every single spot on the imager and create all Measure parameters you want to include in the tolerancing criteria including Flux, Barycenter X/Y. Sigma, Contrast, ….
3. In the File tab of the virtual photometric lab, select Export template to create and save the template you made. In Speos, you can load the template as XML file in the sensor that generated the result. As such you will be able to access the measures and select them as targets in the optimization, or criteria for tolerancing.
4. To create an optimization, from the Light Simulation tab, click Optimization. In the General section, select the Random search as optimization mode to run the optimization algorithm based on the defined Merit function (You can also select “Design of Experiment” for sensitivity analysis.). For tolerancing you need to select “Maximize” merit function to get the simulation measurement as far as possible from the target values. Set “Use maximum number of simulations” to True and define the number of Monte Carlo simulations. Monte Carlo trials results can be kept during the optimization process if you turn “Keep intermediate results” on.
5. Select the Document variables tab through the Variables panel in the Optimization Definition and click + to open the Document variables list. Select the tolerance parameters and set the Min/Max values of the variables in the Variables panel.
6. You can also select the tolerancing criteria from the Target list on the Variables panel. Speos will form a merit function given the measure current value, target value and weights. Several measures can be targeted either for a single field or multiple field points. In the Targets tab, for each target, set the Target value and its Weight. There is not a certain target for a measure when maximizing the merit function but by setting a target value of 0, for instance, you can direct the optimization process to maximize the merit function.
7. In the Simulation tree, right-click the optimization feature and select Compute or GPU Compute to run the optimization. Speos generates a report file including the summary of all the variables, targets, parameters, the tolerancing criteria for all Monte Carlo trials, and the best solution which holds the maximum merit function.
You can find the HTML report under the SPEOS output files folder of the project.
Conclusion
The new feature of “Optical Design Exchange” has enabled significant system level analysis of optical systems designed in Ansys OpticStudio such as stray light analysis and optomechanical tolerancing. A live version of optics in ODX format can be integrated with the mechanical systems to be analyzed using the exclusive optical tools in Speos which works seamlessly within our in-house CAD platform like Ansys SpaceClaim. Ansys Speos provides you with an interactive platform for tolerancing your optical system under the impression of the optomechanical packaging and assembling setup. You can precisely select the mechanical pivot points for all the lens groups and set the tilt/ decenter tolerance parameters accordingly for all degrees of freedom through the graphic area. Multiple criteria can be defined for tolerancing based off a single merit function formed by the Speos optimizer. Speos generates a comprehensive report of the Monte Carlo files including tolerancing setup, measures and merit function values which extremely facilitates the system evaluation process.
Additional Resources
Additional documentation, examples and training material
Relevant Speos Ansys Learning Hub courses
- Speos Getting Started
- Speos Workflow & Geometry Management
- Ansys Speos Stray Light Analysis
- Ansys Speos Embedded Optimizer
- Optical Design Exchange
You can also read more information about optical tolerancing using Ansys Zemax OpticStudio here:
- How to perform a sequential tolerance analysis – Knowledgebase
- How to perform a Non-Sequential tolerance analysis – Knowledgebase
- How to accelerate your tolerance analysis - webinar – Knowledgebase