Skip to content

Commit

Permalink
fix(api): engage axis to enable the motor before attempting to move t…
Browse files Browse the repository at this point in the history
…he axis. (#14955)

There seems to be some issue on the firmware where the motor is enabled
but does not seem to get enabled, causing the axis we are attempting to
move to throw a `finished movement with a condition not met` error. The
firmware should be enabling the motor, and if we query the motor enable
status with get_status_request = 0x01 we get the correct response where
the motor is enabled. For whatever reason sending an explicit
enable_motor_request = 0x06 before moving the axis fixes the problem.

---------

Co-authored-by: ahiuchingau <[email protected]>
  • Loading branch information
2 people authored and Carlos-fernandez committed May 20, 2024
1 parent a084384 commit c571313
Showing 1 changed file with 13 additions and 0 deletions.
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 @@ -1540,6 +1540,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 @@ -1658,13 +1664,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

0 comments on commit c571313

Please sign in to comment.