Nathan22211
New member
I was basically getting tired of homing and doing a QGL after every print as that eats into time between batches. And when doing batch production with a belt mod like this, time is money. Also, I'm not sure if this goes under the deep end or not, as it's just macros and not printing data.
Anywho, the first issue was the homing override. I needed it to store when it homed and did the QGL already (directly overriding G28 causes issues usually) so I needed a macro to store a bool variable. Note that I had to use SET_KINEMATIC_POSITION as the feature to set that within the homing override directly would have it up in the air otherwise.
Note that the G28 Z check is for when I home that axis while the bed is hot.
this would work once before a restart on its own, So I needed to override M84 as well to tell it to home again.
However, I ran into one more issue, the belt mod's prime line macro. it's all in absolute positioning and would end up relative after homing and prime in the back right, so it needs to be wrapped in G91/G90
Do note that after all this I had to raise my Z offset by about 0.3mm
I'm hopeful this helps anyone with the same or similar mod on their 2.4. Though I wish that the code highlighting had a klipper macro specific one. LMK if I missed any potential problem areas or left some macros problematic due to this. I think PROBE_CALIBRATE might be one of them, but I'm not sure.
Anywho, the first issue was the homing override. I needed it to store when it homed and did the QGL already (directly overriding G28 causes issues usually) so I needed a macro to store a bool variable. Note that I had to use SET_KINEMATIC_POSITION as the feature to set that within the homing override directly would have it up in the air otherwise.
Code:
[gcode_macro home_vars]
variable_homed: 0
gcode:
[homing_override]
gcode:
{% if "Z" in params %}
G90
SET_KINEMATIC_POSITION Z=0
G0 X175 Y175 F7200
G28 Z
G91
{% endif %}
{% if printer["gcode_macro home_vars"].homed == 0 %}
SET_KINEMATIC_POSITION Z=0
G0 Z5 F1800
G28 X
G28 Y
G90
G0 X175 Y175 F7200
G28 Z
G91
QUAD_GANTRY_LEVEL
G90
G0 X175 Y175 F7200
G28 Z
G91
{% endif %}
SET_GCODE_VARIABLE MACRO=home_vars VARIABLE=homed VALUE=1
Note that the G28 Z check is for when I home that axis while the bed is hot.
this would work once before a restart on its own, So I needed to override M84 as well to tell it to home again.
Code:
[gcode_macro M84]
rename_existing: M84.1
gcode:
SET_GCODE_VARIABLE MACRO=home_vars VARIABLE=homed VALUE=0
M84.1 {rawparams}
However, I ran into one more issue, the belt mod's prime line macro. it's all in absolute positioning and would end up relative after homing and prime in the back right, so it needs to be wrapped in G91/G90
Code:
[gcode_macro PRIME_LINE]
gcode:
M117 Prime Line
G92 E0 ;Reset Extruder
G1 Z2.0 F3000 ;Move Z Axis up
G90
G1 X30 Y50 Z0.75 F5000 ;Move to start position
G1 X30 Y200.0 Z0.75 F1500 E25 ;Draw the first line
G1 X30 Y200.0 Z0.95 F1500 ;Move up a little
G1 X30 Y50 Z0.95 F1500 E25 ;Draw the second line
G1 X30 Y50 Z1.15 F1500 ;Move up a little
G1 X30 Y200 Z1.15 F1500 E25 ;Draw the thirdline
G1 X30 Y200 Z1.35 F1500 ;Move up a little
G1 X30 Y50 Z1.35 F1500 E25 ;Draw the thirdline
G1 X30 Y30 Z0.20 F1000 ;Lower To Wipe Nozzle Prevent Stringing
G92 E0 ;Reset Extruder
G91
Do note that after all this I had to raise my Z offset by about 0.3mm
I'm hopeful this helps anyone with the same or similar mod on their 2.4. Though I wish that the code highlighting had a klipper macro specific one. LMK if I missed any potential problem areas or left some macros problematic due to this. I think PROBE_CALIBRATE might be one of them, but I'm not sure.