Homemade autostacker (work in progress)

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

Moderators: rjlittlefield, ChrisR, Chris S., Pau

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

Homemade autostacker (work in progress)

Post by enricosavazzi »

Here is an autostacker I have been building for the past few weeks. This is definitely not meant to be portable, and is for use as laboratory equipment. Since it was not clear to me whether additions would be needed, I decided from the start to use containers of generous sizes for the different parts. In fact, it would be possible to move all the electronics to the open aluminium enclosure where the motor is housed, and have only the display, switches and jog control in a smaller table-top enclosure.

The focusing rack is an Olympus BX30MF I discussed in an earlier thread. Its fine focus axle is coupled to a stepper motor that does 200 steps per revolution, controlled by electronics capable of microsteps of 1/8 of a step (which turns out to be quite adequate for precision - in theory 125 nm per microstep). Microstepping makes the motor rotate more evenly and silently. The motor does not get feedback from a rotary encoder, since from tests it seems not to "lose" any steps when operated at reasonable speeds.

The controller is built around an Arduino Mega, which provides more interrupts and I/O lines than the Arduino 2009 (almost all external interrupts are in fact used in my design). The control buttons are fast up, slow up, slow down and fast down, plus an Enter key. The stepper motor controller is on a separate preassembled board, and the relay used to trigger the camera shutter on a third board. All parts were purchased on eBay.

Perhaps the most unusual thing in my design is the addition of a jog control with 100 steps per revolution, which is used to move the rack and to set the stack start, stack end and slice thickness values. It doubles as a remote control for the fine focus, and in fact it is very precise and very handy for this function. The buttons are also usable as remote focus controls. The coarse focus knob of the rack can always be used for manual focus (but of course operating it in the middle of a stack would mess it up). The fine focus knob can be used when the control box is switched off (the motor resists manual turning when powered).

Two limit switches close when the stack approaches the limits of its travel. This causes the fine focusing knob to be rotated back to a safe position, and avoids overloading the stack.

This autostacker is already functional, although the firmware can be polished by adding more functions. Covers will be needed for the motor compartment. Except for a few minor bugs in the firmware, I did not discover any faults that require modification.

I will keep more details for a book I am writing, but those of you who already know how to use microcontrollers do not need to wait for the book publication and can already get ideas from this post.

Image
--ES

AndrewC
Posts: 1436
Joined: Thu Feb 14, 2008 10:05 am
Location: Belgium
Contact:

Post by AndrewC »

If you like playing with microcontrollers, a potential useful mod is to use a rotary encoder and check for lost steps - lets you know when you have run into a brick wall :)

The other nice trick that I've coded into mine is to have single up / down buttons and as you hold one engaged it first jogs a single step and then if you keep holding it down starts a continual movement first slowly and then accelerates to a high limit.
rgds, Andrew

"Is that an accurate dictionary ? Charlie Eppes

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

Post by enricosavazzi »

Hi Andrew,
AndrewC wrote:If you like playing with microcontrollers, a potential useful mod is to use a rotary encoder and check for lost steps - lets you know when you have run into a brick wall :)
Yes, a rotary encoder has a number of possible uses, like allowing the focusing knob to be turned manually without losing track of the current rack position. I left it out of my design for simplicity and because the motor seems well behaved enough not to miss any steps.
The other nice trick that I've coded into mine is to have single up / down buttons and as you hold one engaged it first jogs a single step and then if you keep holding it down starts a continual movement first slowly and then accelerates to a high limit.
Also a good use for a microcontroller. I use a similar algorithm for the Up Slow and Down Slow buttons, but for me it works better to gradually accelerate rather than the (1) one step (2) wait (3) run continuously behaviour.
I built acceleration and deceleration in the Up Fast and Down Fast button handlers and automated stacking as well, which makes it gentler on the motor and focusing rack. However, the jog control is far better than buttons for fine to moderately fast adjustments, so I end up using the jog all the time rather than the Up Slow and Down Slow buttons. The Up Fast and Down Fast buttons, instead, are useful for faster operation than allowed by the jog.

So far I am using a linear ratio between jog control rotation and motor rotation, regardless of jog speed. Four phase changes of the jog control (i.e. one click-stop of the jog knob) trigger a microstep of the motor. It could be advantageous for faster jogging to dynamically increase the number of microsteps when the jog control rotates fast. However, this means a non-linear behaviour, so the scale around the knob of the jog controls can no longer be used.

Other details worth thinking about are exercising the motor when the autostacker is switched on (a few dozen steps up, then back down) to get the mechanism "unstuck", as well as taking up any slack before beginning the stack. This is done by intentionally overshooting when bringing back the focuser to the start position of the stack after recording the end position of the stack, then travelling back to the actual start (i.e., moving a short distance in the same direction that will be followed during the stack).

Another item to decide is whether to display the stack settings in µm versus microsteps. I decided for the former, which means that one jog step/motor microstep, which is the "atomic" unit of travel of my system, corresponds to slightly more than 0.2 µm and the displayed values jump in intervals of 0.2-0.3 µm.
--ES

Post Reply Previous topicNext topic