introduction
With the continuous development of the economy and society, more than half of the rivers in my country have been seriously polluted, and urbanization has accelerated this process. At present, the pollution of urban waters has exceeded 90%, and the trend of water pollution is still accelerating. Originally, it was only surface water pollution, but now the pollution is also accelerating its infiltration into the ground[1]. Traditional sewage treatment plants are mainly controlled by relays, but relay control systems have disadvantages such as large size, high energy consumption, high cost, and poor portability. Once the system design is changed, the controller must be redesigned, which greatly increases the consumption of manpower and material resources. Programmable controllers (PLCs) can well realize the safety, stability, economy and flexibility of the system[2-3], and are therefore widely used in automation control systems.
1. Overall System Design Objectives
1.1 Main Components
The entire automated control system includes a programmable logic controller (PLC), a computer, a monitoring terminal, and various field instruments. The PLC is the core of the entire control system; it, along with the control program set by the computer, determines the relevant procedures and process standards for system operation. It can also automatically or manually control the operation of related equipment according to actual needs. During operation, the relevant field equipment feeds data back to the PLC and related computer equipment in real time for display and control.
1.2 Working Principle
Based on the needs of urban wastewater treatment, the entire control system is divided into two parts: a field control system and a monitoring room control system. Both can control the field equipment, including activating the bar screen to intercept garbage in the wastewater; monitoring the wastewater level in the equalization tank, where the system issues one or two control signals based on the water level to control the operation of one or two pumps, thereby lowering the water level in the equalization tank and ensuring that the water level remains within the safe range. Sludge lift pumps in the sludge tank and emergency lift pumps also achieve automatic control by collecting relevant float information and responding to float signals, or by controlling the operation of the equipment according to user-provided instructions. Other equipment, such as adsorption fans, blowers, and mixed liquor return pumps, can have their start/end times and operating durations controlled according to user commands.
In addition, the system needs to collect sensor information such as residual chlorine, water level, and flow rate on site, and display the information collected by the sensors in real time on each operating interface. At the same time, it displays the operating parameter information of each piece of equipment on the sewage treatment site. When the equipment malfunctions and alarms, it can realize remote alarm and record alarm information on each program, including equipment information, fault or alarm time, etc., thereby ensuring the normal operation of the equipment.
2 Hardware Equipment
The core component of this system is a Siemens S7-200 SMART PLC, which features an Ethernet port, allowing users to directly connect a computer to the PLC via a network cable for easy program downloading and debugging. It also enables rapid communication with other HMIs and computers via the network cable and integrates some library files for direct use during programming. A touchscreen is embedded in the control cabinet to display relevant parameters and control the equipment. Users can operate the system simply by clicking on text or icons on the screen, providing a very convenient human-machine interface. It supports Ethernet communication as well as RS232/422/485 communication, enabling communication between HMIs and between HMIs and the PLC. Users can choose the communication method according to their needs. Furthermore, because it needs to drive large motor equipment, a frequency converter is required. The frequency converter can be configured according to the actual working equipment and environment, reducing motor power consumption and adjusting motor speed. It also allows for soft start and soft stop of the motor, ensuring smooth changes in frequency, current, and voltage during startup and shutdown, preventing the motor from being directly subjected to high current surges. This significantly reduces the maintenance costs of the motor and other equipment. The main materials list is shown in Table 1, and the overall system architecture is shown in Figure 1.
3 Programming
The software system is the core of the entire PLC system design. It works in conjunction with the touchscreen software and computer configuration system to jointly monitor the operation of various devices. Based on actual needs, the system requires control of equipment including mechanical bar screens, sewage lift pumps, submersible mixers, blowers, mixed liquor return pumps, sludge lift pumps, screw press dewatering machines, chlorine dioxide generators, sewage disinfection systems, emergency lift pumps, frequency converters, etc., and must also achieve online residual chlorine detection, water level detection, and flow rate detection.
3.1 Operating modes of each device
Mechanical screens are installed in the screen well to filter out impurities in the sewage and prevent debris from clogging the water pump. Users can set the automatic start and stop times of the mechanical screens via touch screen or computer configuration terminal.
The equalization tank is equipped with two sewage lift pumps, whose operation is controlled by the switching of two internal floats. To protect the equipment, the two sewage lift pumps alternate operation each time the lower float is energized. If the higher float rises and is energized, it means the water level in the equalization tank is high, and both sewage lift pumps need to be started simultaneously to discharge sewage as quickly as possible. If the two sewage lift pumps operate simultaneously for more than a set time and the higher float remains energized, it indicates that the inflow is too large or the equipment has malfunctioned. In this case, the system will issue an alarm to remind the user to troubleshoot the problem on-site. If no problem is found, the alarm will be canceled.
There are two submersible mixers in the anaerobic tank. They work in conjunction with the sludge lift pump in the sludge tank. When the sludge lift pump is running, the corresponding submersible mixer also works until it automatically shuts down after the system's set time.
The contact oxidation tank includes blowers and a mixed liquor return pump. Two blowers are installed in the tank. This equipment needs to operate continuously. During operation, one blower works for a certain period and then switches to the other to continue working, ensuring one is on standby and preventing equipment failure due to continuous operation. The mixed liquor return pump operates automatically based on the operation of the wastewater lift pump. When the wastewater lift pump is running, the mixed liquor return pump automatically starts and automatically shuts off after a set time.
In the sedimentation tank, due to the excessive power of the sludge lift pump, a PLC is used to control the start and stop of the frequency converter, and the frequency converter is connected to the external sludge lift pump. Users can set the running time in the touch screen or computer configuration program, or they can directly control the operation of the frequency converter by setting its working status, so as to pump the sludge from the sedimentation tank to the sludge tank.
The sludge tank is equipped with two lift pumps for sludge discharge. Each time the float in the sludge tank is energized, the two lift pumps switch operation. If the float of one sludge lift pump is still energized after running for 10 minutes, the other sludge lift pump is turned on simultaneously. If both sludge lift pumps remain energized after operating simultaneously for a certain period, it indicates that the sludge input is too large or that the equipment has malfunctioned. The system will issue an alarm, reminding the user to troubleshoot on-site. If no problem is found, the alarm will be canceled. When the float of the sludge lift pump is energized, the screw press dewatering machine also operates synchronously.
The contact disinfection tank mainly contains an odor extraction fan, a chlorine dioxide generator, an activated carbon adsorption tower, and related dosing pumps. When the sludge lift pump is operating, the wastewater disinfection system is activated; when it is deactivated, the system shuts down after a delay. The chlorine dioxide generator starts after the wastewater lift pump has been operating for a certain period and shuts down simultaneously when the pump is deactivated.
The emergency pool lift pump is turned on when the float in the pool is energized and the low float in the regulating pool is not energized. When the high float is energized or the emergency pool float is de-energized, the emergency pool lift pump is turned off.
The adsorption fan, through a system-set operating time, adsorbs internal odorous gases into the pipeline, which are then discharged after passing through the activated carbon adsorption tower. The system also monitors residual chlorine concentration, water level, and water flow rate.
3.2 PLC software programming
The PLC module consists of a PLC with an SR20 CPU, a 16-channel digital output module EM QT16, and a 4-channel analog input module EM AE04. After creating the project, the PLC information needs to be configured. Select the system block in the leftmost toolbar to begin configuring system information, including CPU selection, digital outputs, analog input/output modules, etc. Finally, pair the Ethernet ports. The system is shown in Figure 2.
Because this system is quite large, a single-program design would be too difficult. Therefore, a modular programming approach is adopted, dividing the entire system into different modules based on their functions, with each module being a subroutine. Each subroutine can be controlled by the main program, which facilitates the control, modification, and maintenance of the entire program.
The main program directly controls each functional module. The emergency stop button is connected through I0.0. All devices work normally. When the emergency stop button is pressed, the system loses power and all program blocks stop working, thereby achieving the purpose of emergency stop of the equipment.
The program blocks that need to be designed include "clock subroutine", "timed start subroutine", "numerical conversion subroutine", "automatic subroutine" and "frequency converter subroutine".
The "clock subroutine" is used to read the system time. In the entire system, some wastewater treatment equipment needs to start or stop at a fixed time. In this case, the PLC's clock needs to be set so that it can communicate with the computer to read the time from the computer.
The "Timed Start Subroutine" is used for the timed start and stop of equipment. When the set time arrives, the system automatically turns on the equipment and shuts it down automatically according to the system's set time after running for a period of time. Equipment such as mechanical bar screens, sludge lifting pumps in sedimentation tanks, adsorption fans, and blowers are all set through the Timed Start Subroutine.
The "numerical conversion subroutine" is used to perform numerical conversion. Because the time input from configuration devices such as touch screens and KingSCADA computers can only be displayed down to the minute, and the timer in the PLC cannot directly calculate the minute, it is necessary to perform numerical conversion to amplify the time value input from the configuration device into data that the PLC can recognize.
"Automatic subroutines" are automatically controlled based on various external signals in the system. This includes equipment such as sewage pumps, submersible mixers, sludge lifting pumps, and screw press dewatering machines, which are all automatically controlled based on the operation of floats and other equipment.
The "inverter subroutine" is used for communication between the PLC and the inverter, which uses the Modbus RTU communication protocol. During initial setup, three bit addresses need to be defined as the inverter's start, stop, and frequency setting options before writing the program.
3.3 Touchscreen Configuration Design
The touchscreen is an integrated display and control touchscreen with built-in configuration development software, allowing users to design directly. After design, the project can be downloaded directly to the touchscreen via network or USB interface. Based on actual operational requirements, the touchscreen needs to be configured with page settings, including entry page, main page, parameter page, alarm page, and high/high voltage power supply efficiency.
Variable frequency control page. After designing all pages and saving, offline simulation can be performed to test the functionality of some devices and screen buttons.
3.4 KingSCADA Software Design
The computer-side configuration software design, also known as the host computer program design, allows users to monitor the system's operation from the control room without being physically present at the wastewater treatment site. It is particularly important to note that after creating a new project, the address needs to be set, and this address must match the address in the PLC. After completing the port and data dictionary settings, page settings can be performed. The settings pages are consistent with those on the touchscreen, including the entry page, main page, parameter page, alarm page, and frequency converter control page.
4. Debugging and Summary
After the hardware and software systems are built, each subsystem needs to be tested first. The entire system needs to be integrated and debugged to verify its efficient, stable, and safe operation. The timed start and stop functions of each device, set via touchscreen and KingSCADA software, were tested separately. All devices started and stopped normally. Wastewater pumps, sludge lift pumps, and other equipment also operated normally according to the float status. The frequency converter was running smoothly.
Normally, the equipment can also implement alarm functions according to the actual situation. The software and hardware of each module meet the expected design requirements and achieve the control effect.
The design and operation of automated systems have brought great convenience to the operation of wastewater treatment plants. Users do not need to be in the equipment room 24 hours a day. They can monitor the operation of the wastewater treatment plant from the monitoring room and other places, which not only improves monitoring efficiency, but also greatly reduces production costs.