Mastering PID Control Systems in PLCs: From Core Concepts to Real-World Industrial Applications

Maintaining process variable stability such as temperature, pressure, flow rate, and motor speed is a central challenge in industrial automation. Conventional ON/OFF control often falls short in complex systems, leading to poor stability, high overshoot, and mechanical wear from constant switching. The industry-standard solution to this problem is the Proportional-Integral-Derivative (PID) algorithm integrated into a Programmable Logic Controller (PLC).
Why Simple Control Isn’t Enough for Complex Processes
Discrete ON/OFF control operates like a home thermostat: shutting off when exceeding an upper threshold and turning on when dropping below a lower threshold. At an industrial scale such as plastic extrusion or chemical drying this approach triggers extreme process fluctuations.
When a heating element shuts off upon reaching its target temperature, residual heat continues to transfer due to thermal inertia, causing the actual temperature to overshoot. Conversely, when the temperature drops below the limit, heating lag causes the system to undershoot.
This is where PID control in PLCs steps in. Rather than toggling loads on or off, PID continuously modulates a variable output (e.g., 0–100%) based on the calculated error between a setpoint ($SP$) and a process variable ($PV$).
Anatomy of a PID Algorithm in PLC Programming
A PID system calculates an error value $e(t)$, which represents the difference between the setpoint ($SP$) and the process variable ($PV$). The control signal $u(t)$ sent by the PLC to the actuator is the sum of three distinct components:
1. Proportional (P) – Response to Current Error
Proportional action produces an output proportional to the magnitude of the current error. A larger error yields a larger corrective output.
- Limitation: Proportional control alone cannot drive the process variable to match the setpoint perfectly. It inherently leaves a persistent offset, known as steady-state error.
2. Integral (I) – Eliminating Accumulated Past Error
The integral component accumulates error over time. If an offset persists, the integral term continuously increases correction until the error reaches zero.
- Limitation: Overly aggressive integral tuning causes integral windup, leading to prolonged system oscillation before settling.
3. Derivative (D) – Predicting Future Rate of Change
The derivative component considers how fast the error is changing. When rapid changes occur, derivative action provides early damping to prevent excessive overshoot.
- Limitation: It is highly sensitive to high-frequency noise in analog input signals. Without proper filtering, derivative action can cause erratic controller output spikes.
Case Study: Pasteurization Temperature Control in Milk Processing
To understand how PLC-based PID control operates in practice, consider a case study on a milk pasteurization line at a liquid processing facility.
Process Challenge
Pasteurization requires milk to pass through a heat exchanger and hold a constant temperature of 72°C for exactly 15 seconds. If the temperature drops below 71.5°C, pathogenic bacteria survive and the batch must be scrapped. If the temperature exceeds 74°C, the nutritional content and flavor profile degrade. The incoming raw milk flow rate varies between 50 and 100 liters per minute, with inlet temperatures ranging from 4°C to 10°C.
System Architecture
- Sensor: A Pt100 RTD temperature sensor installed at the heat exchanger outlet, wired to a PLC Analog Input module (4–20 mA signal).
- Controller: A PLC processing the PID algorithm at a fixed sampling interval ($T_s = 100\text{ ms}$).
- Actuator: A PLC Analog Output signal (4–20 mA) driving a modulating steam control valve.
+-------------------------------------------------------------+
| |
| [Setpoint: 72°C] |
| | |
| v |
| +-----------+ Control Signal +------------------+ |
| | PLC PID |------------------->| Control Valve | |
| | Module | (4-20 mA) | (Steam Flow) | |
| +-----------+ +------------------+ |
| ^ | |
| | v |
| Feedback Signal +------------------+ |
| (4-20 mA) | Heat Exchanger | |
| | | (Heating Process)| |
| | +------------------+ |
| | | |
| +-----------+ | |
| | Pt100 RTD |<----------------------------+ |
| | Sensor | Measured Milk Temp |
| +-----------+ |
+-------------------------------------------------------------+
PID Implementation Results
- Without PID (ON/OFF Valve Control): Temperature oscillated between 67°C and 78°C. This 11°C fluctuation caused batch failure rates of up to 18% of total production.
- With PLC PID Loop: After parameter tuning ($K_p = 3.2$, $T_i = 45\text{ s}$, $T_d = 8.5\text{ s}$), the PLC handled flow rate surges smoothly. The steam valve modulated proportionally, holding temperature at 72°C ± 0.3°C even during sudden flow disturbances.
Steps for Oscillation-Free PLC PID Tuning
Deploying PID control in a PLC requires precise tuning of gain parameters ($P$, $I$, and $D$). Field engineers typically follow these steps:
- Open-Loop Response Test: Apply a manual step change to the PLC output (e.g., opening the valve by 10%) and record the process variable response curve to measure system dead time and lag time.
- Initial Parameter Calculation: Use established methods such as Ziegler-Nichols or Cohen-Coon based on open-loop response characteristics to derive baseline estimates.
- Manual Fine-Tuning:
- Increase $P$ (Gain) until the system responds rapidly without excessive oscillation.
- Decrease $I$ (Reset Time) incrementally to eliminate steady-state error.
- Add a small amount of $D$ (Derivative) to damp spikes during sudden setpoint changes.
- Anti-Windup Protection: Enable Integral Anti-Windup in the PLC’s PID function block. This prevents integral error accumulation when controller output saturates at maximum (100%).
Precision Control Integration with Folks Automation
Selecting and configuring a PLC for PID control systems does not have to be complicated. Folks Automation stands as Indonesia’s first domestic PLC manufacturer, backed by extensive experience in producing PLC hardware and automation ecosystems for industrial applications.
As a domestic manufacturer, Folks Automation deeply understands local industrial requirements ranging from field electrical conditions and legacy machine integration to operational cost efficiency. Folks Automation PLCs feature high compatibility with precision analog input/output modules required for reliable closed-loop PID control execution. Key advantages of the Folks Automation local ecosystem include:
- Direct Technical Support: Local engineering teams are readily available for integration, troubleshooting, and loop tuning assistance.
- Spare Part & Module Availability: Streamlined procurement timelines without reliance on lengthy import processes.
- System Scalability: Seamless integration scaling from standalone machine control to plant-wide SCADA systems.
Consult Your Industrial Automation Needs
Is your production line experiencing process fluctuations, energy waste, or downtime due to sluggish controller response? Our engineering team at Folks Automation is ready to help evaluate, design, and optimize your PLC systems and PID control loops.
Reach out directly to the Folks Automation engineering team via WhatsApp for technical discussions and automation consulting at: +62 821-1404-4968

