Data entry

In early lens design programs, data entry was a "phase" in which the lens data for a starting design were read into the computer from a deck of cards. At that time, the numerical aspects of optical design on a computer were so amazing that scant attention was paid to the data entry process. However, as the use of optical design software became more widespread, it was found that a great deal of a designer's time was spent punching cards and submitting new jobs, often to correct past mistakes. Often, it turned out that the hardest part of a design job was preparing a "correct" lens deck!

Over the years, optical design programs have been expanded to improve the data entry process, changing the function of this part of the program from simple data entry to what might be called lens database management. A typical contemporary program provides on-line access to a library of hundreds of lenses, interactive editing, automatic lens drawings, and many features designed to simplify this aspect of optical design.

The lens database contains all items needed to describe the optical system under study, including not only the physical data needed to construct the system (curvatures, thicknesses, etc.), but also data that describes the conditions of use (object and image location, field of view, etc.). Some programs also incorporate optimization data in the lens database, while others provide separate routines for handling such data. In any case, the lens database is often the largest part of an optical design program.

The management of lens data in an optical design program is complicated by two factors. One is that there is a tremendous range of complexity in the types of systems that can be accommodated, so there are many different data items. The other is that the data are often described indirectly. A surface curvature may be specified, for example, by the required slope of a ray that emerges from the surface, rather than the actual curvature itself. Such a specification is called a solve, and is based on the fact that paraxial ray tracing is incorporated in the data entry portion of most optical design programs.

It might seem curious that paraxial ray tracing is still used in contemporary optical design programs that can trace exact rays in microseconds. (The term exact ray is used in this article to mean a real skew ray. Meridional rays are treated as a special case of skew rays in contemporary software; there is not sufficient computational advantage to warrant a separate ray trace for them.) In fact, paraxial rays have some important properties that account for their incorporation in the lens database.

First, paraxial rays provide a linear system model that leads to analysis of optical systems in terms of simple bilinear transforms. Second, paraxial ray tracing does not fail. Exact rays can miss surfaces or undergo total internal reflection. Finally, paraxial rays determine the ideal performance of a lens. In a well-corrected lens, the aberrations are balanced so that the exact rays come to the image points defined by the paraxial rays, not the other way around.

There are two basic types of data used to describe optical systems. The first are the general data that are used to describe the system as a whole, and the other are the surface data that describe the individual surfaces and their locations. Usually, an optical system is described as an ordered set of surfaces, beginning with an object surface and ending with an image surface (where there may or may not be an actual image). It is assumed that the designer knows the order in which rays strike the various surfaces. Systems for which this is not the case are said to contain non-sequential surfaces, which are discussed later.

General system data

The general data used to describe a system includes the aperture and field of view, the wavelengths at which the system is to be evaluated, and perhaps other data that specify evaluation modes, vignetting conditions, etc.

Aperture and field of view

The aperture and field of view of a system determine its conditions of use. The aperture is specified by the axial ray, which emerges from the vertex of the object surface and passes through the edge of the entrance pupil. The field of view is specified by the chief ray, which emerges from the edge of the object and passes through the center of the entrance pupil.

There are various common ways to provide data for the axial and chief rays. If the object is at an infinite distance, the entrance pupil radius and semi-field angle form a convenient way to specify the axial and chief rays. For finite conjugates, the numerical aperture in object space and the object height are usually more convenient.

Some programs permit the specification of paraxial ray data by image-space quantities such as the f-number and the image height, but such a specification is less desirable from a computational point of view because it requires an iterative process to determine initial ray-aiming data.

Wavelengths

It is necessary to specify the wavelengths to be used to evaluate polychromatic systems. Three wavelengths are needed, to enable the calculation of primary and secondary chromatic aberrations. More than three wavelengths are required to provide an accurate evaluation of a typical system, and many programs provide additional wavelengths for this reason. There has been little standardization of wavelength specification. Some programs assume that the first wavelength is the central wavelength, while others assume that it is one of the extreme wavelengths; some require wavelengths in microns, while others require nanometers.

Other General data

Several other items of general data are needed to furnish a complete lens description, but there is little consistency between programs on how these items are treated, or even what they are. The only one that warrants mention here is the aperture stop. The aperture stop is usually defined to be the surface whose aperture limits the angle of the axial ray. Once the aperture stop surface is given, the positions of the paraxial pupils are determined by the imaging properties of the system. Since the aperture and field of view are determined formally by the paraxial pupils, the apertures are not associated with the exact ray behavior.

The "vignetting factor" is used to account for the differences between paraxial and exact off-axis ray heights at apertures. In particular, the vignetting factor provides, in terms of fractional (paraxial) coordinates, the data for an exact ray that grazes the apertures of a system. Typically, there is an upper, lower, and skew vignetting factor. The details of how such factors are defined and handled are program dependent.

Surface data

Surface location

There are two basic ways to specify the location of surfaces that make up a lens. One is to specify the position of a surface relative to the immediately preceding surface. The other is to specify its position relative to some fixed surface (for example, the first surface). The two ways lead to what are called local and global coordinates, respectively. For ordinary lenses consisting of a series of rotationally symmetric surfaces centered on an optical axis, local coordinates are more convenient, but for systems that include reflectors, tilted and/or decentered surfaces, etc, global coordinates are simpler. Internally, optical design programs convert global surface data to local coordinates for speed in ray tracing.

Most optical design programs use a standard coordinate system and standard sign conventions, although there are exceptions.[i] Each surface defines a local right-handed coordinate system in which the z axis is the symmetry axis and the yz plane is the meridional plane. In local coordinates, each surface defines a local coordinate system, which is used to describe the surface under consideration, and also the origin of the next coordinate system. Tilted elements are described by an Euler-angle system in which is a tilt around the x axis, is a tilt around the y axis, and is a tilt around the z axis. Since tilting and decentering operations are not commutative, some data item must be provided to indicate which comes first.

Surface profile

Of the various surfaces used in optical systems, the most common by far is the rotationally symmetric surface, which can be written as[ii]

c is the curvature of the surface; k is the conic constant, and d, e, f, and g are aspheric constants. The use of the above equation is almost universal in optical design programs. The description of conic surfaces in terms of a conic constant instead of the eccentricity e used in the standard mathematical literature allows spherical surfaces to be specified as those with no conic constant (the conic constant is minus the square of the eccentricity).

Although aspheric surfaces include all surfaces that are not spherical, from a design standpoint there is a demarcation between "conic" aspheres, and "polynomial" aspheres described using the coefficients d, e, f, and g. Rays can be traced analytically through the former, while the latter require numerical iterative methods.

Many optical design programs can handle surface profiles that are more complicated than the above, including cylinders, torics, splines, and even general aspheres of the form z = f(x,y), where f(x,y) is an arbitrary polynomial. The general operation of an optical design program, however, can be understood by considering only the rotationally symmetric surfaces described here.

As mentioned above, the importance of paraxial rays in optical system design has led to the indirect specification of lens data, using solves, as they are called, which permit a designer to incorporate the basic paraxial data describing a lens with the lens itself, rather than having to compute and optimize the paraxial performance of a lens as a separate task. Considering the jth surface of an optical system, let

The paraxial ray trace equations can then be written as[iii]

These equations can be inverted to give the curvatures and thicknesses in terms of the ray data. We have

The specification of curvatures and thicknesses by solves is considered to be on an equal basis with the direct specification of these items. The terminology used to specify solves is that the solves used to determine thickness are called height solves, and the solves used to determine curvature are called angle solves. Often, an axial ray height solve on the last surface is used to automatically locate the paraxial image plane, a chief ray height solve on the same surface to locate the exit pupil, and an axial ray angle solve is used to maintain a given focal length (if the entrance pupil radius is fixed). In some programs, additional types of solves are allowed, such as center of curvature solves, or aperture solves.

Of course, specifying lens data in terms of paraxial ray data means that whenever any lens data is changed, two paraxial rays must be traced through the system to resolve any following data that are determined by a solve. In an optical design program, this function is performed by a lens setup routine, which must be efficiently coded, since it is executed thousands of times in even a small design project.

Other functions of the lens setup routine are to precalculate values that are needed for repetitive calculations, such as refractive indices, rotation and translation matrices, etc. Many programs have the capability of specifying certain data items to be equal to () the value of the corresponding item on a previous surface. These are called pickups, and are needed for optimization of systems containing mirrors, as well as maintaining special geometrical relationships. Programs that lack pickups usually have an alternate means for maintaining the required linking between data items. Like solves, pickups are resolved by the lens setup routine, although they do not use paraxial data.

Other surface data

A variety of other data are required to specify surfaces. Most important are apertures, discussed below, and refractive indices. Refractive indices are usually given by specifying the name of a catalog glass. In the lens setup routine, the actual refractive indices are calculated using an index interpolation formula and coefficients supplied by the glass manufacturer, together with the design wavelengths stored with the lens data. Other surface-related items include phase data for diffractive surfaces, gradient-index data, holographic construction data, and coatings.

Apertures have a somewhat obscure status in many optical design programs. Although apertures have a major role to play in determining the performance of a typical system, they do not usually appear directly in optimization functions. Instead, apertures are usually controlled in optimization by targets on the heights of rays that define their edges. If an aperture is specified directly, it will block rays that pass outside of it and cause typical optimization procedures to become unstable. Accordingly, some programs ignore apertures during optimization. Other programs allow the apertures to be determined by a set of exact "reference rays" that graze their extremities.

Non-sequential surfaces

In some optical systems, it is not possible to specify the order in which a ray will intersect the surfaces as it progresses through the system. The most common examples of such systems are prisms such as the corner-cube reflector, where the ordering of surfaces depends on the entering ray coordinates. Other examples of non-sequential surfaces include light pipes and a variety of non-imaging concentrators. Non-sequential surfaces can be accommodated by many optical design programs, but for the most part they are not "designed" using the program, but rather are included as a subsystem used in conjunction with another part of the system that is the actual system being designed. Data specification of non-sequential surfaces is more complicated than ordinary systems, and ray tracing is much slower, since several surfaces must be investigated to see which surface is the one actually traversed by a given ray.

Lens setup

Whenever the data entry process is completed, the lens must be "set up". Pickup constraints must be resolved. If the system contains an internal aperture stop, the position of the entrance pupil must be determined. Then paraxial axial and chief rays must be traced through the system so that surface data specified by solves can be computed. Depending on the program, a variety of other data may be precomputed for later use, including aperture radii, refractive indices, and various paraxial constants.

The lens setup routine must be very efficient, since it is most heavily used code in an optical design program. In addition to running whenever explicit data entry is completed, the code is also executed whenever the lens is modified internally by the program, such as when derivatives are computed during optimization, or when configurations are changed in a multi-configuration system. Typically, lens setup takes milliseconds (at most), so it is not noticed by the user, other than through its effects.



[i]U.S. Military Handbook for Optical Design, republished by Sinclair Optics, Fairport NY 14450 (1987).

[ii]G.H. Spencer & M.V.R.K. Murty,"Generalized Ray-Tracing Procedure", J.Opt.Soc.Am. 52, 672-678 (1962).

[iii]D.C. O'Shea, Elements of Modern Optical Design, John Wiley & Sons, NY (1985).