Learn to configure and optimize a PID controller on Siemens TIA Portal. This educational guide explains the concepts of Proportional, Integral, and Derivative with concrete examples for the industry.
Introduction to PID Regulation
Imagine you're trying to maintain a car's speed at exactly 90 km/h on a hilly road.
If you press the accelerator only when you drop below 90, your speed will constantly oscillate.
This is where the PID (Proportional, Integral, Derivative) comes in.
In the industrial world, PID is the brain that automatically stabilizes temperature, flow, or pressure with surgical precision.
The ultimate goal of a controller is to reduce the gap between what you want (the setpoint) and what you actually have (the measurement).
Whether it's heating a chocolate tank or filling a water reservoir, the PID constantly calculates the necessary correction to reach the target as quickly as possible, without exceeding the safety limits of your installation.

Understanding the Three Actions: P, I, and D
The Proportional (P) action is the immediate reaction; the larger the gap between the setpoint and the measurement, the stronger the controller reacts.
It's like turning on a faucet: if the bucket is empty, you open it fully; if it's almost full, you start closing it.
However, the P action alone is never enough because it always leaves a small residual error.
The Integral (I) action looks back.
It adds up the error that persists over time.
If the P action can't bridge the last millimeters of a water level, the I action will get impatient and gradually increase the power to totally eliminate the error.
It's the indispensable tool for final precision.
The Derivative (D) action looks to the future. It anticipates the speed at which the measurement changes.
If the temperature rises too fast, the D action will slow down the heating before even reaching the setpoint to avoid exceeding it.
It's a bit like slowing down gently before a tight turn to avoid going off the road.
Configuring the PID_Compact Block in TIA Portal
In the Siemens universe, the standard block for continuous regulation is the PID_Compact.
To use it, you need to insert it into a cyclic interruption block (usually OB30).
Why? Because a PID needs to calculate its corrections at regular, precise time intervals (e.g., every 100ms) to remain stable.
The main inputs to know are Setpoint (SP) for your setpoint and Input (or Input_PER) for your measurement coming from a sensor.
The Output (or Output_PER) output controls your actuator; it is crucial to properly configure the limits of your system in the block configuration to avoid the PLC commanding an impossible power for your machine.
// Example of calling PID_Compact in a cyclic OB
"PID_Temp_DB"(
Setpoint := "Data".Consigne_Temperature,
Input_PER := "Capteur_PT100",
Output_PER => "Sortie_Resistance",
RunModeByStartup := TRUE
);Practical Case 1: Temperature Regulation
Let's take a tank that we want to keep at 60°C.
We use a PT100 probe connected to an analog input of the PLC, the actuator is a heating resistance; in TIA Portal, we configure the regulation type to Temperature and the unit to °C.
This allows the software to adapt its internal algorithms to the thermal inertia, which is often slow.
During commissioning, we start by testing the system in manual mode.
We send 20% power and observe if the temperature rises; once we're sure of the wiring, we launch the auto-tuning.
The PID will then make small power jumps to learn how the tank reacts and calculate the best P, I, and D coefficients on its own.
Practical Case 2: Level Regulation
Here, the goal is to maintain a constant water level despite random withdrawals.
We use an ultrasonic sensor (0-10V) and a variable-speed pump; unlike temperature, the level often reacts very quickly, so the settings need to be more responsive to quickly compensate for level drops.
It is vital to properly configure the scaling; if your sensor returns a value between 0 and 27648 (Siemens standard), the PID block must know that this corresponds to 0-200 cm.
A scaling error here would make the regulation totally erratic or unstable because the PID wouldn't understand the real impact of its actions on the physical level.
Simple Tuning Method for Beginners
If you need to manually tune the PID, follow this sequence:
Start with the gain (P), increase it until the system starts to oscillate, then divide this value by two.
You have a stable base but with an error; then, introduce the Integral (I) action gradually to bring the measurement exactly to the setpoint.
The Derivative (D) action is often left at zero for beginners, as it is very sensitive to electrical noise on sensor cables.
A D that's too strong will make your actuator tremble without apparent reason; remember: a system that's too slow needs more P or less I, a system that oscillates too much needs less P or more I.
Frequent Errors and Solutions
The most classic error is calling the PID block in the main cycle (OB1), as the cycle time of OB1 changes all the time, the PID calculations become false.
Always use a cyclic interruption block (OB).
Another error is forgetting to configure the output limits (LMN_LIMIT).
If your valve only opens between 20% and 80%, you must tell the PID so it doesn't exhaust itself trying to open it to 100%.
Finally, be careful with integral saturation (anti-windup).
If your system is mechanically blocked, the I action will continue to increase until the maximum.
When the blockage disappears, the system becomes uncontrolled; fortunately, the TIA Portal's PID_Compact block manages this automatically if you stay within its default parameters.
Conclusion
PID regulation in TIA Portal is not an obscure science reserved for mathematicians; it's a logical tool that simply requires method and observation.
Using the PID_Compact block and the integrated auto-tuning tools, you can stabilize most common industrial processes in a few clicks.
Never forget to test your settings in real conditions and consult the Siemens Technical Documentation for the most complex cases.
To plan your hardware, the TIA Selection Tool remains your best ally.
Good regulation!
