Mechatronics & Robotics

PID Ziegler–Nichols Tuning Calculator — Kp, Ki, Kd from Ultimate Gain and Oscillation Period

Calculate Kp, Ki and Kd using ultimate gain Ku and oscillation period Tu based on the Ziegler–Nichols PID tuning rule.

Unit-aware inputs Deterministic calculation Engineering interpretation
Calculation workspace

Enter the known values and review the calculated result

Deterministic calculation
01
Parameters

Input parameters

Use consistent values and select the intended engineering units.

Ultimate gain

Oscillation period

02
Output

Results

Live
Ready to calculate Complete the required inputs and run the calculation.
Engineering Pro Save, document and continue this calculation

Turn this result into a reusable engineering record with saving, PDF export and reporting workflows.

Engineering reference

Method, application and limitations

Review the calculation method, intended application and engineering assumptions before using the result in a design decision.

01
Method

Formula and calculation method

Kp, Ki and Kd formula:

Kp = 0.6 · Ku

Ti = 0.5 · Tu

Td = 0.125 · Tu

Ki = Kp / Ti

Kd = Kp · Td

where:

  • Kp — Proportional gain [—]
  • Ki — Integral gain [1/s]
  • Kd — Derivative gain [s]
  • Ku — Ultimate gain [—]
  • Tu — Oscillation period [s]
  • Ti — Integral time [s]
  • Td — Derivative time [s]
02
Application

When to use this calculator

When to use this calculator:

  • To calculate proportional gain, integral gain and derivative gain after measuring ultimate gain and oscillation period.
  • To convert an ultimate oscillation test result into PID controller parameters.
  • To check how the oscillation period changes integral time, derivative time, integral gain and derivative gain.
  • To evaluate whether measured ultimate gain or oscillation period produces invalid, limit, warning or unsafe controller parameters.
03
Decision support

How to interpret the result

Proportional gain, integral gain and derivative gain are defined as PID controller parameters calculated from ultimate gain and oscillation period.

The result depends on ultimate gain and oscillation period. Increasing ultimate gain increases proportional gain, integral gain and derivative gain. Increasing oscillation period increases derivative time and derivative gain, while reducing the integral gain ratio.

  • Info — returned when none of the warning, limit or unsafe conditions is reached.
  • Warning — returned when controller balance is greater than 0.3 or integral gain ratio is greater than 5.
  • Limit — returned when ultimate gain is greater than 1,000,000.
  • Unsafe — returned when derivative influence is greater than 1 or oscillation period is below 0.001 s.
  • Invalid — returned when ultimate gain is not greater than zero, oscillation period is not greater than zero, oscillation period is below 0.000001 s, the calculation is not finite, or integral gain or derivative gain is not greater than zero.

The result is used to evaluate the initial PID controller settings calculated from measured ultimate gain and oscillation period.

04
Worked case

Calculation example

Example:

A user measured the ultimate gain and oscillation period during a controller tuning test and wants to calculate initial PID settings.

  • Ku — Ultimate gain = 10
  • Tu — Oscillation period = 2 s

Kp = 6, Ki = 6 1/s, Kd = 1.5 s.

05
Model boundaries

Assumptions and limitations

  • Ultimate gain must be a finite value greater than zero.
  • Oscillation period must be a finite value greater than zero.
  • Oscillation period must not be below 0.000001 s.
  • Integral gain and derivative gain must be greater than zero.
06
Questions

Frequently asked questions

How to calculate Kp, Ki and Kd?
Kp, Ki and Kd are calculated using the Ziegler–Nichols PID tuning formula. Proportional gain is calculated as 0.6 multiplied by ultimate gain, integral gain is calculated by dividing proportional gain by integral time, and derivative gain is calculated by multiplying proportional gain by derivative time.
What affects Kp, Ki and Kd the most?
Proportional gain depends directly on ultimate gain. Integral gain depends on proportional gain and integral time. Derivative gain depends on proportional gain and derivative time. Increasing ultimate gain increases proportional gain, integral gain and derivative gain.
When is the Kp, Ki and Kd formula not valid?
The formula is not valid when ultimate gain is not greater than zero, oscillation period is not greater than zero, or oscillation period is below 0.000001 s. The calculation is also invalid when the resulting controller parameters are not finite, or when integral gain or derivative gain is not greater than zero.
Can this calculator be used after an ultimate oscillation test?
It can be used when ultimate gain and oscillation period are measured as positive finite values. It should not be used when the oscillation period is too small, because the result is classified as invalid for unstable or noisy measurement.
Add an engineering note