Skip to content

Commit

Permalink
hook up the acceleartion setting through the stack, default it to 0 e…
Browse files Browse the repository at this point in the history
…verywhere
  • Loading branch information
ryanthecoder committed Nov 1, 2024
1 parent 1ffba34 commit 901d4cf
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 0 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 @@ -31,6 +31,7 @@
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)

DEFAULT_CALIBRATION_SETTINGS: Final[OT3CalibrationSettings] = OT3CalibrationSettings(
Expand Down Expand Up @@ -322,6 +323,9 @@ def _build_default_liquid_probe(
"samples_for_baselining", default.samples_for_baselining
),
sample_time_sec=from_conf.get("sample_time_sec", default.sample_time_sec),
mount_acceleration=from_conf.get(
"mount_acceleration", default.mount_acceleration
),
)


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 @@ -127,6 +127,7 @@ class LiquidProbeSettings:
plunger_reset_offset: float
samples_for_baselining: int
sample_time_sec: float
mount_acceleration: float


@dataclass(frozen=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async def liquid_probe(
response_queue: Optional[
asyncio.Queue[Dict[SensorId, List[SensorDataType]]]
] = None,
mount_acceleration: float = 0.0,
) -> float:
...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ async def liquid_probe(
response_queue: Optional[
asyncio.Queue[Dict[SensorId, List[SensorDataType]]]
] = None,
mount_acceleration: float = 0.0,
) -> float:
head_node = axis_to_node(Axis.by_mount(mount))
tool = sensor_node_for_pipette(OT3Mount(mount.value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ async def liquid_probe(
response_queue: Optional[
asyncio.Queue[Dict[SensorId, List[SensorDataType]]]
] = None,
mount_acceleration: float = 0.0,
) -> float:
z_axis = Axis.by_mount(mount)
pos = self._position
Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2656,6 +2656,7 @@ async def _liquid_probe_pass(
probe=probe,
force_both_sensors=force_both_sensors,
response_queue=response_queue,
mount_acceleration=probe_settings.mount_acceleration,
)
machine_pos = await self._backend.update_position()
machine_pos[Axis.by_mount(mount)] = end_z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)


Expand Down
4 changes: 4 additions & 0 deletions api/tests/opentrons/hardware_control/test_ot3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def fake_liquid_settings() -> LiquidProbeSettings:
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)


Expand Down Expand Up @@ -829,6 +830,7 @@ async def test_liquid_probe(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)
fake_max_z_dist = 10.0
non_responsive_z_mm = ot3_hardware.liquid_probe_non_responsive_z_distance(
Expand Down Expand Up @@ -1097,6 +1099,7 @@ async def test_multi_liquid_probe(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)
fake_max_z_dist = 10.0
await ot3_hardware.liquid_probe(
Expand Down Expand Up @@ -1173,6 +1176,7 @@ async def _fake_pos_update_and_raise(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0.0,
)
# with a mount speed of 5, pass overlap of 0.5 and a 0.2s delay on z
# the actual distance traveled is 3.5mm per pass
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 @@ -174,6 +174,7 @@ def _get_liquid_probe_settings(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)


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 @@ -450,6 +450,7 @@ def _run_trial(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)

hw_mount = OT3Mount.LEFT if run_args.pipette.mount == "left" else OT3Mount.RIGHT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,7 @@ async def _test_liquid_probe(
plunger_reset_offset=2.0,
samples_for_baselining=20,
sample_time_sec=0.004,
mount_acceleration=0,
)
end_z = await api.liquid_probe(
mount, max_z_distance_machine_coords, probe_settings, probe=probe
Expand Down

0 comments on commit 901d4cf

Please sign in to comment.