Zerene Stacker

StackShot Controller Interface

Summary

StackShot is an automated macro focusing rail that makes it quick and easy to capture stacks of any depth. The StackShot is very precise and can be used for any focusing application ranging from macro with a few inches of depth down to high magnification microscopy with depth of field measured in microns.

The StackShot rail comes with its own controller box that permits stand-alone operation using buttons and a small alphanumeric display.

However, many people prefer to plug the StackShot into a USB port on their computer, then control it directly from Zerene Stacker using a graphical user interface on their computer.

This feature is available for 30 days free trial starting from first use of the feature. After the trial is completed, you'll need a Professional or Prosumer Edition license to continue using it. Personal and Student Edition licenses can be upgraded to Prosumer or Professional for the difference in purchase price. Just email support@zerenesystems.com for details.

For practical purposes, you can think of the StackShot interface as being divided into two major features:

  1. A graphical user interface that allows a USB-enabled StackShot to be controlled from within Zerene Stacker. This interface mimics the coarse- and fine-focus controls of a microscope, as well as providing traditional forward/backward buttons. It provides finer control over rail movements than is provided by the stand-alone StackShot controller.

  2. “Stack New Images”: a capability to ingest and stack new images on the fly as they are acquired by a tethered camera. This feature works nicely in conjunction with the StackShot, but it can also be used without the StackShot, in other setups that provide a tethered camera.

StackShot Interface

Installing the StackShot device drivers

If your computer is connected to the Internet, then in most cases drivers will be installed automatically for you when you first plug in the StackShot. If they are not, then the information in this section will be helpful.

Zerene Stacker uses industry-standard device drivers for the USB chip that is utilized by the StackShot controller.

For Windows computers (Windows 8, 7, Vista, and XP) that are connected to the Internet, the required drivers usually will be automatically located and installed by the operating system when the controller is first plugged in. For computers that are not connected to the Internet or cannot find the proper drivers online for themselves, drivers for the Stackshot controller can be downloaded from http://www.ftdichip.com/Drivers/D2XX.htm. At the current time, the setup executable for Windows (both 32-bit and 64-bit systems) is http://www.ftdichip.com/Drivers/CDM/CDM20830_Setup.exe, except for Windows 8.1 it is http://www.ftdichip.com/Drivers/CDM/CDM v2.08.30 WHQL Certified for Windows 8.1.exe. Simply download this file, burn it to CD or thumbdrive, transfer it to the offline machine, and run the executable there.

For Macintosh computers, drivers are provided as part of the Zerene Stacker bundle and will be installed by Zerene Stacker itself if necessary. You do need to run this process from an account with administrative privileges, and you'll be asked to provide the password for that account. Other than that, Zerene Stacker manages all the details of selecting the proper driver for your system and copying it into /usr/local/lib for you.

For Linux, the StackShot interface is not yet supported. If you want to use StackShot on a Linux system instead of Windows or Mac OS X, please contact support@zerenesystems.com .

Using the Zerene Stacker controls

Position and Shooting

Once a StackShot has been connected to your computer and the appropriate device drivers have been loaded, Zerene Stacker’s interface can be activated by selecting Tools > Stackshot from the Zerene Stacker menu system.

image001.jpg

Clicking this entry will cause a new window to appear:

image002.jpg

The rail position can be adjusted with any of the controls indicated by the red arrows, or by typing a value into the Rail Position field. Sliding the small solid triangle left-right provides very coarse positioning, turning the large outer dial provides finer control at 2 mm per turn, and turning the small inner dial provides finest control at 0.2 mm per turn. (To turn a dial, position your cursor over the black dot, then press-and-drag in a circular manner.)

“Back” and “Fwd” buttons act like the corresponding physical buttons on the Stackshot controller box. They cause the rail to move incrementally, with acceleration, using the maximum speed and ramp time settings from the Configuration panel.

“Set Start” and “Set End” buttons specify the start and end of stack as being the current rail position. Values can also be entered by typing into the corresponding fields.

“Go to Start” and “Go to End” move the rail to the specified positions. They are used to confirm that the desired endpoints have been specified.

Step Size must be manually entered by typing. (Be sure to press Enter on the keyboard when finished.)

# Steps will update automatically as the Start, End, or Step Size fields are set.

“Shutter” button is used to confirm that the camera, flash, and image acquisition software have been set properly.

“Shoot Stack” button begins the shoot/move/shoot/move… sequence. Once this button has been pressed, it will change to a red “Stop Shooting” button that can be used to interrupt the sequence.

Panic Stop

The Panic Stop button will immediately stop rail movement and shooting. Panic stop is also triggered by pushing any physical button on the StackShot controller box while the rail is moving. If the computer loses control of the rail, say because of some problem in the USB interface, then pushing a physical button on the StackShot controller box should still stop the rail.

Hotkeys

A small set of hotkeys is currently provided. Currently there is an “asdf” set for Back (“a”), Fwd (“s”), Set Start (“d”), and Set End (“f”). The “left-arrow” and “right-arrow” keys may also work for Back and Fwd, but these may require that one of the buttons is clicked first in order to direct keyboard input properly. Currently the assignment of hotkeys is fixed, but these will be adjustable in subsequent versions.

Configuration Settings

At the Configuration tab are controls that you will generally set once and then leave unchanged for many stacks.

Within the Configuration tab, settings are broken into two major sections, Stack Settings and Device Settings.

Stack Settings are values that relate primarily to timing. At each focus step, the sequence of operations is this:

  1. Pause for mechanical vibrations to die down (“Settling time”)
  2. Activate shutter for specified time (“Shutter pulse time”)
  3. If there are remaining “Number of shutter pulses per focus step”, then
    • Pause (“Time between shutter pulses”)
    • Repeat from step 2
  4. Pause (“Time after last shutter pulse per focus step)
  5. Move rail carriage (distance of “Step Size” on Common Controls tab)

This entire sequence repeats the number of times indicated by ”# Steps” (number of steps) on the Common Controls tab.

Device Settings are values that relate to mechanical movement of the rail.

“Maximum Rail Speed” and “Ramp time” control how fast the rail moves and how quickly it speeds up and slows down. These should be adjusted to your needs so as to make the Fwd and Back buttons behave comfortably. Typical values are 2 mm per second and 8 seconds ramp time as shown here.

“Millimeters per rotation of stepper motor”, “Microsteps per rotation”, and “Backlash distance” describe the hardware. Shown here are values that correspond to a standard StackShot rail: 16 microsteps per each of 200 full steps per rotation, driving a 16-turns-per-inch screw. The backlash distance will vary from rail to rail and must be determined by experiment. Whatever values you need can be typed into these fields. For example, if a 0.9° stepper motor were used to drive a microscope focus block at 100 microns per rotation, then the proper settings would be 0.100 millimeters per rotation, 6400 microsteps per rotation, and backlash distance 0. In general, backlash distance should be adjusted so that when you rock the nominal rail position back and forth by a small amount using the focus knobs, the physical rail position changes by a similar amount. This setting will facilitate moving the rail to determine start/end positions of the stack. Two procedures for calibrating backlash are given HERE.

“Prerun distance” allows you to specify a distance that the rail should “back off” before moving to the start position to begin shooting a stack. It will also back off before positioning in response to the “Go to Start” and “Go to End” buttons. The purpose of prerun is to guarantee that all types of mechanical slack have been removed before the designated position is reached. The main type of slack is backlash along the rail axis, but usually there is also a small amount of rotational backlash that can be important at higher magnifications. Be careful when using prerun at short working distances, to avoid running your lens into the subject. When moving to Start, the prerun position will be on the side away from End. To be safe, you should set Start to be farther away from your subject, and End to be closer. That way prerun will first move the lens farther away from the subject, then advance it toward the subject to reach the target position.

“High precision threshold” indicates a step size at which Zerene Stacker should switch the rail from normal to “high precision” mode. The difference is that in normal mode the rail position is accurate to roughly 0.005 mm uncertainty, while in high precision mode the accuracy is increased to roughly 0.001 mm uncertainty. Obviously high precision mode is better for fine work, such as through a high power microscope objective where the nominal step size may be only 0.010 mm or less. However, high precision mode has the drawback that it causes the stepper motor to produce a nearly continuous high-pitched whining sound that can be annoying to people around it. Often a good strategy is to set the high precision threshold to something like 0.020 mm so that large steps are done in normal mode and the rail is quiet except when it is actually moving, while small steps are done in high precision mode where the increased accuracy is required.

“Log all communications” causes every communication event between Zerene Stacker and the StackShot to be written into Zerene Stacker's console log. This is useful as a debugging tool.

“External trigger command” is an optional command that is sent to the computer's operating system at the same time that a shutter command is sent to the StackShot controller. This can be used in conjunction with third-party software to drive cameras that are not compatible with the StackShot's shutter control hardware. For example, on one Macintosh system we set up to drive a Hasselblad medium format back via FlexColor software, by defining an AppleScript program as follows:

  tell application "FlexColor"
      activate
      tell application "System Events"
          keystroke "n" using {command down}
      end tell
  end tell

and setting “External trigger command”

  /usr/bin/osascript /Applications/FlexColor/FlexcolorCapture.scpt 
  

Zerene Stacker can also be made to simulate keystrokes and mouse actions by itself, even on Windows systems. This is useful for driving third party applications that are not prepared to be launched or controlled by command line actions. This “robot” capability is described separately, HERE.

Torque and similar parameters are still specified using buttons on the StackShot controller, at this time.

Notes

Rail Noise

If the StackShot controller is working in “high precision” mode, then it will emit a faint high-pitched whining sound whose loudness and pitch depends on rail position. This sound is normal and is not harmful. It is caused by a special high-precision mode of operation that is used by the Zerene Stacker interface to provide reliable movement even down to 1 or 2 microsteps per focus step (roughly 1 micron, using the StackShot rail). In the Zerene Stacker interface, selection of high precision mode depends on step size and a user-settable threshold in the Configuration panel. If the step size is less than the high precision threshold, then the rail will be driven in high precision mode, otherwise it will be left in normal mode.

To disable high precision mode altogether, simply set the threshold to zero.

Firmware Bug

There is a small bug in the StackShot controller firmware as of version 1.0.05 Dev / Oct 27 2010 / 17:46:05. Sometimes if the rail direction is reversed while the rail is still moving, the controller will drop into a mode where it moves the rail very slowly for some seconds, then resumes normal operation. This seems to have no ill effect except for briefly disturbing the human operator. The current version of the Zerene Stacker controller includes a workaround for this bug so it should no longer appear to the user. However, we are continuing to document it for a while in case it reappears. (Please let us know if you see it!)

Backlash

Especially at high magnification, backlash can be an issue even after careful tuning. Not only is it difficult to determine the proper value to remove exactly all slack from the screw — not too much, not too little — but also there is likely to be lateral movement due to slight twisting of the rail carriage when it changes direction. A simple solution to these issues is to use the coarse dial to manually move the rail some distance “before” the nominal Start position, both before setting Start and End, and when actually shooting the stack. That way all forms of backlash will be taken up before any reference positions are established or moved to, so the amount of backlash really won’t matter at all.

“Stack New Images (PMax)”

To start this operation, use Stack > Stack New Images (PMax). When a project is open, and this operation is selected, then Zerene Stacker monitors some specified directory for the appearance of new images (.jpg, .jpeg, .tif, and .tiff files). As new images appear in that directory, they are automatically added to the project and stacked using the PMax method. This is particularly useful in combination with Options > Preferences > Preprocessing > Image Pre-sizing to a % value that allows computation to keep up with image acquisition. When the pre-sizing value is properly tuned, a good preview quality output image roughly 1500 x 1000 pixels can accumulate at the same rate that images are acquired, so that a final output is available only a few seconds after the last frame is shot. (For example, a value of 30% allowed our own laptop computer to keep up with Canon T1i image acquisition at 4752×3168 pixels and 5 seconds per frame.)

The directory to be watched is specified at Options > Preferences > Preprocessing > “Watch directory”. The directory must exist at the time Stack New Images is invoked.

Recipes

The following step-by-step “recipes” for operation are provided to give some ideas for how to use the StackShot interface in practice. The precise steps will vary with other cameras and support software. Quite likely you can figure out better recipes even for the configurations that we show here!

Connect Cables and Initialize Rail Position

  1. USB from computer to StackShot controller
  2. Motor drive from StackShot controller to rail
  3. Shutter cable from StackShot controller to camera
  4. USB cable from camera to computer
  5. Power to StackShot controller
  6. Use buttons on StackShot controller to position StackShot rail near its center position.

Canon T1i with Canon EOS Utility software

  1. Power on camera. Canon EOS Utility program may start automatically at this time. If it does not, then start it manually.
  2. Press “Remote Live View Shooting” button in the window titled “EOS REBEL T1i”. The current Live View image will be displayed on the computer screen.
  3. Illuminate, compose, and frame your subject.
  4. Choose f-number and corresponding focus step size.
  5. Launch Zerene Stacker.
  6. In the Zerene Stacker menus, select Tools > Stackshot.
  7. Reposition and resize windows as necessary, so that you can simultaneously see the main Zerene Stacker window, the StackShot controller window, and the EOS Utility Remote Live View window.
  8. Use focus dials and buttons in Zerene Stacker’s StackShot controller to establish start and end of stack.
  9. Press Live View button on camera so as to make the camera display the Live View image on its own monitor. (This is important. If the camera is in Live View mode but is not displaying the Live View image by itself, then the camera will ignore shutter commands coming from the StackShot.)
  10. Press “Shutter” button to confirm control over the camera, and (if necessary) to force EOS Utility to create its target directory to download image files.
  11. Options > Preferences > Preprocessing > Watch Directory, and select the directory being used by EOS Utility for image download.
  12. File > New Project
  13. Stack > Stack New Images (PMax)
  14. Shoot Stack
  15. Sit back and sip your favorite drink while automation does all the work.

Here is what the screen looks like, most of the way through the process. In this image, the left side of the screen is occupied by Zerene Stacker using an over/under layout. The right side of the screen shows EOS Utility Remote Live View at top, the Zerene Stacker StackShot Controller at bottom, and behind that, an EOS Utility QuickPreview showing one of the captured images resized to full screen.

You may have to look close to see it at this scale, but notice that the front of the coins is fuzzy in the ZS window at top (the most recently processed input frame), while it is quite sharp in the ZS window at bottom (current output window). The difference is much more obvious in the Live View window because it is showing a view with the lens aperture wide open, while the other windows show images as shot, stopped down to f/11 in this case.

image004.jpg

Nikon D5000 with Nikon Camera Control Pro 2 software

  1. Power on camera. Camera Control Pro 2 software may start automatically at this time. If it does not, then start it manually.
  2. In Camera Control Pro 2, go to the Camera menu and be sure that Enable Controls on Camera Body is checkmarked.
  3. Go to Tools > Download Options to specify where images will be placed.
  4. Press “Lv” button at bottom right of Camera Control Pro window. The camera live view image will appear in a window titled “Live View (wide area)”.
  5. Illuminate, compose, and frame your subject.
  6. Choose f-number and corresponding focus step size.
  7. Launch Zerene Stacker.
  8. In the Zerene Stacker menus, select Tools > Stackshot.
  9. Reposition and resize windows as necessary, so that you can simultaneously see the main Zerene Stacker window, the little StackShot controller window, and the Camera Control Pro Live View window.
  10. Use focus dials and buttons in the StackShot controller to establish start and end of stack.
  11. Close the Camera Control Pro Live View Window. (The StackShot controller cannot trigger exposures if this window is left open.)
  12. Be sure that camera body and lens (if any) are both set in manual focus mode. (The StackShot controller may not be able to trigger exposures if these are set in automatic focus mode.)
  13. Press “Shutter” button to confirm control over the camera, and (if necessary) to force Control Pro 2 to create its target directory to download image files.
  14. Options > Preferences > Preprocessing > Watch Directory, and select the directory being used by Camera Control Pro 2 for image download.
  15. File > New Project
  16. Stack > Stack New Images (PMax)
  17. Shoot Stack

(Remaining operations as for Canon recipe, above.)

stacker/docs/stackshot · Last modified: 2014/02/22 20:25
Copyright 2013, Zerene Systems LLC, all rights reserved.