PID TUNING
PID Tuning Explained With a Simulator (Video)
What P, I and D really do, a manual tuning procedure you can practise on a simulated loop, Ziegler–Nichols without the myths, and a worksheet to keep.

This PID tuning tutorial in one paragraph: proportional action gives the main correction, integral removes the steady offset, and derivative damps the approach. To tune by hand, run a step test, start with P and I only, raise the gain until the response is brisk but not oscillating, then add integral until the offset clears without large overshoot.
In this lesson by MATLAB, part of its Understanding PID Control series, manual and automatic PID tuning methods are compared. Watch it for the ideas, then practise on a simulated loop. Follow along, then check your work against the steps below.
What P, I and D actually do
A PID controller compares the process value (PV) with the setpoint (SP). The difference is the error. The controller output is built from three terms.
Proportional (P) is proportional to the present error. Raise the gain and the loop responds harder and faster, with more overshoot, until it starts to oscillate. On most processes P alone leaves a steady offset: the output only changes if there is an error, so a small error has to remain to hold the output where the process needs it.
Integral (I) adds up the error over time and keeps pushing the output until the error is zero. That removes the offset. Too much integral, meaning an integral time that is too short, causes overshoot and a slow, rolling oscillation. When the output hits a limit, the integral can keep growing, which is called windup; anti-windup stops that.
Derivative (D) responds to how fast the error, or on many controllers the PV, is changing. It damps the approach to setpoint and can allow a little more gain. It also amplifies measurement noise, which is why many flow, level and pressure loops run as PI, and D is kept for slower loops such as temperature.
Know your controller's units first
Before touching a number, check which form your controller uses. Some take a gain (Kp), others a proportional band in percent, where a larger band means less action. Some take an integral time in seconds or minutes per repeat, where a larger number means less integral action; others take an integral gain, where a larger number means more. Siemens PID_Compact, for example, shows Kp, Ti and Td. Writing a value meant for one form into another is the most common tuning mistake.
A manual tuning procedure
Practise this on a simulator first. It is safe, fast and repeatable.
- Put the loop in manual. Hold the output steady and let the PV settle.
- Run a step test. Step the output by a known amount, say 5 to 10%, and record the trend. Note how far the PV moved per percent of output (the process gain), how long before it started to move (dead time) and how long it took to reach about 63% of its final change (time constant).
- Start with PI only. Set derivative to zero and choose a cautious gain. A sensible first integral time is roughly the process time constant.
- Close the loop and step the setpoint. Make a small setpoint change and watch the trend.
- Adjust the gain. If the response is sluggish, raise the gain. If it oscillates, lower it. Change one thing at a time.
- Adjust the integral. If the PV creeps slowly to setpoint, shorten the integral time. If it overshoots and rolls, lengthen it.
- Add derivative only if needed. On a slow, noise-free loop, a small derivative can reduce overshoot. If the output becomes jumpy, filter or remove it.
- Test a disturbance, not just a setpoint change. Loops in plants mostly fight disturbances. Change the load or inflow in the simulator and check the recovery.
Ziegler–Nichols, accurately
The Ziegler–Nichols method comes from a 1942 paper by John Ziegler and Nathaniel Nichols. In the closed-loop version you remove integral and derivative action, raise the proportional gain until the loop oscillates with a steady amplitude, and note that ultimate gain (Ku) and the oscillation period (Tu). The classic settings are:
- P only: Kp = 0.5 Ku.
- PI: Kp = 0.45 Ku, Ti = Tu / 1.2.
- PID: Kp = 0.6 Ku, Ti = Tu / 2, Td = Tu / 8.
Two cautions. The result is aggressive: it aims for a quarter-amplitude decay, which means clear overshoot. And driving a real process into sustained oscillation is often not acceptable, so treat Ziegler–Nichols as a starting point you refine, and try it on a simulator before a plant.
Autotune
Most PLC PID blocks include an autotune. Siemens PID_Compact, for example, offers pretuning from a step response and fine tuning from a controlled oscillation. Autotune is a good start, but read what it proposes, check it against your own step test, and test a disturbance before you accept it.
Your tuning worksheet
Copy this into your notes and fill it in for every loop you tune.

Practise on a simulator, free
Our free PID Control for PLC Engineers course covers P, I and D one at a time, tuning from a step test, anti-windup, noise filtering, modelling a process and PID on Allen-Bradley controllers. Its tuning module includes this MATLAB lesson, and its practice task is to run a step test, derive P and I from the response, and compare them with the autotune result.
If you use Siemens, Siemens TIA Portal PID Compact and Analog Processing builds the loop in TIA Portal with PLCSIM: analog scaling, PID_Compact in a cyclic interrupt, pretuning and fine tuning, and a simulated tank with an HMI trend. For the signals themselves, take Industrial Instrumentation and Process Control.
The courses and their assessments are free. The certificate is optional, a small one-off fee from US$2.99 for a beginner course. It is an EDWartens certificate of completion with a code anyone can check at edwartens.com/verification, not a vendor or accredited qualification. Create a free account to start.
Take the free course
Questions
What do P, I and D each do in a PID controller?
P acts on the present error, I on the error accumulated over time, and D on how fast the error or process value is changing. P gives the main correction, I removes steady offset, and D damps the approach but amplifies noise.
Why does a P-only controller leave an offset?
Because the proportional output depends on the error, so on most processes a steady non-zero error is needed to hold the output where the process needs it. Integral action removes that offset.
What are the Ziegler–Nichols PID settings?
In the closed-loop method you find the ultimate gain Ku and period Tu at sustained oscillation, then set Kp = 0.6 Ku, Ti = Tu/2 and Td = Tu/8 for a PID. The result is aggressive, with quarter-amplitude decay.
Should I use derivative action?
Often not. Many process loops such as flow, level and pressure run well as PI. Derivative helps on slow loops such as temperature, but it amplifies measurement noise, so filter the signal if you use it.
Can I practise PID tuning without a real plant?
Yes. A simulated tank or first-order process in a PLC simulator or Simulink behaves enough like a real loop to practise step tests and tuning, which is how our free PID courses teach it.
Sources
Written by the EDWartens engineering team for general education. Product names are trademarks of their owners; mentioning them does not imply endorsement. Prices and terms of other providers were checked on the date shown and can change.





