How PLC PID Loop Control Works
Change the gain, the integral time and the loop update time. Watch the PID instruction execute on each update, see the output move in steps and check how the process value follows the setpoint changes.
Quick answer: A PLC runs its PID instruction at a fixed loop update time, not continuously. On every update it reads the scaled process value, calculates the error and changes the analog output by a P step and an I step, so the output trend is a staircase.
What Is a PLC PID Loop Control?
Most PLCs offer a PID instruction or function block that turns a scaled analog input into an analog output. The block itself is standard, but how often it runs and how it is scaled decide how well the loop performs.
The PID block is executed in a timed task or a cyclic interrupt at the loop update time, often called the sample time. Between updates the output is held, so a long update time adds delay to the loop.
Many PLC PID blocks use the velocity form, which calculates a change in output on each update. That form gives bumpless transfer between manual and auto and stops integral windup at the output limits.
How PLC PID Loop Control Works: Interactive Animation
- 1Analog input card: 4 to 20 mA to PV in %
- 2Timed task clock: loop update time
- 3PID instruction with P and I terms
- 4Analog output card: CV to 4 to 20 mA
- 5Control valve
- 6Process and transmitter
- 7Trend: SP, PV and stepped CV
PLC PID Loop Control Working Principle Step by Step
- The analog input card converts the 4 to 20 mA signal to a raw count, and the program scales it to the process value in percent or engineering units.
- A timed task starts the PID instruction once every loop update time Δt, independent of the main scan.
- The block calculates the error e = SP − PV for direct or reverse action as configured.
- It adds a proportional step Kc × (e − previous e) and an integral step Kc × e × Δt ÷ Ti to the output, and clamps the result to the output limits.
- The new output is scaled to the analog output card, which drives the valve with 4 to 20 mA until the next update.
PLC PID Loop Control Labelled Diagram

PLC PID Loop Control Formula
Position form: CVₙ = Kc × [eₙ + (Δt ÷ Ti) × Σe] + bias
Integral ramp for a constant error = Kc × e ÷ Ti per second, whatever the update time
Rule of thumb: keep Δt at or below one tenth of the process time constant and well below Ti
Example: Kc 1.5, Ti 10 s, Δt 0.5 s, error steps from 0 to 10 %: P step = 1.5 × 10 = 15.0 %, I step = 1.5 × 10 × 0.5 ÷ 10 = 0.75 % per update, so the first update moves CV by 15.75 % and the I ramp is 2 × 0.75 = 1.5 % per second
Main Parts of a PLC PID Loop Control
| Part | What it does |
|---|---|
| Analog input and scaling | Raw counts scaled to PV in percent or engineering units, with a fault check for broken wire |
| Timed task | Runs the PID instruction at a fixed loop update time |
| PID instruction | Holds gain, integral and derivative settings, action, limits and the manual and auto mode |
| Analog output and scaling | Converts CV in percent to counts for the 4 to 20 mA output card |
| HMI faceplate | Lets the operator change SP, mode and manual output and view the trend |
Where a PLC PID Loop Control Is Used
Advantages
- Built into almost every PLC, with no separate controller to buy
- Velocity form gives bumpless manual to auto transfer and simple anti windup
- Loop logic, interlocks and alarms live in one program
Limitations
- A long or irregular update time adds delay and makes the loop less stable
- Scaling or action errors are easy to make and hard to see
- Parameter units differ between blocks, so tuning values do not copy directly
PLC PID Loop Control Field Tips and Common Problems
- Call the PID block from a timed task or cyclic interrupt, not the free running main scan, so Δt is constant.
- Check the units of Ti: some blocks use seconds, some minutes and some repeats per minute.
- Set the action correctly: reverse action for a valve that opens to raise the PV, direct action for one that opens to lower it.
- Initialise the output from the valve position on start up so the loop goes to auto without a bump.
Related Calculators and Tools
Frequently Asked Questions
What is the loop update time in a PLC PID block?
It is the interval at which the PID instruction is executed and the output is recalculated. The block uses it in the integral and derivative terms, so it must match the real task time.
Why does the PLC output move in steps?
The block runs only once per update and holds the output in between. A short update time gives small, frequent steps that look smooth on the trend.
Does a longer update time change the integral action?
The integral ramp per second stays the same because each I step grows with Δt. The extra delay between updates still reduces the stability margin.
What is the difference between velocity and position form?
The position form calculates the full output on each update from the sum of all errors. The velocity form calculates only the change, which makes bumpless transfer and anti windup simpler.
Learn more on the blog
PLC PID instruction configuration
A practical guide on instrumentationblog.in that goes deeper into this topic with field examples.
Read Full ArticleMore How It Works
All How It Works animations · Instrumentation glossary · Comparisons
