PID Tuning Calculator Formula
Understand the math behind the pid tuning calculator. Each variable explained with a worked example.
Formulas Used
Proportional Gain (Kp)
kp = 0.6 * kuIntegral Gain (Ki)
ki = 1.2 * ku / tuDerivative Gain (Kd)
kd = 0.075 * ku * tuIntegral Time (Ti)
ti = tu / 2Derivative Time (Td)
td = tu / 8Variables
| Variable | Description | Default |
|---|---|---|
ku | Ultimate Gain (Ku) | 10 |
tu | Ultimate Period (Tu)(s) | 2 |
How It Works
Ziegler-Nichols PID Tuning
The Ziegler-Nichols closed-loop method determines PID gains from two measurements: the ultimate gain Ku (gain at which the system oscillates) and the ultimate period Tu (period of those oscillations).
Formulas
Kp = 0.6 × Ku
Ti = Tu / 2, so Ki = Kp / Ti = 1.2 × Ku / Tu
Td = Tu / 8, so Kd = Kp × Td = 0.075 × Ku × Tu
These gains provide a starting point; fine-tuning is usually needed to balance response speed, overshoot, and stability.
Worked Example
A system oscillates at Ku = 10 with period Tu = 2 seconds.
- 01Kp = 0.6 × 10 = 6.0
- 02Ti = 2 / 2 = 1.0 s, Ki = 1.2 × 10 / 2 = 6.0
- 03Td = 2 / 8 = 0.25 s, Kd = 0.075 × 10 × 2 = 1.5
Frequently Asked Questions
What is the Ziegler-Nichols method?
It is a classical tuning technique where you increase the proportional gain until the system oscillates continuously. The gain and period at this point (Ku, Tu) are used to compute PID gains from empirical formulas.
Is Ziegler-Nichols tuning optimal?
No. ZN tuning typically produces aggressive response with 25% overshoot. It provides a good starting point, but most systems benefit from adjustment. Modern methods like IMC, lambda tuning, or auto-tuning often give better results.
What if I only want PI control?
For PI control (no derivative): Kp = 0.45 × Ku, Ti = Tu / 1.2. For P-only control: Kp = 0.5 × Ku. These are also from the Ziegler-Nichols table.
Ready to run the numbers?
Open PID Tuning Calculator