Zerene Stacker

StackShot Controller Interface


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 10, 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/CDM21226_Setup.zip. Simply download this file, burn it to CD or thumbdrive, transfer it to the offline machine, and run the executable there.

For Macintosh and Linux computers, drivers are included in Mac OS X and Linux and will be configured by Zerene Stacker if necessary. You do need to run Zerene Stacker from an account with administrative privileges (one that is allowed to update Mac OS X), and you'll be asked to provide the password for the account that you're using. For most users, your regular account will work fine, and the password to provide is just the one that you normally use to login to your computer. Once the password is provided, Zerene Stacker manages all the details internally.

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.

Clicking this entry will cause a new window to appear:

The rail position can be adjusted with any of the controls indicated by the red arrows. 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.) A value can be typed into the text field, and the rail will move to that position when you hit Enter on the keyboard or click away from that field.

“Zero” button relabels the current position of the rail to be “0.00000”.

“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.

“Back Step” and “Fwd Step” buttons move the carriage by the amount specified in the Step Size field.

“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 that have been set. They are used to confirm that the desired endpoints have been specified.

“Step Size” is usually entered manually by typing. (Be sure to press Enter on the keyboard when finished.) Or if you have defined standard settings on the Step Sizes tab, then you can click to select there.

# 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 abort the sequence.

“Pause” button is used to temporarily interrupt the sequence when shooting a stack. It will change to “Resume” when pressed, and pressing “Resume” will let the sequence proceed from the point that it was interrupted. (Note: you should avoid repositioning the rail when the sequence is Paused. If you do, then proper position may not be restored when the sequence resumes.)

“Panic Stop” is used to immediately stop the sequence and stop the rail, even if it is in the middle of moving. This button should be reserved for situation where equipment may be damaged if the movement is allowed to complete.

A typical setup sequence goes like this:

  1. Use the Back and/or Fwd buttons to position to the front of your stack.
  2. Press the Set Start button to lock in this position.
  3. Use the Back and/or Fwd buttons to position to the back of your stack.
  4. Press the Set End button to lock in this position.
  5. Use the Go to Start and Go to End buttons to confirm that you have Start and End positions properly set.
  6. Type an appropriate value into the Step Size field.
  7. Click into the # Steps field and read the number, to confirm that it makes sense.
  8. Press the Shoot Stack button to begin shooting the stack.

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.


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 drawbacks that 1) it causes the stepper motor to produce a nearly continuous high-pitched whining sound that can be annoying to people around it, and 2) the motor drive currents are larger so the motor will become warm. 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 stays cool and 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"
      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.

“Rail position at left/right of indicator bar” is used to adjust the Common Controls panel for rails or other focusing devices of different sizes. It can also be used to swap the left and right sides, for example to support setups in which “Forward” means “to the left”.

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

Step Sizes

The “Step Sizes” tab of the controller panel allows predefined step sizes to be recorded in a table for convenient re-use at a later time. This function is provided mainly for the use of system integrators, who can provide settings that are known to work well with the optics that they provide. But it's also useful for anybody who uses a number of standard setups on a regular basis.

Here is what the table looks like once it has been set up to contain typical settings for a Canon MP-E 65 lens:

At this point, clicking on the row for “5X f/4.0”, with an Adjustment Factor of 0.700, then clicking on “Use Selected Step Size”, will immediately plug in the value 0.050 * 0.700 = 0.035 back on the Common Controls panel.

To set up or modify the table, you start by putting a checkmark in the “Show all controls” checkbox. That causes additional controls to appear:

In these additional controls, “Up”, “Down”, “Delete”, and “Add” are used to rearrange rows, while “Save…” and “Load…” are used to write the table to a text file and read it back again.

The name and location of the last file loaded is kept as part of the Zerene Stacker configuration, so that file will be automatically loaded when Zerene Stacker is launched again. (Note that you must manually “Load…” after “Save…”, when you first create the file.)

The format of the text file is one line per row, columns separated by a tab character.

As shown in a spreadsheet program, here is the file that represents the above table:

Note that the description field can be entered either as plain text or as HTML-formatted text. Here we have used HTML formatting codes to make “MP-E 65” print in bold and red. This sort of formatting is useful to organize the table when many setups are provided.


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!)


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.


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.


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.)


Sometimes things don't work right, so that you cannot shoot a stack.

A particularly common problem is that everything seems to be fine, the rail moves and everything, but the camera won't take pictures during a stack even though it will take pictures when you press the button in some camera control program like Canon EOS Utility. This puzzling situation (and many others) can be debugged as follows.

First, a bit of background may help…

Very important: Zerene Stacker never attempts to talks to the camera directly. When Zerene Stacker wants to take a picture, it sends a command to the StackShot controller to do that. The StackShot controller then closes an electrical switch on the shutter cable. The closing of that electrical switch causes the camera to take a picture. In response to the picture being taken, the camera and EOS Utility have a conversation between themselves to transfer the image to the computer.

When things are acting normally, there are three separate communication channels: USB from Zerene Stacker to StackShot controller box, shutter cable from StackShot controller box to camera, and USB from camera to EOS Utility. (If you are using the “Stack New Images” function in Zerene Stacker, then there is a fourth communication channel of sorts, in which Zerene Stacker periodically checks a folder in the computer's file system to see if there are new images to process. But that is seldom an issue when people see problems.)

Each of these communication channels should be completely independent of the others, except to the extent that activity on one may alter timing of events on another.

Each of the USB connections is bidirectional. The shutter cable and associated electronics are unidirectional. A signal goes from controller box to camera, but no information goes the other way. The StackShot controller cannot tell whether the camera did or did not take a picture.

…end background info…

So, the fact that your camera control program is working OK means that the USB connection between camera and computer is OK. But that path is not used by Zerene Stacker. The problem lies someplace on the other path, or in some interaction between the two paths.

If the camera won't take pictures as part of the stack, then the first thing to check is always step 9 in the Canon recipe above, or step 2 of the Nikon recipe, or some similar setting if you're using another brand of camera. Each of these steps has to do with camera or software settings that are required in order for the shutter cable to tell the camera to take pictures.

If that does not resolve the problem, then check all the cabling again. The problem could be something as simple as a dislodged shutter cable.

If that does not resolve the problem either, then it's probably best to start at the beginning and work your way forward, testing at each step. Here is a long and detailed description of a comprehensive test process using Canon EOS Utility. Make the obvious substitutions if you're using some other camera control program.

  1. Remove all cables, so that the StackShot and camera are two separate units, not connected to anything else.
  2. Be sure that there's a memory card with some free space installed in the camera, so that it can take pictures when not connected to the computer.
  3. Install the shutter release cable between the StackShot controller's Shutter socket and the camera's remote shutter release socket.
  4. Be sure that both the StackShot controller and the camera are powered on.
  5. Press the physical Shutter button on the StackShot controller, and confirm that the camera takes a picture. Repeat this a couple of times. Notice the red light above the Shutter button on the StackShot controller. It should turn on briefly at the instant the button is pressed and the picture is taken, then turn off again a fraction of a second later. If this does not work correctly, then it's possible that the StackShot controller needs to be reset to factory settings, or that there is some problem with the shutter release cable or its connectors.
  6. After you have confirmed that the Shutter button on the StackShot controller can make the camera take a picture, continue as follows…
  7. Connect the StackShot controller to the computer by USB, leaving the camera still not connected to the computer.
  8. Launch Zerene Stacker and do a Tools > Stackshot so as to open Zerene's StackShot Controller panel. If this panel opens properly, then you will know that the USB connection to the StackShot controller is OK.
  9. Mouseclick the Shutter button in the StackShot controller panel, and confirm that the camera takes a picture. Repeat a couple of times. It is very unlikely that this will fail, but if it does, the issue is almost certainly that either 1) the StackShot controller needs to be reset to factory settings, or 2) there is an intermittent failure in the USB cable or its connectors.
  10. After you have confirmed that the Shutter button in the StackShot controller panel can take a picture, then continue as follows…
  11. Connect the USB cable from camera to computer. Be sure that all equipment is powered on. If EOS Utility launches automatically, then manually Quit out of it.
  12. With the camera powered on and connected to the computer, but with EOS Utility not running, again mouseclick the Shutter button in Zerene's StackShot controller panel and confirm that the camera takes a picture. Repeat a couple of times.
  13. Set up a short stack in Zerene Stacker's StackShot controller panel, then press the Shoot Stack button and confirm that the rail moves and the camera fires correctly.
  14. After you have confirmed that you can shoot a stack with everything cabled, but with EOS not running, then continue as follows…
  15. Launch EOS Utility and make sure that it is configured to automatically download images as they are shot.
  16. Be sure that Live View is not enabled in EOS Utility.
  17. Again test to see if you can shoot a stack under these conditions. When this all works, continue as follows…
  18. In EOS Utility, go into Live View.
  19. Do whatever is required, to make the Live View image also show on the camera's own LCD screen.
  20. Again test to see if you can shoot a stack under these conditions. This is testing full functionality: Zerene Stacker driving the StackShot, StackShot driving camera, EOS Utility showing live view and downloading images as they are shot. If this fails, but all the other steps worked, then the problem is probably a bad USB cable that is causing some sort of crosstalk between the two USB connections (one to StackShot, one to Camera). In that case try swapping in new USB cables and repeat the testing.

We've mentioned a couple of places about resetting the StackShot controller to factory settings. Here is how to do that, instructions copied from the Troubleshooting section of the StackShot manual:

With StackShot powered off, hold down the DOWN button, and apply power. Once the splash screen shows up, release the DOWN button. This will load the factory defaults. It will NOT erase your saved settings.

As always, feel free to email support@zerenesystems.com if you need assistance.

stacker/docs/stackshot · Last modified: 2017/03/15 14:36
Copyright 2016, Zerene Systems LLC, all rights reserved.