Advanced G-code post-processor that intelligently smooths flow and adjusts temperature for superior 3D print quality and layer adhesion.
- 🌊 Flow Smoothing: Extracts extrusion moves and smooths flow transitions for better print quality
- 🌡️ Dynamic Temperature Control: Adjusts nozzle temperature based on actual flow demand with gradual transitions
- ⚡ Feedrate Clamping: Prevents exceeding printer's maximum volumetric flow capability
- 📊 Real-time Visualization: Live plotting of flow and temperature profiles
- 🔗 Slicer Integration: Works as post-processing script (OrcaSlicer tested)
- ⚙️ Automatic Configuration: Reads parameters from G-code comments or config blocks
- 👀 Viewer Relaunch: Optionally relaunches slicer viewer after processing
Python 3 required with these packages:
numpymatplotlibPyQt5psutil
Install dependencies:
Ubuntu/Debian:
sudo apt install python3-matplotlib python3-numpy python3-pyqt5 python3-psutilArch/Cachyos:
sudo pacman -S python-matplotlib python-numpy python-pyqt5 python-psutilWindows:
pip install matplotlib numpy PyQt5 psutilpython mz_flow_temp.py <input.gcode>By default, the script shows informational messages in terminal (if run manually). A log file is created only when an error occurs.
Enable debug logging:
Create an empty file called DEBUG_ON in the script folder.
This enables verbose debug output and creates a detailed log file for troubleshooting.
Go to Printer Settings > Machine G-code and add:
- At the end of Machine start G-code:
; MZ FLOW TEMP START - At the beginning of Machine end G-code:
; MZ FLOW TEMP END
In Printer Settings > Notes, add:
mz_flow_temp_sec_per_c_heating = 6
mz_flow_temp_sec_per_c_cooling = 4
mz_flow_temp_launch_viewer = true
Set these values in your Filament profile:
- Temperature ranges (low/high)
- First layer temperature
- Maximum volumetric flow rate
- Minimum print speed
In Print process > Others > Post-processing scripts:
Linux/MacOS:
python <path to script>/mz_flow_temp.pyWindows:
- Find Python path:
where python - Add full command:
"C:\Users\<USER>\AppData\Local\Programs\Python\Python313\python.exe" <path to script>/mz_flow_temp.py
Important: OrcaSlicer doesn't automatically show post-processed G-code. The script can relaunch the viewer to display changes.
- ESC key: Close plot without launching viewer
- Window close/Q key: Close plot and launch viewer (if enabled)
Disable viewer: mz_flow_temp_launch_viewer = false
Your G-code must include:
; nozzle_temperature_range_high = 260
; nozzle_temperature_range_low = 220
; filament_diameter = 1.75
; slow_down_min_speed = 30
; filament_max_volumetric_speed = 12
; nozzle_temperature_initial_layer = 240
; initial_layer_print_height = 0.2Plus in printer notes:
mz_flow_temp_sec_per_c_heating = 6
mz_flow_temp_sec_per_c_cooling = 4
mz_flow_temp_launch_viewer = true
- Parse G-code: Extract extrusion moves and calculate flow rates
- Smooth Flow: Apply smoothing algorithms for better flow consistency
- Adjust Temperature: Modify temperature according to actual flow demand
- Clamp Feedrate: Ensure printer limits aren't exceeded
- Visualize: Display real-time flow and temperature profiles
- Save & Launch: Write processed G-code and optionally open viewer
The tool smooths flow consistency and adjusts temperature according to actual flow demand, helping your printer handle variations effectively. This prevents under-extrusion and improves layer bonding, especially for complex or fast prints.
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Incorrect usage |
| 2 | Input file not found |
| 3 | Missing EXECUTABLE_BLOCK markers |
| 4 | Missing MZ FLOW TEMP markers |
| 5 | Error parsing settings |
| 6 | Missing required parameters |
| 7 | No moves found in G-code |
| 8 | Error writing output file |
| 9 | Unhandled exception |
- No plots/output: Check dependencies and G-code parameters/markers
- Script not running: Verify post-processing script path and permissions
- Incorrect adjustments: Ensure filament/printer settings match hardware
GPL v3
If this project helps you, consider supporting my work: https://ko-fi.com/yurymonzon
Developed by Yury MonZon, inspired by BELAYEL Salim's original temperature controller: https://github.com/sb53systems/G-Code-Flow-Temperature-Controller









