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): add acceleration to pick up tip for 96 channel #12944

Merged
merged 28 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
95d068b
add acceleration to tip_action
caila-marashaj Jun 15, 2023
b4d4bee
pick up tip move happens, but rumbly
caila-marashaj Jun 21, 2023
bdea049
linter stuff cleanup
caila-marashaj Jun 21, 2023
782a760
fixed position of acceleration in tipaction msg
caila-marashaj Jun 22, 2023
73d26bf
moving but delayed
caila-marashaj Jun 27, 2023
c3e044a
modify tip action, debugging code still in there
caila-marashaj Jun 28, 2023
a85074e
mostly working but returning position too early
caila-marashaj Jun 29, 2023
1952348
need to update tests
caila-marashaj Jul 6, 2023
fa194a3
updated unit test args for tip_action
caila-marashaj Jul 17, 2023
d2e7927
rebase
caila-marashaj Jul 17, 2023
2b20a20
rough final draft
caila-marashaj Jul 18, 2023
8cf3c15
cleanup
caila-marashaj Jul 18, 2023
7e5b7ef
format
caila-marashaj Jul 18, 2023
8ace0ef
remove redundant data check from gear motors
caila-marashaj Jul 18, 2023
155738b
hardware controller changes
caila-marashaj Jul 19, 2023
0aede03
increase backward distances
caila-marashaj Jul 20, 2023
97e12e9
changed helpers_ot3 function
caila-marashaj Jul 21, 2023
1550c9a
format
caila-marashaj Jul 21, 2023
735ebe7
helpers_ot3 function change
caila-marashaj Jul 21, 2023
af1eefa
got rid of copysign call
caila-marashaj Jul 21, 2023
e2280aa
check if speed exists
caila-marashaj Jul 21, 2023
5be4492
add deafult value to axis convert call
caila-marashaj Jul 24, 2023
93ef4ca
update gear motor position handling after move
caila-marashaj Jul 25, 2023
f1a42d1
test fix
caila-marashaj Jul 25, 2023
2b71f07
moved comments
caila-marashaj Jul 26, 2023
57bb955
remove updategearmotorpositionestimation msg
caila-marashaj Jul 26, 2023
e201a43
removed more unneeded code
caila-marashaj Jul 26, 2023
6eb76e6
address change reqs
caila-marashaj Jul 27, 2023
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
Prev Previous commit
Next Next commit
test fix
  • Loading branch information
caila-marashaj committed Jul 26, 2023
commit f1a42d185a57f0274a58d6069c0acab10bc86da8
5 changes: 4 additions & 1 deletion api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,17 @@ async def tip_action(
distance: Optional[float] = None,
velocity: Optional[float] = None,
tip_action: str = "home",
back_off: Optional[bool] = False,
) -> None:
move_group = []
if moves is not None:
move_group = create_tip_action_group(
moves, [NodeId.pipette_left], tip_action
)
elif distance is not None and velocity is not None:
move_group = create_gear_motor_home_group(float(distance), float(velocity))
move_group = create_gear_motor_home_group(
float(distance), float(velocity), back_off
)
runner = MoveGroupRunner(
move_groups=[move_group],
ignore_stalls=True if not ff.stall_detection_enabled() else False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ async def tip_action(
distance: Optional[float] = None,
velocity: Optional[float] = None,
tip_action: str = "home",
back_off: Optional[bool] = False,
) -> None:
pass

Expand Down
42 changes: 15 additions & 27 deletions api/src/opentrons/hardware_control/backends/ot3utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Shared utilities for ot3 hardware control."""
from typing import Dict, Iterable, List, Set, Tuple, TypeVar, cast
from typing import Dict, Iterable, List, Set, Tuple, TypeVar, cast, Sequence, Optional
from typing_extensions import Literal
from logging import getLogger
from opentrons.config.defaults_ot3 import DEFAULT_CALIBRATION_AXIS_MAX_SPEED
Expand Down Expand Up @@ -56,8 +56,6 @@
)
from opentrons_hardware.hardware_control.constants import interrupts_per_sec

from opentrons_hardware.hardware_control.constants import interrupts_per_sec

GRIPPER_JAW_HOME_TIME: float = 10
GRIPPER_JAW_GRIP_TIME: float = 10

Expand Down Expand Up @@ -378,29 +376,8 @@ def create_home_groups(
return [home_group, backoff_group]


def create_tip_action_home_group(
axes: Sequence[Axis], distance: float, velocity: float
) -> List[MoveGroup]:
current_nodes = [axis_to_node(ax) for ax in axes]
home_group = [
create_tip_action_step(
velocity={node_id: np.float64(velocity) for node_id in current_nodes},
distance={node_id: np.float64(distance) for node_id in current_nodes},
present_nodes=current_nodes,
action=PipetteTipActionType.home,
)
]

backoff_group = [
create_tip_action_backoff_step(
velocity={node_id: np.float64(velocity / 2) for node_id in current_nodes}
)
]
return [home_group, backoff_group]


def create_tip_action_group(
moves: List[Move[Axis]],
moves: Sequence[Move[Axis]],
present_nodes: Iterable[NodeId],
action: str,
) -> MoveGroup:
Expand All @@ -426,15 +403,26 @@ def create_tip_action_group(
def create_gear_motor_home_group(
distance: float,
velocity: float,
backoff: Optional[bool] = False,
) -> MoveGroup:
step = create_tip_action_step(
move_group: MoveGroup = []
home_step = create_tip_action_step(
velocity={NodeId.pipette_left: np.float64(-1 * velocity)},
acceleration={NodeId.pipette_left: np.float64(0)},
duration=np.float64(distance / velocity),
present_nodes=[NodeId.pipette_left],
action=PipetteTipActionType.home,
)
return [step]
move_group.append(home_step)

if backoff:
backoff_group = create_tip_action_backoff_step(
velocity={
node_id: np.float64(velocity / 2) for node_id in [NodeId.pipette_left]
}
)
move_group.append(backoff_group)
return move_group


def create_gripper_jaw_grip_group(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,18 +694,21 @@ async def test_tip_action(

mock_move_group_run.reset_mock()

await controller.tip_action(distance=33, velocity=-5.5, tip_action="home")
await controller.tip_action(
distance=33, velocity=-5.5, tip_action="home", back_off=True
)
for call in mock_move_group_run.call_args_list:
move_group_runner = call[0][0]
for move_group in move_group_runner._move_groups:
move_groups = move_group_runner._move_groups

for move_group in move_groups:
assert move_group # don't pass in empty groups
assert len(move_group) == 1
assert len(move_group) >= 1

move_groups = move_group_runner._move_groups
# we should be sending this command to the pipette axes to process.
home_step = move_groups[0][0][NodeId.pipette_left]
assert home_step.stop_condition == MoveStopCondition.limit_switch
backoff_step = move_groups[1][0][NodeId.pipette_left]
backoff_step = move_groups[0][1][NodeId.pipette_left]
assert backoff_step.stop_condition == MoveStopCondition.limit_switch_backoff


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_filter_zero_duration_step() -> None:
moves=moves,
present_nodes=present_nodes,
)
assert len(move_group) == 2
assert len(move_group) == 3
for step in move_group:
assert set(present_nodes) == set(step.keys())

Expand Down
1 change: 1 addition & 0 deletions hardware/opentrons_hardware/hardware_control/motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def create_tip_action_backoff_step(velocity: Dict[NodeId, np.float64]) -> MoveGr
duration_sec=abs(np.float64(BACKOFF_MAX_MM) / abs(v)),
stop_condition=MoveStopCondition.limit_switch_backoff,
action=PipetteTipActionType.home,
acceleration_mm_sec_sq=np.float64(0),
)
return backoff

Expand Down