Skip to content

Commit 5bf5092

Browse files
committed
merge request_y_pos_iswap_channel into iswap_request_module_y
1 parent 7cbd9d7 commit 5bf5092

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6439,19 +6439,6 @@ async def position_components_for_free_iswap_y_range(self):
64396439

64406440
return await self.send_command(module="C0", command="FY")
64416441

6442-
async def request_y_pos_iswap_channel(self):
6443-
"""Query the current Y-axis position of the iSWAP channel."""
6444-
6445-
y_pos_query_increments = await self.send_command(
6446-
module="R0",
6447-
command="RY",
6448-
fmt="ry######",
6449-
)
6450-
6451-
y_pos_query_mm = self.y_drive_increment_to_mm(y_pos_query_increments["ry"])
6452-
6453-
return round(y_pos_query_mm, 1)
6454-
64556442
async def move_iswap_x_relative(self, step_size: float, allow_splitting: bool = False):
64566443
"""
64576444
Args:
@@ -7229,16 +7216,11 @@ async def request_iswap_position(self) -> Coordinate:
72297216
z=(resp["zj"] / 10) * (1 if resp["zd"] == 0 else -1),
72307217
)
72317218

7232-
@staticmethod
7233-
def _iswap_y_inc_to_mm(y_inc: int) -> float:
7234-
mm_per_increment = 0.046302083
7235-
return round(y_inc * mm_per_increment, 2)
7236-
72377219
async def iswap_request_module_y(self) -> float:
72387220
"""Request iSWAP module (not gripper) Y position in mm"""
72397221
resp = await self.send_command(module="R0", command="RY", fmt="ry##### (n)")
72407222
iswap_y_pos = resp["ry"][1] # 0 = FW counter, 1 = HW counter
7241-
return STARBackend._iswap_y_inc_to_mm(iswap_y_pos)
7223+
return round(STARBackend.y_drive_increment_to_mm(iswap_y_pos), 1)
72427224

72437225
async def request_iswap_initialization_status(self) -> bool:
72447226
"""Request iSWAP initialization status
@@ -7390,7 +7372,9 @@ async def clld_probe_y_position_using_channel(
73907372
if channel_idx > 0:
73917373
channel_idx_minus_one_y_pos = await self.request_y_pos_channel_n(channel_idx - 1)
73927374
else:
7393-
channel_idx_minus_one_y_pos = STAR.y_drive_increment_to_mm(13_714) + 9 # y-position=635 mm
7375+
channel_idx_minus_one_y_pos = (
7376+
STARBackend.y_drive_increment_to_mm(13_714) + 9
7377+
) # y-position=635 mm
73947378
if channel_idx < (self.num_channels - 1):
73957379
channel_idx_plus_one_y_pos = await self.request_y_pos_channel_n(channel_idx + 1)
73967380
else:
@@ -7440,11 +7424,11 @@ async def clld_probe_y_position_using_channel(
74407424
# Machine-compatibility check of calculated parameters
74417425
assert 0 <= max_y_search_pos_increments <= 13_714, (
74427426
"Maximum y search position must be between \n0 and"
7443-
+ f"{STAR.y_drive_increment_to_mm(13_714)+9} mm, is {max_y_search_pos_increments} mm"
7427+
+ f"{STARBackend.y_drive_increment_to_mm(13_714)+9} mm, is {max_y_search_pos_increments} mm"
74447428
)
74457429
assert 20 <= channel_speed_increments <= 8_000, (
7446-
f"LLD search speed must be between \n{STAR.y_drive_increment_to_mm(20)}"
7447-
+ f"and {STAR.y_drive_increment_to_mm(8_000)} mm/sec, is {channel_speed} mm/sec"
7430+
f"LLD search speed must be between \n{STARBackend.y_drive_increment_to_mm(20)}"
7431+
+ f"and {STARBackend.y_drive_increment_to_mm(8_000)} mm/sec, is {channel_speed} mm/sec"
74487432
)
74497433
assert channel_acceleration_int in [1, 2, 3, 4], (
74507434
"Channel speed must be in [1, 2, 3, 4] (* 5_000 steps/sec**2)"
@@ -7492,7 +7476,7 @@ async def clld_probe_y_position_using_channel(
74927476

74937477
else: # probing_direction == "forward"
74947478
if channel_idx == 0: # safe default
7495-
adjacent_y_pos = STAR.y_drive_increment_to_mm(13_714) + 9 # y-position=635 mm
7479+
adjacent_y_pos = STARBackend.y_drive_increment_to_mm(13_714) + 9 # y-position=635 mm
74967480
else: # previous channel
74977481
adjacent_y_pos = await self.request_y_pos_channel_n(channel_idx - 1)
74987482

0 commit comments

Comments
 (0)