Liconic backend (Liconic STX series automated incubator support)#846
Liconic backend (Liconic STX series automated incubator support)#846sam-adaptyv wants to merge 41 commits intoPyLabRobot:mainfrom
Conversation
…brobot into liconic-backend
- Add BarcodeScanner frontend that wraps BarcodeScannerBackend - Export BarcodeScanner and BarcodeScannerError from __init__.py - Fix type hints in KeyenceBarcodeScannerBackend (callable -> Callable) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Parameter was annotated as str but used as Plate object. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- LiconicBackend now accepts optional BarcodeScanner instance instead of creating KeyenceBarcodeScannerBackend internally - Backend methods set plate.barcode instead of returning barcode strings - Incubator frontend uses **backend_kwargs pattern to pass read_barcode to backend methods without changing signature - Add Keyence-specific error handling (NG/ERR99) to KeyenceBarcodeScannerBackend - Update abstract method signatures in IncubatorBackend Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- shaker_status: raise NotImplementedError (missing PLC command) - get_shaker_speed: add int() conversion before division - check_shovel_sensor: add missing await on asyncio.sleep Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
to clarify, are these in mm or steps? Ideally all resources in PLR are in mm so they can be used in a hardware agnostic setting and make it easy for people to use/make their own labware.
There was a problem hiding this comment.
So pitch and site_height are for sure in mm. The step variable is the number of steps the motors turns (i.e. steps of the motor) which moves the plate shuttle in z. So its specific to the motors used by Liconic. The conversion of pitch to steps is: step = pitch * ( 1713 / 50 ) rounded to the nearest integer. The steps value is what needs to sent directly to the memory in the liconic to move correctly ("WR DM23 x"). So we could calculate the steps value by the pitch value (which is mm) to meet this ideal.
| } | ||
|
|
||
| @classmethod | ||
| def deserialize(cls, data: dict): |
There was a problem hiding this comment.
scan_barcode() calls ST 1910 to move the shovel to the barcode reading position but:
- Doesn't call
_wait_ready()before scanning — is the shovel guaranteed to have finished moving? - Doesn't call
RS 1910afterward to return the shovel, unlikeread_barcode_inline()which does both.
Is this intentional (e.g. caller is expected to handle reset), or should this match the read_barcode_inline pattern?
There was a problem hiding this comment.
- No the shovel isn't guaranteed to have finished moving. Often the barcodes can be read even while the shovel is moving so hasn't been found to be an issue. Only downside is it could slow down the speed of barcode scanning.
- Should call "RS 1910" and thus should match the read_barcode_inline pattern will ensure subsequent commands don't cause errors.
There was a problem hiding this comment.
thanks, I'll implement that!
| 53: 2021, # pitch=59, site_height=53 | ||
| 66: 2467, # pitch=72, site_height=66 | ||
| 104: 3563, # pitch=110, site_height=104 | ||
| } |
There was a problem hiding this comment.
The 104mm rack (pitch 110mm) claims motor steps = 3563, but the formula round(pitch * 1713 / 50) that holds for all other sizes gives 3769. That is a 5.5% difference — too large for rounding.
All other sizes match the formula exactly:
pitch claimed computed
11 377 377 OK
17 582 582 OK
...
72 2467 2467 OK
110 3563 3769 FAIL
Is 3563 empirically determined from the hardware, or a data entry error? Added a test that documents this discrepancy.
There was a problem hiding this comment.
It is a data entry error (aka typo) 104mm was used to compute 3563 but that is the plate height in mm when it should be calculated using the pitch value in mm which is 110 which would equals 3769 steps.
There was a problem hiding this comment.
Should be 110 for pitch and 3769 for steps
Added a new backend for Liconic STX series of automated incubators. It is compatible with existing incubator backend commands also added a number of new incubator backend commands. Also added a new pice of hardware barcode_scanner which can be optionally initialized with a Liconic incubator to read barcodes with optional read_barcode variables added to current and added incubator commands. Right now the barcode is just printed to terminal as the incubator backed typically only returns the Plate object or nothing. If there was a barcode field added to the Plate resource that seems to be obvious place to return the scanned barcode but that could be done in the future. For now the Keyence BL-1300 barcode scanner is the only model support but other models could be easily integrated. Documentation in user_guide > 01_material-handling > liconic.ipynb is also provided.