Temperature Calibration GCODE Editor
Printable files (2)
Description
All rolls of filament have a "sweet spot" temperature for printing, which can vary based on the material, your extruder setup, and even the brand. The easiest way to find the ideal printing temperature is to run a single test print that gradually changes temperature over time, then review the results to see which section has the best layer adhesion, overhangs, bridging, etc. To do this, we need to insert the desired temperature changes into the sliced G-code file before sending it to the printer. While it's not particularly difficult to edit the G-code manually, it's quicker and less error-prone to use a script.
Generally, when I get a new roll of filament the routine is to:
- check the recommended temperature range as given on the filament
- create/edit a temperature tower with that range
- slice the model
- run the gcode file through the python script
- review the print then mark the optimal temp on the side of the spool
Instructions
To use the script you'll need to have python installed. Export your gcode and simply drag and drop the file onto the python scripts icon then follow the prompts to enter four parameters for your tower:
- the starting temperature
- the final temperature
- the amount at which the temperature should change (between regions)
- the height of the tower's base if it has one
The script will then tell you which temps will print at which height and what nozzle temperature commands it found in your existing gcode.
To automate this further, most slicers let you specify a post-processing script (and save it to a profile), allowing the script to run automatically whenever you export your G-code. For example, with PrusaSlicer, go to Print Settings > Output options > Post processing scripts and enter..."path\to\python.exe" "path\to\gcode_temp_changer.py";
Which temp tower?
Thingiverse has plenty of different designs of temperature tower to use - choose any that you like the look of that incorporates a number of tests. I'll occasionally switch between a simpler or more complex tower depending on the circumstances. If the tower you choose is customisable, then you can create a remix with your desired temps; note that it's always quicker to download the scad file and generate the tower on your desktop rather than using the customiser in your browser. If the tower you choose is not customisable and has more stages than you require, then you can use the CUT feature in your slicer to remove the portions you don't need (either from the bottom or the top of the model).
Which Slicer?
The script will auto-detect and handle output from a few different slicers. If you receive the message saying your slicer "isn't yet supported", feel free to leave a comment (and share your gcode).
Disclaimer
Please only use this script if you understand what you're doing. I've added some safety checks to ensure the script will only process "sane" temperatures, but in general, setting temps that your printer can't handle can damage your printer.