Ziegler–Nichols PID Tuning Calculator

Compute PID gains from ultimate gain Ku and oscillation period Pu using classic and modified Ziegler–Nichols rules.

Enter Ultimate Gain and Period

Gain at which the loop oscillates with constant amplitude.

Oscillation period at Ku (time between peaks).

PID Parameters from Ziegler–Nichols

Controller Type Kp Ti (s) Td (s) Ki Kd

Note: Ki = Kp / Ti and Kd = Kp · Td. Units of Ki and Kd depend on your implementation.

How to use this Ziegler–Nichols calculator

  1. Disable integral and derivative in your controller: set Ki = 0, Kd = 0.
  2. Increase Kp slowly until the output oscillates with constant amplitude. Record this gain as Ku.
  3. Measure the time between two consecutive peaks of the oscillation. This is the ultimate period Pu.
  4. Enter Ku and Pu above and click Compute PID Gains.
  5. Choose between Classic and Modified rules depending on how much overshoot you can tolerate.

Formulas used (Ziegler–Nichols closed-loop method)

Classic Ziegler–Nichols rules:

  • P controller: Kp = 0.5·Ku
  • PI controller: Kp = 0.45·Ku, Ti = Pu/1.2
  • PID controller: Kp = 0.6·Ku, Ti = Pu/2, Td = Pu/8

Integral and derivative gains are computed as Ki = Kp / Ti and Kd = Kp · Td.

Modified (less aggressive) rules used here:

  • P controller: Kp = 0.33·Ku
  • PI controller: Kp = 0.35·Ku, Ti = Pu/1.2
  • PID controller: Kp = 0.5·Ku, Ti = Pu/2, Td = Pu/8

These values are commonly used variants that trade some speed for better robustness and lower overshoot.

Example calculation

Suppose you experimentally find:

  • Ultimate gain: Ku = 4.0
  • Ultimate period: Pu = 2.0 s

For a classic PID controller:

  • Kp = 0.6 · 4.0 = 2.4
  • Ti = Pu / 2 = 1.0 s → Ki = Kp / Ti = 2.4 / 1.0 = 2.4
  • Td = Pu / 8 = 0.25 s → Kd = Kp · Td = 2.4 · 0.25 = 0.6

You would configure your PID as Kp = 2.4, Ki = 2.4, Kd = 0.6 (adjusting for your controller’s units).

Limitations and best practices

  • Ziegler–Nichols assumes a reasonably linear, stable process without large dead time.
  • The method intentionally produces a fairly oscillatory response (quarter-amplitude damping).
  • Always validate the tuned gains at low setpoints or in simulation before applying to critical equipment.
  • Use the Modified tab as a safer starting point, then fine-tune manually.

Ziegler–Nichols PID Tuning – FAQ

What is the Ziegler–Nichols tuning method?

It is a classical empirical method to tune PID controllers. You first find the ultimate gain Ku and ultimate period Pu by forcing the loop to oscillate with only proportional control. Then you compute Kp, Ki, and Kd from simple formulas. It is quick and requires no process model, but can be aggressive.

How do I safely find Ku and Pu?

Start from a low Kp with Ki = 0 and Kd = 0. Increase Kp gradually while monitoring the output and actuator limits. Stop increasing as soon as you see sustained oscillations. Measure the period between peaks as Pu. If oscillations grow or the system behaves dangerously, stop and use a different tuning method.

What is the difference between P, PI, and PID in this table?

P uses only proportional action (Ki = 0, Kd = 0).
PI adds integral action to remove steady-state error (Kd = 0).
PID adds derivative action to improve damping and response speed. Most industrial loops use PI or PID.

Why do my units for Ki and Kd look different from other sources?

Some controllers use Ki as 1/Ti, others use Ki = Kp/Ti, and some specify integral and derivative times directly (Ti, Td). This calculator outputs both Ti, Td and Ki, Kd. Always check your controller’s documentation and convert accordingly.