Focus versus stage orientation

I reconfigured my OFM to HiRes, which creates well-focused images. However, when I move the probe around, the focus gets worse. I think this is due to a slight misalignment between the lens and the stage, possibly a tiny tilt between the lens focus plane and the slide. I wonder if it’s possible to create an auto-leveling routine, similar to those used in 3D printers to align the build plate, that could correct the tilt by automatically adjusting the Z axis?

Do you mean that you need to re-focus after a move?
Or is it that the focus is not as good after re-focusing?

There can be tilt in the stage, that will give different focus across the image rather than different when you move.

There will be a change in z-position as you translate, and that will be noticeable at high magnification because the depth of focus is small. The flexure mechanism moves the stage sideways, keeping it parallel to the base. However as the legs are parallelograms the stage moves over the cap of a sphere. This is shown in

Do you mean that you need to re-focus after a move? Yes. And it pretty clear that you can not perfectly align the focus plane to the stage. My idea is if it would be possible to autocrrect the moving focus by tiny z steps.

One of the trade offs when making the design was not pure x/y motion, The stage is higher in the centre of the travel than at the edges. It is theoretically possible to add in a correction, but it wouldn’t be a linear correction, it would need to know the x/y position relative to the centre of motion.

Some work on improving centring is going on in v3 of the software, this may be easier to calibrate and fix live once that is more robust.

Height is basically h * cos(a) with h being the height of the main flexure beams and a being their angle against vertical. So the correction would be h * (1 - cos(a)). a is a compound angle from the combination of x and y movement. May be Pythagoras is good enough for that as an approximation. At least for the original OFM, Delta stage is a different kettle of fish both wrt movement and also as the beams are not vertical in neutral.

Are we running this code on the RaspberryPie? Then doing a bit of trigonometry should be fine. If this runs on some sort of Arduino we might want to use some Small angle approximation.

But yes, actually knowing where the stage is is a prerequisite. I wonder if one could do the opposite thing: After focus check how much the height changed and conclude how far to correct for the next move. Not sure if relying on the flatness of the sample is a recipe for disaster or not…

1 Like

I don’t have the precise geometry of the stage at hand but assuming +/-6mm movement for +/-6° I get h of 57mm. With 6° of movement we’d get a delta h of 0.31mm which is a lot for a microscope with a depth of field measured in microns or even below.