Skip to content

fix(bg-swap): announce the toolchange to the engine before the stock … - #198

Merged
decay71 merged 1 commit into
mainfrom
fix/bg-pick-notice
Oct 25, 2026
Merged

decay71 merged 1 commit into
mainfrom
fix/bg-pick-notice

Conversation

@decay71

@decay71 decay71 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

…pick

A full bg swap that is still priming when the T arrives kept extruding while the stock macro carried the head to the print: the engine's interlock (_check_docked) only sees the extruder ACTIVATION, which stock performs ~2.4 s after lifting the head out of the dock, and only between prime chunks. Field log: pick 13:34:26, activation 13:34:28.6, engine notice 13:34:29.8 - 3.5 s of prime at 4 mm/s plus no anti-ooze retract, the blob in front of the wipe tower.

ace.py wraps T0-T3: before the stock handler runs, _notify_bg_pick tells the engine (request_pick_abort) and waits up to BG_PICK_NOTICE_WAIT for the handover. The engine stops at its next move boundary while the head is still docked: the prime loop ends cleanly, sets its anti-ooze cushion and records the missing purge for the arrival pick-check; every other polling phase (HEAT, PULL, LD_FEED, LD_GRIP) takes its existing pick-abort path. The bulk retract stays untouchable, a notice outside the polling phases is ignored and the T runs as before. An older engine without the hook, or no engine, is a no-op.

Unit tests for both halves (tests/unit/test_bg_pick_notice.py).

…pick

A full bg swap that is still priming when the T arrives kept extruding
while the stock macro carried the head to the print: the engine's
interlock (_check_docked) only sees the extruder ACTIVATION, which stock
performs ~2.4 s after lifting the head out of the dock, and only between
prime chunks. Field log: pick 13:34:26, activation 13:34:28.6, engine
notice 13:34:29.8 - 3.5 s of prime at 4 mm/s plus no anti-ooze retract,
the blob in front of the wipe tower.

ace.py wraps T0-T3: before the stock handler runs, _notify_bg_pick tells
the engine (request_pick_abort) and waits up to BG_PICK_NOTICE_WAIT for
the handover. The engine stops at its next move boundary while the head
is still docked: the prime loop ends cleanly, sets its anti-ooze cushion
and records the missing purge for the arrival pick-check; every other
polling phase (HEAT, PULL, LD_FEED, LD_GRIP) takes its existing
pick-abort path. The bulk retract stays untouchable, a notice outside
the polling phases is ignored and the T runs as before. An older engine
without the hook, or no engine, is a no-op.

Unit tests for both halves (tests/unit/test_bg_pick_notice.py).
@decay71
decay71 merged commit 63674dd into main Oct 25, 2026
5 checks passed
@decay71
decay71 deleted the fix/bg-pick-notice branch October 25, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant