Skip to content

Commit

Permalink
fix(hardware): gripper calibration fix (#15630)
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj authored Jul 11, 2024
1 parent a03199b commit ec3912a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,6 @@ async def capacitive_probe(
tool=sensor_node_for_mount(mount),
mover=axis_to_node(moving),
distance=distance_mm,
plunger_speed=speed_mm_per_s,
mount_speed=speed_mm_per_s,
csv_output=csv_output,
sync_buffer_output=sync_buffer_output,
Expand Down
23 changes: 16 additions & 7 deletions hardware/opentrons_hardware/hardware_control/tool_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ async def capacitive_probe(
tool: InstrumentProbeTarget,
mover: NodeId,
distance: float,
plunger_speed: float,
mount_speed: float,
sensor_id: SensorId = SensorId.S0,
relative_threshold_pf: float = 1.0,
Expand All @@ -538,6 +537,8 @@ async def capacitive_probe(
"""
log_files: Dict[SensorId, str] = {} if not data_files else data_files
sensor_driver = SensorDriver()
pipette_present = tool in [NodeId.pipette_left, NodeId.pipette_right]

capacitive_sensors = await _setup_capacitive_sensors(
messenger,
sensor_id,
Expand All @@ -546,20 +547,28 @@ async def capacitive_probe(
sensor_driver,
)

probe_distance = {mover: distance}
probe_speed = {mover: mount_speed}
movers = [mover]
if pipette_present:
probe_distance[tool] = 0.0
probe_speed[tool] = 0.0
movers.append(tool)

sensor_group = _build_pass_step(
movers=[mover, tool],
distance={mover: distance, tool: 0.0},
speed={mover: mount_speed, tool: 0.0},
movers=movers,
distance=probe_distance,
speed=probe_speed,
sensor_type=SensorType.capacitive,
sensor_id=sensor_id,
stop_condition=MoveStopCondition.sync_line,
)
if sync_buffer_output:
sensor_group = _fix_pass_step_for_buffer(
sensor_group,
movers=[mover, tool],
distance={mover: distance, tool: distance},
speed={mover: mount_speed, tool: plunger_speed},
movers=movers,
distance=probe_distance,
speed=probe_speed,
sensor_type=SensorType.capacitive,
sensor_id=sensor_id,
stop_condition=MoveStopCondition.sync_line,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def move_responder(
message_send_loopback.add_responder(move_responder)

status = await capacitive_probe(
mock_messenger, target_node, motor_node, distance, speed, speed
mock_messenger, target_node, motor_node, distance, speed
)
assert status.motor_position == 10 # this comes from the current_position_um above
assert status.encoder_position == 10
Expand Down

0 comments on commit ec3912a

Please sign in to comment.