Add Command `M600` in Your G-Code File

Step 1, Find the layers in Snapmaker Luban.

After you generate G-code in Snapmaker Luban, you can see the number of layers in the 3D printing section.


Please find the layers in which you want to change the colour.

Step 2, Insert M600 in G-code file

You can find use Ctrl + F to find the layers, in which you want to switch the filament, and then insert M600 before the layers start.

For example, if you want to switch the filament in layer 11, you need to insert M600 when layer 10 ends.

17 Likes

This is a great start, but is there any way to add a terminal so we can enter the changes to G-Code in the window rather than opening a code editor and saving?

1 Like

The big new thing is the ability to run the code M600!
In other slicing software the color change code can be added automatically.

So I’ve entered M600 properly. The printer stopped and allowed me to switch the filament which I did but how will it resume? It just stays in place once switching?

@nissguy @rojaljelly
Sorry that I was out of the office yesterday.

Our software team is planning to add the automatically switch layer feature. We have been aware that the change-filament feature means a lot to users.

Sorry for the inconvenience.

Happy International Labors’ Day.

Edwin

3 Likes

You can load the new filament and then resume the print via the touchscreen.

It is the same mechanism with the filament run-out feature.

Edwin

Works as advertised-I tried a couple of experiments with this over the weekend:

This was 2 colour changes manually added to the gcode, which is a little more obvious in profile (the ball at the top was printed separately and glued on):

7 Likes

Nice work. Thank you for sharing your print.

We plan to add this feature in Snapnamaker Luban so that you can insert the M600 in the software.

Edwin

3 Likes

Hi,

Thanks to the Team for the new command, very useful.

I did modify a script for Ultimaker CURA.

Unzip the script file and save it in the folder “C:\Users\USER\AppData\Roaming\cura\4.9\scripts” (change the path to reflect the name of your “USER” on your computer).

Start or Restart CURA.
To use the script in CURA, go to “Extensions” then “Post Processing” then “Add a script”. Select the script “Filament Change SnapMaker 2” in the list.

You can now enter the layer number at which the change(s) will occur (at the beginning of the layer).
You can enter multiple layers changes with a coma (,). For example you can set “5,10,15,30” to have 4 filament changes.

This is just a cleaning of unnecessary parameters in the original Ultimaker script, but I will add the possibility to change temperature in the next release, to print Multimaterials as it was my first use case and done it manualy.

Edit : Rewrite it all now that i have the possibility to attach files.

Interested in using the M600 but having not used VS Code before how do you get the Layer list column on the left and the G-Code in the column on the right, I just get the G-Code when I open it.

The left column is the result of doing a search for “layer”
ctrl-F shortcut (on Windows & Linux at least)

You’ll get something similar in any text editor. It doesn’t have to be VSCode

The layer numbering in Luban does not correspond with the layers in the G-Code. For starters, Luban starts with layer 1, G-Code starts with 0. If there’s a raft, G-Code starts in negative numbers when Luban starts at 1. Even with a model with no adhesion assistance, Luban shows 5 or 6 layers less than are in the code. Can you explain the numbering system please.

When do you expect the release of that to be

1 Like

Has anyone tried to do this recently? I had this working a few days ago, then it suddenly stopped working. The printer goes right past the M600 code without doing anything. I’m not sure if it’s something I’m doing, or the latest firmware. Anyone happen to know?

I used it this past weekend (after a firmware update) and it worked, same as before. Are you sure you put the command on a new line and not a comment?

3x Sprit Tokens 62p.gcode (1.1 MB)
Would it be too much to ask you or someone to take a look at this bit of Gcode? I have tried like 10 times now and can’t figure out what I’m doing wrong. I thought I was onto something there for a bit - Notepad++ was inserting \n instead of \r\n for each new line - but I’ve made them match what is output by the Luban slicer and I still can’t get it to pause.

That looks correct to me, and I just checked the last print I did with M600, and here’s what I inserted:

G0 X137.039 Y139.941
G0 X137.094 Y139.922
G0 X136.998 Y139.897
M600
;TIME_ELAPSED:8943.722921
;LAYER:27

Looks the same as your file. Are you sure your controller/heads are on the latest firmware? You might try a USB upgrade with the 3dp head attached (download the latest FW to USB, boot with the 3dp head attached, and select the file to upgrade) just to make sure. There was a release a while back that needed to upgrade the head firmware as well, and I can’t remember if it prompted you to do anything if you changed heads. It also wouldn’t work over wifi-had to be a local USB upgrade.

Possibly another thing to try-does your filament runout sensor work? Try cutting the filament off while printing and see if it detects the runout. It’s distinctly possible that if the sensor is broken/not detected that the runout command won’t work.

Hello all,

I cannot seem to get the M600 command to work either. I have the latest firmware version of V1.13.2 and tried re-loading it via USB. I have confirmed that the filament runout sensor is working properly as well.

I’ve tried inserting the command into a few different Gcode files and also directly through the Luban command console. All other commands work as expected except M600 that it seems to completely ignore.

Any suggestions on what else to try? Maybe going to an older firmware version?

Thanks!

I just learned that you can’t use this if you start the print from Luban. Send the file to the printer and start it from the touch screen.

2 Likes

wow, so good smartwork