<p>First things first imho: <strong>M0 to stop the stamp</strong>. I dunno which firmware are you using but it should wait you to press a button on the LCD (Marlin does it).  After that it run the gcode to unload and load the filament, resume temperature (M109 S215) and go ahead with the stamp.</p>

<p>This is my final version:   </p>

<pre><code>    M83
    G1 F3000 E-25
    G1 F300 Z4
    G1 F9000 X100 Y100
    G1 F300 Z15
    M0 ;Do the actual pause
    G21 ;Metric Values
    G90 ;Absolute Positioning
    M109 S205.000 ;205 Unload
    G92 E0 ;Reset Extruder Positioning
    G1 E10 F100 ;Extrude 10mm filament
    G92 E0 ;Reset Extruder Positioning
    G1 E-600 F1500 ;Retract Filament completely 
    G92 E0 ;Reset Extruder
    M400 ;Wait Command
    M117 REMOVE FILAMENT NOW ;LCD Message
    M400 ; Wait Command
    G21 ;Metric Values
    G90 ;Set absolute positioning
    M109 S205.000 ;Preheat PLA
    M300 S440 P200 ; Tone
    M300 S660 P250 ; Tone
    M300 S880 P300 ; Tone
    G4 S5 ; Wait 5 seconds
    G92 E0 ;Reset Extruder Position
    G1 E380 F1500; Fast Feed of 380mm filament
    G92 E0 ;Reset Extruder Position
    G1 E100 F200 ;Feed 100mm filament slowly
    G92 E0 ;Reset Extruder Position
    M400; Finish Move
    M109 S215; resume temperature
    G1 F3000 E25
    G1 F3000 E-25
    G1 F300 Z4
    G1 F9000 X101.7 Y137.3
    G1 F3000 E25
    G1 F9000
    M82
    G92 E763.80547
    G4 P1 
</code></pre>

CC BY-SA 4.0
2019-10-04T11:56:08.050Z
2019-10-04T12:04:58.613Z
2019-10-04T12:04:58.613Z
jakjakjakjakjak
<p>I'm using Ultimaker Cura, and I want to change the filament for a print that I'm attempting at layer 15. The problem I'm having is that I also need to use G-code to load and unload the filament with my BMG extruder. This is the script that Ultimaker Cura created for the post-process to pause at layer 15.</p>

<pre><code>;current layer: 15
M83
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X100 Y100
G1 F300 Z15
M104 S25; standby temperature
M0;Do the actual pause
M109 S215; resume temperature
G1 F3000 E25
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X101.7 Y137.3
G1 F3000 E25
G1 F9000
M82
G92 E763.80547
G4 P1    
</code></pre>

<p>This is what I usually use to unload my filament:</p>

<pre><code>G21 ;Metric Values
G90 ;Absolute Positioning
M109 S205.000 ;205 Unload
G92 E0 ;Reset Extruder Positioning
G1 E10 F100 ;Extrude 10mm filament
G92 E0 ;Reset Extruder Positioning
G1 E-600 F1500 ;Retract Filament completely 
G92 E0 ;Reset Extruder
M400 ;Wait Command
M117 REMOVE FILAMENT NOW ;LCD Message
M400 ; Wait Command
</code></pre>

<p>And to load:</p>

<pre><code>G21 ;Metric Values
G90 ;Set absolute positioning
M109 S205.000 ;Preheat PLA
M300 S440 P200 ; Tone
M300 S660 P250 ; Tone
M300 S880 P300 ; Tone
G4 S5 ; Wait 5 seconds
G92 E0 ;Reset Extruder Position
G1 E380 F1500; Fast Feed of 380mm filament
G92 E0 ;Reset Extruder Position
G1 E100 F200 ;Feed 100mm filament slowly
G92 E0 ;Reset Extruder Position
M400; Finish Move
</code></pre>

<p>So this is what I came up with, will it work?</p>

<pre><code>;current layer: 15
M83
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X100 Y100
G1 F300 Z15
G92 E0; Reset extruder position
G92 E-600 F1500; Retract Filament Completely
M104 S25; standby temperature
M0;Do the actual pause
G92 E0; Reset Extruder Position
M109 S215 ;Preheat PLA+
G1 E380 F1500; Fast Feed of 380mm filament
G92 E0; Reset Extruder Position
G1 E100 F200; Slowly Feed 100mm
M104 S25; Standby Temperature
M0; Do the actual Pause
M109 S215; resume temperature
G1 F3000 E25
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X101.7 Y137.3
G1 F3000 E25
G1 F9000
M82
G92 E763.80547
G4 P1
</code></pre>

CC BY-SA 4.0
2019-08-26T20:42:18.927Z
Try it and tell us if it works!
user77232
<g-code><change-filament>
Help with my G-Code to change filament change mid-print
double0psycho
# Help with my G-Code to change filament change mid-print

(Asked by: username_0 on 2019-08-23)

I'm using Ultimaker Cura, and I want to change the filament for a print that I'm attempting at layer 15. The problem I'm having is that I also need to use G-code to load and unload the filament with my BMG extruder. This is the script that Ultimaker Cura created for the post-process to pause at layer 15.
;current layer: 15
M83
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X100 Y100
G1 F300 Z15
M104 S25; standby temperature
M0;Do the actual pause
M109 S215; resume temperature
G1 F3000 E25
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X101.7 Y137.3
G1 F3000 E25
G1 F9000
M82
G92 E763.80547
G4 P1    

This is what I usually use to unload my filament:
G21 ;Metric Values
G90 ;Absolute Positioning
M109 S205.000 ;205 Unload
G92 E0 ;Reset Extruder Positioning
G1 E10 F100 ;Extrude 10mm filament
G92 E0 ;Reset Extruder Positioning
G1 E-600 F1500 ;Retract Filament completely 
G92 E0 ;Reset Extruder
M400 ;Wait Command
M117 REMOVE FILAMENT NOW ;LCD Message
M400 ; Wait Command

And to load:
G21 ;Metric Values
G90 ;Set absolute positioning
M109 S205.000 ;Preheat PLA
M300 S440 P200 ; Tone
M300 S660 P250 ; Tone
M300 S880 P300 ; Tone
G4 S5 ; Wait 5 seconds
G92 E0 ;Reset Extruder Position
G1 E380 F1500; Fast Feed of 380mm filament
G92 E0 ;Reset Extruder Position
G1 E100 F200 ;Feed 100mm filament slowly
G92 E0 ;Reset Extruder Position
M400; Finish Move

So this is what I came up with, will it work?
;current layer: 15
M83
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X100 Y100
G1 F300 Z15
G92 E0; Reset extruder position
G92 E-600 F1500; Retract Filament Completely
M104 S25; standby temperature
M0;Do the actual pause
G92 E0; Reset Extruder Position
M109 S215 ;Preheat PLA+
G1 E380 F1500; Fast Feed of 380mm filament
G92 E0; Reset Extruder Position
G1 E100 F200; Slowly Feed 100mm
M104 S25; Standby Temperature
M0; Do the actual Pause
M109 S215; resume temperature
G1 F3000 E25
G1 F3000 E-25
G1 F300 Z4
G1 F9000 X101.7 Y137.3
G1 F3000 E25
G1 F9000
M82
G92 E763.80547
G4 P1

**Tags:** g-code, change-filament
> **Comments:**
> **username_1**: Try it and tell us if it works!  

---

## 1 answers

### Answer by username_2 on 2019-10-04. Score: 2

First things first imho: M0 to stop the stamp. I dunno which firmware are you using but it should wait you to press a button on the LCD (Marlin does it).  After that it run the gcode to unload and load the filament, resume temperature (M109 S215) and go ahead with the stamp.
This is my final version:   
    M83
    G1 F3000 E-25
    G1 F300 Z4
    G1 F9000 X100 Y100
    G1 F300 Z15
    M0 ;Do the actual pause
    G21 ;Metric Values
    G90 ;Absolute Positioning
    M109 S205.000 ;205 Unload
    G92 E0 ;Reset Extruder Positioning
    G1 E10 F100 ;Extrude 10mm filament
    G92 E0 ;Reset Extruder Positioning
    G1 E-600 F1500 ;Retract Filament completely 
    G92 E0 ;Reset Extruder
    M400 ;Wait Command
    M117 REMOVE FILAMENT NOW ;LCD Message
    M400 ; Wait Command
    G21 ;Metric Values
    G90 ;Set absolute positioning
    M109 S205.000 ;Preheat PLA
    M300 S440 P200 ; Tone
    M300 S660 P250 ; Tone
    M300 S880 P300 ; Tone
    G4 S5 ; Wait 5 seconds
    G92 E0 ;Reset Extruder Position
    G1 E380 F1500; Fast Feed of 380mm filament
    G92 E0 ;Reset Extruder Position
    G1 E100 F200 ;Feed 100mm filament slowly
    G92 E0 ;Reset Extruder Position
    M400; Finish Move
    M109 S215; resume temperature
    G1 F3000 E25
    G1 F3000 E-25
    G1 F300 Z4
    G1 F9000 X101.7 Y137.3
    G1 F3000 E25
    G1 F9000
    M82
    G92 E763.80547
    G4 P1


---

