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): Implement moving baseline readings for sensor-move #15494

Merged
merged 9 commits into from
Jun 26, 2024

Conversation

ryanthecoder
Copy link
Contributor

Overview

We are changing the pressure sensor timing during moves so that we can baseline the pressure value as the plunger is in motion, this lets us account for variations in tips more accurately. We also added a delay in turning off the pressure sensor readings after movement has finished so that we can attempt to tell better if we have hit liquid or labware bottom

Test Plan

Changelog

Review requests

Risk assessment

@ryanthecoder ryanthecoder requested a review from a team as a code owner June 21, 2024 20:40
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Some nits about waiting and about where some timing should live.

@@ -173,6 +173,20 @@ async def run_sync_buffer_to_csv(
"""Runs the sensor pass move group and creates a csv file with the results."""
sensor_metadata = [0, 0, mount_speed, plunger_speed, threshold]
positions = await move_group.run(can_messenger=messenger)
# wait a little to see the dropoff curve
await asyncio.sleep(0.15)
Copy link
Member

Choose a reason for hiding this comment

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

let's make this a passed-in configuration value please. also if this timing is critical we really should not be ensuring it in python in linux userspace with an asyncio sleep, those times are not guaranteed at all. could have a request_data_after_delay can message or something

self.event.clear()
self.expected_ack = message_index
start = time.time()
while True:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
while True:
try:
await asyncio.wait_for(event.wait(), wait_time)
except asyncio.TimeoutError:
pass
self.event.clear()

?

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 47.61905% with 11 lines in your changes missing coverage. Please review.

Project coverage is 55.65%. Comparing base (5ce130b) to head (a1e666f).
Report is 74 commits behind head on edge.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #15494      +/-   ##
==========================================
- Coverage   60.43%   55.65%   -4.78%     
==========================================
  Files         154      113      -41     
  Lines       12119     9334    -2785     
==========================================
- Hits         7324     5195    -2129     
+ Misses       4795     4139     -656     
Flag Coverage Δ
hardware 55.65% <47.61%> (+0.03%) ⬆️
shared-data ?

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

Files Coverage Δ
.../opentrons_hardware/firmware_bindings/constants.py 99.29% <100.00%> (+<0.01%) ⬆️
...pentrons_hardware/hardware_control/tool_sensors.py 84.61% <44.44%> (-1.19%) ⬇️
...rdware/opentrons_hardware/sensors/sensor_driver.py 83.17% <45.45%> (+0.48%) ⬆️

... and 43 files with indirect coverage changes

@ryanthecoder ryanthecoder merged commit da42c01 into edge Jun 26, 2024
16 of 17 checks passed
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.

None yet

2 participants