Skip to content

bring back request_tip_len_on_channel #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions pylabrobot/liquid_handling/backends/hamilton/STAR.py
Original file line number Diff line number Diff line change
Expand Up @@ -7317,6 +7317,54 @@ async def clld_probe_z_height_using_channel(

return result_in_mm

async def request_tip_len_on_channel(
self,
channel_idx: int, # 0-based indexing of channels!
) -> float:
"""
Measures the length of the tip attached to the specified pipetting channel.
Checks if a tip is present on the given channel. If present, moves all channels
to THE safe Z position, 334.3 mm, measures the tip bottom Z-coordinate, and calculates
the total tip length. Supports tips of lengths 50.4 mm, 59.9 mm, and 95.1 mm.
Raises an error if the tip length is unsupported or if no tip is present.
Parameters:
channel_idx: Index of the pipetting channel (0-based).
Returns:
The measured tip length in millimeters.
Raises:
ValueError: If no tip is present on the channel or if the tip length is unsupported.
"""

# Check there is a tip on the channel
all_channel_occupancy = await self.request_tip_presence()
if not all_channel_occupancy[channel_idx]:
raise ValueError(f"No tip present on channel {channel_idx}")

# Level all channels
await self.move_all_channels_in_z_safety()
known_top_position_channel_head = 334.3 # mm
fitting_depth_of_all_standard_channel_tips = 8 # mm
unknown_offset_for_all_tips = 0.4 # mm

# Request z-coordinate of channel+tip bottom
tip_bottom_z_coordinate = await self.request_z_pos_channel_n(
pipetting_channel_index=channel_idx
)

total_tip_len = round(
known_top_position_channel_head
- (
tip_bottom_z_coordinate
- fitting_depth_of_all_standard_channel_tips
- unknown_offset_for_all_tips
),
1,
)

if total_tip_len in [50.4, 59.9, 95.1]: # 50ul, 300ul, 1000ul
return total_tip_len
raise ValueError(f"Tip of length {total_tip_len} not yet supported")

async def ztouch_probe_z_height_using_channel(
self,
channel_idx: int, # 0-based indexing of channels!
Expand Down