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

User-Generated tips and tricks for the Rostock Max, Orion, H1.1, or H1 Printers
Post Reply
User avatar
Jimustanguitar
ULTIMATE 3D JEDI
Posts: 2631
Joined: Sun Mar 31, 2013 1:35 am
Location: Notre Dame area
Contact:

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

Post 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]
jesse
Printmaster!
Posts: 426
Joined: Tue Jan 01, 2013 8:38 pm
Contact:

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

Post 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.
Holy1
Printmaster!
Posts: 349
Joined: Fri Jan 24, 2014 12:53 pm

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

Post 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" onclick="window.open(this.href);return false;
Orion to Cartesian http://forum.seemecnc.com/viewtopic.php?f=59&t=7808" onclick="window.open(this.href);return false;
User avatar
lightninjay
Printmaster!
Posts: 289
Joined: Sun Jul 13, 2014 12:49 am
Location: Tampa, Florida

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

Post 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!
If at first you don't succeed, you're doing something wrong. Try again, and if it fails again, try once more. Through trial and error, one can be the first to accomplish something great.
Post Reply

Return to “General Tips 'N Tricks”