BakingTray
Search…
Verifying hardware operation
Ensuring hardware is functioning correctly
At this point you should have an acquisition PC with MATLAB, ScanImage, and BakingTray installed in your MATLAB path. Your scanning acquisition hardware should be set up and running. You will now ensure that the hardware related to serial sectioning is functioning correctly and that BakingTray can talk to it.

Preparation

  • Ensure your stages are plugged in, switched on, and the drivers are installed.
  • Ensure the laser is connected to the PC via a serial cable (ideally) or USB-serial.
Serial connections have lower latency than USB-serial. Use them where possible.
  • As you proceed with the steps below, make a note of which classes you used and the settings required.

Laser

BakingTray communicates with the laser in order to stop acquisition should it drop out of modelock. Available laser control classes are in the components/laser directory. Let us say you have a Chameleon laser and it is connected to your motherboard serial port, COM1. The following sample session confirms we can connect to the laser and demonstrates some features of the laser control class.
1
>> c=chameleon('COM1');
2
3
Setting up Chameleon laser communication on serial port COM1
4
Connected to Chameleon laser on serial port COM1
5
6
>> [~,status]=c.isReady
7
status =
8
'Laser not powered on'
9
% So let's turn on the laser with the key switch...
10
11
% Test if laser shutter is open (0 means it's closed, 1 means it's open)
12
>> c.isShutterOpen
13
ans =
14
0
15
>> c.openShutter; % Let's open the shutter
16
>> c.isShutterOpen
17
ans =
18
1
19
% Yep, shutter is now open
20
21
% Let's read and then change the wavelength
22
>> c.readWavelength
23
ans =
24
920
25
26
>> c.setWavelength(940);
27
>> c.readWavelength
28
Failed to read wavelength from Chameleon. Likely laser is tuning.
29
ans =
30
NaN
31
32
% Wait 5 seconds...
33
>> c.readWavelength
34
ans =
35
940
36
% Nice
37
38
% Close communications with the laser
39
>> delete(c)
40
Disconnecting from Chameleon laser
41
Closing serial communications with Chameleon laser
Copied!

Vibratome

Most vibratomes consist of a DC motor that turns a cam which produces lateral motion of an assembly that in turns holds the blade. The vibratome should be securely bolted in place. Attach the blade holder to the vibratome as you would for normal operation.
It is possible vibratome motor far harder than the manufacturer intended. Start at slow speeds and be sure you know how to cut power to the device if you need to.
You will now ensure you can set the vibratome to run at a specified speed and also stop the vibratome. The following sample session demonstrates this with the Faulhaber MCDC motor controller, with which we interface via a serial connection.
1
>> f=FaulhaberMCDC('COM2');
2
Setting up Faulhaber MCDC3006 DC motor controller.
3
Motor max speed: 60 revs per second.
4
5
%Let's start a gentle vibration
6
>> f.startVibrate(5); % You should now see a modest vibration of the blade
7
>> f.stopVibrate; % And we stop it
Copied!
You should consider the sample speed setting, which is the input argument to startVibrate, to be in arbitrary units. The goal now is to identify a reasonable speed setting for slicing the sample.
1
% Try a range of speeds and stop once it becomes more noisy
2
>> f.startVibrate(10); % quiet
3
>> f.startVibrate(11); % quiet
4
>> f.startVibrate(12); % still quiet
5
>> f.startVibrate(13); % Getting loud: vibrations are clearly audible
6
>> f.startVibrate(10); % <--- Back off a few steps. Make a note of this setting.
7
>> f.stopVibrate;
8
9
% Terminate the session
10
>> delete(f)
11
Closing connection to Faulhaber MCDC motor controller
Copied!
If you run the vibratome too fast you will wear our the axel or the bearings and may need to replace the whole unit after a year or two. Make a note of the vibrate speed chosen above. You will later use this to slice samples and only modify if it if you notice cutting problems.
The Leica VT1000 works well with a Faulhaber MCDC3006. The motor has a red and black lead that goes to the motor + and - connections on the ccontroller. The encoder has four connections. The red cable goes to sensor Ucc on the controller. Black to sensor ground. The brown cable is channel B and white is channel A.
Note that BakingTray can also run devices such as the Leica VT1200 (the unit used by Economo et al) by gating its operation with a TTL pulse via the JaneliaLeicaContoller class.

The X/Y/Z Stages

The X/Y sample stages translate the sample during a tile scan and drive the sample into the blade during cutting. The Z stage (Z-jack) moves the sample up and down for cutting. Ensure that the stages and hardware isn't in a configuration where unintended motions could result in damage. Use motion control software supplied by the manufacturer to confirm the stages move as expected: that you can make large and small motions, change speed, etc.
If you are using PI stages, see the detailed instructions for setting them up.
Most devices, such as those sold by Aerotech, PI, or ThorLabs, will allow you to issue motion commands in mm. However, you may have a motor controller that is not calibrated and works on motor "ticks" that will move the device by a small fixed distance. The Z-jack on the TissueCyte 1000 is one such device. If this is the case, follow the actuator calibration steps.
The stage driving the Z-jack must move down to the lower limit switch when homing. BakingTray expects the home position to be z=0 mm.

Ensuring BakingTray can move the stage

Now you will ensure that BakingTray is able to interact with the stage. Close the manufacturer's control software before proceeding. The following example will connect to a PI stage via a PI C891 controller. If you have a different device you can find the name of the class which controls it here. If your device is not currently supported, you can find information on writing a control class here.
1
>> STAGE = genericPIstage;
2
>> STAGE.axisName='someName'; %Does not matter for this toy example
3
>> PIC891 = C891(STAGE); %Create control class
4
>> controllerID.interface='usb'; %We will connect via USB...
5
>> controllerID.ID= '116010269'; %Using the serial number of the C891
Copied!
Now we are ready to communicate with the device and connect to it:
1
>> PIC891.connect(controllerID)
2
Loading PI_MATLAB_Driver_GCS2 ...
3
PI_MATLAB_Driver_GCS2 loaded successfully.
4
Attempting to connect to C-891 with serial number 116010269
Copied!
If you saw no errors, you can now do stuff like move the stage:
1
>> PIC891.absoluteMove(0);
2
>> PIC891.absoluteMove(10);
3
>> PIC891.relativeMove(-3);
Copied!