Repository navigation
exclude_object: lift before the first travel after a skipped object - #28
Draft
alandebortolo wants to merge 2 commits into
Draft
alandebortolo wants to merge 2 commits into
alandebortolo wants to merge 2 commits into
Conversation
…he transform Fixes Snapmaker#22 (skip an object, Pause, Resume fails with "Move out of range"). While an object is skipped, exclude_object keeps a per-extruder offset: last skipped G-code position minus last printed position. The U1 pause park (MOVE_TO_DISCARD_FILAMENT_POSITION) moves the head with toolhead.manual_move(), so gcode_move resets its position through exclude_object.get_position(), which returns the parked position plus that stale offset. The next G1 that does not set both X and Y (Resume's _CLIENT_EXTRUDE, an E-only move) carries the wrong XY and is rejected, or, inside the bed, travels there while extruding. get_position() now compares the position below the transform with the last one _normal_move() sent. If they differ, the head was moved outside the transform, so the XYZ offset is zeroed and the last printed position becomes the real one. The E offset is left as it was. Diagnosis and the suggested fix are from the issue's reporter; this patch implements that suggestion. Regression test: tests/test_issue22.py (red on 93cb12f, green with this patch) in github.com/DesignMaster-Solutions/u1-fixpack.
Stacked on the fix for Snapmaker#22 (uses its last_tx_position). The slicer ends every object with a short ramped lift (OrcaSlicer: 0.4 mm of Z over a few mm of XY) and then travels at that height. When the object was skipped the head is not at the end of that object but at the end of the last printed one, and the first move after the skip goes from there straight to the end point of the ramp: the same 0.4 mm of Z is spread over the whole distance, so the nozzle leaves the last printed part almost at print height and crosses whatever is in between. Seen on a real print file (abehrman's of 2026-11-01, Snapmaker#22, three objects skipped) run offline: 8 such travels cross finished parts with less than 0.05 mm of clearance, with and without 0022. _normal_move() now makes the Z part of that first move where the head is, then the XY part. Any E in that move stays with the XY part, as before: a Z+E move would be checked as an extrude-only move (max_extrude_only_distance). Nothing changes when the first move after the skip does not go up, or when no object is skipped. Regression test: tests/test_issue22travel.py in github.com/DesignMaster-Solutions/u1-fixpack (red on stock and with 0022 alone, green with this patch).
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.
Stacked on #24 (it uses the
last_tx_positionthat PR adds), so this shows two commits until #24 is merged. Only the second one is new: the diff of this PR alone.What happens. OrcaSlicer ends every object with a short ramped lift (0.4 mm of Z over a few mm of XY) and then travels at that height. When the object was skipped, the head is not at the end of that object but at the end of the last printed one, and the first move after the skip goes from there straight to the end point of the ramp. The same 0.4 mm of Z is spread over the whole distance, so the nozzle leaves the last printed part almost at print height and crosses whatever is in between.
There is no issue for this yet. I found it while replaying the 2026-11-01 file from #22 (@abehrman's, three objects skipped) offline: 8 travels cross finished parts with less than 0.05 mm of clearance, all 8 the first move after the
EXCLUDE_OBJECT_ENDof a skipped object (file lines 207895, 215427, 315713, 322732, 392687, 401815, 421571, 507349). They are there on stock and with #24 alone, so it is a second effect of Skip, not something #24 causes or fixes.The change. When the first move after a skipped object goes up,
_normal_move()makes the Z part where the head is and then the XY part. Any E in that move stays with the XY part, as today (a Z+E move would be checked as an extrude-only move). Nothing changes when that move does not go up, or when no object is skipped.How I tested it, without a printer. Same harness as #24: the firmware in Klipper batch mode with the shipped
lava/printer.cfg, the file printed throughvirtual_sdcard, assertions on the firmware's own move trace.tests/test_issue22travel.py(A, B, C on every layer, B skipped, 8 mm ramped lifts that also retract): red on stock and with exclude_object: drop the skipped-object offset after a park outside the transform (fixes #22) #24 alone (a 0.4 mm lift stretched over 150 mm), green with this patchcomplete, same filament per head as stock (20129 mm and 588 mm)Test, fixture and logs: https://github.com/DesignMaster-Solutions/u1-fixpack (
tests/test_issue22travel.py,tests/prove.sh,docs/evidence/issue-22/), with CI on every push.Draft for the same reason as #24: batch mode has no physics, so this proves what the firmware commands, not what a print looks like. Nobody has printed with it. A travel that the slicer itself planned without a lift is left as it is.
Built with AI coding assistance; I reviewed and tested it.