Repository navigation
Conversation
BioCam
force-pushed
the
mantis-v1-connect-clamp
branch
2 times, most recently
from
November 11, 2026 18:22
cbebef1 to
8e6e57a
Compare
…read the chip tags - the link on the FTDI's interface B: framing and check word, one command in flight, replies matched on packet number and board, events to waiters registered before the command is sent; a negative status is a refusal and raises `CommandRefusedError` with the device's message - discovery reads each board's firmware: only board 0 must answer, board 11 answering means v4 - reads for firmware version, name and motor limits - the declared configuration check, a declared board that does not answer refuses setup, and confirmed firmware for the v4 set seen on a device - the unit's own values: read from its vendor folder (`oem_config_directory`) or a saved configuration, which must agree where both hold a value; else the generation's recording, with a warning; `save_configuration` keeps the unit's values so the folder is needed once - recordings of a v4 and a v3 - errors by kind under `MantisError`, each also its built-in, with tables for the motor, sensor alarm and clamp state codes - the plate clamp on the LC3 board: `lock(*, level)` at the unit's levels waits for clamping done, raises at once on a failure state and releases on failure; `unlock()`, `request_state()`; stop releases a clamp not reading unclamping done - the RFID reader on interface A: `request_tag(*, slot)`, `request_tags()`; the antenna switch through WritePPI at the multiplexer's address; built only when the reader answers - `MantisLiquidClass` and `mantis_mapping`, the v4 liquid classes by viscosity band and chip type - `MantisDevice` with the `Mantis()` factory, `mantis.plate_clamp` and `mantis.rfid` - simulation above the wire, from a recording - the resource model in mm: the main body, the plate holder and both chip racks - design.md, the hello-world notebook and the registry entry Co-Authored-By: xbtu2 <228601186+xbtu2@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BioCam
force-pushed
the
mantis-v1-connect-clamp
branch
from
November 11, 2026 18:31
8e6e57a to
735e9dd
Compare
This branch has not been deployed
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.
The Problem
PyLabRobot has no way to drive a Formulatrix Mantis yet. #987 adds a Mantis backend with the full dispense workflow on a v3, built on the earlier machine and backend structure. The Mantis is a large device: arm, chip changer, pressure system, plate clamp and RFID reader, in two generations (v3 and v4) that differ in hardware. This PR starts the v1 Mantis small but complete: connecting, identifying the device, reading it, clamping the plate and reading the chip tags, on any v3 or v4. Later PRs build the arm, the chips and dispensing on top. The v1 device structure follows the
STARandCLARIOstarv1 drivers.Every Mantis is calibrated at the factory: its clamp levels and RFID antennas sit in that unit's own files, installed with the vendor software. A driver that hard-codes one unit's values runs every other unit on the wrong ones.
PR Content
Mantis(...)builds the v1 device:MantisDevicewithMantisDriveron the FTDI FT2232H's two interfaces (B carries commands, A carries the RFID reader), plus a 3D resource model with the left and right chip racks.oem_config_directory: the unit's vendorData/Device/Configsfolder. The clamp levels come fromDevice.config, the antennas fromRFID.config.save_configuration(path=...)saves the device and those unit values to a JSON, so the folder is needed only once. Later setups take that file asdeclared_configuration_json.mantis.plate_clamp(v4, the motorised clamp):lock(level=...),unlock(),request_state().lock()without a level usesdefault_lock_level(1, the weakest), a public default like the v1STAR'sdefault_y_speed. Lock and unlock poll until done and raisePlateClampErrorat once on a fault state.stop()releases a clamp left locked.mantis.rfid:request_tag(slot=...)andrequest_tags()read the chip in each input slot: serial, chip type, manufacturing date and whether the tag is valid. An empty slot gives None.MantisError, e.g.CommandRefusedError,PlateClampError,MantisTimeoutError.MantisConfigurationErrorsubclassesValueError.MantisLiquidClassandmantis_mapping: the 26 v4 liquid classes as code, the same pattern as the v1STARliquid classes. Nothing uses them until dispensing lands; they're infrastructure.Mantis(simulation=True)sits above the wire and answers from a declared configuration: your own saved file, or the v4 recording when none is given.Usage
v3
No v3 has run this code yet. On a v3, setup should connect, identify the generation and read the device. The v3 has no
RFID.config, so RFID reads refuse. Its pneumatic clamp isn't in this PR: #987 and the vendor files disagree on its command numbers, and we're waiting on a capture to settle them. If you have a v3, a run of the notebook's first cells would tell us a lot.On the device
A Mantis v4, every step on macOS (libftdi) and on Windows (FTDI's own D2XX driver, follow-up PR), with identical bytes on both:
lock()atdefault_lock_level1 / 2request_tags🤖 Generated with Claude Code