Skip to content

Instantly share code, notes, and snippets.

@rbuckton
Last active February 3, 2024 21:11
Show Gist options
  • Save rbuckton/93060c4c628235ac5382ca477a072fa3 to your computer and use it in GitHub Desktop.
Save rbuckton/93060c4c628235ac5382ca477a072fa3 to your computer and use it in GitHub Desktop.
Nozzle Change script
;FLAVOR:Marlin
;Printer: Ender 3 Pro
;; Copyright 2023 Ron Buckton
;; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
;; documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
;; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
;; permit persons to whom the Software is furnished to do so, subject to the following conditions:
;;
;; The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
;; Software.
;;
;; THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
;; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
;; COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
;; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
; Setup and homing
M117 Preparing...
M82 ; Absolute extrusion
G90 ; Absolute positioning
G21 ; Millimeter units
M149 C ; Celsius temperature units
G92 E0 ; Reset extruder
G28 ; Home all axes
; Move extruder to a comfortable Z height to remove nozzle
G0 Z150 ; Raize Z to 150mm
M400 ; Wait for moves to complete
; Ensure hotend is cool before removing sock
M109 R0 ; Wait for hotend to cool down if hot
; Prompt to remove sock
M300 S880 P200 ; Beep
M0 «Remove sock»
; Heat hotend prior to filament unload
M109 I0 ; Heat hotend
; Unload filament
M117 Wait for unload...
M702 T0 U10 ; Unload filament (10mm)
G4 P5000 ; Delay 5000ms to allow filament to cool
; Prompt to remove filament
M300 S880 P200 ; Beep
M0 «Unload filament»
; Prompt to replace nozzle
M300 S880 P200 ; Beep
M0 «Replace nozzle. HOT!»
; Reheat nozzle
M109 I0 ; Reheat nozzle
; Prompt to load filament
M300 S880 P200 ; Beep
M0 «Load filament»
; Load filament
M701 T0 L10 ; Load filament (10mm)
M0 «Filament loaded»
; Purge filament
M117 Purging filament...
G92 E0 ; Reset extruder
G1 E50 F180 ; Purge filament (50mm at feed rate of 3mm/s)
G92 E0 ; Reset extruder
; Pause for purge cleanup
M300 S880 P200 ; Beep
M0 «Clean purge»
; Cool hotend
M109 R0 ; Wait for extruder to cool
; Prompt to attach sock
M300 S880 P200 ; Beep
M0 «Attach sock»
; Re-home nozzle
M117 Auto-homing...
G28 ; Home all axes
M117 Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment