Skip to content

fix(star): split pipetting operations by channel spacing#1164

Open
HaamsRee wants to merge 1 commit into
PyLabRobot:mainfrom
HaamsRee:fix/star-pipetting-batch-spacing
Open

fix(star): split pipetting operations by channel spacing#1164
HaamsRee wants to merge 1 commit into
PyLabRobot:mainfrom
HaamsRee:fix/star-pipetting-batch-spacing

Conversation

@HaamsRee

@HaamsRee HaamsRee commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Fixes STAR backend pipetting behavior when the configured minimum channel spacing is wider than the target spacing. Addresses #822.

Previously, STARBackend.aspirate() and STARBackend.dispense() sent all requested operations in a single C0AS or C0DS command. For adjacent wells in a 96-well plate, this could request 9 mm channel spacing from a STAR configured for a minimum of 18 mm.

This PR changes aspirate and dispense to:

  1. Plan legal groups of simultaneous operations with the existing channel batch planner.
  2. Send one firmware command for each batch instead of one command with impossible channel positions.
  3. Keep volumes, liquid heights, flow rates, and the other per-operation firmware parameters aligned with their original operations in each batch.

It also removes the explicit 100 mm end position and minimum traverse height from the liquid-height probing path, allowing the normal STAR channel traversal height to be used.

The single-batch behavior is unchanged when all requested channel positions are valid simultaneously.

Motivation

On a STAR with four 1 mL channels spaced at 18 mm, adjacent 96-well targets cannot be reached by those channels simultaneously. Sending them in one command requested a mechanically impossible arrangement instead of splitting the work into legal sequential movements.

During testing with probe_liquid_height=True, the hard-coded 100 mm Z end and traverse height also caused the probing workflow to crash on the physical instrument. Removing those overrides restores the backend's normal safe traversal behavior between batches.

Tests

Added STAR backend tests for:

  • splitting an aspirate across adjacent 96-well targets into three commands at 18 mm minimum spacing,
  • splitting a dispense across the same targets,
  • using the normal traversal height after liquid-height probing instead of requesting 100 mm.

Ran:

uv run pytest pylabrobot/liquid_handling/backends/hamilton/STAR_tests.py pylabrobot/liquid_handling/pipette_batch_scheduling_tests.py -q

Result:

146 passed, 13 warnings, 81 subtests passed

ruff check and ruff format --check also pass for both changed files.

@HaamsRee
HaamsRee marked this pull request as ready for review July 13, 2026 16:52
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.

1 participant