PLC control program for an industrial hydraulic system with three pressure sensors, a proportional valve, PID-based pressure regulation, and fault diagnostics.
This project demonstrates a complete control solution typical of food and meat-processing machinery (fish-processing lines, separators, press systems). It was developed as a standalone demo based on real commissioning experience.
| Component | Details |
|---|---|
| Pressure sensors | 3× 4–20 mA transmitters (0–250 bar) |
| Proportional valve | 0–100% analogue output |
| Control strategy | PID closed-loop on working pressure |
| Fault handling | Overpressure, wire-break, E-stop |
src/
GVL.st — Global variable list
FB_PressureScale.st — 4-20mA scaling with wire-break detection
FB_HydraulicControl.st — Main hydraulic control FB (PID + faults)
MAIN.st — Main program (entry point)
- Platform: CODESYS 3.5
- Language: Structured Text (ST) — IEC 61131-3
- PID: CODESYS standard
FB_PIDlibrary - Signal: 4–20 mA scaled via 0–32767 ADC range
FB_PressureScalereads raw ADC values from each sensor, scales them to bar, and flags wire-break faults if the signal drops below 3.8 mA.FB_HydraulicControlruns PID control on the working pressure (P2), driving the proportional valve output.- Overpressure on P2 or any sensor fault triggers an immediate valve close and sets a fault code.
MAINwires sensors → control FB → global outputs each scan cycle.
Nikita Poliakov — Automation & Instrumentation Engineer
2+ years delivering end-to-end control systems for food and meat-processing equipment.
LinkedIn | work.nikita@bk.ru