Skip to content

Commit

Permalink
can't import hardware from ot3api, breaks importablility
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Jul 22, 2024
1 parent 6b2f1c8 commit b71e286
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
20 changes: 16 additions & 4 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
)


from opentrons_hardware.hardware_control.tool_sensors import (
liquid_probe_non_responsive_z_distance,
)
from opentrons_shared_data.pipette.dev_types import (
PipetteName,
)
Expand Down Expand Up @@ -2602,6 +2599,21 @@ def add_gripper_probe(self, probe: GripperProbe) -> None:
def remove_gripper_probe(self) -> None:
self._gripper_handler.remove_probe()

@staticmethod
def liquid_probe_non_responsive_z_distance(z_speed: float) -> float:
"""Calculate the Z distance travelled where the LLD pass will be unresponsive."""
# NOTE: (sigler) Here lye some magic numbers.
# The Z axis probing motion uses the first 20 samples to calculate
# a baseline for all following samples, making the very beginning of
# that Z motion unable to detect liquid. The sensor is configured for
# 4ms sample readings, and so we then assume it takes ~80ms to complete.
# If the Z is moving at 5mm/sec, then ~80ms equates to ~0.4
baseline_during_z_sample_num = 20 # FIXME: (sigler) shouldn't be defined here?
sample_time_sec = 0.004 # FIXME: (sigler) shouldn't be defined here?
baseline_duration_sec = baseline_during_z_sample_num * sample_time_sec
non_responsive_z_mm = baseline_duration_sec * z_speed
return non_responsive_z_mm

async def _liquid_probe_pass(
self,
mount: OT3Mount,
Expand Down Expand Up @@ -2684,7 +2696,7 @@ async def liquid_probe(
# height where probe action will begin
# TODO: (sigler) add this to pipette's liquid def (per tip)
probe_pass_overlap_mm = 0.1
non_responsive_z_mm = liquid_probe_non_responsive_z_distance(
non_responsive_z_mm = OT3API.liquid_probe_non_responsive_z_distance(
probe_settings.mount_speed
)
probe_pass_z_offset_mm = non_responsive_z_mm + probe_pass_overlap_mm
Expand Down
15 changes: 0 additions & 15 deletions hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,21 +383,6 @@ async def _run_with_binding(
return result


def liquid_probe_non_responsive_z_distance(z_speed: float) -> float:
"""Calculate the Z distance travelled where the LLD pass will be unresponsive."""
# NOTE: (sigler) Here lye some magic numbers.
# The Z axis probing motion uses the first 20 samples to calculate
# a baseline for all following samples, making the very beginning of
# that Z motion unable to detect liquid. The sensor is configured for
# 4ms sample readings, and so we then assume it takes ~80ms to complete.
# If the Z is moving at 5mm/sec, then ~80ms equates to ~0.4
baseline_during_z_sample_num = 20 # FIXME: (sigler) shouldn't be defined here?
sample_time_sec = 0.004 # FIXME: (sigler) shouldn't be defined here?
baseline_duration_sec = baseline_during_z_sample_num * sample_time_sec
non_responsive_z_mm = baseline_duration_sec * z_speed
return non_responsive_z_mm


async def liquid_probe(
messenger: CanMessenger,
tool: PipetteProbeTarget,
Expand Down

0 comments on commit b71e286

Please sign in to comment.