Skip to content

Commit

Permalink
ensure evo tip dispense and unseal functions work
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten committed Jan 24, 2025
1 parent 44b4faf commit ebdfe93
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2325,11 +2325,11 @@ def set_working_volume(
instrument.working_volume = tip_volume

async def tip_drop_moves(
self, mount: Union[top_types.Mount, OT3Mount], home_after: bool = False
self, mount: Union[top_types.Mount, OT3Mount], home_after: bool = False, ignore_plunger: Optional[bool] = False
) -> None:
realmount = OT3Mount.from_mount(mount)

await self._move_to_plunger_bottom(realmount, rate=1.0, check_current_vol=False)
if ignore_plunger is False:
await self._move_to_plunger_bottom(realmount, rate=1.0, check_current_vol=False)

if self.gantry_load == GantryLoad.HIGH_THROUGHPUT:
spec = self._pipette_handler.plan_ht_drop_tip()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def pick_up_tip(
...

async def tip_drop_moves(
self, mount: MountArgType, home_after: bool = True
self, mount: MountArgType, home_after: bool = True, ignore_plunger: Optional[bool] = False,
) -> None:
...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ async def execute(self, params: EvotipDispenseParams) -> _ExecuteReturn:
pipetting=self._pipetting,
model_utils=self._model_utils,
)


if (
isinstance(current_location, CurrentWell)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ async def relative_pickup_tip(
tip_pick_up_params: TipPickUpParams,
mount: MountType,
press_fit: bool,
current_volume: float,
) -> None:
prep_distance = tip_pick_up_params.prepDistance
press_distance = tip_pick_up_params.pressDistance
Expand Down Expand Up @@ -174,7 +175,7 @@ async def relative_pickup_tip(
)

# Lower tip presence
await self._gantry_mover.move_axes(axis_map={mount_axis: 2}, speed=10)
await self._gantry_mover.move_axes(axis_map={mount_axis: 2}, speed=10, relative_move=True)
await self._gantry_mover.move_axes(
axis_map={MotorAxis.AXIS_96_CHANNEL_CAM: ejector_push_mm},
speed=5.5,
Expand All @@ -185,9 +186,11 @@ async def relative_pickup_tip(
speed=5.5,
relative_move=True,
)

# cache_tip
if self._state_view.config.use_virtual_pipettes is False:
self._tip_handler.cache_tip(pipette_id, tip_geometry)
self._hardware_api.hardware_instruments[mount.to_hw_mount()].set_current_volume(current_volume)

async def execute(
self, params: EvotipSealPipetteParams
Expand Down Expand Up @@ -238,6 +241,7 @@ async def execute(
tip_pick_up_params=params.tipPickUpParams,
mount=mount,
press_fit=True,
current_volume=maximum_volume,
)
elif channels == 96:
pick_up_params = (
Expand All @@ -248,14 +252,15 @@ async def execute(
tip_geometry=tip_geometry,
tip_pick_up_params=pick_up_params,
mount=mount,
press_fit=True,
press_fit=False,
current_volume=maximum_volume,
)
else:
tip_geometry = await self._tip_handler.pick_up_tip(
pipette_id=pipette_id,
labware_id=labware_id,
well_name=well_name,
do_not_ignore_tip_presence=False,
do_not_ignore_tip_presence=True,
)
state_update = StateUpdate()
state_update.update_pipette_tip_state(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from opentrons.protocol_engine.resources.model_utils import ModelUtils
from opentrons.protocol_engine.errors import UnsupportedLabwareForActionError
from opentrons.protocol_engine.types import MotorAxis
from opentrons.types import MountType

from ..types import DropTipWellLocation
from .pipetting_common import (
Expand All @@ -29,7 +31,7 @@

if TYPE_CHECKING:
from ..state.state import StateView
from ..execution import MovementHandler, TipHandler
from ..execution import MovementHandler, TipHandler, GantryMover


EvotipUnsealPipetteCommandType = Literal["evotipUnsealPipette"]
Expand Down Expand Up @@ -76,12 +78,14 @@ def __init__(
tip_handler: TipHandler,
movement: MovementHandler,
model_utils: ModelUtils,
gantry_mover: GantryMover,
**kwargs: object,
) -> None:
self._state_view = state_view
self._tip_handler = tip_handler
self._movement_handler = movement
self._model_utils = model_utils
self._gantry_mover = gantry_mover

async def execute(self, params: EvotipUnsealPipetteParams) -> _ExecuteReturn:
"""Move to and drop a tip using the requested pipette."""
Expand Down Expand Up @@ -116,11 +120,20 @@ async def execute(self, params: EvotipUnsealPipetteParams) -> _ExecuteReturn:
)
if isinstance(move_result, DefinedErrorData):
return move_result

# Move to an appropriate position
mount = self._state_view.pipettes.get_mount(pipette_id)

mount_axis = MotorAxis.LEFT_Z if mount == MountType.LEFT else MotorAxis.RIGHT_Z
await self._gantry_mover.move_axes(
axis_map={mount_axis: -14}, speed=10, relative_move=True
)

await self._tip_handler.drop_tip(
pipette_id=pipette_id,
home_after=home_after,
do_not_ignore_tip_presence=False,
ignore_plunger=True,
)

return SuccessData(
Expand Down
5 changes: 4 additions & 1 deletion api/src/opentrons/protocol_engine/execution/tip_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async def drop_tip(
pipette_id: str,
home_after: Optional[bool],
do_not_ignore_tip_presence: Optional[bool] = True,
ignore_plunger: Optional[bool] = False,
) -> None:
"""Drop the attached tip into the current location.
Expand Down Expand Up @@ -277,6 +278,7 @@ async def drop_tip(
pipette_id: str,
home_after: Optional[bool],
do_not_ignore_tip_presence: Optional[bool] = True,
ignore_plunger: Optional[bool] = False,
) -> None:
"""See documentation on abstract base class."""
hw_mount = self._get_hw_mount(pipette_id)
Expand All @@ -288,7 +290,7 @@ async def drop_tip(
else:
kwargs = {}

await self._hardware_api.tip_drop_moves(mount=hw_mount, **kwargs)
await self._hardware_api.tip_drop_moves(mount=hw_mount, ignore_plunger=ignore_plunger, **kwargs)

if do_not_ignore_tip_presence:
# Allow TipNotAttachedError to propagate.
Expand Down Expand Up @@ -440,6 +442,7 @@ async def drop_tip(
pipette_id: str,
home_after: Optional[bool],
do_not_ignore_tip_presence: Optional[bool] = True,
ignore_plunger: Optional[bool] = False,
) -> None:
"""Pick up a tip at the current location using a virtual pipette.
Expand Down

0 comments on commit ebdfe93

Please sign in to comment.