Skip to content
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

chore: Separate lt and ht pickup and dropoff #13962

Merged
merged 19 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
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
21 changes: 7 additions & 14 deletions api/src/opentrons/hardware_control/instruments/ot2/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
PlungerPositions,
MotorConfigurations,
SupportedTipsDefinition,
TipHandlingConfigurations,
PickUpTipConfigurations,
DropTipConfigurations,
PipetteModelVersionType,
PipetteNameType,
PipetteLiquidPropertiesDefinition,
Expand Down Expand Up @@ -109,10 +110,7 @@ def __init__(
)
self._nozzle_offset = self._config.nozzle_offset
self._nozzle_manager = (
nozzle_manager.NozzleConfigurationManager.build_from_nozzlemap(
self._config.nozzle_map,
self._config.partial_tip_configurations.per_tip_pickup_current,
)
nozzle_manager.NozzleConfigurationManager.build_from_config(self._config)
)
self._current_volume = 0.0
self._working_volume = float(self._liquid_class.max_volume)
Expand Down Expand Up @@ -230,17 +228,15 @@ def plunger_motor_current(self) -> MotorConfigurations:
return self._config.plunger_motor_configurations

@property
def pick_up_configurations(self) -> TipHandlingConfigurations:
def pick_up_configurations(self) -> PickUpTipConfigurations:
return self._config.pick_up_tip_configurations

@pick_up_configurations.setter
def pick_up_configurations(
self, pick_up_configs: TipHandlingConfigurations
) -> None:
def pick_up_configurations(self, pick_up_configs: PickUpTipConfigurations) -> None:
self._pick_up_configurations = pick_up_configs

@property
def drop_configurations(self) -> TipHandlingConfigurations:
def drop_configurations(self) -> DropTipConfigurations:
return self._config.drop_tip_configurations

@property
Expand Down Expand Up @@ -292,10 +288,7 @@ def reset_state(self) -> None:

self._tip_overlap_lookup = self.liquid_class.tip_overlap_dictionary
self._nozzle_manager = (
nozzle_manager.NozzleConfigurationManager.build_from_nozzlemap(
self._config.nozzle_map,
self._config.partial_tip_configurations.per_tip_pickup_current,
)
nozzle_manager.NozzleConfigurationManager.build_from_config(self._config)
)

def reset_pipette_offset(self, mount: Mount, to_default: bool) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,24 +768,24 @@ def plan_check_pick_up_tip( # type: ignore[no-untyped-def]
self._ihp_log.debug(f"Picking up tip on {mount.name}")

if presses is None or presses < 0:
checked_presses = instrument.pick_up_configurations.presses
checked_presses = instrument.pick_up_configurations.press_fit.presses
else:
checked_presses = presses

if not increment or increment < 0:
check_incr = instrument.pick_up_configurations.increment
check_incr = instrument.pick_up_configurations.press_fit.increment
else:
check_incr = increment

pick_up_speed = instrument.pick_up_configurations.speed
pick_up_speed = instrument.pick_up_configurations.press_fit.speed

def build_presses() -> Iterator[Tuple[float, float]]:
# Press the nozzle into the tip <presses> number of times,
# moving further by <increment> mm after each press
for i in range(checked_presses):
# move nozzle down into the tip
press_dist = (
-1.0 * instrument.pick_up_configurations.distance
-1.0 * instrument.pick_up_configurations.press_fit.distance
+ -1.0 * check_incr * i
)
# move nozzle back up
Expand All @@ -808,7 +808,9 @@ def add_tip_to_instr() -> None:
current={
Axis.by_mount(
mount
): instrument.nozzle_manager.get_tip_configuration_current()
): instrument.pick_up_configurations.press_fit.current_by_tip_count[
instrument.nozzle_manager.current_configuration.tip_count
]
},
speed=pick_up_speed,
relative_down=top_types.Point(0, 0, press_dist),
Expand All @@ -817,7 +819,7 @@ def add_tip_to_instr() -> None:
for press_dist, backup_dist in build_presses()
],
shake_off_list=self._build_pickup_shakes(instrument),
retract_target=instrument.pick_up_configurations.distance
retract_target=instrument.pick_up_configurations.press_fit.distance
+ check_incr * checked_presses
+ 2,
),
Expand All @@ -837,7 +839,9 @@ def add_tip_to_instr() -> None:
current={
Axis.by_mount(
mount
): instrument.nozzle_manager.get_tip_configuration_current()
): instrument.pick_up_configurations.press_fit.current_by_tip_count[
instrument.nozzle_manager.current_configuration.tip_count
]
},
speed=pick_up_speed,
relative_down=top_types.Point(0, 0, press_dist),
Expand All @@ -846,7 +850,7 @@ def add_tip_to_instr() -> None:
for press_dist, backup_dist in build_presses()
],
shake_off_list=self._build_pickup_shakes(instrument),
retract_target=instrument.pick_up_configurations.distance
retract_target=instrument.pick_up_configurations.press_fit.distance
+ check_incr * checked_presses
+ 2,
),
Expand Down Expand Up @@ -923,9 +927,13 @@ def plan_check_drop_tip( # type: ignore[no-untyped-def]
):
instrument = self.get_pipette(mount)

if not instrument.drop_configurations.plunger_eject:
raise CommandPreconditionViolated(
f"Pipette {instrument.name} on {mount.name} has no plunger eject configuration"
)
bottom = instrument.plunger_positions.bottom
droptip = instrument.plunger_positions.drop_tip
speed = instrument.drop_configurations.speed
speed = instrument.drop_configurations.plunger_eject.speed
shakes: List[Tuple[top_types.Point, Optional[float]]] = []
if Quirks.dropTipShake in instrument.config.quirks:
diameter = instrument.current_tiprack_diameter
Expand All @@ -941,7 +949,11 @@ def _remove_tips() -> None:
bottom,
droptip,
{Axis.of_plunger(mount): instrument.plunger_motor_current.run},
{Axis.of_plunger(mount): instrument.drop_configurations.current},
{
Axis.of_plunger(
mount
): instrument.drop_configurations.plunger_eject.current
},
speed,
home_after,
(Axis.of_plunger(mount),),
Expand Down Expand Up @@ -971,7 +983,7 @@ def _remove_tips() -> None:
{
Axis.of_main_tool_actuator(
mount
): instrument.drop_configurations.current
): instrument.drop_configurations.plunger_eject.current
},
speed,
home_after,
Expand Down
46 changes: 24 additions & 22 deletions api/src/opentrons/hardware_control/instruments/ot3/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
PlungerPositions,
MotorConfigurations,
SupportedTipsDefinition,
TipHandlingConfigurations,
PickUpTipConfigurations,
PressFitPickUpTipConfiguration,
CamActionPickUpTipConfiguration,
DropTipConfigurations,
PlungerHomingConfigurations,
PipetteNameType,
PipetteModelVersionType,
Expand Down Expand Up @@ -95,10 +98,7 @@ def __init__(
)
self._nozzle_offset = self._config.nozzle_offset
self._nozzle_manager = (
nozzle_manager.NozzleConfigurationManager.build_from_nozzlemap(
self._config.nozzle_map,
self._config.partial_tip_configurations.per_tip_pickup_current,
)
nozzle_manager.NozzleConfigurationManager.build_from_config(self._config)
)
self._current_volume = 0.0
self._working_volume = float(self._liquid_class.max_volume)
Expand Down Expand Up @@ -185,21 +185,19 @@ def plunger_motor_current(self) -> MotorConfigurations:
return self._plunger_motor_current

@property
def pick_up_configurations(self) -> TipHandlingConfigurations:
def pick_up_configurations(self) -> PickUpTipConfigurations:
return self._pick_up_configurations

@pick_up_configurations.setter
def pick_up_configurations(
self, pick_up_configs: TipHandlingConfigurations
) -> None:
def pick_up_configurations(self, pick_up_configs: PickUpTipConfigurations) -> None:
self._pick_up_configurations = pick_up_configs

@property
def plunger_homing_configurations(self) -> PlungerHomingConfigurations:
return self._plunger_homing_configurations

@property
def drop_configurations(self) -> TipHandlingConfigurations:
def drop_configurations(self) -> DropTipConfigurations:
return self._drop_configurations

@property
Expand Down Expand Up @@ -258,10 +256,7 @@ def reset_state(self) -> None:

self._tip_overlap_lookup = self.liquid_class.tip_overlap_dictionary
self._nozzle_manager = (
nozzle_manager.NozzleConfigurationManager.build_from_nozzlemap(
self._config.nozzle_map,
self._config.partial_tip_configurations.per_tip_pickup_current,
)
nozzle_manager.NozzleConfigurationManager.build_from_config(self._config)
)

def reset_pipette_offset(self, mount: OT3Mount, to_default: bool) -> None:
Expand Down Expand Up @@ -510,14 +505,6 @@ def tip_presence_responses(self) -> int:
# TODO: put this in shared-data
return 2 if self.channels > 8 else 1

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

@property
def end_tip_action_retract_distance_mm(self) -> float:
return self._config.end_tip_action_retract_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 Expand Up @@ -672,6 +659,21 @@ def set_tip_type(self, tip_type: pip_types.PipetteTipType) -> None:
self._tip_overlap_lookup = self.liquid_class.tip_overlap_dictionary
self._working_volume = min(tip_type.value, self.liquid_class.max_volume)

def get_pick_up_configuration_for_tip_count(
self, count: int
) -> Union[CamActionPickUpTipConfiguration, PressFitPickUpTipConfiguration]:
for config in (
self._config.pick_up_tip_configurations.press_fit,
self._config.pick_up_tip_configurations.cam_action,
):
if not config:
continue
if count in config.current_by_tip_count:
return config
raise CommandPreconditionViolated(
message=f"No pick up tip configuration for {count} tips",
)


def _reload_and_check_skip(
new_config: PipetteConfigurations,
Expand Down
Loading
Loading