From 9cb6a402353e2656ad58d1da6e2ba7a84c363dd5 Mon Sep 17 00:00:00 2001 From: Alise Au <20424172+ahiuchingau@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:58:54 -0500 Subject: [PATCH 1/2] fix(api): FLEX fast home collision hangs because of deadlock (#14602) --- api/src/opentrons/hardware_control/ot3api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index 15de962d442..4099728f64a 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -1542,7 +1542,7 @@ async def _home_axis(self, axis: Axis) -> None: self._log.warning( f"Stall on {axis} during fast home, encoder may have missed an overflow" ) - await self.refresh_positions() + await self.refresh_positions(acquire_lock=False) await self._backend.home([axis], self.gantry_load) else: From 0451ae20df444e10c5495b9502af64ba5f38ab3f Mon Sep 17 00:00:00 2001 From: Alise Au <20424172+ahiuchingau@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:24:07 -0500 Subject: [PATCH 2/2] fix(api): raise error if fast home is stalling (#14609) Closes RQA-2312 We previously swallowed collision errors during fast home move and proceeded to slow home because we used to not handle encoder overflow properly and would mistakenly raise. Now that we have fixed those encoder issues, we should actually raise the error when the motor stalls. --- api/src/opentrons/hardware_control/ot3api.py | 22 ++++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index 4099728f64a..cf76723c20c 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -33,9 +33,6 @@ 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 import types as top_types from opentrons.config import robot_configs @@ -1531,19 +1528,12 @@ async def _home_axis(self, axis: Axis) -> None: axis_home_dist = 20.0 if origin[axis] - target_pos[axis] > axis_home_dist: target_pos[axis] += axis_home_dist - try: - await self._backend.move( - origin, - target_pos, - speed=400, - stop_condition=HWStopCondition.none, - ) - except StallOrCollisionDetectedError: - self._log.warning( - f"Stall on {axis} during fast home, encoder may have missed an overflow" - ) - await self.refresh_positions(acquire_lock=False) - + await self._backend.move( + origin, + target_pos, + speed=400, + stop_condition=HWStopCondition.none, + ) await self._backend.home([axis], self.gantry_load) else: # both stepper and encoder positions are invalid, must home