Conversation
A STAR, STARlet and STAR+ driven through a single driver in `pylabrobot.hamilton`, with each fitted module as a feature of it: the pipetting channels, the 96- and 384-heads, the iSWAP, the autoload, the X-arms and the front cover. Setup discovers what is fitted, initializes only what reports itself down, and models every feature on the deck. A simulator answers from recorded device configurations, and a device's configuration can be saved and simulated from later. Resources: the STAR decks and CORE grippers move to their own modules with their old imports kept, the pipetting channels are modelled as `NChannelPipette` and `TipMountingShaft`, and `HamiltonDeck` places the parts the driver models. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi everyone,
We need a new Hamilton STAR integration that is...
Here I built the first (purposefully limited) version of the new v1 STAR integration with this aim.
(Note: when using the term "STAR" here, I refer to the STAR, STARlet, and STARPlus liquid handling workstations in all their possible configurations.)
The Problem
The v0 integration of the Hamilton STAR is the strongest of all liquid handling workstations in PyLabRobot. It was the first in PLR's history, and has continuously grown ever since.
However, as we have learned over the years what makes the STAR system so powerful, we have also learned the limitations of our existing monolithic architecture.
The main ones include...
STAR_backend.pyv1 STAR
Here, I introduce a new STAR driver with a range of new functionalities and a series of new concepts.
The aim of this PR is not to produce a fully functional v1 STAR driver.
That requires careful step by step building and reviews by the community along the way.
The aim of this PR is to provide the first wave of new functionalities, validate them, actively discuss and build modifications ("identifying the unknown unknowns"), and get ready for the next wave (specifically, tip and liquid handling).
Device-centered architecture
Core to PLR v1: the center of an integration is now the device, a resource which owns a device driver and has a deck.
Composition architecture across programmatic control & modelling system
Robots are fundamentally composable, i.e. made up of subcomponents which can vary between configurations.
Based on @rickwierenga's idea of the v1 architecture, this composition is now taken directly into the integration architecture:
pipettes.py,iswap.py,head96.py,autoload.py, ...).(Importantly, "one feature, one module" is a paradigm, not a hard rule - where it is unintuitive or overcomplicating, we do not adhere to it just for the sake of ticking a checkbox. Discussion and community feedback are meant to derive useful solutions in these cases.)
A feature's driver module and resource are in continuous communication. This enables...
Configuration per device feature as the source of all information
A common problem we encountered is that each feature brings its own settings, conversion factors, subcomponent modifications, ... i.e. configuration.
Worse, between different hardware and firmware versions these configurations can vary massively (e.g. a drive's parameters might use increments x 100 and after an update just increments, drive ranges might change as the hardware evolves, ...).
We need to discover & capture this information during setup/initialisation of a device and record it inside the running integration, so every command of the driver works with up-to-date information.
This is why
STARDriver.configuration), which also declares which features are fitted, andXArm.configuration,Head96.configuration, ...), which provides the information that feature needs.On a physical device, this entire configuration can easily be saved as a configuration JSON (though I am not attached to JSON as the format here).
Simulation, with easy configuration declaration provided by JSON
A real simulation engine must...
STARChatterboxBackendalready did in legacy/v0),To enable (3), the v1 STAR driver now takes an optional
declared_configuration_json: Optional[str], the path to a saved configuration.When provided...
a) to a simulated STAR, it adapts the simulator to that specific configuration (x/y/z ranges, accelerations, speeds, which feature classes are instantiated, ...),
b) to a physical STAR, it cross-checks the declared configuration against what the device reports is fitted: channel count, deck size, autoload, iSWAP, heads, cover monitoring, and what each arm carries. Serial number, firmware and geometry are deliberately not compared, so a configuration saved on one device describes any other of the same build (very useful for automated protocols requiring specific features :)
(A simulated STAR runs the same cross-check during setup - its declared configuration is what it answers from, so there it always matches.)
Simple SOP: connect to your device, run setup + save the configuration -> use that JSON from then on for all simulations of that device:
What is in this PR, and what is not
STARBackendworks exactly as before, so nobody has to migrate yet.resources/changes (STAR decks and CORE grippers in their own modules, channels modelled asNChannelPipette/TipMountingShaft) keep their old imports working - main's own resources and legacy tests pass against this branch.How to review
It's one commit, most of it in
pylabrobot/hamilton/star/driver/features/. A good reading order:device.py->driver/master.py-> one feature (x_arm.pyis the smallest) ->driver/simulator.py.Known follow-ups:
move_to_safe_zas a stop-disc move with speed & acceleration,rotate_to_anglesrefusing before it moves,packet_read_timeoutin the reply router.There is a lot more, but this is getting too long.
So let's discuss the rest in the review of this and provide regular smaller summaries so people can easily follow along.
🤖 Generated with Claude Code