diff --git a/.last_sync_id b/.last_sync_id index 47d1324..621eda3 100644 --- a/.last_sync_id +++ b/.last_sync_id @@ -1 +1 @@ -ad9b7449e5249c80ac9fb860c758a2ce600ea8aa +4e044b3a83f43e35e5a18c892fcf6318f1d990f1 diff --git a/klicky-macros.cfg b/klicky-macros.cfg index be88c44..39e4aaf 100644 --- a/klicky-macros.cfg +++ b/klicky-macros.cfg @@ -355,59 +355,70 @@ gcode: {% set release_feedrate = printer["gcode_macro _User_Variables"].release_speed * 60 %} {% set z_drop_feedrate = printer["gcode_macro _User_Variables"].z_drop_speed * 60 %} {% set bypass_probe_docking = printer["gcode_macro _User_Variables"].bypass_probe_docking|default(False) %} - {% if bypass_probe_docking == False %} - {% else %} + {% if bypass_probe_docking == True %} _KlickyDebug msg="Attach_Probe probe docking bypassed, doing nothing" {% endif %} - {% if bypass_probe_docking == False %} + + {% if bypass_probe_docking != True %} _entry_point function=Dock_Probe + # If probe not attached and not locked - {% endif %} - _KLICKY_STATUS_BUSY - {% if printer.gcode_move.gcode_position.z < safe_z %} - _KlickyDebug msg="Dock_Probe toolhead too low, raising it to {safe_z}mm from {printer.gcode_move.gcode_position.z}mm" - G0 Z{safe_z} F{z_drop_feedrate} - {% endif %} - _Umbilical_Path - # Probe entry location - _KlickyDebug msg="Dock_Probe moving near the dock with G0 X{docklocation_x|int - attachmove_x|int} Y{docklocation_y|int - attachmove_y|int} F{travel_feedrate}" - G0 X{docklocation_x|int - attachmove_x|int} Y{docklocation_y|int - attachmove_y|int} F{travel_feedrate} - {% if docklocation_z != -128 %} - _KlickyDebug msg="Dock_Probe moving near the dock with G0 Z{docklocation_z|int - attachmove_z|int} F{dock_feedrate}" - G0 Z{docklocation_z|int - attachmove_z|int} F{dock_feedrate} - {% endif %} - # if necessary do some actions before moving the toolhead to dock - _DeployKlickyDock - # Drop Probe to Probe location - _KlickyDebug msg="Dock_Probe moving to the dock with G0 X{docklocation_x} Y{docklocation_y} F{dock_feedrate}" - G0 X{docklocation_x} Y{docklocation_y} F{dock_feedrate} - {% if docklocation_z != -128 %} - _KlickyDebug msg="Attach_Probe moving to the dock with G0 Z{docklocation_z} F{dock_feedrate}" - G0 Z{docklocation_z} F{dock_feedrate} - {% endif %} - # Probe decoupling - {% if docklocation_z != -128 %} - _KlickyDebug msg="Dock_Probe moving from the dock to G0 Z{docklocation_z|int + dockmove_z|int} F{release_feedrate}" - G0 Z{docklocation_z|int + dockmove_z|int} F{release_feedrate} - {% endif %} - _KlickyDebug msg="Dock_Probe moving from the dock to G0 X{docklocation_x|int + dockmove_x|int} Y{docklocation_y|int + dockmove_y|int} F{release_feedrate}" - G0 X{docklocation_x|int + dockmove_x|int} Y{docklocation_y|int + dockmove_y|int} F{release_feedrate} - # if necessary do some actions after attaching the probe - _RetractKlickyDock - #Do an extra move away - _KlickyDebug msg="Dock_Probe moving away from the dock to G0 X{docklocation_x|int + dockmove_x|int - attachmove_x|int} Y{docklocation_y|int + dockmove_y|int - attachmove_y|int} F{release_feedrate}" - G0 X{docklocation_x|int + dockmove_x|int - attachmove_x|int} Y{docklocation_y|int + dockmove_y|int - attachmove_y|int} F{release_feedrate} - ## Go to Z safe distance - {% if (printer.gcode_move.gcode_position.z < safe_z) %} - _KlickyDebug msg="Dock_Probe moving to a safe Z position: G0 Z{safe_z} F{z_drop_feedrate} from {printer.gcode_move.gcode_position.z}" + {% if probe_attached and not probe_lock %} + _KLICKY_STATUS_BUSY + {% if printer.gcode_move.gcode_position.z < safe_z %} + _KlickyDebug msg="Dock_Probe toolhead too low, raising it to {safe_z}mm from {printer.gcode_move.gcode_position.z}mm" G0 Z{safe_z} F{z_drop_feedrate} - {% endif %} + {% endif %} + _Umbilical_Path - _Park_Toolhead + # Probe entry location + _KlickyDebug msg="Dock_Probe moving near the dock with G0 X{docklocation_x|int - attachmove_x|int} Y{docklocation_y|int - attachmove_y|int} F{travel_feedrate}" + G0 X{docklocation_x|int - attachmove_x|int} Y{docklocation_y|int - attachmove_y|int} F{travel_feedrate} - G4 P1000 - _CheckProbe action=dock - _KLICKY_STATUS_READY + {% if docklocation_z != -128 %} + _KlickyDebug msg="Dock_Probe moving near the dock with G0 Z{docklocation_z|int - attachmove_z|int} F{dock_feedrate}" + G0 Z{docklocation_z|int - attachmove_z|int} F{dock_feedrate} + {% endif %} + + # if necessary do some actions before moving the toolhead to dock + _DeployKlickyDock + + # Drop Probe to Probe location + _KlickyDebug msg="Dock_Probe moving to the dock with G0 X{docklocation_x} Y{docklocation_y} F{dock_feedrate}" + + G0 X{docklocation_x} Y{docklocation_y} F{dock_feedrate} + {% if docklocation_z != -128 %} + _KlickyDebug msg="Attach_Probe moving to the dock with G0 Z{docklocation_z} F{dock_feedrate}" + G0 Z{docklocation_z} F{dock_feedrate} + {% endif %} + + # Probe decoupling + {% if docklocation_z != -128 %} + _KlickyDebug msg="Dock_Probe moving from the dock to G0 Z{docklocation_z|int + dockmove_z|int} F{release_feedrate}" + G0 Z{docklocation_z|int + dockmove_z|int} F{release_feedrate} + {% endif %} + + _KlickyDebug msg="Dock_Probe moving from the dock to G0 X{docklocation_x|int + dockmove_x|int} Y{docklocation_y|int + dockmove_y|int} F{release_feedrate}" + G0 X{docklocation_x|int + dockmove_x|int} Y{docklocation_y|int + dockmove_y|int} F{release_feedrate} + + # if necessary do some actions after attaching the probe + _RetractKlickyDock + + #Do an extra move away + _KlickyDebug msg="Dock_Probe moving away from the dock to G0 X{docklocation_x|int + dockmove_x|int - attachmove_x|int} Y{docklocation_y|int + dockmove_y|int - attachmove_y|int} F{release_feedrate}" + G0 X{docklocation_x|int + dockmove_x|int - attachmove_x|int} Y{docklocation_y|int + dockmove_y|int - attachmove_y|int} F{release_feedrate} + + ## Go to Z safe distance + {% if (printer.gcode_move.gcode_position.z < safe_z) %} + _KlickyDebug msg="Dock_Probe moving to a safe Z position: G0 Z{safe_z} F{z_drop_feedrate} from {printer.gcode_move.gcode_position.z}" + G0 Z{safe_z} F{z_drop_feedrate} + {% endif %} + + _Park_Toolhead + + G4 P1000 + _CheckProbe action=dock + _KLICKY_STATUS_READY {% elif probe_lock %} {% if verbose %}