Move Out of Range errors from End G-Code

Basic Information:

Printer Model: Mega Zero - Voron Edition
MCU / Printerboard: BTT SKR2
klippy.log
klippy.log.zip (887.0 KB)

Describe your issue:

Im not sure what has changed recently, however my end g-code (which has worked for a long time) is now throwing “Move out of range Errors” for the Y-Axis move (Present Print).

; Klipper Config
STATUS_READY
M400 ; wait for moves to finish
M117 Cooling down...
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M107 ; Fan off

G91 ;relative positioning
G1 E-5 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z+25.0 E-5 ;X-20 Y-20 F[layer_height] ;move Z up a bit and retract filament even more
G28 X0 ;move X to min endstops, so the head is out of the way

G90 ;Absolute positioning
G1 Y200 F3000 ;Present print
M84 ;steppers off
; M300 P300 S4000
M84 ; disable motors
SET_SKEW CLEAR=1
M117 Print Finished.
STATUS_READY

Screenshot 2023-04-11 at 9.38.35 am

Has something changed recently? This has only started happening in the last week or so.

It’s not a good idea to move the print head in X or Y in relative mode at the end of the print. Your macro is telling the printer to move 20mm in the negative direction regardless of where it is at the end of the print. In this case it appears your head is at an X location around 8mm from the edge when the print ends, and your macro is trying to move the head to -12mm which isn’t possible. I would recommend leaving the printer in absolute mode and moving the head to 0,0 or some other known location at the end of the print.

1 Like

Ah good point - I hadnt realised I was doing that. Cheers.

EDIT: I double-checked, that section is commented out:

;X-20 Y-20 F[layer_height] ;

I’ll remove it anyway, just in case.

I’m on mobile and can’t easily look at your log. Something is trying to move your printer to -12 on the X axis. That appears to be the error. See if you can find anything in your macros that could be doing that.

1 Like

I don’t disagree with your findings, I’m wondering if Klipper is seeing the double “;” and ignoring the first one?

I think I found the issue. Clear your skew compensation before moving to Y200. Your endstop is at X-12, and your homing X right before moving Y. With the skew enabled it’s trying to move an extra few tenths of a mm during the Y move.

1 Like

Legend, I’ll move that.

Thank you, that was the solution. :pray: