Skip to content

Commit

Permalink
SMART-M600:
Browse files Browse the repository at this point in the history
Added NOZZLE_CHANGE and MAINTENANCE macros
  • Loading branch information
rootiest committed Apr 16, 2023
1 parent e326a10 commit 1254240
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 2 deletions.
31 changes: 31 additions & 0 deletions extras/filament_change/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand Down
57 changes: 55 additions & 2 deletions extras/filament_change/smart-m600.cfg
Original file line number Diff line number Diff line change
@@ -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 #####
#####################################
Expand Down Expand Up @@ -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

################################
Expand Down Expand Up @@ -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 ############
################################
Expand All @@ -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 #############
################################
Expand Down

0 comments on commit 1254240

Please sign in to comment.