DIY 3D Tech

The On-Line Magazine for 3D Printing & CNC

Nozzle Cleaning G-Code!

G-Code to clean the nozzle of the 3d printer

 

Nozzle Cleaning G-Code for 300mm x 300mm 3D Printer such as the Creality CR-10 or the Tronxy X5S

; Pefix G-Code for Creality CR-10 by www.DIY3DTech.com to clean nozzle
; Place as start G-Code in Slicer
; Use of this code is at your own risk (no warranties made or implied)
;
M117 Clean			   ; Indicate nozzle clean in progress on LCD
;M109 S<your temp>   		   ; Uncomment to set your own temp [run warmer to clean out nozzle] 			
M107				   ; Turn layer fan off
G21			          ; Set to metric [change to G20 if you want Imperial]
G90                             ; Force coordinates to be absolute relative to the origin
G28                             ; Home X/Y/Z axis
G0 X1 Y0 Z0.15 F9000            ; Move in 1mm from edge and up [z] 0.15mm
G92 E0                          ; Set extruder to [0] zero
G1 Y290 E100 F500               ; Extrude 100mm filiment along Y axis 290mm long to prime and clean the nozzle
G92 E0                          ; Reset extruder to [0] zero end of cleaning run
G1 E-3 F500                     ; Retract filiment by 3 mm to reduce string effect
G1 X3 Y290 Z15 F9000      	   ; Move over and rise to safe Z height
G1 X3 Y0 Z15 F9000		   ; Move back to front of bed at safe Z height to shear strings
;
; Ensure extruder is not reset by other code or it will be 3mm short [see next line also]
;G1 E3 F500					; Uncomment if you believe exruder will be reset
; Recommend turning off SKIRT in the slicer to avoid strings pulled into first layer 
; Begin printing with sliced GCode after here

 

Nozzle Cleaning G-Code for 200mm x 200mm 3D Printer such as the Tevo Tarantula or the Wanhao

; Pefix G-Code for most 200mm x 200mm 3D printers by www.DIY3DTech.com to clean nozzle
; Place as start G-Code in Slicer
; Use of this code is at your own risk (no warranties made or implied)
;
M117 Clean			; Indicate nozzle clean in progress on LCD
;M109 S<your temp>   		; Uncomment to set your own temp [run warmer to clean out nozzle] 			
M107				; Turn layer fan off
G21				; Set to metric [change to G20 if you want Imperial]
G90                          ; Force coordinates to be absolute relative to the origin
G28                          ; Home X/Y/Z axis
G0 X1 Y0 Z0.15 F9000         ; Move in 1mm from edge and up [z] 0.15mm
G92 E0                       ; Set extruder to [0] zero
G1 Y190 E50 F500             ; Extrude 100mm filiment along Y axis 190mm long to prime and clean the nozzle
G92 E0                       ; Reset extruder to [0] zero end of cleaning run
G1 E-3 F500                  ; Retract filiment by 3 mm to reduce string effect
G1 X3 Y190 Z15 F9000      	; Move over and rise to safe Z height
G1 X3 Y0 Z15 F9000		; Move back to front of bed at safe Z height to shear strings
;
; Ensure extruder is not reset by other code or it will be 3mm short [see next line also]
;G1 E3 F500					; Uncomment if you believe exruder will be reset
; Recommend turning off SKIRT in the slicer to avoid strings pulled into first layer 
; Begin printing with sliced GCode after here