Skip to content

Commit ce0f2a0

Browse files
authored
feat(protocol-designer): cap flow rate at hardware maximum (#18859)
This PR ensures that the interpolated liquid class flow rate for aspirate, dispense, and blowout does not exceed the range prescribed by the pipette liquid definition's plunger curves. To achieve this, we reuse the max flow rate logic in `getMaxUiFlowRate` in the liquid class form change handler utils, to make sure the populated flow rates from the liquid class are physically possible. The code is a bit redundant in the various form change utils, but I am erring on the side of caution vs. DRY given the upcoming release. I can refactor the utilities in a followup post-release. Closes RQA-4151
1 parent e4ab7b3 commit ce0f2a0

File tree

2 files changed

+333
-64
lines changed
  • protocol-designer/src
    • pages/Designer/ProtocolSteps/StepForm/PipetteFields
    • steplist/formLevel/handleFormChange

2 files changed

+333
-64
lines changed

protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/PipetteFields/utils.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,30 +207,31 @@ const _getPipetteAccuracyUlPerMm = (args: {
207207
return lastEntry[1] * targetVolume + lastEntry[2]
208208
}
209209

210-
export const getMaxUiFlowRate = (args: {
211-
targetVolume: number
210+
interface BaseGetMaxUiFlowRateArgs {
212211
channels: PipetteChannels
213212
robotType: RobotType
214-
tipLiquidSpecs: SupportedTip
215-
flowRateType: FlowRateType
216-
correctionVolume: number
217213
shaftULperMM: number
218-
}): number => {
219-
const {
220-
targetVolume,
221-
channels,
222-
robotType,
223-
tipLiquidSpecs,
224-
flowRateType,
225-
correctionVolume,
226-
shaftULperMM,
227-
} = args
214+
}
215+
interface BlowoutMaxUiFlowRateArgs extends BaseGetMaxUiFlowRateArgs {
216+
flowRateType: 'blowout'
217+
}
218+
interface AspirateDispenseMaxUiFlowRateArgs extends BaseGetMaxUiFlowRateArgs {
219+
flowRateType: 'aspirate' | 'dispense'
220+
tipLiquidSpecs: SupportedTip
221+
targetVolume: number
222+
correctionVolume?: number
223+
}
224+
export const getMaxUiFlowRate = (
225+
args: BlowoutMaxUiFlowRateArgs | AspirateDispenseMaxUiFlowRateArgs
226+
): number => {
227+
const { channels, robotType, flowRateType, shaftULperMM } = args
228228

229229
const maxPlungerSpeed =
230230
CHANNELS_MAPPED_TO_MAX_SPEED[robotType][channels].plunger
231231
if (flowRateType === 'blowout') {
232232
return round(shaftULperMM * maxPlungerSpeed)
233233
}
234+
const { targetVolume, tipLiquidSpecs, correctionVolume = 0 } = args
234235
const pipetteAccuracyUlPerMm = _getPipetteAccuracyUlPerMm({
235236
targetVolume,
236237
tipLiquidSpecs,

0 commit comments

Comments
 (0)