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

fix(api): Speed up LLD by reducing the post-success raise. #17102

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down Expand Up @@ -1535,6 +1536,7 @@ def response_capture(data: Dict[SensorId, List[SensorDataType]]) -> None:
threshold_pascals=threshold_pascals,
plunger_impulse_time=plunger_impulse_time,
num_baseline_reads=num_baseline_reads,
z_offset_for_plunger_prep=z_offset_for_plunger_prep,
sensor_id=sensor_id_for_instrument(probe),
force_both_sensors=force_both_sensors,
emplace_data=response_capture,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
Expand Down
3 changes: 3 additions & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2677,6 +2677,7 @@ async def _liquid_probe_pass(
probe_settings: LiquidProbeSettings,
probe: InstrumentProbeType,
p_travel: float,
z_offset_for_plunger_prep: float,
force_both_sensors: bool = False,
response_queue: Optional[PipetteSensorResponseQueue] = None,
) -> float:
Expand All @@ -2689,6 +2690,7 @@ async def _liquid_probe_pass(
probe_settings.sensor_threshold_pascals,
probe_settings.plunger_impulse_time,
probe_settings.samples_for_baselining,
z_offset_for_plunger_prep,
probe=probe,
force_both_sensors=force_both_sensors,
response_queue=response_queue,
Expand Down Expand Up @@ -2838,6 +2840,7 @@ async def prep_plunger_for_probe_move(
probe_settings,
checked_probe,
plunger_travel_mm + sensor_baseline_plunger_move_mm,
z_offset_for_plunger_prep,
force_both_sensors,
response_queue,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ async def test_liquid_probe(
threshold_pascals=fake_liquid_settings.sensor_threshold_pascals,
plunger_impulse_time=fake_liquid_settings.plunger_impulse_time,
num_baseline_reads=fake_liquid_settings.samples_for_baselining,
z_offset_for_plunger_prep=2.0,
)
except PipetteLiquidNotFoundError:
# the move raises a liquid not found now since we don't call the move group and it doesn't
Expand Down
3 changes: 3 additions & 0 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ async def test_liquid_probe(
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.samples_for_baselining,
probe_safe_reset_mm,
probe=InstrumentProbeType.PRIMARY,
force_both_sensors=False,
response_queue=None,
Expand Down Expand Up @@ -1114,6 +1115,7 @@ async def test_multi_liquid_probe(
fake_settings_aspirate.sensor_threshold_pascals,
fake_settings_aspirate.plunger_impulse_time,
fake_settings_aspirate.samples_for_baselining,
2.0,
probe=InstrumentProbeType.PRIMARY,
force_both_sensors=False,
response_queue=None,
Expand Down Expand Up @@ -1149,6 +1151,7 @@ async def _fake_pos_update_and_raise(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
probe: InstrumentProbeType = InstrumentProbeType.PRIMARY,
force_both_sensors: bool = False,
response_queue: Optional[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ async def liquid_probe(
threshold_pascals: float,
plunger_impulse_time: float,
num_baseline_reads: int,
z_offset_for_plunger_prep: float,
sensor_id: SensorId = SensorId.S0,
force_both_sensors: bool = False,
emplace_data: Optional[
Expand Down Expand Up @@ -331,8 +332,9 @@ async def liquid_probe(
)
sensor_runner = MoveGroupRunner(move_groups=[[lower_plunger], [sensor_group]])

# Only raise the z a little so we don't do a huge slow travel
raise_z = create_step(
distance={head_node: float64(max_z_distance)},
distance={head_node: float64(z_offset_for_plunger_prep)},
velocity={head_node: float64(-1 * mount_speed)},
acceleration={},
duration=float64(max_z_distance / mount_speed),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def move_responder(
threshold_pascals=threshold_pascals,
plunger_impulse_time=0.2,
num_baseline_reads=20,
z_offset_for_plunger_prep=2.0,
sensor_id=SensorId.S0,
)
assert position[motor_node].positions_only()[0] == 14
Expand Down
Loading