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

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Jan 15, 2025

Overview

Closes RESC-345.

Test Plan and Hands on Testing

Run a PAPIv≥2.16 protocol on a Flex. Cancel it at a point when tips are attached and contain liquid. Without this PR, the pipette should accidentally aspirate when it homes, as shown in this video. With this PR, it should not do that; the liquid should remain in place. Ideally, use food dye to confirm this, because it can be difficult to notice.

Changelog

See comments.

Review requests

See comments.

Risk assessment

Medium.

Comment on lines 136 to +142
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()
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

@SyntaxColoring SyntaxColoring force-pushed the do_not_home_plungers_when_run_ends branch from cfb9072 to 1137f00 Compare January 15, 2025 22:06
@SyntaxColoring SyntaxColoring changed the base branch from edge to chore_release-8.3.0 January 15, 2025 22:06
Comment on lines 136 to +142
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()
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

@SyntaxColoring SyntaxColoring marked this pull request as ready for review January 16, 2025 15:15
@SyntaxColoring SyntaxColoring requested a review from a team as a code owner January 16, 2025 15:15
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

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

Wooooo! This works! I can confirm that running a protocol on 8.2 repros the issue, and running your branch does not cause any liquid aspiration on home.

@SyntaxColoring SyntaxColoring merged commit bb78046 into chore_release-8.3.0 Jan 16, 2025
25 checks passed
@SyntaxColoring SyntaxColoring deleted the do_not_home_plungers_when_run_ends branch January 17, 2025 18:52
sfoster1 added a commit that referenced this pull request Jan 21, 2025
That PR changed the stop behavior on OT-2 to fix some bugs but the tests
didn't get changed. Fix the tests.
sfoster1 added a commit that referenced this pull request Jan 22, 2025
That PR changed the stop behavior on OT-2 to fix some bugs but the tests
didn't get changed. Fix the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants