Research on Fuzzy PID Water Pressure Control Based on KingSCADA and PLC
2026-04-06 04:29:25··#1
Abstract: This paper introduces the basic functions of S7-300 and the basic principles of fuzzy control, and elaborates on how to use STEP 7 to write a user-developed fuzzy PID control algorithm and how to use KingSCADA 6.5 to monitor the water pressure of the water supply network. Through communication between KingSCADA and S7-300, the P, I, and D parameters are adjusted in real time using the fuzzy PID control algorithm to achieve control of the water pressure of the water supply network. Keywords: KingSCADA 6.5, water pressure control, fuzzy PID control algorithm, S7-300 PLC, multi-point interface network (MPI) 1 Introduction In recent years, with the development of industrial automation technology, people have increasingly higher requirements for automated monitoring systems. This requires a set of monitoring software that is easy to use, powerful, high-performance, stable and reliable. Siemens' SIMATIC S7 PLC network has a multi-point interface network (MPI), which can realize communication between S7-300 and the industrial control configuration software KingSCADA to achieve automatic control by the computer. This paper studies the application of KingSCADA 6.5 and S7-300 in the control of constant pressure water supply systems. 2. Introduction to KingSCADA KingSCADA is an intelligent software package for creating human-machine interfaces for industrial control objects on a PC. It uses Windows 98/Windows 2000/Windows NT4.0 Chinese operating systems as its operating platform and features comprehensive graphical functionality, a consistent and user-friendly interface, and ease of learning and use. The package consists of three parts: Project Manager (ProjManager), Project Explorer (TouchExplorer), and Screen Development System (TouchVew). ProjManager is used for creating new projects, project management, and can search, back up, and effectively restore existing projects, as well as import and export data dictionaries. TouchExplorer is the core of the KingSCADA software and its management and development system. It serves as the development environment for application projects, embedding a screen development system that can complete tasks such as screen design and animation connection. TouchVew is the real-time runtime environment for the "KingSCADA" software. It displays animated graphics created in the screen development system and handles data exchange between the database and I/O service programs. Through real-time database management, it collects various data from a group of industrial control objects and visually represents data changes using animation. It also performs monitoring functions such as alarms, historical records, and trend curves, and can generate historical data files. Screen applications designed and developed in the TouchExplorer screen development system must run within the TouchVew runtime environment. 3. Introduction to S7-300 The S7-300 series PLC is one of Siemens' latest industrial control products and holds an important position in Siemens' industrial control applications. The S7-300 series PLC boasts powerful hardware and software capabilities, employing a modular design for convenient system configuration. A single rack baseplate can house various special function modules, including power supplies, CPUs, signal modules, and communication processors. These modules are easy to install. The system features a robust PROFIBUS fieldbus interface and an MPI interface. The MPI interface serves as both a programming and data communication interface, enabling communication between PLCs or between a PLC and a host computer via the MPI protocol, thus forming an MPI network. However, the built-in configuration functions of the S7-300 series PLC fall short of customer requirements, offering poor visualization. Therefore, matching configuration software is needed to implement its monitoring functions. Hardware configuration is required when using the S7-300. The computer acts as the PLC programming device. Open the S7-300 programming software package STEP 7 and configure the rack number, power supply, CPU, distributed I/O, and other modules according to their actual physical locations. The addresses of distributed I/O modules are typically set using the dial switches next to the modules. Finally, the configuration program table is downloaded to the PLC and confirmed. In Siemens' STEP7 software package, ladder diagrams, statement lists, or function block diagrams can be used for programming. 4 Implementation and application of fuzzy PID control algorithm The analysis and design methods in automatic control theory are mainly based on the linear time-invariant mathematical model of the controlled object. This model ignores the nonlinearity and time-varying nature of the actual system and has a large gap with the actual system. For many industrial control objects, it is impossible to establish a relatively accurate mathematical model. Therefore, the design methods in automatic control theory are difficult to use in most control systems. Fuzzy control is suitable for systems where the object model is difficult to establish, the process characteristics lack consistency, and there is nonlinearity, but operational experience can be summarized [2]. Water pressure control has nonlinearity, time-varying nature, and lag. Therefore, the fuzzy PID control algorithm is applied to the constant pressure water supply control system. 4.1 Composition and Working Process of Constant Pressure Water Supply Control System This system uses a PLC as the control core. The required water pressure is freely set via a host computer. Once the water pressure is set, based on the principle of variable frequency constant pressure water supply, pressure sensors installed on the water supply network sample the water pressure data and convert the water pressure signal into an electrical signal, which is then sent to the PLC. The PLC compares and calculates the actual water pressure value with the set water pressure value, converts the calculation result back into an electrical signal, and outputs it to the signal input terminal of the frequency converter. The frequency converter adjusts the power frequency of the water pump motor according to the input signal, thereby adjusting the speed of the water pump to maintain the water pressure value in the water supply network within the set water pressure range, thus achieving the purpose of constant pressure water supply. On the other hand, the PLC also communicates with the computer to monitor pressure changes in real time through the configuration screen. This constant pressure water supply system includes an Advantech industrial control computer (host computer), an S7-300 PLC, a frequency converter, a water pump motor, a level sensor, and a water tank. The software part is STEP 7 running on the WINDOWS platform. Its basic function is to assist users in completing application software tasks [5]. This constant pressure water supply system adopts the working mode of controlling three pumps with one frequency converter. The working process is as follows: First, the frequency converter starts the No. 1 water pump. If the working frequency has reached 50Hz, but the pressure is still insufficient, the No. 1 pump is switched to the power frequency operation, and then the frequency converter starts the No. 2 water pump. The water supply pump is in the "1 power and 1 frequency converter" operation state; if the working frequency of the frequency converter has reached 50Hz again, but the pressure is still insufficient, the No. 2 pump is also switched to the power frequency operation, and then the frequency converter starts the No. 3 water pump. The water supply pump is in the "2 power and 1 frequency converter" operation state. If the frequency of the inverter has dropped to the lower limit frequency, but the pressure is still too high, then pump #1 will be stopped, and the water supply pump will be in the "1 working and 1 variable frequency" operation state; if the frequency of the inverter has dropped to the lower limit frequency, but the pressure is still too high, then pump #2 will be stopped, and the water supply pump will be in the pump #3 variable frequency operation state. This arrangement has the advantage of making the working time of the three pumps more uniform. 4.2 Fuzzy control principle The most basic fuzzy control system structure is shown in Figure 1. In the figure, y[sub]r[/sub] is the system set value, and y is the system output value. They are both clear quantities. As can be seen from the figure, it is not much different from the traditional control system structure, except that the fuzzy controller is used instead of the traditional digital controller. [align=center] Figure 1 Fuzzy control system structure diagram[/align] Generally speaking, the fuzzy controller has three main functional modules. (1) Fuzzification Fuzzification is the process of converting the definite value of the input quantity of the fuzzy controller into the corresponding fuzzy linguistic variable value. The corresponding linguistic variable value is defined by the corresponding membership degree. (2) Fuzzy Reasoning Fuzzy reasoning consists of three parts: major premise, minor premise, and conclusion. The major premise is a set of multiple multidimensional fuzzy conditional statements that constitute the rule base; the minor premise is a fuzzy judgment statement, called a fact. The process of deriving new fuzzy propositions as conclusions based on the known rule base and input variables and fuzzy transformation is called fuzzy reasoning. (3) Explicitization Explicitization is the process of converting the fuzzy set obtained after fuzzy reasoning into digital values used for control. 4.3 Implementation and Application of Fuzzy PID Control Algorithm This paper mainly discusses the application of KingSCADA 6.5 and S7-300 in pressure control. In the S7-300 programming software package STEP 7, a user program is written to replace the traditional PID controller with a fuzzy PID controller and to execute the fuzzy PID control algorithm by interrupt. The STEP 7 is used to implement the intelligent algorithm to select appropriate PID parameters and to control the system by changing the PID parameters in the PID module of the PLC. In this way, the PID programming module statement integrated by the PLC and the intelligent control are organically combined, which improves the control accuracy and speed of the system and realizes effective intelligent control of the system. Here, we use fuzzy control to select the system control parameters P, I, and D by querying the rule table. Since the controlled parameter water pressure changes rapidly, the sampling time of this control system is 5 seconds. The parameters in the fuzzy PID control algorithm are determined by the following method: where ke and kec are the quantization factors of deviation e and deviation change rate ec, respectively; e[sub]H[/sub], e[sub]L[/sub], ec[sub]H[/sub], ec[sub]L[/sub] are the upper limit and lower limit values of deviation e and deviation change rate ec, respectively [3]; is the boundary value of the discrete domain after the domain of the linguistic variable is converted from the continuous domain to the finite discrete domain. For deviation e and deviation change rate, their physical domain is transformed to the entire domain {-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6} through quantization, that is, n is 6. If the fuzzified value obtained contains decimals, the fuzzified value is rounded to an integer. The water pressure control process is configured and monitored in KingSCADA 6.5. In the design, KingSCADA treats each lower-level machine as an external device. During the development process, the connection can be completed conveniently and quickly according to the prompts of the "Device Configuration Wizard". During operation, KingSCADA exchanges data with these external devices through the driver, including data acquisition and data sending commands. Each driver is a COM object, which makes the communication program and KingSCADA form a complete system. Its communication principle with the lower-level machine is shown in Figure 2. This system uses serial communication to establish a connection with the S7-300 PLC. After the communication between the upper-level machine and the PLC is established, in order to realize the monitoring function of the upper-level machine on the pressure control system, it is necessary to set variables and connect variables to the PLC. I/O variables are defined in the KingSCADA data dictionary and associated with intermediate variables defined in the PLC in advance. After the data variables are set, the screen can be configured, and the final upper-level machine monitoring function can be realized according to the actual requirements of the system monitoring. The designed software uses curves to display parameter changes and can perform real-time curve monitoring and historical curve query [4]. The above algorithm was applied to the experiment, and the experimental control effect is shown in Figure 3. The traditional PID algorithm was applied to the experiment, and the experimental effect is shown in Figure 4. Figure 3 shows that when the water pressure value changes, it quickly returns to the setpoint, with virtually no overshoot and very little oscillation, achieving excellent control. In Figure 4, however, oscillations occurred for a longer period each time the setpoint changed. This demonstrates that the fuzzy PID control algorithm achieves better results than the traditional PID algorithm. [align=center] Figure 3 KingSCADA Online Trend Chart (Fuzzy PID Control)[/align] [align=center] Figure 4 KingSCADA Online Trend Chart (PID Control)[/align] 5 Summary The industrial control computer uses KingSCADA to communicate with the PLC, offering advantages such as good real-time performance, high speed, high reliability, stable operation, and flexible adjustment. The system's human-machine interface is user-friendly and intuitive, and it is flexible and easily expandable. This paper, combined with a constant pressure water supply system, proposes a fuzzy PID control algorithm and uses an S7-300 PLC to write a fuzzy PID program. This algorithm was used to set P, I, and D parameters in real time, and the PLC used its integrated PID module to quickly output control quantities. The operation of the constant pressure water supply system was monitored using KingSCADA software, and the results were applied experimentally. Experimental results show that this method achieves intelligent control of the system without increasing system costs, exhibiting advantages such as high control accuracy and good stability. This provides a new approach for the application of intelligent control algorithms in industrial process control. References: [1]. Beijing Yacon Technology Development Co., Ltd. Kingview User Manual [M]. Beijing: 2004. [2]. Liao Changchu (ed.). S7-300/400 PLC Application Technology [M]. Beijing: Machinery Industry Press, 2005. [3]. Yi Jikai, Hou Yuanbin. Intelligent Control Technology [M]. Beijing: Beijing University of Technology Press, 1999. [4]. Wu Zhengang, Chen Hu. PLC Human-Machine Interface and Programming [J]. Microcomputer Information, 2005, 8-1: 21-23. [5]. Qin Jian, Guo Haidong, Tan Xuefeng Design of Liquid Level PLC Control System Based on Kingview [J]. Journal of Jilin Chemical Engineering Institute, 2006, 23-1: 56-58. Research on Fuzzy PID Water Pressure Control Based on Kingview and PLC