Skip to content

Commit

Permalink
update before homing
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jul 27, 2023
1 parent b0f5fa6 commit 685d0fb
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,18 +1209,13 @@ async def _retrieve_home_position() -> Tuple[
# G, Q should be handled in the backend through `self._home()`
assert axis not in [Axis.G, Axis.Q]

# ensure stepper position can be updated after boot
await self.engage_axes([axis])
await self._update_position_estimation([axis])
# refresh motor and encoder statuses after position estimation update
motor_ok = self._backend.check_motor_status([axis])
encoder_ok = self._backend.check_encoder_status([axis])

# we can update the motor position if the encoder position is valid
if encoder_ok and not motor_ok:
# ensure stepper position can be updated after boot
await self.engage_axes([axis])
await self._update_position_estimation([axis])
# refresh motor and encoder statuses after position estimation update
motor_ok = self._backend.check_motor_status([axis])
encoder_ok = self._backend.check_encoder_status([axis])

# we can move to safe home distance!
if encoder_ok and motor_ok:
origin, target_pos = await _retrieve_home_position()
Expand Down

0 comments on commit 685d0fb

Please sign in to comment.