Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Menu

Search

Chapter 1
Welcome to CODE V

CODE V is a tool for designing and analyzing optical systems. This chapter
introduces you to CODE V, describes what is available to help you learn and use it,
and briefly describes the user interface and structure of the program.

Contents

What is CODE V? ........................................................................................................2


This Manual and You....................................................................................................5
Assumptions and Terminology .....................................................................................7
The CODE V Interface .................................................................................................9
The Structure of CODE V ..........................................................................................13
Starting, Stopping, and Getting Technical Support ....................................................14
Before You Begin: Settings Assumed for this Guide .................................................15

CODE V Introductory User’s Guide 1


Chapter 1 Welcome to CODE V
Menu

What is CODE V?
Search

A Power Tool for Optics


CODE V is a powerful and flexible software tool for solving optical problems.
Although its development started over 30 years ago, CODE V has been continually
improved to keep pace with optical and computer technology. With a customizable
Windows-based user interface, extensive help features, and excellent technical
support to back it up, CODE V is also very easy to learn and use, as this manual
will show.

Typical Tasks for CODE V


CODE V can be used for many purposes. Here are some typical tasks.
• Evaluate and adapt an existing optical design for suitability in a new
application, or to reduce fabrication costs. Plastics, aspheres, diffractives, or off-
the-shelf components might be evaluated in such a redesign.
• Create a new design based on requirements for a specific product or application.
• Prepare an optical design for fabrication through tolerance analysis, fabrication
drawings, and even IGES (CAD) export.
What are the applications? In broad terms, there are three application areas:
• Image-forming systems
• Photonics or telecom systems
• Illumination and other systems
Historically, 80% or more of CODE V’s usage has probably been in the image-
forming category, which is very broad. Examples include cameras, zoom lenses,
optical disc systems, medical systems, telescopes, spectroscopes, copiers,
projectors, scanners, microlithography systems, and many aerospace applications,
both military and civilian.
Although these applications have existed for many years, new work continues to be
done as technology advances—cameras become digital cameras, CDs give way to
DVDs, and so on. The photonics field has been growing a lot in recent years, while
illumination and other systems is a significant segment due to CODE V’s great
flexibility.

2 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

The Beauty of Not Starting from Scratch


Search As mentioned in the last section, CODE V has been used for many years and for
many applications. One advantage of this is that is rarely necessary to start an
optical design project completely from scratch. It is more typical to adapt an
existing design for a new purpose, and we will teach you how to do that in this
manual, starting with CODE V’s New Lens Wizard.

Intellectual Property Issues


As you will see, the New Lens Wizard allows you to start a design from a CODE V
sample lens, from a database of 2,456 patents, from your own collected “favorites,”
or from a blank lens. Sample lenses and patents can be useful starting points, but
you should also be aware of and sensitive to the need to honor intellectual property
in the design process. While all of the patents in the CODE V patent database are
expired, there are other sources that include unexpired patents. You can certainly
study and learn from such material, but be careful in using any unexpired patent as
a starting point that you are not infringing on the patent owner’s rights.
The “favorites” feature can be a gold mine in the future—as you develop designs,
or import and study designs by colleagues within your organization, you will build
up a library of lens designs that are well understood and probably well-suited to
your applications. When you complete a design and save it in a lens file, you can
quickly add it to your favorites using the Tools > Add to Favorites menu. It will
then be available for future New Lens Wizard sessions.

The Beauty of Keeping It Simple


When you start a new design, you should try to include what is essential, and leave
the more complex features for later. Polarization may eventually be an important
factor, but you probably don't need to turn it on and worry about it now. Here are
some other tips for keeping your design simple:
• Try to use an all-spherical design before turning to aspheres or diffractives.
• If aspheres or diffractives are necessary, introduce the lower-order terms first.
• Don’t use x-components of fields, tilts, and decenters unless the system is truly
and generally asymmetric.

CODE V Introductory User’s Guide 3


Chapter 1 Welcome to CODE V
Menu

But don’t make things too simple:


Search • Even if a system is intended for axis-only use (e.g., some laser systems), it is
normally advisable to include at least a second very small off-axis Y field, if
only to account for possible misalignment in use. Using only one field point
can sometimes cause problems with too-small default apertures.
• A conic may seem simpler than an asphere, but if a surface has very small
curvature, a conic will not be an effective optimization variable, while a fourth
order aspheric term may be.
These examples may seem very technical, but you will understand them as you
work with CODE V. In more general terms, you should make use of CODE V’s
speed, ease of use, and Undo capability (Edit > Undo menu) to try things in a
simple way first and evaluate. If it doesn’t work, use Undo and add some more
variables, then re-run your optimization. This may only take a few clicks and a few
seconds to re-run, making trial and error an effective design strategy in some cases.

4 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

This Manual and You


Search

Audience
The intended audience for this manual is any technically oriented person who wants
to use CODE V to model, analyze, and optimize optical systems. Although a
background in optics or optical engineering is certainly helpful, there are many
users of CODE V who have learned the necessary skills and knowledge on their
own, through professional seminars (SPIE and others) or through self-study with
various books. CODE V is not a magic black box that will allow anyone to design
lenses with no understanding of optics, but the necessary background can often be
learned as you work with the program.

About This Manual


This manual is reasonably self-contained, but it does not attempt to teach optical
theory or general optical engineering, at least not in any systematic way. Nor does it
attempt to teach every single feature of CODE V. It teaches the use of CODE V on
a set of practical problems through a series of detailed how-to examples.

Learning More
If you need more detailed information and practice on the mechanics of the user
interface, work through the CODE V Test Drive. To find more detailed information
or additional examples on program features, the online Help or the CODE V
Reference Manual is a good source (see “Online Help and Documentation” below
for more details).

Tip: Chapter 10, Tech Talk: Useful Background contains a lot of valuable material
that supplements and explains optical modeling issues in more detail. It covers
coordinate systems, System Data details, pupils and vignetting, and other important
subjects. You may want to skim through it before doing the examples in Chapter 2
and Chapter 3.

If you need more background to understand the technical or optical points, we


suggest reading some relevant sections of one of the references (Appendix B). The
books by Fischer (2000) and Shannon (1997) have a very modern and practical
orientation that nicely supplements the examples and discussions in this guide.

CODE V Introductory User’s Guide 5


Chapter 1 Welcome to CODE V
Menu

Online Help and Documentation


Search CODE V includes extensive online Help and documentation (it is “online” in the
sense of on your computer screen rather than printed, but not on the Internet—the
Help features are installed with the program on your computer). There is even help
on getting help! There are many ways to get help in CODE V. Take a look at the
Help menu:

• Choose Help > CODE V Help (or press F1) to get into the help system on a
page with information targeted to the currently open window or dialog box.
• Choose Help > Contents and Index to open the help contents browser; double-
click on topic headers to expand them and view the many sub-topics. You can
also search the Help contents from this window.
• Choose Help > What's This? Help (or press SHIFT+F1) to change the cursor
into a “help pointer” with which you can click on an item of interest and see a
relevant help topic (most items in the interface have some help, but not all).
• Choose Help > CODE V Reference Manual to open the PDF (Adobe Acrobat)
file for the complete CODE V Reference Manual, including all text, graphics
and examples. The Reference Manual is completely searchable and print ready.
• Choose Help > Tip of the Day to view a CODE V tip (you can also turn off
Show Tips on Startup in this dialog box).

6 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

Assumptions and Terminology


Search
There are no specific prerequisites for this manual, although it does assume some
basic familiarity with optical systems, methods, and terminology. Here are a few of
the concepts and terms we will use without much explanation. If you have taken a
college-level physics course that includes basic optics, you will find most of the
terminology at least somewhat familiar, although the engineering and design side of
things may be new to you.
Light—Electromagnetic waves characterized for optical purposes mainly by their
wavelengths or colors. Light waves are very short—for green light, about 500 x
10-9 meters (m), or 500 nanometers (nm). The speed of light is a constant in
vacuum (c = 3 x 108 m/sec), but it slows down in dense media such as glass. The
speed ratio between vacuum and a material is called the index of refraction (n),
which varies with material (glass) type and with wavelength. Light has other
properties such as polarization that can be modeled in CODE V but are less
important than wavelength.
Optical surface—A surface with an associated curvature, position, and material
(characterized mainly by its index of refraction values). Optical surfaces also have
lateral extent (aperture size) and may have other properties that define their shape
or behavior.
Geometrical vs. physical optics—Geometrical optics assumes that light travels in
straight lines called rays, and that these rays obey simple laws when they encounter
optical surfaces (Snell’s Law and the Law of Reflection). Physical optics assumes
that light is a wave, and this wave-like behavior is responsible for diffraction
effects. CODE V operates on a combination of geometrical and physical optics.
Ray tracing—Mathematical method of determining the path of light through a
series of optical surfaces. Rays are generally associated with geometrical optics, but
ray tracing can be extended in various ways to incorporate wave behavior and even
polarization states and allow physical optics calculations (also called wave-based or
diffraction-based calculations).
Optical system—A collection of optical surfaces along with some properties
(system data) that define the rays of light that will interact with the surfaces. An
optical system in CODE V is a model of a real optical system that could be built. It
can contain refracting surfaces, reflecting surfaces, or both.
Lens—We use the word lens as a synonym for an optical system in CODE V, in the
same sense that people refer to a zoom lens for a camera. In common use, the term
lens often means a single, carefully shaped piece of glass. This is called a lens
element in optical design usage, or sometimes an optical component.

CODE V Introductory User’s Guide 7


Chapter 1 Welcome to CODE V
Menu

Object and Image surfaces—The object surface is where light is assumed to start,
and the image surface is where light is usually collected and analyzed (an image is
Search
often formed there, but not always). The words object and image have special
meaning in general or classical optics. We will refer you to basic optics texts for
more on this subject. Many (perhaps most) systems modeled in CODE V are
image-forming systems, so these relationships are important, although it is more
important to know the concepts and meanings than the equations, since CODE V
calculates these quantities for you.
First-order or paraxial optics—Ray tracing can be reduced to simpler linear
equations by making certain assumptions (e.g., angles are small so that sin θ = θ,
ray heights are small, etc.). These are called first order or paraxial relationships, and
they are convenient for defining the basic properties of optical systems.
Focal length—A basic first-order property of an image-forming optical system, the
focal length of a thin (zero thickness) lens is the distance at which light rays from
infinity will converge to form an image. Effective focal length (EFL) accounts for
the non-zero thickness of a real optical system.
Airy Disc—An Airy disc represents the best possible focused image of a point
source using a perfect lens with a circular aperture. The diameter of the first
minimum in the point spread function (PSF) is 2.44λ(f-number). You will come
across many references to the Airy disc throughout the CODE V documentation.

2.44λ(f/no)

Intensity at
image plane

There are probably more concepts and terms that we will assume you understand,
but these are the basic building blocks. If this is all unfamiliar to you, you may want
to read some chapters from the books listed in Appendix B, or you can just dive in
and see how you do.

8 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

The CODE V Interface


Search

A VERY Brief Tour


On the theory that the best way to learn something is to do it, we would recommend
that you use the CODE V Test Drive as a practical introduction to the CODE V user
interface. Although it has a lot in common with other Windows-based applications,
there are some interface concepts and techniques that are specific to CODE V. The
Test Drive is a brief manual that concentrates on the user interface and the most
basic features of the program, with relatively little explanatory material.
This manual will eventually show you all of the interface features, but they will be
interspersed with examples and explanatory text, since the goal of this manual is to
teach you the practical use of CODE V for various applications.
Read and work through the two brief sample sessions in the Test Drive and you will
return here ready to learn the technical material without too much concern for the
mechanics of the user interface. If you are familiar with other Windows
applications, you shouldn't have much trouble navigating the interface anyway,
though the Test Drive will also teach you about CODE V-specific interface features
that will make your use more efficient.

Tip: Note that when you work with spreadsheets in CODE V, you can select either
individual cells or entire rows or columns. Cells correspond to particular data items
such as thickness, while rows usually correspond to entire surfaces. The right click
menus will be different depending on which you select. To select a row, click in the
left-most cell until the row highlights. You can also drag to select multiple rows,
then right-click to do something with them (like deleting a block of surfaces).

All that being said, following is a screen shot from the program, along with brief
definitions of the key parts. You can refer back to this page if you encounter a term
such as status bar and you don’t recall what or where it is.

CODE V Introductory User’s Guide 9


Chapter 1 Welcome to CODE V
Menu

Title bar Navigation bar Menu bar Toolbar LDM spreadsheet


Search

Command Command Plot window Tabbed output Status bar


window line window

• Title bar—Includes file name for your current lens “document.”


• Window Navigation Bar—Provides a way to keep track of all the windows
you are working with. This Navigation bar can be “docked” along an edge of the
CODE V workspace window, or it can float, as shown in the following
illustration (hold down the CTRL key to prevent docking while dragging with
mouse).
• Menu bar—Contains most of the functions of the program. You can add
additional menu items (such as frequently used macros) in the Customize
dialog box (Tools > Customize menu).
• Toolbar—Single-click shortcuts for many common functions. Place the mouse
pointer over a tool to see a descriptive “tool tip” message. You can move tool
bars around by dragging them with the mouse. You can also modify tool bar
contents in the Customize dialog box (Tools > Customize menu).

10 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

• Lens Data Manager (LDM) Window—This spreadsheet is the main


numerical view of the primary lens data. You can access other data and
Search
operations by right-clicking on cells, rows, or columns of this spreadsheet. The
pop-up menu will contain only the commands you can enter for the item you
clicked.
• Command Window—The “journal” window for all text-based output, and the
main workspace for directly entering and viewing results of commands.
• Command entry line—Part of the Command Window, this is the place to type
program commands if you wish to use them (commands and mouse-based
operations are integrated in CODE V; you can use either method at virtually any
time).
• Plot Windows—Graphics that are generated by command operations are
displayed in dedicated plot windows. You can have up to 100 such windows,
although 3 or 4 is more common.
• Tabbed Output Window—Specialized calculations such as MTF and spot
diagrams are called options in CODE V. When launched from the menu bar,
each option creates its own tabbed output window (TOW), which includes text,
graphics, and any warning or error messages. The main feature of TOW's is that
they remember their settings and thus can re-run their calculations with a click
of the Execute (Recalculate) button.
• Status Bar—The status bar is the lower border of the main CODE V window. It
displays several parameters such as focal length, dimensions, etc. which are
configurable in the Customize dialog box (Tools > Customize menu).

What About Commands and Macros?


You can run CODE V by choosing menu items, filling in spreadsheets and dialogs,
and clicking buttons. This is the approach used for most of this manual, but there is
another way. You can also access all of the program’s features by typing
commands in the Command Window. If you are an experienced CODE V user,
you may know many of these commands and you may prefer this method. If so,
that's great. You can type commands, work with menus, or do a little of both.
If you want to learn commands, you can start by reviewing the command input
examples from this manual, which are listed in Appendix A. You can also make use
of help features (especially the F1 key) to access documentation that lists both the
screen prompts and the three-letter acronyms (TLAs) for CODE V commands.
(If you are a fan of TLAs, you will be in heaven with CODE V’s command
language, which has well over 1000 TLAs. This may help explain why we
developed the menu interface!)

CODE V Introductory User’s Guide 11


Chapter 1 Welcome to CODE V
Menu

Macro-PLUS
Search Another place to view and learn command language is through ORA-supplied
macros. There are a large number of them found in the Macro dialog box (Tools >
Macro Manager menu), or in the \macro subdirectory of the CODE V installation
directory. In fact, although you can use supplied macros very well from the menu
interface, you must use commands to write macros. The CODE V online Help has
an excellent section on the built-in Macro-PLUS programming language and
supplied macros.

12 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

The Structure of CODE V


Search
CODE V has many parts, but its overall architecture is rather flat, with only two
levels. The interactive “core” of CODE V is called the Lens Data Manager (LDM).
You communicate with this part of the program through menus and dialogs, or
through commands, or both (if you see the prompt CODE V> in the Command
Window, you are in the LDM). The LDM maintains the lens database and
communications with the computer's operating system and file system when
necessary.
The other level of CODE V is the options level. Options are special-purpose
calculations such as MTF, spot diagram, optimization, etc. There are over 45
options. You can think of them as sub-programs with their own input dialogs,
commands and output containers, for that is essentially what they are. When you
are working in an option, you are locked out of LDM operations until you click
Apply & Close, OK, or Cancel in the option dialog box (or type GO or CAN on
the command line, if you launched the option there). You are in an option if you see
a Command Window prompt other than CODE V> (e.g., MTF>, AUT>, etc.).
Macro-PLUS is always available, and when macros are run, they feed commands to
the LDM or to options, depending on how they are programmed.

LDM File System


Lens (Lens Data Manager)
Database Lens storage, glass
catalog, Help files, etc.
Lens data entry
Data modification
Data display
Diagnostic analysis
Use of files (I/O)
Macro-PLUSTM
(programming)

Options
ANALYSIS AUTO MTF SPOT TOR VIEW COST
Basic ray trace Calculate/plot MTF or RMS Lens drawing
Lens optimization Spot diagram Lens cost
analysis modulation based tolerancing (2D, 3D) estimator
transfer function

CODE V Introductory User’s Guide 13


Chapter 1 Welcome to CODE V
Menu

Starting, Stopping, and Getting Technical Support


Search

Installing CODE V
We assume that CODE V has already been properly installed. For help with this,
please see the installation guide that came with your CODE V CD-ROM. Also
make sure that your security key is attached to the parallel port, if a key is required
for your installation. If you have problems, see “Getting Technical Support” below.

Starting CODE V
To start CODE V, simply use the Windows Start menu to locate the program
shortcut (or double-click the desktop shortcut if you've kept it).

Saving Your Work


To save a lens file, choose the File > Save Lens As menu.
To save the contents of a text or graphics window, bring it to the front and choose
the File > Save Window As menu.
To save the settings you have entered for a CODE V option, click the Option Set
button on the lower left corner of the option dialog box. This displays the Option
Sets dialog box. Click the Save As button in the Option Sets dialog box and enter a
descriptive name for the settings you have entered.

Exit from CODE V


Choose the File > Exit menu to exit from CODE V (or type EXIT in the Command
Window).

Getting Technical Support


Although the online help is always available through the F1 key or Help menu,
sometimes you will need to get help from a human expert. You can contact ORA in
several ways:
Email: support@opticalres.com
Web: http://support.opticalres.com
Telephone (USA, Pacific Time): (626) 795-9101

14 CODE V Introductory User’s Guide


Chapter 1 Welcome to CODE V
Menu

Before You Begin: Settings Assumed for this Guide


Search
CODE V is designed with a number of configurable settings that can affect how the
program looks and behaves. Many of these settings are mainly cosmetic or personal
preferences (e.g., font sizes), but some can lead to confusion if they are different
from what is assumed here. Before you start using this guide, do the following.
1. Choose the Tools > Preferences menu.
2. In the Preferences dialog box, click the General tab.
3. Check and set if needed (other settings don't matter for this manual):
– System units set to Millimeters
– Aperture mode set to Semi (displays aperture radii rather than diameters)
4. Click the UI tab (for user interface settings).
5. Check and set if needed (other settings don’t matter for this manual):
– Under Settings Activation, select Invoke Options Settings First.
– Under Use Wizards, select New Lens.
6. Click OK to save these settings and close the Preferences dialog box.
7. Choose the Tools > Customize menu.
8. In the Customize dialog box, click the Format Cell tab. Make sure that the
General Format button is selected, and enter 5 in the Precision (# of digits)
field.
9. Click the Close button to save these settings and close the Customize dialog
box.
10. Choose the Edit > Radius Mode menu to set the radius/curvature mode.

CODE V Introductory User’s Guide 15


Chapter 1 Welcome to CODE V
Menu

Search

16 CODE V Introductory User’s Guide

You might also like