Skip to content

Commit

Permalink
fix(api): add a buffer to tip action home moves to make sure the limi…
Browse files Browse the repository at this point in the history
…t switch is triggered (#12743)
  • Loading branch information
Laura-Danielle authored May 22, 2023
1 parent acbf638 commit 8e800ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class TipMotorPickUpTipSpec:
pick_up_distance: float
speed: float
currents: Dict[OT3Axis, float]
# FIXME we should throw this in a config
# file of some sort
home_buffer: float = 0


@dataclass(frozen=True)
Expand All @@ -100,6 +103,9 @@ class DropTipMove:
home_after_safety_margin: float = 0
home_axes: Sequence[OT3Axis] = tuple()
is_ht_tip_action: bool = False
# FIXME we should throw this in a config
# file of some sort
home_buffer: float = 0


@dataclass(frozen=True)
Expand Down Expand Up @@ -691,6 +697,7 @@ def build_presses() -> Iterator[Tuple[float, float]]:
pick_up_distance=instrument.pick_up_configurations.distance,
speed=instrument.pick_up_configurations.speed,
currents={OT3Axis.Q: instrument.pick_up_configurations.current},
home_buffer=10,
),
),
add_tip_to_instr,
Expand Down Expand Up @@ -769,6 +776,7 @@ def build() -> List[DropTipMove]:
home_after_safety_margin=abs(bottom_pos - droptip_pos),
home_axes=home_axes,
is_ht_tip_action=is_ht_pipette,
home_buffer=10 if is_ht_pipette else 0,
),
DropTipMove( # always finish drop-tip at a known safe plunger position
target_position=bottom_pos, current=plunger_currents, speed=None
Expand Down
4 changes: 2 additions & 2 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ async def _motor_pick_up_tip(
# back clamps off the adapter posts
await self._backend.tip_action(
[OT3Axis.of_main_tool_actuator(mount)],
pipette_spec.pick_up_distance,
pipette_spec.pick_up_distance + pipette_spec.home_buffer,
pipette_spec.speed,
"home",
)
Expand Down Expand Up @@ -1703,7 +1703,7 @@ async def drop_tip(
)
await self._backend.tip_action(
[OT3Axis.of_main_tool_actuator(mount)],
move.target_position,
move.target_position + move.home_buffer,
move.speed,
"home",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_plan_check_pick_up_tip_with_presses_argument(
pick_up_distance=0,
speed=10,
currents={OT3Axis.Q: 1},
home_buffer=10,
),
),
(None, 3, 8, None),
Expand Down

0 comments on commit 8e800ef

Please sign in to comment.