Zemax Modeling and Simulation

Objective

The primary objective of this project was to try to model and replicate the existing 6mm wide-angle lens marketed for use with the Raspberry Pi HQ camera in Zemax.

Specs

The 6mm wide-angle lens for the Raspberry Pi camera is sold on Adafruit with the spec sheet shown in the figure on the right (linked to the adafruit product page). Notably this lens has a focal length of 6mm, an F/# of 1.2, a field angle of 63º, a back focal length of 7.53mm, an image format of ½’, and a rough overall length of 34 mm.

Approach

Being a commercial lens it would make sense that this lens follows a standard lens form. With this logic, several traditional lens forms were chosen. Cooke triplet, Tessar, Ernostar, Sonnar, and Double Gauss lens forms were initially attempted [2]. All of those lens forms failed to adequately account for the high 31.5º half-angle field of view combined with the necessary 5mm entrance pupil diameter dictated by the F/# of 1.2 and the focal length of 6mm. In order to confirm that the issue fell on the lens forms, scaling of Zemax templates for the Cooke triplet and the double Gauss was attempted. These attempts however lead to numerous total internal reflection errors and ray aiming failures. 

In response to repeated failure with easily accessible traditional lens forms. A copy of the lens from Adafruit was opened and the first and second optical elements were observed as shown in Figure 2. The first element is clearly a cemented doublet with a planar first surface, difficult to discern but likely a positive radius second surface, and a positive third surface with a small radius. The total element is roughly 3 mm thick. The second element is a biconvex singlet. It is roughly 1 mm thick. Both of these lenses have some kind of coating that is presumably an anti-reflective coating. The assumption was made that the lens form is roughly symmetrical around the stop and thus was modeled as doublet-singlet-stop-singlet-doublet as shown in Figure 3. This design was improved until the focal length and F/# were close to their proper values and then the final surface was constrained by the image space F/# in order to constrain the focal length when combined with the entrance pupil diameter. In order to reduce pupil aberration paraxial ray aiming was used. The back focal length of 7.53 mm was held fixed in order to ensure similarity with the purchased lens. All surfaces, thicknesses, and glasses were made variable except for the initial planar surface and the final aperture-constrained surface.

Figure 3: Rough approximation of initial lens form.

For optimization, glasses were limited to 4x the value of the initial N-BK7 and N-F2 glass choices. Surface coatings were not optimized. The Merit function was calculated to optimize for the wavefront (spot size initially worked better but quickly produced results with large amounts of spherical aberration and astigmatism but little distortion), pupil integration was done with 4 rings and 6 arms, and boundary values for the glass and air were set. For the glass the following values were chosen: min 1, max 3, edge thickness 1. For the air the following values were chosen: min 0.5, max 4, edge thickness 1. These values were chosen based on intuition gathered from the lens disassembly. The merit function was then generated and several weights were manually adjusted (specifically for air minimum edge thickness on surface 8, and glass minimum center thickness on surface 2) to prevent surfaces from intersecting with each other in undesired manners. The hammer optimization algorithm was then run overnight. The resulting lens is shown in Figure 4.

Figure 4: Optimized lens and lens data

Characterization and Analysis of Performance

This lens has an effective focal length of 6 mm, a back focal length of 7.606178 mm, a total length of 33.11455 mm, an image space F/# of 1.2, and a working F/# of 1.320065. Looking at a Seidel diagram shown in Figure 5 it is apparent that though this lens is good from a general aberration standpoint, there is a disappointing amount of distortion. Looking at an FTT MTF graph shown in Figure 6 it is notable that the lens is capable of resolving frequencies much better at the 22.27 degree field than at normal incidence or maximum incidence. At the center and maximum fields, it becomes difficult to resolve frequencies above 160 or even less whereas with the middle incidence that can be extended to 320 or greater depending on whether the pattern is sagittal versus tangential. As shown in Figure 7 the max distortion occurs at the max field and is around 16%. While that is a lot of distortion when comparing the simulated image and the actual image [3] as presented in Figure 8 it is clear that the original lens has a large amount of distortion and is qualitatively rather similar to the modeled lens. When looking at ray fan plots (as shown in Figure 9) the existence of 3rd-order aberrations and pupil aberration is apparent and gets worse as the field increases. This is confirmed by the spot diagrams (Figure 10) which showcase more aberrated patterns as the field increases.

References

[1] A. Industries, “6mm 3MP Wide Angle Lens for Raspberry Pi HQ Camera.” Accessed: May 08, 2024. [Online]. Available: https://www.adafruit.com/product/4563

[2] Kats, “Optical Lens Design Forms: An Ultimate Guide to the types of lens design,” A Pencil of Rays. Accessed: May 08, 2024. [Online]. Available: https://www.pencilofrays.com/lens-design-forms/

[3]“Raspberry Pi High Quality Camera - Page 6 - Raspberry Pi Forums.” Accessed: May 08, 2024. [Online]. Available: https://forums.raspberrypi.com/viewtopic.php?f=43&t=272658&start=125#p1662752

Next
Next

Photography