From 67622b5f2b366e7589c27a882ed331607768b883 Mon Sep 17 00:00:00 2001 From: Camillo Moschner Date: Sat, 2 May 2026 01:08:35 +0100 Subject: [PATCH 1/3] anchor iSWAP Y move bounds to EEPROM parking pose --- .../backends/hamilton/STAR_backend.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py index 10cfc65de36..3f453b12cb9 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py +++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py @@ -1368,6 +1368,7 @@ def __init__( self._channel_traversal_height: float = 245.0 self._iswap_traversal_height: float = 280.0 self._iswap_rotation_drive_x_offset_mm: Optional[float] = None + self._iswap_rotation_drive_y_max_mm: Optional[float] = None self.core_adjustment = Coordinate.zero() self._unsafe = UnSafe(self) @@ -1765,6 +1766,7 @@ async def set_up_iswap(): ) self._iswap_rotation_drive_x_offset_mm = await self._iswap_rotation_drive_request_x_offset() + self._iswap_rotation_drive_y_max_mm = await self._iswap_rotation_drive_request_y_max() async def set_up_core96_head(): if self.extended_conf.left_x_drive.core_96_head_installed and not skip_core96_head: @@ -9865,6 +9867,15 @@ async def _iswap_rotation_drive_request_x_offset(self) -> float: resp = await self.send_command(module="C0", command="RA", ra="kg", fmt="kg###") return cast(int, resp["kg"]) / 10.0 + async def _iswap_rotation_drive_request_y_max(self) -> float: + """Read the iSWAP Y-axis upper bound (parking pose) from EEPROM, in mm. + + Parking sits at the back of the usable Y travel; anything past it is in + the mechanical-stop region. + """ + py = await self.iswap_rotation_drive_request_predefined_y_positions() + return py["parking"] + async def iswap_rotation_drive_request_x(self) -> float: """Request iSWAP rotation drive X position (deck coordinates), in mm. @@ -9996,10 +10007,13 @@ async def iswap_rotation_drive_move_y( self._channels_minimum_y_spacing[1:] ) - max_y = self.extended_conf.pip_maximal_y_position + assert self._iswap_rotation_drive_y_max_mm is not None, ( + "iSWAP Y max not loaded; was setup() called with skip_iswap=False?" + ) + max_y = self._iswap_rotation_drive_y_max_mm absolute_min_y = self.extended_conf.left_arm_min_y_position if not (absolute_min_y <= y <= max_y): - raise ValueError(f"y must be between {absolute_min_y} and {max_y} mm, got {y} mm") + raise ValueError(f"y must be between {absolute_min_y} and {max_y} mm, is {y}") target_channel_0_y = y - channel_0_radius - iswap_radius if channel_0_y > target_channel_0_y: From 1edb81de1582b6d20c2ab2d775aea3d838b48c26 Mon Sep 17 00:00:00 2001 From: Rick Wierenga Date: Fri, 1 May 2026 17:21:01 -0700 Subject: [PATCH 2/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../liquid_handling/backends/hamilton/STAR_backend.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py index 3f453b12cb9..479cab34e63 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py +++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py @@ -10007,9 +10007,12 @@ async def iswap_rotation_drive_move_y( self._channels_minimum_y_spacing[1:] ) - assert self._iswap_rotation_drive_y_max_mm is not None, ( - "iSWAP Y max not loaded; was setup() called with skip_iswap=False?" - ) + if self._iswap_rotation_drive_y_max_mm is None: + self._iswap_rotation_drive_y_max_mm = await self._iswap_rotation_drive_request_y_max() + if self._iswap_rotation_drive_y_max_mm is None: + raise RuntimeError( + "iSWAP Y max not loaded; was setup() called with skip_iswap=False?" + ) max_y = self._iswap_rotation_drive_y_max_mm absolute_min_y = self.extended_conf.left_arm_min_y_position if not (absolute_min_y <= y <= max_y): From 0220cdde43995885e5da7c4d175ddf17df9b60e5 Mon Sep 17 00:00:00 2001 From: Camillo Moschner Date: Sat, 2 May 2026 19:38:35 +0100 Subject: [PATCH 3/3] `make format` --- pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py index 479cab34e63..e6dfee5693b 100644 --- a/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py +++ b/pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py @@ -10010,9 +10010,7 @@ async def iswap_rotation_drive_move_y( if self._iswap_rotation_drive_y_max_mm is None: self._iswap_rotation_drive_y_max_mm = await self._iswap_rotation_drive_request_y_max() if self._iswap_rotation_drive_y_max_mm is None: - raise RuntimeError( - "iSWAP Y max not loaded; was setup() called with skip_iswap=False?" - ) + raise RuntimeError("iSWAP Y max not loaded; was setup() called with skip_iswap=False?") max_y = self._iswap_rotation_drive_y_max_mm absolute_min_y = self.extended_conf.left_arm_min_y_position if not (absolute_min_y <= y <= max_y):