Repository navigation
Description
Firmware version
2.0.0 (Klipper version string 2.0.0-paxx12-24). Also reproduced on 1.6.0 (1.6.0.267_20260815150420).
Firmware source
Third-party provider
Third-party firmware source
https://github.com/paxx12-snapmaker-u1/SnapmakerU1-Extended-Firmware (release 2.0.0-paxx12-24)
Was the configuration modified?
Yes
What configuration changes were made?
printer.cfg and fluidd.cfg are as shipped. fluidd.cfg, which holds INNER_PAUSE, INNER_RESUME and MOVE_TO_DISCARD_FILAMENT_POSITION, is byte-identical to the stock copy in origin_printer_data. Added on top:
- Extended Firmware includes (
extended/klipper/*.cfg):mainsail_pause_resume.cfg: renames PAUSE/RESUME to pass-through wrappers (gcode: _PAUSE_BASE {rawparams})- TMC autotune and reduced X/Y current
- adaptive bed-mesh override
- RFID reader disabled
- Spoolman link, AFC lane definitions, a heater-module config
- The BMCU-Klipper add-on (
bmcu/*.cfg).
None of these touch exclude_object, gcode_move, the park commands, or the pause/resume macros' moves. The reproduction below uses a stock preset, a native head, and no add-on commands in the file. The add-on's RESUME hook passes straight through when it has no pending refill.
Was the source code modified?
No
What source code changes were made?
N/A, no changes by me.
The files involved are byte-identical to Snapmaker/u1-klipper main @ 93cb12f ("Release firmware version 2.0.0"):
klippy/extras/exclude_object.pyklippy/extras/gcode_move.pyklippy/extras/pause_resume.pyklippy/gcode.pyklippy/kinematics/extruder.py
All of them except pause_resume.py are also unchanged from 1.6.0. pause_resume.py only gained refusal error codes in 2.0.0.
The Extended firmware patches toolhead.py (junction speed backports). manual_move() and the toolhead:manual_move event are unchanged.
How can the issue be reproduced?
-
Slice two objects with the stock U1 preset (0.2 mm, PLA), one native head, no prime tower, label objects on:
- A: cube 20×20×3 mm at the front (centre 135,40)
- B: cube 40×40×60 mm at the back (centre 135,200)
B must be taller than A, and must sit well toward +Y of A.
-
Start the print. Skip B early:
EXCLUDE_OBJECT NAME=CUBE_ID_1_COPY_0at layer 2. -
After A finishes (layer 15), only B's skipped layers remain. During that stretch, press Pause in the UI or send
PAUSEthrough Moonraker. A pause from inside the file is refused here ("Cannot pause while in an excluded region"); a UI pause is not. -
Press Resume.
Actual Gcode I used:
Dual_Cube_Bug_Test_PLA.gcode.zip
What was the actual result?
Resume fails, and the print cannot be continued:
!! Resumes error!
Move out of range on Y axis: 169.131 445.274 10.406 [548.911]
The GET_POSITION that INNER_PAUSE logs straight after its park shows why:
toolhead: X:160.490000 Y:300.500000 Z:7.975976 E:528.911280
gcode: X:169.131000 Y:445.274000 Z:10.406309 E:1486.461120
- The head is really at the head-3 discard position (160.49, 300.5), but gcode position is (+8.641, +144.774) away from it.
- That offset is exactly where the file had reached inside the skipped B, (133.964, 193.681), minus the last move actually printed on A, (125.323, 48.907).
- Resume's first move is
_CLIENT_EXTRUDE LENGTH=20, an E-onlyG1(E 548.911 = 528.911 + 20). It carries that wrong XY, so Y 445 is rejected.
(2.0.0-paxx12-24, 2026-10-31 16:31-16:41 in the attached log. The same file on 1.6.0 earlier that day: gcode X:167.058 Y:440.565 against toolhead X:160.49 Y:300.5, then Move out of range on Y axis: 167.058 440.565 12.836 [798.911].)
Cause. Skipping an object makes exclude_object keep a per-extruder offset: last skipped position − last printed position. Then:
MOVE_TO_DISCARD_FILAMENT_POSITION→MOVE_TO_XY_IDLE_POSITION_EXTRUDERparks withtoolhead.manual_move()(kinematics/extruder.py:1820-1864, moves at 1851-1858).manual_movefirestoolhead:manual_move(toolhead.py:548-554).gcode_movehandles that withreset_last_position()→position_with_transform()(extras/gcode_move.py:15-16, 111-113).exclude_object.get_position()returns physical position + the stale offset (extras/exclude_object.py:151-159).- The next G1 that does not set both X and Y (E-only, or Z-only) inherits that XY.
_normal_movesees XY ≠ last skipped XY, zeroes the offset, and sends the wrong XY unchanged (extras/exclude_object.py:187-207).
If the wrong position had fallen inside the bed, the head would have travelled there while extruding. That is inferred from the same code path; it was not tested.
The pause guard in extras/pause_resume.py (cmd_PAUSE) only covers being inside the skipped object; the offset outlives it. The get_position() logic itself is mainline Klipper. The U1 reaches it easily because its parks use manual_move and are followed by E-only moves.
A second way to hit it: end of print. On a 5 h print with one object skipped, the end-of-print sequence of my filament add-on ran MOVE_TO_DISCARD_FILAMENT_POSITION and then G1 E30:
Move out of range on Y axis: 53.792 426.030 199.957 [25367.803]
Park (45.28, 300.5) + offset (+8.512, +125.530) = (53.792, 426.030), an exact match. The stock PRINT_END then failed at the same XYZ with E 2.000 lower (_CLIENT_RETRACT), and the print was marked cancelled.
That second failure is a separate issue: gcode.py:201-245 only sends gcode:command_error (and with it reset_last_position) from the top-level _process_commands. Mainline sends it at every nesting level. A caught nested error therefore leaves the wrong position in place for the next command.
What was the expected result?
The pause park should leave gcode position equal to where the head actually is, and Resume should continue the print. An E-only move should never move XY.
Possible fix (untested, for discussion):
- In
exclude_object.get_position(), check whethernext_transform.get_position()differs from the last position_normal_movesent. If it does, the head was moved outside the transform, so zero the active extruder's XYZ offset and setlast_position_extrudedto the current position before returning. - A
toolhead:manual_movehandler inexclude_objectalone would not work:gcode_moveregisters its handler first and reads the position before the new handler runs. - Separately, sending
gcode:command_errorfor nested errors, as mainline does, would stop one failure from carrying into the next command.
Log files
klippy-2026-10-31-redacted.log
Attached: klippy-2026-10-31-redacted.log. It is the complete klippy.log from 15:06 to 16:41 on 2026-10-31, with one access token and a LAN IP redacted.
| Run | Exclusion | Pause | Resume error |
|---|---|---|---|
| 2.0.0-paxx12-24 | 16:39:24 | 16:40:54, GET_POSITION at lines 21092-21093 | 16:41:28, line 21109 |
| 1.6.0 | 15:37:29 | 15:39:01 | 15:40:33 |
I can also provide an offline replay harness: it loads the unmodified exclude_object.py and gcode_move.py and reproduces both failures to within 0.0005 mm.
Activity
alandebortolo commentedon Nov 4, 2026
I implemented the fix you suggested in draft PR #24: when the head was moved outside the exclude_object transform (the pause park's
manual_move), the XYZ offset is reset and E is kept. It comes with a regression test that prints a file through the firmware's ownvirtual_sdcardand presses Pause/Resume through the webhook handlers, in Klipper batch mode on 93cb12f. Stock fails all three cases with your error (Move out of range on Y axis: 33.000 448.500 5.800 [42.288]); with the patch, all three finish.I don't have a U1, so it hasn't run on hardware. If you build custom firmware, could you try the patch with the file that triggered this and tell me whether Resume works? It applies cleanly on 2.0.0 and on the 2.1.0 PR (#23).
abehrman commentedon Nov 9, 2026
Another way to hit this, with no pause involved: a tool change after an object is skipped. Two prints failed this way on my U1 (stock firmware
2.0.0.205_20260914173503).Both prints skipped objects mid-print. After each tool change, the slicer ran a short prime in the purge chute:
SAVE_GCODE_STATE,MOVE_TO_DISCARD_FILAMENT_POSITION, thenG1 E…. The tool swap and the discard park both move the head outside the exclude_object transform.get_position()then returns the physical position plus the stale offset, and the first E-only move carries the wrong XY. This is the same path you describe for the pause park.G1 E10 ; restore retractionmoved the head from the chute (160.2, 300.5) to (148.989, 337.635). That is past Y max 335, so the print stopped with "Move out of range".G1 E…in the chute moved the head 222 mm to (28.1, 202.4), across the part, while extruding. The swap took 58 s instead of about 15 s, and the next T3 dock failed.So the "would travel there while extruding" case does happen on hardware when the wrong position lands inside the bed.
An offline replay of the unmodified
exclude_object.py+gcode_move.pyover both G-code files predicts both bad targets exactly. I haven't run #24 yet. From reading it, itslast_tx_positioncheck should also catch tool-swap and park moves, not only the pause park, since any move outside the transform makes the position differ.Workaround in the meantime: after a tool change or a manual-move macro, make one absolute XY move to the current position before any E-only or Z-only move. That clears the offset and doesn't move the head.
alandebortolo commentedon Nov 9, 2026
Thank you, this is the hardware confirmation the PR was missing, and your offline replay matches what the firmware does in batch mode.
Your reading of #24 is right, and your case shows which offset is the dangerous one.
exclude_objectkeeps the offset per extruder, so what is stale at a tool change is the offset of the tool being swapped in, from the last time it printed, when its last moves were the skipped object's. After the swap, the chute park (amanual_move) makesgcode_movere-read the position as chute plus (last skipped point minus the previous object's last point), and the prime's E-only move zeroes the offset and goes there.I added your path as the fourth regression case in the same harness: a two-colour file where T0 prints A and T1 prints C then B, B skipped at layer 2, and every swap is the U1 Orca profile's
change_filament_gcodefollowed bySAVE_GCODE_STATE,MOVE_TO_DISCARD_FILAMENT_POSITION, an E-only prime,MOVE_TO_XY_IDLE_POSITION_EXTRUDER,RESTORE_GCODE_STATE. On stock 2.0.0 (93cb12f) and stock 2.1.0 (7ac453b), at the fifth tool change (layer 3, back to T1)GET_POSITIONin the chute says toolhead X92.7 Y300.5 and gcode X82.7 Y230.5, and theG1 E20prime moves the head to X82.7 Y230.5, 70 mm in Y across the bed while extruding, the shape of your 2026-11-01 print. With #24 all seven tool changes stay in the chute and the print endscomplete. Test, fixture and the firmware console of both runs:tests/test_issue22.py,tests/issue22/tool_change.gcodeanddocs/evidence/issue-22/harness-console-tool-change-*.txtin https://github.com/DesignMaster-Solutions/u1-fixpack (commit ba7d321). I am adding your report to the PR description, with credit.On the workaround, from the same code path: it works when the XY you send is the toolhead's position (
printer.toolhead.position), notprinter.gcode_move.gcode_position, which already carries the stale offset. The first XY move clears the offset and goes to the XY as given, so with the physical XY it is a zero-length move.If you can attach the two G-code files (or just the layers around the failing swaps), I will run them through the harness on stock and patched and post the numbers next to your logs. And if you ever run a build with the patch on your U1, one of those two files is the test that would let this PR leave draft.
abehrman commentedon Nov 9, 2026
Here are both files: https://gist.github.com/abehrman/4fcabd84dc57d5197168635d14e249ac (use "Download ZIP" or
git clone; the web view truncates large files). They are unmodified, exactly as they were printed on the U1 (stock firmware 2.0.0.205_20260914173503). Times are the printer's klippy.log clock. Line numbers marked "≈" come from the reader'ssd_posat the time of the exclusion. Because the reader reads ahead, the line that was actually executing was a little earlier.2026-10-27,
K_rper_182_(3)_PETG_4h25m.gcodeExcluding object K_RPER_07__1_ID_17_COPY_0andK_RPER_07__1_ID_18_COPY_0, at sd_pos ≈ 7916749 (≈ line 311388).G1 E10 F187 ; restore retraction, afterMOVE_TO_DISCARD_FILAMENT_POSITIONandM83.Move out of range on Y axis: 148.989 337.635 10.874.2026-11-01,
K_rper_182_(3)_PETG_4h1m.gcodeExcluding object K_RPER_07__1_ID_15_COPY_0andK_RPER_07__1_ID_17_COPY_0, at sd_pos ≈ 5139310 (≈ line 195168).Excluding object K_RPER_182_ID_16_COPY_0, at sd_pos ≈ 5154227 (≈ line 195724).G1 E10 F299 ; restore retraction. The head travelled 222 mm from the chute to about (28.1, 202.4) while extruding. The swap took 58 s, and the next T3 dock failed.Thanks for the workaround note about
printer.toolhead.position. Our macro already sends the toolhead's XY. I haven't run #24 on the printer yet.alandebortolo commentedon Nov 9, 2026
Both files replayed through the harness on 93cb12f (2.0.0), stock and with #24, unmodified except for what batch mode cannot do: the start block (probe, camera, RFID) is replaced by the state it leaves behind (T1 on the carriage, absolute XYZ, relative E); the Skip is an
EXCLUDE_OBJECTinjected before the line that holds the byte your klippy.log gives as sd_pos; aGET_POSITIONgoes after everyMOVE_TO_DISCARD_FILAMENT_POSITIONand after the; restore retractionprime; and T4 is mapped onto extruder3, because the extruder map table only exists while the screen starts a print. The shipped printer.cfg parks extruder1 and extruder3 in the chute at X92.7 and X227.7, while on your unit the heads behind T1 and T4 sit at X160.2 and about X250, so compare the offsets, not the absolute X.2026-10-27,
K_rper_182_(3)_PETG_4h25m.gcode, Skip at sd_pos 7916749GET_POSITIONin the chute says toolhead X92.700 Y300.500 Z9.350 and gcode X81.489 Y337.635 Z10.850, and theG1 E10 F187is rejected:Move out of range on Y axis: 81.489 337.635 10.850. Your log:148.989 337.635 10.874. Same Y, same stale offset (gcode minus toolhead = -11.211, +37.135 on both), X differing by 67.5 = 160.2 - 92.7, Z by your mesh.complete.2026-11-01,
K_rper_182_(3)_PETG_4h1m.gcode, Skips at sd_pos 5139310 and 5154227GET_POSITIONsays toolhead X227.700 Y300.500 and gcode X28.113 Y202.421, and theG1 E10 F299moves the head to X28.113 Y202.421 while extruding: your "about (28.1, 202.4)", 199.6 mm here against 222 on your unit, the difference again being the chute X of that head. The harness has no dock to fail afterwards, so the file runs to the end.complete.So the firmware in batch mode lands on the same two targets as your offline replay and as the printer, and the patch removes both. Generator, summary and the four firmware consoles:
tests/issue22/replay_real.py,tests/issue22/replay_report.py,docs/evidence/issue-22/real-print-{A,B}-{stock,patched}.txtin https://github.com/DesignMaster-Solutions/u1-fixpack (commit f5d1308). Your G-code files are not in the repo; their sha256 is in the evidence headers. The same four results on 7ac453b (2.1.0):real-print-*-2.1.0.txt.One thing in the 2026-11-01 run worth knowing: the Skip at 5139310 lands on the
M400inside the layer-19 tool change, so the firmware excluded the two objects while the swap to T1 was in progress, and that swap and the twelve after it were still clean. The one that went wrong is the only T4 swap-in in the file whose previous T4 section ended inside a skipped object (K_RPER_07__1_ID_17 in the layer before; every other T4 section ends in an object that was still printing), which is the offset the patch drops.