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): engage axis to enable the motor before attempting to move the axis. #14955

Merged
merged 3 commits into from
Apr 19, 2024
Merged
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
13 changes: 13 additions & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,12 @@ async def _home_axis(self, axis: Axis) -> None:
await self._set_plunger_current_and_home(axis, motor_ok, encoder_ok)
return

# TODO: (ba, 2024-04-19): We need to explictly engage the axis and enable
# the motor when we are attempting to move. This should be already
# happening but something on the firmware is either not enabling the motor or
# disabling the motor.
await self.engage_axes([axis])

# we can move to safe home distance!
if encoder_ok and motor_ok:
origin, target_pos = await self._retrieve_home_position(axis)
Expand Down Expand Up @@ -1657,13 +1663,20 @@ async def retract_axis(self, axis: Axis) -> None:

async with self._motion_lock:
if motor_ok and encoder_ok:
# TODO: (ba, 2024-04-19): We need to explictly engage the axis and enable
# the motor when we are attempting to move. This should be already
# happening but something on the firmware is either not enabling the motor or
# disabling the motor.
await self.engage_axes([axis])

# we can move to the home position without checking the limit switch
origin = await self._backend.update_position()
target_pos = {axis: self._backend.home_position()[axis]}
await self._backend.move(origin, target_pos, 400, HWStopCondition.none)
else:
# home the axis
await self._home_axis(axis)

await self._cache_current_position()
await self._cache_encoder_position()

Expand Down
Loading