From 1254240fc82d263a3894f3d4a2dfde6471000ea2 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 16 Apr 2023 16:04:37 -0400 Subject: [PATCH] SMART-M600: Added NOZZLE_CHANGE and MAINTENANCE macros --- extras/filament_change/README.md | 31 +++++++++++++++ extras/filament_change/smart-m600.cfg | 57 ++++++++++++++++++++++++++- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/extras/filament_change/README.md b/extras/filament_change/README.md index d67f38c..aea58e8 100644 --- a/extras/filament_change/README.md +++ b/extras/filament_change/README.md @@ -42,6 +42,8 @@ During manual filament changes this behavior is modified slightly to account for - [Slicer Material/Color Change](#slicer-materialcolor-change) - [Manual Filament Change](#manual-filament-change) - [Manual Purging](#manual-purging) + - [Nozzle Change](#nozzle-change) + - [Maintenance Parking](#maintenance-parking) - [Toggling Filament Sensing](#toggling-filament-sensing) - [Automating Filament Sensor Toggling](#automating-filament-sensor-toggling) - [Additional Notes](#additional-notes) @@ -52,6 +54,7 @@ During manual filament changes this behavior is modified slightly to account for - [v2.3.0 2023-02-17](#v230-2023-02-17) - [v2.2.5 2023-1-27](#v225-2023-1-27) - [v2.2.0 2023-1-27](#v220-2023-1-27) + - [v2.5.0 2023-4-16](#v250-2023-4-16) - [v2.0.1 2023-1-3](#v201-2023-1-3) - [v2.0 2023-1-1](#v20-2023-1-1) - [v1.9 2022-12-30](#v19-2022-12-30) @@ -379,6 +382,29 @@ There is also a `PURGE` command included. This command will allow you to extrude To use this, simply run `PURGE` +## Nozzle Change + +You can use the `NOZZLE_CHANGE` command to perform nozzle changes. + +It will park the toolhead in a convenient location (by default the center of the XYZ axes) and then unload the filament. + +Once you have completed the nozzle change you can run `NOZZLE_CHANGE_DONE` to load the filament and cool down the hotend. + +To change the parking coordinates, see [the MAINTENANCE macro](#maintenance-parking) +## Maintenance Parking + +This macro parks the toolhead in a convenient position for performing maintenance. + +To change the maintenance parking position, change all three variable values **on the `MAINTENANCE` macro: + + variable_maint_x: -1 + variable_maint_y: -1 + variable_maint_z: -1 + +When any of these values are set to `-1` the default (centered) parking coordinates will be used. + +Changing them all to your preferred coordinates will change the parking location used by `MAINTENANCE` (and others that use it like `NOZZLE_CHANGE`) + ## Toggling Filament Sensing You can use the following commands to toggle the filament sensor on and off: @@ -479,6 +505,11 @@ This helps to prevent accidental triggering outside of prints when performing ma variable_auto_unload: False variable_runout: False +## v2.5.0 2023-4-16 + +- Added `NOZZLE_CHANGE` and `MAINTENANCE` macros. +- Fixed a typo in the `COLOR_CHANGE` macro. + ## v2.0.1 2023-1-3 - Minor bug fix to repair `coldstart` feature. This should hopefully prevent runouts from ever being triggered during manual filament changes. diff --git a/extras/filament_change/smart-m600.cfg b/extras/filament_change/smart-m600.cfg index 44d19e0..2edc984 100644 --- a/extras/filament_change/smart-m600.cfg +++ b/extras/filament_change/smart-m600.cfg @@ -1,6 +1,6 @@ ##################################### # Smart Filament Change Macros # -# Version 2.4.0 2023-4-2 # +# Version 2.5.0 2023-4-16 # ##################################### ##### PLEASE READ BELOW ##### ##################################### @@ -88,7 +88,7 @@ gcode: M600 SET_GCODE_VARIABLE MACRO=_m600cfg VARIABLE=prev_temp VALUE={printer.extruder.target} SET_GCODE_VARIABLE MACRO=_m600cfg VARIABLE=runout VALUE=True - M{printcfg.output|int} Unloading Filament... + M{m600cfg.output|int} Unloading Filament... UNLOAD_FILAMENT ################################ @@ -319,6 +319,31 @@ gcode: STATUS_READY {% endif %} +################################ +######## NOZZLE_CHANGE ######### +################################ +## This macro is used to change the nozzle on the printer +## It prepares the printhead by heating the nozzle to the +## apppropriate temperature and unloading the filament. +## Then the printhead is parked in a convenient position for nozzle changes. +[gcode_macro NOZZLE_CHANGE] +description: Prepare the printer for a nozzle change +gcode: + {% set m600cfg = printer["gcode_macro _m600cfg"] %} ; get m600cfg variables + HOME_IF_NEEDED ; Home all axes if not already homed + M{m600cfg.output|int} Nozzle Change + MAINTENANCE ; Park the toolhead in a convenient position + UNLOAD_FILAMENT ; Unload filament + M{m600cfg.output|int} Change nozzle now and run NOZZLE_CHANGE_DONE when finished + +[gcode_macro NOZZLE_CHANGE_DONE] +description: Complete the nozzle change +gcode: + {% set m600cfg = printer['gcode_macro _m600cfg'] %} ; get m600cfg variables + LOAD_FILAMENT ; Load filament + M104 S0 ; Turn off extruder heater + M{m600cfg.output|int} Nozzle Change Complete + ################################ ########### PARKING ############ ################################ @@ -342,6 +367,34 @@ gcode: G90 G1 X{m600cfg.x|int} Y{m600cfg.y|int} F{m600cfg.park_speed|int} +## MAINTENANCE parking +[gcode_macro MAINTENANCE] +description: Move the toolhead to a convenient position for working on it +variable_maint_x: -1 +variable_maint_y: -1 +variable_maint_z: -1 +gcode: + {% set m600cfg = printer['gcode_macro _m600cfg'] %} ; get m600cfg variables + {% set config = printer.configfile.settings %} ; get realtime configfile settings + {% set max_x = config["stepper_x"]["position_max"]|float %} ; get max x position + {% set max_y = config["stepper_y"]["position_max"]|float %} ; get max y position + {% set max_z = config["stepper_z"]["position_max"]|float %} ; get max z position + {% set mid_x = max_x / 2.0 %} ; get middle of x axis + {% set mid_y = max_y / 2.0 %} ; get middle of y axis + {% set mid_z = max_z / 2.0 %} ; get middle of z axis + {% if maint_x < 0 or maint_y < 0 or maint_z < 0 %} ; if maintenance position is not defined move to middle of bed + {% set move_x = mid_x %} ; use middle of x axis + {% set move_y = mid_y %} ; use middle of y axis + {% set move_z = mid_z %} ; use middle of z axis + {% else %} ; otherwise, move to defined positions + {% set move_x = maint_x %} ; get maintenance x position + {% set move_y = maint_y %} ; get maintenance y position + {% set move_z = maint_z %} ; get maintenance z position + {% endif %} + HOME_IF_NEEDED ; Home all axes (if not already homed) + G0 X{move_x} Y{move_y} Z{move_z} F3000 ; Move to maintenance position + M{m600cfg.output|int} Maintenance position reached + ################################ ########### HOMING ############# ################################