How to regulate (Kp, Ki, Kd) in PID controller?

PID Kp Ki Kd tuning

How to Tune Kp, Ki and Kd in a PID Controller

PID tuning is not the process of making three numbers as large as possible until the machine becomes fast. It is the process of finding a controller response that is fast enough, stable enough and tolerant enough for the real plant.

The same Kp, Ki and Kd values can behave completely differently on a pressure loop, an oven, a tank-level system or a servo axis because the physical processes do not have the same gain, delay, inertia or operating limits.

Tune the behaviour of the complete loop, not the three numbers displayed on the controller.

Before working on tuning, it helps to understand what PID control is and how the P, I and D components contribute to the controller output.

Before Touching the Gains, Prove the Loop

A poorly behaving control loop is not automatically a poorly tuned PID controller.

Before changing gains, verify the complete signal path:

Sensor → Input → Engineering scaling → PID → Output → Actuator → Physical process

If the real pressure is 6 bar but incorrect analog scaling reports 5 bar, the controller is being given false information.

If the PID output changes but a valve is stuck, changing Kp does not repair the valve.

If a VFD is limited by a long acceleration ramp, increasing proportional gain may simply drive the controller output to its maximum sooner while the motor still accelerates at the same physical rate.

Tuning starts only after measurement and actuation are known to be correct.

For analog loops, verify 0-10 V and 4-20 mA scaling before blaming the controller.

Kp: How Hard Should the Controller React?

Kp determines the strength of the proportional response to the present error.

If the setpoint is far from the measured process value, proportional action produces a larger correction. As the error becomes smaller, the proportional contribution decreases.

Increasing Kp will often make a loop respond more strongly and may shorten the apparent response time.

But this is not guaranteed to improve control.

Too much proportional action can produce:

repeated oscillation around the setpoint,

excessive overshoot,

rapid valve movement,

unstable pump-speed commands,

mechanical vibration in motion systems.

The useful Kp is not the highest stable number. It is the gain that gives the required response with enough stability margin for changing operating conditions.

What Does Too Little Kp Look Like?

A weak proportional response often looks sluggish.

After a load disturbance, the process may take too long to recover.

After a setpoint change, PV may move in the correct direction but without enough authority.

However, do not automatically increase Kp when a process is slow.

The apparent sluggishness may be caused by:

sensor filtering,

process dead time,

a slow valve,

a long VFD ramp,

thermal inertia,

slow communication.

Those effects are covered in more detail in time delay and process dynamics.

Ki: Removing Error That Refuses to Go Away

Integral action addresses error that remains over time.

Suppose a pressure setpoint is 6 bar and proportional control stabilises the process at 5.8 bar.

The remaining 0.2 bar error persists.

Integral action gradually adds more control effort while that error continues, helping the process reach the desired value.

In a parallel-form PID controller, Ki represents the integral gain.

Increasing Ki generally causes integral action to accumulate more quickly.

This can reduce steady-state error faster, but excessive integral action can create:

large overshoot,

slow repeating oscillation,

long settling time,

integral windup.

Integral action is primarily there to remove persistent error. It should not be used as a substitute for adequate proportional control or sufficient actuator capacity.

Ki and Ti Are Not the Same Parameter

This is one of the easiest ways to make a serious tuning mistake when moving between controller brands.

Some PID implementations use:

Kp, Ki and Kd

while others use:

Kp, Ti and Td.

Ki is an integral gain. Ti is an integral time constant.

They do not mean the same thing and their numeric behaviour is not interchangeable.

In standard PID form, increasing Ti generally weakens the integral contribution when the other terms remain unchanged.

That means an instruction such as “increase the integral setting” can be dangerously ambiguous if one person is thinking about Ki while another controller uses Ti.

Never transfer PID values between PLCs, drives or temperature controllers until you know which equation and units each device uses.

Kd: Damping, Not Fortune-Telling

Derivative action responds to the rate at which the relevant signal is changing.

In suitable loops it can add damping and help reduce overshoot.

It is sometimes described as “predicting future error”. That description is too loose for practical engineering. A derivative term does not know what will happen next; it reacts to the current rate of change.

Derivative action also reacts strongly to rapid measurement changes.

Unfortunately, electrical noise, pressure pulsation and quantisation also look like rapid changes.

For this reason, D can produce a noisy control output when the measurement is not clean.

Many industrial pressure, flow, temperature and level loops therefore operate successfully with PI control and no derivative term at all.

Do Not Add D Just Because the Loop Oscillates

Oscillation has many possible causes.

Excessive Kp may be responsible.

Integral action may be too aggressive.

The plant may have large dead time.

The sensor may contain noise.

A mechanical system may have resonance.

The actuator may be sticking.

Adding derivative action without understanding the reason for the oscillation can make diagnosis more difficult.

Derivative Filtering Helps, but Filtering Has a Price

Industrial PID implementations frequently filter the derivative action because an unfiltered derivative term can react severely to measurement noise.

Filtering reduces sensitivity to rapid noise, but it also changes the controller dynamics.

Excessive filtering introduces additional lag.

This produces the usual control-engineering trade-off:

less noise versus more delay.

Before adding heavy filtering, check whether the real problem is poor grounding, bad shielding, unstable instrumentation or unnecessary transmitter damping.

Sample Time Changes the Controller

A digital PID controller does not continuously calculate like the ideal equation drawn in a textbook.

A PLC, microcontroller or drive evaluates its PID algorithm at discrete time intervals.

Integral and derivative calculations depend on that timing.

Therefore changing the PID execution interval without understanding the controller implementation can change the loop behaviour even if the displayed gain values remain the same.

For a PLC application, the PID instruction should normally execute at a known periodic rate appropriate to the physical process.

A slow temperature process may require a relatively slow update rate. Pressure and flow loops may need shorter periods.

The details of PLC implementation are covered in PID control with PLCs.

Output Limits Should Be Set Before Tuning

The controller equation can calculate values the physical machine cannot produce.

A control valve cannot travel beyond its mechanical limits.

A heater cannot deliver more than its rated power.

A VFD cannot command an unlimited motor speed.

PID output limits should therefore reflect the usable range of the actuator.

This matters particularly during tuning because a controller that spends most of its time saturated is not behaving like an unrestricted theoretical PID loop.

Integral Windup: When the Controller Wants More Than the Machine Can Deliver

Assume a pump is already running at maximum allowable speed while pressure remains below the setpoint.

The PID output cannot physically increase any further.

If integral action continues accumulating the remaining error, the internal integral value can become very large.

When process demand later decreases, that stored integral action may keep the output unnecessarily high and produce severe pressure overshoot.

This is integral windup.

Industrial PID blocks may provide functions such as:

output limiting,

integral hold,

tracking,

anti-windup feedback.

The exact implementation depends on the controller.

Anti-windup behaviour is part of PID commissioning, not an optional theoretical detail.

Manual Mode Is the Best Place to Start

Before automatic tuning, put the process in a safe condition and test the actuator manually where the application allows it.

A controlled manual test can answer several questions immediately.

1. Does the valve, heater, VFD or actuator respond?

2. Does PV move in the expected direction?

3. Does the sensor report approximately the correct physical change?

4. How quickly does the process begin to respond?

5. Does the actuator have an unexpected limit or delay?

There is little value in tuning a closed loop before these basic facts are known.

A Practical Manual-Tuning Approach

There is no single tuning sequence that is correct for every PID implementation. Manufacturer procedures should take priority.

For a conventional process loop, however, a practical engineering sequence may look like this:

1. Verify sensor and actuator operation.

2. Confirm engineering scaling.

3. Confirm the control direction.

4. Configure sensible output limits.

5. Verify the PID execution interval.

6. Establish a controlled proportional response.

7. Add only enough integral action to remove the persistent offset.

8. Consider derivative action only if the process benefits from it.

9. Record SP, PV and controller output during tests.

10. Validate the result under real load and disturbances.

This is intentionally different from blindly changing all three gains together.

Tune from the Trend, Not from Memory

PID tuning becomes much easier when setpoint, process value and controller output are plotted together.

Useful signals include:

SP - Setpoint

PV - Process value

CV - Controller output

Auto / Manual status

Actual actuator feedback

A trend can show whether the controller is actually producing the behaviour being blamed on it.

If CV changes but the real valve position does not, the PID is not the first problem.

If CV remains at its upper limit for minutes, look at actuator capacity and process demand.

If PV starts moving only long after CV changes, investigate delay before increasing gain.

Read the Symptoms

The process is stable but painfully slow: proportional action may be weak, but also investigate sensor filtering, actuator speed and dead time.

PV repeatedly crosses the setpoint with a regular oscillation: proportional or integral action may be too aggressive for the plant dynamics.

PV settles close to the setpoint but leaves a persistent offset: additional integral action may be appropriate.

PV overshoots badly and takes a long time to return: integral action and windup deserve attention.

Controller output is noisy: inspect measurement quality, Kp and derivative action.

Controller output stays at 100% but the target is never reached: check the physical capacity of the process before changing gains.

The tuning works at low load but becomes poor at high load: plant dynamics may change with operating point.

For a wider diagnostic approach, see PID troubleshooting.

Setpoint Response and Disturbance Rejection Are Different Tests

Commissioning engineers often judge a PID loop by changing the setpoint and watching the response.

That is useful, but it may not represent the actual production problem.

A pressure system might operate at the same 6 bar setpoint for months. Its real challenge is maintaining that pressure when plant consumption suddenly increases.

A temperature loop may have a fixed setpoint while product flow and inlet temperature change continuously.

A controller tuned for a dramatic setpoint response is not automatically the controller that best rejects production disturbances.

Decide what the loop actually needs to do before deciding what “good tuning” looks like.

Pressure Example: Do Not Tune Around a Slow VFD Ramp

Consider a pressure transmitter, PLC and pump VFD maintaining 6 bar.

The PID output rises immediately when pressure falls.

But suppose the drive has a 20-second acceleration ramp.

The motor cannot follow the PID command quickly, regardless of how high Kp is set.

An aggressive controller may simply saturate at maximum output while the drive continues following its configured ramp.

The engineer may then incorrectly increase integral action because pressure remains low, creating windup on top of the actuator delay.

The correct investigation includes both the controller and VFD process behaviour.

Temperature Example: Stored Energy Changes the Tuning Problem

A furnace or heated tank can continue getting hotter even after heater output is reduced.

The process contains stored thermal energy.

The temperature sensor may also respond more slowly than the heating element itself.

Aggressive proportional and integral tuning can therefore produce large overshoot.

Temperature loops often benefit from a much calmer tuning strategy than fast pressure or flow loops.

For dedicated controllers, see PID with temperature controllers.

Level Control Is Different Again

Tank level often behaves as an integrating process.

If inflow remains greater than outflow, the level keeps rising rather than naturally settling at a new operating point.

That is different from many self-regulating pressure or temperature processes.

Tuning values copied from a pressure loop can therefore perform very poorly in level control.

Auto-Tune Is a Test, Not Magic

Many PLCs, drives and temperature controllers provide automatic tuning.

Auto-tune normally excites the process in a controlled way, observes the response and calculates initial controller parameters.

This can be extremely useful.

But the process must already be electrically and mechanically healthy.

Before auto-tune, confirm:

valid measurement,

correct control direction,

working actuator,

safe output limits,

acceptable process operating range.

The resulting gains should still be verified under real production conditions.

Ziegler-Nichols Is Not a Universal Factory Procedure

Ziegler-Nichols remains historically important and useful for understanding tuning relationships.

That does not mean every industrial machine should be pushed toward sustained oscillation to obtain PID parameters.

Processes with strict pressure, temperature, product-quality or mechanical limits may not tolerate aggressive identification tests.

Cohen-Coon and other classical approaches also provide useful initial tuning ideas, but none of them removes the need to understand the actual plant.

A tuning formula is a starting method, not permission to ignore process limits.

Model-Based Tuning and Robustness

If an approximate process model is available, PID tuning can be approached more systematically.

Process gain, time constants and dead time can be used to select controller parameters that achieve a desired balance between speed and robustness.

This balance is important because the real plant never remains identical to the commissioning test forever.

Pumps wear.

Filters become dirty.

Product properties change.

Ambient conditions move.

Valve characteristics change across their travel.

A controller tuned exactly at the edge of instability may look impressive during one test and become troublesome in production.

Industrial tuning normally needs some tolerance for the plant being imperfect.

For the stability side, see stable PID operation.

Full PID Is Not Automatically Better Than PI

A three-term PID controller may look more advanced than a PI controller, but control quality is not measured by how many terms are enabled.

Many industrial temperature, flow and pressure loops use PI control successfully.

Derivative action should have a reason for being present.

Likewise, more advanced control methods may be appropriate for plants with large dead time, measurable disturbances, changing dynamics or strongly interacting variables.

The alternatives are compared in PID and other control strategies.

A Final PID Tuning Check

1. Is PV physically correct?

2. Are SP and PV using the same engineering units?

3. Does the actuator work correctly in Manual mode?

4. Is the control direction correct?

5. Are output limits realistic?

6. Is the PID execution interval known and repeatable?

7. Is the sensor or input filter adding excessive delay?

8. Does the actuator spend significant time saturated?

9. Is anti-windup behaviour configured correctly?

10. Have SP, PV and CV been viewed together on a trend?

11. Has the tuning been tested under realistic load changes?

12. Is fault behaviour defined for a failed sensor or actuator?

If several of these questions are unanswered, changing PID gains is probably premature.

Related PID Tuning Topics

PID fundamentals: What Is PID? - P, I and D Components - How PID Works

Tuning and process behaviour: Time Delay and Process Dynamics - Stable PID Operation - PID for Different Process Types - PID Troubleshooting

Industrial controllers: PID with PLCs - PID with VFDs - PID with Servo Motors

Process applications: Pressure Control - Flow Control - Level Control - Temperature Control

Beyond basic tuning: PID and Other Control Strategies

PID implementations differ between manufacturers. Parallel Kp/Ki/Kd form, standard Kp/Ti/Td form, derivative filtering, sample time, output limiting, anti-windup and Manual/Auto tracking should be verified against the documentation for the actual PLC, drive or process controller being commissioned.