Calculate PID tuning suggestions from a process model
This PID calculator provides Ziegler-Nichols open-loop, Cohen-Coon and ultimate-gain closed-loop tuning suggestions for P, PI and PID controllers. It shows parallel-form gains Kp, Ki and Kd alongside integral and derivative times Ti and Td. A separate plot illustrates how the currently applied gains behave on the entered first-order-plus-dead-time process model.
The suggested gains and applied controller are separate. Changing a model or rule updates the recommendation, while Apply Suggested Gains transfers it to the plotted controller. Manual sliders then change the applied values. This separation lets you compare a recommendation with an existing tuning without assuming the chart has already adopted the new values.
Identify K, T and L consistently
A first-order-plus-dead-time model describes a process with a gain, a dominant lag and a transport delay. Process gain K is settled output change divided by input change. T is the time constant after the delay, while L is the delay before the modeled response begins. Use consistent engineering units for input, output and time; gains calculated for percentage output cannot be pasted unchanged into a controller using a different output scale.
The step-test formulas here require finite positive K, T and L. They do not cover a negative process gain, integrating plant or a zero-delay limit by silently replacing the model. A blank or invalid parameter shows no tuning suggestion. A physical zero-delay process needs another suitable tuning approach rather than inventing a small nonzero delay.
Open-loop tuning rules and controller forms
The implemented Ziegler-Nichols table is:
| Controller | Kp | Ti | Td |
|---|---|---|---|
| P | T / (K × L) | none | zero |
| PI | 0.9 × T / (K × L) | L / 0.3 | zero |
| PID | 1.2 × T / (K × L) | 2 × L | 0.5 × L |
Cohen-Coon adjusts the coefficients using the ratio r = L/T. For PID, Kp = (T/(K × L)) × (4/3 + r/4), Ti = L × (32 + 6r)/(13 + 8r), and Td = 4L/(11 + 2r). Neither rule automatically checks whether this approximate model adequately represents the real process.
The standard controller form uses Kp multiplied by error, the error integral divided by Ti, and Td times error derivative. The equivalent parallel coefficients are Ki = Kp/Ti and Kd = Kp × Td. A P controller has no integral action, shown as an infinite Ti, rather than a finite integral time to enter into firmware.
Worked example with the default process
Use K = 1.5, T = 2 s and L = 0.5 s, then choose PID. The library computes:
| Rule | Kp | Ti, s | Td, s | Ki | Kd |
|---|---|---|---|---|---|
| Ziegler-Nichols open loop | 3.2 | 1 | 0.25 | 3.2 | 0.8 |
| Cohen-Coon | 3.72222 | 1.11667 | 0.173913 | 3.33333 | 0.647343 |
These values are starting suggestions for the stated mathematical model. The initial manual gains are a separate example, so click Apply before judging the recommendation's plotted response. No measured settling-time or overshoot statistic is calculated; inspect the illustrative curves and verify performance through a suitable analysis or controlled test.
Ultimate gain and the gentler variant
The closed-loop rule takes Ku, the proportional-only ultimate gain, and Tu, its oscillation period. For classic PID it gives Kp = 0.6Ku, Ti = Tu/2 and Td = Tu/8. With Ku = 10 and Tu = 2 s, the result is Kp = 6, Ki = 6 and Kd = 1.5.
The gentler PID variant uses Kp = 0.2Ku, Ti = Tu/2 and Td = Tu/3. The same example gives Kp = 2, Ki = 2 and Kd = 1.33333. Its traditional no-overshoot label does not guarantee a particular response for every plant. The interface therefore presents it as a gentler coefficient set rather than a promise about the actual system.
Only use a real ultimate-gain experiment where intentionally approaching sustained oscillation is acceptable. The NI tuning-method overview provides additional context for the method. This page does not connect to hardware, perform an experiment or automatically identify Ku and Tu from uploaded data.
Sample-time scaling for controller code
If code accumulates raw error once per sample and differentiates by subtracting the previous error without dividing by elapsed time, its coefficients need the sample interval Ts. The displayed integral coefficient is Ki × Ts and the derivative coefficient is Kd / Ts. For the open-loop example at Ts = 0.01 s, these are 0.032 and 80.
Do not apply that conversion twice when a controller library already handles timing. A changed sample interval also changes the physical implementation, so match the configured units and loop scheduling. Blank, zero and negative sample times produce no per-sample values. The sample-time field converts the recommendation; it does not change the plot's integration step or automatically convert the manual controller.
Understand what the simulation represents
The plot uses a fixed Euler integration step of 0.05 s over a 10 s window, with a unit setpoint change at 1 s. Dead time is rounded to that integration grid. The controller output is limited to ±50, with a simple integral rollback during saturation, and the derivative acts on error without a filter.
This is an educational approximation, not a stability proof or a high-fidelity actuator model. The plot requires a time constant of at least its integration step; smaller positive time constants may still produce formula suggestions without a plot. Fast dynamics, derivative kick, coarse delay rounding and nonlinear saturation can affect what the curves show. The display does not model sensor noise, a real derivative filter or a full commissioning procedure.
Continue the analysis
Read the PID tuning guide for additional model and tuning context. Use the Bode plot generator for transfer-function frequency-response exploration and the stepper calculator when the controlled axis also needs pulse and travel calculations. Controller gains, actuator capability and mechanical load are distinct parts of the design.