Table of Contents
ToggleA control loop in a PLC is only as good as the block that runs it, the timing behind it and the values you feed it. Getting setup, scaling and sample time right gives smooth, stable control without endless trial and error.
Modern PLCs ship with ready made PID blocks that handle scaling, anti windup and tuning for you. This guide explains how those blocks work and how to configure them correctly on real plants.
What Is a PLC PID Instruction?
A PLC PID instruction is a ready made function block that reads a process value, compares it with a setpoint and calculates an output using proportional, integral and derivative action. It saves you from writing the PID algorithm by hand in ladder or structured text.
Every major vendor provides one. Siemens offers PID Compact, PID 3Step and PID Temp, Rockwell offers PID and PIDE, and smaller brands include similar blocks in their instruction sets.

SolisPLC explains that the Technology folder in TIA Portal groups these blocks under PID Control. Their worked example uses a pressure transmitter ranged 0 to 120 bar as the process value.
Siemens PID Block Types
Continuous controller with analog or PWM output.
Step controller for motorised valves with open and close outputs.
Heating and cooling controller with two outputs.
Pick the block by the type of final element. A positioner valve or VFD suits PID Compact, while a raise and lower actuator needs PID 3Step.
Why Timing Matters
The block must run at a fixed, known interval, not in the free running main cycle. The normal PLC scan cycle varies with logic load, which would distort integral and derivative action.
SolisPLC notes that TIA Portal places the block inside a cyclic interrupt OB, which defaults to 100 ms. Fast flow loops may need a shorter interval, while slow temperature loops can run every second or more.
| Loop Type | Typical Sample Time | Notes |
|---|---|---|
| Flow | 50 to 100 ms | Fast, noisy signal |
| Pressure | 100 to 200 ms | Depends on volume |
| Level | 0.5 to 1 s | Integrating process |
| Temperature | 1 to 5 s | Slow, large lag |
7 Practical PLC PID Instruction Setup Steps
Input scaling is the most common source of errors. Our guide to analog scaling from raw counts shows how 0 to 27648 maps to a real range.
Check wiring and signal health first, as covered in PLC analog input basics. A noisy input will make any tuning look poor.
Key Parameters Explained
The meaning of each term is explained in PID tuning parameters. Some vendors use gain, others use proportional band, so always check units.
P and I Term Formula
I change per sample = Kc × Error × Ts ÷ Ti
Proportional band = 100 ÷ Kc
Example:
Kc = 2, Error = 5 percent, Ts = 0.1 s, Ti = 10 s
P term = 2 × 5 = 10 percent
I change = 2 × 5 × 0.1 ÷ 10 = 0.1 percent per sample
Proportional band = 50 percent, 6 repeats per minute
Repeats per minute equals 60 divided by integral time in seconds. It is the unit many older controllers and some DCS faceplates use.
PID Term Calculator
A negative error drives the output down for a direct acting loop. Reverse acting loops flip the sign, so set the action correctly in the block.
Tuning the Loop
Built in pretuning and fine tuning work well for most loops. For manual methods, see our PID tuning guide and how to tune a PID controller.
Relay feedback and step tests are the basis of most auto tuners, as described in auto tune methods. Always tune with the process near its normal operating point.
- Ready made, tested algorithm.
- Built in anti windup and limits.
- Auto tuning and commissioning screens.
- Manual mode and bumpless transfer.
- Needs a fixed interrupt interval.
- Vendor units and names differ.
- Poor scaling breaks the loop.
- Auto tune can upset sensitive processes.
Common Applications
For two loops working together, read what is cascade control. How you call a PLC PID instruction also depends on the programming language you use.
Siemens PID Compact Manual PDF
PID Compact Step by Step Video
PLC PID Instruction FAQ
Related Articles
- PID Controller Tuning Guide
- PID Controller Types Explained
- PLC Analog Scaling
- What Is Cascade Control
- How PLC Scan Cycle Works
External References
- PID Control With PID Compact, Siemens
- An Introduction to PID Programming in TIA Portal, SolisPLC
- PID Controller, Wikipedia
What We Learn Today
- A PLC PID instruction runs inside a fixed time cyclic interrupt.
- Correct scaling and limits matter as much as tuning.
- Gain, integral time and proportional band convert with simple formulas.
