Skip to content

Commit bd8e8ef

Browse files
authored
Fix STARBackend.get core() & STARBackend.put core() (#710)
1 parent 6252689 commit bd8e8ef

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR_backend.py

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4974,6 +4974,7 @@ async def dispense_pip(
49744974
@need_iswap_parked
49754975
async def get_core(self, p1: int, p2: int):
49764976
"""Get CoRe gripper tool from wasteblock mount."""
4977+
49774978
if not 0 <= p1 < self.num_channels:
49784979
raise ValueError(f"channel_1 must be between 0 and {self.num_channels - 1}")
49794980
if not 1 <= p2 <= self.num_channels:
@@ -4984,23 +4985,29 @@ async def get_core(self, p1: int, p2: int):
49844985
# a resource on the robot deck and use deck.get_resource().get_location_wrt(self.deck).
49854986
deck_size = self.deck.get_absolute_size_x()
49864987
if deck_size == STARLET_SIZE_X:
4987-
xs = 7975 # 1360-797.5 = 562.5
4988+
xs = 7975 # 1360-797.5 = 562.5 (distance to right edge of deck)
49884989
elif deck_size == STAR_SIZE_X:
4989-
xs = 13385 # 1900-1337.5 = 562.5, plus a manual adjustment of + 10
4990+
xs = 13375 # 1900-1337.5 = 562.5 (distance to right edge of deck)
49904991
else:
49914992
raise ValueError(f"Deck size {deck_size} not supported")
49924993

4994+
channel_x_coord = round(xs + self.core_adjustment.x * 10)
4995+
back_channel_y_center = round(1250 + self.core_adjustment.y * 10)
4996+
front_channel_y_center = round(1070 + self.core_adjustment.y * 10)
4997+
begin_z_coord = round(2350 + self.core_adjustment.z * 10)
4998+
end_z_coord = round(2250 + self.core_adjustment.z * 10)
4999+
49935000
command_output = await self.send_command(
49945001
module="C0",
49955002
command="ZT",
4996-
xs=f"{xs + self.core_adjustment.x:05}",
5003+
xs=f"{channel_x_coord:05}",
49975004
xd="0",
4998-
ya=f"{1240 + self.core_adjustment.y:04}",
4999-
yb=f"{1065 + self.core_adjustment.y:04}",
5005+
ya=f"{back_channel_y_center:04}",
5006+
yb=f"{front_channel_y_center:04}",
50005007
pa=f"{p1:02}",
50015008
pb=f"{p2:02}",
5002-
tp=f"{2350 + self.core_adjustment.z:04}",
5003-
tz=f"{2250 + self.core_adjustment.z:04}",
5009+
tp=f"{begin_z_coord:04}",
5010+
tz=f"{end_z_coord:04}",
50045011
th=round(self._iswap_traversal_height * 10),
50055012
tt="14",
50065013
)
@@ -5010,23 +5017,32 @@ async def get_core(self, p1: int, p2: int):
50105017
@need_iswap_parked
50115018
async def put_core(self):
50125019
"""Put CoRe gripper tool at wasteblock mount."""
5020+
50135021
assert self.deck is not None, "must have deck defined to access CoRe grippers"
5022+
50145023
deck_size = self.deck.get_absolute_size_x()
50155024
if deck_size == STARLET_SIZE_X:
50165025
xs = 7975
50175026
elif deck_size == STAR_SIZE_X:
5018-
xs = 13385
5027+
xs = 13375
50195028
else:
50205029
raise ValueError(f"Deck size {deck_size} not supported")
5030+
5031+
channel_x_coord = round(xs + self.core_adjustment.x * 10)
5032+
back_channel_y_center = round(1240 + self.core_adjustment.y * 10)
5033+
front_channel_y_center = round(1065 + self.core_adjustment.y * 10)
5034+
begin_z_coord = round(2150 + self.core_adjustment.z * 10)
5035+
end_z_coord = round(2050 + self.core_adjustment.z * 10)
5036+
50215037
command_output = await self.send_command(
50225038
module="C0",
50235039
command="ZS",
5024-
xs=f"{xs + self.core_adjustment.x:05}",
5040+
xs=f"{channel_x_coord:05}",
50255041
xd="0",
5026-
ya=f"{1240 + self.core_adjustment.y:04}",
5027-
yb=f"{1065 + self.core_adjustment.y:04}",
5028-
tp=f"{2150 + self.core_adjustment.z:04}",
5029-
tz=f"{2050 + self.core_adjustment.z:04}",
5042+
ya=f"{back_channel_y_center:04}",
5043+
yb=f"{front_channel_y_center:04}",
5044+
tp=f"{begin_z_coord:04}",
5045+
tz=f"{end_z_coord:04}",
50305046
th=round(self._iswap_traversal_height * 10),
50315047
te=round(self._iswap_traversal_height * 10),
50325048
)

pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ async def test_move_core(self):
927927
self.STAR._write_and_read_command.assert_has_calls(
928928
[
929929
_any_write_and_read_command_call(
930-
"C0ZTid0001xs07975xd0ya1240yb1065pa07pb08tp2350tz2250th2800tt14"
930+
"C0ZTid0001xs07975xd0ya1250yb1070pa07pb08tp2350tz2250th2800tt14"
931931
),
932932
_any_write_and_read_command_call(
933933
"C0ZPid0002xs03479xd0yj1142yv0050zj1876zy0500yo0885yg0825yw15" "th2800te2800"

0 commit comments

Comments
 (0)