Can't home after finish a print

Basic Information:

Printer Model: GtMax Core A1 (a national manufacturer)
MCU / Printerboard: BTT SKR 1.4 and Raspberry Pi 3 as secondary
Host / SBC
klippy.log
logs-20241129-220009.zip (2.4 MB)

Describe your issue:

Hi guys, It’s been a while since I noticed that my printer can’t home anymore after complete a print.

I mean, it can run all commands fine and park the car after finish it. But if I try to home the X axis, for example, the car moves to the home position but return a message like “Must home axis first: 15.997 179.999 230.625 [16266.579]”
the same error occurs with the Y axis (didn’t test the Z axis because I can’t even home X and Y)

But if I restart the firmware, the printer back to normal.

I’m currently using the sensorless home from my TMC2209 v1.3

these are my macros for START and END print

[gcode_macro START_PRINT]
gcode:
  {% set BED_TEMP = params.BED_TEMP|default(110)|float %}
  {% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(240)|float %}
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=current_layer VALUE=0
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=hotend_temp VALUE=0
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=hotbed_temp VALUE=0
  M190 S{BED_TEMP} ; AQUECE MESA PARA A TEMPERATURA DA PRIMEIRA CAMADA
  M109 S{EXTRUDER_TEMP} ; AQUECE EXTRUSOR PARA A TEMPERATURA DA PRIMEIRA CAMADA
  M402
  #G28 ; HOME GERAL
  #{% if printer.toolhead.homed_axes == "xy" %}
  #G28 Z
  #{% else %}
  #G28
  #{% endif %}
  M400
  G29 ; AUTO NIVELAMENTO
  M400
  G92 E0; RESETA EXTRUSOR
  G1 X5 Y5 Z0.7 F10000 ; VAI PARA PONTO DE PURGA
  G1 E20 F150; FAZ A PURGA
  G92 E0;  RESETA EXTRUSOR
  G1 E-4; RETIRA PRESSAO DO BICO
  G1 Z10; SOBE O BICO
  G1 X5 Y100 F10000; MOVIMENTO PRA SOLTAR PURGA
  SKEW_PROFILE LOAD=calilantern_skew_profile
[gcode_macro END_PRINT]
gcode:
  SET_SKEW CLEAR=1
  {% if printer.extruder.temperature >= 170 %}
      G92 E0; RESETA EXTRUSOR
      G1 E-4; RETIRA PRESSAO DO BICO
  {% endif %}
  TURN_OFF_HEATERS
  G1 X280
  G1 Y180
  {% if printer.toolhead.position.z|float < 230 %}
    G1 Z230
  {% endif %}
  M84 ; DESLIGA MOTORES
  M106 S0 ; DESLIGA VENTILADOR
  M300 S4 P500 ; GERA BEEP
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=current_layer VALUE=0
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=hotend_temp VALUE=0
  SET_GCODE_VARIABLE MACRO=PRINTER_TEMPS_VALUE VARIABLE=hotbed_temp VALUE=0

Try removing your G28 and see if the error persists.

My G28 is commented. It is inside the G29 command. But is was uncommented before, and has the same problem

You mean remove my custom G28?

also… this is my G28 and G29 commands

[gcode_macro G28]
rename_existing: G28.1
gcode:
  {% if 'X' in params %}
  G28.1 X
  G1 X25 F1200
  G4 P2000
  {% endif %}
  
  {% if 'Y' in params %}
  G28.1 Y
  G1 Y25 F1200
  G4 P2000
  {% endif %}

  {% if 'Z' in params %}
  G28.1 Z
  G1 Z10 F1200
  {% endif %}  

  {% if 'X' not in params and 'Y' not in params and 'Z' not in params %}
  # Home X
  G28.1 X
  G1 X25 F1200
  G4 P2000
  # Home Y
  G28.1 Y
  G1 Y25 F1200
  G4 P2000
  # Home Z
  G28.1 Z
  G1 Z10 F1200
  {% endif %}  
[gcode_macro G29]
gcode:
  {% if not printer.toolhead.homed_axes == "xyz" %}
  G28
  {% endif %}
  BED_MESH_CLEAR
  BED_MESH_CALIBRATE
  G1 Z10 F1000
  G1 X8 Y25 F6000
  G1 Z1 F1000
  G1 Z10 F1000

remove the g28 from where?
unfortunately I need to make the custom g28 because I have the sensorless homing

With what command do you home?

I still use g28

But I create a custom g28 (that still calls the old one) and renamed the old one to g28.1

Because I use a sensorless homing, so I need to move the car a bit after the home

Your G28 thing is not related to sensorless homing and is not needed for it. All that is needed is described here: TMC drivers - Klipper documentation