Skip to content

Commit

Permalink
fix(api): raise error if fast home is stalling (#14609)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahiuchingau authored and y3rsh committed Mar 13, 2024
1 parent b5fa901 commit bd12333
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bd12333

Please sign in to comment.