Agilent VSpin#
The VSpin centrifuge is controlled by the VSpinBackend class.
from pylabrobot.centrifuge import Centrifuge, VSpinBackend
vspin_backend = VSpinBackend() # VSpinBackend(device_id="YOUR_FTDI_ID_HERE")
cf = Centrifuge(name = "centrifuge", backend = vspin_backend, size_x= 1, size_y=1, size_z=1)
await cf.setup()
Before you can use the “go to bucket” commands, you need to calibrate the bucket positions. See below for instructions.
await cf.go_to_bucket1()
await cf.go_to_bucket2()
await cf.spin(
g=800,
duration=60, # seconds
acceleration=1.0, # 0-1
deceleration=1.0, # 0-1
)
Status commands
await vspin_backend.get_door_locked()
await vspin_backend.get_door_open()
await vspin_backend.get_bucket_locked()
Calibrating bucket 1 position#
You need to calibrate the bucket 1 position for every vspin once. There are two ways to do this:
Manually: Move bucket 1 to the correct position using the physical controls on the centrifuge.
Programmatically: Use the
go_to_positioncommand to move bucket 1 to the correct position.
With bucket 1 in the correct position, save it with cf.backend.set_bucket_1_position_to_current(). This will save the calibration for the current centrifuge to disk at ~/.pylabrobot/vspin_bucket_calibrations.json (based on the usb serial number).
Moving using code#
Use vspin_backend.go_to_position to move the buckets to the correct position. A full rotation is 8000 ticks, so 4.5 degrees per 100 ticks.
await vspin_backend.go_to_position(100)
await vspin_backend.set_bucket_1_position_to_current()
Manually rotating#
You can open the door unlock the bucket and manually rotate the buckets to the desired position.
Warning
High risk / high reward! The vspin has a safety mechanism that will close the door when it detects movement. This means the door will close when you rotate the buckets manually too fast. Be careful or it will eat your fingers! It will save time compared to using code though.
await cf.open_door()
await vspin_backend.unlock_bucket()
Manually rotate buckets to align bucket 1 with door
await vspin_backend.set_bucket_1_position_to_current()
Loader#
The VSpin can optionally be used with a loader (called Access2). The loader is optional because you can also use a robotic arm like an iSWAP to move a plate directly into the centrifuge.
When using the loader, you must specify the FTDI device ids for both devices because both use FTDI and are otherwise indistinguishable. See below for how to find the device ids.
Here’s how to use the loader:
import asyncio
from pylabrobot.centrifuge import Access2, VSpinBackend
vspin_backend = VSpinBackend(device_id="YOUR_VSPIN_FTDI_ID_HERE")
centrifuge, loader = Access2(name="name", vspin=vspin_backend, device_id="YOUR_LOADER_FTDI_ID_HERE")
# initialize the centrifuge and loader in parallel
await asyncio.gather(
centrifuge.setup(),
loader.setup()
)
# go to a bucket and open the door before loading
await centrifuge.go_to_bucket1()
await centrifuge.open_door()
# assign a plate to the loader before loading. This can also be done implicitly by for example
# lh.move_plate(plate, loader)
from pylabrobot.resources import Cor_96_wellplate_360ul_Fb
plate = Cor_96_wellplate_360ul_Fb(name="plate")
loader.assign_child_resource(plate)
# load and unload the plate
await loader.load()
await loader.unload()
Installation#
The VSpin centrifuge connects to your system via a COM port. Integrating it with pylabrobot library requires some setup. Follow this guide to get started.
1. Installing libftdi#
macOS#
Install libftdi using Homebrew:
brew install libftdi
Linux#
Debian (rpi) / Ubuntu etc:
sudo apt-get install libftdi-dev
Other distros have similar packages.
Windows#
Find Your Python Directory
To use the necessary FTDI .dll files, you need to locate your Python environment:
Open Python in your terminal:
python >>> import sys >>> sys.executable
This will print a path, e.g.,
C:\Python39\python.exe.Navigate to the
Scriptsfolder in the same directory aspython.exe.
Download FTDI DLLs
Download the required .dll files from the following link:
FTDI Development Kit (link will start download).
Extract the downloaded zip file.
Locate the
bin64folder.Copy the files named:
libftdi1.dlllibusb-1.0.dll
Place DLLs in Python Scripts Folder
Paste the copied .dll files into the Scripts folder of your Python environment. This enables Python to communicate with FTDI devices.
Configuring the Driver with Zadig
Use Zadig to replace the default driver of the VSpin device with libusbk:
Identify the VSpin Device
Open Zadig.
To confirm the VSpin device, disconnect the RS232 port from the centrifuge while monitoring the Zadig device list.
The device that disappears is your VSpin, likely titled “USB Serial Converter.”
Replace the Driver
Select the identified VSpin device in Zadig.
Replace its driver with
libusbk.Optionally, rename the device to “VSpin” for easy identification.
Note: If you need to revert to the original driver for tools like the Agilent Centrifuge Config Tool, go to Device Manager and uninstall the
libusbkdriver. The default driver will reinstall automatically.
2. Finding the FTDI ID#
To interact with the centrifuge programmatically, you need its FTDI device ID. Use the following steps to find it:
Open a terminal and run:
python -m pylibftdi.examples.list_devices
This will output something like:
FTDI:USB Serial Converter:FTE0RJ5T
Copy the ID (
FTE0RJ5Tor your equivalent).
You’re now ready to use your VSpin centrifuge with pylabrobot!