Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): fix left mount being disengaged when moving to maintenance position #14341

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
8 changes: 8 additions & 0 deletions api/src/opentrons/hardware_control/protocols/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ 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 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
)
Expand Down
Loading