BakingTray
  • BakingTray Documentation
  • Getting Started
    • Hardware requirements
    • Known issues
    • Initial Installation
      • Software installation
      • Setting up ScanImage
    • Hardware setup
      • Motor Setup
        • PI stage setup
        • Calibrating a linear actuator
        • Verifying stage motions
      • Setting up a VT1000 vibratome
      • Setting up the laser
    • Finishing the install
      • Check the noise on your amplifiers
      • Starting BakingTray
      • Settings Files
      • Calibration
        • Basic calibrating procedures
        • Calibrating image size
        • Achieving high stitching accuracy
        • Fine-tuning positioning accuracy
        • Stitching tweak walkthrough
    • Stitching data
  • Users
    • Introduction
    • Sample preparation
    • User Guide
      • Starting BakingTray
      • Step 0: Loading the sample
      • Step 1: Setting imaging parameters
      • Step 2: Preparing the sample
      • Step 3: Selecting the imaging area
      • Step 4: Starting the acquisition
      • Step 5: Concluding the acquisition
      • Setting up checklist
      • Resuming an acquisition
      • Manual ROI acquisitions
    • Excitation choices
    • Choosing imaging settings
    • Troubleshooting
      • Hardware problems
      • Computer problems
      • Cutting problems
      • Imaging problems
    • Data structure
    • autoROI
  • Developers
    • Developers
      • Code overview
      • Developer notes
      • Motion control classes
      • The recipe file
      • Auto-ROI
      • Simulated mode
      • Contributing
    • FAQ
    • Gallery
Powered by GitBook
On this page
  • Connecting to the device
  • Calibrating
  • Ensure repeatability is good
  1. Getting Started
  2. Hardware setup
  3. Motor Setup

Calibrating a linear actuator

Calibrating a linear actuator

PreviousPI stage setupNextVerifying stage motions

Last updated 6 months ago

These instructions apply if you need to calibrate an uncalibrated linear actuator to receive motion commands in mm.

Connecting to the device

Before proceeding with this step ensure the area surrounding the stage is clear of obstructions. Remove the objective, the water bath, and the blade holder. The describes how BakingTray handles motion control hardware. Briefly, each physical motion axis consists of a linear stage and a controller for that stage. BakingTray represents these as separate software entities: a class that inherits linearstage represents the stage and a class that inherits linearcontroller represents the stage controller. To connect to the TC1000 Z-jack from the command line we first need to build the stage class then attach it to the controller:

% Make an instance of the Haydon 43k4U linear stage class
>> tStage=haydon43K4U
tStage = 
  haydon43K4U with properties:

          positionUnits: 'mm'
                 axisID: ''
         invertDistance: 1
         positionOffset: 0
    controllerUnitsInMM: 1
               axisName: []
                 minPos: []
                 maxPos: []
% That creates an instance of the class. This instance needs to be 
% populated with reasonable settings:
>> tStage.minPos=0;
>> tStage.maxPos=40;
>> tStage.axisName='zAxis';
>> tStage.controllerUnitsInMM=1.5305E-4; % We'll show how to derive this later

Now it's time to make an instance of the controller.

% The controller class for this Z-jack is an AMS_SIN11. Let's make an instance of 
% that and attach it to the stage we just made:
>> A = AMS_SIN11(tStage);

% The following command will connect to the device and then immediately start 
% a downward reference motion until it reaches the lower limit switch. This will
% be considered the zero position. Locations upward from this are positive. 
% YOUR SYSTEM MUST HAVE FUNCTIONAL LIMIT SWITCHES FOR THE REFERENCING MOVE TO WORK
>> A.connect('COM8');
Device returned:
 K= 5/ 3,I= 2001/ 1,V= 10014/ 1,E= 100,,1/10thn=A
Homing axis on AMS_SIN11..

% Indeed it considers itself to be at 0 mm
>> A.axisPosition
ans =
     0

>> A.absoluteMove(10); %move up 10 mm
>> A.axisPosition
ans =
   10.0000

% Do not disconnect yet from the device.

Calibrating

The stepper motor controller instructs the motor how many steps to take, it doesn't know anything about the number of mm the actuator has traveled. The conversion factor of mm to steps was defined above as:

tStage.controllerUnitsInMM=1.5305E-4;
>> A.absoluteMove(15);
>> A.absoluteMove(10); % We will move down next. This gets rid of backlash
>> A.attachedStage.controllerUnitsInMM=1; % scaling factor is now one to one
>> A.attachedStage.maxPos=1E6; % Or the controller refuses to move the axis

Now set to the measuring gauge and make a note of the reading. Move the stage down by 10,000 steps:

A.relativeMove(-10000);

Take a note of the reading again. The calibration value is the difference between those readings divided by 10,000. In our case:

>> (3.218-1.687)/10000
ans =
   1.5310e-04

That's very close to the value of 1.5305E-4 which we had measured previously. Enter your value as shown below and return the max pos to a safe value

>> A.attachedStage.controllerUnitsInMM=1.310E-4; %Your value here
>> A.attachedStage.maxPos=40;
>> A.absoluteMove(10); % Get everything back as before

Your Z-jack should now be calibrated.

Ensure repeatability is good

Confirm that the stage moves as expected by taking a few 1 mm steps and reading the value of the gauge:

>> A.relativeMove(-1);
>> A.relativeMove(-1);
>> A.relativeMove(-1);
>> A.relativeMove(-1);
>> A.relativeMove(-1);

Ignore a value obtained right after a change of direction. To confirm that the referencing is repeatable you should move to an absolute position (10 mm in the following example), place the gauge at that point and take a reading, then reference the stage and move back there.

>> A.absoluteMove(10); % Note reading on gauge
>> A.referenceStage;
Homing axis on AMS_SIN11.................
>> A.absoluteMove(10); % Note the reading again

Repeat the above two or three times. The readings at the start and end should match pretty closely. If the readings are about 100 microns out, that is likely OK.

This value is correct for our hardware but you should derive it again here. For this you will need a and an to clamp it to. You can clamp to the thicker portion with a 9.5 mm diameter right below the main body (see the ThorLabs CAD PDF from the link above). The arm holding the gauge can be strong, so take care not to damage the gauge by driving the stage into it.

motion control classes page
Mitoyo measuring gauge sold by ThorLabs
arm of some sort