PID Tuning Calculator (Ziegler-Nichols and Lambda)
Calculate starting PID settings from a closed-loop test (ultimate gain and period) or from a simple process model.
From an ultimate-gain test
Ku is the proportional gain at which the loop oscillates steadily with I and D off. Pu is the time for one oscillation. Results are in the same time unit as Pu.
From a process model (lambda tuning, PI)
Get K, τ and θ from a step test: change the output by a known amount and record the response. A larger λ gives a slower, gentler loop. A common starting point is λ equal to τ or larger.
How it works
The ultimate-gain method (Ziegler-Nichols) was published in 1942 and gives fairly aggressive tuning with noticeable overshoot. Tyreus-Luyben reduces gain and lengthens the integral time for a gentler response. Lambda tuning instead picks the closed-loop speed you want and works out the gains from a process model.
Ziegler-Nichols PI: Kp = 0.45·Ku, Ti = Pu / 1.2
Tyreus-Luyben PID: Kp = Ku / 2.2, Ti = 2.2·Pu, Td = Pu / 6.3
Lambda PI: Kp = τ / (K × (λ + θ)), Ti = τ
Ki = Kp / Ti Kd = Kp × Td
Worked example
A loop oscillates steadily at Ku = 4 with a period of 10 seconds. Ziegler-Nichols PID gives Kp = 2.4, Ti = 5 s and Td = 1.25 s. Tyreus-Luyben gives a gentler Kp = 1.82, Ti = 22 s and Td = 1.59 s.
For a model with K = 2, τ = 30 s, θ = 5 s and λ = 30 s, lambda tuning gives Kp = 30 / (2 × 35) = 0.43 and Ti = 30 s.
Common questions
Is it safe to find Ku by pushing a loop to oscillate?
Not on every process. Driving a loop to sustained oscillation can upset or damage equipment. Where that is not acceptable, use the process-model method from a small step test instead.
Do I need the derivative term?
Often not. Many loops, especially flow, pressure and noisy level loops, work well with PI only. Derivative amplifies noise.
Calculations are provided for convenience and education. Test any tuning on the actual process under appropriate safeguards.