Pause at layer end

Hi there, yesterday I had an issue, where I had to stop my print because I had started a bad file. I wanted to split the correct file at a certain point to continue with the print. That was no problem, but the problem I had was to stop the print at a defined point.

So it would be cool to have a button, maybee on the GCode Viewer page, where I could stop or pause the print after the layer is finished.

Greetings
Martin

2 Likes

I start developing such a Plugin: see https://github.com/OllisGit/OctoPrint-PauseAt

The idea is to stop the print on different "actions": layer, height, button-click

  • execute a predefined pause gcode
  • click resume-button
  • execute a predefined resume gcode

At the moment I am really busy, so it could take some time to finish.

BR
Olli

2 Likes

Actually, that would be very handy: to have an option or override for PAUSE which will finish the current layer and then pause. And it would be good if it told you which layer was just finished, having done so.

I actually have a program that will split gcode files, but it probably only works with Cura 2.3.1 or close.

Cura 15.0.4 has a plugin for "pause at height", but, not for layer. It does move the print head out of the way so that you can insert parts into the print, which is nice, but, you can only use it once per print.

I've used it to insert a safety pin into a part once, but, I had to run the whole print first to find out where I wanted it to pause when I actually inserted the pin
AvengersPin2small

It was convenient, but, there must be a better way

Honestly, I tried the Cura pause-at-height/z/whatever and it didn't properly manage the G90/G91 and drilled my hotend into my plastic bed. I didn't need any more testing before removing that script mod in Cura.

If you could provide the GCODE that was inserted into your file by that script then I could take a look at what they did.

Let me look...

Ack, it's python that they've used to edit the gcode, and the gcode is 29,000 lines, but, hmm

I wonder if this might be it..

No promises, just guessing...

It looks a little funny but that M83/M84 pair suggest that this was inserted, along with that M0.

My thoughts exactly. Plus the existence of the "X190 Y190", which is where the head temporarily parks while waiting for the M0

I set it for 5MM, what I don't understand is how "Layer85" equates to 5MM

Please forgive me if I've gotten all of this wrong. I know absolutely NOTHING about gcode, and only wrote my very first line of python just this week while trying to figure out how to get an SB Motor Board to run my Omnibot 2000, which, BTW, I've gotten absolutely nowhere with

I think I'm gonna take the head off and put a Darth Vader mask on him

It won't help me write the python any better, but , it'll look cool

I found this function before and I allready used it. But I have to plan the pause before I start the print. In my case I wanted to interrupt the print, because I found out, that I started a bad file.

By the way, as you mentioned, Cura can only insert one pause. But when you save the gcode file twice with different pause heights, you can merge the two files with a good editor and the result is a gcode file with 2 pause heights. Worked good in my case, where I printed a plate with three different color layers.

By the way, as you mentioned, Cura can only insert one pause.

What version of Cura are you using? With the version I have, I can insert as many pauses as I want.

I'm using Cura 15.04.6. Maybee not the newest, but it works for me.

My 3D printing experience doesn't go that far back :smile: so you may be right that it only allows one pause.

Here's my take on that, for what it's worth:

;LAYER:85
;TYPE:CUSTOM                               # 1st line of their insert
M83                                        # Extruder relative mode
G1 E-1.000000 F6000                        # Retract 1mm
G1 Z15 F300                                # Park above &
G1 X190.000000 Y190.000000 F9000           # Move away
M84 E0                                     # Stop the idle hold
M0                                         # Full stop (& then you Resume)
G1 E1.000000 F6000                         # Extrude 1mm & then
G1 E-1.000000 F6000                        # Retract another 1mm
G1 X105.409000 Y119.758000 Z6.730000 F9000 # Move closer
G1 E1.000000 F6000                         # Extrude that 1mm from before
G1 F9000                                   # Set the movement speed
M82                                        # Extruder absolute mode
G1 F2400 E1064.89482                       # Re-initialize the extrusion
                                           # amount saved from before
G1 Z6.770                                  # Move to .04 above start
G0 F9000 X102.995 Y119.758 Z6.730          # Get ready to begin again
1 Like

Cool. You speak GCODE.

Do ya also speak Klingon ?

And how did you get G1 Z6.770 = .04 above start ?

Is the .04 in MM ?

Was that a calculation of stepper motor action ?

I do have the newest Cura, but, first of all, there are so many settings that it's just plain confusing, and I like the settings that I've currently got in my 15.04.6, and secondly, and probably most importantly, Octoprint allows you to import settings from Cura to use in its own slicer, which I find quite handy at times, BUT, only if you don't go any higher than version 15.04.6

Cura did a major overhaul after that, and the built in slicer gets as confused as I do by those settings

It's for those two reasons that I'm sticking with the older version

OK, call me a nerd :nerd_face: but I downloaded Cura 15.04.6 and have the following observations:

  1. You can have more than one "Pause at height", just click the plugin for as many as you want.
  2. "Pause at height" is brain-dead and gets confused with Z changes in the start gcode

Attached is an updated "Pause at height" that fixes that. Due to discourse not liking .py or .zip, I added a .log to the file name. You will have to remove that after you download it. Open Cura, go to the Plugins tab and at the bottom, click on "Open plugin location". Rename the old one (PauseAtZ.py.orig), put my modified, renamed version in that directory (you will need administrator privileges to do that). Close and open Cura and you should be good to go.

pauseAtZ.py.log (3.7 KB)

I inserted the "Pause at height" plugin twice, but I found only one pause in my gcode file. You can insert the plugin more than once, but it is only working one time.

Did you change the height of the second instance of the plugin? Here's what I did:

  1. Install Cura 15.04.6
  2. Start Cura, define a printer
  3. Load a file to slice, 3DBenchy.stl
  4. Click on the plugins tab
  5. Click on Pause at height 3 times
  6. Change the height of the second instance to 10
  7. Change the height of the third instance to 15
  8. Save the GCode
  9. Look at the GCode and discover that Z heights of 5,10, and 15 all occur in the start gcode.
  10. Go back to Cura, change the heights to 20, 30, 40.
  11. Save the GCode
  12. Look at the Gcode and see custom commands at Z=20, 30, and 40.
  13. Modify the PauseAtZ.py to fix the start gcode problem.
  14. Open Cura again, change the heights to 5,10,15.
  15. Save the GCode
  16. Verify that my fix worked and there are 3 custom command sections at Z=5, 10, and 15.

That little magic trick was called subtraction. ha

G1 Z6.770                                  # Move to .04 above start
G0 F9000 X102.995 Y119.758 Z6.730          # Get ready to begin again

It's just the 6.770mm - 6.730mm = 0.04mm.

Actually... not seeing more than one

If I raise the height in MM, the custom moves up in layer height, but, I still see only one custom

I probably did something wrong (I did mention that I have no idea what I'm doing, didn't I ?)