<p>I own a delta 3D printer. The problem is that, at the beginning of a print the extruder outputs dirty filament. I want a clean filament flow at the start of my prints!</p>

<p>How can I make the hotend exit the print surface (glass plate) by 10mm, extrude the bad filament and go back to printing again? Can this be done with G-code?</p>

<p>My Z high is 190&nbsp;mm and the glass plate diameter is 120&nbsp;mm. I'm using Marlin + Ramps 1.4. </p>

<p>I'm using Repetier-Host and CuraEngine as Slicer, but I really would like a G-code that can work on multiple environments like Cura and Repetier. I just want to add it to the start G-code and print!</p>

A lot of slicers will have a Wipe option. Here are some examples:
See
Unofficial Simplify3D Documentation
. Go to the section talking about
Wipe Nozzle
, under the heading
Extruder Tab
Two more ooze-fighting options are Coast at end and Wipe nozzle. Coast turns off the extruder the specified distance before it normally would, to drain what would have oozed as the end of a line. This can help with ooze-induced blobs at the end of lines, but if turned up too high will lead to gaps in your print walls. Changes to this setting will be visible as gaps in the g-code preview.
Wipe has the nozzle retrace over the start of a perimeter line at the
  end of a perimeter for the specified distance with the extruder off,
  to leave any ooze behind before proceeding. It is similar to Coast in
  that it moves the extruder without extruding, but wipe occurs after
  the end of the line while coast occurs before.
Slic3r has some sort of coasting. But I think in their docs the option is there:
Slic3r Manual - Fighting Ooze
Wipe before retract - Moves the nozzle whilst retracting so as to reduce the chances of a blob forming.
As you asked for G-Code here you go:
Reprap Forum - Wipe nozzle via GCODE
Example
```
```
;Sliced at: {day} {date} {time}
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
;M190 S{print_bed_temperature} ;Uncomment to add your own bed temperature line
;M109 S{print_temperature} ;Uncomment to add your own temperature line
G21        ;metric values
G90        ;absolute positioning
M82        ;set extruder to absolute mode
M107       ;start with the fan off
G28 X0 Y0  ;move X/Y to min endstops
G28 Z0     ;move Z to min endstops
M117 Auto-level...
G29        ;auto-level
;G92 Z-.01 ; Lower = Z Pos, Lift = Z Neg
M117 Preparing...
G1 Z10.0 F{travel_speed} ;move the platform down 15mm
G92 E0                  ;zero the extruded length
G1 F100 E30              ;extrude 10mm of feed stock
G92 E0                  ;zero the extruded length again
G1 F{travel_speed}
;Put printing message on LCD screen
M300 S900 P160         ;start beep
M300 S1000 P160
M300 S2000 P160
M0    ;Wait for the user
M117 Printing...
```
```
Lulzbot forum - Start GCODE Script for Wipe
, in particular
this post
:
Example
```
```
G91 ; switch to relative positioning
G1 Z10 ; safe raise of z axis to ensure probe doesn't hit bed clamp
G90 ; switch back to absolute positioning
G28 ; home all axes
G29 ; level print bed
G1 X298 Y137 Z2 F5000 ; move to wait position right hand side of the table
G1 Z0.4 ; position nozzle
G1 E25 F300 ; purge nozzle
M400 ; wait for purge to complete
G1 X285 F1200 ; slow wipe
G1 Z0.5 F1200 ; lift
```
```
That should get you started.