Petrographic OFM v7 first build

Hi everyone,
I am a Canadian geologist with academia and industry experience. In my work, I collect a large amount of petrographic slides from surface samples. I have found that it is difficult to share information amongst colleagues that do not have access to a petrographic microscope. Common tools allow you to produce low resolution scans, or select high resolution photos taken with a microscope. My objective is to modify an OFM microscope to be able to scan the full surface of a petrographic slide in one or two sessions (46 x 26 mm) with a moderate magnification (10x). In order to understand the capability of the system, I have built an upright OFM v7 with no further modifications. Prior to making changes to the body to improve the stage range of motion, I wanted to share some notes from my build and also ask some question about the optics.


I have built the microscope over 3 evenings with no significant issues. I used TauLab’s Sangaboard and illumination system. Great communication and fast shipping. Highly recommended. Otherwise I used a raspberry 4B and the module 2 camera. I sourced the doublet lens from Surplus Shed (13 mm dia. 49 mm FL achromat doublet lens) and the nuts, bolts and Viton rings from McMasterCarr (USA). Here are the mistakes I made during the build:
(1) I broke one of the hinge of the flexure system, on the stepper motor side, when trying to fit the nuts in the stage but did not notice it until I had assembled the mechanical parts. This essentially limits the effective range of one of the axis. I had a spare body so I quickly re-traced the building steps the next day.
(2) I ordered a 30 cm pi-camera cable but it is too short. You need at least 50 cm for an upright build with an infinity corrected module.
(3) I connected the led module to the wrong port. I found the best information about where to connect the led module on the Sangaboard is on the forum. I would suggest adding a photo to the instructions.
(4) I used the monitor port to connect the camera on the Raspberry pi. Easy fix.
(5) For an upright build, the camera should be rotated 90 degrees to match the X-Y axis on the software. It is easy to generate a modified STL on openSCAD and I will print a new module to fix that.

I was not expecting the build to go that smoothly. I was equally impressed with the software and its scanning capability with autofocus. However, I believe I did not print the appropriate optic module for the microscope lens that I am using. I am using an Olympus MSPlan 10x/0.3, infinity corrected with a mechanical tube length of 180 mm. It is a good quality lens (low aperture of 0.3) so I would expect it to be quite sharp and have a good depth of field. I have not tested it on a commercial microscope.

The focus quality is reasonably good in the middle of the image but decreases radially so that most of the photograph is slightly out of focus. I have used the “optics_picamera_2_rms_infinity_f50d13.stl” file to print the optic module and I believe the sample is reasonably flat. There is a slight misalignment between the light source and the lens which produces a dark halo in the upper left corner but that doesn’t seem to impact the focus quality (all corners are equally out of focus). See the following pictures:


Plane polarized photograph of a partially chloritized (green) biotite grain (brown) surrounded by a quartz and plagioclase matrix (colourless).


Cross polarized photograph of a biotite grain (dark brown) next to a plagioclase grain (grey) with some basal twinning (different shades of grey along the grain’s long axis)
Edit: I also took a photograph of a business card with reflected light (Ikea office lamp!) to provide an homogenous pattern to better visualize the focus quality:

I had a look at the openSCAD parameter files and attempted to generate another optic module for an infinity corrected lens with mechanical tube length of 180 mm. I noticed a difference between the initial model I sourced from the website (green module in image below) and the one I generated (yellow modules) but no difference between models for an infinity corrected optic module with f=160 mm (centre) or f=180 mm (right).

I also had a look at the optic design page and noticed that the change of mechanical tube length from 160 to 180 mm should impact the focal length of the achromatic lens used to focus the image on the camera (from 50 mm to 63 mm). Does that mean I should be using the same optic module but with a different doublet lens?
Edit: After some extra reading I now understand that the mechanical tube length may not matter for infinity corrected lenses and that the focusing distance of between the sensor and the tube lens is what really matter. Adding to my confusion, I measured on the STL file and all optic modules in this photo have a distance of 49 mm between the seat of the doublet lens and where the the surface where the camera module gets sandwiched (where the breadboard sits) so the sensor should come short of the required focal length. Would that explain why my camera doesn’t focus perfectly? Meaning that the image is always in focused a few mm behind the sensor? ( Assembly Instructions (openflexure.org)

I hope this will help other people to build their microscope and that someone will be able to help me with my optics issue.
Cordially,
Nicolas

4 Likes

@NicolasPL this is a great build and a really useful set of notes and photographs, thank you for sharing them.
In the main photograph you have the v7.0.0-Beta1 version of the microscope stand, were you mainly working from the v7.0.0-Beta1 instructions as well, or the v7.0.0-Beta2 instructions released? I can see that you have the updated upright condenser, which was in the Beta1 bug fixes.

  1. It is a pity that a hinge broke. Your prints look good, there is a little ringing but the layers look to be well fused.
  2. We have some discussion of ribbon cable lengths on Gitlab Issue #323. I think I have 300mm on my upright, I shall need to check now! Maybe I have not got the infinity corrected optics module.
  3. This is in process of being sorted out. Sangaboard v0.5 and the illumination module from TauLab have come recently and the instructions have not quite caught up yet. The Beta2 instructions for Sangaboard v0.5 are for the LED module with a built in current limiter, which is described in the instructions.
  4. The monitor and camera ports on a Pi are identical and confuse many people.
  5. I had not noticed that. It may be that on mine I just switched the motor connectors on the Sangaboard. This could also be done easily in software - in the same way that the Deltastage x,y,z moves are mapped to the motors a,b,c. These are probably more robust solutions than having two versions of the optics module.

For the optics, you are right that a ‘tube length’ should not make a difference on an infinity corrected optic - the image is formed at infinity. However there is a known issue #158 that the infinity optics module is usually a little short - this is on my list to find out whether it is defined incorrectly or whether it is printing issues, or different back focal lengths of different nominally 50mm focal length lenses. The specified Thorlabs lens has a back focal length of 47.2mm, but the camera sensor surface is ~2mm above the camera board so the module is ~49mm from the back of the lens to the front of the camera board in that case. For an infinity corrected optics module it is very easy to check - take off the objective and the tube lens should give a focused image for objects that are far away. As it is usually too short rather than too long you can correct with shims in another thread on this topic.

1 Like

I think William has covered almost everything - but on the subject of the focus at the edges, there are potentially a couple of things going on:

  1. the saturation will drop at the edges, due to a limitation of the camera sensor. This can be corrected in post-processing, though the calibration is (currently) a bit painful. I have plans to fix it in the near future, but I am keeping my timescales deliberately vague.
  2. the f=50mm lens will introduce some field curvature, meaning that if you shift the focus slightly, you should see the centre of the image get fuzzier and the sharp region becomes a ring moving outwards from the centre. Focus stacking would, in theory, fix this and give a nice sharp image across the whole field.
  3. If anything is tilted, you’d see field tilt where instead of a ring, the focused region is a line that moves across the image as you adjust z. This is probably most likely due to the camera sensor not being parallel to the PCB (it’s usually stuck on with a foam pad) and I have not yet got a neat solution for fixing it.

If you play about with the focus and figure out whether it’s (2) or (3) I would be curious.

I’m also curious how you’re fitting your polarisers. I’m aware of one or two folk who have played with rotating polarisers, though I’m not sure any have shared their designs openly yet.

1 Like

I saw that in the images, which is a shame. Without enough light in the top left corner the colour balance correction is not able to give a flat colourless background.

I have not worked out a way of making it possible to align the condenser in the upright with the camera. At 10× you have quite a large field of view and the LED illumination spot is quite small so it does need to be aligned well. However the small spot is mainly because the condenser is designed to illuminate at high NA for high magnification lenses, and you don’t need that. You could try moving the condenser nearer or further away, or just using the LED with no lens, really close to the sample. From what I think the LED size is, 0.3NA would need the LED about 2mm from the sample.

Thanks for the advice Richard and William,
I have added 1.5 mm shims underneath the Pi camera and that seems to have improved the field curvature. Now more of the image is in focus.

I have been using the v7.0.0-beta2 instructions. They were great.

I haven’t worked a permanent solution for the polarizers yet. My goal is to scan full thin sections so I am not aiming for a rotating stage. I am using cheap polarizing films I sourced from amazon. I simply stuck one of them on top of the condenser lens to polarize the light below the specimen and I place a second one on top of the sample at a 90 degree angle to take cross-polarized photographs. It’s good enough to make simple mineralogical interpretations. Down the line I will make a thin section holder and a slider that will hold the second polarizer.