3D Printer Microscope

I have been pondering increasing the range of motion for a flexure stage this morning. At some point I was wondering if one could just use a 3D printer. They do move relatively precisely. Range of motion is typically 15 to 30cm, which seems like great to scan a larger number of samples - even if it is just one row. They are also abundant and cheap, especially used.

So after a quick Google search I found the EnderScope that does just that: Adding a OFM like optic module to a 3D printer.

While this project is a great solution for their particular use case (Scanning for plastic particles in water filters) I don’t think is transfers well to many others. They are using a 4x objective, So they are more in the realm of a stereo microscope than a compound microscope (Yes, I know; neither of these terms really apply here).

So I tried to come up with some back of the envelope calculations if this approach would work at all for larger magnification.

X and Y axis of typical 3D printers have typically about 100 steps/mm already including micro stepping. This is 10um per step. The paper above gives a repeatability of +/- 4um so about somewhere within the given step. Field of view for a 100x objective with 20mm image size is 200um, even if a good portion of that is not used we can still assume a field of view of at least 50um (the pictures in the original OFM paper look more like 150um). So being off by 8 or 10 um would still allow scanning and stitching the images. Given that many use cases would rather use an air objective with 60x or less we can conclude that the XY movement should be sufficient. Modern drivers have even higher micro stepping so high demand applications could get even better results.

Z movement is another story, though. Depth of field of large magnification optics is very thin and far from the 0.5mm of the 4x objective used in the EnderScope. 40x has about 1um; 100x 0.4 to 0.2um. So we should aim for 0.1um steps in Z directions, for 100x may be even a bit smaller. If we limit ourselves to 20x and 40x a few less steps per mm may still do.

Most 3D printers use lead screws for the Z axis which gives additional reduction. Steps per mm are about 2560 (200 steps * 16 micro stepping / 1.25 mm per revolution) so ~0.4um steps. This may just be good enough for a 40x objective, assuming this theoretical value matches reality.

One could try to add more reduction to the Z axis, either by using a finer lead screw or adding a reduction between the motor and the lead screw. This would require non trivial changes to the mechanics of the printer. May be there are printer out there that already have a better resolution on the Z axis. I didn’t do a survey yet.

Another possible approach is adding a high precision (flexure based) Z actuator. This is something already demonstrated to have the necessary precision. Such 1 axis activator can replace the print head and be driven by the same model of motor as the printers extruder. This would allow using the printers electronic. Z movement could use the regular Z axis for rough movement (if this is needed at all) and the “extruder” head for focussing.

An elegant solution would be to add a 5:1 or 10:1 mechanical reduction directly in the optics head using a flexure. But this requires a fixed point to leverage against. And that is hard to come by. One could press a lever against the glass slight beside the cover slip and then pushing it down. The leverage would move the optics down at a reduced rate. This would probably work just fine until you try to move the head and have to deal with the friction between the head and the slide or move the head all way up to no longer touch. A 3D printer may just be fast enough to do that. It is still a crazy idea better left until everything else has been tried..

As there are basically no 3D printers that move the bed in X and Y the optics module needs to move in at least one axis. This is less than ideal but should be fine. It is about the same weight and size of an extruder and even similar to an hot end. As we move only very slowly and don’t have any physical contact with the sample (ignore the paragraph above) mechanical strain on the printer is much lower than during actual prints.

A moving optics unfortunately means that the illumination also needs to move. The EnderScope solves this by adding a LED ring around the optics. This is obviously not going to work for larger magnifications which need illumination through the sample.A possible solution is a C frame that wraps around the sample and holds the illumination module underneath pointing up towards the optics. This frame does not need to be attached to the precision Z axis. Adjusting the height of the illumination can probably done with the normal Z axis of the printer or some adjustment screw(s).

For this to work the samples can’t just lie on the build plate but need to be raised up or a custom build plate with holes for the illumination shining through and possibly a place for the C frame - unless it reaches out at the front and there is space underneath for it. The most universal solution is just having a sample holder that gets put on top of the build plate that has room underneath for the illumination.

Reflective illumination that couple the illumination into the tube don’t have this issue and may be a simpler use case for this idea even if this is the more complicated setup over all.

Following this idea most printers should be able to be transformed into an automated microscope without permanent changes. Simple replace the print head with the microscope head and then place/mount the sample holder on or instead of the print plate.

Software of course is another story. One I am not going to look into here. I don’t dare to ask what it would need to switch the movement in the OFM software to controll a 3D printer via gcode.

This would be great to see.

For z- motion, the separate z axis that is used on the Upright version of the OpenFlexure Microscope could be modified to fit where the extruder would be on a printer. As you say, it would need a different motor to be driven by the bi-polar drivers on a printer. It is also possible to modify the wiring in the motors we use to make them operate as bipolar steppers.

Hi all,

I have built a prototype of a “traditional” motorized microscope with travel that can cover a full slide.

It uses high precision leadscrews for all 3 axes. The stage moves in XY, while the objective moves in Z. I chose lead screw leads such that the positioning is precise enough for a 40x objective, though I’m having some issues with slop from my crummy linear bearings on the XY stage. The Z axis uses a MGN-type linear rail and is rock solid.

It uses bipolar steppers controlled by a simple driver board/arduino and the RPi hi-quality camera.

Since it diverges so completely from the OFM I haven’t tried reusing any of the software but I have basic motor control working and am attempting to reimplement the OFM autofocus method.

My eventual goal is to create a sub-1000 USD full slide scanner and/or interactive microscope with live tiling.

3 Likes

Are those Igus bearings? Those need to be pressed into a pretty precise hole of the right size to squeeze the slop out of them. Even if they are not: Check your data sheet on how they need to be mounted. Not sure if a 3D printed part is even stiff enough. If in doubt a metal sleeve may solve the issue.

Well, or traditional linear ball bearings if you still can find the space.

They’re plain plastic bushings from McMaster Carr but similar to Igus. I plan to replace them with ball bearings.

The Igus ones call for a H7 hole, so 0-12um oversized for 3-6mm diameter. That requires at least a reamer.

That’s an impressive looking machine! The as-yet-unreleased v3 of the microscope software should make it, in principle, relatively simple to swap out the stage and camera for g code and a Pi HQ camera respectively. Indeed, the HQ camera already works, but with a few annoying quirks. While there’s now a lot more development on v3 than v2, it’s still not quite stable enough that we are recommending everyone use it. However, I think it would be reasonable to suggest that taking v3 as a starting point (which already includes some quite good progress towards live tiling) would be less work than starting from scratch. The limiting factor, as usual, is documentation: while we have software that works most of the time, we are still trying to make it possible to navigate the codebase nicely…

This is a line of thinking we’ve gone down a few times, and never quite made it to implementing. As you say, 3D printer XY plus flexure Z should be a powerful combination - but transmission illumination is tricky. One option I’m curious about is LED array illumination: rather than a conventional condenser (which needs to be precisely aligned), an array of LEDs on the other side of the sample illuminates a much larger region, and one might get away with mounting it on a separate translation stage. So long as the error between the two is acceptable (and the tolerance here is likely ~1mm rather than ~10um) it might be much more compact and easier to work with. This comes with the caveat that I’ve never tried it - it’s just an option that seems to me like it might be a useful compromise.

I considered whether I should use an off-the shelf CNC controller that understands Gcode for motor control - what stopped me is that I believe Gcode is largely unidirectional and I didn’t know if there was a way for the controller to communicate back to the computer sending commands that a command had finished - something potentially really important for an automated microscope that needs to quickly switch between imaging and movement.

Anyway, for testing I reinvented the wheel and wrote a simple bipolar motor controller that understands serial commands and sends an acknowledgement when done with a move.

One thing that I’ve been thinking about for the hardware is using CoreXY type kinematics to move the stage/sample. It would allow for two fixed motors and the use of belts rather than gears and this might remove some backlash. But this comes at the price of a lot of extra idler pulleys and crazy belt routing and whatnot. We could somewhat control the step size via the diameter of the drive pulleys.

I think on balance it’s likely not worth the touble to design from scratch, but it might make sense to obtain a commercial corexy printer and convert the build plate axis (z only) to hold the objective and possibly illumination, and convert the print head carriage (XY) to a sample carriage.

The optics also need a bit of work. I believe I’m getting quite a lot of field curvature and axial chromatic aberration from the achromatic doublet and I’m thinking of replacing it with a multi element 75mm industrial camera lens.

Depending on the system there is M400 or G4 to wait for all commands to finish. Grbl e.g. uses the later. They will only return OK after everything is done.

1 Like

In that case I probably should have saved myself some work and just used GRBL. Live and learn.