Skip to content

Conversation

@BioCam
Copy link
Collaborator

@BioCam BioCam commented Dec 29, 2025

No description provided.

Copy link
Contributor

Copilot AI left a 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 refactors the capacitive liquid-level detection (cLLD) probing logic to make the tip length calculation tip-aware and adds comprehensive safety validation. The primary purpose is to ensure that the Z-drive start position accounts for the actual tip length rather than using a fixed value, preventing potential collisions or invalid search positions.

Key Changes:

  • Made start_pos_search optional with automatic computation based on tip length when not provided
  • Added precondition checks including tip presence validation and channel index bounds checking
  • Enhanced documentation with detailed docstring describing all parameters, behavior, and exceptions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@rickwierenga rickwierenga left a comment

Choose a reason for hiding this comment

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

this PR makes move_z_drive_to_liquid_surface_using_clld depend on C0 (through self.request_tip_presence and self.request_tip_len_on_channel), meaning it can no longer be run in parallel. running this function in parallel was the reason for splitting it out of clld_probe_z_height_using_channel in #742

I don't think it is possible to have these c0 features and run it in parallel, meaning the caller will have to perform checks instead of this function. maybe we should make it private? _move_z_drive_to_liquid_surface_using_clld

it is important that we can run this in parallel for probing multiple liquid height simultaneously.

@BioCam
Copy link
Collaborator Author

BioCam commented Dec 30, 2025

Thank you for catching this @rickwierenga !

I have excised the C0 dependency out of _move_z_drive_to_liquid_surface_using_clld (and renamed it as per your suggestion), and moved the correction for the tip bottom (which was broken for both start_search_pos and lowest_immers_pos) into clld_probe_z_height_using_channel instead.

Comment on lines +9143 to +9144
if start_pos_search is None:
start_pos_search = safe_head_top_z_pos - tip_len + fitting_depth
Copy link
Member

Choose a reason for hiding this comment

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

why is this implicit behaviour good?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you please elaborate what you mean?

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.

2 participants