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 liquid getting homed into pipette after certain protocols end #17285

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def _home_everything_except_plungers(self) -> None:
axes=[MotorAxis.X, MotorAxis.Y, MotorAxis.LEFT_Z, MotorAxis.RIGHT_Z]
)

async def _drop_tip(self) -> None:
async def _try_to_drop_tips(self) -> None:
"""Drop currently attached tip, if any, into trash after a run cancel."""
attached_tips = self._state_store.pipettes.get_all_attached_tips()

Expand Down Expand Up @@ -134,9 +134,9 @@ async def do_stop_and_recover(
PostRunHardwareState.HOME_THEN_DISENGAGE,
)
if drop_tips_after_run:
await self._drop_tip()
await self._hardware_api.stop(home_after=home_after_stop)
else:
await self._hardware_api.stop(home_after=False)
if home_after_stop:
await self._home_everything_except_plungers()
await self._try_to_drop_tips()

await self._hardware_api.stop(home_after=False)

if home_after_stop:
await self._home_everything_except_plungers()
Comment on lines 136 to +142
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old code:

        if drop_tips_after_run:
            await self._drop_tip()
            await self._hardware_api.stop(home_after=home_after_stop)

If home_after_stop was True, the self._hardware_api.stop(...) call would home everything, including the plungers.

I think this used to be safe when this code was originally written. The line immediately preceding it, self._drop_tip(), would have ensured that there were no tips attached, and therefore no liquid for the home to accidentally aspirate.

But that assumption stopped holding for Flex protocols with PAPIv≥2.16; since then, self._drop_tip() has been a no-op (see the comments in _try_to_drop_tips().) So this self._hardware_api.stop(...) was accidentally homing with tips possibly still attached and liquid possibly still in them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my fix here, nothing in this file should ever home the plungers anymore.

We could try to be a little fancier than that. We could home the plungers specifically in the cases where the robot did drop tips. I haven't done that here because it doesn't seem worth the complexity. The plungers will home when the next run begins, anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, i agree with this fix. let's just not home the damn things, it's too hard to pick the right behavior

Loading