Gcodes for a filament change mid-print
November 29, 2011 07:51AM

I'm hoping to print some snowflakes with people names on for Xmas
(Thanks go to the providers of my Snowflake base [www.thingiverse.com], and text creator [www.thingiverse.com])

To get two different colours, I'd like to change the filament once the snowflake has been printed but before the name, i.e. at the end of one layer height and before the next.

I've a wades extruder that allows easy (ish) swapping of the filament so I'm happy about the mechanical side.

But I need some Gcode that waits for me. Something like:

* ….blah,blah,blah loads of gcode that prints the first 20 layers
* G1 X135 Y0 ; Go to the dump zone so there's no ooze dripping on printed part
* - wait till 'some interactive event' occurs. Keep the heater on
; Now I spend 5 mins swapping the filament and possibly put kettle on. Once happy, I trigger 'some interactive event' and the gcode parts processing again
* G1 E ; extrude some filament replace what oozed out
*…..continue with print till the end

Then I'll just paste this into the correct place in the gcode file

Any suggestions for the gcodes I need (if they exist)?

I thought maybe "M226: Gcode Initiated Pause - Initiates a pause in the same way as if the pause button is pressed" - but I'm not sure how the pause button really works or how to restart the print.


Re: Gcodes for a filament change mid-print
November 29, 2011 02:18PM
G04 P5000 is to pause for 5 Sec
then you might need to purge the extruder
M101 to run the extruder
G04 P30000 to run the extruder for 30 sec
M103 to shut it off after the purge

then continue on again after that but you might want to add a move the z up and then move the z down after the filament change.

this would require you to be there to change the filament though I dont know how to add a pause with a restart on a button press and if that is in any firmware..

Bruce Wattendorf
Re: Gcodes for a filament change mid-print
November 29, 2011 08:34PM
PLA or ABS? If ABS and you are there when it is printing, what about putting in some sharpie markers to color the filament? But I'm thinking the slacker way - and since I don't know how to do the programming to get it to pause. Then you wouldn't need to change the filament again when the snowflake(s) is(are) done.
Re: Gcodes for a filament change mid-print
November 30, 2011 02:55AM
I think I've found an alternative solution
(though using pens to colour filament is something I plan to try at some point too smiling smiley )

I use Skeinforge to slice my STLs into gcode. The Carve Plug-in (http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Carve) has "Layers From" and "Layers To" options (see text below)

So, I'll create two models and print on one top of the other. Imagine the snowflake is 6 layers high and the text 5, I need to carve the model twice as follows:

1) Layers From=0 ; Layers To=6
2) Layers From=7 ; Layers To=11

Then for the second Print I use the Bottom plug-in (http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Bottom) , Altitude setting to start printing 7 layers up.
(Bottom/Altitude = 2.8 ; my layer height is 0.4 and I want to start at the seventh layer height)

So, now I can print the first bit (snowflakes), change the filament, and then do the second print.

This all looks OK to me - anything I've missed?



Carve Plug-in
Layers From
Default is zero.

Defines the index of the bottom layer that will be carved. If the 'Layers From' is the default zero, the carving will start from the lowest layer. If the 'Layers From' index is negative, then the carving will start from the 'Layers From' index below the top layer.

For example if your object is 5 mm tall and your layer thickness is 1 mm if you set layers from to 3 you will ignore the first 3 mm and start from 3 mm.

Layers To
Default is a huge number, which will be limited to the highest index layer.

Defines the index of the top layer that will be carved. If the 'Layers To' index is a huge number like the default, the carving will go to the top of the model. If the 'Layers To' index is negative, then the carving will go to the 'Layers To' index below the top layer.

This is the same as layers from, only it defines when to end the generation of gcode.

Bottom Plug-in
Default is zero.
Defines the altitude of the bottom of the model. The bottom slice has a z of the altitude plus the 'Additional Height over Layer Thickness' times the layer thickness.
Re: Gcodes for a filament change mid-print
December 29, 2011 07:34PM
You can also just do it manually. When it's at the right place, pause the print. Type "M114" and send it to the printer, which will respond with the current position, something like "X70.48 Y48.3 Z4.4 E0.24". Note this down. Then move the hot end to somewhere you can purge the extruder, by typing "G1 X20 Y20 Z20 F1000". Reverse out your filament, put new filament in, purge out any old filament. Reset the extruder by typing "G92 E0.24", which sets the extruder back to where it thought it was when you stopped. Then move the hot end back to the position it was in when you paused it by typing "G1 X70.48 Y48.3 Z4.4 F1000". Then resume the print. I have done this successfully a number of times, but the trick is to do it quickly!

Alternatively, I just cut off the old colour 1cm above the extruder, and feed in the new colour immediately behind the old filament, so it keeps a constant pressure. This is while the machine is running, about 30-40 seconds before it's actually needed. I'm lucky that my extruder feeds very well, and takes the next filament really easily, without much hassle, so long as I can keep up with the extruder! The colour changes pretty quickly, within about 2cm of filament.
Re: Gcodes for a filament change mid-print
January 01, 2012 05:32PM

great tip... which typ of extruder do you use? i got often problems if i try to feed in material manually....



- 3D Printing - Prototyping - DIY - Microcontroller - Development
Re: Gcodes for a filament change mid-print
January 02, 2012 04:53PM
bensor, it's a Greg's hinged extruder, with springs to apply pressure and a home-made hobbed bolt. My hot end is a mendel-parts v9.
Re: Gcodes for a filament change mid-print
September 29, 2012 04:38PM
droftarts wrote:
>"...but the trick is to do it quickly! "

Can I ask why this has to be done 'quickly'?

I assumed that once the printer was paused, it would sit there for as long as you needed, until you press resume again.

Am I wrong here?
Re: Gcodes for a filament change mid-print
October 04, 2012 08:39AM
You dont want the print to cool down too much is why, especially right where the tip is at. Near the tip where the hotend is working its' magic the plastic is soft and maleable therefore layers fuse better and the hotend can push through tiny bits of plastic rather than knocking your print off the surface.

Letting that cool down too much will cause layer seperation and other nasty things to happen.
Sorry, only registered users may post in this forum.

Click here to login