Leakage Monitoring and Protection, Solve Safety Issues with PLC!
Leakage monitoring and protection are key aspects of distribution systems, and they can be easily implemented using Siemens PLC. Today, let’s discuss how to use the S7-1200 to create a leakage monitoring and protection system to address potential safety hazards on-site.
Real-Time Leakage Monitoring + Quick Protection
Real-Time Leakage Monitoring + Quick Protection
Assuming there are multiple devices running in a production workshop, we need to achieve the following functions:
-
Real-time monitoring of leakage for each device, triggering an alarm and cutting off power when leakage exceeds the set value. -
Leakage data can be displayed on a touchscreen for easy observation and fault location. -
The system should have a manual reset function, allowing the operator to restore power after the leakage fault is resolved.
Hardware Requirements
Hardware Requirements
-
Siemens S7-1200 PLC -
Leakage sensor (with analog output, e.g., 4-20mA) -
Digital output module (to control circuit breakers) -
Alarm buzzer -
Touchscreen (e.g., KTP series, to display leakage data and alarm information)
Potential Issues
Potential Issues
-
Sensor Signal Fluctuation: The leakage sensor’s signal may have noise, leading to false alarms. -
Excessive Alarms Disrupting Operations: When multiple devices leak, the alarm buzzer will sound continuously, affecting the operator’s judgment. -
Incomplete Reset Logic: Sometimes, the fault may not be fully resolved, yet the system can be reset, potentially causing hazards.
Don’t worry, we will address these issues one by one.
Program Logic Design
Program Logic Design
To clarify logic, we will break down the functions into several parts:
-
Analog Signal Processing -
Alarm and Protection Logic -
Data Monitoring and Reset Function
Analog Signal Processing
Analog Signal Processing
The output of the leakage sensor is a 4-20mA signal, corresponding to the leakage current value. The PLC needs to convert this signal into the actual current value and determine if it exceeds the set leakage protection value (e.g., 30mA). The code is as follows:
// Analog input processing
// AIW64 is the analog input address, calculating the actual current value
LeakageCurrent := (REAL_TO_INT(AIW64) * 10.0 / 27648.0);
// Determine if leakage occurs
IF LeakageCurrent > 30.0 THEN
Alarm := TRUE; // Exceeds 30mA, trigger alarm
ELSE
Alarm := FALSE;
END_IF;
This uses the calculation formula for analog inputs, where 27648 is the maximum value for the S7-1200’s analog input, corresponding to the range of 4-20mA.
Alarm and Protection Logic
Alarm and Protection Logic
If leakage exceeds 30mA, an alarm is triggered, and the corresponding device’s power is cut off. To avoid false alarms due to signal fluctuations, a delay judgment logic can be added:
// Leakage alarm delay
Network 1
A Alarm // Leakage alarm signal
L T1 // Timer
= M0.0 // Stable leakage alarm signal
TON T1, T#2s // Delay for 2 seconds to avoid false alarms
// Cut off power
Network 2
A M0.0 // Stable leakage alarm signal
= Q0.0 // Circuit breaker control output
// Alarm buzzer
Network 3
A M0.0
= Q0.1 // Alarm buzzer
A 2-second delay before alarming can filter out short-term signal fluctuations.
Data Monitoring and Reset Function
Data Monitoring and Reset Function
The real-time value of leakage current needs to be displayed on the touchscreen, and a reset button should be added for the operator to manually restore power.
// Real-time data transmission
HMI_CurrentValue := LeakageCurrent; // Transmit leakage current value to touchscreen
// Manual reset logic
IF ResetButton = TRUE THEN
Q0.0 := FALSE; // Restore power
Q0.1 := FALSE; // Turn off alarm buzzer
END_IF;
When configuring the touchscreen, bind the HMI_CurrentValue
variable to the display interface to see the real-time leakage current value.
Optimization Solutions
Optimization Solutions
-
Signal Fluctuation Issue: If a 2-second delay is still not enough, consider using an averaging filter algorithm to smooth the signal. -
Alarm Interference Issue: Set up independent alarm buzzers for each device or implement an alarm priority feature on the touchscreen to highlight critical faults. -
Reset Logic Issue: Increase real-time monitoring of leakage current, and check if the current is below the safe value during reset to avoid hazards.
Inspection and Testing
Inspection and Testing
After writing the program, testing is a critical step:
-
Simulate leakage signals to check if alarms are triggered and if circuit breakers disconnect. -
Ensure that the manual reset button works correctly and that the touchscreen displays accurately. -
Simultaneously test multiple devices for leakage to ensure alarm logic remains clear.
Conclusion
Conclusion
The leakage monitoring and protection system not only enhances safety but also allows for flexible functional expansion through PLC. Pay attention to signal processing and clear logic when writing programs to ensure higher system stability.
If you have any questions, feel free to leave a message, and let’s discuss!