ToolSphere

PID Tuning Helper

Robotics

PID tuning calculator: Ziegler-Nichols (step test or Ku/Tu) and Cohen-Coon gains as Kp, Ki, Kd and Ti, Td, a live step-response plot, and per-sample gains.

Enter a process model to get suggested gains. Apply them to the plot, or adjust the applied gains yourself.

Suggested controller gains

Proportional Kp
3.2000
Integral Ki
3.2000
Derivative Kd
0.8000

Ti = 1 sTd = 0.25 s

Suggestions use Ziegler-Nichols (open loop) and the PID controller. They update separately from the applied gains below.

1. Process model

Use a first-order-plus-dead-time (FOPDT) model: process gain, response time and delay.

2. Tuning rule

If your loop code does not multiply by dt: Ki·Ts = 0.032, Kd/Ts = 80

3. Applied controller gains

These gains drive the plot. Apply a suggestion above, or move a slider to compare the response.

Proportional gain (Kp)2.4
Integral gain (Ki)1.2
Derivative gain (Kd)0.3

The illustrative plot uses a fixed 0.05 s integration step, a 10 s window and output limiting at ±50. Sample time below only converts gains for your code.

Illustrative step response

Applied gains

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use PID Tuning Helper

  1. 1Enter a positive process gain K, time constant T and dead time L for a step-test rule, or choose the closed-loop rule and enter positive Ku and Tu.
  2. 2Select P, PI or PID and compare suggested parallel gains Kp/Ki/Kd with standard-form times Ti/Td.
  3. 3Click Apply Suggested Gains to update the plotted controller; changing a recommendation alone does not apply it.
  4. 4Adjust the manual gains to explore the illustrative FOPDT response. The chart uses its own fixed integration step, not the conversion sample-time field.
  5. 5Enter your controller sample interval in seconds to calculate Ki·Ts and Kd/Ts; apply this scaling only if the receiving code does not already do it.

About PID Tuning Helper

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.

Guides and tutorials

Frequently asked questions

How do I calculate PID gains with this tool?

Choose a tuning rule and supply the model or ultimate-gain parameters that rule requires. The resulting coefficients are starting suggestions; check the controller form and units before applying them elsewhere.

What is the difference between Ziegler-Nichols open and closed loop?

The open-loop rule uses process gain, time constant and dead time from a process model. The closed-loop rule instead uses ultimate proportional gain and oscillation period; this tool does not measure either set automatically.

What do Kp, Ki, Kd, Ti and Td mean?

Kp, Ki and Kd are the parallel-form coefficients, while Ti and Td are times in the standard form. The conversion is Ki = Kp/Ti and Kd = Kp × Td; controller units and implementation details still matter.

Does changing the tuning rule immediately change the plotted controller?

No; suggestions update separately from applied gains. Click Apply Suggested Gains to transfer the recommendation, then use the manual controls to explore changes.

Why is zero dead time rejected for step-test tuning?

The implemented rules divide by dead time, so the zero-delay case is outside their supported inputs. The tool does not silently replace zero with a different process model.

Does the gentler closed-loop variant guarantee no overshoot?

No; its coefficients describe a traditional gentler tuning variant. Actual overshoot depends on the plant, controller implementation, limits and other operating conditions.

When should I use the per-sample gain values?

Use them only when the receiving code needs coefficients for raw per-sample error accumulation and differencing. If its library already applies the sample interval, adding this scaling again changes the intended controller.

Does the sample-time field control the chart simulation?

No; it converts the suggested coefficients for your code. The chart uses its own fixed integration step and the currently applied manual controller gains.

Can the plot prove my real system is stable?

No; it simulates a simplified process with a fixed numerical grid, output limit and basic integral rollback. It does not include all real sensor, actuator or process dynamics.

Can I use a negative process gain or an integrating process?

This interface supports a finite positive-gain first-order-plus-dead-time model for its step-test rules. Processes outside that assumption require an appropriate controller sign convention and a different analysis or tuning method.

Have a suggestion for PID Tuning Helper?Share your feedback ↗