Loading

Simplify3D Color change, filament change, pausing

Please Login to Comment

So there really is a lack of proper info out there on how to do that. So after much research, i think i got it.

https://youtu.be/OiixypnOS8o

Filament Color Change with S3D

First Choose which option you are interested on.

Option A
You want to display your current layers on your LCD.
You want to pause print, move hot end out of the way, and change filament then resume.

Option B
You want to pause print, move hot end out of the way, and change filament then resume.

Here is the code.

Option A
Go to Process Settings
Go to Scripts Tab
On the bottom box (post processing) enter

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

Please note you must change the layer's number to the layer you want the color to change at!
You can repeat the third line as many times as needed, just update the layer number accordingly.
**Order of the above code matters. Enter it exactly. The third line assumes the previous two lines exist.

Option B
Go to Process Settings
Go to Scripts Tab
On the bottom box (post processing) enter

{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM0\n; layer 4, Z = "}

Please note you must change the layer's number to the layer you want the color to change at!
You can repeat the third line as many times as needed, just update the layer number accordingly.

In simple terms, this is what it accomplishes.
First line adds M117 to the layers on the Gcode. It displays them on the LCD.
Second line eliminates some spaces so the whole data shows on a 20x4 display.
Third line is what looks for the M117 Layers label, enters a new line and inserts the coordinates to park, and pauses print.

UPDATE 1/14/17
Tip: (Thanks Plust)
Place a semicolon for the Option A 3th line or the line in Option B if you need a print without changing filament.
Example:

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
;{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

UPDATE 12/9/2017
I have found out that for the Wanhao Duplicator i3 the pause command is M25 instead of M0. Update script code accordingly.

Also, some firmwares do not recognize M0 as pause, in that case, you may also try M600

Hello STIG_, thank you, and thanks to whom helped to improve this help, very much for this instructions. Option B also worked great for my try!
I am glad I can now feel very confortable to use different filaments for my future prints, and not just limit myself to different layer heights.

I just tried option B and it works excellent! How or what is the best way to find out what layer you want to change filament on a taller print?

what i do is slice the model normally, then use the slider to move it up and down (the preview) to find out the spot i want to do this, most slicers show you the layer you are previewing

Works perfect, thanks!

Glad i was of some help!, Your welcome.

Thanks very much. :)

Glad i was of some help!, Your welcome.

If I want to have the extrusion multiplier go up at the same time, would it look like

{REPLACE "\nM117 Layer 14, Z=" "\nG1 X10 Y5\nM25\nM221 S103 D0\nM117 Layer 14, Z="}

or am I putting that where it doesn't belong?

TIA!

Hello. Great post / thread. I have a Wanhao Duplicator I3 2.1 and am using S3D. I am used to Cura where I could pause the print, change filament color, and restart. Now with S3D, I pasted in the script as per below and all the print is doing is pausing correctly at the specified layer by moving to origin, but then restarts by going right back to where it stopped, presumably for the next layer, thus not allowing any parking of motor, changing of filament, etc. Not sure what I'm doing wrong. Any advice would be appreciated! Thanks in advance!

Here is what I pasted into the script for say changing out the filament color at layer 10 (tried a larger layer height too but same thing):

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 10, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 10, Z="}

Then your firmware doesnt handle the M0 command... in this case, change M0 for M600 and see if it works now.

Hi and thanks for responding! I'll try this. Also I found info on the Wanhao website per the link below that has a different script line (??). Here it is:
{REPLACE "\n; layer 19, Z = " "; layer 19\nG28 Y0 X0\nM300\nM25\nG92 E0\nG28 Y0 X0\n; layer 19 "}

(I'm guessing the above is for pausing at, for example, layer 19)

Here is the link, just scroll down to the info on S3D:
https://3dprinterwiki.info/duplicatori3/pause-at-layer-height/

that is very good to know, i wasnt very familiar with the Wanhao firmware... glad i now know its M25 for Pausing with those.
Thanks for sharing!

One more thing. Tried twice over the weekend with a 3 hr print and it failed both times after prompting to change filament, then hitting "continue print" under the sdcard option on control box. I tried a small 1" x 1" x 1/2" high test print with the newly added "change filament" code per the line above and it worked fine, so I ventured into the larger print. Now it goes all the way and prompts to change filaments (actually just goes to 0,0 which I know means to change the filament as its the correct layer per the script line I set), then I change it, and then choose continue to proceed with rest of print. It goes thru all the motions fine but the only thing (and most important thing) is that it IS NOT EXTRUDING the filament. It did extrude fine with the test print but not with the larger print, which has a higher z value. ???? Not sure why this is, must be something in the slicer S3D causing no filament to come out. Any ideas???

Interesting... i have a few ideas... try again the test cube, maybe 1"x1"x1". I saw your previous code, and i would suggest making some edits to ensure the least amount of things are happening.
First, i would not use G28 X0Y0 on your code, this may end up triggering the end stops more likely. My code uses G1 (move) X &Y close to the front, but just shy of triggering the end stops, that way the machine doesnt reset its location.
Second, i saw you have G92 E0, which may end up messing up your extrusion, i am not 100% sure since now we know your machine doesnt run Marlin like mines.

Third, when i take the old filament out, and i push the new one in, i tend to push enough so i "prime" the nozzle, and as soon as i wipe the tip, i hit continue. It then tends to go back and continue printing.... which doesnt give it time to ooze, and get an air pocket. Always get seamless prints.

**Remember, that the Extruder motor will be on HOLD (locked) so you must be pressing the extruder arm to release the pressure so you can move the filament in and out. (u more likely knew this.)

Try just this and see:

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 9, Z=" "\nG1 X5 Y5\nM25\nM117 Layer 9, Z="}

Great info! I'll try this out tonite. Good suggestions. Here's the normal process I use. I setup the layer in the script where I want the print to pause, then save the gcode to the sd card (for now, getting Raspberry maybe for xmas). The print will go until the layer where its supposed to pause flawlessly. Instead of then "pulling" the filament out which had a tendency to break the filament inside the hot end, I have been doing a reverse extrude with the motor for months w/o issues using Cura for a filament switch. Then I normally hold the extruding lever down and "fish" the new filament into the hot end until it stops, then I use the extruder motor in normal direction to feed it in till it starts to come out. Extrude about maybe an inch or two, wipe off and immediately go to control box and choose sd card / continue.

No prob! Just trying to learn the script adder myself and came across your thread. The guys at S3D are using your thread for the filament changing reference so they must like your info! I'm coming over from Cura when another person posted something for that software in terms of a plug in. That works great but I recently purchased S3D for the features of better support customization and the most important thing that sold me was the tweaking option of process at different layer heights throughout the print (.1 for fine detail and .2 / .3mm for the stuff that doesn't much mattter). Only had my Di3 for a little over 1/2 year so still learning. I use Solidworks for my designs. Thanks again.

They do refence this? HA how cool... Just glad i can help others achieve better results

Yup. I guess your their man lol. Here is a snip from their email to me regarding this subject:

"This is a great post on changing filament mid-print: https://www.thingiverse.com/groups/simplify3d/topic:10525 Essentially, you need to replace the layer comment of the layer you want to stop at, which you can do with the REPLACE command in the post-processing toolbox in the Scripts tab. You can adjust the script in that link to have the print head go wherever you want for the change, and with no M84 to disable the motors, they will be locked when it is at that position. "

Is there a way to get this to raise the z height when you pause? I tend to pause it at a pretty low height for a lot of my prints, and sometimes the filament gets stuck to the heat block because its so low when i switch colors. Thanks for posting this though, helps me out a lot!

Thanks for the post, I'm new to 3D Prints as well as to S3D. Now in Theory if I want to change color to have a different color in the middle of my 111 layers object, then the code should be:

{REPLACE "; layer" "M37 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM37 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM37 Layer 4, Z="}
{REPLACE "; layer" "M74 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM74 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM74 Layer 4, Z="}

That way the second color would have to be changed in layer 37 and then again in layer 74 to the original color.
Am I correct?
Thanks for your help.

Hi everyone, I really wanted my Z to go up 20 mm and I tried to change it several times so I can not. Can any one help? I put something like that

{REPLACE "; layer" "M117 Layer"}
{REPLACE "Z =" "Z ="}
{REPLACE "\ nM117 Layer 593, Z =" "Z20 \ nM0 \ nM117 Layer 593, Z ="}

Can you check if this is correct?

Do you have to go up 20mm??
(also you have an error on the second line, take the space off Z =, should be Z=

Anyways, check my video description again. I just added one more option. if you have latest marlin, like 1.1.5+ i believe, you can use the advanced pause feature instead and that has an option to bring up the Z. I would use that instead of having to add a bunch more code manually. Reason it didnt work for you, its because you have to set relative and absolute positioning when doing that, otherwise, it wont work.

This is the code i use to pause. It raises my z up by 10. {REPLACE "\nM117 Layer 16, Z=" "\nG1 Z+10 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 16, Z="}

Kinda yes. But not sure why you have M37 in there. Should be something like this.

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 37, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 37, Z="}
{REPLACE "\nM117 Layer 74, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 74, Z="}

Got you, I misunderstood the original explanation.
Again,
Thanks

No problem. Just happy to help others overcome the hoops I had to jump at one point or another

One more question. What if I want Z to be at Z10 so I can prime the nozzle?

Should it be?

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
{REPLACE "\nM117 Layer 37, Z=" "\nG1 X10 Y5 Z10\nM0\nM117 Layer 37, Z="}
{REPLACE "\nM117 Layer 74, Z=" "\nG1 X10 Y5 Z10\nM0\nM117 Layer 74, Z="}

I'm just trying to learn as much as I can here.

Kinda.... you want to be mindful of the place where you ask for the color change to take place. For example.. layer 37 its close to 7mm high considering a 0.20mm layer height. So, you can prime anyways.
With your code, its going to ask for the nozzle to move down (or up) to Z10, which may end up with the hot end hitting whatever you printing.
typically you will have plenty space to prime as long as your not changing colors in the first 8 layers.

ok.
I just finished printing a two color spinner for my kid, came out outstanding.
Thanks for your help.

Awesome!, glad it worked for you! Thumbs up

Hi,
Sadly this method doesn´t work for my Prusa i3 mk2 since there is no mechanism allowing to change the filament by hand without any trouble. I've always done it over the menu. But if I use your code, I can't get in the menu, because if I click on the menu button, it automatically continues printing without letting me change filament.
So what I need is, that it moves the extruder away (as it does now) and pauses the print and I have to resume the print by the menu after changing the filament. Also a signal sound would be nice, if possible (my printer is able to do that).
How could I do that? Do you have any advice? It would be really nice! Thank you

You may need to do what I did and manually add "M600" to your color change locations in the GCODE for the MK2 (for information check out the bottom of this article: http://www.prusaprinters.org/easy-color-3d-printing-on-new-original-prusa-i3-1-75-mm-video/)

Thanks for your reply. So in this case, does it look like this?
{REPLACE "\nM117 M600 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 M600 Layer 4, Z="}

Or like this?

{M600 REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nM117 Layer 4, Z="}

I quite don't understand how you meant it

Tested: This works perfectly ON PRUSA ORIGINAL I3 MK2S (I can't validate any other devices).

{REPLACE "; layer 2, Z = " "\nM600\n; layer 2, Z = "}
(where you change the layer number to suit your needs)

Thank you so much, you helped me out a lot!!

No problem, it gave me an excuse to learn something new :D

Ok, just tried it and must say: AWESOME. It just works like the color change of prusa!

I THINK (But need to test) that it would be something more like this:
{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM600\n; layer 4, Z = "}
(where you change the layer number to suit your needs)

The Prusa Original i3 Mk2(s) does not recognize the M0 command as a pause in this dialog, so what I had previously done was saved my S3D project as GCODE and manually edited in the M600. M600 is Prusa's Marlin command for a filament change - which literally lifts the Z, moves it to the side, then beeps loudly at you until you begin following the prompts on the LCD to go through a filament change and purge.

If you are at a place where you can test that replace line, go for it - otherwise I'll try it out when I get home. Or, better yet, maybe someone like @STIG_ will jump in and be the educated voice of reason! :D

Cheers.

Is there a way of doing this per process rather than per layer? I'm not talking about using the advanced settings, still GCODE. Example: Say I have 2 objects on my print bed, but I want each of them to be a different color, your code calls for changing colors at a specified layer height, but is there a code for changing between processes (assuming I've assigned each model to it's own process)?

Absolutely.
Lets assume you have two 20mm cubes, A is on the front and B is on the back of the built plate. Lets assume that Process1 for A. Leave that one alone.
On Process2 for B, you can insert on your starting script G1 X10 Y5 ( Y5 can be Y100 if you want head further back) and M0 on a new line. This will have the same effect.
NOTES:
remember that you cant have all the usual stuff on the starting script such as bed level, home axis etc, because it may crash into model A in the bed.
And also make sure the processes are sequential (of course since you asked for this)

So, this method calls out the known X/Y coords of the second model, correct? (Sorry, I'm just dipping my toes into the code end of this) Is there a way to call it out by process within S3D instead, or is the answer, "you have to print the processes separately"?

Maybe i can explain a bit better.
For what you asked, select in S3D the option where it uses Process1 to print model A, then goes to Process2 to print model B. You can choose this on the pop up once you hit slice.

The code G1 X10 Y5 is simply telling the hot end to move out of the way. The numbers justs tells it where to "park". You can enter whatever coordinate works for your case.
M0 is the actual command to pause the print.

Thanks so much for your advice - I tried M0 and that did nothing, so I found out that my machine (Prusa mk2s) uses Marlin which has the M600 code for changing filament. Unfortunately that also seems to do nothing, and I think here's why (and what I'm asking for now): So I am testing printing 4 process on one layer that I want to all be different colors. They are intertwined, so using the G1 options won't quite do it. In S3D I'm telling all of the processes to slice at once (and it's printing them separately and correctly so long as it runs all the way through with no pause/change), but when I put M600 in the starting script of the 2nd, 3rd, and 4th processes it does nothing (though connecting to the printer and sending M600 directly to the printer gives me the result I'm looking for). I'm just guessing here, but it appears that S3D is NOT looking at the individual process scripts once I have selected more than one and sliced it - but possibly creating a single starting and ending script based on the first and last models? Are there any additional thoughts about this, or suggestions on getting my intended result?

Edit: I have a work-around that (unfortunately) doens't have much to do with S3D. I saved the GCode and then manually edited it. S3D calls each process a "layer" and I was able to add a line for "M600" after each new "layer".

Does this code (or any of the others mentioned here) re-home the X and Y axis?
There is a good chance that the head will get moved, even a fraction, during a change over.
Also, how does one get to the machine settings to unfeed and refeed the filament? Or are you just pulling it out and pushing it in?

**Updated - The original method, doesnt disable the stepper motors for X and Y, so the extruder is not moving from its position. So once you click resume, it goes back where it was.
If you were to add a home X & Y will be pretty simple to this code. For example.
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="}

On S3D u can either CTRL+P or click the icon on the right side. I have tested you can manually click feed E and it does, if you dont do it by hand. I have a bowden, so i feed it by hand softly until it primes. Should be same on direct drives.

Ok Thanks.
So the {REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="} will home and return to the correct position to continue printing after the 'continue' signal?
As for using S3D for controls... i use my FFCP standalone. just insert the SD. select the file and away we go... No computer attached.

Yes it will resume normal.
All you gotta do is change the number 4 (twice on that code) to the layer # you want.

Can you tell me how is it possible to print every process 2layer heigt in diffrent collors? Is this code right? :
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM0\nG1 X0 Y0\nM117 Layer 4, Z="}
What have i to change in the code that it change the filament after every process. An where have i to put the g gode? Start scripte side last box?

Hello M3d_factory.
First and foremost, im not trying to sound mean. But do you understand my original post? If you dont, perhaps read it a few more times. I am not trying to belittle, im trying to see if my next explanation will make sense to you.

If you do understand, here is the short version.
You can take that whole code i posted above and copy it into S3D as you would based on the first layer to make the color change.
You can then re-copy and re paste the same code under the previous one once again and then change the layer number to what you want to make the next color change. You can do this as many times as you wish.

When its all said and done, all this code does, it goes into your Gcode, and enters certain code right before the layer you want.

This works great!
I have add some code to the line so the printer beeps when I have to chance filament.
(M300 Sxxxx Sxxxx)
Sxxxx frequency in Hz
Pxxxx duration in milliseconds

Option A 3th line:
{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 4, Z="}

Option B:
{REPLACE "; layer 4, Z = " "\nG1 X10 Y5\nM300 S1000 P1000\nM0\n; layer 4, Z = "}

Tip:
Place a semicolon for the Option A 3th line or the line in Option B if you need a print without chancing filament.
Example:

{REPLACE "; layer" "M117 Layer"}
{REPLACE " Z = " " Z="}
;{REPLACE "\nM117 Layer 4, Z=" "\nG1 X10 Y5\nM300 S1000 P1000\nM0\nM117 Layer 4, Z="}

Excuses for my bad English ;)

Thanks for the semi colon idea, that will be very handy at just leaving code alone, and only activating it when needed. Thanks!.
Ill see about updating the OP

Hi,
the easiest way to change colors / filament:
in: Advanced Tab / Layer Modifications
Stop printing at hight xx
(switch Heated Bed & Extruder ON) change colors / filament / ...
edit Process:
Start printing at hight xx (remove checkbox in "Stop ..")
see: http://www.thingiverse.com/make:284209

Funny Toilet Sign with background
by Nipsel

Thank you very much Nipsel. Glad see multiple options now.

Im sure "easiest" is a relative term. It all depends on where the user wants to edit many settings, or just add 1 line of code. But now that we have all this consolidated here, they can see what works best for them.

OR, if you have Repetier firmware, you can just edit the GCODE and place M600 at the layer you wish to do a color change.

Repetier lets you edit the Gcode, and shows layer your in (i like that!)
For repetier i insert the following code on the layer i wish to color change. Works great for me.

G1 E-3 F6000 ; retract filament
G1 X10 Y5 F6000; move hot end out of the way
M84 E; disengage E motor
@pause print
G1 X0 Y0 F6000; home X and Y axis
G1 E0 F6000; engage E motor

Thank you for the post, that's a very interesting subject. We also wanted to find official recommendations, a code for colour change in the middle of the print.

Did you try the S3D support team. What you have above looks good and should work. There is a easier way to do this by adding multiple processes and in Advanced setting set when to start and stop printing. Check out https://www.youtube.com/watch?v=H5a-7Pm081k&list=PLN2klu_fubRD4wQq-d067QjkdsNVUueD2&index=15

The multiple process will not work if you have a printer with a probe for bed levelling.
Also you have the heated extruder and bed (if you have a heated bed) up after you're filament change.
So I go for the STIG_ method.

Yes. I have done that multiple process method. It involves editing the end script and start script for both. Then it also matters the way it run your processes. So it introduces more steps that can risk not doing it right. Which drive me to finding a way to just enter one line of code on the layer I wanted and considering it done.
Thank you for your input. Have a great day

This is not working for me.
The Wanhao D6 ignores this code.
It just keeps on printing.

Iwonder if your firmware doesnt recognize M0..... Perhaps you can replace M0 with M600 to see if it does?

Wanhao printers ignore the m600 commands as well. lol
Maybe I must start with G91,G1,G90,M25

The following gcode commands are recognized by ReplicatorG – Sailfish as well as any slicers which use GPX to convert gcode to S3G/X3G.

Pause at ZPos:
M322 Zzzz.zz
Maybe that will work instead of M0

Gotcha..
if you print from USB, can you start a test cube print, when its running then send a pause command and see what code the host sent to the printer? perhaps you can catch the command sent....