BakingTray
Search…
Calibrating a linear actuator
Calibrating a linear actuator
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 motion control classes page 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:
1
% Make an instance of the Haydon 43k4U linear stage class
2
>> tStage=haydon43K4U
3
tStage =
4
haydon43K4U with properties:
5
6
positionUnits: 'mm'
7
axisID: ''
8
invertDistance: 1
9
positionOffset: 0
10
controllerUnitsInMM: 1
11
axisName: []
12
minPos: []
13
maxPos: []
14
% That creates an instance of the class. This instance needs to be
15
% populated with reasonable settings:
16
>> tStage.minPos=0;
17
>> tStage.maxPos=40;
18
>> tStage.axisName='zAxis';
19
>> tStage.controllerUnitsInMM=1.5305E-4; % We'll show how to derive this later
Copied!
Now it's time to make an instance of the controller.
1
% The controller class for this Z-jack is an AMS_SIN11. Let's make an instance of
2
% that and attach it to the stage we just made:
3
>> A = AMS_SIN11(tStage);
4
5
% The following command will connect to the device and then immediately start
6
% a downward reference motion until it reaches the lower limit switch. This will
7
% be considered the zero position. Locations upward from this are positive.
8
% YOUR SYSTEM MUST HAVE FUNCTIONAL LIMIT SWITCHES FOR THE REFERENCING MOVE TO WORK
9
>> A.connect('COM8');
10
Device returned:
11
K= 5/ 3,I= 2001/ 1,V= 10014/ 1,E= 100,,1/10thn=A
12
Homing axis on AMS_SIN11..
13
14
% Indeed it considers itself to be at 0 mm
15
>> A.axisPosition
16
ans =
17
0
18
19
>> A.absoluteMove(10); %move up 10 mm
20
>> A.axisPosition
21
ans =
22
10.0000
23
24
% Do not disconnect yet from the device.
Copied!

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:
1
tStage.controllerUnitsInMM=1.5305E-4;
Copied!
This value is correct for our hardware but you should derive it again here. For this you will need a Mitoyo measuring gauge sold by ThorLabs and an arm of some sort 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.
1
>> A.absoluteMove(15);
2
>> A.absoluteMove(10); % We will move down next. This gets rid of backlash
3
>> A.attachedStage.controllerUnitsInMM=1; % scaling factor is now one to one
4
>> A.attachedStage.maxPos=1E6; % Or the controller refuses to move the axis
Copied!
Now set to the measuring gauge and make a note of the reading. Move the stage down by 10,000 steps:
1
A.relativeMove(-10000);
Copied!
Take a note of the reading again. The calibration value is the difference between those readings divided by 10,000. In our case:
1
>> (3.218-1.687)/10000
2
ans =
3
1.5310e-04
Copied!
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
1
>> A.attachedStage.controllerUnitsInMM=1.310E-4; %Your value here
2
>> A.attachedStage.maxPos=40;
3
>> A.absoluteMove(10); % Get everything back as before
Copied!
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:
1
>> A.relativeMove(-1);
2
>> A.relativeMove(-1);
3
>> A.relativeMove(-1);
4
>> A.relativeMove(-1);
5
>> A.relativeMove(-1);
Copied!
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.
1
>> A.absoluteMove(10); % Note reading on gauge
2
>> A.referenceStage;
3
Homing axis on AMS_SIN11.................
4
>> A.absoluteMove(10); % Note the reading again
Copied!
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.