DotScott1
Posts: 13
Joined: Wed Mar 21, 2018 5:33 pm

Pause at Height (NOT LAYER)?

Fri Dec 07, 2018 1:38 pm

Hello,

So I've been searching around and so far, all I can seem to find is a commend (below) for pausing the print at a certain LAYER, but I have not seen a command to pause the print at a certain HEIGHT. Is this possible?

Here's what I have to pause at a certain LAYER:

{REPLACE "\n; layer 22, Z = " "; layer 22\nG28 Y0 X0\nM300\nM25\nG92 E0\nG28 Y0 X0\n; layer 22 "}

Can I replace "Layer" with something that will stop it at a specified height?

Here's the problem: I can pause a single model at layer 20 and it works fine... but if I try to print 2 of those models, it then stops at layer 10. I can try to double that but then it only stops for one model instead of both... so on the other model, it will stop before or after that layer but not on it. Kind of difficult to explain but if you try it, you'll see. This is why I was wondering if it's possible to just stop it at a certain height instead of layer number.

One other thing: I'd like it to go to position X200 Y400 instead of homing. Anyone know what to replace the G28 commands with to achieve this?


Any tips or advice would be much appreciated!

DotScott1
Posts: 13
Joined: Wed Mar 21, 2018 5:33 pm

Re: Pause at Height (NOT LAYER)?

Tue Dec 11, 2018 12:38 pm

Anything? ... :(

B-H-S
Posts: 35
Joined: Tue May 15, 2018 2:49 pm

Re: Pause at Height (NOT LAYER)?

Tue Dec 11, 2018 1:48 pm

I personally would alter the Gcode at the given layer (height) you want to stop at then place the command to pause, that is what I do, from your example are you creating a script to do this,, if so I think that's too complicated for me.. and I would do two prints.

DotScott1
Posts: 13
Joined: Wed Mar 21, 2018 5:33 pm

Re: Pause at Height (NOT LAYER)?

Tue Dec 11, 2018 4:22 pm

B-H-S wrote:
Tue Dec 11, 2018 1:48 pm
I personally would alter the Gcode at the given layer (height) you want to stop at then place the command to pause, that is what I do, from your example are you creating a script to do this,, if so I think that's too complicated for me.. and I would do two prints.
Well, that's basically what this script is doing. The only problem is that it counts the first layer of the first object as layer one, then the first layer of the next object as layer two, etc. So if I stop it at any given layer (instead of height), it pauses only one one single object's layer... but not the rest.

And I know I can print one object at a time and do this but... I have hundreds of these things to print :| I would have to babysit it constantly and it would take a lot longer (with startup times, etc. Not really an option :\ I may just have to take a hit and do maybe 1/3rd the amount of objects at a time and print sequentially. Would take a while to even setup the sequential print, stopping at the appropriate layer for each model though (since it continues to count up layers as it goes from object to object).

I just feel like there has to be some other way to stop it at a given height.... also attempting to do it through octoprint... might have better luck there.

greybeard
Posts: 162
Joined: Mon Mar 02, 2015 1:23 pm

Re: Pause at Height (NOT LAYER)?

Tue Dec 11, 2018 5:02 pm

If you dig deeper into it, you'll find there are G & M codes for pausing at Height. However, Codes, while they generally work across several machines, not all facilitate the full list of codes.

Example: M26 pauses an SD card print
Here's a good link with indicators on what machines work/don't work with certain codes. You did not post your machine/firmware type...

https://reprap.org/wiki/G-code#M25:_Pause_SD_print

If looking at the M26 example, you'll see a link to another Mcode for Pausing where a further comment is provided...

Lastly, a 'Cheater' approach that I sometimes use:
I built my machines and setup the switch to check for broken filament to accommodate this - I don't always use the switch for checking broken filament: The switch is adjustable at any height and there's a short piece of filament, tied to a wire that gets pulled at desired height. That trips the switch and causes a Pause for changing a broken filament and moves the head to front for loading.
It's simply a poorman's approach but, it works.

If you built something like that, you could print a zillion parts and when the switch trips, bingo, you're stopped at the desired height... The ability to do this depends on your machine and your abilities...

FOLLOW-UP My other machine does not have the wire to pull the filament out of the switch (I seldom use that PETg/ABS dedicated machine). But, just to show you the simplicity of doing similar, I just did this - simply mount the switch (with double-sided tape) and fed a section of filament through it. When the switch triggers at the filament's end, Pause happens. So, the only real dialing-in is to determine the height to cut on the green filament in the photo... you get the idea....
Attachments
Pause.png
3D Print Parts
https://www.thingiverse.com/Still_Breathing/designs

mroek
Posts: 144
Joined: Mon Oct 26, 2015 1:47 pm

Re: Pause at Height (NOT LAYER)?

Tue Dec 11, 2018 6:26 pm

DotScott1 wrote:
Tue Dec 11, 2018 4:22 pm
B-H-S wrote:
Tue Dec 11, 2018 1:48 pm
I personally would alter the Gcode at the given layer (height) you want to stop at then place the command to pause, that is what I do, from your example are you creating a script to do this,, if so I think that's too complicated for me.. and I would do two prints.
Well, that's basically what this script is doing. The only problem is that it counts the first layer of the first object as layer one, then the first layer of the next object as layer two, etc. So if I stop it at any given layer (instead of height), it pauses only one one single object's layer... but not the rest.

And I know I can print one object at a time and do this but... I have hundreds of these things to print :| I would have to babysit it constantly and it would take a lot longer (with startup times, etc. Not really an option :\ I may just have to take a hit and do maybe 1/3rd the amount of objects at a time and print sequentially. Would take a while to even setup the sequential print, stopping at the appropriate layer for each model though (since it continues to count up layers as it goes from object to object).

I just feel like there has to be some other way to stop it at a given height.... also attempting to do it through octoprint... might have better luck there.
This is still not clear to me. Unless you print multiple objects sequentially, there is a fixed relationship between layer count and Z height, and pausing should not be an issue, even if you will have to find the correct layer number for the height you want to pause at.

If you need to print sequentially, then S3D does count layers for every object, and you will need to edit the G-code manually to insert the pause commands at the correct height (by searching for the Z height comment that S3D outputs).

But again, I'm still not sure I get the problem correctly. Maybe create a factory file with a couple of objects on the build plate and describe exactly what you want to happen and when to pause?

mroek
Posts: 144
Joined: Mon Oct 26, 2015 1:47 pm

Re: Pause at Height (NOT LAYER)?

Wed Dec 12, 2018 8:17 am

Here's a solution that should work to insert pauses at a specific height:

If your system doesn't have sed (Windows usually don't) you need that. On my Win10 computer I downloaded a native x64 version from here:

https://github.com/mbuilov/sed-windows

Then I placed the downloaded executable in a folder, in my case "C:\Programs\sed". Then I renamed the executable to be called just sed.exe, so the complete path to the executable becomes:

"C:\Programs\sed\sed.exe"

Now you are ready to insert the necessary magic to the post processing scripts tab, here's an example

"C:\Programs\sed\sed.exe" -i "/Z = 4.400$/a; first line to add\n; Second line to add\n; Third line to add" "[output_filepath]"

In this example, for every comment line in the G-code that ends with "Z = 4.400" (the green text), three additional comment lines will be added after that line, outlined in blue. Change only the colored parts of the command, don't touch anything else. Note that the double quotes around the executable path isn't strictly necessary here, but if you have spaces in the path, you need them.

So for your initial request, the equivalent command would become:

"C:\Programs\sed\sed.exe" -i "/Z = 4.400$/aG28 Y0 X0\nM300\nM25\nG92 E0\nG28 Y0 X0" "[output_filepath]"

You would of course need to edit the height to whatever height you want. And there's also the caveat that the height entered must match the actual height comment in the file. If you use a layer height of 0.3 mm for instance, then you will never see a height of 1.000 mm in the file, so make sure you make the height a multiple of your layer height. You can of course also just find the actual height in the preview from within S3D.

For multiple heights you want to pause, add multiple lines of the above command. Since the command looks for the layer height comment instead of the layer number, it will work also for sequential printing.

DotScott1
Posts: 13
Joined: Wed Mar 21, 2018 5:33 pm

Re: Pause at Height (NOT LAYER)?

Wed Dec 12, 2018 6:22 pm

HA! No kidding!... this was just fixed with the latest update (4.1.1)!! WOO! Wow I just downloaded the latest software today and this problem is just... gone. Everything works perfectly now because it counts the first layer of ALL objects on the bed as layer one (instead of layers 1, 2, 3, etc). Aahhhh yesss. This is awesome. Problem solved thanks to the S3D devs :)

Thank you to everyone who commented and tried to help though!! Really appreciate all the suggestions.

mroek
Posts: 144
Joined: Mon Oct 26, 2015 1:47 pm

Re: Pause at Height (NOT LAYER)?

Wed Dec 12, 2018 7:00 pm

DotScott1 wrote:
Wed Dec 12, 2018 6:22 pm
HA! No kidding!... this was just fixed with the latest update (4.1.1)!! WOO! Wow I just downloaded the latest software today and this problem is just... gone. Everything works perfectly now because it counts the first layer of ALL objects on the bed as layer one (instead of layers 1, 2, 3, etc). Aahhhh yesss. This is awesome. Problem solved thanks to the S3D devs :)

Thank you to everyone who commented and tried to help though!! Really appreciate all the suggestions.
I must admit I really don't get this. If you use sequential printing, it still outputs consecutive (and unique) layer numbers, so the first layer of object 1 is numbered as layer 1, but the first layer of object 2 will not be numbered as layer 1, even if the Z height is back down to the build plate.

If you are not printing sequentially, the layer numbering is what it has always been, nothing changed in 4.1.1 for that. And in that case the layer number is always corresponding to a multiple of the Z height.

So while I am happy that your issue appears resolved in the latest version, I am still curious what the problem really was, because that is still very unclear. Do you have a factory file that exhibits the problem in 4.0.1 (or 4.1) and not in 4.1.1?

DotScott1
Posts: 13
Joined: Wed Mar 21, 2018 5:33 pm

Re: Pause at Height (NOT LAYER)?

Thu Dec 13, 2018 12:08 pm

mroek wrote:
Wed Dec 12, 2018 7:00 pm
DotScott1 wrote:
Wed Dec 12, 2018 6:22 pm
HA! No kidding!... this was just fixed with the latest update (4.1.1)!! WOO! Wow I just downloaded the latest software today and this problem is just... gone. Everything works perfectly now because it counts the first layer of ALL objects on the bed as layer one (instead of layers 1, 2, 3, etc). Aahhhh yesss. This is awesome. Problem solved thanks to the S3D devs :)

Thank you to everyone who commented and tried to help though!! Really appreciate all the suggestions.
I must admit I really don't get this. If you use sequential printing, it still outputs consecutive (and unique) layer numbers, so the first layer of object 1 is numbered as layer 1, but the first layer of object 2 will not be numbered as layer 1, even if the Z height is back down to the build plate.

If you are not printing sequentially, the layer numbering is what it has always been, nothing changed in 4.1.1 for that. And in that case the layer number is always corresponding to a multiple of the Z height.

So while I am happy that your issue appears resolved in the latest version, I am still curious what the problem really was, because that is still very unclear. Do you have a factory file that exhibits the problem in 4.0.1 (or 4.1) and not in 4.1.1?
Actually... I think I figured out the problem. It appears that when you have a single object with multiple processes throughout (Process A goes to 5mm height, then process B starts at 5mm height) it tends to screw up the pausing script. At least when I copy that object (and it's multiple processes) anyway. Somewhere along the way I switched it to where the object only had one, single process instead of multiple and maybe that's what solved the issue. Not sure if that's a bug or just something in the script I was trying to run but... this works for now.

Return to “General Discussion and Tips”