GregFisk25
Posts: 17
Joined: Thu Mar 06, 2014 4:15 am

Pause @Z

I am sure that this was advertised as a feature, but I have been searching now for ages.
Can someone please tell me how to add multiple Z pauses?
Dean
Posts: 6
Joined: Mon Jan 04, 2016 7:03 am

Re: Pause @Z

For Makerbot/Sailfish firmware:

If you only want to pause at one location, lets say at 20mm then at the end of your Start GCode (under the scripts tab) you can add the following command line

Code: Select all

M322 Z20.0
If you want to pause at multiple location, there is also a way to script this using GPX. At the end of Start GCode (under the scripts tab) you will see a reference to

Code: Select all

M73 P1 ;@body (notify GPX body has started)
Move the body macro to a separate line, and place some pause macros in front of it. For example if you wanted to pause at 3mm and 6mm do the following:

Code: Select all

M73 P1
;@pause 3.0
;@pause 6.0
;@body (notify GPX body has started)
M71 Pause activity and display message, resuming build on button push. Optional timeout specified by P-code in seconds. If timeout is specified and no button is pushed, machine should shut down or reset.

Ex.: M71 (Please insert motor into assembly and push a button.)
Ex.: M71 P20 (Machine will reset in twenty seconds!)
Last edited by Dean on Thu Jan 07, 2016 6:07 am, edited 1 time in total.
CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Pause @Z

If you're using MakerBot/Sailfish firmwares, then you can do this on the LCD panel. It allows you to setup pause locations using the printer buttons.

If you're using a Marlin or other RepRap printer, then you can just add a M0 command in your gcode wherever you want Simplify3D to pause (of course, this assumes you are printing over USB using S3D). And even better, the program will automate inserting these commands. For example, let's say you want to pause at layer 50 and layer 100. Just add the following 2 lines into your "commands for post-processing" section on the Scripts tab
{REPLACE "; layer 50," "M0\n; layer 50,"}
{REPLACE "; layer 100," "M0\n; layer 100,"}

That will automatically insert the M0 commands. Then when you print that file with Simplify3D, it will automatically pause when it reaches those locations so that you can do whatever you need (such as change filament, etc).

One more tip - you can use the Preview Mode set to "by layer" to see what layer you want to use for the pause
Last edited by CompoundCarl on Thu Jun 09, 2016 8:05 am, edited 1 time in total.
GregFisk25
Posts: 17
Joined: Thu Mar 06, 2014 4:15 am

Re: Pause @Z

Thats brilliant Dean, thanks so much. This really needs to be in the documentation.

Thanks again, to both of you :)
Skimmy
Posts: 10
Joined: Mon Feb 01, 2016 2:24 pm

Re: Pause @Z

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

does not work.

It does get put into the settings-part in the gcode and looks like this:

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

But when looking at the code around layer 50, the M0 command doesn't show up...
andrewk72
Posts: 161
Joined: Fri Apr 29, 2016 5:43 am

Re: Pause @Z

Correct. That should not work. There are no lines in your gcode file that say "; layer 50[End of line]". The layer tags look more like "; layer 50, Z = 25.1[End of line]". So if you just change it to {REPLACE "; layer 50" "; layer 50\nM0\n"} then it would work. You just need to remove the \n from the first part of the command.
razster
Posts: 54
Joined: Wed Aug 05, 2015 4:48 pm

Re: Pause @Z

The new version supports commas in the post-processing commands, so personally, I would use the following to add a pause at layer 50

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

That will put an M0 command right before the layer 50 tag, and the comma helps make sure it only matches layer 50 and not 500, 501, etc

There's lots of other goodies in the new update I haven't looked through yet, but I can already see how this one would be useful :D
CompoundCarl
Posts: 2005
Joined: Wed Aug 05, 2015 7:23 am

Re: Pause @Z

razster wrote:The new version supports commas in the post-processing commands, so personally, I would use the following to add a pause at layer 50

{REPLACE "; layer 50," "M0\n; layer 50,"}
I've used this same syntax many times. But I can see what you mean about layer 50 vs 500. Being able to add that comma now will help.
cbarry
Posts: 31
Joined: Thu Apr 18, 2019 1:52 pm

Re: Pause @Z

To clear up a problem, noted earlier, about REPLACE not modifying the line.

The reasoning is that the person was looking for "; layer <num>,\n", and of course the newline was not to be found there. You can as others have noted put the changes before the layer comment, but I like it after the layer comment, so it's contained in that layer's definition. Anal? maybe...

Here is the incantation of the command that I use:

Code: Select all

{REPLACE "; layer 151," "; layer 151 - Preparing to change filament,\nG28 X\nM0\n;"}
The reason is as follows: In the normal generated gcode, the comment line will be:

Code: Select all

; layer 151, Z = 30.002
When we replace "; layer 151," we are only replacing that part of the string; the "Z = 30.002" part does not get replaced. By including a final "\n;" at the end of the replacement, the "Z = 30.002" will become a comment at the end of it, like so:

BEFORE:

Code: Select all

; layer 151, Z = 30.002
AFTER:

Code: Select all

; layer 151 - Preparing to change filament,
G28 X
M0
; Z = 30.002
Hope that may help someone.

Cheers,
Christopher

Return to “General Discussion and Tips”