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(app): Fix tip drop height during Error Recovery #16656

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
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 @@ -13,7 +13,11 @@ import type {
import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data'
import type { CommandData, PipetteData } from '@opentrons/api-client'
import type { Axis, Sign, StepSize } from '/app/molecules/JogControls/types'
import type { DropTipFlowsRoute, FixitCommandTypeUtils } from '../types'
import type {
DropTipFlowsRoute,
FixitCommandTypeUtils,
IssuedCommandsType,
} from '../types'
import type { SetRobotErrorDetailsParams, UseDTWithTypeParams } from '.'
import type { RunCommandByCommandTypeParams } from './useDropTipCreateCommands'

Expand All @@ -37,7 +41,7 @@ export interface UseDropTipCommandsResult {
handleCleanUpAndClose: (homeOnExit?: boolean) => Promise<void>
moveToAddressableArea: (
addressableArea: AddressableAreaName,
stayAtHighestPossibleZ?: boolean
isPredefinedLocation: boolean // Is a predefined location in "choose location."
) => Promise<void>
handleJog: (axis: Axis, dir: Sign, step: StepSize) => void
blowoutOrDropTip: (
Expand Down Expand Up @@ -102,7 +106,7 @@ export function useDropTipCommands({

const moveToAddressableArea = (
addressableArea: AddressableAreaName,
stayAtHighestPossibleZ = true // Generally false when moving to a waste chute or trash bin or during "fixit" flows.
isPredefinedLocation: boolean
): Promise<void> => {
return new Promise((resolve, reject) => {
const addressableAreaFromConfig = getAddressableAreaFromConfig(
Expand All @@ -116,7 +120,8 @@ export function useDropTipCommands({
const moveToAACommand = buildMoveToAACommand(
addressableAreaFromConfig,
pipetteId,
stayAtHighestPossibleZ
isPredefinedLocation,
issuedCommandsType
)
return chainRunCommands(
isFlex
Expand Down Expand Up @@ -386,11 +391,16 @@ const buildBlowoutCommands = (
const buildMoveToAACommand = (
addressableAreaFromConfig: AddressableAreaName,
pipetteId: string | null,
stayAtHighestPossibleZ: boolean
isPredefinedLocation: boolean,
commandType: IssuedCommandsType
): CreateCommand => {
// Always ensure the user does all the jogging if choosing a custom location on the deck.
const stayAtHighestPossibleZ = !isPredefinedLocation
Copy link
Contributor Author

@mjhuff mjhuff Oct 31, 2024

Choose a reason for hiding this comment

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

Note that we still must specify this param during Error Recovery, because if the client issues a moveToAddressableArea after selecting the "manually move to a location" option, the pipette will move in the z-axis, which we want to avoid.


// Because we can never be certain about which tip is attached outside a protocol run, always assume the most
// conservative estimate, a 1000ul tip.
const zOffset = stayAtHighestPossibleZ ? 0 : 88
const zOffset = commandType === 'setup' && !stayAtHighestPossibleZ ? 88 : 0

return {
commandType: 'moveToAddressableArea',
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function ChooseDeckLocation({
)?.id

if (deckSlot != null) {
void moveToAddressableArea(deckSlot).then(() => {
void moveToAddressableArea(deckSlot, false).then(() => {
proceedWithConditionalClose()
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function ChooseLocation({
toggleIsRobotPipetteMoving()
void moveToAddressableArea(
selectedLocation?.slotName as AddressableAreaName,
issuedCommandsType === 'fixit' // Because PE has tip state during fixit flows, do not specify a manual offset.
true
).then(() => {
void blowoutOrDropTip(currentRoute, () => {
const successStep =
Expand Down
Loading