Skip to content

Commit 5c81179

Browse files
authored
bring back STAR.request_tip_len_on_channel (#380)
1 parent 2b3a14f commit 5c81179

File tree

1 file changed

+48
-0
lines changed
  • pylabrobot/liquid_handling/backends/hamilton

1 file changed

+48
-0
lines changed

pylabrobot/liquid_handling/backends/hamilton/STAR.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7317,6 +7317,54 @@ async def clld_probe_z_height_using_channel(
73177317

73187318
return result_in_mm
73197319

7320+
async def request_tip_len_on_channel(
7321+
self,
7322+
channel_idx: int, # 0-based indexing of channels!
7323+
) -> float:
7324+
"""
7325+
Measures the length of the tip attached to the specified pipetting channel.
7326+
Checks if a tip is present on the given channel. If present, moves all channels
7327+
to THE safe Z position, 334.3 mm, measures the tip bottom Z-coordinate, and calculates
7328+
the total tip length. Supports tips of lengths 50.4 mm, 59.9 mm, and 95.1 mm.
7329+
Raises an error if the tip length is unsupported or if no tip is present.
7330+
Parameters:
7331+
channel_idx: Index of the pipetting channel (0-based).
7332+
Returns:
7333+
The measured tip length in millimeters.
7334+
Raises:
7335+
ValueError: If no tip is present on the channel or if the tip length is unsupported.
7336+
"""
7337+
7338+
# Check there is a tip on the channel
7339+
all_channel_occupancy = await self.request_tip_presence()
7340+
if not all_channel_occupancy[channel_idx]:
7341+
raise ValueError(f"No tip present on channel {channel_idx}")
7342+
7343+
# Level all channels
7344+
await self.move_all_channels_in_z_safety()
7345+
known_top_position_channel_head = 334.3 # mm
7346+
fitting_depth_of_all_standard_channel_tips = 8 # mm
7347+
unknown_offset_for_all_tips = 0.4 # mm
7348+
7349+
# Request z-coordinate of channel+tip bottom
7350+
tip_bottom_z_coordinate = await self.request_z_pos_channel_n(
7351+
pipetting_channel_index=channel_idx
7352+
)
7353+
7354+
total_tip_len = round(
7355+
known_top_position_channel_head
7356+
- (
7357+
tip_bottom_z_coordinate
7358+
- fitting_depth_of_all_standard_channel_tips
7359+
- unknown_offset_for_all_tips
7360+
),
7361+
1,
7362+
)
7363+
7364+
if total_tip_len in [50.4, 59.9, 95.1]: # 50ul, 300ul, 1000ul
7365+
return total_tip_len
7366+
raise ValueError(f"Tip of length {total_tip_len} not yet supported")
7367+
73207368
async def ztouch_probe_z_height_using_channel(
73217369
self,
73227370
channel_idx: int, # 0-based indexing of channels!

0 commit comments

Comments
 (0)