Skip to content
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

feat(hardware): get baseline pressure before liquid sensing #12314

Merged

Conversation

caila-marashaj
Copy link
Contributor

@caila-marashaj caila-marashaj commented Mar 17, 2023

Since we now have auto-zeroing for the pressure sensor, this code just makes it so that the liquid probing functionality, by default, will request a baseline read of the pressure sensor before searching for liquid.

After a BaselineSensorRequest is sent the from Python side and a baseline pressure is found, the firmware will automatically compare the difference between a given pressure reading and the new baseline, with the threshold value. This way, the threshold becomes a sort of maximum variance from the baseline value.

This can be turned off in the get_pressure_baseline parameter of LiquidProbeSettings, in which case the pressure will just be compared to the threshold like it was previously.

This closes RLIQ-347

@caila-marashaj caila-marashaj requested a review from a team as a code owner March 17, 2023 18:21
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #12314 (0af9c63) into edge (ce6fedd) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #12314      +/-   ##
==========================================
- Coverage   74.28%   74.24%   -0.05%     
==========================================
  Files        2161     2162       +1     
  Lines       59715    59770      +55     
  Branches     6105     6105              
==========================================
+ Hits        44361    44377      +16     
- Misses      13924    13963      +39     
  Partials     1430     1430              
Flag Coverage Δ
hardware 58.44% <100.00%> (-0.26%) ⬇️
notify-server 89.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/src/opentrons/config/defaults_ot3.py 97.50% <ø> (ø)
api/src/opentrons/config/types.py 100.00% <ø> (ø)
...entrons/hardware_control/backends/ot3controller.py 65.12% <ø> (ø)
...pentrons/hardware_control/backends/ot3simulator.py 88.05% <ø> (ø)
api/src/opentrons/hardware_control/ot3api.py 79.51% <ø> (ø)
...pentrons_hardware/hardware_control/tool_sensors.py 98.57% <100.00%> (+0.06%) ⬆️

... and 3 files with indirect coverage changes

Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

In general looks good, but we should:

  1. make the name in the configuration more clear
  2. get clarify from hardware to see if they'll ever want to modify the number of reads for the average
  3. log the auto-zero result (at least using log.debug)

Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

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

Looks much better, we should make sure to test this on a robot though.

@caila-marashaj caila-marashaj force-pushed the RLIQ-347-zero-pressure-sensor-before-liquid-probe branch from 0ad59ac to 0af9c63 Compare March 21, 2023 15:29
@caila-marashaj caila-marashaj merged commit 7f10607 into edge Mar 21, 2023
@caila-marashaj caila-marashaj deleted the RLIQ-347-zero-pressure-sensor-before-liquid-probe branch March 21, 2023 19:55
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