www.iap.uni-jena.de
Optical Design with Zemax
for PhD
Lecture 8: Advanced handling
2016-01-27
Herbert Gross
Winter term 2015
2
Preliminary Schedule
No Date Subject Detailed content
1 11.11. Introduction
Zemax interface, menus, file handling, system description, editors, preferences,
updates, system reports, coordinate systems, aperture, field, wavelength, layouts,
raytrace, diameters, stop and pupil, solves, ray fans, paraxial optics
2 02.12. Basic Zemax handling surface types, quick focus, catalogs, vignetting, footprints, system insertion, scaling,
component reversal
3 09.12. Properties of optical systems aspheres, gradient media, gratings and diffractive surfaces, special types of
surfaces, telecentricity, ray aiming, afocal systems
4 16.12. Aberrations I representations, spot, Seidel, transverse aberration curves, Zernike wave
aberrations
5 06.01. Aberrations II PSF, MTF, ESF
6 13.01. Optimization I algorithms, merit function, variables, pick up’s
7 20.01. Optimization II methodology, correction process, special requirements, examples
8 27.01. Advanced handling slider, universal plot, I/O of data, material index fit, multi configuration, macro
language
9 03.02. Imaging Fourier imaging, geometrical images
10 10.02. Correction I simple and medium examples
11 17.02. Correction II advanced examples
12 24.02. Illumination simple illumination calculations, non-sequential option
13 02.03. Physical optical modelling Gaussian beams, POP propagation
14 07.03. Tolerancing Sensitivities, Tolerancing, Adjustment
1. Miscellaneous
2. Vignetting, diameter types, ray aiming
3. Material index fit
4. Lens catalogs
5. Graphical options
6. Slider and visual optimization
7. Multi configuration
8. Data IO
9. Macro language
3
Contents
Object in infinity
- incoming marginal ray parallel to axis
- first distance infinity
- off-axis field only as angle
- no initial NA possible
Image in infinity
- outgoing marginal ray ideally parallel to axis
- explicit declaration: ‚afocal image space‘
- geometrical aberrations as angles
- wave aberration reference is plane wave
- definition of Airy diameter in mrad
Entrance pupil in infinity
- incoming chief ray parallel to axis
- explicit declaration: ‚telecentric object space‘
Exit pupil in infinity
- outgoing chief ray ideally parallel to axis
4
Special Infinity Cases
The Special Infinity Cases
Simple case:
- object, image and pupils are lying in a finite
distance
- non-telecentric relay systems
Special case 1:
- object at infinity
- object sided afocal
- example: camera lens for distant objects
Special case 2:
- image at infinity
- image sided afocal
- example: eyepiece
Special case 3:
- exit pupil at infinity
- image side telecentric
- example: camera lens for metrology
Special case 4:
- exit pupil at infinity
- image sided telecentric
- example: old fashion lithographic lens
5
The Special Infinity Cases
Very special: combination of above cases
Examples:
- both sided telecentric: 4f-system, lithographic lens
- both sided afocal: afocal zoom
- object sided telecentric, image sided afocal:
microscopic lens
Notice: telecentricity and afocality can not be combined on the same side of a system
Cardinal elements of a selected index range
(lens or group)
7
Cardinal Elements in Zemax
In the menue TOOLS – DESIGN – QUICK FOCUS we have the opportunity to adjust
the image location according to the criteria
1. Spot diameter
2. Wavefront rms
3. Angle radius
IN principle, this option is a simplified optimization
Example: find the best image
plane of a single lens
Spot before and after performing the
optimal focussing
8
Quick Focus Option
In the menue TOOLS – DESIGN – QUICK ADJUST we have the opportunity to adjust
1. one thickness
2. one radius
similar to the quick focus function some where in the system
Special application: adjust the air distance before a collimation lens to get the best collimation
As criteria, wavefroint, spot diameter of angular radius ar possible
Example: Move a lens in between a
system to focus the image
Spots before and aftre thew adjustment
9
Quick Adjust Option
Useful commands for system changes:
1. Scaling (e.g. patents)
2. Insert system
with other system file
File - Insert Lens
2. Reverse system
10
System changes
Auxiliary menus:
1. Tilt/Decenter element
2. Folding mirror
11
3D Geometry
Local tilt and decenter of a surface
1. no direct visibility in lens editor
only + near surface index
2. input in surface properties
3. with effect on following system surfaces
12
3D Geometry
Different possible options for specification of the aperture in Zemax:
1. Entrance pupil diameter
2. Image space F#
3. Object space NA
4. Paraxial working F#
5. Object cone angle
6. Floating by stop size
Stop location:
1. Fixes the chief ray intersection point
2. input not necessary for telecentric object space
3. is used for aperture determination in case of aiming
Special cases:
1. Object in infinity (NA, cone angle input impossible)
2. Image in infinity (afocal)
3. Object space telecentric
Aperture data in Zemax
There are several different types of
diameters in Zemax:
1. Surface stop
- defines the axis intersection of the chief
ray
- usually no influence on aperture size
- only one stop in the system
- is indicated in the Lens Data Editor
by STO
- if the initial aperture is defined, the size
of the stop semi-diameter is determined
by marginal raytrace
14
Diameters in Zemax
2. Userdefined diameter at a surface in
the Lens Data Editor (U)
- serves also as drawing size in the
layout (for nice layouts)
- if the diameter in the stop plane is fixed, the initial aperture can be computed automatically by
General / Aperture Type /
Float by Stop Size
This corresponds to a ray aiming
3. Individual diameter of perhaps
complicated shape at every surface
(‚apertures‘)
- no impact on the drawing
- is indicated in the Lens Data Editor
by a star
- the drawing of vignetted rays can
by switched on/off
15
Diameters in Zemax
4. Individual aperture sizes for every field point can be set by the vignetting factors of the
Field menu
- real diameters at surfaces must be set
- reduces light cones are drawn in the layout VDX, VDY: relative decenter of light cone in x, y
VCX, VCY: compressian factors in x, y
VAN: azimuthal rotation angle of light cone
- If limiting diameters are set in the system, the corresponding factors can be calculated by the Set Vig command
16
Diameters and stop sizes
In the Tools-menue, the diameters
and apertures can be converted
automatically
17
Diameters in Zemax
Userdefined diameter at a surface in
the Lens Data Editor (U)
- serves also as drawing size in the
layout (for nice layouts)
- if the diameter of the system stop is fixed, the initial aperture can be computed automatically by
General / Aperture Type /
Float by Stop Size
This corresponds to a ray aiming on the rim of the stop surface. The aperture values in the PRESCRIPTION DATA list then changes with the diameter
A more general aiming and determination of the opening for all predefined diameters is not possible in Zemax
18
Ray Aiming
choice of 4 dispersion formula
after fit:
- pv and rms of approximation visible
- no individual errors seen
check results for suitable accuracy,
especially at wavelengths and
temperatures with sparse input data
and at intervall edges
add to catalog
enter additional data
Save catalog
Material Index Fit
19 Ref.: B. Böhme
Establishing a special own
material
Select menue:
Tools / Catalogs / Glass catalogs
Options:
1. Fit index data
2. Fit melt data
Input of data for wavelengths
and indices
It is possible to establish own
material catalogs with additional
glasses as an individual library
20
Material Index Fit
Melt data:
- for small differences of real materials
- no advantage for new materials
Menue option:
‚Glass Fitting Tool‘
don‘t works (data input?)
21
Material Index Fit
Menue: Fit Index Data
Input of data: 2 options:
1. explicite entering wavelengths and indices
2. load file xxx.dat with two columns:
wavelength in mm and index
Choice of 4 different dispersion formulas
After fit:
- pv and rms of approximation visible
- no individual errors seen
- new material can be added to catalog
- data input can be saved to file
22
Material Index Fit
Lens catalogs:
Data of commercial lens vendors
Searching machine for one vendor
Componenets can be loaded or inserted
Preview and data prescription possible
Special code of components in brackets
according to search criteria
23
Lens Catalogs
Some system with more than one lens available
Sometimes:
- aspherical constants wrong
- hidden data with diameters, wavelengths,...
- problems with old glasses
Data stored in binary .ZMF format
Search over all catalogs not possible
Catalogs changes dynamically with every release
Private catalog can be generated
24
Lens Catalogs
Stock Lens Matching
This tool swaps out lenses in a design to the nearest equivalent candidate out of a
vendor catalogue
It works together with the merit function requirements (with constraints)
Aspheric, GRIN and toroidal surfaces not supported; only spherical
Works for single lenses and achromates
Compensation due to thickness adjustments is optional
Reverting a lens to optimize (?)
Top results are listed
Combination of best single lens substitutions is possible.
Overall optimization with nonlinear interaction ?
Ref.: D. Lokanathan
Stock Lens Matching
Selectioin of some vendors by
CNTR SHIFT marking
Ref.: D. Lokanathan
Stock Lens Matching
Output
Ref.: D. Lokanathan
Compact window with 4 or 6 output
options can be summarized and
defined individually
28
Report Graphic
In the menue of output windows the option
OVERLAY allows for superposing of two or
more variations of the output
This gives the opportunity to compare various
versions
Examples:
1. Layout for x- and y-cross section
2. Universal plot for different parameters
3. Delano diagram for different field sizes
29
Overlay Option
Possibility to generate individual plots for special properties during changing one or two
parameters
Usually the criteria of the merit function are shown
Demonstration: aspherical lens, change of Strehl ratio with values of constants
The sensitivity of the correction can be estimated
It is seen, that the aspherical constants on one side are enough to
correct the system
30
Universal Plot
One-dimensional: change of 4th
order coefficient at first surface
Two-dimensional case: dependence on
the coefficients on both sides
31
Universal Plot
Universal plot configurations can be saved and called later
Useful example: spot diameter as a function of a variable: operator RSCH
32
Universal Plot
Slider option in menue: Tools / Miscellaneous / Slider
Dependence of chosen window output as a function of a varying parameter
Automatic scan or manual adjustment possible
Example 1: spot for changing the aspherical constant of 4th order of a lens
Example 2: Optical compensated zoom system
33
Slider
Menu Tools / Design / Visual optimization
Change of variable quantities by slider and instantaneous change of all windows
‚Optimization‘ under visual control of the consequences
Visual optimization
Multi configuration editor
Establishment of different system paths or configurations
Toggle between configurations with CNTR A
Examples:
1. Zoom systems, lenses moved
2. Scan systems, mirror rotated
3. Switchable optics, components considered / not taken into account
4. Interferometer, test and reference arm
5. Camera with different object distances
6. Microscope tube system for several objective lenses
7. ...
In the multi configuration editor, the parameters / differences must be defined
Many output options and the optimization can take all configurations into account
Special option: showallconfiguration in the 3D layout drawing simultaneously
1. shifted, for comparison
2. with same reference, overlayed
35
Multi Configuration
Demonstrational example:
Twyman-Green interferometer
36
Multi Configuration
Output of numerical data of results:
Text option with save: generation of ASCII file
37
Data IO
Export of IGES / STEP files,
for CAD data transfer
38
Data IO
There is a macro language for Zemax to allow for
individual problem solving
Some provided example files are distributed
Editing and running can be done from Zemax interface
Necessary: xxx.ZMX-file
Debugging of macro-language errors is cumbersome
Not all of the output data is provided by the commands
Coding of parameters is in many cases a bit tricky
Graphical options rather limited
Possibilities:
1. special and individual analysis
2. change of system data and case studies
3. optimization
4. print export of data
39
Macro Language
Code Example:
Incidence angles at all surfaces
for 3 field positions
Online output
40
Macro Language
! comment line follows
variables, declarations, simple operations, strings, basic mathematical functions
IF THEN ELSE, GOTO, LABEL, FOR NEXT
a = AQVAL() numerical aperture
ro = CURV(j) surface curvature of surface no. j
y = FLDY(j) field size no. j
u = RAYL(j) direction cosine of real ray at surface no. j
y = RAYY(j) y-value of real ray at surface no. j
t = THIC(j) thickness at surface j
PRINT ‚text‘, x,y print text
FORMAT 5.3 numerical format of output: 5 places, 3 digits
OUTPUT ‚fname.txt‘ declaration of output file for results
GETSYSTEMDATA n get special coded (n) data of the system
GETZERNIKE maxorder, wave, field, sampling, vector, zerntype, epsilon, reference
PWAV n set primary wavelength
RAYTRACE hx, hy, px, py, wavelength
SURP surface, code, value1, value2 set surface properties
SYSP code, value1, value2 set system properties
41
Important Macro Commands
42
Example - 1
! 2013-05-12 H.Gross
!
! Calculation of the 2nd moments in x-and y-direction of a system spots for all field points
! A circular pupil shape is assumed
! number of field positions in the data
nfield = nfld()
!
! number of pupil sampling points (fix), arbitrary choice, determines accuracy and run time
!
npup = 21
! look for main wavelength in the data
!
jwave = pwav()
! initialization of increments in field and pupil
!
dw = 2/(nfield-1)
dp = 2/(npup-1)
!
! determine the index of image surface
n = nsur()
!
! header row in output: nfield npup jwave
print " "
print "Spot 2nd order moments in my"
print " "
FORMAT 10.5
PRINT "Fields: ",nfield, " pupil sampling: ",npup," wavelength: ",wavl(jwave)
print " "
43
Example - 2
!-------------------------------------------------
!
! loop over field points in y-direction: index jy
!
for jy = 1, nfield, 1
hx = 0
hy = sqrt((jy-1)/(nfield-1))
!
!----------------------------------------------------
!
! first loop to calculate the centroid
!
! initialization of centroids and moments
!
xc = 0
yc = 0
Mx2 = 0
My2 = 0
Nray = 0
!
! loop over pupil points: indices kx, ky
!
for ky = 1, npup, 1
for kx = 1, npup, 1
px = -1+(kx-1)*dp
py = -1+(ky-1)*dp
44
Example - 3
! raytrace
raytrace hx, hy, px, py, jwave
xp = rayx(n)
yp = rayy(n)
!
! error case for rays outside circular pupil
ierr = raye()
pr = sqrt(px*px+py*py)
if ( pr > 1) then ierr = 1
!
! summation of 1st order moment to calculate the centroid in x and y
if (ierr == 0)
Nray = Nray+1
xc = xc + xp
yc = yc + yp
endif
!
! end of pupil loop
next
next
!
! final calculation of centroid coordinates xc,yc
xc = xc / Nray
yc = yc / Nray
!
! second loop over pupil for calculation of moments M2 and M3
! indices kx, ky
for ky=1, npup, 1
for kx = 1, npup, 1
45
Example - 4
px = -1+(kx-1)*dp
py = -1+(ky-1)*dp
! raytrace
raytrace hx, hy, px, py, jwave
xp = rayx(n)
yp = rayy(n)
! error case
ierr = raye()
pr = sqrt(px*px+py*py)
if ( pr > 1) then ierr = 1
! summation of moments, scaling from mm into my
if (ierr == 0)
Mx2 = Mx2 + (xp-xc)*(xp-xc)*1.e6
My2 = My2 + (yp-yc)*(yp-yc)*1.e6
endif
! end of pupil loops
next
next
! final calculation of moments for present field location and print of results
Mx2 = Mx2 / Nray / 3.14159
My2 = My2 / Nray / 3.14159
!
! determine field size
Hy = fldy(jy)
FORMAT 8.4
PRINT "Field: ",Hy," Nray = ",Nray," centroid xc = ",xc," Mx2 = ",Mx2
PRINT " "," "," centroid yc = ",yc," My2 = ",My2
print " "
!
! end of field loop
next