How to use Ray Aiming


This article explains:
  • What Ray-aiming is
  • When it is needed and how to use it

This article includes examples using a sample lens file.

Authored By: Nam-Hyong Kim

What is Ray-aiming?

The Ray-aiming is an iterative ray tracing algorithm in Zemax that finds rays at the object that correctly fill the stop surface, for a given stop size. It is generally only required when the pupil, the image of the stop as seen from the object space, is considerably aberrated or shifted/tilted.

The Ray-aiming option is specified under System > General > Ray Aiming menu.

Without Ray-aiming, real rays from the object are aimed at the paraxial entrance pupil; the paraxial image of the stop seen from the object. The size and the location of the entrance pupil is reported under the general section of the Prescription Data (Report> Prescription Data in the main menu). If there are no optics between the object and the stop surface, or if the aberration introduced by the lenses between those surfaces is negligible, then the real and paraxial marginal ray height at the stop surface will be very close, hence no pupil aberration.  In this case, Ray-aiming is not required and enabling it will only slow down the raytrace without any increase in accuracy. Only use Ray-aiming when necessary!



Pupil Abberation Fan
To find out if a system has significant pupil aberration use the Pupil Aberration Analysis under Analysis > Fans > Pupil Aberration. As a rule of thumb, if the maximum pupil aberration is more than few percent, Ray-aiming is generally required.

The following images show the pupil aberration plot for a system with significant pupil aberration.


Ray-aiming Off



Ray-aiming On



Example with moderate pupil abberration

Open the Double Gauss 28 degree field.zmx sample file in Zemax/Samples/Sequential/Objectives folder.

Lets suppose that this file represents a camera lens in which the stop semi-diameter is known to be exactly 10 lens units. The system aperture can be then be defined as “float by stop size", thus the semi-diameter value in the Lens Data Editor determine the size of the system aperture; a proper choice when the size of the stop is known.

The system aperture type can be defined under System >General>Apertures

Set the system aperture to “float by stop size”.



The stop semi-diameter can be manually set to 10 lens unit in the Lens Data Editor.



Example with moderate pupil abberration cont.

If you zoom in close to the edge of the stop surface in the layout, you can see that the marginal rays do not land exactly on the edge of the stop.



This is because without Ray-aiming, the rays from the objects space are aimed at the entrance pupil; the paraxial image of the stop as seen from the object space. The paraxial calculation for entrance pupil size and position considers only the power of the optics between the object and the stop surface and  not the aberration. Ideally, when ray tracing, only rays that land on the correct stop coordinates should be chosen to property sample the system aperture. For example, the very definition of marginal ray requires it to intersect the edge of the stop rather than away from it.

The pupil aberration plot shows a maximum value of 3% with Ray-aiming off, indicating that Ray-aiming may not be necessary. Users need to always consider the trade off between the increased ray trace accuracy vs. computational time, when using Ray-aiming is optional. In general, Ray-aiming will decrease the ray trace speed roughly by factor of 2  to 8.

Now, lets turn the Ray-aiming to “Paraxial” and observe the change in the layout.

The Ray-aiming algorithm iteratively finds the rays in object space that will yield the desired stop surface coordinate. The layout shows all marginal rays intersecting the exact stop semi-diameter. The aberrations are still present but they are accounted for when choosing the rays to sample the stop. Ray-aiming does not remove the pupil aberration but rather accounts for it when choosing input rays.

 



Example with significant pupil abberration

This example shows a case where Ray-aiming must be used. Open the included sample file Ray Aiming sample 2.zip and set the Ray-aiming to “off”.

You will notice that all the rays from the object space, i.e. before surface #4, are aimed at the paraxial entrance pupil. The entrance pupil position in the Prescription Data is in surface #1 coordinate system, hence in this example it is 1.82915 lens unit (mm for this file) right of surface #1.

The semi-diameter of the stop surface is set automatically in the Lens Data Editor to allow real marginal rays from all fields and wavelength to pass the stop. Note that with Ray-aiming off, none of the rays from field #3 can even reach the stop surface, since given the incident angle the rays cannot travel through all surfaces prior to stop; a requirement in sequential ray tracing. 

Before Zemax can aim the rays to properly fill the stop, the size of the stop has to be determined first, unless explicitly specified by using “float by stop size” aperture type (for this file, the system aperture type is Entrance Pupil Diameter).  With "Paraxial" Ray-aiming, the size of the stop, to which the rays are aimed at, is determined by the paraxial marginal ray height at the stop surface. To find out this value, even without Ray-aiming, open the Ray Trace Calculation under Analysis > Calculation > Ray Trace, and by clicking Settings in the menu, set the field to 1 and pupil coordinate to Px=0 and Py=1; the on axis marginal ray. Under the paraxial ray trace data, the Y height at the stop is reported as being 0.424799 and under the real ray trace data 0.43225. This difference between the real and paraxial marginal ray height is much larger for field #2 as evident from the ray trace calculation and the 2D layout above.



Example with significant pupil abberration cont.

Now, lets turn the Ray-aiming back to “Paraxial” (not “Real”). The difference between the real and paraxial Y marginal ray coordinate at the stop surface is practically zero, as reported in the raytrace calculation, for all fields and wavelengths.

Ray-aiming Paraxial

As mentioned previously, with Ray-aiming set to “Paraxial”, the real marginal rays intercepts the “paraxial” stop surface height. Sometimes a user might want to specify the size to the stop that the real ray should fill, just like the previous Double Gauss example. To explicitly specify the location where the real marginal ray should intercept at the stop surface location, in addition to Ray-aiming, the system aperture type can be set to “float by stop size” (System >General> Aperture) and semi-diameter values for the stop entered manually in the Les Data Editor.

For moderately aberrated systems, the stop size determined using paraxial ray will generally be slightly different than one determined using real rays. Usually, the difference between the paraxial and real stop surface height will be too small for the effect due to the difference to be worth considering. Nonetheless, the “aberrated” option for Ray-aiming under System>General>Ray Aiming uses real rays rather than paraxial to calculate the stop height. This option is almost never necessary since you can set the system aperture type to “float by stop size” and manually set the stop size to explicitly specify where the real rays should be aimed at. We at ZDC have yet to see a clear case where this feature is absolutely needed. Of course, this does not mean that there isn’t a system out there that genuinely requires “aberrated” Ray-aiming, hence the reason it is still available as an option. Please consult the manual carefully before using “aberrated” Ray-aiming. The “Real” Ray-aiming option should not be considered as a superior alternative to "Paraxial" Ray-aiming.

By default the “use Ray-aiming cache” option is checked and the “Robust Ray-aiming” unchecked. These setting should not be modified as they are rarely needed. For more information about these setting, please refer to chapter 6 of the manual.



Decentered Stop

The paraxial ray calculation, used to calculate the entrance pupil size and position, ignores tilt and decenter of surfaces including the stop. Therefore, the vertex of the paraxial entrance pupil is always located along the local Z axis of the object surface. If the stop surface is significantly decentered and/or tilted with respect to the paraxial entrance pupil, Ray-aiming might be needed, even with no optics between the object and stop. See the example in the following diagrams.

Ray-aiming "off"

Ray-aiming "Paraxial"

 Turn ray-aiming on if the stop is decentered with respect to the optical axis (i.e. Z axis of the object surface)



Summary and References

This article has shown the basic Ray-aiming concept and its proper use in sequential Zemax. In summary:

  • Only use Ray-aiming when needed
  • Ray-aiming does not remove the pupil aberration but rather accounts for it when choosing input rays
  • Ray-aiming with “float by stop size” system aperture type can be used to force the rays to fill the user-defined stop size
  •  Systems with decentered/tilted stop might require Ray-aiming

 

References

1. Zemax User Manual .





Attachments


Ray Aiming sample 2.zip Ray Aiming sample 2.zip (2.16 KB, 2 views)



© All Rights Reserved.