PyLabRobot / pylabrobot

interactive & hardware agnostic SDK for lab automation
https://docs.pylabrobot.org
MIT License
178 stars 63 forks source link

Error should be raised before transfer attempted if tip length and plate height are incompatible with head type #316

Open maraxen opened 5 days ago

maraxen commented 5 days ago

Describe the bug

From what I can see, PyLabRobot does not currently validate tip length and head dimensions against plate height, which can lead to the robot attempting to access positions that are physically impossible. This can occur in two main scenarios:

Expected behavior

PyLabRobot should implement comprehensive checks before any transfer is attempted to ensure compatibility between the chosen head, tip length, and target plate:

If any incompatibility is detected, PyLabRobot should raise an error with a descriptive message, specifying the cause of the conflict and potential solutions (e.g., use longer tips, adjust aspiration height, use a smaller volume well).

To Reproduce

Scenario 1 (96 Head):

  1. Use a 96 head with tips that are too short for the target plate.
  2. Attempt a transfer.
  3. Observe a crash or failed transfer.

Scenario 2 (Single Channel):

  1. Use a single channel pipette with a wide tip.
  2. Attempt a transfer from a narrow well where the tip needs to descend significantly to reach the liquid.
  3. Observe a crash or failed transfer.

Possible Solution

Implement a pre-pipetting validation function that:

Additional context

This comprehensive validation is crucial for preventing damage to expensive lab equipment, ensuring the reliability of automated liquid handling protocols, and minimizing experimental errors caused by failed transfers.

rickwierenga commented 5 days ago

It is really a function of the minimum height the tip will reach, which will also include liquid height. With LLD it's hard to predict, but in that case we can assume a worst case scenario. I can think about edge cases where the tips diameter increases along its length, but since we don't know the exact geometry, that part may not be something we can implement right now.

Want to work on a pr for this?