Automation

PID tuning calculator (step test and ultimate gain)

Turn an open-loop step test (process gain, time constant, dead time) or a closed-loop ultimate test (Ku, Pu) into P, PI or PID settings by the Ziegler–Nichols and SIMC rules, in gain and times or proportional band and repeats per minute, with the parallel-form Ki and Kd.

Process model, controller and rule
Change in PV (in % of its range) ÷ change in output (%) at steady state. A 10 % valve step that moves the temperature by 20 % of the transmitter span is K = 2.
Time from the end of the dead time to 63.2 % of the final change.
Delay between the output step and the moment the PV starts to move.
The proportional-only gain at which the loop just sustains a steady oscillation.
Period of that oscillation, peak to peak.
SIMC is a PI rule for a first-order model, so this is fixed at PI when SIMC is chosen.
SIMC needs the step-test model; in ultimate mode the Ziegler–Nichols closed-loop rule is used.
τc = θ for a fast, robust response; larger for a gentler one; never below θ.

PID settings

Enter your values and press Calculate.

What the calculator does

A PID controller has three numbers to set, and the rules for setting them all start from a simple description of the process. The calculator takes either of the two classic descriptions and returns the settings. From an open-loop step test you read the process gain K, the time constant τ and the dead time θ off a trend: the first-order-plus-dead-time (FOPDT) model that fits most temperature, pressure, flow and composition loops well enough for tuning. From a closed-loop ultimate test you have the ultimate gain Ku at which the loop just oscillates and the period Pu of that oscillation.

For the step-test model it offers the original Ziegler–Nichols open-loop rule and Skogestad's SIMC rule, which adds one knob, the closed-loop time constant τc, that sets how fast and how robust the loop will be. For the ultimate test it applies the Ziegler–Nichols closed-loop rule. The result comes out as the controller gain Kc, integral time Ti and derivative time Td of the ideal (ISA) form, and also as the parallel-form Ki and Kd, the proportional band and the reset rate in repeats per minute, because every vendor writes the same controller a different way. It reports the controllability ratio θ ÷ τ, which says how hard the loop is, and it tells you where to start: the rule values are starting points, not the finished tuning.

Formula

Controller (ideal form): u = Kc × ( e + (1 ÷ Ti) ∫ e dt + Td de/dt )

Ziegler–Nichols open-loop, from K, τ, θ:
P: Kc = τ ÷ (K θ)
PI: Kc = 0.9 τ ÷ (K θ) Ti = 3.33 θ
PID: Kc = 1.2 τ ÷ (K θ) Ti = 2 θ Td = 0.5 θ

Ziegler–Nichols closed-loop, from Ku, Pu:
P: Kc = 0.5 Ku
PI: Kc = 0.45 Ku Ti = Pu ÷ 1.2
PID: Kc = 0.6 Ku Ti = Pu ÷ 2 Td = Pu ÷ 8

SIMC (Skogestad 2003), PI for a first-order-plus-dead-time model:
Kc = τ ÷ (K (τc + θ)) Ti = min( τ, 4 (τc + θ) )

Conversions: Ki = Kc ÷ Ti Kd = Kc × Td PB = 100 ÷ Kc % reset = 60 ÷ Ti repeats/min (Ti in s)
Controllability ratio = θ ÷ τ

where e is the error (setpoint minus measurement, or the reverse for a direct-acting loop) and u the controller output, both in percent of range; K is dimensionless when PV and output are both in percent; τ, θ, Ti, Td, τc and Pu are in seconds. Ki and Kd are the gains of the parallel (independent-gains) form u = Kp e + Ki ∫ e dt + Kd de/dt with Kp = Kc. The Ziegler–Nichols integral time 3.33 θ is the θ ÷ 0.3 of the 1942 paper. The SIMC rule is Skogestad's for the first-order model; his PID version is for a second-order model and puts the second time constant into Td, so for a first-order model SIMC is a PI rule.

Worked example

A jacketed reactor temperature loop in a Lahore chemical plant. With the controller in manual, the steam valve is stepped from 40 % to 50 % and the temperature trend recorded: the PV sits still for 10 s, then rises with a first-order shape and settles 20 % of the transmitter span higher. So K = 20 ÷ 10 = 2, θ = 10 s, and the 63.2 % point is reached 60 s after the PV starts to move, so τ = 60 s. A PI controller by Ziegler–Nichols:

  1. Kc = 0.9 × 60 ÷ (2 × 10) = 2.70; Ti = 3.33 × 10 = 33.3 s.
  2. Parallel form: Ki = 2.70 ÷ 33.3 = 0.0811 s⁻¹.
  3. Proportional band = 100 ÷ 2.70 = 37.0 %; reset rate = 60 ÷ 33.3 = 1.80 repeats per minute.
  4. Controllability ratio θ ÷ τ = 10 ÷ 60 = 0.17: a typical, well-behaved loop.
  5. The calculator suggests starting at half the rule gain, Kc = 1.35, because Ziegler–Nichols aims at quarter-amplitude damping.

The other rules for the same process, all reproduced by the calculator when you switch the controller, the rule or the test:

  • Ziegler–Nichols PID: Kc = 1.2 × 60 ÷ 20 = 3.60, Ti = 20.0 s, Td = 5.00 s (Ki = 0.180 s⁻¹, Kd = 18.0 s).
  • SIMC PI with τc = θ = 10 s: Kc = 60 ÷ (2 × (10 + 10)) = 1.50, Ti = min(60, 80) = 60.0 s, Ki = 0.0250 s⁻¹, proportional band 66.7 %, reset 1.00 repeats per minute. Almost half the Ziegler–Nichols gain, with a longer integral time: slower, and far more forgiving of a model that is a little wrong.
  • Ultimate test on a different loop, Ku = 4 and Pu = 30 s, PI: Kc = 0.45 × 4 = 1.80, Ti = 30 ÷ 1.2 = 25.0 s; PID: Kc = 2.40, Ti = 15.0 s, Td = 3.75 s.

For the record, the step-test model above has a theoretical ultimate gain of about 5.0 and an ultimate period of about 38 s (where the phase lag of the first-order response plus the dead time reaches 180°), and the closed-loop rule applied to those gives PI settings of Kc ≈ 2.3 and Ti ≈ 31 s, close to the open-loop 2.70 and 33.3 s. The two Ziegler–Nichols rules are meant to agree.

The rules side by side for the example process

RuleControllerKcTi (s)Td (s)Character
Ziegler–Nichols open-loopP3.00Aggressive; a steady-state offset remains
Ziegler–Nichols open-loopPI2.7033.3Aggressive: quarter-amplitude damping, overshoot of roughly half
Ziegler–Nichols open-loopPID3.6020.05.00Aggressive; the derivative needs a clean, filtered signal
SIMC, τc = θ = 10 sPI1.5060.0Robust: gain margin about 3, phase margin about 60°, small overshoot
SIMC, τc = 2 θ = 20 sPI1.0060.0Gentle: slower, no overshoot, tolerant of a poor model
Ziegler–Nichols closed-loop (Ku = 4, Pu = 30 s)PI1.8025.0Aggressive, same intent as the open-loop rule
Ziegler–Nichols closed-loop (Ku = 4, Pu = 30 s)PID2.4015.03.75Aggressive

Step-test model K = 2, τ = 60 s, θ = 10 s. The closed-loop rows use the calculator's default Ku and Pu, which describe a separate test, not this model. "Character" is the intent of the rule: Ziegler and Nichols designed for a decay ratio of one quarter; Skogestad designed for a chosen closed-loop time constant and a stated robustness.

Controller forms and units you will meet

FormEquationWhere it appearsWhat to convert
Ideal (ISA, non-interacting)u = Kc (e + 1/Ti ∫e dt + Td de/dt)The form this calculator gives; most PLC and DCS function blocksNothing, but check whether Ti and Td are in seconds or minutes
Parallel (independent gains)u = Kp e + Ki ∫e dt + Kd de/dtMany PLC libraries, embedded and microcontroller code, some drivesKi = Kc ÷ Ti and Kd = Kc × Td, shown in the results; Kp = Kc
Series (interacting, classical)u = Kc′ (1 + 1/(Ti′ s)) (1 + Td′ s) eOlder analogue and pneumatic controllers and some DCS blocksIdentical for P and PI. For PID: Kc = Kc′ (1 + Td′/Ti′), Ti = Ti′ + Td′, Td = Ti′ Td′ ÷ (Ti′ + Td′)
Proportional band and repeats per minutePB = 100 ÷ Kc %; reset = 60 ÷ Ti per minute; rate = Td in minutesSingle-loop temperature and process controllers, older instrument lineagesThe calculator's second output form; note that a larger band means a smaller gain

Vendors differ, and the same vendor differs between product lines. Allen-Bradley's PLC PID instructions offer both an independent-gains and a dependent (ISA) equation and take their times in minutes; Siemens' compact PID blocks take a gain and times in seconds; Honeywell and Yokogawa single-loop controllers work in proportional band, with the reset unit depending on the model. Read the block's documentation for the equation and the units before typing in any number from this page.

Assumptions and limitations

  • The process is modelled as first order plus dead time. K, τ and θ are a fit, not a truth. Most self-regulating loops fit well enough for tuning; a process with two similar time constants, an inverse response or oscillatory dynamics needs a better model and a different rule.
  • The step test must be done properly. Controller in manual, process at steady state, a step large enough to see clearly above the noise and small enough to stay in the linear region (5–10 % of output is usual), held until the PV settles, and ideally repeated in the other direction. Noise and valve stiction corrupt τ and θ more than K; a valve with 2 % stiction can make a 5 % step look like a 3 % one.
  • Integrating processes need different rules. A tank level with a pump on the outlet does not settle after a step; it ramps. The rules here do not apply. The SIMC rule for an integrating process is Kc = 1 ÷ (K′ (τc + θ)) and Ti = 4 (τc + θ), with K′ the slope gain in % per second per % of output; see the FAQ.
  • These are starting points. Ziegler–Nichols gives a decay ratio of one quarter, which most plant loops find too lively; SIMC with τc = θ is a sound default. Either way, watch the loop through a setpoint change and a disturbance and adjust: gain down if it overshoots, Ti up if it cycles slowly.
  • Derivative on the measurement, filtered. Put Td on the PV, not on the error, so a setpoint step does not kick the output; filter the derivative (a filter time constant of Td ÷ N with N between about 8 and 20 is the usual arrangement); and use it only on clean signals such as temperature. Most PLC blocks default to derivative on PV, but check.
  • Anti-windup, limits and action. The integral must stop accumulating when the output is at its limit, or the loop overshoots badly after a saturation; almost every block does this, but a hand-coded PID may not. Set the output limits, set direct or reverse action (a cooling loop is the opposite of a heating loop), and make sure the controller tracks the output in manual for a bumpless transfer.
  • Units. K is dimensionless only when PV and output are both in percent of range. If the PLC works in engineering units, either scale first or use K in °C per % of output; the gain then carries units and must be entered in the form the block expects.

Frequently asked questions

Which rule should I use?

SIMC with τc = θ, unless you have a reason not to. It is derived for a stated robustness (gain margin about 3, phase margin about 60°, tolerating a model error of a factor of two), and its one knob is easy to explain to the operator: bigger τc, gentler loop. Use Ziegler–Nichols when the loop must be fast and can tolerate overshoot, and even then consider starting at half its gain. In practice many loops that were "tuned by Ziegler–Nichols" are running at a fraction of the rule gain because someone turned it down after the first upset.

Why does my loop oscillate after Ziegler–Nichols tuning?

Because that is what it was designed to do: the rule targets quarter-amplitude damping, where each overshoot is a quarter of the one before, which is a lightly damped oscillation. Add a valve with stiction, a model that is a little off, or a process gain that changes with load, and the damping goes from light to none. Halve the gain; if it still cycles slowly, lengthen Ti; if it cycles fast, reduce Td or remove it. A loop that cycles with a period close to the dead time is a gain problem; one that cycles with a period of several minutes is usually an integral-time problem.

What is the ultimate test, and is it safe?

The ultimate test sets the controller to proportional only and raises the gain until the loop oscillates with a steady amplitude; that gain is Ku and the period is Pu. It takes the loop to the edge of instability, which is not acceptable on many plant loops, and it can take a long time on a slow process. The relay autotune (Åström and Hägglund, 1984) does the same job safely: it switches the output between two fixed values around the setpoint, producing a small, bounded oscillation from which Ku and Pu follow. Most PLC and single-loop autotuners are relay autotuners; trust them when the process was at steady state, the oscillation was clean and the resulting gains are sensible against a step test.

How do I tune a level loop?

A tank level with an outlet pump or a downstream control valve is an integrating process: a step in the inlet valve makes the level ramp, not settle. Do the step test anyway and measure the slope: K′ = (rate of level change in % per s) ÷ (step in %) and the dead time θ before the ramp starts. Then use the SIMC integrating rule: Kc = 1 ÷ (K′ (τc + θ)), Ti = 4 (τc + θ). Too short a Ti on an integrating process causes slow cycling that no gain change will fix. If the tank is there to absorb flow surges, tune it loose (large τc) so the level is allowed to move.

What sample time does the PLC need?

A rule of thumb: the PID block should execute at least ten times per time constant and at least four times per dead time, so at or below τ ÷ 10 and θ ÷ 4. For the example (τ = 60 s, θ = 10 s) that is 2.5 s or faster; a typical 100 ms task is far inside. It matters more for fast loops such as flow and pressure, where a 1 s cyclic task adds effective dead time and the analogue input filter may be the slowest element. Executing the block faster than the transmitter updates gains nothing.

What do I do with a dead-time-dominant loop?

When θ ÷ τ is above 1 the controller is mostly waiting, and Ziegler–Nichols gains become very aggressive because the rule scales with τ ÷ θ. SIMC with τc ≥ θ still works and gives a loop as fast as the dead time allows, with a small gain and Ti ≈ τ. Beyond that, a Smith predictor or a model predictive controller can compensate for the dead time explicitly, if the model is good. Better still is to reduce the dead time at source: move the sensor closer to the valve, shorten the sampling line, or speed up the transmitter's update rate.

References

  • Ziegler, J. G. and Nichols, N. B., "Optimum settings for automatic controllers", Transactions of the ASME, vol. 64, pp. 759–768, 1942 — the open-loop (reaction curve) and closed-loop (ultimate) rules
  • Skogestad, S., "Simple analytic rules for model reduction and PID controller tuning", Journal of Process Control, vol. 13, pp. 291–309, 2003 — the SIMC rules, the half rule for model reduction, and the integrating-process rule
  • Åström, K. J. and Hägglund, T., Advanced PID Control, ISA, 2006 — controller forms, derivative filtering, anti-windup and relay autotuning
  • Åström, K. J. and Hägglund, T., "Automatic tuning of simple regulators with specifications on phase and amplitude margins", Automatica, vol. 20, pp. 645–651, 1984 — the relay feedback autotuner

Last reviewed 2026-09-20.