From 6d9db72fbae36769550257872616f1486cebd21a Mon Sep 17 00:00:00 2001 From: Ryan Howard Date: Wed, 7 Aug 2024 16:12:44 -0400 Subject: [PATCH] fix(api): Lld math mistake round 2 (#15924) # Overview ## Test Plan and Hands on Testing ## Changelog ## Review requests ## Risk assessment --------- Co-authored-by: caila-marashaj --- api/src/opentrons/hardware_control/ot3api.py | 2 +- api/tests/opentrons/hardware_control/test_ot3_api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index 5f9c9840834..08dcb488aab 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -2717,7 +2717,7 @@ async def liquid_probe( # probe_start_pos.z + z_distance of pass - pos.z should be < max_z_dist # due to rounding errors this can get caught in an infinite loop when the distance is almost equal # so we check to see if they're within 0.01 which is 1/5th the minimum movement distance from move_utils.py - while (probe_start_pos.z - pos.z) < (max_z_dist + 0.01): + while (probe_start_pos.z - pos.z) < (max_z_dist - 0.01): # safe distance so we don't accidentally aspirate liquid if we're already close to liquid safe_plunger_pos = top_types.Point( pos.x, pos.y, pos.z + probe_safe_reset_mm diff --git a/api/tests/opentrons/hardware_control/test_ot3_api.py b/api/tests/opentrons/hardware_control/test_ot3_api.py index a6ae8e870d1..20a8f090374 100644 --- a/api/tests/opentrons/hardware_control/test_ot3_api.py +++ b/api/tests/opentrons/hardware_control/test_ot3_api.py @@ -958,7 +958,7 @@ async def test_liquid_probe_plunger_moves( mount_travel_distance = mount_speed * mount_travel_time max_z_distance -= mount_travel_distance - move_mount_z_time = (max_z_distance + probe_safe_reset_mm) / mount_speed + move_mount_z_time = (max_z_distance + probe_pass_z_offset_mm) / mount_speed p_travel_required_for_z = move_mount_z_time * config.plunger_speed @@ -1167,7 +1167,7 @@ async def _fake_pos_update_and_raise( OT3Mount.LEFT, fake_max_z_dist, fake_settings_aspirate ) # assert that it went through 4 passes and then prepared to aspirate - assert mock_move_to_plunger_bottom.call_count == 4 + assert mock_move_to_plunger_bottom.call_count == 5 @pytest.mark.parametrize(