Z move or not automatically_Z_Tilt_QGL - markniu/Bed_Distance_sensor GitHub Wiki

This klipper Macro is for the Z_tilt and QGL.

1, It will do tilt/QGL with z axis moving like normal probe sensor,because the bed may be much uneven at first.

2, then continue z tilt/QGL without z moving.

Here is a macro example for Z Tilt,just copy and paste them into your printer.cfg

[gcode_macro Z_TILT_ADJUST]
rename_existing: _Z_TILT_ADJUST
description:
gcode:
    #run z tilt with z move up and down at first
    BDSENSOR_SET QGL_TILT_PROBE=1 #set this 1 to enable z axis up and down
    BDSENSOR_SET COLLISION_HOMING=0
    _Z_TILT_ADJUST horizontal_move_z=6 retry_tolerance=1
    G28 Z0
    #run z tilt with no z move up and down
    BDSENSOR_SET QGL_TILT_PROBE=0 #set this 0 to disable z axis up and down while probe
    _Z_TILT_ADJUST horizontal_move_z=1 retry_tolerance=0.04
    #BDSENSOR_SET COLLISION_HOMING=1 #optional
    G28 Z0

for quad_gantry_level:

[gcode_macro QUAD_GANTRY_LEVEL]
rename_existing: _QUAD_GANTRY_LEVEL
description:
gcode:
    #run z tilt with z move up and down at first
    BDSENSOR_SET QGL_TILT_PROBE=1 #set this 1 to enable z axis up and down
    BDSENSOR_SET COLLISION_HOMING=0
    _QUAD_GANTRY_LEVEL  horizontal_move_z=6 retry_tolerance=1
    G28 Z0
    #run z tilt with no z move up and down
    BDSENSOR_SET QGL_TILT_PROBE=0 #set this 0 to disable z axis up and down while probe
    _QUAD_GANTRY_LEVEL horizontal_move_z=1 retry_tolerance=0.04
    #BDSENSOR_SET COLLISION_HOMING=1 #optional
    G28 Z0

Test video: https://www.youtube.com/watch?v=IZf-PunQ6v8