Skip to content

Lift the colour-change traverse clear of the model - #128

Merged
solutionphil merged 1 commit into
alphafrom
fix/toolchange-traverse-lift
Oct 8, 2026
Merged

solutionphil merged 1 commit into
alphafrom
fix/toolchange-traverse-lift

Conversation

@solutionphil

Copy link
Copy Markdown
Owner

Was

Patch K in scripts/apply-config-patches.sh: the two traverses that leave the print position during a colour change get the same balanced 1 mm lift Phrozen already uses one step later in PG101.

Warum

A two-colour print on 2026-10-07 collided during a filament change and came out with a layer shift. klippy.log carries no error in 88614 lines — no "Move out of range", no "Timer too close", no shutdown. That is what a purely mechanical crash looks like: the coordinates are legal, the belts skip, Klipper keeps printing at the position it believes in.

PRZ_CUT_WAITINGAREA travels to the waiting position with no Z component, so it crosses the part at the current layer height. PRZ_PAUSE_WAITINGAREA makes the same move one step earlier, before PAUSE_PRINTING has saved the state. In that print all four changes sat at Z 0.2 / 0.4 / 0.6 / 0.8 — the colour is in the first four layers — so there was no clearance at all. The part spans X 97.3–226.7, Y 115.3–262.0 and the traverse ends at Y295, so it has to cross it.

The clearance already exists in the file: PG101 wraps a later move in G91 / G1 Z1 / G90 … G91 / G1 Z-1 / G90, and the comment above it says it is there so the head does not stop on the model. It simply sits after the call that needed it.

Scope

The same travel line appears 19 times in printer_gcode_macro.cfg. The others (PG102, PG108, PG111–PG119) shuttle between the waiting and spitting positions behind the bed and never cross the part. PAUSEMA, PRZ_MANUAL_WAITING and PRZ_WAITINGAREA share the shape on the manual-pause path and are left alone deliberately, not by oversight.

Balanced pair on purpose: Z ends where it started, so spit, wipe and cut see no change, and the fix does not lean on RESTORE_GCODE_STATE MOVE=1 restoring Z (it does — but relying on it would turn a later edit into a crash).

printer_gcode_macro.cfg is never regenerated on an existing printer, so this is a self-heal patch like B and J, not a template change.

Verified

On the printer against a copy in /tmp, not only locally:

  • CRLF preserved — 1894 → 1910 CR for 16 inserted lines
  • G1 Z1 F4000 1 → 3
  • second run a no-op (marker gate)
  • live config untouched, temp files removed

Open

This fixes the traverse across the part. If the actual contact was at the cutter behind the bed, it will not help — a test print with a colour change in the first layers is the discriminator.

🤖 Generated with Claude Code

A two-colour print on 2026-10-07 collided during a filament change and came
out with a layer shift. klippy.log has no error in 88614 lines -- no "Move out
of range", no "Timer too close", no shutdown -- which is what a purely
mechanical crash looks like: the coordinates are legal, the belts skip, and
Klipper keeps printing at the position it believes in.

PRZ_CUT_WAITINGAREA travels to the waiting position with no Z component at
all, so it crosses the part at the current layer height; PRZ_PAUSE_WAITINGAREA
does the same move one step earlier, before PAUSE_PRINTING has saved the
state. In that print all four changes sat at Z 0.2/0.4/0.6/0.8 -- the colour
is in the first four layers -- so the nozzle had no clearance at all. The part
spans X 97.3-226.7, Y 115.3-262.0 and the traverse ends at Y295: it has to
cross it.

The clearance already exists in the file. PG101 wraps a later move in
G91/G1 Z1/G90 ... G91/G1 Z-1/G90, and the comment above it says it is there so
the head does not stop on the model -- it just sits after the call that needed
it. Patch K gives that same balanced pair to the two traverses that leave the
print. Balanced on purpose: Z ends where it started, so spit, wipe and cut see
no change, and the fix does not lean on RESTORE_GCODE_STATE MOVE=1 bringing Z
back (it does, but relying on that turns a later edit into a crash).

The same travel line appears 19 times; the rest shuttle between the waiting
and spitting positions behind the bed and never cross the part. PAUSEMA,
PRZ_MANUAL_WAITING and PRZ_WAITINGAREA share the shape on the manual-pause
path and are left alone deliberately.

Verified on the printer against a copy in /tmp, not just locally: CRLF
preserved (1894 -> 1910 CR for 16 inserted lines), G1 Z1 1 -> 3, second run a
no-op, live config untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@solutionphil
solutionphil merged commit 8be981b into alpha Oct 8, 2026
5 checks passed
@solutionphil
solutionphil deleted the fix/toolchange-traverse-lift branch October 8, 2026 08:40
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