▼ Click the card below to follow me
▲ Click the card above to follow me
Hello everyone, I am Luejue. Today, let’s talk about how Siemens PLC plays a crucial role in the water treatment industry. Whether in a water supply plant or a sewage treatment plant, PLC is an indispensable “brain”. It acts like a diligent steward, constantly monitoring water quality and flow, directing various equipment to operate in an orderly manner. Now, let’s take a look at how PLC intelligently controls the entire water treatment process.
Water Intake Stage: Perfect Coordination of PLC and Flow Meter
At the water intake, the PLC first reads the data from the flow meter. Here, we usually use an analog input module to receive a 4-20mA current signal.
Hardware Connection:
-
The signal line of the flow meter connects to the PLC’s analog input terminal.
-
The PLC’s digital output terminal connects to the start-stop control circuit of the water pump.
Code Example (Ladder Diagram):
// Read flow data
LD "Flow_Sensor"
MOVE IW64, MD100 // Assume IW64 is the analog input address, MD100 stores the flow value
// Control water pump based on flow
LD MD100
> F 1000.0 // Assume flow greater than 1000m³/h starts the standby pump
= M 10.0 // M10.0 as the condition to start the standby pump
LD M10.0
TON T1, 10s // Delay 10 seconds to prevent frequent start-stop
= Q 0.0 // Q0.0 controls the start of the standby pump
Note: Analog signals are susceptible to interference; when wiring, keep away from high voltage. Use shielded cables if necessary.
Water Quality Monitoring: Data Collection from Multi-Parameter Online Analyzers
Modern water plants are equipped with online water quality analyzers that can monitor pH, turbidity, residual chlorine, and other parameters in real-time. PLC communicates with these instruments via bus systems such as Modbus RTU or Profibus DP.
Hardware Connection:
-
The PLC’s communication module (e.g., CP341) connects to the RS485 interface of the water quality analyzer.
-
Correctly set communication parameters (baud rate, parity, etc.).
Code Example:
// Use SFC14 to read Profibus DP slave data
CALL "DPRD_DAT"
LADDR := W#16#100 // Assume slave address is 256
RET_VAL:= MW10 // Store return value
RECORD := P#M20.0 BYTE 16 // Store received data
// Process received data
L MD20 // pH value
T MD100
L MD24 // Turbidity
T MD104
L MD28 // Residual chlorine
T MD108
Practical Application: A certain water supply plant has implemented automatic alarm and remote monitoring for abnormal water quality using this system, greatly enhancing water supply safety.
Flocculation and Sedimentation: PLC Control of Dosing System
In the flocculation and sedimentation tank, the PLC automatically controls the dosing amount based on the incoming water quality and flow. This requires the use of PID control algorithms.
Hardware Connection:
-
The PLC’s analog output module connects to the variable frequency drive of the dosing pump.
-
The turbidity meter connects to the PLC’s analog input module.
Code Example:
// Use PID_Compact instruction for PID adjustment
"PID_Compact_1"(
Setpoint := 1.0, // Target turbidity value
Input := "Turbidity_Value",// Actual turbidity value
Output => "Dosing_Pump_Speed" // Control dosing pump speed
);
// Dosing pump start-stop control
LD "Dosing_Pump_Speed"
> F 0.0
= Q 1.0 // Q1.0 controls the start of the dosing pump
Common Issues: PID parameter tuning is a technical task. If oscillations occur, try decreasing the proportional gain and increasing the integral time.
Filtration System: Automatic Control of Backwashing
Sand filter tanks require regular backwashing. The PLC can automatically start the backwashing process based on running time or pressure difference.
Hardware Connection:
-
The pressure difference sensor connects to the PLC’s analog input.
-
The electric actuators of various valves connect to the PLC’s digital output.
Code Example (Ladder Diagram):
// If pressure difference exceeds set value or running time exceeds 24 hours, start backwashing
LD "Pressure_Diff"
> F 0.5
OR(
LD "Run_Time"
> T T#24h
)
S M 20.0 // Set backwashing flag
// Backwashing program
LD M20.0
TON T10, 10s // Start backwashing after 10 seconds
AN T10
= Q 2.0 // Q2.0 controls the closing of the inlet valve
LD T10
= Q 2.1 // Q2.1 controls the opening of the backwashing valve
// Backwashing lasts for 5 minutes
LD M20.0
TON T11, 5m
R M20.0 // Reset backwashing flag
Note: During backwashing, monitor the turbidity of the backwash water to avoid insufficient or excessive backwashing.
Disinfection: Online Analysis of Residual Chlorine and Chlorination Control
Disinfection is the final barrier in water treatment. The PLC needs to accurately control the chlorination amount to ensure that the residual chlorine in the outgoing water meets standards.
Hardware Connection:
-
The residual chlorine analyzer connects to the PLC’s analog input.
-
The chlorinator’s control signal connects to the PLC’s analog output.
Code Example:
// Read residual chlorine value
LD "Chlorine_Sensor"
MOVE PIW100, MD200 // PIW100 is the input address of the residual chlorine sensor
// PID control of chlorination amount
"PID_Compact_2"(
Setpoint := 0.3, // Target residual chlorine value 0.3mg/L
Input := MD200, // Actual residual chlorine value
Output => MD204 // Control chlorination amount
);
// Output chlorination control signal
MOVE MD204, PQW200 // PQW200 is the analog output address, controls the chlorinator
Practical Experience: Chlorination control should consider the water retention time. A feedforward control can be set based on flow to improve system response speed.
Data Recording and Remote Monitoring
Modern water plants need to record operational data and achieve remote monitoring. Siemens PLC can communicate with SCADA systems via Ethernet modules to realize this function.
Hardware Connection:
-
The PLC’s Ethernet module connects to the factory network.
-
Configure the PLC’s IP address and communication parameters.
Code Example:
// Use TSEND_C instruction to send data to SCADA system
"TSEND_C_DB"(
REQ := M30.0,
CONT := TRUE,
LEN := 20,
CONNECT := "TCON_IP_v4_SEC",
DATA := P#M100.0 BYTE 20,
DONE => M30.1,
BUSY => M30.2,
ERROR => M30.3,
STATUS => MW32
);
Safety Reminder: While remote control is convenient, be cautious about network security. It is recommended to use VPN or dedicated lines and set firewall rules.
Practical Exercise Suggestions
-
Build a small water treatment model using S7-1200 PLC, including water intake, dosing, filtration, and disinfection stages.
-
Learn to use SIMATIC STEP 7 and TIA Portal programming software, familiarizing yourself with ladder diagrams and SCL language.
-
Try using the PLC’s Web Server function to achieve a simple remote monitoring page.
-
Simulate various fault situations, such as sensor failures or communication interruptions, and write corresponding fault handling programs.
This article introduces the main aspects of PLC applications in the water treatment industry, but there are many details that need attention in actual projects, such as motor soft start control, variable frequency speed regulation, valve position feedback, etc. I hope this article provides some ideas for those entering the field of water treatment automation. Continuous learning and experience accumulation are necessary in actual work. I wish everyone success on the path of automation!
Like and Share
Let Money and Love Flow to You