Skip to content

Commit

Permalink
feat(api): add z_overlap_between_passes_mm to LiquidProbeSettings (#1…
Browse files Browse the repository at this point in the history
…6055)

<!--
Thanks for taking the time to open a Pull Request (PR)! Please make sure
you've read the "Opening Pull Requests" section of our Contributing
Guide:


https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests

GitHub provides robust markdown to format your PR. Links, diagrams,
pictures, and videos along with text formatting make it possible to
create a rich and informative PR. For more information on GitHub
markdown, see:


https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

To ensure your code is reviewed quickly and thoroughly, please fill out
the sections below to the best of your ability!
-->

# Overview

<!--
Describe your PR at a high level. State acceptance criteria and how this
PR fits into other work. Link issues, PRs, and other relevant resources.
-->

This PR adds the z_overlap_between_passes_mm field to
LiquidProbeSettings, with the default and universal value of 0.1mm.

## Test Plan and Hands on Testing

<!--
Describe your testing of the PR. Emphasize testing not reflected in the
code. Attach protocols, logs, screenshots and any other assets that
support your testing.
-->

## Changelog

<!--
List changes introduced by this PR considering future developers and the
end user. Give careful thought and clear documentation to breaking
changes.
-->

## Review requests

<!--
- What do you need from reviewers to feel confident this PR is ready to
merge?
- Ask questions.
-->

## Risk assessment

<!--
- Indicate the level of attention this PR needs.
- Provide context to guide reviewers.
- Discuss trade-offs, coupling, and side effects.
- Look for the possibility, even if you think it's small, that your
change may affect some other part of the system.
- For instance, changing return tip behavior may also change the
behavior of labware calibration.
- How do your unit tests and on hands on testing mitigate this PR's
risks and the risk of future regressions?
- Especially in high risk PRs, explain how you know your testing is
enough.
-->
  • Loading branch information
pmoegenburg authored Aug 20, 2024
1 parent c40859f commit 54f54d4
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions api/src/opentrons/config/defaults_ot3.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
sensor_threshold_pascals=15,
output_option=OutputOptions.sync_buffer_to_csv,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "/data/pressure_sensor_data.csv"},
)

Expand Down Expand Up @@ -343,6 +344,9 @@ def _build_default_liquid_probe(
aspirate_while_sensing=from_conf.get(
"aspirate_while_sensing", default.aspirate_while_sensing
),
z_overlap_between_passes_mm=from_conf.get(
"z_overlap_between_passes_mm", default.z_overlap_between_passes_mm
),
data_files=data_files,
)

Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/config/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class LiquidProbeSettings:
sensor_threshold_pascals: float
output_option: OutputOptions
aspirate_while_sensing: bool
z_overlap_between_passes_mm: float
data_files: Optional[Dict[InstrumentProbeType, str]]


Expand Down
6 changes: 3 additions & 3 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2707,12 +2707,12 @@ async def liquid_probe(
instrument.backlash_distance + sensor_baseline_plunger_move_mm
)
# height where probe action will begin
# TODO: (sigler) add this to pipette's liquid def (per tip)
z_overlap_between_passes_mm = 0.1
sensor_baseline_z_move_mm = OT3API.liquid_probe_non_responsive_z_distance(
probe_settings.mount_speed
)
z_offset_per_pass = sensor_baseline_z_move_mm + z_overlap_between_passes_mm
z_offset_per_pass = (
sensor_baseline_z_move_mm + probe_settings.z_overlap_between_passes_mm
)

# height that is considered safe to reset the plunger without disturbing liquid
# this usually needs to at least 1-2mm from liquid, to avoid splashes from air
Expand Down
1 change: 1 addition & 0 deletions api/tests/opentrons/config/ot3_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"sensor_threshold_pascals": 17,
"output_option": OutputOptions.stream_to_csv,
"aspirate_while_sensing": False,
"z_overlap_between_passes_mm": 0.1,
"data_files": {"PRIMARY": "/data/pressure_sensor_data.csv"},
},
"calibration": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
)

Expand Down
8 changes: 6 additions & 2 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
)

Expand Down Expand Up @@ -825,6 +826,7 @@ async def test_liquid_probe(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
)
fake_max_z_dist = 10.0
Expand Down Expand Up @@ -905,7 +907,7 @@ async def test_liquid_probe_plunger_moves(
mount_speed
)

probe_pass_overlap = 0.1
probe_pass_overlap = config.z_overlap_between_passes_mm
probe_pass_z_offset_mm = non_responsive_z_mm + probe_pass_overlap
probe_safe_reset_mm = max(2.0, probe_pass_z_offset_mm)

Expand Down Expand Up @@ -999,7 +1001,7 @@ async def test_liquid_probe_mount_moves(
mount_speed
)

probe_pass_overlap = 0.1
probe_pass_overlap = config.z_overlap_between_passes_mm
probe_pass_z_offset_mm = non_responsive_z_mm + probe_pass_overlap
probe_safe_reset_mm = max(2.0, probe_pass_z_offset_mm)

Expand Down Expand Up @@ -1068,6 +1070,7 @@ async def test_multi_liquid_probe(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
)
fake_max_z_dist = 10.0
Expand Down Expand Up @@ -1140,6 +1143,7 @@ async def _fake_pos_update_and_raise(
sensor_threshold_pascals=15,
output_option=OutputOptions.can_bus_only,
aspirate_while_sensing=True,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "fake_file_name"},
)
# with a mount speed of 5, pass overlap of 0.5 and a 0.2s delay on z
Expand Down
1 change: 1 addition & 0 deletions hardware-testing/hardware_testing/gravimetric/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def _get_liquid_probe_settings(
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
output_option=OutputOptions.sync_only,
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
data_files={InstrumentProbeType.PRIMARY: "/data/testing_data/pressure.csv"},
)

Expand Down
1 change: 1 addition & 0 deletions hardware-testing/hardware_testing/liquid_sense/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def _run_trial(
sensor_threshold_pascals=lqid_cfg["sensor_threshold_pascals"],
output_option=OutputOptions.sync_buffer_to_csv,
aspirate_while_sensing=run_args.aspirate,
z_overlap_between_passes_mm=0.1,
data_files=data_files,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,7 @@ async def _test_liquid_probe(
sensor_threshold_pascals=probe_cfg.sensor_threshold_pascals,
output_option=OutputOptions.can_bus_only, # FIXME: remove
aspirate_while_sensing=False,
z_overlap_between_passes_mm=0.1,
data_files=None,
)
end_z = await api.liquid_probe(
Expand Down

0 comments on commit 54f54d4

Please sign in to comment.