Skip to content

Commit be3bf13

Browse files
committed
fix 96 head trash
1 parent 140cd81 commit be3bf13

File tree

3 files changed

+23
-34
lines changed

3 files changed

+23
-34
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR.py

+19-30
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
STARLET_SIZE_X,
7070
)
7171
from pylabrobot.resources.liquid import Liquid
72+
from pylabrobot.resources.trash import Trash
7273
from pylabrobot.utils.linalg import matrix_vector_multiply_3x3
7374

7475
T = TypeVar("T")
@@ -1387,7 +1388,8 @@ async def setup(
13871388
core96_head_initialized = await self.request_core_96_head_initialization_status()
13881389
if not core96_head_initialized:
13891390
await self.initialize_core_96_head(
1390-
z_position_at_the_command_end=int(self._traversal_height * 10)
1391+
trash96=self.deck.get_trash_area96(),
1392+
z_position_at_the_command_end=int(self._traversal_height * 10),
13911393
)
13921394

13931395
# After setup, STAR will have thrown out anything mounted on the pipetting channels, including
@@ -5116,46 +5118,33 @@ async def request_tadm_status(self):
51165118
# -------------- 3.10.1 Initialization --------------
51175119

51185120
async def initialize_core_96_head(
5119-
self,
5120-
x_position: int = 2321,
5121-
x_direction: int = 1,
5122-
y_position: int = 1103,
5123-
z_deposit_position: int = 1890,
5124-
z_position_at_the_command_end: int = 2450,
5121+
self, trash96: Trash, z_position_at_the_command_end: float = 245.0
51255122
):
51265123
"""Initialize CoRe 96 Head
51275124
5128-
Initialize CoRe 96 Head. Dependent to configuration initialization change.
5129-
51305125
Args:
5131-
x_position: X-Position [0.1mm] (discard position of tip A1). Must be between 0 and 30000.
5132-
Default 0.
5133-
x_direction: X-direction. 0 = positive 1 = negative. Must be between 0 and 1. Default 0.
5134-
y_position: Y-Position [0.1mm] (discard position of tip A1 ). Must be between 1054 and 5743.
5135-
Default 5743.
5136-
z_deposit_position_[0.1mm]: Z- deposit position [0.1mm] (collar bearing position). Must be
5137-
between 0 and 3425. Default 3425.
5138-
z_position_at_the_command_end: Z-Position at the command end [0.1mm]. Must be between 0 and
5139-
3425. Default 3425.
5126+
trash96: Trash object where tips should be disposed. The 96 head will be positioned in the
5127+
center of the trash.
5128+
z_position_at_the_command_end: Z position at the end of the command [mm].
51405129
"""
51415130

5142-
assert 0 <= x_position <= 30000, "x_position must be between 0 and 30000"
5143-
assert 0 <= x_direction <= 1, "x_direction must be between 0 and 1"
5144-
assert 1054 <= y_position <= 5743, "y_position must be between 1054 and 5743"
5145-
assert 0 <= z_deposit_position <= 3425, "z_deposit_position must be between 0 and 3425"
5146-
assert (
5147-
0 <= z_position_at_the_command_end <= 3425
5148-
), "z_position_at_the_command_end must be between 0 and 3425"
5131+
# The firmware command expects location of tip A1 of the head.
5132+
loc = trash96.get_absolute_location()
5133+
head_size_x = 9 * 11 # 12 channels, 9mm spacing in between
5134+
head_size_y = 9 * 7 # 8 channels, 9mm spacing in between
5135+
channel_size = 9
5136+
loc.x += (trash96.get_size_x() - head_size_x) / 2 + channel_size / 2
5137+
loc.y += (trash96.get_size_y() - head_size_y) / 2 + channel_size / 2
51495138

51505139
return await self.send_command(
51515140
module="C0",
51525141
command="EI",
51535142
read_timeout=60,
5154-
xs=f"{x_position:05}",
5155-
xd=x_direction,
5156-
yh=f"{y_position}",
5157-
za=f"{z_deposit_position}",
5158-
ze=f"{z_position_at_the_command_end}",
5143+
xs=f"{abs(round(loc.x * 10)):05}",
5144+
xd=0 if loc.x >= 0 else 1,
5145+
yh=f"{abs(round(loc.y * 10)):04}",
5146+
za=f"{round(loc.z * 10):04}",
5147+
ze=f"{round(z_position_at_the_command_end*10)}",
51595148
)
51605149

51615150
async def move_core_96_to_safe_position(self):

pylabrobot/resources/hamilton/hamilton_deck_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_summary(self):
4646
"""
4747
Rail Resource Type Coordinates (mm)
4848
=================================================================================
49-
(-13) ├── trash_core96 Trash (-232.100, 110.300, 189.000)
49+
(-13) ├── trash_core96 Trash (-58.200, 106.000, 229.000)
5050
5151
(1) ├── tip_carrier TipCarrier (100.000, 063.000, 100.000)
5252
│ ├── tip_rack_01 TipRack (106.200, 073.000, 214.950)

pylabrobot/resources/hamilton/hamilton_decks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,11 @@ def __init__(
399399
self._trash96: Optional[Trash] = None
400400
if with_trash96:
401401
# got this location from a .lay file, but will probably need to be adjusted by the user.
402-
self._trash96 = Trash("trash_core96", size_x=82.6, size_y=122.4, size_z=0) # size of tiprack
402+
self._trash96 = Trash("trash_core96", size_x=122.4, size_y=82.6, size_z=0) # size of tiprack
403403
self.assign_child_resource(
404404
resource=self._trash96,
405-
location=Coordinate(x=-232.1, y=110.3, z=189.0),
406-
) # 165.0 -> 189.0
405+
location=Coordinate(x=-42.0 - 16.2, y=120.3 - 14.3, z=229.0),
406+
)
407407

408408
if with_teaching_rack:
409409
teaching_carrier = Resource(name="teaching_carrier", size_x=30, size_y=445.2, size_z=100)

0 commit comments

Comments
 (0)