Repository navigation
Lift the colour-change traverse clear of the model - #128
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was
Patch Kinscripts/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 inPG101.Warum
A two-colour print on 2026-10-07 collided during a filament change and came out with a layer shift.
klippy.logcarries 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_WAITINGAREAtravels to the waiting position with no Z component, so it crosses the part at the current layer height.PRZ_PAUSE_WAITINGAREAmakes the same move one step earlier, beforePAUSE_PRINTINGhas 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:
PG101wraps a later move inG91 / 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_WAITINGandPRZ_WAITINGAREAshare 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=1restoring Z (it does — but relying on it would turn a later edit into a crash).printer_gcode_macro.cfgis 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:G1 Z1 F40001 → 3Open
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