Tuning PID controllers: Ziegler–Nichols and what to do afterwards
Two short experiments give you starting gains. A model and a specification tell you how to improve them.
THE SHORT ANSWER
Ziegler–Nichols tuning gives starting PID settings from one simple experiment. The first method fits an open-loop step response with a gain K, delay L and time constant T; the second uses the ultimate gain Kcr and period Pcr at which a P-only loop oscillates steadily. Both tables give Kp, Ti and Td in standard form and aim at a quarter-decay response, so the result is a first guess to refine.
Compute Ziegler–Nichols PID settings from a reaction curve or from the ultimate gain and period, convert between PID forms, and refine or replace the result when its overshoot is too large.
The PID chapter explained what the P, I and D terms do and why saturation calls for anti-windup. It did not say how to choose the three numbers. This chapter gives two experiment-based recipes, one model-based recipe, and the checks that come after them.
Review the previous lesson: PID, saturation and windupFirst, picture it
You have a PID controller with three settings and a plant you cannot model in detail. Ziegler and Nichols proposed a shortcut in 1942. Do one simple experiment: either step the plant input and record the S-shaped response, or close the loop with proportional action only and raise the gain until the output oscillates steadily. Measure two numbers on the record, look up the three settings in a table, and you have a working controller. The table is aggressive on purpose: it aims for a response in which each overshoot peak is about a quarter of the one before. So treat the result as a first guess, then trade some speed for damping.
Build the idea step by step
A PID controller is written in two ways. The standard form Kp(1 + 1/(Ti·s) + Td·s) uses one gain and two times; the parallel form Kp + Ki/s + Kd·s uses three gains. They are the same controller with Ki = Kp/Ti and Kd = Kp·Td, and the Ziegler–Nichols tables are written in the standard form. The first method uses an open-loop step test: fit the response with a gain K, a delay L and a time constant T, then read Kp, Ti and Td from the table. The second method uses the closed loop: find the ultimate gain Kcr at which a P-only loop oscillates steadily, and the period Pcr of that oscillation. If you have a transfer function, compute Kcr and Pcr with a Routh table or by substituting s = jω, with no experiment at all. Either way, simulate or test the result and then adjust it to the overshoot you can accept.
Read the equations
The standard form on the left and the parallel form on the right describe the same controller. Tuning tables give Kp, Ti and Td; convert when your controller asks for Ki and Kd.
First method: approximate the S-shaped step response by a gain, a delay and one time constant. Draw the tangent at the inflection point; it meets the initial level at t = L and the final level at t = L + T.
Ziegler–Nichols settings from the reaction curve. The gain is inversely proportional to the delay: a plant with a long delay relative to its time constant gets a cautious controller.
Ziegler–Nichols settings from the ultimate gain and ultimate period. Every row backs the gain off from Kcr and ties both times to the period of the oscillation.
At the ultimate gain the P-only loop has poles at ±jωcr. Setting the real and imaginary parts of this equation to zero gives ωcr and Kcr; a Routh table gives the same pair.
Written out, a Ziegler–Nichols PID is an integrator with a double zero: at −4/Pcr for the second method and at −1/L for the first. Fine tuning moves this zero and the gain in front.
Quarter decay: each peak is a quarter of the previous one. For a dominant pole pair this means a damping ratio of about 0.22, which is why the set-point overshoot is large.
PI-D control with a derivative filter: the derivative acts on the measurement, so a set-point step causes no derivative spike. The filter limits the derivative's high-frequency gain to Kp·N.
I-PD control: only the integral term sees the error. The loop transfer function, and therefore stability, is the same as for PID and PI-D; the set-point response starts more gently.
Lambda tuning of a PI controller for a first-order plant. The integral time cancels the plant time constant, and the gain sets the closed-loop time constant λ that you choose.
The same rule for the thermal lab's heater, in the lab's parallel form. With C = 1000 J/K, H = 5 W/K and λ = 50 s it gives Kp = 20 W/K and Ki = 0.1 W/(K·s).
What the symbols mean
- proportional gain: controller-output units per unit of error (W/K in the thermal lab)
- integral time, s
- derivative time, s
- integral gain Kp/Ti: units of Kp per second
- derivative gain Kp·Td: units of Kp times seconds
- controller transfer function
- plant transfer function
- static process gain Δy/Δu: output units per input unit (K/W for the heater)
- apparent delay read from the reaction curve, s
- apparent time constant read from the tangent of the reaction curve, s
- ultimate (critical) gain: the P-only gain that gives sustained oscillation
- ultimate period: the period of that oscillation, s
- frequency of that oscillation, rad/s
- damping ratio of the dominant closed-loop pole pair, dimensionless
- derivative filter factor, dimensionless, usually 5 to 20
- Laplace transforms of the set-point, the measured output, the error R − Y and the controller output
- time constant of a first-order plant, s
- chosen closed-loop time constant, s
- thermal capacity in J/K and heat-loss coefficient in W/K of the heater model
The tables assume the standard form, so convert before entering gains into a parallel-form controller such as the labs on this site, which use Kp, Ki and Kd. In the first method keep the process gain K: tables that print 1.2T/L state the same rule for a response normalised to K = 1. The second method needs a loop that actually reaches sustained oscillation at a finite gain.
Ziegler–Nichols second method on a third-order plant, then one fine-tuning pass
The plant has an integrator and two lags; input and output are dimensionless. Close the loop with proportional action only and write the characteristic equation.
Build the Routh table. The s¹ row becomes zero at the gain where a pole pair sits on the imaginary axis.
Find the oscillation frequency by substituting s = jω. The imaginary part gives the frequency and the real part confirms the gain.
Convert the frequency to a period.
Read the PID row of the second-method table.
Convert to the parallel form, and write the controller with its double zero at −4/Pcr.
Check the closed loop. Its characteristic polynomial is s⁴ + 5s³ + (4 + 2Kd)s² + 2Kp·s + 2Ki. All four roots are in the left half-plane, but the dominant pair has ζ ≈ 0.24: the simulated unit-step response peaks at 1.61, a 61% overshoot, and the next peak is 1.13, a decay ratio of 0.21.
Fine-tune. Keep Kp and double both times, which moves the double zero from −1.27 to −0.64. The overshoot drops to 21% and the 2% settling time from 11.1 s to 5.5 s. Stop here or continue, depending on the specification.
Reference tables
| Controller | |||
|---|---|---|---|
| P | |||
| PI | |||
| PID |
K = Δy/Δu is the process gain, L the delay and T the time constant read from the tangent at the inflection point. Tables that print 1.2T/L assume K = 1.
| Controller | |||
|---|---|---|---|
| P | |||
| PI | |||
| PID |
Kcr is the proportional gain at which the loop first oscillates steadily and Pcr is the period of that oscillation. Both rules aim at roughly quarter-amplitude decay, so expect large overshoot and plan to refine.
| Controller | Ti (s) | Td (s) | Ki = Kp/Ti (s⁻¹) | Kd = KpTd (s) | |
|---|---|---|---|---|---|
| P | 5.00 | ∞ | 0.000 | 0 | 0.000 |
| PI | 4.50 | 2.618 | 0.000 | 1.719 | 0.000 |
| PID | 6.00 | 1.571 | 0.393 | 3.820 | 2.356 |
More detail and model assumptions
Finding Kcr and Pcr without an experiment
At the ultimate gain the P-only closed loop has a pair of poles exactly on the imaginary axis, at s = ±jωcr. Two calculations find it. In the Routh table, Kcr is the gain that makes a whole row zero, and the auxiliary equation from the row above gives ωcr. Or substitute s = jω into 1 + Kp·G(s) = 0 and set the real and imaginary parts to zero separately: one equation gives ωcr and the other gives Kcr. Then Pcr = 2π/ωcr.
The Nyquist plot says the same thing. Sustained oscillation means Kp·G(jω) passes through −1, so ωcr is the phase-crossover frequency of the plant and Kcr = 1/|G(jωcr)| is its gain margin. The second method therefore samples the plant's frequency response at one point: the point with −180° of phase.
That is why the method fails for simple plants. A first-order lag never passes −90° of phase and a second-order lag reaches −180° only as ω → ∞, so a P-only loop around either is stable for every positive gain and no Kcr exists. This site's motor model, with one electrical and one mechanical lag, is such a plant in continuous time. Add a delay or one more lag and a finite Kcr appears: e^{−0.5s}/(s + 1) has Kcr ≈ 3.81 and Pcr ≈ 1.71 s, and the motor lab's loop sampled every 20 ms has Kcr ≈ 8.6 V·s/rad with Pcr ≈ 0.16 s.
What quarter decay costs, and how to fine-tune
Ziegler and Nichols tuned for fast recovery from load disturbances and accepted a decay ratio of one quarter. For a dominant pole pair that corresponds to a damping ratio near 0.22. The response to a set-point step then typically overshoots by 10% to 60%, depending on the plant. The worked example sits at the top of that range: the overshoot is 61% and the dominant poles have ζ ≈ 0.24.
Both tables place the two PID zeros at the same point. The second method gives Gc = 0.075·Kcr·Pcr·(s + 4/Pcr)²/s, a double zero at −4/Pcr; the first gives Gc = 0.6·(T/K)·(s + 1/L)²/s, a double zero at −1/L. Both set Ti = 4Td. Fine tuning means moving that double zero and the overall gain while watching the response.
Change one thing at a time and repeat the same step test. Lengthening Ti weakens the integral action and usually cuts overshoot; lengthening Td adds damping until measurement noise becomes the limit. In the worked example, doubling both times with Kp unchanged lowers the overshoot from 61% to 21% and the 2% settling time from 11.1 s to 5.5 s. Lowering Kp is not always the safe move: halving Kp alone in that example raises the overshoot to 67%, because the crossover moves down to frequencies where the PID zeros have not yet added their phase lead.
The PID you actually implement
The textbook PID differentiates the error. When the set-point jumps, the error jumps with it: the derivative term produces a very large spike and the proportional term a step. This is set-point kick. The cure is to feed the derivative term, or both the derivative and the proportional terms, from the measurement instead of the error. PI-D control differentiates −y; I-PD control applies both P and D to −y, so that only the integral term sees the error.
All three structures have the same loop transfer function, so stability, margins and disturbance rejection do not change. Only the response to the set-point changes: PI-D removes the spike, and I-PD also removes the proportional jump, which gives a slower and smoother start. The motor lab already differentiates the measurement, as the PID chapter described.
Two more parts are standard. A pure derivative has a gain that grows without limit as frequency rises, so it is implemented as Td·s/(1 + Td·s/N): a derivative filter that caps the high-frequency gain at Kp·N, with N usually between 5 and 20. And integral action needs anti-windup whenever the actuator can saturate: the PID chapter and the windup lab show why, and the thermal lab uses conditional integration for the same reason.
Tuning from a model: lambda tuning
When you have a model, choose the closed-loop behaviour directly. For a first-order plant G = K/(τs + 1), set the PI integral time equal to the plant time constant, Ti = τ. The controller zero cancels the plant pole and the loop transfer function becomes Kp·K/(τs). The closed loop from set-point to output is then 1/(λs + 1) with λ = τ/(Kp·K). Pick the closed-loop time constant λ you want and solve for the gain: Kp = τ/(Kλ).
For the thermal lab, C = 1000 J/K and H = 5 W/K give K = 0.2 K/W and τ = 200 s. In the lab's own units, Kp = C/λ in W/K and Ki = Kp/Ti = H/λ in W/(K·s). With λ = 50 s this is Kp = 20 W/K and Ki = 0.1 W/(K·s); with λ = 25 s it is Kp = 40 W/K and Ki = 0.2 W/(K·s). A smaller λ is faster and asks for more heater power at the instant of a step: Kp times the step size, on top of the power that holds the temperature.
Two limits apply. The design is linear, so it predicts the response only while the heater stays between 0 W and its maximum: the lab's start from 20 °C to 60 °C requests 800 W from a 400 W heater and is slower than λ suggests. And the cancellation hides the plant pole from set-point changes only. A disturbance, or an integral term that starts at the wrong value, still decays with the plant's own 200 s time constant; that is the slow final creep you see after the saturated start.
Connect the example to the lab
The thermal lab's heater is a first-order plant with K = 1/H = 0.2 K/W and τ = C/H = 200 s. It has no delay, so neither Ziegler–Nichols table applies to it; lambda tuning does, with Kp = C/λ and Ki = H/λ. The lab's default gains, Kp = 20 W/K and Ki = 0.1 W/(K·s), are exactly the λ = 50 s design. Try λ = 25 s (Kp = 40, Ki = 0.2) and λ = 100 s (Kp = 10, Ki = 0.05), and time a small target step as described in the experiment below.
Try lambda-tuned PI gains on the heaterMake a prediction before moving a control.
- PREDICTThe lab defaults Kp = 20 W/K and Ki = 0.1 W/(K·s) correspond to λ = 50 s. After a 5 K target step that does not saturate the heater, when should the temperature have covered 63% of the step? Which gains give λ = 25 s and λ = 100 s?
- CHANGE ONE THINGOpen the PI lesson, set the duration to 1800 s, choose the event 'Target change' at 900 s with new value 65 °C, and pin the run. Then enter Kp = 40, Ki = 0.2 and run again; then Kp = 10, Ki = 0.05. Change only the two gains.
- OBSERVEAfter 900 s, read the time the temperature takes to reach about 63.2 °C: close to 50 s, 25 s and 100 s, with no overshoot. Then look at the first minutes of each run: compare requested and applied power, and note how long the temperature takes to come within 1 K of 60 °C.
- EXPLAINExplain why the 5 K step follows 1/(λs + 1) while the 40 K start does not. Use the heater limit and the cancelled 200 s plant pole in your answer, and say what λ = 25 s costs at the instant of the step.
A Ziegler–Nichols result is a starting point, not a finished design: in the worked example it gives 61% overshoot. Do not run the ultimate-gain experiment on a plant where sustained oscillation is unsafe; compute Kcr from a model or use the step test instead. And check which PID form your controller uses before typing Ti and Td where it expects Ki and Kd.
Check your understanding+
A P-only loop oscillates steadily when Kp = 8, with a period of 5 s. What are the Ziegler–Nichols PID settings in parallel form?
Kp = 0.6 × 8 = 4.8, Ti = 0.5 × 5 = 2.5 s and Td = 0.125 × 5 = 0.625 s, so Ki = 4.8/2.5 = 1.92 s⁻¹ and Kd = 4.8 × 0.625 = 3.0 s.Solve these before opening the solutions
Work each problem on paper first. Open the answer to check yours, then the full solution if you need the steps, and mark how it went.
Your design is in standard form: Kp = 4, Ti = 2 s, Td = 0.25 s. The controller you must program uses the parallel form. Find Ki and Kd. Then convert a parallel controller with Kp = 6, Ki = 1.5 s⁻¹ and Kd = 1.2 s to standard form.
Show answer
AnswerKi = 2 s⁻¹ and Kd = 1 s. For the second controller Ti = 4 s and Td = 0.2 s.
Show full solution
Solution
Standard to parallel: divide the gain by the integral time and multiply it by the derivative time.
Parallel to standard: invert the same two relations. Kp is the same number in both forms.
A heat exchanger is at rest. Opening the steam valve by a further 20% raises the outlet temperature by 8 °C. The tangent at the inflection point of the recorded curve gives a delay L = 4 s and a time constant T = 24 s. Find the Ziegler–Nichols PI and PID settings.
Show answer
AnswerPI: Kp = 13.5 %/°C, Ti ≈ 13.3 s. PID: Kp = 18 %/°C, Ti = 8 s, Td = 2 s.
Show full solution
Solution
Process gain: output change divided by input change.
Compute the group T/(KL) that appears in every row of the first-method table.
PI row.
PID row. In parallel form these are Ki = 2.25 %/(°C·s) and Kd = 36 %·s/°C.
A position servo has the transfer function below. Use a Routh table to find the ultimate gain and period of a P-only loop, then give the Ziegler–Nichols PID settings and the location of the controller zeros.
Show answer
AnswerKcr = 16 and Pcr = π/2 ≈ 1.571 s. PID: Kp = 9.6, Ti ≈ 0.785 s, Td ≈ 0.196 s, with a double zero at s ≈ −2.55.
Show full solution
Solution
Write the P-only characteristic equation.
The s¹ entry of the Routh table is (10·16 − 10Kp)/10. It is zero at the ultimate gain.
The auxiliary equation from the s² row gives the oscillation frequency, and from it the period.
Read the PID row of the second-method table.
Parallel gains and zero location. A simulation of this loop gives 61% overshoot, so fine tuning is needed here too.
A process has the transfer function below. (a) Show that a P-only loop around it has no ultimate gain. (b) The temperature sensor adds a lag 1/(0.1s + 1) to the loop. Find Kcr and Pcr now, and the Ziegler–Nichols PID settings.
Show answer
Answer(a) s² + 4s + 3 + Kp is stable for every Kp > 0. (b) Kcr = 57.2, ωcr ≈ 6.56 rad/s, Pcr ≈ 0.958 s; PID: Kp ≈ 34.3, Ti ≈ 0.479 s, Td ≈ 0.120 s.
Show full solution
Solution
(a) The second-order characteristic polynomial has positive coefficients for every positive gain, and the real part of its poles stays at −2.
(b) Include the sensor lag and expand.
Substitute s = jω. The imaginary part gives the frequency and the real part gives the gain.
Period and PID row.
Exam-level. A small oven has thermal capacity C = 1500 J/K and heat-loss coefficient H = 6 W/K. Its heater delivers 0 to 500 W and the room is at 20 °C. (a) Find the plant gain and time constant. (b) Design a PI controller by lambda tuning for a closed-loop time constant of 50 s; give Kp in W/K and Ki in W/(K·s). (c) The oven is holding 70 °C. What is the largest target step that does not saturate the heater? (d) How long does the oven take to cover 95% of such a step?
Show answer
AnswerK ≈ 0.167 K/W and τ = 250 s; Kp = 30 W/K and Ki = 0.12 W/(K·s); the step must not exceed about 6.7 K; 95% takes about 150 s.
Show full solution
Solution
(a) Write the energy balance for the temperature rise above ambient and transform it.
(b) Set Ti = τ and solve the lambda rule for Kp, then convert to the parallel form.
(c) Holding 70 °C takes H(70 − 20) = 300 W, which leaves 200 W. Right after the step the proportional term adds Kp·Δr, and the power then falls toward the new holding value, so the peak is at the instant of the step.
(d) Without saturation the closed loop is 1/(50s + 1). Solve 1 − e^{−t/λ} = 0.95.
Mark each exercise after you check your answer. Marks stay in this browser.
Terms this lecture teaches
- PID controlPID 제어
- reaction curve반응곡선
- ultimate gain임계이득
- anti-windup안티와인드업
- ultimate period임계주기
- derivative filter미분 필터
- derivative kick미분 킥
- PID tuningPID 동조
- Ziegler–Nichols tuning지글러–니콜스 동조법
- dead time (time delay)시간 지연
- derivative action미분 동작
- pole–zero cancellation극점·영점 상쇄
Frequently asked questions
What are the Ziegler–Nichols settings for the ultimate gain method?
With ultimate gain Kcr and ultimate period Pcr: P control uses Kp = 0.5Kcr; PI uses Kp = 0.45Kcr and Ti = Pcr/1.2; PID uses Kp = 0.6Kcr, Ti = 0.5Pcr and Td = 0.125Pcr. These are standard-form values, so convert with Ki = Kp/Ti and Kd = Kp·Td for a parallel-form controller.
What are the Ziegler–Nichols settings for the reaction curve method?
Fit the step response with process gain K = Δy/Δu, delay L and time constant T. Then P uses Kp = T/(KL); PI uses Kp = 0.9T/(KL) and Ti = L/0.3; PID uses Kp = 1.2T/(KL), Ti = 2L and Td = 0.5L. Tables that print 1.2T/L assume a response normalised to K = 1.
Why does Ziegler–Nichols tuning give so much overshoot?
The rules aim at a quarter decay ratio, each peak a quarter of the one before, which suits fast recovery from load disturbances. For a dominant second-order pair that means ζ ≈ 0.22, and a pure second-order step response with that damping overshoots by 50%. Treat the settings as a starting point and trade some speed for damping, for example by lengthening Ti and Td.
Why does the ultimate gain method fail for some plants?
It needs a P-only loop that reaches sustained oscillation at a finite gain, which requires the plant phase to reach −180° at a finite frequency. A first-order lag never passes −90°, and a second-order lag reaches −180° only as ω → ∞, so no Kcr exists. A delay or an extra lag creates one; never run the experiment where sustained oscillation is unsafe.
Why the next lesson follows
Lambda tuning assumed that the heater can deliver whatever the controller requests. The next chapter starts from the energy balance instead and asks first whether a one-way heater can reach the target at all, before any gain is chosen.
Further reading
Finished the reading and the exercises? Mark the lecture as done to tick it on the syllabus. Progress stays in this browser.
EIGENROOM · https://eigenroom.com/theory/pid-tuning · Updated 2026-11-15