Skip to content

Commit 65353c6

Browse files
added stallguard reset
1 parent d0896c3 commit 65353c6

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

hardware-testing/hardware_testing/modules/flex_stacker_qc/test_stallguard.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,7 @@ async def test_stallguard(
6868
except FlexStackerStallError:
6969
ui.print_info("Stall Detected")
7070
stall_detected = True
71-
72-
axis_reset = False
73-
while not axis_reset:
74-
try:
75-
# Move the axis off the crash block before re-homing
76-
await stacker.move_axis(
77-
test_axis,
78-
Direction.EXTEND,
79-
20,
80-
STACKER_MOTION_CONFIG[test_axis]["home"].move_params.max_speed,
81-
STACKER_MOTION_CONFIG[test_axis]["home"].move_params.acceleration,
82-
STACKER_MOTION_CONFIG[test_axis]["home"].run_current,
83-
)
84-
axis_reset = True
85-
except FlexStackerStallError:
86-
axis_reset = False
71+
await stacker._driver.set_stallguard_threshold(test_axis, False, 0)
8772

8873
await stacker.home_axis(test_axis, Direction.EXTEND)
8974

@@ -134,7 +119,13 @@ async def run(stacker: FlexStacker, report: CSVReport, section: str) -> None:
134119
test_reset = True
135120
except FlexStackerStallError:
136121
# Double check if crash block was actually removed
137-
await stacker.home_axis(StackerAxis.Z, Direction.EXTEND)
138-
await stacker.home_axis(StackerAxis.X, Direction.EXTEND)
122+
await stacker._driver.set_stallguard_threshold(StackerAxis.Z, False, 0)
123+
await stacker._driver.set_stallguard_threshold(StackerAxis.X, False, 0)
124+
await stacker._driver.set_stallguard_threshold(
125+
StackerAxis.Z, True, STALLGUARD_CONFIG[StackerAxis.Z].threshold
126+
)
127+
await stacker._driver.set_stallguard_threshold(
128+
StackerAxis.X, True, STALLGUARD_CONFIG[StackerAxis.X].threshold
129+
)
139130
if not stacker.is_simulated:
140131
ui.get_user_ready("Remove the crash block from the stacker")

0 commit comments

Comments
 (0)