Published May 30, 2006. This tutorial relates to LensForge 1.0. There are changes in LensForge 1.1.
The lens title should be entered on the window obtained via menu System > Info. The
surface table looks a bit different.
In this tutorial we will go through the process of setting up a lens design from
scratch.
Very little familiarity with lens design or with the LensForge computer
program will be assumed, making this tutorial useful for
basic training in the use of LensForge. There will be lots of pictures.
We will also cover looking up glasses in the built-in library and setting
a solve to automatically focus the system.
Rather than designing our own lens, we will analyze an existing lens. To keep it
simple we will analyze a singlet: a lens made of a monolithic piece of glass.
The singlet we will analyze is Thorlabs part number LA1131, described in their catalog as
BK7 Uncoated Plano-Convex Lens, DIA = 25.4mm, f = 50.0mm
Thorlabs supplies a
PDF drawing that you can
use for reference.
From the Thorlabs drawing, the prescription of the lens can be summarized as follows:
Prescription for Thorlabs LA1131
| Parameter | Value |
| Glass | BK7 |
| Front surface radius of curvature | 25.8mm |
| Back surface radius of curvature | infinity (plano) |
| Center thickness | 5.3mm |
| Diameter | 25.4mm |
That is really all the information we need to completely specify the lens. We are not
yet considering coatings.
Step 1
To start, open the LensForge application by double-clicking on the application icon (if it is in
your dock, of course, a single click will do). The LensForge menu bar will take its place at the top of
the screen.
For a description of these menu items, see the previous tutorial.
Step 2 - Create a new empty lens file
Next, go to the menu and select .
An empty new document will appear. In LensForge, documents have multiple windows.
Typically first window you will when you do
File > New
is Lens data window (unless you have changed
the preferences some time in the past).
Step 2 - Give the lens a description
To set the name of the lens you need the System info window, summoned using
System > Info.
Move the mouse cursor over the text box beside the label "System name" on the System window.
Click in the box to make it the keyboard focus (it will acquire a blue outline)
and type "Thorlabs LA1131".
Step 3 - Save the lens file
Even before we enter any lens data, we save the file so that it has a name and so that we know
we can save it. Go to the menu and select .
At this stage, because this is the first time we are saving the file,
the
menu item is actually doing the
action of the item.
A sheet will slide down from the title bar of the System window
asking you what file name you would like to use, and where
you would like the file to be saved. Type "singlet test" for the name, and choose a location (the
Desktop, say). Leave the file format as "ZEMAX lens file".
Press the blue Save button to finish the job.
Step 4 - Entering lens data
A lens system consisting of a singlet is analyzed with four surfaces that will be numbered 0 through 3.
These surfaces are:
| Surface 0 | The object (where the light rays start) |
| Surface 1 | Front surface of the glass |
| Surface 2 | Back surface of the glass |
| Surface 3 | The image (where we analyze the focus) |
We will analyze the lens for the case of an object at infinite distance.
Make four surfaces
In the Lens data window, press the insert button four times to make four surfaces.
After doing that
the Lens data
window should look like this:
You will note that the Lens data window is divided into an upper and a lower area, separated by
a row of buttons (Prev, Next, Insert, etc.). In the upper area is a table and in the lower area
are boxes to enter the information that appears in the table, as well as additional information.
The lower area has other functions, too. We can ignore the
lower area for now.
The column labelled "number" is the number of the surface, 0 through 3.
The column labelled "type" is the type of surface. The "STANDARD" type is what we will be using,
because it can represent a sphere,
so just leave the settings as they are for this tutorial. Other columns give the radius of curvature,
thickness, glass, and semidiameter. No "semidiameter" has nothing to do with "radius of curvature":
it is how far off axis a ray can be and still pass through the lens.
So far everything is zero,
even the radius of curvature. Don't worry, zero radius of curvature will be interpreted as planar.
Assign a stop surface
The first thing to do is to assign a stop surface. In lens design this is defined as
the limiting aperture of the system and it determines where the rays are aimed.
That is why it is critical to put it where you mean to.
We will set surface 1 to be the stop.
Just click on the row of the table for surface 1. Don't click on any obvious controls, but otherwise it
is safe to click anywhere in the row.
The row will change color to indicate that surface 1 is selected
and the button labelled
"Set surface as stop" will become active. Press it. The column labelled
"stop" will indicate that surface 1 has become the stop.
Setting surface thicknesses
In LensForge, the "thickness" of a surface is the distance from that surface to the next surface.
Enter infinte thickness for the surface 0 by double-clicking in the column labelled "thickness" in the
first row. Type "i" and press return. The word "infinity" will appear, and the table will
move you on to editing the thickness of surface 1. Semidiameters begin to change at this point,
just ignore them for now.
Enter the thickness 5.3 for surface 1 and press return. Note that you don't type "mm" or anything.
All lengths in the table are in mm.
Now, we don't know the thickness for surface 2,
so lets put in 10.
Surface 3 is the image, leave its thickness equal to zero.
Use the mouse to click somewhere in the table to close the editing.
After doing that
the Lens data
window should look like this:
The thickness of the last surface is not used by LensForge, so just leave it.
Step 5 - Save the lens file
We won't harp on this any more, but it is a good idea to save the
file from time to time, as you work on it.
Someone might trip over your extension cord.
Go to the menu and
select .
The file will be saved under its current name.
Step 6 -Set the glass
Double-click in the "glass" column in the row for surface 1.
When we type the name of the glass and press enter (or return)
LensForge will look up the glass and associate it with the surface.
This looking up is case-insensitive, so you can just type
lower-case "bk7" and press return. It turns red. That means it
did not work: LensForge does not know about a glass called
BK7. This is what the Lens data window now looks like if we select
the row for surface 1:
The glass name is red and in the lower part of the window,
in the little box next
to the glass, you see the description "Unknown glass".
This failure
is not because LensForge is uneducated, it is because
the glass vendors do not have a glass named BK7 these days.
But there are environmentally friendly glasses with nearly
the same name that has replaced BK7. All we have to do is look
them up in the catalog.
Looking up a glass
To view the glass library, go to
the menu and
select .
The glass library will appear:
The table lists every glass in the built-in library, for each glass
giving the glass name (also known as glass type), the glass code,
and the version, which identifies the vendor
catalog from whence the glass came.
Already on the first page we can see K-BK7 from Sumita, but let's dig
deeper.
The search box at the top of the window will let you restrict the table
to those glasses whose name matches the string you type.
Type bk7 into the search box.
You should see the following:
We see there are two likely candidates for modern-day BK7. Let's pick
the Schott one. It is called N-BK7, so we can just go back to the Lens
data window and type n-bk7 for the glass for surface 1.
Or, as intimated in the upper right hand corner of the glass library
window, we can drag the glass from the library and drop it onto surface
1 in the table in Lens data window. It is difficult to communicate
a dynamic process like drag and drop in a still picture,
but the image below shows where you press the mouse button (the red
dot), where you move to (the red line), and where you release the mouse
button to drop the glass (the end of the red arrow, over surface 1):
I hope it worked for you. If you had an accident and dropped the glass
on the wrong surface, just select
from the
menu.
Step 6 - Save the file again!
Enough said.
Step 7 - Make a picture
It is time we had a look at the lens we are analyzing.
Go to the menu,
submenu,
and select .
This creates a window showing a planar view (a cross section or projection).
By default the section is the YZ plane.
Note that if the glass library window is the front one then the menu item
we want will be disabled. This is because the glass library belongs to the
application as a whole and not to the lens design document. You will first
have to select a window of the document (e.g., the Lens data window) to
enable the Analysis menu items.
This is what the planar layout will look like:
You will note that the little numbers just above the picture will change
as you move the mouse about. These are the y and z coordinates of the
cursor. Also, when you pass over the plane of a surface, the window will
show which surface it is just above the image.
The image is not very pretty just yet, we should set the diameter of the lens.
Right now it is drawn using the automatically calculated semidiameters.
Go back to the Lens data window and enter 12.7 (half of 25.4)
for the semidiameter of surface
1 and 2. Now go back to the planar view by clicking on its title bar or
selecting the window from the select menu.
You can zoom to see the entire lens by selecting
from the menu or by
clicking twice on the Zoom button. Now we have:
Well, it does not look much like a lens and the reason is that we've not yet
made the front surface curved. Go back to the Lens data window and enter
25.8 (the prescription curvature) for the radius of curvature of surface 1.
Now we have:
Now is looking quite like a lens, but we would like to fill the lens with rays.
To do that we must adjust the pupil of the system.
Step 7 - Setting the pupil
Open the pupil control dialog by choosing
from the menu.
Right now we see that the pupil is being determined
by the diameter of the entrance pupil, or rather,
the extent of the incoming rays has the specified diameter.
This diameter is only 1mm, which is why the bundle of rays
on the layout view is so narrow.
The lens is 25.4mm in diameter, but we would
almost never use the full
lens in practice. Let's use 90% of the diameter,
and take 22.8mm as the diameter of the pupil.
Change the value to 22.8 and press enter or tab so that
the value it taken. Then you can close the pupil control
window.
Now the planar view looks like this:
Step 8 - Using a solve
In the above picture it is clear that the last surface is too
close to the lens. The rays are converging, but still have a
long way to go to focus.
To adjust the distance between the lens and the last surface
in order to be at focus, we will use what is known as a "solve".
In the Lens data table, the column just to the right of the
thickness column contains pop-up menus. Each pop-up
menu lets you choose what
solve to use for the thickness of that surface. Right now
they are blank, which means no solve is used.
Click on the thickness solve pop-up menu for surface 2 and release
the mouse over "M" to select the "marginal ray height zero" solve.
The thickness of surface 2 will automatically update to bring the
image plane to the plane of paraxial focus. In the Lens data table
you should see
The planar view will
look like this after you zoom to fit (double-click on the Zoom button
will do it):
You will note that the beam is a bit narrower before the
image plane. This is because of spherical aberration: the lens
surface is a sphere and so it can not focus perfectly. The focus
is blurry (the rays do not focus to a point)
and the smallest spot size, or "circle of least confusion",
occurs before the plane of paraxial focus.
Step 9 - Making a ray fan diagram
Go to the menu,
submenu,
and select .
This creates a window showing the result of a
transverse ray fan
calculation. It should look like this:
The horizontal axis is the pupil coordinate: -1 for the bottom of the
pupil to +1 for the top of the pupil, as viewed from the object space.
For each pupil coordinate a ray is traced.
The y coordinate of the ray when it hits the image plane is plotted
against the vertical axis. The meaning of the shape you see is that
rays through the top of the pupil hit the image plane too low, and
rays through the bottom of the pupil hit the image plane too high.
This is the signature of undercorrected spherical aberration.
The slope of the curve is zero at the center, which means that the
system is at focus for paraxial rays (thanks to the marginal ray solve
we put on the thickness of surface 2).
Step 9 - Using the correct wavelength
Up to this point we have been tracing rays assuming that the
wavelength of the light is 0.55 microns (the default value).
The Thorlabs singlet has a design wavelength of 633 nm, or
0.633 microns. To change the ray tracing wavelength,
go to the menu,
and select .
The window that opens should look like this:
Change the value 0.55 to 0.633 so that we are using the design
wavelength for the lens. You will note that the marginal ray
solve now gives a slightly different value for the thickness of
surface 2
because the focal length changes with changes of wavelength
due to dispersive nature of the glass.
Step 10 - Checking the focal length
To finish this tutorial, we will check if the focal length
of the lens matches the Thorlabs drawing, where it is listed
as 50.0mm at 633nm.
Go to the menu,
submenu,
and select .
We will not go over this information in this tutorial.
Here we just note that the focal length is pretty much
as specified on the Thorlabs drawing. The difference is
within the tolerance of the radius of curvature, which
the drawing only gives to one 0.1mm precision.
Conclusion
At the end of this tutorial, you should understand how to enter surface
data for an infinite conjugate system
into LensForge, how to specify the entrance pupil diameter for your
lens, how to specify the wavelength for ray tracing, and how to
make layout and ray fan plots.
To learn more, play with LensForge, or try one of the more advanced
tutorials as they are published.
By the way, there is any easy way to enter the data for a catalog lens
into LensForge, if you have the catalog in ZMF format. You can open
the ZMF file in LensForge, make a new lens design and drag the lens
from the ZMF file to the empty Lens data table.