Are there any established ways or ideas of how to access a liquid handler’s sensors, and feed regular measurements into Python for conditional control?
In particular, I am interested in PLR-based total aspiration and dispensation monitoring (TADM) and (self-chosen) conditional aspiration with both pressure- and capacitance-based LLD on the Hamilton STAR(let).
In the first instance the goal is to just access the sensors and being able to plot out the pressure and capacitance measurements while a pipette is entering a container (i.e. well/tube/reservoir).
For this purpose I would imagine a lh.read_sensor(channel = 1, sensor = 'pressure') method that can then be expanded upon.
Interested to hear whether there is something like this already, or ideas of how to implement it.
Here’s a notebook and code sample with some of our TADM data tests
lh.backend.send_command("P1", "BG", nr='0001', gi='000', gj=1, gk=2) # start TADM monitoring
lh.dispense("aspiration plate", [200], tadm_algorithm=1, recording_mode=2)
lh.backend.send_command("P1", "QL")
lh.backend.send_command("P1", "QM")
data = ''
# request data of tadm measurement
for i in range(0, 126):
data += lh.backend.send_command("P1", "QN", li=f'{i:04}', ln='01')[12:] + ' '
data = data[:-1]
v = []
for y in data.split(" "):
v.append(int(y))
plot(v)
Also who knew Python notebook files uploaded to Google Drive automatically get rendered in Colab!
That was the notebook I had in mind, thanks Stefan for posting it. As you can see it directly writes a bunch of low-level fw commands, and some of the methods have probably been renamed (plr was actually still a fork of pyhamilton at the time!), but you should be able to piece things together pretty easily.
To get you started: essentially what’s going on is you create a TADM buffer in memory and start monitoring on a pipetting channel using the BG command. Hamilton calls the buffer the “Limit curve index”, which is identified with a number between 0 and 999. When you aspirate with the tadm monitoring parameter enabled, you can specify the buffer to write to. Finally you’d use the QN command to retrieve the data from the buffer. There are some other commands like AQ for reseting all buffers (limit curves).
Some other interesting sensor methods that are available on STAR are:
request_pip_height_last_lld
request_plate_in_iswap
request_iswap_position
request_cover_open
To give you a sense of things you could do.
Any hardware feature the firmware exposes, which I think should be most, can be used with PLR, so it really depends on what you need. Please let me know if anything seems missing and I’ll try my best to add it.
Beautiful work reverse-engineering this. I am really hoping we can pull through with effective high-level code taking advantage of this sensing. So far, I’ve set up my assays to not require LLD, but I am certain LLD can become useful in a production setting when we aren’t around to babysit a robot.