Speeding up the ASI Stage

As I’ve discussed previously, I’ve been working on building a system for high speed image stitching. I’ve described previously a number of methods I’ve tried for image acquisition. To get high speed mosaic scanning, I’ve tried software and hardware control of the stage, as well as rapid stage scanning and strobe illumination. To date, however, I haven’t tried very hard to speed up the stage itself. I spent a few days last week trying to make the ASI stage move as fast as possible, and it turns out you can get more than a two-fold increase in speed just by configuring the stage correctly.

The ASI stage manual describes a number of parameters which affect how long it takes to scan an array. The ones I have tested are:

  • Speed: This is the speed the stage travels at once it is under way.
  • Acceleration: This control how fast the stage accelerates to its set speed. This is measured in milliseconds, so smaller values correspond to faster acceleration.
  • Finish Error (PCROS): For stages with encoders, this controls the disagreement that will be accepted between the encoder position and the programmed position. In other words, the stage will stop moving when the encoder says it is within this value of its target postion.
  • Backlash: This is a distance parameter for the anti-backlash routine in the motor controller. A value of 0 disables the anti-backlash routine.

All of these parameters are exposed in the Micro-Manager driver except for Acceleration. This Micro-manager script will set the stage acceleration. If you save it as mmstartup.bsh in the Micro-manager directory, it will run on startup and set the acceleration.

//Function to send arbitrary commands to ASI Stage
//Replace COM4 with the COM port number your stage is attached to.
String sendASICommand(String command){
mmc.setSerialPortCommand("COM4", command, "\r");
String asiReturn = mmc.getSerialPortAnswer("COM4", "\n");
asiReturn = asiReturn.replaceAll("\r", "\r\n"); //reformat multiline responses for display
return asiReturn;

ans = sendASICommand("AC X=30 Y=30"); //Change 30 if you want a different acceleration.

I tested different settings for these parameters under both software and hardware controlled acquisition, acquiring a 9 x 20 grid. The results are below:

Acceleration Error (PCROS)BacklashTime (Software)Time (Hardware)
100 msec11 nm0 mm140 s95 s
100 msec50 nm0 mm95 s73 s
30 msec50 nm0 mm73 s51 s
30 msec50 nm0.05 mm62 s41 s

Setting the stage parameters appropriately can give over a two-fold increase in speed. To compare this to our previous results, I ran both a small section (180 images) and the same large section as previously (616 images). The results are below:

GridNumber of ImagesTime (Software)Time (Hardware)
9 x 2018062 s45 s
22 x 28616211 s129 s

As can be seen, our new software speeds are close to what we were previously getting with hardware triggering, and the hardware triggered results approach what we could previously obtain with fast scanning (strobe illumination without stopping the stage). The hardware triggered speeds (~5 images / second) are getting to the point where the perfect focus system is unable to keep the section in focus, so we may stick with software triggered imaging. The overhead of software over hardware triggering is about 130 msec per image.

4 thoughts on “Speeding up the ASI Stage

  1. I just added acceleration to the Micro-manager device adapter ASIStage.

    ASI offers stages with various leadscrew pitches (basically a gearing ratio). A coarser leadscrew will make the stage go faster but won’t have as accurate of positioning.

    If you are pushing the limits of achievable stage speed, the stage travel time might be mostly in the acceleration and deceleration time, in the extreme situation the stage may not ever reach its maximum speed. In this case making the leadscrew coarser provides only marginal speed benefit at significant accuracy cost.

  2. Thanks Jon! I thought about modifying the adapter myself, but I’m not much of a C++ coder, so I’m glad you did it.

  3. I am a dealer for microscope but also motion control products . I represent Marthauser, Ludl Prior and Objective Imaging Imaging. The issue I am interested in is that I have 40-50 used motorized stages by different mfg and am looking for low cost solutions for stiching for my customers . The Objective Imaging works flawlessly , can this be duplicated by Micromanager. Enjoyed the web page

  4. Hi Mike –

    We routinely do image stitching in Micro-manager / FIJI – see http://nic.ucsf.edu/blog/?p=899 for some details. The system isn’t completely turnkey, as image acquisition and stitching have to be done as separate steps, but it is pretty reliable, provided your final images are less than 2 gigapixels. Let me know if you have questions.


Comments are closed.