Microswitch based inductive probe replacement (Klicky Probe) (#351)
* Create README.md * initial sincronization * preparing for PR moved the files to the right directory removed space in filenames added the mod to the respective table * Update README.md added better and more recent photos * Update README.md corrected image paths * Update README.md added link to original repository * requested corrections removed some spaces from files corrected some spelling mistakes corrected the readme links updated the AB mount for printabillity * corrected robust AB mount updated robust AB mount from oc_geek on usermods * more corrections updated zipfile with up to date files corrected a spelling mistake
|
|
@ -0,0 +1,5 @@
|
|||
CAD files
|
||||
|
||||
- Version 0.1 - initial release
|
||||
- Version 0.2 - Revised probe and dock to improve the docking fit, remaining components are compatible
|
||||
- Thanks to oc_geek for improving the probing of a badly tilted gantry (10º) and the probe and dock attachment, it's much better now
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Voron V2.4:
|
||||
If using the probe instead of a physical Z endstop please remember to comment out the homing override from your printer.cfg and use the klicky-probe.cfg one.
|
||||
For using the Klicky probe as a probe only it is not necessary to remove anything from your existent configuration, it is better to comment the homing override on klicky-probe.cfg
|
||||
|
||||
Voron V1.8:
|
||||
Due to the fact that the probe may hit the bed on the v1.8 when going to the physical Z endstop, please use the homing override included in klicky-probe.cfg instead of the one that you currently have in your printer.cfg .
|
||||
|
||||
You may have a faster PRINT_START if you use Attach_Probe_Lock at the beggining and Dock_Probe_Unlock at the end.
|
||||
|
|
@ -0,0 +1,634 @@
|
|||
# This macro was provided by discord user Garrettwp to whom i give my thanks for sharing it with me.
|
||||
# The v1.8 version template was provided by Yeri, who helped to debug prior to release, thanks again.
|
||||
# I have tweaked it a lot.
|
||||
#
|
||||
# this macro is based on the great Annex magprobe dockable probe macros "#Originally developed by Mental, modified for better use on K-series printers by RyanG and Trails"
|
||||
# that macro can be found here https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/blob/master/All_Printers/Microswitch_Probe/Klipper_Macros/dockable_probe_macros.cfg
|
||||
#
|
||||
# by standing on the shoulders of giants, lets see if we can see further
|
||||
|
||||
[gcode_macro User_Variables]
|
||||
variable_verbose: True # Enable verbose output
|
||||
variable_travel_speed: 200 # how fast all other travel moves will be performed when running these macros
|
||||
variable_dock_speed: 50 # how fast should the toolhead move when docking the probe for the final movement
|
||||
variable_release_speed: 100 # how fast should the toolhead move to release the hold of the magnets after docking
|
||||
variable_z_drop_speed: 20 # how fast the z will lower when moving to the z location to clear the probe
|
||||
variable_home_z_height: 15 # Z when homing
|
||||
|
||||
# if a separate Z endstop switch is in
|
||||
# use, specify the coordinates of the switch here (Voron).
|
||||
# Set to 0 to have the probe move to center of bed
|
||||
variable_z_endstop_x: 304
|
||||
variable_z_endstop_y: 291
|
||||
#variable_z_endstop_x: 0
|
||||
#variable_z_endstop_y: 0
|
||||
|
||||
# location to park the toolhead
|
||||
variable_park_toolhead: False # Enable toolhead parking
|
||||
variable_parkposition_x: 150
|
||||
variable_parkposition_y: 150
|
||||
variable_parkposition_z: 30
|
||||
|
||||
#dock location
|
||||
variable_docklocation_x: 39 # X Dock position
|
||||
variable_docklocation_y: 304 # Y Dock position
|
||||
variable_docklocation_z: 15 # Z dock position
|
||||
variable_dockarmslenght: 60 # Dock arms lenght, toolhead movement necessary to clear the dock arms
|
||||
|
||||
#Umbilical to help untangle the umbilical in difficult situations
|
||||
variable_umbilical_x: 15 #X umbilical position
|
||||
variable_umbilical_y: 15 #Y umbilical position
|
||||
variable_umbilical: False #should we untabgle the umbilical
|
||||
|
||||
# Do not modify below
|
||||
gcode:
|
||||
{% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %}
|
||||
{% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %}
|
||||
{% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %}
|
||||
{% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %}
|
||||
{% set Oz = printer['configfile'].config["probe"]["z_offset"]|float %}
|
||||
|
||||
# if docklocation_z is zero, use Home Z height for safety
|
||||
{% if docklocation_z == 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=docklocation_z VALUE={ home_z_height }
|
||||
{% endif %}
|
||||
|
||||
# If x, y coordinates are set for z endstop, assign them
|
||||
{% if z_endstop_x != 0 or z_endstop_y != 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_x VALUE={ z_endstop_x }
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_y VALUE={ z_endstop_y }
|
||||
|
||||
# if no x, y coordinates for z endstop, assume probe is endstop and move toolhead to center of bed
|
||||
{% else %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_x VALUE={ (Mx * 0.5) - Ox }
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_y VALUE={ (My * 0.5) - Oy }
|
||||
{% endif %}
|
||||
|
||||
|
||||
[gcode_macro Probe_Variables]
|
||||
variable_probe_attached: False
|
||||
variable_probe_state: False
|
||||
variable_probe_lock: False
|
||||
variable_z_endstop_x: 0
|
||||
variable_z_endstop_y: 0
|
||||
gcode:
|
||||
|
||||
|
||||
[gcode_macro Homing_Variables]
|
||||
default_parameter_reset: 0
|
||||
gcode:
|
||||
{% set R = params.RESET %}
|
||||
|
||||
{% if R %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
{% endif %}
|
||||
|
||||
# Attach probe and lock it
|
||||
[gcode_macro Attach_Probe_Lock]
|
||||
gcode:
|
||||
Attach_Probe
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ True }
|
||||
|
||||
# Attach probe and lock it
|
||||
[gcode_macro Dock_Probe_Unlock]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
Dock_Probe
|
||||
|
||||
# Attach Probe Routine
|
||||
[gcode_macro Attach_Probe]
|
||||
gcode:
|
||||
# Get probe attach status
|
||||
{% set P = printer["gcode_macro Probe_Variables"].probe_attached %}
|
||||
{% set L = printer["gcode_macro Probe_Variables"].probe_lock %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# Get Docking location
|
||||
{% set Dx = printer["gcode_macro User_Variables"].docklocation_x %}
|
||||
{% set Dy = printer["gcode_macro User_Variables"].docklocation_y %}
|
||||
{% set Dz = printer["gcode_macro User_Variables"].docklocation_z %}
|
||||
{% set Da = printer["gcode_macro User_Variables"].dockarmslenght %}
|
||||
# Safe Z for travel
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
#Set speed
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
|
||||
M400 # mandatory to save the new safe position
|
||||
#allows the docking position to be independent of the Z offset, necessary for bed mounted probes
|
||||
SAVE_GCODE_STATE name=_attachProbe
|
||||
SET_GCODE_OFFSET Z=0
|
||||
|
||||
# if x and y are not homed
|
||||
{% if not 'xy' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X and Y Axis First!") }
|
||||
|
||||
# If probe not attached and locked
|
||||
{% elif not P and not L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Attaching Probe") }
|
||||
{% endif %}
|
||||
G90
|
||||
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Resetting Z position to zero") }
|
||||
{% endif %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
{% endif %}
|
||||
|
||||
{% if (printer.toolhead.position.z < Hzh) %}
|
||||
G1 Z{Hzh} F1200
|
||||
{% endif %}
|
||||
Umbilical_Path
|
||||
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} F{St}
|
||||
# pickup from Probe location
|
||||
G1 X{Dx} Y{Dy} F1800
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} F6000
|
||||
|
||||
Park_Toolhead
|
||||
|
||||
CheckProbe action=attach
|
||||
|
||||
{% elif L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe locked!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe attached, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% else %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe already attached!") }
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# Probe attached, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
# Dock Probe Routine
|
||||
[gcode_macro Dock_Probe]
|
||||
gcode:
|
||||
# Get probe attach status
|
||||
{% set P = printer["gcode_macro Probe_Variables"].probe_attached %}
|
||||
{% set L = printer["gcode_macro Probe_Variables"].probe_lock %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# Get Docking location
|
||||
{% set Dx = printer["gcode_macro User_Variables"].docklocation_x %}
|
||||
{% set Dy = printer["gcode_macro User_Variables"].docklocation_y %}
|
||||
{% set Dz = printer["gcode_macro User_Variables"].docklocation_z %}
|
||||
{% set Da = printer["gcode_macro User_Variables"].dockarmslenght %}
|
||||
# Safe Z for travel
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
# Set speed
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set Sd = printer["gcode_macro User_Variables"].dock_speed * 60 %}
|
||||
{% set Sr = printer["gcode_macro User_Variables"].release_speed * 60 %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
|
||||
M400 # mandatory to save the new safe position
|
||||
#allows the docking position to be independent of the Z offset, necessary for bed mounted probes
|
||||
SAVE_GCODE_STATE name=_dockProbe
|
||||
SET_GCODE_OFFSET Z=0
|
||||
|
||||
{% if not 'xyz' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X, Y and Z Axis First!") }
|
||||
|
||||
# If probe not attached and not locked
|
||||
{% elif P and not L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Docking Probe") }
|
||||
{% endif %}
|
||||
G90
|
||||
|
||||
{% if (printer.toolhead.position.z < Hzh) %}
|
||||
G1 Z{Hzh} F{Sz}
|
||||
{% endif %}
|
||||
|
||||
Umbilical_Path
|
||||
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} F{St}
|
||||
# Drop Probe to Probe location
|
||||
G1 X{Dx} Y{Dy} F{Sd}
|
||||
# Probe decoupling
|
||||
G1 X{Dx|int + 40} Y{Dy} F{Sr}
|
||||
G1 X{Dx|int + 40} Y{Dy|int - 40} F{St}
|
||||
|
||||
Park_Toolhead
|
||||
|
||||
CheckProbe action=dock
|
||||
|
||||
{% elif L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe locked!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe docked, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% else %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe already docked!") }
|
||||
{% endif %}
|
||||
# Probe docked, do nothing
|
||||
CheckProbe action=query
|
||||
{% endif %}
|
||||
#reverts to the original Z offset
|
||||
RESTORE_GCODE_STATE name=_dockProbe
|
||||
|
||||
|
||||
# Quad Gantry Level
|
||||
#[gcode_macro QUAD_GANTRY_LEVEL]
|
||||
#rename_existing: _QUAD_GANTRY_LEVEL
|
||||
#gcode:
|
||||
# {% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# {% if V %}
|
||||
# { action_respond_info("QG Level") }
|
||||
# {% endif %}
|
||||
#
|
||||
# CheckProbe action=query
|
||||
# Attach_Probe
|
||||
#
|
||||
# _QUAD_GANTRY_LEVEL {% for p in params
|
||||
# %}{'%s=%s ' % (p, params[p])}{%
|
||||
# endfor %}
|
||||
#
|
||||
# Dock_Probe
|
||||
|
||||
|
||||
# Z Tilt Adjust
|
||||
[gcode_macro Z_TILT_ADJUST]
|
||||
rename_existing: _Z_TILT_ADJUST
|
||||
gcode:
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Z Tilt Adjust") }
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
_Z_TILT_ADJUST {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
Dock_Probe
|
||||
G28 Z0
|
||||
|
||||
|
||||
# Screws Tilt Adjust
|
||||
[gcode_macro SCREWS_TILT_CALCULATE]
|
||||
rename_existing: _SCREWS_TILT_CALCULATE
|
||||
gcode:
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Screws Tilt Adjust") }
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
_SCREWS_TILT_CALCULATE {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
# Bed Mesh Calibrate
|
||||
[gcode_macro BED_MESH_CALIBRATE]
|
||||
rename_existing: _BED_MESH_CALIBRATE
|
||||
gcode:
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Bed Mesh Calibrate") }
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
_BED_MESH_CALIBRATE {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
|
||||
# Probe Calibrate
|
||||
[gcode_macro PROBE_CALIBRATE]
|
||||
rename_existing: _PROBE_CALIBRATE
|
||||
gcode:
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed %}
|
||||
|
||||
# Go to Z safe distance before saving location in order to
|
||||
# avoid crashing the probe on the bed when coming back
|
||||
G1 Z{Hzh} F{Sz}
|
||||
M400 # mandatory to save the new safe position
|
||||
SAVE_GCODE_STATE NAME=_original_nozzle_location
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
# Restore nozzle location to probe the right place
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
_PROBE_CALIBRATE {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
# Restore nozzle location again at the end
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
# Probe Accuracy
|
||||
[gcode_macro PROBE_ACCURACY]
|
||||
rename_existing: _PROBE_ACCURACY
|
||||
gcode:
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed %}
|
||||
|
||||
# Go to Z safe distance before saving location in order to
|
||||
# avoid crashing the probe on the bed when coming back
|
||||
G1 Z{Hzh} F{Sz}
|
||||
M400 # mandatory to save the new safe position
|
||||
SAVE_GCODE_STATE NAME=_original_nozzle_location
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
# Restore nozzle location to probe the right place
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
_PROBE_ACCURACY {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
|
||||
# Restore nozzle location again at the end
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
|
||||
# enable to SET_KINEMATIC_POSITION for Z hop
|
||||
[force_move]
|
||||
enable_force_move: True
|
||||
|
||||
# Homing Override
|
||||
[homing_override]
|
||||
axes: xyz
|
||||
gcode:
|
||||
# collect user state variables
|
||||
User_Variables
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% set P = printer["gcode_macro Probe_Variables"].probe_attached %}
|
||||
{% set L = printer["gcode_macro Probe_Variables"].probe_lock %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
G90
|
||||
G0 Z{Hzh} F600
|
||||
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
|
||||
# reset parameters
|
||||
{% set X, Y, Z = False, False, False %}
|
||||
|
||||
# which axes have been requested for homing
|
||||
{% if not 'X' in params
|
||||
and not 'Y' in params
|
||||
and not 'Z' in params %}
|
||||
|
||||
{% set X, Y, Z = True, True, True %}
|
||||
|
||||
{% else %}
|
||||
{% if 'X' in params %}
|
||||
{% set X = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'Y' in params %}
|
||||
{% set Y = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'Z' in params %}
|
||||
{% set Z = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'X' in params
|
||||
and 'Y' in params
|
||||
and 'Z' in params %}
|
||||
# reset homing state variables
|
||||
# if homing all axes
|
||||
Homing_Variables reset=1
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
# Home x
|
||||
{% if X %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing X") }
|
||||
{% endif %}
|
||||
|
||||
G28 X0
|
||||
|
||||
{% endif %}
|
||||
|
||||
# Home y
|
||||
{% if Y %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing Y") }
|
||||
{% endif %}
|
||||
|
||||
G28 Y0
|
||||
|
||||
{% endif %}
|
||||
|
||||
# Home z
|
||||
{% if Z %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing Z") }
|
||||
{% endif %}
|
||||
|
||||
# if probe is configured as endstop, attach it
|
||||
{% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %}
|
||||
{% if V %}
|
||||
{ action_respond_info("auto-attaching Probe") }
|
||||
{% endif %}
|
||||
Attach_Probe
|
||||
# if probe is attached and not used for Z Homing, dock it (1.8 Z endstop)
|
||||
{% elif P %}
|
||||
{% if V %}
|
||||
{ action_respond_info("auto-docking Probe for Z endstop") }
|
||||
{% endif %}
|
||||
#remove the probe lock if is use
|
||||
{% if L %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
Dock_Probe
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ True }
|
||||
{% else %}
|
||||
Dock_Probe
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Home_Z
|
||||
|
||||
# if probe is configured as endstop, dock it
|
||||
{% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %}
|
||||
{% if V %}
|
||||
{ action_respond_info("auto-docking Probe") }
|
||||
{% endif %}
|
||||
Dock_Probe
|
||||
# if probe is Locked and not attached, attach it (was removed for 1.8 Z endstop)
|
||||
{% elif L and not P %}
|
||||
{% if V %}
|
||||
{ action_respond_info("auto-attaching Probe after Z endstop") }
|
||||
{% endif %}
|
||||
#attach the probe
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
Attach_Probe
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ True }
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
|
||||
# park the toolhead
|
||||
Park_Toolhead
|
||||
|
||||
#g0 x150 y150 z30
|
||||
|
||||
# umbilical path setup
|
||||
[gcode_macro Umbilical_Path]
|
||||
gcode:
|
||||
{% set Ux = printer["gcode_macro User_Variables"].umbilical_x %}
|
||||
{% set Uy = printer["gcode_macro User_Variables"].umbilical_y %}
|
||||
{% set U = printer["gcode_macro User_Variables"].umbilical %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
|
||||
{% if U %}
|
||||
# Used to give the umbilical a better path to follow and coil properly if dock is tight in space
|
||||
G1 X{Ux} Y{Uy} Z{Hzh} F{St}
|
||||
{% endif %}
|
||||
|
||||
|
||||
# Home Z Routine
|
||||
[gcode_macro Home_Z]
|
||||
gcode:
|
||||
{% set Zx = printer["gcode_macro Probe_Variables"].z_endstop_x %}
|
||||
{% set Zy = printer["gcode_macro Probe_Variables"].z_endstop_y %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
|
||||
|
||||
|
||||
# if x and y are not homed yet, raise error
|
||||
{% if not 'xy' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X and Y Axis First!") }
|
||||
|
||||
{% else %}
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Resetting Z position to zero") }
|
||||
{% endif %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
{% endif %}
|
||||
|
||||
# move tool to safe homing position and home Z axis
|
||||
# location of z endstop
|
||||
G1 X{Zx} Y{Zy} Z{Hzh} F{St}
|
||||
|
||||
G28 Z0
|
||||
G1 Z{Hzh} F{Sz}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
# check to see if probe is where it is supposed to be after
|
||||
# attaching/docking maneuver and set homing error or shutdown
|
||||
[gcode_macro CheckProbe]
|
||||
variable_probe_state: 0
|
||||
default_parameter_action:
|
||||
gcode:
|
||||
Query_Probe
|
||||
SetProbeState action={ ACTION }
|
||||
|
||||
|
||||
# due to how templates are evaluated, we have query endstops in one
|
||||
# macro and call another macro to make decisions based on the result
|
||||
[gcode_macro SetProbeState]
|
||||
default_parameter_action:
|
||||
gcode:
|
||||
{% set P = printer.probe.last_query %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
|
||||
# If triggered (true), probe not attached
|
||||
{% if P %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_attached VALUE={ False }
|
||||
|
||||
# If not triggered (false), probe attached
|
||||
{% else %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_attached VALUE={ True }
|
||||
{% endif %}
|
||||
|
||||
{% if params.ACTION == 'query' %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_state VALUE={ P }
|
||||
{% endif %}
|
||||
|
||||
# if probe fails to attach/detach
|
||||
# if not docked
|
||||
{% if (not P and params.ACTION == 'dock') %}
|
||||
{ action_raise_error("Probe dock failed!") }
|
||||
{% endif %}
|
||||
|
||||
# if not attached
|
||||
{% if P and params.ACTION == 'attach' %}
|
||||
{ action_raise_error("Probe attach failed!") }
|
||||
{% endif %}
|
||||
|
||||
# Override M84 to reset homing state if motors are disabled.
|
||||
[gcode_macro M84]
|
||||
rename_existing: M84.1
|
||||
gcode:
|
||||
Homing_Variables reset=1
|
||||
M84.1
|
||||
|
||||
|
||||
# Override M18 to reset homing state if motors are disabled.
|
||||
[gcode_macro M18]
|
||||
rename_existing: M18.1
|
||||
gcode:
|
||||
Homing_Variables reset=1
|
||||
M18.1
|
||||
|
||||
|
||||
# Park Toolhead Routine
|
||||
[gcode_macro Park_Toolhead]
|
||||
gcode:
|
||||
{% set P = printer["gcode_macro User_Variables"].park_toolhead %}
|
||||
{% set Px = printer["gcode_macro User_Variables"].parkposition_x %}
|
||||
{% set Py = printer["gcode_macro User_Variables"].parkposition_y %}
|
||||
{% set Pz = printer["gcode_macro User_Variables"].parkposition_z %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set H = printer["gcode_macro Homing_Variables"].homing %}
|
||||
{% set Hx = printer["gcode_macro Homing_Variables"].homed_x %}
|
||||
{% set Hy = printer["gcode_macro Homing_Variables"].homed_y %}
|
||||
{% set Hz = printer["gcode_macro Homing_Variables"].homed_z %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
|
||||
{% if (P and Hx and Hy and Hz) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Parking Toolhead") }
|
||||
{% endif %}
|
||||
G90
|
||||
G1 X{Px} Y{Py} Z{Pz} F{St}
|
||||
{% endif %}
|
||||
|
|
@ -0,0 +1,594 @@
|
|||
# This macro was provided by discord user Garrettwp to whom i give my thanks for sharing it with me.
|
||||
# I have tweaked it a lot.
|
||||
#
|
||||
# this macro is based on the great Annex magprobe dockable probe macros "#Originally developed by Mental, modified for better use on K-series printers by RyanG and Trails"
|
||||
# that macro can be found here https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/blob/master/All_Printers/Microswitch_Probe/Klipper_Macros/dockable_probe_macros.cfg
|
||||
#
|
||||
# by standing on the shoulders of giants, lets see if we can see further
|
||||
|
||||
[gcode_macro User_Variables]
|
||||
variable_verbose: True # Enable verbose output
|
||||
variable_travel_speed: 200 # how fast all other travel moves will be performed when running these macros
|
||||
variable_dock_speed: 50 # how fast should the toolhead move when docking the probe for the final movement
|
||||
variable_release_speed: 100 # how fast should the toolhead move to release the hold of the magnets after docking
|
||||
variable_z_drop_speed: 20 # how fast the z will lower when moving to the z location to clear the probe
|
||||
variable_home_z_height: 15 # Z when homing
|
||||
|
||||
# if a separate Z endstop switch is in
|
||||
# use, specify the coordinates of the switch here (Voron).
|
||||
# Set to 0 to have the probe move to center of bed
|
||||
variable_z_endstop_x: 92.5
|
||||
variable_z_endstop_y: 303.5
|
||||
#variable_z_endstop_x: 0
|
||||
#variable_z_endstop_y: 0
|
||||
|
||||
# location to park the toolhead
|
||||
variable_park_toolhead: False # Enable toolhead parking
|
||||
variable_parkposition_x: 150
|
||||
variable_parkposition_y: 150
|
||||
variable_parkposition_z: 30
|
||||
|
||||
#dock location
|
||||
variable_docklocation_x: 45 # X Dock position
|
||||
variable_docklocation_y: 305 # Y Dock position
|
||||
variable_docklocation_z: 15 # Z dock position
|
||||
variable_dockarmslenght: 30 # Dock arms lenght, toolhead movement necessary to clear the dock arms
|
||||
|
||||
#Umbilical to help untangle the umbilical in difficult situations
|
||||
variable_umbilical_x: 15 #X umbilical position
|
||||
variable_umbilical_y: 15 #Y umbilical position
|
||||
variable_umbilical: False #should we untabgle the umbilical
|
||||
|
||||
# Do not modify below
|
||||
gcode:
|
||||
{% set Mx = printer['configfile'].config["stepper_x"]["position_max"]|float %}
|
||||
{% set My = printer['configfile'].config["stepper_y"]["position_max"]|float %}
|
||||
{% set Ox = printer['configfile'].config["probe"]["x_offset"]|float %}
|
||||
{% set Oy = printer['configfile'].config["probe"]["y_offset"]|float %}
|
||||
{% set Oz = printer['configfile'].config["probe"]["z_offset"]|float %}
|
||||
|
||||
# if docklocation_z is zero, use Home Z height for safety
|
||||
{% if docklocation_z == 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=docklocation_z VALUE={ home_z_height }
|
||||
{% endif %}
|
||||
|
||||
# If x, y coordinates are set for z endstop, assign them
|
||||
{% if z_endstop_x != 0 or z_endstop_y != 0 %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_x VALUE={ z_endstop_x }
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_y VALUE={ z_endstop_y }
|
||||
|
||||
# if no x, y coordinates for z endstop, assume probe is endstop and move toolhead to center of bed
|
||||
{% else %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_x VALUE={ (Mx * 0.5) - Ox }
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=z_endstop_y VALUE={ (My * 0.5) - Oy }
|
||||
{% endif %}
|
||||
|
||||
|
||||
[gcode_macro Probe_Variables]
|
||||
variable_probe_attached: False
|
||||
variable_probe_state: False
|
||||
variable_probe_lock: False
|
||||
variable_z_endstop_x: 0
|
||||
variable_z_endstop_y: 0
|
||||
gcode:
|
||||
|
||||
|
||||
[gcode_macro Homing_Variables]
|
||||
default_parameter_reset: 0
|
||||
gcode:
|
||||
{% set R = params.RESET %}
|
||||
|
||||
{% if R %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
{% endif %}
|
||||
|
||||
# Attach probe and lock it
|
||||
[gcode_macro Attach_Probe_Lock]
|
||||
gcode:
|
||||
Attach_Probe
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ True }
|
||||
|
||||
|
||||
# Attach probe and lock it
|
||||
[gcode_macro Dock_Probe_Unlock]
|
||||
gcode:
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_lock VALUE={ False }
|
||||
Dock_Probe
|
||||
|
||||
# Attach Probe Routine
|
||||
[gcode_macro Attach_Probe]
|
||||
gcode:
|
||||
# Get probe attach status
|
||||
{% set P = printer["gcode_macro Probe_Variables"].probe_attached %}
|
||||
{% set L = printer["gcode_macro Probe_Variables"].probe_lock %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# Get Docking location
|
||||
{% set Dx = printer["gcode_macro User_Variables"].docklocation_x %}
|
||||
{% set Dy = printer["gcode_macro User_Variables"].docklocation_y %}
|
||||
{% set Dz = printer["gcode_macro User_Variables"].docklocation_z %}
|
||||
{% set Da = printer["gcode_macro User_Variables"].dockarmslenght %}
|
||||
# Safe Z for travel
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
#Set speed
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
|
||||
#prior to saving actual position, check if its necessary to move to a safe Z
|
||||
#that has enought overhead for the attached probe
|
||||
{% if (printer.toolhead.position.z < Hzh) %}
|
||||
G1 Z{Hzh} F1200
|
||||
{% endif %}
|
||||
M400 # mandatory to save the new safe position
|
||||
#allows the docking position to be independent of the Z offset, necessary for bed mounted probes
|
||||
SAVE_GCODE_STATE name=_attachProbe
|
||||
SET_GCODE_OFFSET Z=0
|
||||
|
||||
# if x and y are not homed
|
||||
{% if not 'xy' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X and Y Axis First!") }
|
||||
|
||||
# If probe not attached and locked
|
||||
{% elif not P and not L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Attaching Probe") }
|
||||
{% endif %}
|
||||
G90
|
||||
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Resetting Z position to zero") }
|
||||
{% endif %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
{% endif %}
|
||||
|
||||
{% if (printer.toolhead.position.z < Hzh) %}
|
||||
G1 Z{Hzh} F1200
|
||||
{% endif %}
|
||||
|
||||
Umbilical_Path
|
||||
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} Z{Hzh} F{St}
|
||||
#lower to Z dock
|
||||
G1 Z{Dz} F600
|
||||
# pickup from Probe location
|
||||
G1 X{Dx} Y{Dy} F1800
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} F6000
|
||||
#Go to Z safe distance
|
||||
G1 Z{Hzh} F600
|
||||
Park_Toolhead
|
||||
|
||||
CheckProbe action=attach
|
||||
|
||||
{% elif L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe locked!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe attached, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% else %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe already attached!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe attached, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% endif %}
|
||||
#reverts to the original Z offset
|
||||
RESTORE_GCODE_STATE name=_attachProbe
|
||||
|
||||
|
||||
# Dock Probe Routine
|
||||
[gcode_macro Dock_Probe]
|
||||
gcode:
|
||||
# Get probe attach status
|
||||
{% set P = printer["gcode_macro Probe_Variables"].probe_attached %}
|
||||
{% set L = printer["gcode_macro Probe_Variables"].probe_lock %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# Get Docking location
|
||||
{% set Dx = printer["gcode_macro User_Variables"].docklocation_x %}
|
||||
{% set Dy = printer["gcode_macro User_Variables"].docklocation_y %}
|
||||
{% set Dz = printer["gcode_macro User_Variables"].docklocation_z %}
|
||||
{% set Da = printer["gcode_macro User_Variables"].dockarmslenght %}
|
||||
# Safe Z for travel
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
# Set speed
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set Sd = printer["gcode_macro User_Variables"].dock_speed * 60 %}
|
||||
{% set Sr = printer["gcode_macro User_Variables"].release_speed * 60 %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
|
||||
M400 # mandatory to save the new safe position
|
||||
#allows the docking position to be independent of the Z offset, necessary for bed mounted probes
|
||||
SAVE_GCODE_STATE name=_dockProbe
|
||||
SET_GCODE_OFFSET Z=0
|
||||
|
||||
{% if not 'xyz' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X, Y and Z Axis First!") }
|
||||
|
||||
# If probe not attached and not locked
|
||||
{% elif P and not L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Docking Probe") }
|
||||
{% endif %}
|
||||
G90
|
||||
|
||||
{% if (printer.toolhead.position.z < Hzh) %}
|
||||
G1 Z{Hzh} F{Sz}
|
||||
{% endif %}
|
||||
|
||||
Umbilical_Path
|
||||
|
||||
# Probe entry location
|
||||
G1 X{Dx} Y{Dy|int - Da|int} Z{Hzh} F{St}
|
||||
#lower to Z dock
|
||||
G1 Z{Dz} F{Sz}
|
||||
# Drop Probe to Probe location
|
||||
G1 X{Dx} Y{Dy} F{Sd}
|
||||
# Probe decoupling
|
||||
G1 X{Dx|int + 40} Y{Dy} F{Sr}
|
||||
#Go to Z safe distance
|
||||
G1 X{Dx|int + 40} Y{Dy|int - 5} Z{Hzh} F{St}
|
||||
|
||||
Park_Toolhead
|
||||
|
||||
CheckProbe action=dock
|
||||
|
||||
{% elif L %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe locked!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe docked, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% else %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Probe already docked!") }
|
||||
{% endif %}
|
||||
|
||||
# Probe docked, do nothing
|
||||
CheckProbe action=query
|
||||
|
||||
{% endif %}
|
||||
#reverts to the original Z offset
|
||||
RESTORE_GCODE_STATE name=_dockProbe
|
||||
|
||||
|
||||
|
||||
# Quad Gantry Level
|
||||
[gcode_macro QUAD_GANTRY_LEVEL]
|
||||
rename_existing: _QUAD_GANTRY_LEVEL
|
||||
gcode:
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% if V %}
|
||||
{ action_respond_info("QG Level") }
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
_QUAD_GANTRY_LEVEL {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
Dock_Probe
|
||||
|
||||
|
||||
# Z Tilt Adjust
|
||||
#[gcode_macro Z_TILT_ADJUST]
|
||||
#rename_existing: _Z_TILT_ADJUST
|
||||
#gcode:
|
||||
# {% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# {% if V %}
|
||||
# { action_respond_info("Z Tilt Adjust") }
|
||||
# {% endif %}
|
||||
#
|
||||
# CheckProbe action=query
|
||||
# Attach_Probe
|
||||
#
|
||||
# _Z_TILT_ADJUST {% for p in params
|
||||
# %}{'%s=%s ' % (p, params[p])}{%
|
||||
# endfor %}
|
||||
# G28 Z0
|
||||
# Dock_Probe
|
||||
|
||||
|
||||
# Screws Tilt Adjust
|
||||
#gcode_macro SCREWS_TILT_CALCULATE]
|
||||
#rename_existing: _SCREWS_TILT_CALCULATE
|
||||
#gcode:
|
||||
# {% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
# {% if V %}
|
||||
# { action_respond_info("Screws Tilt Adjust") }
|
||||
# {% endif %}
|
||||
#
|
||||
# CheckProbe action=query
|
||||
# Attach_Probe
|
||||
#
|
||||
# _SCREWS_TILT_CALCULATE {% for p in params
|
||||
# %}{'%s=%s ' % (p, params[p])}{%
|
||||
# endfor %}
|
||||
#
|
||||
# Dock_Probe
|
||||
|
||||
# Bed Mesh Calibrate
|
||||
[gcode_macro BED_MESH_CALIBRATE]
|
||||
rename_existing: _BED_MESH_CALIBRATE
|
||||
gcode:
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Bed Mesh Calibrate") }
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
_BED_MESH_CALIBRATE {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
|
||||
# Probe Calibrate
|
||||
[gcode_macro PROBE_CALIBRATE]
|
||||
rename_existing: _PROBE_CALIBRATE
|
||||
gcode:
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed %}
|
||||
|
||||
# Go to Z safe distance before saving location in order to
|
||||
# avoid crashing the probe on the bed when coming back
|
||||
G1 Z{Hzh} F{Sz}
|
||||
M400 # mandatory to save the new safe position
|
||||
SAVE_GCODE_STATE NAME=_original_nozzle_location
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
# Restore nozzle location to probe the right place
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
_PROBE_CALIBRATE {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
# Restore nozzle location again at the end
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
|
||||
# Probe Accuracy
|
||||
[gcode_macro PROBE_ACCURACY]
|
||||
rename_existing: _PROBE_ACCURACY
|
||||
gcode:
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed %}
|
||||
|
||||
# Go to Z safe distance before saving location in order to
|
||||
# avoid crashing the probe on the bed when coming back
|
||||
G1 Z{Hzh} F{Sz}
|
||||
M400 # mandatory to save the new safe position
|
||||
SAVE_GCODE_STATE NAME=_original_nozzle_location
|
||||
|
||||
CheckProbe action=query
|
||||
Attach_Probe
|
||||
|
||||
# Restore nozzle location to probe the right place
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
_PROBE_ACCURACY {% for p in params
|
||||
%}{'%s=%s ' % (p, params[p])}{%
|
||||
endfor %}
|
||||
|
||||
Dock_Probe
|
||||
|
||||
# Restore nozzle location again at the end
|
||||
RESTORE_GCODE_STATE NAME=_original_nozzle_location MOVE=1 MOVE_SPEED={St}
|
||||
|
||||
|
||||
# enable to SET_KINEMATIC_POSITION for Z hop
|
||||
[force_move]
|
||||
enable_force_move: True
|
||||
|
||||
# Homeing Override
|
||||
[homing_override]
|
||||
axes: xyz
|
||||
gcode:
|
||||
# collect user state variables
|
||||
User_Variables
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
G90
|
||||
G0 Z{Hzh} F600
|
||||
{% endif %}
|
||||
|
||||
CheckProbe action=query
|
||||
|
||||
# reset parameters
|
||||
{% set X, Y, Z = False, False, False %}
|
||||
|
||||
# which axes have been requested for homing
|
||||
{% if not 'X' in params
|
||||
and not 'Y' in params
|
||||
and not 'Z' in params %}
|
||||
|
||||
{% set X, Y, Z = True, True, True %}
|
||||
|
||||
{% else %}
|
||||
{% if 'X' in params %}
|
||||
{% set X = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'Y' in params %}
|
||||
{% set Y = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'Z' in params %}
|
||||
{% set Z = True %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'X' in params
|
||||
and 'Y' in params
|
||||
and 'Z' in params %}
|
||||
# reset homing state variables
|
||||
# if homing all axes
|
||||
Homing_Variables reset=1
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
# Home x
|
||||
{% if X %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing X") }
|
||||
{% endif %}
|
||||
G28 X0
|
||||
{% endif %}
|
||||
|
||||
# Home y
|
||||
{% if Y %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing Y") }
|
||||
{% endif %}
|
||||
G28 Y0
|
||||
{% endif %}
|
||||
|
||||
# Home z
|
||||
{% if Z %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Homing Z") }
|
||||
{% endif %}
|
||||
|
||||
# if probe is configured as endstop, attach it
|
||||
{% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %}
|
||||
Attach_Probe
|
||||
{% endif %}
|
||||
|
||||
Home_Z
|
||||
|
||||
|
||||
# if probe is configured as endstop, dock it
|
||||
{% if printer['configfile'].config["stepper_z"]["endstop_pin"] == 'probe:z_virtual_endstop' %}
|
||||
Dock_Probe
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
CheckProbe action=query
|
||||
|
||||
# park the toolhead
|
||||
Park_Toolhead
|
||||
|
||||
# umbilical path setup
|
||||
[gcode_macro Umbilical_Path]
|
||||
gcode:
|
||||
{% set Ux = printer["gcode_macro User_Variables"].umbilical_x %}
|
||||
{% set Uy = printer["gcode_macro User_Variables"].umbilical_y %}
|
||||
{% set U = printer["gcode_macro User_Variables"].umbilical %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
|
||||
{% if U %}
|
||||
# Used to give the umbilical a better path to follow and coil properly if dock is tight in space
|
||||
G1 X{Ux} Y{Uy} Z{Hzh} F{St}
|
||||
{% endif %}
|
||||
|
||||
|
||||
# Home Z Routine
|
||||
[gcode_macro Home_Z]
|
||||
gcode:
|
||||
{% set Zx = printer["gcode_macro Probe_Variables"].z_endstop_x %}
|
||||
{% set Zy = printer["gcode_macro Probe_Variables"].z_endstop_y %}
|
||||
{% set Hzh = printer["gcode_macro User_Variables"].home_z_height|float %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set Sz = printer["gcode_macro User_Variables"].z_drop_speed * 60 %}
|
||||
|
||||
# if x and y are not homed yet, raise error
|
||||
{% if not 'xy' in printer.toolhead.homed_axes %}
|
||||
{ action_raise_error("Must Home X and Y Axis First!") }
|
||||
|
||||
{% else %}
|
||||
{% if (not 'z' in printer.toolhead.homed_axes) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Resetting Z position to zero") }
|
||||
{% endif %}
|
||||
SET_KINEMATIC_POSITION Z=0
|
||||
{% endif %}
|
||||
|
||||
# move tool to safe homing position and home Z axis
|
||||
# location of z endstop
|
||||
G1 X{Zx} Y{Zy} Z{Hzh} F{St}
|
||||
G28 Z0
|
||||
G1 Z{Hzh} F{Sz}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
# check to see if probe is where it is supposed to be after
|
||||
# attaching/docking maneuver and set homing error or shutdown
|
||||
[gcode_macro CheckProbe]
|
||||
variable_probe_state: 0
|
||||
default_parameter_action:
|
||||
gcode:
|
||||
Query_Probe
|
||||
SetProbeState action={ ACTION }
|
||||
|
||||
|
||||
# due to how templates are evaluated, we have query endstops in one
|
||||
# macro and call another macro to make decisions based on the result
|
||||
[gcode_macro SetProbeState]
|
||||
default_parameter_action:
|
||||
gcode:
|
||||
{% set P = printer.probe.last_query %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
|
||||
# If triggered (true), probe not attached
|
||||
{% if P %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_attached VALUE={ False }
|
||||
|
||||
# If not triggered (false), probe attached
|
||||
{% else %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_attached VALUE={ True }
|
||||
{% endif %}
|
||||
|
||||
{% if params.ACTION == 'query' %}
|
||||
SET_GCODE_VARIABLE MACRO=Probe_Variables VARIABLE=probe_state VALUE={ P }
|
||||
{% endif %}
|
||||
|
||||
# if probe fails to attach/detach
|
||||
# if not docked
|
||||
{% if (not P and params.ACTION == 'dock') %}
|
||||
{ action_raise_error("Probe dock failed!") }
|
||||
{% endif %}
|
||||
|
||||
# if not attached
|
||||
{% if P and params.ACTION == 'attach' %}
|
||||
{ action_raise_error("Probe attach failed!") }
|
||||
{% endif %}
|
||||
|
||||
# Park Toolhead Routine
|
||||
[gcode_macro Park_Toolhead]
|
||||
gcode:
|
||||
{% set P = printer["gcode_macro User_Variables"].park_toolhead %}
|
||||
{% set Px = printer["gcode_macro User_Variables"].parkposition_x %}
|
||||
{% set Py = printer["gcode_macro User_Variables"].parkposition_y %}
|
||||
{% set Pz = printer["gcode_macro User_Variables"].parkposition_z %}
|
||||
{% set St = printer["gcode_macro User_Variables"].travel_speed * 60 %}
|
||||
{% set V = printer["gcode_macro User_Variables"].verbose %}
|
||||
|
||||
{% if (P and 'xyz' in printer.toolhead.homed_axes) %}
|
||||
{% if V %}
|
||||
{ action_respond_info("Parking Toolhead") }
|
||||
{% endif %}
|
||||
G90
|
||||
G1 X{Px} Y{Py} Z{Pz} F{St}
|
||||
{% endif %}
|
||||
|
||||
|
After Width: | Height: | Size: 520 KiB |
|
After Width: | Height: | Size: 619 KiB |
|
After Width: | Height: | Size: 845 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 490 KiB |
|
After Width: | Height: | Size: 489 KiB |
|
After Width: | Height: | Size: 321 KiB |
|
After Width: | Height: | Size: 359 KiB |
|
After Width: | Height: | Size: 386 KiB |
|
After Width: | Height: | Size: 186 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 439 KiB |
|
After Width: | Height: | Size: 781 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 408 KiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 377 KiB |
|
After Width: | Height: | Size: 340 KiB |
|
After Width: | Height: | Size: 386 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 443 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 281 KiB |
|
After Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 424 KiB |
|
After Width: | Height: | Size: 349 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
|
@ -0,0 +1,116 @@
|
|||
# Klicky-Probe
|
||||
Microswitch probe with magnetic attachment, primarily aimed at CoreXY 3d printers with a focus on the Voron printers, should work on other printers with the variable mount.
|
||||
|
||||
The objectives for this project are:
|
||||
- drop in replacement for Omron TL-Q5MC2 or PL-08N2 (you don't need to replace the toolhead)
|
||||
- easier and faster to build than similar probe types
|
||||
- does not require soldering
|
||||
- fixed probe dock mount (for the printers that are suported), less variables to adjust
|
||||
- be able to detect all the print surfaces
|
||||
- be as close to the hotend tip as possible
|
||||
- highly repeatable and accurate probes
|
||||
- less temperature variations
|
||||
- no melting of its parts
|
||||
- cheap to build
|
||||
|
||||
It can also be used with the new [automatic Z calibration](https://github.com/protoloft/klipper_z_calibration) klipper plugin to effectively calculate the Z offset from the probe and from the Z endstop.
|
||||
|
||||
The inspiration for the Klicky Probe comes from the [Annex magprobe](https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/tree/master/All_Printers/Microswitch_Probe) and the [Euclid probe](https://github.com/nionio6915/Euclid_Probe), it uses some concepts from each of the projects.
|
||||
|
||||

|
||||
|
||||
There is no need for supports, recommended settings are 4 perimeters/top/bottom, 13% infill.
|
||||
|
||||
The probe dock is mounted on the gantry, allowing it to be used as a Z endstop if desired (I use it that way).
|
||||
|
||||
There are three gantry extrusion mounts possible:
|
||||
- one fixed to be used on the Voron V2.4 or V1.8 AB with MGN12 or MGN9
|
||||
<img src="Photos/Fixed_mount_complete.jpg" width="100">
|
||||
- one that has some variance for other toolheads
|
||||
<img src="Photos/Variable_mount_complete.jpg" width="100">
|
||||
- one fixed sidemount dock to allow a purge/scrub bucket on the left side of the bed
|
||||
<img src="Photos/Fixed_sidemount_complete.jpg" width="100">
|
||||
|
||||
The fixed gantry extrusion mounts have been confirmed to work on the Voron V2.4 and V1.8
|
||||
|
||||
The normal magnet installation is that the two magnets that attach to the microswitch are installed with the same polarity, the 3rd magnet should have the inverse polarity.
|
||||
There is however the possibility that the magnets will demagnetize over time due to the alternating magnetic fields thay may result in a slow but sure demagnetization of the magnets, the magnets are so strong that may take a long time to show the effects of demagnetization YMMV.
|
||||
|
||||
No soldering is necessary, the probe microswitch connectors are also press-fit on the magnets.
|
||||
<p float="left">
|
||||
<img src="Photos/probe_components.jpg" width="150" />
|
||||
<img src="Photos/probe_install.jpg" width="150" />
|
||||
<img src="Photos/Probe_topside.jpg" width="150" />
|
||||
<img src="Photos/probe_v1_underside.jpg" width="150" />
|
||||
<img src="Photos/probe_complete.jpg" width="150" />
|
||||
</p>
|
||||
|
||||
The AB mount wires are also connected with pressure from the magnets, you can use the probe magnets as a template to insert the AB mount magnets, it is easier that way to don't insert the magnets the wrong way.
|
||||
<p float="left">
|
||||
<img src="Photos/AB_Mount_wiring_1.jpg" width="150" />
|
||||
<img src="Photos/AB_Mount_wiring_2.jpg" width="150" />
|
||||
<img src="Photos/AB_Mount_wiring_3.jpg" width="150" />
|
||||
<img src="Photos/AB_Mount_wiring_4.jpg" width="150" />
|
||||
<img src="Photos/AB_Mount_wiring_complete.jpg" width="150" />
|
||||
</p>
|
||||
|
||||
You will not lose Y travel on any configuration in the tests that were done.
|
||||
|
||||
It is also recommended to glue the magnets in place, superglue is good.
|
||||
|
||||
You will need to add macros to Klipper to be able to dock and undock the probe as necessary to do the Endstop (if necessary) and Quad Gantry Level, it is in the Klipper Macro directory.
|
||||
|
||||
<img src="Photos/All_Klicky_probe_components.jpg" width="600" />
|
||||
|
||||
Probe BOM:
|
||||
- 1x microswitch (the omron D2F-5 or D2F-5L (removing the lever) is recommended)
|
||||
- 2x M2x10 self tapping
|
||||
- 4x 6x3 magnets
|
||||
|
||||
AB mount BOM:
|
||||
- 3x 6x3 magnets
|
||||
|
||||
Probe Dock:
|
||||
- 1x 6x3 magnets
|
||||
- 2x M3x20
|
||||
|
||||
Fixed Dock mount:
|
||||
- 2x M3 threaded insert M3x5x4
|
||||
- 2x M5x10
|
||||
- 2x M5 t-nut or equivalent
|
||||
|
||||
or
|
||||
|
||||
variable Dock mount:
|
||||
- 10x M3 threaded insert M3x5x4
|
||||
- 8x M3x8
|
||||
- 2x M5x10
|
||||
- 2x M5 t-nut or equivalent
|
||||
|
||||
If you would like to check a possibly more uptodate repository, check [here](https://github.com/jlas1/Klicky-Probe)
|
||||
|
||||
The macro is based on a version provided by the user garrettwp on Discord, many thanks to him.
|
||||
I have tweaked it a lot.
|
||||
It is also originally based on the great Annex magnet dockable probe macros "#Originally developed by Mental, modified for better use on K-series printers by RyanG and Trails" and can be found [here](https://github.com/Annex-Engineering/Annex-Engineering_Other_Printer_Mods/blob/master/All_Printers/Microswitch_Probe/Klipper_Macros/dockable_probe_macros.cfg)
|
||||
|
||||
Would also like to thank the Voron discord community and VoronDesign for all the work that was and still is being made to maintain the Voron ecosystem.
|
||||
|
||||
The probe accuracy output is something like this:
|
||||
probe accuracy results: maximum 6.430000, minimum 6.426250, range 0.003750, average 6.428750, median 6.428750, standard deviation 0.000791
|
||||
|
||||
There is now an arrow on the probe telling you where should the switch pole be to have the correct offset.
|
||||
The probe offsets are:
|
||||
- z_offset = 6.42
|
||||
- x_offset: 0
|
||||
- y_offset: 19.75
|
||||
|
||||
Assembled Klicky Probe
|
||||
<p>
|
||||
<img src="Photos/Voron_V2.4_300mm_back.jpg" />
|
||||
|
||||
[Dock and undock video](Photos/Dock_and_Undock.mp4)
|
||||
|
||||
|
||||
It is working very well, if you decide to use it, give me feedback, either here, or on discord, my discord user is JosAr#0517.
|
||||
|
||||
By standing on the shoulders of giants, lets see if we can see further.
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
STL files
|
||||
|
||||
There is no need for supports, recommended settings are 4 perimeters/top/bottom, 13% infill.
|
||||
All the files are ready to print, they are in the recommended orientation.
|
||||
|
||||
- Version 0.1 - initial release
|
||||
- Version 0.2 - Revised probe and dock to improve the docking fit, remaining components are compatible
|
||||
- Thanks to oc_geek for improving the probing of a badly tilted gantry (10º) and the probe and dock attachment, it's much better now
|
||||
|
||||
The Klicky Probe consists on four different components:
|
||||
- Afterburner (AB) mount
|
||||
- the probe itself
|
||||
- probe dock
|
||||
|
||||

|
||||
|
||||
- there is also the probe dock mount, of which there are currently three versions
|
||||
- gantry fixed dock mount (center) (usable on Voron V2.4 or V1.8)
|
||||
- gantry variable dock mount (right) (allow some variance to support custom toolheads)
|
||||
- gantry fixed dock sidemount (left) (tested for now on Voron V2.4 to allow a purge/scrub bucket on the left side of the bed)
|
||||
|
||||

|
||||
|
||||
|
|
@ -135,6 +135,7 @@ like so:
|
|||
| | [Neopixel Case](./JNP/Neopixel-Y_Rails) | mounting for Neopixel strip with 8 LED´s | :heavy_check_mark: |:x: |:x: |:x: |
|
||||
| | [Side Panels](./JNP/Side-Panels) | Panels with intergrated hinge | :heavy_check_mark: |:x: |:x: |:x: |
|
||||
| joposter | [V0 Clippable LED Caselight](./joposter/v0_clippable_ledmounts) | LED Case light for the V0 that clips into the extrusions | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
||||
| JosAr | [Klicky Probe](./JosAr/Klicky-Probe) | Microswitch based inductive probe replacement | :x: | :heavy_check_mark: |:heavy_check_mark: | :x: |
|
||||
| KenadyDwag44 | [Switchwire Lightbar](./KenadyDwag44/sw_lightbar) | A LED lightbar for switchwire | :x: | :x: | :x: | :heavy_check_mark: |
|
||||
| KevinAkaSam | [VEFACH](./KevinAkaSam/VEFACH) | Voron Exhaust Filter Inserts for Activated Coal + Hepa | :x: | :grey_question: | :heavy_check_mark: | :x: |
|
||||
| KiloQubit | [V0 Reverse Bowden Mount](./KiloQubit/V0_reverse_bowden_mount)| V0 reverse bowden mount | :heavy_check_mark: | :x: | :x: |:x:|
|
||||
|
|
|
|||