Skip to content

Commit

Permalink
feat(api): check for tip presence on 96 channel pipette (#13703)
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj authored Oct 6, 2023
1 parent 1b209e5 commit 0b97681
Show file tree
Hide file tree
Showing 68 changed files with 175 additions and 67 deletions.
4 changes: 4 additions & 0 deletions api/src/opentrons/hardware_control/instruments/ot3/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ def remove_tip(self) -> None:
def has_tip(self) -> bool:
return self._has_tip

@property
def tip_presence_check_dist_mm(self) -> float:
return self._config.tip_presence_check_distance_mm

# Cache max is chosen somewhat arbitrarily. With a float is input we don't
# want this to unbounded.
@functools.lru_cache(maxsize=100)
Expand Down
40 changes: 39 additions & 1 deletion api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
pipette_load_name_conversions as pipette_load_name,
)
from opentrons_shared_data.robot.dev_types import RobotType
from opentrons_shared_data.errors.exceptions import StallOrCollisionDetectedError
from opentrons_shared_data.errors.exceptions import (
StallOrCollisionDetectedError,
)

from opentrons import types as top_types
from opentrons.config import robot_configs, feature_flags as ff
Expand Down Expand Up @@ -1895,6 +1897,42 @@ async def blow_out(
blowout_spec.instr.set_current_volume(0)
blowout_spec.instr.ready_to_aspirate = False

async def get_tip_presence_status(self, mount: OT3Mount) -> bool:
"""
Check tip presence status. If a high throughput pipette is present,
move the tip motors down before checking the sensor status.
"""
checked_mount = OT3Mount.from_mount(mount)
high_throughput = self._gantry_load == GantryLoad.HIGH_THROUGHPUT
if high_throughput:
# check if we're already at the tip_presence_check position, if we are dont move

instrument = self._pipette_handler.get_pipette(checked_mount)
tip_presence_check_target = instrument.tip_presence_check_dist_mm

# if position is not known, home gear motors before any potential movement
if self._backend.gear_motor_position is None:
await self.home_gear_motors()

tip_motor_pos_float = axis_convert(self._backend.gear_motor_position, 0.0)[
Axis.of_main_tool_actuator(checked_mount)
]

# only move tip motors if they are not already below the sensor
if tip_motor_pos_float < tip_presence_check_target:
clamp_moves = self._build_moves(
{Axis.Q: tip_motor_pos_float}, {Axis.Q: tip_presence_check_target}
)
await self._backend.tip_action(moves=clamp_moves[0])
tip_status = await self._backend.get_tip_present_state(
mount=checked_mount, expect_multiple_responses=high_throughput
)

if high_throughput:
# return tip motors to neutral position
await self.home_gear_motors()
return tip_status

async def _force_pick_up_tip(
self, mount: OT3Mount, pipette_spec: PickUpTipSpec
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_filter_zero_duration_step() -> None:
Axis.P_R: 0,
}
moves = [Move.build_dummy([Axis.X, Axis.Y, Axis.Z_L, Axis.Z_R, Axis.P_L])]
for block in (moves[0].blocks[0], moves[0].blocks[1]):
for block in moves[0].blocks:
block.distance = f64(25.0)
block.time = f64(1.0)
block.initial_speed = f64(25.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"plungerHomingConfigurations": {
"current": 2.0,
"speed": 5
}
},
"tipPresenceCheckDistanceMM": "8.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"plungerHomingConfigurations": {
"current": 2.0,
"speed": 5
}
},
"tipPresenceCheckDistanceMM": "8.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"plungerHomingConfigurations": {
"current": 2.0,
"speed": 5
}
},
"tipPresenceCheckDistanceMM": "8.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"plungerHomingConfigurations": {
"current": 0.8,
"speed": 5
}
},
"tipPresenceCheckDistanceMM": "8.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
"plungerHomingConfigurations": {
"current": 0.8,
"speed": 5
}
},
"tipPresenceCheckDistanceMM": "8.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.3,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.3,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.3,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.3,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 0.5,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"plungerHomingConfigurations": {
"current": 1.0,
"speed": 30
}
},
"tipPresenceCheckDistanceMM": "0.0"
}
Loading

0 comments on commit 0b97681

Please sign in to comment.