This postprocessing script allows you to calibrate your extrusion multiplier using multiple objects in a single print that was generated with Prusa Slicer.
After reading through Ellis 3dp tuning guide on calibrating your extrusion multiplier in Prusa Slicer, I became annoyed after consecutively having to print multiple times just to fine the right flow for my printer. Ellis guide on calibrating your extrusion multiplier can be found here: https://ellis3dp.com/Print-Tuning-Guide/articles/extrusion_multiplier.html
Eventually I was sitting here doing manual modifications to the Gcode to find each object start position and adding a M221 S90 or whatever flow I needed. This also was annoying, so I decided to write a post processing script to automatically calculate the flow percentages based on the defined extrusion multiplier for your current filament profile selected.
This script works for Marlin Firmware, but can be edited easily to work on klipper by modifying line 75 in the script with approriate gcode. (I think klipper can use M221? DOUBLE CHECK!)
Your base Multiplier is set to 1 under filament settings, if you wanted to print 3 objects, one being at an extrusion multiplier of 1, the other .98, and the third .97. This script will add the associated M221 S100, S98, S97 to your gcode for each instance of an object.
Now, say your base extrusion set in the profile was different, like .935 This script will also account for this and calculate the correct flow compensation. If you wanted to print 3 objects, one being at an extrusion multiplier of .94, the other .93, and the third .92. This script will then calculate the associated M221 S100.53, S99.47, S98.4 to your gcode. So as you can see it is adopts to whatever your base extrusion multiplier is set to.
- This script. (You can use the .exe or python script) Download Here
- This script works for Marlin Firmware, but can be edited easily to work on klipper by modifying line 75 in the script with approriate gcode. (I think klipper can use M221? DOUBLE CHECK!)
- You must enable the setting "Label Objects" in Prusa Slicer under Print Settings -> Output Options -> Output file
- You must also use "Add an Instance" to duplicate your models. The script works by looking for specific keywords and will NOT work with separated objects
Alright, now that you have some things setup. Lets walk through the steps:
- As recommended in Ellis guide, I use 30x30x3 blocks to calibrate my extrusion multiplier. You can download mine Here:
- Import your block into Prusa Slicer, then as mentioned previously. Duplicate it as many times as you need to by Adding New Instances. Do not use separate objects!!! You should have multiple instances starting with one. Make sure your blocks are aligned and sorted correctly, Instance 1, 2, 3, 4, So you can easily remember what flows you defined when looking over them.
- Note your Extrusion Multiplier value defined under Filament Settings (I recommend just setting this to 1, but as mentioned above the script can calculate the correct flow percentage even if use a different base value)
- Now go ahead and slice and save your Gcode to a folder.
- Now lets start up our script, you have two options, one being use the compiled .exe or using python and downloading the raw script. The choice is yours, you can run the script with python using python Calibrate-Flow.py. Otherwise just double click on the .exe
- The script will tell you to hit enter to open a file dialog and select your gcode you just created:
- Now we need to tell the script our base extrusion multiplier that is currently set in prusa slicer from step 3, in my case it is 1. We can also see the script found our 4 instances.
- Now we need to define what we would like our extrusion multiplier to be for each instance. The scale can be any percentage in decimal format. (e.g., 100% would be 1, 102% would be 1.02, 98.5% would be .985, etc.)
- AND WE ARE DONE! The script will give you an output of the settings and save over the existing file:
Just to show what the output would look like if we didn't use 1 as the base extrusion multiplier (We can see the percentages are way different from if we used a value of 1 as the base):