Automating microscope focus

Have questions about the equipment used for macro- or micro- photography? Post those questions in this forum.

Moderators: rjlittlefield, ChrisR, Chris S., Pau

Pau
Site Admin
Posts: 6053
Joined: Wed Jan 20, 2010 8:57 am
Location: Valencia, Spain

Automating microscope focus

Post by Pau »

I want to drive the microscope fine focus knob with a stepper motor.
This has been done by several members with excellent solutions. I want to expose my goals and limitations to get advice.

- I want to drive different microscopes and microscope blocs with a single motor (one at once, of course), so it must be easily mountable and dismountable.

- I want to control the device from the computer. I also want to have Live View at the computer screen, I'm using a Canon 7D USB tethered to EOS Utility under Win 7.
I've observed that the camera can fire with its shutter button when tethered but only if LV is set from the camera LV but not if LV is activated directly from the computer, this doesn't seem a big issue, will it behave the same if the camera is fired from the Wemacro or Arduino controller?

- I don't want to spend much money, Stackshot seems out of equation.

- I would like an Arduino based system but my electronics and software skills are close to zero so in this case I would need complete info and help or an of the shelf solution if available.

- All this seems to focus me at the Wemacro MicroMate http://www.wemacro.com/?product=micromate.

- It must be somewhat fool proof: I don't want to apply excessive torque to the focus knob if eventually it reaches its limits.
To couple it I'm thinking in a magnet at the motor shaft and a metal plate glued at the focus knob plate.

Please, give me your comments and ideas. Thanks in advance!
Pau

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: Automating microscope focus

Post by enricosavazzi »

Pau wrote:I want to drive the microscope fine focus knob with a stepper motor.
...
- It must be somewhat fool proof: I don't want to apply excessive torque to the focus knob if eventually it reaches its limits.
To couple it I'm thinking in a magnet at the motor shaft and a metal plate glued at the focus knob plate.
I will address the points where I can contribute, one at a time.

What you are proposing is essentially a friction clutch. It will work, but you must achieve a friction high enough not to cause any slippage during normal focusing, and low enough not to cause any damage to the focus mechanism at the end of its travel. This can be tricky. An additional disadvantage is that the motor will keep running after reaching the end of the focus travel, so the motor controller will lose track of where the stage is located along its travel range.

The better alternative is to add sensors to the stage or focus rack to detect when the focus range is close to either end. The most practical sensor type is optical (magnetic/reed switch sensors generally are less precise). The optical sensors have a (usually IR) LED shining on a photodetector, and additional electronics to provide a digital output signal for easily connecting the sensor output to an input of the motor controller. A shutter (in practice a small plastic or metal leaf) attached to the stage or focus rack will optically block the gap between LED and detector when the stage reaches a given position. The resulting signal to the controller is used to stop the motor without losing track of where the stage is.

In practice you need a single shutter and two detectors (one for the upper end of the travel, one for the lower end). Sometimes it is possible to use two shutters and a single detector, but in this case the motor controller will not directly know whether it reached the upper or lower end of the travel, and the software will have to make an assumption based on the direction of travel prior to detecting the shutter.
--ES

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: Automating microscope focus

Post by enricosavazzi »

Pau wrote:I want to drive the microscope fine focus knob with a stepper motor.
...
You may find that you want to alternate many times between manual focus and motorized focusing during each session. Stepper motors give a significant "holding force" even when completely powered off, so focusing with the motor mechanically connected to the focus shaft is impractical, and physically disconnecting the motor time-consuming (besides causing the controller to "forget" where the current travel position is).

I solved this problem by adding a precision rotary encoder to the motor controller. Turning the large knob of the encoder sends signals to the controller and rotates the fine focus axle accordingly. The advantage is that you can place the encoder anywhere it is ergonomically best. Another advantage is that the controller always remembers its current position, even when focusing manually, so it can always return to a previous position if necessary.

I also have four buttons (fast up, slow up, slow down, fast down) that, when pressed, continuously rotate the fine focus axle until released. In practice, this replaces the function of the coarse focus knob. By accelerating the motor at start and slowing it down at the end in software, the motion becomes smooth instead of "jerky".
Last edited by enricosavazzi on Wed Mar 28, 2018 6:52 am, edited 1 time in total.
--ES

enricosavazzi
Posts: 1474
Joined: Sat Nov 21, 2009 2:41 pm
Location: Västerås, Sweden
Contact:

Re: Automating microscope focus

Post by enricosavazzi »

Pau wrote:- I want to drive different microscopes and microscope blocs with a single motor (one at once, of course), so it must be easily mountable and dismountable.
There are mechanical problems with this goal, since different focusing racks likely require different ways of attaching the motor. For some uses, it may also be preferable to use stepper motors with 400 steps per revolution (e.g. microscopes). For other uses, 200 steps per revolution is more than enough. The direction of rotation of the focus knob can also differ in different microscope brands (which requires the motor wires to be connected differently, or the software to keep track of which direction of rotation is "up" and "down", respectively, for each rack).

Since small stepper motors are not that expensive, you may consider leaving the "right" type of motor permanently connected to each focus rack, and instead switch the controller (or computer) among the different racks. Equip each motor with the same connector, and you are done.

Don't forget to wire the end-of-travel detectors to the same connector, so you will only need to plug and unplug one connector. This means in practice four contacts for a two-phase stepper motor, and another four for the two optical end-of-travel detectors (each detector needs GND, +5V, and output, and the two detectors can share GND and +5V).

You may also want to mount a flashing LED on the microscope or focusing rack, to warn when the controller is operating automatically (e.g. during a stacking series) to remind you to keep your hands off the focus knobs. This requires two additional contacts.

It is also a good idea to have a "scram" button to stop the controller in emergencies, since the pressure applied by a stepper motor after demultiplying through the focus gears is quite high. The best solution is to combine the switch with the flashing LED by using an illuminated button, large enough that you will not miss it when it is necessary to press it really fast to save the objective or your fingers. Two more contacts for the switch (GND can be shared, so now we are up to 10 or 11 connector contacts - you might want to start with a 25-pin connector just in case, e.g. a DB-25 unless you might confuse it with a computer serial cable, in which case use a larger connector like DB-37).
--ES

houstontx
Posts: 395
Joined: Fri Jul 31, 2015 1:07 pm

Post by houstontx »

I have a prior Z focus drive motor with nikon adapter sleeve for sale. Doesn't have the controller. So its cheap! Not sure if its the encoded version or not. There is an open source software for prior drives:

https://micro-manager.org/wiki/Prior

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Post by mjkzz »

if your controller supports limit switches, you can install them along the travel path

Here is my controller that has a 3.5mm stereo jack, you can install two pieces of metal at where you want to stop moving (four pieces at each end, two share the same wire). when the two pieces of metal make contact, the controller will stop moving motor. Of course, you can install sophisticated limit switches, but two metals making contact is more than enough.

Image

ChrisR
Site Admin
Posts: 8668
Joined: Sat Mar 14, 2009 3:58 am
Location: Near London, UK

Post by ChrisR »

I've had similar thoughts to Pau's going on in the background.

There are only so many fine-focus knobs.
I was thinking of a library of 3D printable push-on wheels capable of being driven by a standard form and outer diameter, toothed belt or gear. There would be a multiplier for each depending on the focus per revolution. Most are 100 or 200µm per rev, and some would be "backwards", ok.

I'm thinking that in the interests of fitting multiple 'scopes, some step precision and backlash could be sacrificed.
Eg if the drive is 5% eccentric, use smaller steps and do 5% more of them - no big deal.

What's the best way to get the shape of a focus knob into a CAD program for a 3D printer?
Chris R

Pau
Site Admin
Posts: 6053
Joined: Wed Jan 20, 2010 8:57 am
Location: Valencia, Spain

Post by Pau »

Enrico, thank you very much for your time and excellent ideas.

I fear that you have not seriously considered my limitations:
Pau wrote: - I don't want to spend much money...

- ...but my electronics and software skills are close to zero...
enricosavazzi wrote:
Pau wrote:I want to drive the microscope fine focus knob with a stepper motor.
...
- It must be somewhat fool proof: I don't want to apply excessive torque to the focus knob if eventually it reaches its limits.
To couple it I'm thinking in a magnet at the motor shaft and a metal plate glued at the focus knob plate.
I will address the points where I can contribute, one at a time.

What you are proposing is essentially a friction clutch. It will work, but you must achieve a friction high enough not to cause any slippage during normal focusing, and low enough not to cause any damage to the focus mechanism at the end of its travel. This can be tricky. An additional disadvantage is that the motor will keep running after reaching the end of the focus travel, so the motor controller will lose track of where the stage is located along its travel range.
...
Good ideas for sure.
I've tested the situation of my focus blocks
- All of them have flat surfaces at the fine focus knob end, so gluing a metal circle or washer would be easy.
- The Oly BHMJ and a noname one are self protected: when they arrive to the limit if you continue rotating the fine focus it just drives the coarse knob in the opposite direction with no damage
- The Zeiss WL has a very limited range (2mm) and high precision (100micron/turn) so it only will be used for high magnification with flat specimens. The stop is very solid and the fine focus very smooth so a friction clutch approach (likely a magnet) sould work OK
- The Zeiss Standard seems the more prone to damage (although having three stands I could assume some risks) because the fine and coarse knobs are gear linked and the limits are no neat, so when you arrive to them you're forcing the mechanics.

If the motor control loses its position this doesn't seem a big issue, I think that I just would need to set again the start and end positions.

The idea of the detectors is brilliant but I would need to install them at each stand, maybe in the future but for now it seems too complex for me
enricosavazzi wrote: I solved this problem by adding a precision rotary encoder to the motor controller. Turning the large knob of the encoder sends signals to the controller and rotates the fine focus axle accordingly. The advantage is that you can place the encoder anywhere it is ergonomically best. Another advantage is that the controller always remembers its current position, even when focusing manually, so it can always return to a previous position if necessary.
Again an excellent idea. With my skills it sounds like sci-fi for me, where to find and how to mount it? Would it play together with a controller like the Wemacro?
...and again excellent ideas about "scram" button (this one seems the easier to implement), LEDs, etc but again this would be for more skilled people and/or later upgrades
Pau

Pau
Site Admin
Posts: 6053
Joined: Wed Jan 20, 2010 8:57 am
Location: Valencia, Spain

Post by Pau »

mjkzz wrote:if your controller supports limit switches, you can install them along the travel path

Here is my controller that has a 3.5mm stereo jack, you can install two pieces of metal at where you want to stop moving (four pieces at each end, two share the same wire). when the two pieces of metal make contact, the controller will stop moving motor. Of course, you can install sophisticated limit switches, but two metals making contact is more than enough.
Thanks Mike,
Nice!, is it an off the self device? I think I can't replicate your designs, again my electronics skills are just inexistent.
I don't know if the controller could support it
Pau

Pau
Site Admin
Posts: 6053
Joined: Wed Jan 20, 2010 8:57 am
Location: Valencia, Spain

Post by Pau »

houstontx wrote:I have a prior Z focus drive motor with nikon adapter ...
Thanks, but just browsing the micro-manager site produces me headaches, although would be nice to see the device.
Pau

Online
Adalbert
Posts: 2427
Joined: Mon Nov 30, 2015 1:09 pm

Post by Adalbert »

Hello Pau,
If you had some time to assemble some wires I would recommend my solution:
http://www.photomacrography.net/forum/v ... highlight=
You could use a shaft coupling with an appropriate diameter.
This is probable the easiest way.
BR, ADi

Smokedaddy
Posts: 1954
Joined: Sat Oct 07, 2006 10:16 am
Location: Bigfork, Montana
Contact:

Post by Smokedaddy »

ChrisR wrote:... There are only so many fine-focus knobs. I was thinking of a library of 3D printable push-on wheels ...
Wouldn't the MicroMate wheel adapter design work with the 3 set screws? I would love to automate my MM-11 (which I"ve mentioned before).

mjkzz
Posts: 1681
Joined: Wed Jul 01, 2015 3:38 pm
Location: California/Shenzhen
Contact:

Post by mjkzz »

Pau wrote:
mjkzz wrote:if your controller supports limit switches, you can install them along the travel path

Here is my controller that has a 3.5mm stereo jack, you can install two pieces of metal at where you want to stop moving (four pieces at each end, two share the same wire). when the two pieces of metal make contact, the controller will stop moving motor. Of course, you can install sophisticated limit switches, but two metals making contact is more than enough.
Thanks Mike,
Nice!, is it an off the self device? I think I can't replicate your designs, again my electronics skills are just inexistent.
I don't know if the controller could support it
ah, yes, it is, the controller can be found here But of course, you have to make your own wiring, so yeah, it is not suitable for your specs. But then again, it makes me think that maybe it is better to have a limit switch kit . . . thanks.

in general, the concept of limit switch is to prevent something like ramping into one end and damage things, there is even a wiki page about it, and that is the idea I am pitching in.

Anyways, I tried :D

perdu34
Posts: 50
Joined: Fri Nov 25, 2016 7:03 am

Post by perdu34 »

Have you looked at using CNC boards to control your motors?

http://openbuildspartstore.com/cnc-xpro ... er-driver/

Image


Boards like the one above are essentially an arduino with some extra features, like dedicated limit switches. I know they aren't cheap but they can control up to 4 axis at a time and have a large support network.[/img]

houstontx
Posts: 395
Joined: Fri Jul 31, 2015 1:07 pm

Post by houstontx »

Pau wrote:
houstontx wrote:I have a prior Z focus drive motor with nikon adapter ...
Thanks, but just browsing the micro-manager site produces me headaches, although would be nice to see the device.
Image

Image

Post Reply Previous topicNext topic