Home > Stage Metrology

Stage Metrology

Stage Repeatability

Stage manufacturers often provide specifications of accuracy and repeatability. In most cases they do not explain how these numbers are obtained. Here we provide tools that help to measure repeatability and some other characteristics of motorized XY stages important to users. It is assumed that the user has a "calibration slide", which can be a slide like England Finder, or can be any slide with high-contrast features. The pictures below show a field of view at a target position (left) and the same field of view captured after the stage was moved and returned to the same coordinates. The original and repeat image are color-coded to show that while the stage returned to the same nominal coordinates, it is at a physically different location. To assess stage repeatability several specific components are required (in addition to common microscope automation components): a script that moves the stage to the same target position from different starting positions, a program that measures pixel shift between images, and a method to present data and calculate errors. These components will be described below.

england finder   england finder

 1. Acquisition of images for evaluation of stage repeatability (BeanShell script for Micro-Manager)

// Micro-Manager Stage Repeatability Test: Return to Target Point from Top Left, then from Bottom Right
doSnapAndSave(){
    // Snap a picture with Canon EOS Camera using remote trigger from Tofra Controller
    mmc.setProperty(stage,"Out1X","1");
    mmc.sleep(100);
    mmc.setProperty(stage,"Out1X","0");
}
// Constants
stage = "TXY";
dist = 5000;
ntest = 50;
settletime = 200; 
// Change target position for your stage; Preferably repeat for several positions
targetposX = 70000; targetposY = 42000;

// Test Run from Top Left (TL)
for (j=0; j<ntest; j++){
    // Move to TL
    mmc.setXYPosition(stage,targetposX-dist,targetposY-dist);
    mmc.waitForDevice(stage);
    // Move to Target Position
    mmc.setXYPosition(stage,targetposX,targetposY);
    mmc.waitForDevice(stage);
    // Wait to Settle
    mmc.sleep(settletime);
    // Snap image
    doSnapAndSave();
}

// Test Run from Bottom Right (BR)
for (j=0; j<ntest; j++){
    // Move to BR
    mmc.setXYPosition(stage,targetposX+dist,targetposY+dist);
    mmc.waitForDevice(stage);
    // Move to Target Position
    mmc.setXYPosition(stage,targetposX,targetposY);
    mmc.waitForDevice(stage);
    // Wait to Settle
    mmc.sleep(settletime);
    // Snap image
    doSnapAndSave();
}

2. Evaluation of shifts between images. Download Shifts.zip and unzip it to a directory of your choice. To run Shifts.exe open the Command Prompt window and type the path to the executable and parameters string. Parameters are explained below:

1: Path and file name specification, e.g.: C:...IMG*.jpg; Default: *.tif
2: Compare mode: 0 - previous to next, 1 - first to each; Default: 1
3: Starting search step (in pixels); Default: 4
4: Final search step (in pixels); Default: 0.05
5: Final value of distance function; Default: 3.0
6: Fraction of image used in calculations (fraction of each dimension); Default: 0.5

Example:

C:\Users\...\Shifts.exe F:\...\StageRepeatability\Run1\*.jpg

- Parameters must be listed in this order. All parameters are optional.
- Images are considered in lexicographic order.
- For each pair of images the search continues until the final search step and the final value of distance function drop below the given values for parameters 4 and 5.
- If the question mark is the first parameter, explanation of parameters will be displayed.
- Shifts.exe will generate a table with the following four columns: image file name, shift in X, shift in Y, approximation error and save it in the same directory as the images.
- If the file can't be saved, then the results table will be displayed with NotePad.exe
- If no files are found in the path specification, no output is generated.
- Compare mode 1 is used for relocation to the same spot; Compare mode 0 is used for mapping of the lead screw.

3. Presentation of results. Download StageRepeatabilityTemplate.zip, unzip it into an Excel spreadsheet and update the microns per pixel value. Open the ResShifts.txt file produced in step 2 with Excel. Copy the 2-nd and 3-rd columns (not including the title) into the first two columns of the downloaded spreadsheet (again not including the title). The spreadsheet will recalculate the errors and update the plot. A result obtained with a 4-slide stage from one of the major manufacturers is shown below:

relocation errors relocation graph

Limit Switch Repeatability

Repeatability of limit switches affects the accuracy of relocation to the same point after repeated homing (e.g., after power down). The following script collects coordinates of points where the limit switches stopped stage movement when moving both axes in both directions. The actual homing algorithm implemented in a motor controller may be different. This script allows to assess the raw repeatability of limit switches.

stage = "TXY";
// Read current slew velocity
slewx = mmc.getProperty(stage,"SlewVelocityX");
slewy = mmc.getProperty(stage,"SlewVelocityY");
// Set number of repetitions
nrep = 10;
// Print title
print("X-\tX+\tY-\tY+");
// Repeat: Move to limits - both axes, both ends.
for (j=0; j<nrep; j++){
    // X Axis - Negative direction
    mmc.setProperty(stage,"SpeedX","-"+slewx);
    mmc.waitForDevice(stage); mmc.stop(stage);
    xposn = mmc.getXPosition(stage);
    // X Axis - Positive direction
    mmc.setProperty(stage,"SpeedX",slewx);
    mmc.waitForDevice(stage); mmc.stop(stage);
    xposp = mmc.getXPosition(stage);
    // Y Axis - Negative direction
    mmc.setProperty(stage,"SpeedY","-"+slewy);
    mmc.waitForDevice(stage); mmc.stop(stage);
    yposn = mmc.getYPosition(stage);
    // Y Axis - Positive direction
    mmc.setProperty(stage,"SpeedY",slewy);
    mmc.waitForDevice(stage); mmc.stop(stage);
    yposp = mmc.getYPosition(stage);
    // Print results
    print("" + xposn + "\t" + xposp + "\t" + yposn + "\t" + yposp);
}

After the script is finished copy the output into the spreadsheet LimitSwitchRepeatabilityTemplate.zip to produce repeatability estimates. Below is the result for the same stage:

limit switch repeatability

Home > Stage Metrology