How to add extra nozzle wipe after finishing printing with PETG

Hello! I’m using the PolyMaker PETG with BambuLab X1-Carbon and would like to add option to add the wipe of printing nozzle after the print is finished.

With this particular manufacturer it is quite often that some leftovers of filament are still dripping from the nozzle while it travels after print and these leftovers stick like a blob on the tip. I would like to get rid of those by wiping.

Thank you.

3 Likes

Add this gcode to wipe the nozzle
G0 Z5 F20000
G1 X60 Y265 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X100 F5000
G1 X70 F15000
G1 X90 F5000

1 Like

Just adding this to “Filament end G-code” section or anywhere else?

I think that adding the code in the section “Filament end G-code” should be ok. In this case, remove the first line G0 Z5 F20000

Did you ever test this @yehor? I’m having similar problems with PolyLite PETG…

I managed to get an extra wipe, but this was not enough.

Thinking how to make sequence in the end of filament properties:

  • wipe
  • cooldown to 190 (about this temp it stopps flowing through the nozzle)
  • extra wipe (a few times)

Good idea, that’s what I did now. Cooling down 60 degrees and wiping the nozzle every 10 degrees.

I just did a small test print but seems to work well.

Do you mind to share your G-code and to tell where to put it (printer of filament profile)?

I’ve added it to the printer profile as I’m not sure how this interacts with the filament specific end gcode.

This is still work in progress, but you’ll get the idea:

;===== date: 20230428 =====================
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-0.8 F1800 ; retract
G1 Z{max_layer_z + 0.5} F900 ; lower z a little
G1 X65 Y245 F12000 ; move to safe pos 
G1 Y265 F3000

G1 X65 Y245 F12000
G1 Y265 F3000
M140 S0 ; turn off bed
M106 S0 ; turn off fan
M106 P2 S0 ; turn off remote part cooling fan
M106 P3 S0 ; turn off chamber cooling fan

G1 X100 F12000 ; wipe
; pull back filament to AMS
M620 S255
G1 X20 Y50 F12000
G1 Y-3
T255
G1 X65 F12000 ; move over poop chute
G1 Y265
G1 X100 F12000 ; wipe
M621 S255 ; end tool change

;  extra wipe start
; Wipe the hotend every 10c down to -60c from print temp then turn off
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-10}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-10}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-20}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-20}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-30}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-30}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-40}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-40}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-50}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-50}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-60}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-60}
M104 S0 ; turn off hotend
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G4 4000
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
;  extra wipe end

; disabled, done during extra wipe
;M104 S0 ; turn off hotend

M622.1 S1 ; for prev firware, default turned on
M1002 judge_flag timelapse_record_flag
M622 J1
    M400 ; wait all motion done
    M991 S0 P-1 ;end smooth timelapse at safe pos
    M400 S3 ;wait for last picture to be taken
M623; end of "timelapse_record_flag"

M400 ; wait all motion done
M17 S
M17 Z0.4 ; lower z motor current to reduce impact if there is something in the bottom
{if (max_layer_z + 100.0) < 250}
    G1 Z{max_layer_z + 100.0} F600
    G1 Z{max_layer_z +98.0}
{else}
    G1 Z250 F600
    G1 Z248
{endif}
M400 P100
M17 R ; restore z current

G90
G1 X128 Y250 F3600

M220 S100  ; Reset feedrate magnitude
M201.2 K1.0 ; Reset acc magnitude
M73.2   R1.0 ;Reset left time magnitude
M1002 set_gcode_claim_speed_level : 0

M17 X0.8 Y0.8 Z0.5 ; lower motor current to 45% power

Thank you! This is a great start for me! I’m not familiar with G-code at all!

I wonder if G-code for Bambu supports the variables and loops like here? Maybe than this chunk of code:

;  extra wipe start
; Wipe the hotend every 10c down to -60c from print temp then turn off
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-10}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-10}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-20}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-20}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-30}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-30}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-40}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-40}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-50}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-50}
M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-60}
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
G1 X100 F5000 ; wipe right
G1 X70 F15000 ; wipe left
M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-60}

Could be replaced with something like:

;  extra wipe start
; Wipe the hotend every 10c down to -60c from print temp then turn off

#100 = 6; steps of cooling down 
#200 = 10; degrees of cooling down per step
#000 = 0; current step of cooling down

WHILE [#000 LE #100] DO1
	#000 = #000 + 1
	M104 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-#200*#000}
	G1 X100 F5000 ; wipe right
	G1 X70 F15000 ; wipe left
	G1 X100 F5000 ; wipe right
	G1 X70 F15000 ; wipe left
	M109 S{nozzle_temperature_initial_layer[initial_no_support_extruder]-#200*#000}
END1

That would indeed be a nice improvement. But I have no idea if loops are supported in BL’s g-code implementation :man_shrugging:

I haven’t seen any documented looping functions in Bambu generated gcode.

There is some documentation on the available conditional statements.

https://wiki.bambulab.com/en/p1/manual/extension-board-gcode-placeholder-reference