This script demonstrates how automatically adjusting nozzle temperature, flow rate, and print speed can significantly improve both quality and speed, while also simplifying slicer settings.
Inspired by my personal approach and developed with basic Delphi programming skills, this script is not a definitive solution. Instead, it’s a proof of concept showing the potential benefits of integrating such features directly into slicer software, where they could unlock even greater efficiency and advanced capabilities.
The concept is based on the idea that filament gradually absorbs heat as it travels through the hotend, and should be extruded at an optimal final temperature. The script dynamically adjusts nozzle temperature for different sections and geometries of the print. It calculates these adjustments based on the average flow rate (updated every second) and modifies the G-code speed to match the ideal flow rate for the corresponding temperature (factoring in layer height and line width).
With my printer setup, this approach has allowed me to achieve better speed and quality using the same slicer settings, even with an older Klipperized 3D printer and budget filament. In fact, I now rely on this script for all my prints—it’s that effective.
I believe 3D printing can be much less complicated than it currently seems. I encourage you to test, share, and improve this concept. I’m convinced that this approach, or something similar, could shape the future of 3D printing. With advancements in AI, 3D printing could become truly accessible to everyone.
I welcome your feedback and ideas—let’s innovate together. “Alone we go faster, together we go further.”
:warning: Please use this script responsibly and with caution, applying reasonable values and closely monitoring your printer's behavior.
Happy Smart 3D Printing :)
See my OrcaSlicer
Settings :gear:
See the Print Samples
Discussion, Share yours :bulb:
This project began in June 2024.
Compiled with Delphi 12 Community Edition
(Free for windows, MacOS, and Android).
Email : sb53systems@gmail.com
Discord: sb53systems
I thank everyone who participated in this project even indirectly ❤️
(Updated in November 03 2024)
All Firmwares
.Arcs
moves support.Custom
Klipper Estimator script. You can retain your old script configuration after an update by using your old "/Config" folder from the previous version. Simply replace the files "SB53-Systems.exe" and "Klipper_estimator.exe.". Note that the final version 1.1 include a different Klipper_Estimator script.
PRINTING PERSPECTIVE
Three months later, nothing more!
The script can be used as a standard program by running the SB53-Systems.exe file and manually opening a G-Code file, or by integrating it into the slicer as a post-processing script.
D:\SB53_G-Code_Flow_Temperature_Controller_V1.1\SB53-Systems.exe;
Included a Custom version of Klipper_Estimator V 3.7.3. An accurate tool that uses Klipper Look-Ahead kinematics
to estimate the time and average flow rate for each move in the G-Code. (+/- 1s total time for Klipper Firmware). The mechanism is very close to other Firmwares (+/- 5% if used correctly).
Note that the file \Klipper_estimator.exe
(already included) is required and must be in the same Folder with this Script.
Editing the First Layer Temperature
is important, the script can :
Edit the specified "Start Print"
Macro (Klipper).
Edit the "M109 S"
G-Code command, provided that:
It is preceded by the comment "; Temp_To_Edit"
; Temp_To_Edit
And add the comment "; PRINT_END" at the start of the Machine End G-Code
, this will allow the script to avoid the print end Moves.
; PRINT_END
The Initial Temperature
estimated by the Script depends on the speed of the first moves of the G-Code, you can adjust it by fixing the speed of the Purge Line
or the speed of the First layer Perimeters
.
To have a best Speed/Quality Optemization
, the Slicer Profil must be set for Max Moves and Max Volumetric Speed. The Nozzle temperature is not important because it will be reset in the script, and the speed will be reduced (not increased) to the Recommended Flow.
Example below with my max 200mm/s Printer speed : (Same profil for PLA, PETG and ABS
)
The speed of Overhangs
and small Internal/External Bridges
should be set to the maximum speed, this will ensure that the filament is extruded at the recommended flow rate and that it is not too hot and falls off, or too cold and shrinks, also avoiding sudden flow changes and unnecessary temperature drops caused by the average flow calculated by the script.
See my overhangs test examples.
For larger bridges, I use Thick Bridges
in Orca Slicer and a single 5015 radial fan for part cooling, there is not much deference between a 60mm bridge at 30mm/s and another at 100mm/s, and since I don't print a lot of wide bridges, I prefer to keep an automatic speed.
See my Bridge test examples.
You can use a modifier (or more) in the slicer that changes the speed of a few lower layers to the bridge, the temperature and speed should gradually decrease to the desired bridge speed. Example bellow for 50mm/s External Bridge speed. (This approach can only be optimized when it is integrated into the Slicer)
You have to set your filament settings:
You can reduce the speed of the Cooling Fan
(Except for Bridges and Ovehangs), the Min Print Speed
, and the Min Layer Time
.
The script is specifically programmed to reduce speeds only when they exceed the recommended flow rate, while lower speeds will remain as set in the G-Code (Slicer speed).
The script does not display the temperature curve in the generated G-Code Chart if Arcs moves are used. This is due to the integration and interpretation of the Klipper_Estimator output.
PA can be adjusted based on temperature only for Klipper firmware. For other firmwares you need to uncheck the Adjust PA option.
Changing PA while printing can cause bubbles in the walls. The script is programmed to adjust PA only in sparse infill, internal solid infill, support, and internal bridges.
This script doesn't support Multi-Tool
or Multi-Material
printing.
For a Bambu Lab
3D printer, you need to Avoid Flow Calibration
and First Layer Inspection
used at the beginning of the print.
Ironing
is not recommended with this script, as it can affect the desired results and increase printing time.
Adaptive Pressure Advance
is not recommended with this script.
Delta Printers
kinematic limits are not supported with the current version of Klipper Estimator.
Reading or generating large G-Code files with this Script can takes up to 2 minutes, depending in your CPU
.
Processing G-Code with Arcs Moves
will take longer, because the Klipper Estimator script will cut them into small segments based on the parameter "mm_per_arc_segment": 0.1
.
The generated G-Code is 10% to 30% larger than the original one due to Temp and Speed adjustment.
This script is currently only available for Windows OS
. With Delphi 12
and some changes to the source code, it can be compiled for other operating systems (I can help with this or do it later!).
The visual calibration method (effective for PETG, PLA, etc.) involves selecting the desired appearance (closest to the original filament) over 3 to 5 prints:
Cylinder
in Vase Mode
(You can use the maximum layer height and maximum line width), while limiting the maximum volumetric speed to the desired test flow rate. Start with the maximum recommended temperature, then manually and gradually reduce the temperature during printing. (This step should be done without the script) Flow/Temperature
values, which means it will adjust them linearly. The ideal would be to obtain the final temperature of the extruded filament using a more accurate and automated solution that gives a curve closer to reality!
This will also be useful with Filaments that cannot be visually calibrated.
It would be ideal for filament vendors to provide just one ideal temperature!
I challenge makers to find a precise, cost-effective, and user-friendly solution for the majority of 3D printers :rocket:
Max/Average Smoothing value
may affect the result and print time, you have to experiment yourself (I recommend values between 10 and 30). Speed Optimization
as long as it doesn't affect the desired quality, usually the printing time will only vary by a few minutes. Quality Optimization
to reduce flow variation. Fuzzy Skin
, Variable_Layer_Height
and Scarf_Joint_Seam
can cause print delay due to frequent flow changes. Variable_Layer_Height
and Precise_Z_Height
.The script will popup once you Print or Export the G-Code from the Slicer, ask the user whether the script will be applied or not.
If yes, the first execution:
Extruder/Printer
values.(config .json)
.
{
"max_velocity": 400.0,
"max_acceleration": 10000.0,
"minimum_cruise_ratio": 0.5,
"square_corner_velocity": 5.0,
"instant_corner_velocity": 1.0,
"mm_per_arc_segment": 0.1,
"move_checkers": [
{
"axis_limiter": {
"axis": [
0.0,
0.0,
1.0
],
"max_velocity": 5.0,
"max_accel": 200.0
}
},
{
"extruder_limiter": {
"max_velocity": 106.43243214765772,
"max_accel": 2660.8108036914427
}
}
]
}
Note that You have to set this file for each Printer/Extruder
preset.
After saving the Extruder/Printer
preset, you need to select the Filament Type
, then set the filament values (start with 1mm3/2) and save with a specific name. (for each Extruder)
Extruder/Printer
and Filament
used, if they are written with the same name as in the slicer (Copy and Paste).
Below is the Generated G-Code