Help with setting up a Purge Line

Trying to setup GCode that will let me print a line on the bed to purge and prime the nozzle, I have a BL Touch and I think the GCode I made is putting the head too far into the bed when doing the Purge Line.

Here is what I have.

Start;
G21 ; metric values
G90 ; absolute positioning
M82 ; set extruder to absolute mode
M107 ; start with the fan off
M140 S{material_bed_temperature_layer_0} ; Set bed temperature (no wait)
G28 X Y F6000 ; move X/Y to min endstops
G28 Z F1200 ; move Z to min endstops ; raise the nozzle
G28 X Y F6000 ; move X/Y to min endstops
M190 S{material_bed_temperature_layer_0} ; wait for bed temperature to reach target
M104 S{material_print_temperature_layer_0} T0 ; set extruder temperature (no wait)
G29 ; auto-leveling
G28 X Y F6000 ; move X/Y to min endstops, may disable bed leveling
M420 S1 ; enable bed leveling compensation
M109 S{material_print_temperature_layer_0} T0 ; set extruder temperature and wait
G1 Y-3.0 Z # 10.0 F500.0 ; lower print head and move out of print volume
G1 X60.0 E9 F500 ; start purge line
G1 x100.0 E12.5 F500.0 ; finish purge line
G4 S2 ; Wait for 2 seconds
G92 E0 ; zero the extruded length
M117 Printing from Cura…; message

End;
M400 ; wait until previous lines finished
M104 S0 ; extruder heater off
M140 S0 ; heated bed heater off
M107; Turn fan off
G91 ; relative positioning
G1 E-0.5 F300 ; retract the filament a bit before lifting the nozzle to release some of the pressure
G1 Z+2.0 F6000 ; move Z up and retract filament even more
G90 ; absolute positioning
G1 X0 F6000 ; move X to min endstops so the head is out of the way
G1 Y160 F6000 ; move the bed so it is easy to access to the printed part
G92 E0 ; zero the extruded length
M84 ; steppers off

Is there something I can put in to have it use the data from the bed leveling to do the purge line?

Z # ? This is strange.

From what I was able to gather from reading through Marlins documentation, values after Z goes up and putting Z # goes down.

After doing an auto bed leveling the head is up in the air, with out that it just dumps filimate over the bed but with how I have it now it’s leaving a line in the bed.

Please note: I’m 99.9% sure I have no idea what I’m doing. Before getting the BL Touch when homed it would sit in the home location and leave a dot then raise up, extruder like 3 mm of filimate then jump over to start printing.

I would love if it did a purge line like my Ender 3 Pro does. Or like how he has it in here. https://youtu.be/6csbJ5965Bk

After a LOT of trial and error I was able to come up with this, it seems to work the way I want it to.

Starting
;{material_print_temperature} {material_bed_temperature}
G21 ; metric values
G90 ; absolute positioning
M82 ; set extruder to absolute mode
M107 ; start with the fan off
M140 S{material_bed_temperature_layer_0} ; Set bed temperature (no wait)
G28 X Y F6000 ; move X/Y to min endstops
G28 Z F1200 ; move Z to min endstops ; raise the nozzle
G28 X Y F6000 ; move X/Y to min endstops
G29 ; auto-leveling
G28 X Y F6000 ; move X/Y to min endstops, may disable bed leveling
M420 S1 ; enable bed leveling compensation
G1 Y-3.0 Z 0.6 F500.0 ; lower print head and move out of print volume
M190 S{material_bed_temperature_layer_0} ; wait for bed temperature to reach target
M104 S{material_print_temperature_layer_0} T0 ; set extruder temperature (no wait)
M109 S{material_print_temperature_layer_0} T0 ; set extruder temperature and wait
G1 X60.0 E9 F500 ; start purge line
G1 x100.0 E12.5 F500.0 ; finish purge line
G4 S2 ; Wait for 2 seconds
G92 E0 ; zero the extruded length
M117 Printing from Cura…; message

Ending;
M400 ; wait until previous lines finished
M104 S0 ; extruder heater off
M140 S0 ; heated bed heater off
M107; Turn fan off
G91 ; relative positioning
G1 E-0.5 F300 ; retract the filament a bit before lifting the nozzle to release some of the pressure
G1 Z+2.0 F6000 ; move Z up and retract filament even more
G90 ; absolute positioning
G1 X0 F6000 ; move X to min endstops so the head is out of the way
G1 Y160 F6000 ; move the bed so it is easy to access to the printed part
G92 E0 ; zero the extruded length
M84 ; steppers off

I figured out how the “G1 Y-3.0 Z 0.6 F500.0” line actually works and had to change it to .6 as .3 would still scratch the bed sometimes.

Where do you read this? I do not see this in the official Marlin document (https://marlinfw.org/docs/gcode/G000-G001.html) so I do not think ADVi3++ supports this syntax. For up, you use a positive number, and for down a negative one. You have to be in relative positioning (G91).

It is better to use a X instead of x. Not sure Marlin is able to deal with x.

This may be specific to your setup unfortunately. But your idea is very interesting. I will try it myself when I get some time.

Going to be honest with you, I think your starting script has too much left over from earlier attempts to get it working, which is confusing things. I see

G28 X Y F6000 ; move X/Y to min endstops
G28 Z F1200 ; move Z to min endstops ; raise the nozzle
G28 X Y F6000 ; move X/Y to min endstops
G29 ; auto-leveling
G28 X Y F6000 ; move X/Y to min endstops, may disable bed leveling

all in a row, which is not quite right.

I personally don’t do actual lines when I purge the nozzle, but this is my start gcode modified to include 2 purge lines (which is what Google shows me when I look up Ender 3 Pro). Keep in mind, as andrivet said, you should not be using any negative values unless you have set G91 for relative positioning.

M107 ; Start with the fan off
M140 S{material_bed_temperature_layer_0} ; Set Heat Bed temperature
M117 Homing All Axes...; Put homing message on LCD screen
G28 ; Home all axes
G1 Z20 F3000 ; Raise the head
M104 S120 ; Preheat extruder a bit but not enough to ooze
M190 S{material_bed_temperature_layer_0} ; Wait for Heat Bed temperature
M104 S{material_print_temperature_layer_0} T0 ; Heat extruder to target temperature
G29 ; Autolevel bed
G1 X0 Y0 Z20 F3000 ; Zero X and Y
M109 S{material_print_temperature_layer_0} T0 ; Wait for extruder temperature
M300 ; Play tone
M117 Priming Extruder...; Put priming message on LCD screen
; Start custom purge line
G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position
G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little
G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line
G92 E0 ; Reset Extruder
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
; End custom purge line
M117 Printing...; Put printing message on LCD screen
1 Like

I’ll give it a try, Thanks!

So I noticed that if i were to print with my settings right after testing something the filament would break off between the extruder and the hodent.
I’ve since moved to your start code you gave me and I love how it’s acting just like my Ender 3 Pro now (I see that you got the code you gave from using Ender settings too.)
But seriously, thanks, it’s helped a lot and I’m not getting that problem anymore <3

Glad I could help! My starting code is slightly tweaked from the code in the ADVi3++ User Manual.

1 Like