-
Notifications
You must be signed in to change notification settings - Fork 135
Make STARBackend.probe_liquid_heights() Smart
#876
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
base: main
Are you sure you want to change the base?
Conversation
…on methods important for usage in... 1.- LLD (based on these inner detection methods rather than the default aspirate) 2.- auto-liquid level following
useful for pooling (?)
i.e. channels not used in between those that are used in spread behaviour across large
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the probe_liquid_heights() method to automatically handle complex channel and container configurations that previously required manual batching or raised errors. The changes enable the method to intelligently group containers by X position, partition channels into compatible Y sub-batches, compute channel-aware offsets for non-consecutive channel configurations, and provide fine-grained Z-axis control during probing operations.
Changes:
- Added automatic X-position grouping and Y sub-batching to handle any channel/container configuration
- Implemented channel-index-aware offset calculation for non-consecutive channels (e.g., [0,1,2,5,6,7])
- Added three new traverse height parameters and a flag to control Z positioning at different stages
- Added duplicate channel validation with an override flag for legitimate multi-probe scenarios
- Exposed all cLLD and pLLD detection parameters as method arguments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
using the trackers :)
important: thorough in-line documentation to counter complexity
|
This is step 3 from #822 (comment) |
The Problem
probe_liquid_heightshad several limitations that prevented it from handling real-world channel/container configurations:NotImplementedError, even though the method could handle them sequentially.channels like
[0,1,2,5,6,7]were spaced as if they were[0,1,2,3,4,5], ignoring the physical gap required by phantom intermediate channels (3 and 4). If the container was too small to fit allchannels, this raised an unhandled
ValueErrorinstead of falling back gracefully.members) would raise errors mid-command instead of being automatically partitioned into compatible batches.
This PR
Makes
probe_liquid_heights"smart" 🤓, i.e. automatically handle any channel/container configuration:channel index difference. Phantom channels between non-consecutive batch members are explicitly positioned at minimum spacing to prevent firmware errors. Each sub-batch is probed in parallel.
get_wide_single_resource_liquid_op_offsets, then only the actual channel offsets are kept. Channels like[0,1,2,5,6,7]now correctly fit in one batch. If the container is too small, offsets fallback to center and Y sub-batching automatically serializes the channels that can't coexist.
move_to_z_safety_afterflag allows skipping the final Z raiseentirely. On any error, all channels return to full Z safety regardless of these settings.
min_traverse_height_at_beginning_of_commandNone→ full Z safetymin_traverse_height_during_commandNone→ full Z safetyz_position_at_end_of_commandNone→ full Z safetymove_to_z_safety_afterTrueFalseallow_duplicate_channels— defaults toFalsewith a clear error message;aspirate/dispensepassTruesince they may legitimately probe the same container multiple times.No breaking changes — single-X, consecutive-channel usage produces identical behavior.
Pseudocode: full method flow