Hi, what plugin could I get so that I could have it pause at a specific layer height to do a filament change, like at 0.8mm it would pause, I swap filament and resume printing. Which plugin would suit this?
You would normally do this within the slicer directly, but I have made a plugin called Pause Management that you can add your own pauses, but also requires some changes to the slicer for it to be able to work.
Something weird I noticed is this: I pause the print (manually) and swap the filament. I flush out all of whatever color, and then I click "Resume." It makes this grinding noise, retracting very fast, and then nothing comes out, but it retracts and detracts. What am I doing wrong here?
My GCODE Scripts:
After print job is paused:
M107 ; Turn off the fans
G91 ; Relative positioning
G1 Z+10 F300 ; Move the nozzle up 10mm
G90 ; Absolute positioning
G1 X0 Y0 F300 ; Move the print head to the front left corner (adjust as necessary)
Before print job is resumed:
M104 S[first_layer_temperature] ; Set nozzle temperature to last used temp
M140 S[first_layer_bed_temperature] ; Set bed temperature to last used temp
M109 S[first_layer_temperature] ; Wait for nozzle temperature to reach the desired temp
M190 S[first_layer_bed_temperature] ; Wait for bed temperature to reach the desired temp
M106 S255 ; Turn the fans back on (adjust fan speed as necessary)
Oh yeah, also it goes really slow too, not the normal speed it should be going.
And it never actually goes back to the correct z height it was at.
What am I doing wrong here? It's so annoying!
Well, your resume script for OctoPrint may not work. OctoPrint has no knowledge of those tokens you are using. It only knows of what's documented in the Context section of docs. I suggest you look at GCODE Scripts β OctoPrint master documentation for potentially working examples.
That shouldn't effect the print speed, but I suspect that might have something to do with your F300 parameters sent in your pause script setting. If it's not set back to printing speeds it may not be in the gcode to get back up to normal speeds.
If it helps, my printer is an ELEGOO Neptune 3 Pro.
I got those scripts and tweaked them for my printer, but there is still no extrusion! I even tried adding the G83 command at the end, like in After Pause/Resume there is no more extrusion, but there was still no extrusion! There was retraction and detraction, but no extrusion!. It's becoming very VERY frustrating!
Here are my updated G-code scripts:
After the print job is paused:
; (optional) disable stepper inactivity timeout - uncomment if your printer disables steppers during pause and supports this command
;M18 S0
{% if pause_position.x is not none %}
; relative XYZE
G91
M83
; retract filament, move Z slightly upwards
G1 Z+5 E-5 F4500
; absolute XYZE
M82
G90
; move to a safe rest position, adjust as necessary
G1 X0 Y0
{% endif %}
After the print job is resumed:
{% if pause_position.x is not none %}
; (optional) disable stepper inactivity timeout - uncomment if your printer disables steppers during pause and supports this command
; M18 S0
; relative XYZE
G91
M83
; retract filament exactly 1mm, move Z slightly upwards
G1 E-1 F1200 ; Retract 1mm of filament at 1200 mm/min
G1 Z+5 F1200 ; Move Z up by 5mm at 1200 mm/min
; absolute XYZE
M82
G90
; Reset E position to saved pause position
G92 E{{ pause_position.e }}
; Ensure filament is primed before continuing
G1 F100 ; Set a slower feed rate for priming
G1 E5 F1000 ; Extrude 5mm of filament at 1000 mm/min (adjust as necessary for priming)
; Move back to pause position XYZ
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F1200
; Reset to feed rate before pause if available
{% if pause_position.f is not none %}
G1 F{{ pause_position.f }} ; Restore the previous feed rate
{% else %}
G1 F1200 ; Set a default feed rate of 1200 mm/min
{% endif %}
{% endif %}
G83
What am I doing wrong? It's becoming so frustrating that I can't even do a simple filament change with Octoprint!
It doesn't seem like it's priming either....
I think we need some basic data first. What slicer (and version) are you using? What OS is the slicer running on? What version of firmware is in your printer?
Please create a 5x5x5mm cube and slice it with a filament change at 2.5mm (or at a layer close to that) and upload the gcode file created by the slicer.
How are you initiating the filament change (i.e. detailed steps)?
ELEGOO Slicer (port of Orca Slicer) newest version running on Mac OS Sequoia
I'm initiating the filament change on the Octoprint interface by simply clicking the "Pause Button"
And I don't think it's my gcode but if you insist I will send it, but I think it's something wrong with my "When print resumed" gcode script, because it retracts and detracts, just doesn't extrude any filament or prime for that matter.
Please replace "newest version" with an actual version number. While it might seem unimportant to you, it might be important to people reading this topic in the future.
OctoPrint pause & resume scripts depend on compatible settings in the slicer. Without knowing how the slicer is configured, we can't know if your pause and resume scripts are compatible. Examining the gcode output is the quickest way to verify.
In any case, the scripts you posted contain a G83
which doesn't appear in the Marlin documentation (but does appear in the RepRap documentation as a Prusa specific command)
Just "clicking the Pause Button" is an unusual way of making a filament change. Many slicers include the ability to insert commands at a known point in the gcode file. Unfortunately, OrcaSlicer 2.3.0 does not appear to be one of those slicers.
Manually editing the gcode output finding the location (usually at a layer change) and inserting a @pause
command would be preferable to just clicking the button.
Alternatively, when configured, Marlin firmware implements an M600 filament change command. Instead of inserting @pause
, you could insert an M600
instead. In this case, the OctoPrint pause and resume scripts would again need to be compatible with this method of changing filament.
We may need you to enable serial logging in OctoPrint and then upload a systeminfo bundle so we can troubleshoot whatever method you decide on for this filament change.
works just like PrusaSlicer from the sliced preview panel. slide the right slider down to the layer and right-click the + button.
I think enabling serial logging is the best move forward, so we can see the full communication between OctoPrint and the printer, which would include the commands in OctoPrint's gcode scripts section.
Learn something new everyday!
I will post the system info bundle along with the version of my slicer as soon as I return from the office. I paused from OctoPrint because I was testing my updated g-code scripts to ensure they were functioning correctly.
No worries, we'll get you sorted out
Ok, so my ELEGOO Slicer version is: 1.1.7.3
G-Code file of calibration cube with pause at 2.5 layer height:
CalibrationCube5mmPauseAt2.5.gcode (78.8 KB)
System Info Bundle:
octoprint-systeminfo-20250408154728.zip (559.2 KB)
Excellent! It looks like the pause is going to use M600
(at line 1204).
The slicer is generating code for absolute coordinates, G90
(at line 103), and relative extrusion, M83
(at line 105).
Your pause and resume scripts need to preserve these settings and it looks like you are switching to absolute extrusion (M82
) at the end of the pause script (and G83
is simply wrong at the end of the resume script). This will indeed cause chaos .
While fixing these issues is desirable if the pause is either @pause
or uses the pause button in OctoPrint, we need to understand how the M600
is going to affect things. It does its own positioning and filament management, so the OctoPrint scripts don't need to do that.
I suggest that you enable serial logging, remove the pause and resume scripts, and attempt to print this. If you want, change the filament layer change to occur earlier like layer 3 or so. Upload another bundle after whatever happens!
BTW, the M600
command takes parameters with the defaults defined in Configuration_adv.h
. The Marlin license requires that the sources be available so you might ask ELEGOO for a copy so you can examine this file to determine the M600 defaults. Alternatively, you could just ask them for the default values.
Ok, I will remove the pause and resume scripts, turn on serial logging, print the calibration cube, and upload serial.log and the system info bundle when the cube is done printing.
I set the 2.5mm layer pause in the slicer, but OctoPrint clearly ignored the M600 command and proceeded with the print without pausing.
Using the Terminal tab I did the experiment below (the Send:
commands) on my LulzBot TAZ 6 running Marlin 2.0.9. There was no filament inserted but I watched the extruder motion during the M600
and it seemed to do the right things (i.e. retract/eject/load the filament with prompts on the LCD screen).
Note the M115
response Recv: Cap:HOST_ACTION_COMMANDS:1
and the first response after the M600
of Recv: //action: paused
. Can you do a similar experiment on your printer?
Send: M115
Recv: FIRMWARE_NAME:Marlin FIRMWARE_VERSION:2.0.9.0.13 EXTRUDER_TYPE:Universal (Aug 10 2022 09:40:12) SOURCE_CODE_URL:https://gitlab.com/lulzbot3d/marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:LulzBot TAZ 6 EXTRUDER_COUNT:1 UUID:845f003c-aebd-4e53-a6b9-7d0984fde609
Recv: Cap:SERIAL_XON_XOFF:0
Recv: Cap:BINARY_FILE_TRANSFER:0
Recv: Cap:EEPROM:1
Recv: Cap:VOLUMETRIC:1
Recv: Cap:AUTOREPORT_POS:0
Recv: Cap:AUTOREPORT_TEMP:1
Recv: Cap:PROGRESS:0
Recv: Cap:PRINT_JOB:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:RUNOUT:1
Recv: Cap:Z_PROBE:1
Recv: Cap:LEVELING_DATA:1
Recv: Cap:BUILD_PERCENT:1
Recv: Cap:SOFTWARE_POWER:0
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
Recv: Cap:EMERGENCY_PARSER:1
Recv: Cap:HOST_ACTION_COMMANDS:1
Recv: Cap:PROMPT_SUPPORT:0
Recv: Cap:SDCARD:1
Recv: Cap:REPEAT:0
Recv: Cap:SD_WRITE:1
Recv: Cap:AUTOREPORT_SD_STATUS:1
Recv: Cap:LONG_FILENAME:1
Recv: Cap:THERMAL_PROTECTION:1
Recv: Cap:MOTION_MODES:0
Recv: Cap:ARCS:1
Recv: Cap:BABYSTEPPING:1
Recv: Cap:CHAMBER_TEMPERATURE:0
Recv: Cap:COOLER_TEMPERATURE:0
Recv: Cap:MEATPACK:1
Recv: ok P15 B3
Send: M104 S140
Recv: ok P15 B3
Send: M140 S40
Recv: ok P15 B3
Send: G28 X Y
Recv: X:-18.10 Y:305.50 Z:15.00 E:0.00 Count X:-1810 Y:30350 Z:24000
Recv: ok P13 B3
Send: G28 Z
Recv: X:-20.10 Y:259.50 Z:16.00 E:0.00 Count X:-2010 Y:25550 Z:0
Recv: ok P13 B3
Send: G0 X140 Y140 Z20
Recv: ok P14 B3
Send: M600
Recv: //action: paused
Printer signalled that it paused, switching state...
Recv: X:140.00 Y:302.50 Z:30.00 E:-2.00 Count X:14000 Y:29850 Z:48000
Recv: echo: Insert filament and send M108
Recv: echo: busy: paused for user
Recv: //action: resumed
Printer signalled that it resumed, switching state...
Recv: ok P15 B3
Ok, so in terminal I will do the M600 command, and let you know what happens, and paste what happens in the terminal.