Free software

About OpticalSetup

Copyright © 2026 Luca Genchi and contributors.

OpticalSetup is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

It is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

The numbers OpticalSetup reports come from models with stated limits; read each component's page in the wiki before relying on one.

If you use OpticalSetup in your research, teaching or publications, please cite the software:

Bertoncini, A., & Genchi, L. (2026). OpticalSetup - the optical workbench software [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.23191537

Examples / Fundamentals / Scan lens and tube lens: the galvo relayed to the back pupil

Scan lens and tube lens: the galvo relayed to the back pupil

Two lenses image a scanning mirror onto the back pupil of an objective, so that turning the mirror tilts the beam in the pupil without moving it, and the focus sweeps across the sample.

Open in the canvas →

A live trace of the setup above, shown as a picture. Open it in the canvas to take it apart, retune it, and save or export it as your own.

Background

A laser-scanning microscope moves a focused spot across the sample by changing the angle at which the beam enters the objective. An objective turns angle into position: a parallel beam entering at an angle θ is focused f tan θ from the axis, f being the objective's focal length. But the beam must still pass through the objective's back pupil at every angle. If it simply swung from a mirror some distance away it would slide across the pupil and be cut off at the ends of the scan.

The answer is to image the mirror onto the pupil. The scan mirror turns about an axis in the focal plane of a first lens, the scan lens. Together with the tube lens it forms an afocal telescope that projects an enlarged image of the beam at the mirror onto the back pupil of the objective, so that the beam only pivots within the pupil, without any lateral shift, while the focus moves across the sample[1].

The same two lenses set two other things. They widen the beam by the ratio of their focal lengths, and that ratio is chosen so that the beam roughly fills the pupil, which is what gives the objective its numerical aperture[1]. And they reduce the scan angle by the same ratio: a telescope that magnifies the beam demagnifies its angles.

What this setup demonstrates

A 488 nm laser with a 1.8 mm beam meets a galvo mirror that swings ±2° about its resting angle. A scan lens of f = 50 mm stands 50 mm after the mirror and a tube lens of f = 200 mm a further 250 mm on: the two share a focal point, where the beam comes to a focus (the intermediate image). The objective, f = 10 mm and NA 0.4, has its back pupil 200 mm after the tube lens, where the image of the mirror lies.

The lenses widen the beam four times, to 7.2 mm in a pupil of 8 mm. A turn of the mirror by 2° turns the beam by 4°, which the lenses reduce to 1° at the pupil, and the focus moves 10 mm × tan 1° = 0.17 mm. The enlarged view, 1 mm across, shows the focus sweeping along the sample plane as the scan plays (500 Hz, slowed down by the canvas's time scale). Select the objective at any moment of the scan: its inspector reports the back pupil 90% to 95% filled, all through.

Things to try. Set the mirror's scan waveform to Static and its centre angle to 2°: the beam stays tilted, the focus stays at the end of its sweep, and the objective still reports all through. Now move the objective 50 mm closer to the tube lens. The pupil is no longer where the mirror is imaged: the tilted beam has slid 0.9 mm across it, and the inspector reports it overfilled, about 80% through. Set the angle back to 0° and all of the beam passes again: only the ends of a scan are cut, which in an image shows as dark edges.

What you won't see

The scan lens and the tube lens are ideal thin lenses, and the objective is a single ideal plane with a stop at its back focal plane. Real scan and tube lenses are corrected, multi-element designs: the article cited above compares the aberrations of achromats and of more elaborate designs used as scan lenses. None of those aberrations exist in this setup, and the focus is as sharp at the edge of the scan as on the axis.

The scan is in the plane of the drawing only. A microscope scans in two directions, with a second mirror that cannot sit in the same place as the first; the ways around that (a second relay, or two mirrors close together) are not drawn. The waist printed in the enlarged view is the size an ideal Gaussian beam with this cone would have, and the sample is a plain block: no fluorescence is produced.

Related components

References

  1. A. Negrean and H. D. Mansvelder, “Optimal lens design and use in laser-scanning microscopy,” Biomedical Optics Express 5, 1588 (2014)