PI stage setup
We have had excellent success with PI linear stages for tile scanning; they have outstanding long-term reliability over many years, accumulating millions of tile motions. Most BrainSaw systems run on PI V-551.4B and V-551.2B direct-drive stages, driven by C-891 controllers (BakingTray expects one controller per stage). We have also had good results with the legacy PI M-531.DD and M-605.2DD stages that came with TissueVision's TissueCyte 1000.
First steps
Before proceeding it is worth checking that your new PI stages move as expected over the travel ranges we care about. You will use PI's MikroMove software that came with your stages to check this. Here we assume you have already installed PI's software, set up the stages as a coupled X/Y pair, and hooked up all the cables.
Connect to the stages in MikroMove
Close BakingTray. Fire up MikroMove and connect the stages such that they appear in the software.

Record your settings
First of all take a record of the factory settings of your stages. Right-click on each axis, select "Show Expanded Single-Axis Window" and screen-shot all the settings. Save these for future reference.

Check the step response
Load the stages with the water bath and fire up the data recorder for each axis: click the axis name in the menu and select "Show data recorder". Then click "Configure Curves" near the bottom left. This brings up a window that allows you to select how the data are plotted to screen. The following is a useful configuration: show the actual and target position on the left axis and the position error (the difference between the two) on the right axis:

Press "OK" and initiate a step of the size you expect to make during tile-scanning. Here we are making a 1.1 mm step. Our stage achieves this in about 125 ms. You may need to adjust the number of recorded data points or sampling rate (bottom left). In the following case the data duration was reduced from 512 ms to 256 ms.

The goal is to have the stage settle in under about 150 ms with a target velocity of about 25 mm/s (above we used 35 mm/s); the exact number is not very important as the stages will not achieve it over such a short distance. If your stage is settling much later or shows evidence of oscillation, you may need to tweak the PID loops (below) or reduce the acceleration and/or deceleration settings.
Tuning the PID loops
The parameters for tuning the PID loops can be accessed via the expanded single axis window. The direct-drive stages have separate loops for position and velocity. Try changing the position terms and enable the display of the startup parameters. This will make going back to the original values easier.
To tweak the PID loop:
Set the I and D terms to zero. Set P to a low number (e.g. 10). Perform a step of the size and speed typical of tile scanning.
Keep doubling P until you see oscillations, then halve it.
The I term is used to remove error that has accumulated over time to create an offset between the target and actual positions. Likely it will need to be some small positive number. Set I to some small positive number such as 0.1. If there is a consistent error between the target and true position, double it. Re-test and keep doubling until the error has gone.
Tweak D if needed, but otherwise leave at zero.
Other checks
Ensure that the stages are also able to perform larger motions (20 or 30 mm) without issue. We won't be making large fast motions regularly during imaging, but they might take place during sample set up and we want to ensure there is no unexpected behavior.
Once you have done the above for both stages, check all is good by imaging pollen grains. Does the image settle almost right away after the stage motion?
Troubleshooting
We have had a couple of microscopes where the stages report they have settled, but the image continues to oscillate for a few hundred ms and this is visible in the images. In one case, the problem was somehow related to the PIFOC and somehow went away after firmware updating the controller. In the other case the problem was associated only with the Y stage, so the dominant tiling axis (the one doing most motions) was moved to X. The problem thereby went away. In general, vibrations of this sort can be decreased by accelerating and decelerating more slowly.
The "OTG" light on the C-891 controller indicates "on target". Tile-scanning in BakingTray depends on the controller returning that the stage has reached its target position. If something is preventing that, the OTG light will not illuminate. If that happens during tile-scanning, then the acquisition stalls. Debugging should concentrate on figuring out what is blocking the stage from achieving its target position.
Soft limits
Once all steps are complete and the microscope is assembled, you can set the soft limits (min and max positions) for the X and Y axes so that even at the firmware level, stages can't accept out of bounds motion commands that would cause hardware damage. BakingTray has its own soft-limits, though, so this step is optional.
Hints and tips
Ensure that the stage really is settling as expected. e.g. If you are planning on moving in 1 mm steps and settling well within, say, 200 ms then make sure that you can successfully issue 1 mm motion steps every 200 ms. Ensure that every so often the stages aren't taking much longer to settle. This can happen and it will really slow down your acquisitions. Tweak PID parameters until this is no longer a problem.
Last updated