Homing_override Macro G28 called recursively

Basic Information:

Printer Model: TwoTrees Saphire Plus
MCU / Printerboard: MKS Robin Nano V3.0
Host / SBC: Ras-Pi 3b

klippy.log (1.6 MB)

So I am on Mainsail OS 2.2.2, klipper version v0.13.0-371-g7a723bdc

I have spent the whole evening battling [homing_override]. I have a CoreXY printer with a BLTouch and BTT Eddy. I want to use the BLTouch only for homing and Z-tilt, and Eddy for mesh.

My problem is that the BLTouch and Eddy can’t be defined as probes, so I am using [homing_override] to home Z with the BLTouch. My issue is that I have to probe somewhere in the middle of the bed, but when using [homing_override] only on Z and including any sort of G28 command inside, I get a “Macro G28 called recursively” error.

I saw it used to work with G28 X0, G28 Y0. Could this be fixed so that if I only set Z to be overridden, X and Y remain untouched, and maybe be able to set what happens before the override—so first X and Y home, and then the overridden Z homes? Or at least reinstate the G28 X0/Y0 command.

It is so frustrating because the feature is great. I saw some posts talking about the inflexibility of Klipper homing, and here it is, even though [homing_override] was supposed to fix that.

Or am I doing something wrong? Please tell me: why, when I press the home button or just use the general G28, does it start with Z and nothing on X and Y? Where did X and Y go?

[homing_override]
axes: z
set_position_z: 0
gcode:
   G28 Y0
   G28 X0
    SET_KINEMATIC_POSITION Z=20  ; "Cheat" - tell Klipper you're at Z=20
    G1 Z30 F5000                 ; Now move both Z steppers together to Z=10
    
    SET_KINEMATIC_POSITION X=0 Y=0 Z=280
    #BLTOUCH_DEBUG COMMAND=pin_down
    M400
    PROBE
    BLTOUCH_DEBUG COMMAND=pin_up
    
    SET_KINEMATIC_POSITION Z=0

[gcode_macro G281]
gcode:
    SET_KINEMATIC_POSITION Z=20  ; "Cheat" - tell Klipper you're at Z=20
    G1 Z30 F5000                 ; Now move both Z steppers together to Z=10

    G28 X Y 

    G90             ; X and Y use absolute bed coordinates
    G1 X150 Y180 F6000    ; Move to bed position X260 Y120

    G28

Just my opinion but it may be easier to simply override the G28 command. Then you can check for passed params and do what you need by calling G28.1 inside the macro. I personally think this is more flexible since you can add custom params. Once you decide to go without a probe config section all the work/logic falls on you to ensure things get done.

\[gcode_macro G28\]
rename_existing: G28.1
gcode:
    # add what you need and only call G28.1 inside this macro