Change Filament Mid Print

Ok, here are some updates:
I changed all of the F4500 to F1800, which eliminated the grinding noise when retracting.
There was no pile at X0 and Y0, and it did not extrude 10mm of filament, even though in the resume script it does E-5, then E5, and E5; the wheel wasn't turning.
Running it in safe mode did not change anything.
The simplified G-Code scripts didn't change a thing.
When it was paused, the temperatures stayed the same.
I'll upload a system info bundle as well as a screenshot of the temperatures when it was paused.
Screenshot 2025-04-10 3.48.12 PM
octoprint-systeminfo-20250410155325.zip (651.9 KB)

The serial log in the latest bundle doesn't contain the log of the latest run.

I'm at a complete loss to explain why the E-5, E5, E5 commands in the resume script doesn't move the extruder.

Can you explain step by step exactly what you do manually during the pause?

When testing, nothing. I just pause it and unpause to see if it will even extrude. Perhaps I have to restart the Pi or Octoprint for the g-code scripts to change?

If you do Nothing then I don't understand how the printer continues from the @pause...

You do not have to restart the RPi or OctoPrint after editing the scripts.

Earlier you uploaded a bundle which did contain the serial log of the experiment. In that log there were commands to remove the filament (E-100) and insert the filament (E100 followed by an E20). Where did those commands come from? They are not in the gcode file and they are not in the scripts.

I'm going to take a break from this topic. Hopefully, @jneilliii or someone else can take over.

Oh, that. I was just swapping filaments for a different print job.

this is a good thing because we didn't tell it to change.

yeah, not sure why the serial.log in that bundle only seems to be temperature data. please try these steps and then re-upload the bundle.

  1. delete serial.log from OctoPrint's logging section of settings.
  2. restart octoprint in safe mode again.
  3. start test print
  4. pause from OctoPrint (or let @pause command do the pause from the file)
  5. wait a minute or two
  6. resume print from OctoPrint
  7. cancel print after a little while of movement if it extrudes or not
  8. re-upload fresh system info bundle.

you were doing this from OctoPrint's control tab? only reason the commands would show in the serial.log as sent would have been if it was sent from OctoPrint I'm pretty sure. if that's the case, F300 is coming from your printer profile settings in OctoPrint and would make sense as a default value.

image

I would be interested in knowing what the default EEPROM value for max feedrate would be. In the terminal tab of OctoPrint send the command M203 and what is returned?

Recv: M203 X300.00 Y300.00 Z10.00 E60.00

Yes, I was using the Retract and Extrude buttons on the control tab. I set it to 100mm to unload and extrude, and an extra 20mm to finish clearing out the other color.

Updated system info bundle:
octoprint-systeminfo-20250410194422.zip (665.3 KB)
And sadly, still no extrusion.

Ok, M203 reports mm/s, whereas the setting in OctoPrint's printer profile and in movement commands (G1 G0) are in mm/min. So if we take your max numbers are multiply by 60 that should give us the correct values.

300x60 = 18000
10x60 = 6000
60x60 = 3600

keep in mind these are max values, so settings these lower in OctoPrint's settings isn't necessarily a bad idea.

when you did this, was the retraction and extrusion doing anything at all? seems like that would not be the case if the speed was being set to 300 instead of a higher number like 2500 or 3000. using 4500 would just be hitting the max limit and keep it at 3600 in theory.

serial logging wasn't enabled.

Yes, it retracts/extrudes great when swapping filaments. It's just during a print where it doesn't work.
Sorry... I will upload another bundle.
octoprint-systeminfo-20250410194422.zip (665.3 KB)

still empty serial.log. you have to enable it and do the process for us to log what's happening. just enabling it is not going to magically make it log all the stuff that has already happened when it wasn't enabled.

looks to be same file

My bad...
Here is an updated bundle:
octoprint-systeminfo-20250410201647.zip (703.5 KB)
Additionally, I observed that it extrudes 10mm of filament before resuming the print, which is good because at least it's priming. Still no extrusion after pause though.

please clarify this statement. it doesn't extrude when you try to extrude from the control tab of OctoPrint while paused or it doesn't extrude after the print is resumed?

please also re-share what you currently have in the gcode scripts. I think I'm still seeing M83 included in the on pause script.

2025-04-10 20:12:55,681 - Changing monitoring state from "Printing" to "Pausing"
2025-04-10 20:12:55,694 - Send: N900 M400*46
2025-04-10 20:12:56,539 - Recv:  T:209.84 /210.00 B:60.17 /60.00 @:76 B@:0
2025-04-10 20:12:56,853 - Recv: ok
2025-04-10 20:12:56,857 - Send: N901 M114*47
2025-04-10 20:12:56,868 - Recv: X:113.35 Y:113.95 Z:2.30 E:-1.50 Count X:9068 Y:9116 Z:929
2025-04-10 20:12:56,925 - Recv: ok
2025-04-10 20:12:56,927 - Send: N902 G91*26
2025-04-10 20:12:56,939 - Recv: ok
2025-04-10 20:12:56,942 - Send: N903 M83*18
2025-04-10 20:12:56,952 - Recv: ok
2025-04-10 20:12:56,958 - Send: N904 G1 Z+5 E-5 F1800*83
2025-04-10 20:12:56,969 - Recv: ok
2025-04-10 20:12:56,972 - Send: N905 G90*28
2025-04-10 20:12:56,976 - Recv: ok
2025-04-10 20:12:56,978 - Send: N906 G1 X0 Y0*38
2025-04-10 20:12:58,539 - Recv:  T:209.78 /210.00 B:60.05 /60.00 @:77 B@:0
2025-04-10 20:12:58,984 - Recv: echo:busy: processing
2025-04-10 20:13:00,384 - Recv: ok
2025-04-10 20:13:00,387 - Changing monitoring state from "Pausing" to "Paused"

I think if anything M83 should be in the resume script, not the pause script.

Oh, it doesn't extrude after print is resumed. Sorry, I should have clarified.
My G-Code Scripts:

After Pause:

; (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 F1800

; absolute XYZE
G90

; move to a safe rest position, adjust as necessary
G1 X0 Y0
{% endif %}

Before Resume:

{% if pause_position.x is not none %}

; prime nozzle
G1 E-5 F1800
G1 E5 F1800
G1 E5 F1800

; absolute XYZ
G90

; reset E
G92 E{{ pause_position.e }}

; move back to pause position XYZ
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F1800

; reset to feed rate before pause if available
{% if pause_position.f is not none %}G1 F{{ pause_position.f }}{% endif %}
{% endif %}

I initially overlooked the M83 in the resume script, but ultimately, it made no difference even when I removed it. Once I noticed it, though, I made sure to remove it.

From the Marlin documentation for M90:

In absolute mode all coordinates given in G-code are interpreted as positions in the logical coordinate space. This includes the extruder position unless overridden by M83.

Removing all the M83 commands is causing the extruder to be set to absolute every time M90 is executed.

The following pause and resume scripts should be correct for maintaining relative E:

Pause:

; (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 ; not needed because G91 sets E relative

; retract filament, move Z slightly upwards
G1 Z+5 E-5 F1800

; absolute XYZE
G90
; relative E
M83

; move to a safe rest position, adjust as necessary
G1 X0 Y0
{% endif %}

Resume:

{% if pause_position.x is not none %}

; prime nozzle (relative E) 
M83
G1 E-5 F1800
G1 E5 F1800
G1 E5 F1800

; absolute XYZE
G90
; relative E
M83

; reset E
G92 E{{ pause_position.e }}

; move back to pause position XYZ
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F1800

; reset to feed rate before pause if available
{% if pause_position.f is not none %}G1 F{{ pause_position.f }}{% endif %}
{% endif %}
1 Like

Thank you both, @b-morgan and @jneilliii, for your invaluable assistance with this issue. It took some time, but I’m pleased to say that the problem is now fully resolved! The updated G-code scripts worked perfectly, and now the printer extrudes smoothly after I resume the print following a color change. I appreciate your support and patience throughout this process—it really made a difference! Thank you!

Nice catch @b-morgan on the documentation notes, I kind of eluded to having M83 in the resume script before but wasn't 100% sure it would work because the reprap gcode docs diidn't specifically state that note for G90 although it does for G91.

1 Like