3D Printing Calculators
PID Tuning (Ziegler–Nichols)
https://www.3dsizing.com/calculators/pid-tuning/
Estimate only — not firmware, a slicer profile or a shop quote. Confirm on a test print.
PID Tuning (Ziegler–Nichols)
When a heater sits at the edge of oscillation, Ku is that gain and Tu is the period in seconds. Classic Ziegler–Nichols turns those two numbers into Kp, Ki and Kd. Firmware choice here is documentation — the three gains are the same math.
Inputs
Results
Please tick the box above to display the Result.
Calculation method
Classic Ziegler–Nichols PID from the ultimate-sensitivity experiment: Kp = 0.6 × Ku, Ki = 2 × Kp / Tu, Kd = Kp × Tu / 8, with Tu in seconds. The firmware dropdown does not alter the numbers; Marlin and Klipper simply expect different G-code or config keys. Invalid if Ku or Tu is not positive. There is no unit conversion: Marlin (M301/M304) and Klipper (pid_Kp/pid_Ki/pid_Kd) both express the gains on a 0–255 heater-PWM scale per °C, with Ki per second and Kd in seconds, so enter as Ku the Kp value your firmware was running.
Exact formula
Kp = 0.6 × Ku. Ki = 2 × Kp / Tu. Kd = Kp × Tu / 8. Marlin M301/M304 and Klipper pid_Kp/pid_Ki/pid_Kd take the same numbers on a 0–255 PWM scale. Limits: Classic Ziegler–Nichols is aggressive and can overshoot. Prefer firmware PID_CALIBRATE / M303; never leave a heater unattended hunting Ku.
Related calculations
- is the bed even strong enough — PID cannot invent watts
- motion calibration — different loop, same “measure then type” ritual
Where to paste the numbers
Marlin: M301 for hotend, M304 for bed, then M500. Klipper: pid_Kp, pid_Ki, pid_Kd under the heater section, then SAVE_CONFIG after a real PID_CALIBRATE if you can.
Frequently asked questions
How do I find Ku and Tu?
Raise Kp (others zero) until the temperature oscillates at constant amplitude. Ku is that Kp. Tu is the time between peaks. Then come here. Or skip this and run M303 / PID_CALIBRATE.
Marlin vs Klipper values differ on forums.
Both autotunes (M303 and PID_CALIBRATE) run a relay test and apply these same classic formulas, but they estimate Ku and Tu differently, at different temperatures and fan settings. The math on this page is identical for both.
Bed Tu is huge compared with the hotend.
A bed is a slow plant: hotends typically oscillate with Tu of about 20–40 s, beds often 100 s or more. Do not paste hotend PID onto the bed.
My bed overshoots 10 °C.
ZN classic is snappy. Lower Kp a bit or use the firmware autotune, which often damps more.
More in this topic
All tools in this topicFDM calibration & firmware
Stepper Motor E-Steps Calibration Calculator
Calculate new extruder e-steps from old e-steps, commanded length and measured filament. Formula: new = old × requested / actual.
FDM calibration & firmware
Input Shaper Max Acceleration
Reproduce Klipper’s suggested max_accel for ZV, MZV, ZVD, EI, 2-hump EI and 3-hump EI from the shaper frequency, with its 0.12 mm smoothing target, square corner velocity and damping ratio.
FDM calibration & firmware
Klipper Rotation Distance Calculator
Convert a measured extrude test into Klipper rotation_distance, or derive rotation_distance from Marlin e-steps, full steps, microsteps and gear ratio.
FDM calibration & firmware
Z-Axis Optimal Layer Height
Snap a desired FDM layer height to the nearest full-step multiple of your Z lead screw and motor step angle to reduce microstep banding.
FDM calibration & firmware
Stepper Motor Vref Calculator
Calculate stepper driver Vref from target RMS current and sense resistor for A4988, DRV8825, TMC2208 and TMC2209, using each chip’s datasheet relation. Also reports peak coil current.
FDM calibration & firmware
Thermal Shrinkage Scaling Calculator
Scale an STL to offset FDM cooling shrinkage for PLA, PETG, ABS, ASA, nylon, PC or a custom percent. Outputs scale factor and the new model size.
FDM calibration & firmware
Maximum Volumetric Flow Rate Calculator
Compute FDM volumetric flow Q = layer height × line width × speed, then the maximum print speed a hotend can hold at a stated mm³/s limit.
FDM calibration & firmware
Z-Axis Lead Screw Resolution Calculator
Calculate Z steps per millimetre and linear resolution from motor step angle, lead-screw pitch and microstepping. Helps diagnose Z banding.