Skip to content

Commit 888182b

Browse files
committed
api raises ValueError() if pipette tries to move plunger beyond TOP position
1 parent f37ad5d commit 888182b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

api/src/opentrons/hardware_control/instruments/ot3/pipette_handler.py

+5
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ def plunger_position(
514514
multiplier = 1.0 + (correction_volume / ul)
515515
mm_dist_from_bottom = ul / instr.ul_per_mm(ul, action)
516516
mm_dist_from_bottom_corrected = mm_dist_from_bottom * multiplier
517+
max_mm = instr.plunger_positions.bottom - instr.plunger_positions.top
518+
if mm_dist_from_bottom_corrected > max_mm:
519+
raise ValueError(f"Pipette does not support displacement of "
520+
f"{round(mm_dist_from_bottom_corrected, 2)} mm "
521+
f"(maximum is {max_mm} mm)")
517522
position = instr.plunger_positions.bottom - mm_dist_from_bottom_corrected
518523
return round(position, 6)
519524

0 commit comments

Comments
 (0)