With the rapid development of society and economy, the process of urbanization has gradually entered a stage of rapid development. The scale of the city has expanded, the population has increased, the scale of construction and the level of construction have continued to increase, and the people’s living standards have been greatly improved. The demand for water supply is getting higher and higher. People are beginning to pay attention to the problems of water supply pressure and water supply quality. These changes have brought unprecedented challenges to the urban water supply system  . In the past, the traditional water supply system had many shortcomings and was far from meeting the requirements of modernization. The secondary pressurized water supply system became the main water supply method to meet the basic requirements of residents. However, in the actual application of the secondary pressurized water supply program, many problems such as high investment cost, low automation, difficult system maintenance, high energy consumption, etc. have also appeared. These problems are particularly obvious during the peak and low periods of residential water consumption. In the peak period, the residential water consumption is large, resulting in insufficient water supply in the system and low water pressure; in the low period, the residential water consumption is small, resulting in high water pressure, which may cause damage to the water supply pipeline in the long run  .
2. Design of Hardware Platform for Water Supply System
In order to better solve many problems of the traditional water supply system, this paper uses S7-1200 PLC controller and frequency converter as the core control mechanism, and uses pressure sensors to detect the pressure of the water supply pipe network in real time. According to the deviation of the actual water pressure and the set water pressure, the frequency converter is The output frequency is adjusted by Increment PID Control, and then the rotation speed of the three water pump motors and the increase or decrease of the pump is controlled to realize the closed-loop adjustment of the water pressure of the pipe network to achieve the purpose of constant pressure water supply and energy saving  . The constant pressure water supply system is mainly composed of a detection mechanism composed of pressure, flow, and liquid level sensors, a control mechanism with PLC as the core, an actuator based on a frequency converter and a contactor, that is, a monitoring mechanism based on the upper computer. The main block diagram of the system is shown in Figure 1.
Figure 1. Main block diagram of constant pressure water supply system.
1) Detection mechanism
The signal detection part can sense external information and send it to the controller. The signals that the system needs to detect mainly include: the real-time pressure on the water side, the liquid level value of the reservoir, the actual output frequency of the inverter, and the fault signal that is the thermal relay protection circuit breaker signal. The pressure sensor installed in the pipeline monitors the water pressure in real time and feeds it back to the controller. The pressure value is an important criterion for the controller to perform PID calculation. Its accuracy and real-time have an important influence on the stability of the control effect  . When the pressure sensor When there is a disconnection, the controller should switch the manual safety output value from the automatic control mode according to the protection program or directly perform the protection shutdown process. In order to prevent this phenomenon, an extra pressure detection can be set on the horizontal section of the water supply pipeline. Point, the average value of the extra sensor is used as the feedback value. When a pressure sensor fails, the control system alarms and discards the invalid data here. The main function of the reservoir is to buffer the water flow from the public pipe network. When the upstream pipe network has a problem causing insufficient water inflow, the liquid level sensor detects that the actual liquid level is below the lower limit and the controller will protect the water pump. Stop the machine to prevent the pump from being damaged due to idling of the pump. The system fault signal is mainly used to monitor whether the motor is overloaded or not, and whether the inverter is working normally  .
2) Control mechanism
The PLC controller and its expansion modules are the core of the entire water supply system. The current state of the control system is obtained through the physical connection between the I/O port and the detection device, and the logic operation and PID operation are performed according to the control program written by the engineer, and then the frequency conversion is adjusted. Actuators such as speed controllers and contactors issue control instructions, and then the inverter adjusts and controls the operation of the pump motor, and the contactor switches the operation state of the pump to maintain stable water pressure and ensure the stable operation of the system.
3) Executive agency
The actuator is composed of three pump motors, which is the ultimate executor of the entire water supply system, with frequency conversion and fair operation modes. The difference between the actual water pressure value of the water pipe network and the set water pressure value determines the operating state of the water pump. When all three pumps are running at power frequency, they can meet the maximum water demand during peak periods.
4) Monitoring agency
The monitoring software operation interface is designed according to the system requirements. The upper computer mainly includes the monitoring main interface, alarm interface, trend record and parameter settings and other interface contents. The system status can be monitored and displayed in real time by using buttons, pictures and animation connection components.
2.1. Working Principle
The constant pressure water system designed in this paper has three working modes according to the position of the three-way rotary switch: stop state, on-site manual, program manual, and program automatic modes.
1) Stagnation state
When the system is powered on for the first time or the system is overhauled, the knob switch should be turned to the stop position. At this time, the traditional relay control circuit and PLC control circuit are cut off and cannot output normally.
2) On-site manual mode
cuts off the PLC controlled output through the intermediate relay, and controls the start and stop of the motor through the traditional start-and-stop circuit composed of buttons and contactors. In this mode, neither the PLC nor the inverter can output effectively, and the motor can only pass the main terminal of the contactor is directly connected to the power frequency current.
3) Program manual mode
In manual control mode, by switching the hand/auto virtual button on the host computer interface to the “manual” 4 state, the corresponding manual/automatic running flag in the PLC is reset to the “False” state, and the PLC is the control logic cuts off the power flow input to the automatic program block. At this time, each water pump can be individually controlled in the host computer, so that the three water pumps can be switched according to the actual situation in the two states of power frequency and variable frequency, and the frequency output value of the inverter can be freely set within the allowable range.
4) Program automatic mode
In automatic control mode, after the system is turned on and powered on, select to turn on the automatic mode  . Under normal circumstances, the PLC executes the automatic control program. If the pressure sensor detects that the current pressure value is lower than the setting, the PLC controls the 1# water pump motor to start variable frequency operation and adjust the output frequency of the inverter in real time through the PID control algorithm. If the frequency of 1# water pump motor reaches 50 Hz and the actual pressure value is still lower than the setting, the 1# water pump motor will run at power frequency and the 2# pump motor will run at variable frequency. As the user’s water consumption increases, if the actual pressure value is still lower than the setting, it means that the two pumps can no longer meet the normal water supply demand, and the number of pumps needs to be increased, 1# water pump motor power frequency, 2# water pump motor power frequency, 3# water pump motor frequency conversion; if the water supply demand cannot be met at this time, the three water pump motors enter the power frequency operation state at the same time. When the user’s water consumption drops and the actual pressure value is higher than the set value, the pump will be reduced or the power frequency will be switched in sequence.
2.2. Water Supply System Controller Design
The variable frequency constant pressure water supply control system uses a pressure sensor to detect the water pressure Pr in real time, compare the real-time water pressure Pr with the set water pressure value to obtain the error ΔP, and adjust the output frequency of the inverter in real time by the PID control algorithm , So as to control the operating frequency of the water pump motor to adjust the water supply pressure to stabilize near the set pressure value to ensure that the water pressure controlled by the entire water supply system is constant and meet the control requirements. The control principle diagram is shown in Figure 2.
At present, PID control algorithms are mostly used in single-variable closed-loop control scenarios. The core of its control is the proper combination of error proportional amplification, integral action, and derivative action parameters  . The expression of PID control algorithm can be expressed as:
In the formula, KP is the proportional amplification factor; TI is the integral time constant; TD is the derivative time constant. PID is a second-order linear
Figure 2. Control schematic diagram.
controller. The standard positional PID algorithm is often used in the industry; the output of the positional PID controller directly corresponds to the adjustment range of the actuator. When using a computer to realize the error, the amount of calculation Large, and need to consider integration saturation and other issues when programming. Therefore, in the computer sampling control, the digital PID incremental control algorithm  is often used, and the expression is sorted out:
2.3. Mathematical Model of Constant Pressure Water Supply System
After studying the constant pressure water supply system and working process, it is found that:
1) At the beginning of the system operation, the water pump starts to supply water to the pipe network, and the pipe network pressure keeps the initial pressure unchanged for a period of time  . This is a pure lag process ;
2) The working process of the pump motor can be approximately regarded as
the first-order inertial link ;
3) The detection link such as pressure sensor can be equivalent to the proportional gain link K. Therefore, under certain conditions, the approximate mathematical model of the constant pressure water supply system is
G(s) is the transfer function of the constant pressure water supply system; k is the system gain; T is the inertial time constant of the system; τ is the pure lag time of the system. Literature  obtains a large number of inverter output frequencies and the corresponding speed of the pump unit through experiments, and uses the least square method to identify the water supply system model parameters k, T, τ.
3. Control System Hardware Design
The control system with PLC controller as the core can be simply divided into three levels: equipment layer, control layer and human-computer interaction layer  . Among them, the equipment layer mainly includes the actual control objects and various sensors. In the constant pressure water supply system, it mainly includes actuators and sensors such as variable frequency pumps, electric valves, flow meters, and pressure gauges, which complete the production process described by the system process and are important Data collection; the control layer mainly includes control devices, various expansion modules, boards and signal relays and other equipment, through field bus or standard current, voltage signals and equipment layer sensors and actuators for data interaction, and execute control programs Complete data acquisition and conversion, switch logic control, PID calculation output, fault diagnosis, etc.; the monitoring system of the human-computer interaction layer for control parameter configuration provides interactive entry to complete system data monitoring, data recording analysis reports, etc.
3.1. PLC Controller and Expansion Module Selection
As a typical industrial controller, PLC is widely used in various harsh control environments with good reliability and stability. And with the development of modern electronic technology, the calculation speed, scalability and cost performance of PLC controllers have been greatly improved. The environment of the pump room with constant pressure water supply is relatively humid, and the frequent start and stop of frequency converters and asynchronous motors produce greater electromagnetic interference, so PLC is the primary choice for field controllers  . The field control program of constant pressure water supply mainly includes pump logic switching, PID control frequency modulation and fault protection, etc. The program capacity is relatively small. After preliminary estimation, the digital quantity input point used in the system is about 5 points, the analog quantity input is 3 points, the digital quantity output is 7 points, and the analog quantity output is 1 point. Taking into account the I/O redundancy of the system and the product performance of small and medium-sized PLCs of various brands, Siemens S7-1214DC/DC/RlyPLC is selected as the main controller in the project, and DQ4x24VDC digital output module and AI4x12Bit/AQ2x14Bit analog are mounted on the right side. Channel expansion for input and output modules  .
In the constant pressure water supply, the inverter receives the operation enable signal and frequency setting from the PLC controller, and controls the change of the water supply pressure by adjusting the actual speed of the booster pump. The system uses Siemens MM420 frequency converter, which has modular design and simple programmability. It is a common model of constant pressure water supply system. The parameter setting of the inverter mainly includes the motor parameter setting and the control mode setting. The specific parameters should be selected according to the specific control requirements and motor type. The constant pressure water supply control system designed in this paper uses the terminal control mode and motor parameters to control the inverter. Generally, it can be obtained from the motor nameplate or manufacturer’s instructions. The main parameter settings are shown in Table 1.
3.2. Main Circuit Design Analysis
Use M1, M2, and M3 to represent three asynchronous motors of the same model used to drive the booster pump, and each motor is controlled by two contactors that are not connected at the same time. Take the M1 motor as an example. When the contactor KM1 is turned on and KM2 is turned off, the motor uses the
Table 1. Frequency converter parameter setting.
power frequency current from the power grid, and the motor runs at a frequency of 50 HZ. When the contactor KM2 is turned on and KM1 is turned off, the motor uses the output from the inverter, and the motor runs at variable frequency. When the motor fails, the thermal relay FR will provide protection to the motor in the power frequency state, and the inverter will automatically stop and alarm when it detects overcurrent in the frequency conversion state.
3.3. System Control Circuit Design
The control loop includes field button control and PLC control loops that use self-holding circuits. The control signal from the field-level button and the output control signal of the PLC share the control coil of the contactor, for each motor In the control process of the two contactors, the interlock connection is used to ensure that the two contactors will not be turned on at the same time, so as to prevent a short circuit when the button is touched by mistake or programming error. The contactor accepts PLC control or on-site button control by the rotary switch SA to select. When the rotary switch SA turns to the left, the on-site control loop is turned on, and the intermediate relay KM8 is turned on at the same time. The PLC detects I0.0 and stops the PLC immediately. The program is executed and all PLC outputs are disabled, and the start button of the corresponding motor is pressed, the motor becomes the power frequency running state and is kept on by the self-holding circuit. When the rotary switch is turned to the right, the intermediate relay KM7 is turned off, and the field control loop will not be turned on when the button is pressed. The system turns to the PLC control state, and automatically controls the on and off of the relay according to the written control program to achieve Automatic control of booster pump. Because the content of the host computer is designed in the system, no additional control buttons are set to occupy the digital input points of the PLC. The automatic operation of the program, manual control and parameter adjustment are all completed in the host computer.
4. System Programs
After the system is started, if the motor has no fault, turn the knob switch to PLC control mode, and then switch the system to automatic control mode through upper computer operation. The pressure setting value is 3.2 kpa. When it is in the low peak period of water consumption, after the system turns to the automatic control mode, control the No. 1 water pump KM1 to close, KM2 to disconnect, the No. 1 water pump is in the variable frequency water supply state, the No. 2 water pump and the No. 4 water pump Standby stop; when the pressure drops due to the increase in water consumption, the output frequency of the inverter rises, when it rises to 50 HZ, that is, when the upper limit output frequency, the control program switches the No. 1 pump to the power frequency operation state and the No. 2 pump to Frequency conversion operation status; if the water pressure continues to drop, then continue to transition the No. 3 pump to the frequency conversion mode, and the No. 1 and No. 2 pumps will run at power frequency. According to the design requirements of the system, the water supply output of the system retains a certain output margin. Therefore, under the maximum water consumption, the No. 3 water pump generally does not reach the upper limit frequency. Similarly, when the water consumption is reduced and the pressure rises, the number of pump operations is reduced in turn. The program control flow is shown in Figure 3.
The PID control block in Portal software that supports CPU1214PLC is the “PID_Compact” function block, which is a PIDT1 controller with anti-integral saturation function and capable of weighting proportional and differential functions. The output calculation formula is:
In the formula, y―PID algorithm output value; Kp―proportional gain; b―proportional action weight; w―set value; x―process value; TI―integral action time; TD―differential action time; a―differential delay coefficient; c―differential action weight. The PID control parameters can be given by manual testing, or estimated by the PID controller through the self-tuning function.
5. Monitoring Design Based on WINCC
The frequency conversion constant pressure water supply system originally designed not only includes the detection mechanism, control mechanism and actuator, but also designed a monitoring mechanism composed of the upper computer to complete the monitoring, control and management of the PLC status and the controlled process of the lower computer. This article uses TIA WinCC Advanced configuration software to design the host computer monitoring screen. The screen content includes the main monitoring interface, parameter
Figure 3. Schematic diagram of program control flow.
setting interface, alarm and operation record interface, and trend graph interface.
The main monitoring interface of the water supply system is mainly composed of a buffer tank with a height of 5 m, three water pump motors with variable frequency operation, and a pressure sensor. It also includes manual/automatic switching buttons, reset buttons, interference buttons, and power frequency/variable frequency operation of water pump motors. The switch button and the set frequency input box in the manual operation mode of the inverter and the output frequency display box in the automatic operation mode, the pressure setting and manual interference input box reflect the operation of the equipment and the changes of the system process variables Under the circumstances, a good human interaction interface is provided for managers. The alarm configuration is to monitor the changes of variables that reflect the actual state of the equipment in the running state and prompt the fault information of the field equipment in time. The alarm record interface provides real-time alarm and historical alarm related information, including number, time, date, state variables, alarm text, etc. so that the alarm information is clear at a glance.
6. Simulation Analysis and Summary
Refering to Chapter 4 “Water Supply Quality and Water Pressure” in the “Urban Water Supply Project Planning Specification (GB50282-98)”, it is known that the pressure of the water supply network should be stable at about 3.2 KPa. According to the literature  , the control object model of the variable frequency and constant pressure water supply system in this district is:
With the help of MATLAB’s PIDTuner tool, the PID parameters of the simulation object are optimized. The optimized step curve is shown in Figure 4.
In this paper, a PLC-based variable frequency speed regulation and constant pressure water supply monitoring system is designed. The main control objective is to stabilize the water supply pressure. It uses a step-by-step variable frequency control method that drives three pump motors in a time-sharing manner. The pressure sensor detects the pressure value in real time, uses PID control algorithm to output the frequency setting value to the inverter through PLC, and then realizes the control of the water pump outlet pressure to achieve the purpose of constant pressure water supply.
Figure 4. PID Tuner optimized PID step response.