From e2b7eb8a9e7fed40a0183975a479040b8d133a7a Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:45:42 -0500 Subject: [PATCH 1/3] RQA-2235 if z_L is disengaged before moving to maintenance pos, home z_l --- .../commands/calibration/move_to_maintenance_position.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py b/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py index 464b177e980..ab4daeac568 100644 --- a/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py +++ b/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py @@ -80,6 +80,11 @@ async def execute( ot3_api = ensure_ot3_hardware( self._hardware_api, ) + # the 96-channel mount is disengaged during gripper calibration and + # must be homed before the gantry position can be called + if not ot3_api.backend.check_motor_status([Axis.Z_L]) and \ + ot3_api.backend.check_encoder_status([Axis.Z_L]): + await ot3_api.home([Axis.Z_L]) current_position_mount = await ot3_api.gantry_position( Mount.LEFT, critical_point=CriticalPoint.MOUNT ) From 14b236121cff415aec9aa48c0998391693d137b0 Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:39:53 -0500 Subject: [PATCH 2/3] fix --- api/src/opentrons/hardware_control/ot3api.py | 6 ++++++ .../commands/calibration/move_to_maintenance_position.py | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/api/src/opentrons/hardware_control/ot3api.py b/api/src/opentrons/hardware_control/ot3api.py index a795d12f270..5da50e41c55 100644 --- a/api/src/opentrons/hardware_control/ot3api.py +++ b/api/src/opentrons/hardware_control/ot3api.py @@ -1001,6 +1001,12 @@ def _assert_encoder_ok(self, axes: Sequence[Axis]) -> None: detail={"axes": axes_str}, ) + def motor_status_ok(self, axis: Axis) -> bool: + return self._backend.check_motor_status([axis]) + + def encoder_status_ok(self, axis: Axis) -> bool: + return self._backend.check_encoder_status([axis]) + async def encoder_current_position( self, mount: Union[top_types.Mount, OT3Mount], diff --git a/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py b/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py index ab4daeac568..b610eefe86c 100644 --- a/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py +++ b/api/src/opentrons/protocol_engine/commands/calibration/move_to_maintenance_position.py @@ -82,8 +82,9 @@ async def execute( ) # the 96-channel mount is disengaged during gripper calibration and # must be homed before the gantry position can be called - if not ot3_api.backend.check_motor_status([Axis.Z_L]) and \ - ot3_api.backend.check_encoder_status([Axis.Z_L]): + if ot3_api.encoder_status_ok(Axis.Z_L) and not ot3_api.motor_status_ok( + Axis.Z_L + ): await ot3_api.home([Axis.Z_L]) current_position_mount = await ot3_api.gantry_position( Mount.LEFT, critical_point=CriticalPoint.MOUNT From 1ffcda65f3ed7d33598b0034f29f026b4bec3173 Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:51:10 -0500 Subject: [PATCH 3/3] fix linter --- api/src/opentrons/hardware_control/protocols/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/src/opentrons/hardware_control/protocols/__init__.py b/api/src/opentrons/hardware_control/protocols/__init__.py index 4b85140f9ba..e47b54dba2c 100644 --- a/api/src/opentrons/hardware_control/protocols/__init__.py +++ b/api/src/opentrons/hardware_control/protocols/__init__.py @@ -1,6 +1,8 @@ """Typing protocols describing a hardware controller.""" from typing_extensions import Protocol, Type +from opentrons.hardware_control.types import Axis + from .module_provider import ModuleProvider from .hardware_manager import HardwareManager from .chassis_accessory_manager import ChassisAccessoryManager @@ -82,6 +84,12 @@ class FlexHardwareControlInterface( def get_robot_type(self) -> Type[FlexRobotType]: return FlexRobotType + def motor_status_ok(self, axis: Axis) -> bool: + ... + + def encoder_status_ok(self, axis: Axis) -> bool: + ... + __all__ = [ "HardwareControlAPI",