Page 1 of 1

How to edit GCode to add a pause for changing filament color

Posted: Wed Sep 30, 2015 1:11 am
by Jimustanguitar
I've seen some neat prints lately that used multiple colors, and the trick that the guy was using was to click the pause button, jog the machine up a few ticks, change the filament, jog the machine back down, and resume the print with a new color.

Instead of waiting until the right layer, and doing this process manually, how would I do this with GCode? I want to do this without having to watchdog my prints. I also usually print from SD, so I'd love to not have to run a USB cable across my room. Any tips?

[img]https://scontent-ord1-1.xx.fbcdn.net/hp ... e=568CD6C4[/img]

[img]https://scontent-ord1-1.xx.fbcdn.net/hp ... e=5695ED16[/img]

[img]https://fbcdn-photos-b-a.akamaihd.net/h ... 473c365478[/img]

[img]https://scontent-ord1-1.xx.fbcdn.net/hp ... e=568C1F53[/img]

Re: How to edit GCode to add a pause for changing filament c

Posted: Wed Sep 30, 2015 7:21 am
by jesse
Repetier-Host will pause if you add @pause to the gcode. You can swap the filament while it's paused and then resume the print.

Re: How to edit GCode to add a pause for changing filament c

Posted: Wed Sep 30, 2015 7:45 am
by Holy1
Here is what I do. It is at the end of this post. You can just copy and paste the gcode.
Hope that helps.
http://forum.seemecnc.com/viewtopic.php?f=66&t=6789

Re: How to edit GCode to add a pause for changing filament c

Posted: Wed Sep 30, 2015 8:48 pm
by lightninjay
I use a bit of a convoluted and manual system to do this, but it allows me extreme precision with my filament changes and other settings changes.

In a nutshell, I make separate gcode files for each portion of the print. You start off with the full gcode file, and then cut and paste the portion that begins at the layer you want the pause to occur at, into another text file and save it as a second gcode. I modify my header for the second file to ensure that the nozzle doesn't come crashing down into the print during the usual lower and prime, and modify the footer of my first file to make sure the machine essentially finishes the print, but does not reset and does not lower the temp of the heated bed or nozzle.

What I end up with is something that looks like this when observed in a gcode editor
This is what the file originally begins as.
This is what the file originally begins as.
This is the first half of the file.  It becomes its own gcode file, as you might be able to see, the layer count is all the way at max. (Bottom sliders)
This is the first half of the file. It becomes its own gcode file, as you might be able to see, the layer count is all the way at max. (Bottom sliders)
This may look strange, a print starting in midair, but in reality, the first gcode has already completed and half of an object is sitting on your printer when you send this second gcode.  It mates up perfectly and then continues on printing.
This may look strange, a print starting in midair, but in reality, the first gcode has already completed and half of an object is sitting on your printer when you send this second gcode. It mates up perfectly and then continues on printing.
This particular print, I had the gcode separated so I could then insert two spheres that had previously been printed. If the print hadn't broken loose from the bed, it would've been perfect, but as it stands, I still ended up with a pretty cool print.
This is what I ended up with, looks kinda like a C instead of the Donut that it was lol
This is what I ended up with, looks kinda like a C instead of the Donut that it was lol
Admittedly, this workflow is not exactly ideal, and is kind of clunky, but you really only need to do it once to create your separate gcodes, then you can change the filament to any color you want and print the separate files as many times as you want.

I actually use this particular method to do things such as change the infill midprint (by splicing together two different gcodes, first half being for instance 20% infill, and the second half being 100%) and I have also had success with printing ninjaflex on top of PLA for the endpin of my electric cello (which is quite close to being completely finished by the way).

Hope any of this could be of some help Jim!