[gcode_macro _M401] ;needed a space here.
Got my M401 example from here: https://euclidprobe.github.io/06_klipper3.html
So here's what my M401 g-code probe attach looks like now:
#macro deploy klicky probe
[gcode_macro M401]
gcode:
G90
{action_respond_info("Entering M401")}
error_if_probe_deployed ; check to make sure that the probe is not already attached
_M401
[gcode_macro error_if_probe_deployed]
gcode:
QUERY_PROBE ; check probe status
do_error_if_probe_deployed ; logic check to verify probe is not already deployed
[gcode_macro do_error_if_probe_deployed]
gcode:
{% if not printer.probe.last_query %}
{action_raise_error("klicky Probe is already deployed - Remove and Return it to the dock")}
{% endif %}
#Macro to Deploy Bed Probe
[gcode_macro _M401] ;needed a space here before the _M401
gcode:
G90 ; use absolute coordinates
{% if printer.probe.last_query %}
G0 Z20 F3000 ; raise up to safe height
G0 X81 Y300 ; stop in front of dock
G0 X81 Y333 ; stop above dock
G0 Z15 F3000 ; lower onto the klicky to attach
G0 Y300 ; pull it from the dock
G0 Z20 F500 ; move up to elevation of Z20
{% endif %}
error_if_probe_not_deployed
{action_respond_info("Exiting M401")}
[gcode_macro error_if_probe_not_deployed]
gcode:
QUERY_PROBE
do_error_if_probe_not_deployed
[gcode_macro do_error_if_probe_not_deployed]
gcode:
{% if printer.probe.last_query %}
{action_raise_error("klicky Probe failed to deploy!")}
{% endif %}
And it seems to work. Comes in a little low, moving to the center of the bed after probing the z-pin.
A little higher would make it more comfortable.
Got my M401 example from here: https://euclidprobe.github.io/06_klipper3.html
So here's what my M401 g-code probe attach looks like now:
#macro deploy klicky probe
[gcode_macro M401]
gcode:
G90
{action_respond_info("Entering M401")}
error_if_probe_deployed ; check to make sure that the probe is not already attached
_M401
[gcode_macro error_if_probe_deployed]
gcode:
QUERY_PROBE ; check probe status
do_error_if_probe_deployed ; logic check to verify probe is not already deployed
[gcode_macro do_error_if_probe_deployed]
gcode:
{% if not printer.probe.last_query %}
{action_raise_error("klicky Probe is already deployed - Remove and Return it to the dock")}
{% endif %}
#Macro to Deploy Bed Probe
[gcode_macro _M401] ;needed a space here before the _M401
gcode:
G90 ; use absolute coordinates
{% if printer.probe.last_query %}
G0 Z20 F3000 ; raise up to safe height
G0 X81 Y300 ; stop in front of dock
G0 X81 Y333 ; stop above dock
G0 Z15 F3000 ; lower onto the klicky to attach
G0 Y300 ; pull it from the dock
G0 Z20 F500 ; move up to elevation of Z20
{% endif %}
error_if_probe_not_deployed
{action_respond_info("Exiting M401")}
[gcode_macro error_if_probe_not_deployed]
gcode:
QUERY_PROBE
do_error_if_probe_not_deployed
[gcode_macro do_error_if_probe_not_deployed]
gcode:
{% if printer.probe.last_query %}
{action_raise_error("klicky Probe failed to deploy!")}
{% endif %}
And it seems to work. Comes in a little low, moving to the center of the bed after probing the z-pin.
A little higher would make it more comfortable.