Nozzle PID Tuning - Phil1988/FreeDi GitHub Wiki
What is PID Tuning?
PID tuning for the nozzle heater ensures that the extruder temperature is maintained accurately, improving print consistency.
Good PID values mean:
- Faster heatup times
- Stable temperatures during printing (±1°C)
- Consistent extrusion quality
- Reduced stringing and oozing
Time required: ~10 minutes
Prerequisites
- Printer homed and ready
- No prints currently running
- Good ventilation (hotend will run at high temperature for extended periods)
What Temperature Should I Use?
Choose a temperature you typically print at eg.:
- PLA: 200-210°C
- PETG: 230-240°C
- ABS/ASA: 240-250°C
- TPU: 210-230°C
⚠️ Tip: If you print multiple materials, tune at the temperature you use most often.
Methods to Perform PID Tuning for the Nozzle Heater
There are 2 ways to perform nozzle PID tuning. All methods perform the same calibration - they only differ in how you start it.
1. Using the Console in Mainsail
-
Open the Console in Mainsail
-
Enter the following command (replace
210with your target temperature):PID_CALIBRATE HEATER=extruder TARGET=220 -
The nozzle will do some heating cycles while the temperature response will be measured. Wait for the calibration to complete (~10 minutes)
-
Once finished, save the results:
SAVE_CONFIG
2. Using a Macro in Mainsail
You can also perform the PID tuning by using the "NOZZLE PID TUNE" macro in Mainsail. This method is equivalent to using the Console command, but it simplifies the process by triggering the macro directly.
-
In Mainsail, look for the NOZZLE PID TUNE macro button
-
Click it to start the calibration
Note: Starting from FreeDi v1.40, this macro is included by default. If you're on an older version, you can add this to your macros.cfg:
# Nozzle PID tuning
# For more information, see https://www.klipper3d.org/Config_checks.html#calibrate-pid-settings
[gcode_macro NOZZLE_PID_TUNE]
description: "Perform PID tuning for the nozzle heater"
gcode:
PID_CALIBRATE HEATER=extruder TARGET=220
Verification
After tuning:
- Open Mainsail and navigate to Configuration → printer.cfg
- Scroll to the bottom of the file
- You should see a section like this:
#*# <---------------------- SAVE_CONFIG ---------------------->
#*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated.
#*#
#*# [extruder]
#*# control = pid
#*# pid_kp = 23.456
#*# pid_ki = 1.234
#*# pid_kd = 111.234
The exact values vary by every printer and even you will redo it on the same machine.
When to Re-Tune PID
You should recalibrate nozzle PID if:
- You replace the hotend or heater cartridge
- You replace the thermistor
- You upgrade to a different hotend model
- You notice temperature instability (oscillations, overshooting)
- You move to a significantly different ambient temperature environment
Otherwise, PID tuning remains valid indefinitely.
Why Nozzle PID Tuning Matters
Proper nozzle PID tuning ensures:[attached_file:1]
- Consistent extrusion: Stable temperatures mean consistent filament flow
- Better layer adhesion: No temperature variations between layers
- Reduced defects: Less stringing, oozing, and blobbing
- Faster prints: Heater reaches target faster and stays there
- Safety: Prevents thermal runaway from poor temperature control
By performing PID tuning for the nozzle heater, you help ensure that the nozzle temperature remains stable, preventing issues like temperature overshoot or undershoot during printing.[attached_file:1]
Next Step: Bed PID Tuning →