Hello!
I have created a complex system. It consists in a multiconfiguration system with around 700 optical surfaces (multiple mirrors, some of them ignored with multiconfiguration operands, and lots of coordinate breaks), 240 tolerance operands (16 are compensators) and the tolerance is also launched with a self-edited merit function.
From my experience, the compensators have always increased a lot the time of the tolerancing, but in this case, which such a complex and huge system, it takes too much, I would like to ask about how zemax does the search for the global minima with the compensators in order to reach the requirements and how could I optimize my process (ZPL, ZOS-API, just launch the simulation in a different computer...)
Best regards
Solved
How to reduce the time of tolerancing with compensators?
Best answer by MichaelH
Hi Bozkov,
When OpticStudio performs a tolerance analysis, the steps are relatively simple:
- Perturb all the values defined in the Tolerance Data Editor. This is typically changing a single value in the Lens Data Editor, but some operands might perturb a different value.
- Set all compensators as variables in the Lens Data Editor.
- Build a Merit Function based on the Criterion or use the User Defined Merit Function
- Perform a local optimization (if selected)
- Report the Merit Function Value
So the tolerancing method isn’t that complex but based on your setup it could take a long time. Before recommending some speed improvements, I would ensure that you run & save a single Monte Carlo tolerance to ensure you fully understand what OpticStudio is doing to modify your nominal system in order to perform the tolerance. In the Tolerancing window and the Monte Carlo tab, set the # Monte Carlo Runs and # Monte Carlo Save to 1, click Ok and then open the file.
I would try the following steps to speed up the tolerancing analysis
- Close all other applications that might be using extra cores so OpticStudio gets all the power of your computer
- Make sure your tolerance operands are realistic and you’re not making either these perturbations or compensators too large. If the perturbations are too large, you might be skipping to different local minimums in solution space and causing the optimizer to take a long time.
- If you’re just running a Monte Carlo (MC) run, set the Mode to Skip Sensitivity
- If your Criterion is set to Merit Function, make sure your MF is efficient for tolerancing. Remove any operands with a 0 weight since this will take extra time to calculate. Avoid using long running operands like POPD or really high sampling.
- If your Criterion is set to any of the MTF options, change this to Merit Function and use the Optimization Wizard to build a Contrast optimization at the given frequency; the OPD minimization of Contrast optimization is orders of magnitude faster than the FFT MTF calculation and will still produce the best system for a given frequency.
- Try a MC run with the Comp set to Paraxial Focus. This will maintain the constant offset of paraxial-focus-to-image-plane that your nominal system will have. For small compensator values, this will provide a relative measure of the best & worst performing systems and you can open individual systems, run an optimization, and get the absolute performance.
- If your Comp is set to Optimize All, make sure to select DLS and not OD. The DLS algorithm is better suited for continuous merit functions & sequential mode while OD is better suited for discrete merit functions (those with pixels) & non-sequential mode.
- If your Cycles is set to Automatic, try changing it to a finite number of cycles. This will prevent a long running optimization. For small perturbations, this is perfectly valid but for the final analysis, you might need to run a full optimization on your down-selected design based on how it will be assembled (if the compensator is drop-in & small adjustment then a finite number is fine but if this is a one-off system with precision compensators, then you’ll have to run an Automatic optimization on the down-selected design).
- Make sure a single system update is as fast as possible:
- Avoid using a Maximum solve on the Clear Semi-Diameter. There was a previous bug that caused a really long system update that might or might not be fixed in your version of OpticStudio
- If your Stop is the first surface, turn of Ray Aiming (the Entrance Pupil and Stop are collocated in Object Space so there is no need for Ray Aiming)
- Make sure your Aperture Type is Float By Stop Size (this is the only setting that doesn’t require additional calculation)
- Make sure your Field Type is set to either Angle (infinite conjugate) or Object Height (finite conjugate). If your Field Type is defined in Image Space, then OpticStudio needs to perform additional calculations to trace rays & perform the tolerance.
- If you’re using Polarization, try turning Polarization off for the tolerancing run and then only using Polarization for post-processing. Most operands don’t consider polarization but this setting might cause 2 rays to be traced when only 1 ray is needed for tolerancing.
- When possible, replace any Merit Function optimization with a solve in the Lens Data Editor. This typically won’t apply for tolerancing but is a good general rule to follow...solves are always deterministic.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.