Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Stopping and starting at layer X to change filament

Thu Jul 14, 2016 5:32 pm

I know that I can get Simplify 3D to print up to a certain layer, and then change the filament and print again using the "start printing at" control. The problem is that the design of my printer makes homing while something is on the buildplate problematic. I have an Airwolf HD2X. The XY nozzle is on rods that get in the way when the machine homes Z.

I know that I can prevent homing by getting rid of the G28 Z0 command in the starting script. Then it will home X and Y, but not Z. This is acceptable since the Z axis is unlikely to move while I change filament.

If I do this, where will the printer start printing? Will Marlin assume that it has homed, and then move up to the "start printing at" from the level it is already at giving me a mess?

Is there a way to tell it where it is so that that doesn't happen?

CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Stopping and starting at layer X to change filament

Fri Jul 15, 2016 7:15 am

I would just insert a M0 command wherever you want to stop. That will pause the print just as if you clicked the Pause button in the machine control panel, so then you can do whatever you want.

For example, if you want to pause at layer 50, add the following into your "commands for post-processing" section (on the Scripts tab)

{REPLACE "\n; layer 50," "\nM0\n; layer 50,"}

That will add the M0 command right before layer 50 starts so that you can change the filament. If you want to home the XY axis as well, then put the following:

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"}

Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Re: Stopping and starting at layer X to change filament

Fri Jul 15, 2016 9:53 am

"I would just insert a M0 command wherever you want to stop. That will pause the print just as if you clicked the Pause button in the machine control panel, so then you can do whatever you want."

It is nearly impossible to insert a new filament without bumping the XY, so XY needs to home after I change filament. It can be done, but if the filament gets caught in the Bowden tube, I have to take the Bowden tube off, and that can't be done without bumping XY. This is the biggest drawback to a Bowden tube. If I can get this set, at least I can change filament at a planned time without worry.

I notice the G92 Z.10 command. That actually looks like it might do what I want, but I'm a little concerned about what I want to set Z to, because I'm not certain why it is set to 0.10 after homing. I would think that it should be set to 0.0. I think that if I delete the G28 Z commands, and change G92 Z5 (assuming I'm changing filament at 5 mm), that should do it. But maybe I want to set it to G92 Z5.1, because I'm not clear on why there is a G92 z.10 in the start script.

Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Re: Stopping and starting at layer X to change filament

Fri Jul 15, 2016 11:06 am

"hat will add the M0 command right before layer 50 starts so that you can change the filament. If you want to home the XY axis as well, then put the following:

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"}"

I'm sorry, I missed this part. Can you show me what this looks like in the script? I have no experience editing the script. I think you are saying that I should add:

REPLACE "\n; layer 50," "\nM0\n; layer 50,"
REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"

into the area below the Script tabs labelled "additional terminal commands for post processing".

Or should I add:

{REPLACE "\n; layer 50," "\nM0\n; layer 50,"}
{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"}

I'm not familiar with the syntax. Also, Can I add multiple stops? Ultimately, I'd like to print a "rainbow" of colors. If I threw in:

{REPLACE "\n; layer 50," "\nM0\n; layer 50,"}
{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"}
{REPLACE "\n; layer 100," "\nM0\n; layer 100,"}
{REPLACE "; layer 100," "G28 X0 Y0\nM0\n; layer 100,"}

Would it stop at layer 50, and then again at layer 100?

CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Stopping and starting at layer X to change filament

Sat Jul 16, 2016 6:32 am

More info about the syntax is explained here: viewtopic.php?f=8&t=1959

The "\n" character represents a new line, so all it does is replace the layer comment in the gcode file with a new command, and then moves the old layer comment onto a new line. And you don't need both of the commands I listed above, just one or the other. If you want it to home before pausing, then use just the second one.

So yes, if you placed these 2 commands in your "commands for post-processing" section, it would home and pause at layer 50 and then again at layer 100

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; layer 50,"}
{REPLACE "; layer 100," "G28 X0 Y0\nM0\n; layer 100,"}

Add those commands, then click Prepare to Print and then click "Save Toolpaths to Disk" and then open up the exported gcode file in a text editor. Do a "Ctrl+F" search for "; layer 50," and you can verify the commands that it added.

Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Re: Stopping and starting at layer X to change filament

Mon Jul 18, 2016 10:36 am

Reading up, I just noticed that the M0 command will turn the temperature down to 0. I can't change the filament that way. Can I add a M109 S220 to this code to set the temperature after the M0? Come to think of it, it should home after I change the filament, not before. I don't think this will work right.

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; M109 S220\n; layer 50,"}
{REPLACE "; layer 100," "G28 X0 Y0\nM0\n; M109 S220\n; layer 100,"}

andrewk72
Posts: 161
Joined: Fri Apr 29, 2016 5:43 am

Re: Stopping and starting at layer X to change filament

Tue Jul 19, 2016 6:30 am

Beeblebrox wrote:Reading up, I just noticed that the M0 command will turn the temperature down to 0.
That is not correct. It doesn't drop the temperature unless you explicitly add something like M104 S0 before you send the M0 command. The M0 on it's own is literally the EXACT same as just pressing the pause button in the software.

Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Re: Stopping and starting at layer X to change filament

Tue Jul 19, 2016 10:54 am

OK, good. I still want it to home X and Y after I change filament. So I think I should change the command to:

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n; G28 X0 Y0\n; G92 X0 Y0\n; layer 50,"}
{REPLACE "; layer 100," "G28 X0 Y0\nM0\n; G28 X0 Y0\n; G92 X0 Y0\n; layer 100,"}

The G92 may be superfluous, but my assumption is that I will move the XY while changing filament. Also, I notice sometimes you are using a semi-colon to separate commands, but sometimes it's just a newline "\n", so my syntax may be off again.

Beeblebrox
Posts: 6
Joined: Thu Jul 14, 2016 12:57 pm

Re: Stopping and starting at layer X to change filament

Tue Jul 19, 2016 4:31 pm

Reading some more, it looks like the semi-colon is just for commenting after the line. So I need to remove most of those semi-colons.

{REPLACE "; layer 50," "G28 X0 Y0\nM0\n G28 X0 Y0\n G92 X0 Y0\n; layer 50,"}
{REPLACE "; layer 100," "G28 X0 Y0\nM0\n G28 X0 Y0\n G92 X0 Y0\n; layer 100,"}


Incidentally, I understood that the M0 command shut the heaters off from here: http://reprap.org/wiki/G-code#M0:_Stop_ ... ional_stop

I may be misunderstanding it though, so I'll give this code a shot when I get a chance. I do wonder how this will work through VIKI 2.0. I generally print from the Micro SD card.

glassy
Posts: 1
Joined: Wed Jul 27, 2016 9:22 am

Re: Stopping and starting at layer X to change filament

Wed Jul 27, 2016 9:27 am

I am using a Raise3D Plus dual printer.
This printer has an embedded instruction to pause the print which can be called by placing an M2000 gCode before a new layer.
When printer encounters this gCode it activates an internally embedded routine (as if the pause is requested from the touch-screen).
So using the {REPLACE "... mechanism it is quite simple to insert stops for filament changes into the gCode file.

Return to “General Discussion and Tips”