My article on global lens design and using commercial off-the-shelf lenses was recently published. This was my “swan song” before taking my current position. Here is a link to the article. There are resources included for the ZPL code. Hope you enjoy.
Synthesis of original optical designs is a challenging endeavor for novice lens designers. It is made more difficult when attempting to design a compound lens from off-the-shelf lenses. All but the simplest compound lenses resist ready analysis or understanding from a first-principles approach of geometric optics; however, many optical design packages include powerful optimization algorithms for both local and global searches. Despite the power of these tools, the initial construction of a starting lens and merit function remains crucial to the effective utilization of the optimizer. A workflow is presented for a generic starting design, construction of the merit function, and the optimization for a compound monochromatic objective lens composed only of commercial off-the-shelf lenses. A protocol is defined for the substitution of off-the-shelf lenses into a design with optical elements of arbitrary shape factor. Additionally, the theory and method for optimization of the shape factor via a macro in Zemax OpticStudio are provided to accelerate the substitution protocol and improve search results. The performance of the objective design is presented both before and after the off-the-shelf lens substitution and performance is compared to the design requirements. A tolerance analysis is performed and sensitivity and yield are discussed. The macro, lens design, merit function, and additional supporting code are provided.