Intro Line - Auto-Clean Nozzle Gcode

I thought I’d share this.
Neat little ‘trick’ by inserting a few lines of gcode into the Start Gcode of every generated gcode.
I’m not sure if Luban allows adding Start Gcode as I haven’t been using Luban. I use Prusa Slicer and Cura instead. Please search elsewhere on how to add the start gcode. I’m only giving you the gcode lines.

Just before printing, it will extrude some filament to prime the nozzle and then draw an intro line across the bed, along the edge so it wouldn’t likely interfere with the actual object you’re printing; unless your object takes up the entire bed edge-to-edge.

I love it, it works like a charm, you’ll love it too.

G28 ;Home

G1 Z15.0 F6000 ;Move the platform down 15mm

;Prime the extruder

G92 E0

G1 F200 E3

G92 E0

G1 X0 Y0 Z0.4 E9.0 F1000.0 ; go 0 0 0.3

G92 E0.0

G1 X6 E9.0 F1000.0 ; intro line

G1 X100.0 E12.5 F1000.0 ; intro line

G92 E0.0

Happy printing with clean nozzle.


Hi Dave,

I am not sure why you need to move X and Z coordination.
In a G-code file that is generated by Snapmaker Luban, the machine will extrude melted filament and then retract it.

G92 E0
G1 E20 F200
G92 E0
;Start GCode end
G92 E0
G1 F3600 E-5


Hi Edwin,
I wasn’t really paying attention. I copied pasted it from my Prusa Slicer in a hurry.
I stand corrected.

Extruding filament is good for priming but to actually get rid of it just before printing is another useful bit.
Prusa firmware does this and I thought what a clever idea. So I adopted the method on all my other printers.

1 Like