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): move pipette up out of liquid before requesting data buffer #15852

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
MoveGroupStep,
)
from opentrons_hardware.hardware_control.move_group_runner import MoveGroupRunner
from opentrons_hardware.hardware_control.types import MotorPositionStatus
from opentrons_hardware.hardware_control.types import (
MotorPositionStatus,
MoveCompleteAck,
)

LOG = getLogger(__name__)
PipetteProbeTarget = Literal[NodeId.pipette_left, NodeId.pipette_right]
Expand Down Expand Up @@ -179,10 +182,15 @@ async def run_sync_buffer_to_csv(
tool: InstrumentProbeTarget,
sensor_type: SensorType,
output_file_heading: list[str],
raise_z: Optional[MoveGroupRunner] = None,
) -> Dict[NodeId, MotorPositionStatus]:
"""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)
if raise_z is not None:
# if probing is finished, move the head node back up before requesting the data buffer
if positions[head_node].move_ack == MoveCompleteAck.stopped_by_condition:
await raise_z.run(can_messenger=messenger)
# wait a little to see the dropoff curve
await asyncio.sleep(0.15)
for sensor_id in log_files.keys():
Expand Down Expand Up @@ -472,14 +480,24 @@ async def liquid_probe(
pressure_output_file_heading,
)
elif sync_buffer_output:
raise_z = create_step(
distance={head_node: float64(max_z_distance)},
velocity={head_node: float64(-1 * mount_speed)},
acceleration={},
duration=float64(max_z_distance / mount_speed),
present_nodes=[head_node],
)
raise_z_runner = MoveGroupRunner(move_groups=[[raise_z]])

return await run_sync_buffer_to_csv(
messenger,
mount_speed,
plunger_speed,
threshold_pascals,
head_node,
sensor_runner,
log_files,
messenger=messenger,
mount_speed=mount_speed,
plunger_speed=plunger_speed,
threshold=threshold_pascals,
head_node=head_node,
move_group=sensor_runner,
raise_z=raise_z_runner,
log_files=log_files,
tool=tool,
sensor_type=SensorType.pressure,
output_file_heading=pressure_output_file_heading,
Expand Down
Loading