Change filament after x meter

Hi,

Anybody knows about an existing postprocessor script to change filament after x meter...?! sort of pause at height, but then pause after x meter of filament.
For the current print i did it by hand, which works as well...

I have a few 1.2kg print and only 500 gram material spools available. Now I manually adjusted the gcode bij looking at the e value (and take into account the reset G92 E0) and it will pause octoprint.
But could be a nice plugin (or marlin feature), when choosing 'filament change' then a question pops up 'after x meter' which defaults to 0(?!).

cheers / joris

Nothing I know of that can do that. The closest one I can think of is OctoPrint-TimeToFilament but it doesn't pause or anything.

1.2kg of filament in one print? That object must be huge.

Can you elaborate on how you did it by hand? What slicer do you use?

I think this would be best accomplished during the slicing phase. To do it in OctoPrint or Marlin would be fairly complicated because various slicers manage E values differently (i.e. absolute vs relative, resets at layer changes, etc.)

With Ultimaker Cura, you can move the object below the print bed and when sliced, only the portion above the print bed is processed. The information displayed after slicing includes the amount of filament used. Using this information, the layer heights for filament changes (i.e. pause at height) can be determined.

Sure...! I use Cura normally.
After slicing I openend the gcode in a text editor and searched for G92 E0 because I know that the e value is ressetted when it gets to high.
In this case it is resetted after around E1600 E1700.
From that value I calculated the mm of filament. In this case the 'flavor' of gcode was 'Marlin' so the E value is mm length. (Flavor 'UltiGcode' -> volumetric extrusion amounts, flavor 'Marlin' or 'Reprap' -> lengths extrusion amounts).
Then manually count the 'find next' until you reach about 60 meters, in this case the length of the spools.
Then I placed a "M118 //action:pause" command to trigger the pause at octoprint.
Then repeat for the next change.

To do it in OctoPrint or Marlin would be fairly complicated because various slicers manage E values differently (i.e. absolute vs relative, resets at layer changes, etc.)

Yes and no. I think Octoprint already states something about filament (cannot check right now).
And yes, I think where to do it has different benefits.
In cura: perfect, then you just say the length of your spool
In Marlin/octoprint: Then you can also initiate it when you grapped a used spool and you see during the print you have only x meters left.

There is already a material change option on the lcd in marlin, that could be place to make an (advanced) option where you can choose after x meters (or after x height or after x layer)
Same could be for Octoprint, although I haven't seen any plugins (yet?!) where you can 'program' an action in the future.
(Another nice plugin would be: Do gcode x after layer/height y. For example when you started a print but then realised that the top part is more narrow or has tiny towers so you want to lower the speed or temp for that section. I should start a new topic for that. OR make this plugin 'request' more general so this fits in there as well......)

you can move the object below the print bed

Keep in mind that the bottom layers are solid then unles you set them on 0 with the initial bottom thickness setting...

cheers / joris

I did some experimentation with Cura output and OctoPrint upload and it appears that during the upload of a gcode file, OctoPrint determines the amount of filament used by examining the E values. It also appears to be clever enough to take into account those G92 E0 resets that occur when E gets too large and it works when relative E is selected in Cura.

While printing a gcode file, I don't see anything in the OctoPrint plugin documentation that exposes the amount of filament extruded to this point so a plugin would have to keep track of this itself.

There are a couple of plugins that might contain some useful information, https://plugins.octoprint.org/plugins/filamentmanager/ and https://plugins.octoprint.org/plugins/SpoolManager/.

Implementing something in Marlin would best be discussed in their forums. See https://marlinfw.org/docs/development/contributing.html for more information.

Have you ever considered adding a filament sensor to your printer? I added one to mine, and it could solve your problem with less than 10 bucks.

Yes, I have mounted the tunell filament sensor. However, there is a funny problem that when the material is blocked for reason (last part stuck in the spool for example), the stepper 'skips' and causes sometimes enough movement to convince the sensor that the filament moves.
I was also thinking of using a limit switch, but then you have the same problem when the last part of the filament is too stuck in the spool.
But indeed, the 'programmed' pause is for now an extra safety, but in theory not necessary.

The request was also more in general, than just my case. I still think it would be a nice feature for all printers without filament sensor.

I also posted it on the marlin github here: https://github.com/MarlinFirmware/Marlin/issues/22860
One answer was a pretty nice workaround. Abuse the M412 code. That is something you can implement perfectly wit a custom button in Octoprint.