A method and system for regulating valve flow rate in water quality monitoring system

Through particle iterative optimization and fuzzy algorithm combined with PID controller, the problem of nonlinear and time-varying valve opening control is solved, the stability of flow rate and system adaptability are achieved, and the stable operation of the water quality monitoring system is ensured.

CN118519463BActive Publication Date: 2024-10-08QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410985334.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-08
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing technology is difficult to handle nonlinear and time-varying valve opening control, resulting in unstable flow rates and affecting the operation of the water quality monitoring system.

Method used

The particle iterative optimization algorithm and fuzzy algorithm combined with the PID controller are used to optimally control the valve opening by calculating the flow rate deviation and deviation change rate to ensure the stability of the flow rate.

Benefits of technology

It achieves effective control of nonlinear and time-varying systems, improves the adaptability and anti-interference ability of the system, and ensures the stable operation of the water quality monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519463B_ABST
    Figure CN118519463B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of valve opening control systems, and discloses a method and system for regulating the stable flow rate of a valve in a water quality monitoring system, wherein the target flow rate g(t) of a water storage tank at time t and the actual flow rate y(t) of the water storage tank are set, and the flow rate deviation e(t) and the deviation change rate ec of the two are calculated, and the flow rate deviation e(t) and the deviation change rate ec are optimized by an optimization algorithm, and after particle iteration, the global optimal parameters based on the current group are obtained, and the optimized values ​​are used as input variables of the control algorithm, and the proportional coefficient, integral coefficient, and differential coefficient are output after fuzzy algorithm processing, and the proportional coefficient, integral coefficient, and differential coefficient are substituted into the control law of the controller, the response of the system is calculated, and the final result U(t) of the control valve opening is output. The advantage is that a control algorithm for fast and intelligent control of the valve opening is used, and optimization is performed to achieve precise control of the valve opening, so as to achieve the purpose of stable flow rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of valve opening control systems, and in particular relates to a method and system for regulating a valve to stabilize flow rate in a water quality monitoring system. Background Art

[0002] A valve is a device used to control the flow of fluids (liquids, gases, etc.). It can open, close or adjust the fluid channel to control the flow, pressure and direction of the fluid. It is widely used in many fields and plays a key control and safety role. The control of valve opening is crucial for the stable operation and flow control of fluid pipeline systems. At present, existing technologies lack the ability to handle nonlinear and time-varying conditions. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for regulating the flow rate of a valve in a water quality monitoring system, a control algorithm for maintaining a stable flow rate, and ensuring that the integrated water quality monitoring system can operate stably. The technical solution is:

[0004] A method for adjusting a valve stable flow rate in a water quality monitoring system comprises the following steps:

[0005] S1. Setting t The target flow rate of the water tank at the moment g , the actual flow rate of the water tank , calculate the velocity deviation between the two and the rate of change of deviation ;

[0006] S2. Flow rate deviation and the rate of change of deviation The optimization algorithm is used for optimization. After particle iteration, the global optimal parameters based on the current group are obtained. and ;

[0007] S3. Use the optimized value as the input variable of the control algorithm, and output the proportional coefficient after fuzzy algorithm processing , integral coefficient , differential coefficient , substitute it into the controller to calculate the system response, and output the final result U(t) of controlling the valve opening.

[0008] Preferably, in step S2, the flow rate deviation and the rate of change of deviation Optimization using an optimization algorithm includes the following steps:

[0009] S21. Initialization value: In the D-dimensional search space, there are M particles, each particle represents a set of solutions;

[0010] S22. Initialize the position and velocity of particles: j The initial position of a particle is , No. j The initial velocity of a particle is ;

[0011] S23. Initialize the best individual and population positions of particles:

[0012] For j particles, the individual optimal position is: ; For the global population, the optimal position is: ;

[0013] S24. Define the fitness function: According to the position of each particle, calculate the value of the fitness function: The formula of the fitness function is:

[0014] ;

[0015] and is the inertia weight coefficient;

[0016] S25. Update particle position and speed: according to the current position of the particle ,speed and the best historical position , update the particle's position and speed ;

[0017] S26. Repeat iteration: iterate L times to obtain the optimal position;

[0018] S27. Assign the optimal parameters to the input of the control algorithm controller.

[0019] Preferably, in step S25, the speed of the next step = Inertia part W +Cognitive part R + Social Section S ;

[0020] The inertia part is composed of the inertia weight and the particle's own velocity:

[0021] ;

[0022] The cognitive part is the distance and direction between the particle's current position and its historical optimal position:

[0023] ;

[0024] The social part is the distance and direction between the current position of the particle and the historical optimal position of the group:

[0025] ;

[0026] ;

[0027] is the inertia weight, is the individual learning factor, is the group learning factor, , is a random number between [0, 1].

[0028] Preferably, in step S25, the position of the particle is updated = current position + speed of next step * time;

[0029] .

[0030] Preferably, in step S3, the fuzzy algorithm: the selected input variable is the flow rate deviation and the rate of change of deviation , the output variable is the proportional coefficient , integral coefficient , differential coefficient ; Select the domain V of the fuzzy subset as [-6, 6]; divide the input variables and output variables equally into 7 fuzzy subsets in the domain {positive large (PB), positive middle (PM), positive small (PS), zero (ZO), negative small (NS), negative middle (NM), negative large (NB)}.

[0031] Preferably, in step S3, the output fuzzy set is converted into a specific control quantity using a suitable method. , , ; Select the area averaging method for defuzzification; The area averaging method is to find the area enclosed by the membership function curve and the horizontal coordinate of the fuzzy set, and then find the coordinate value corresponding to the bisector that divides the area into two equal parts, and use this value to represent the entire fuzzy set.

[0032] Preferably, in step S3, a control rule of the fuzzy controller is established: when the flow rate deviation When larger, Take a larger value to reduce the overshoot. Should be as small as possible. Take a smaller value; when At medium size, Take the smaller value, and Take a moderate value; when When smaller, Take the larger value, Take the larger value, Take a moderate value.

[0033] Preferably, in step S3, the control law of the PID controller is:

[0034] Output = proportional coefficient * velocity deviation + integral coefficient * area + differential coefficient * deviation change rate

[0035] The proportionality factor is ,

[0036] The integral coefficient is , is the integration time,

[0037] The differential coefficient is , is the differential time;

[0038] ;

[0039] Where e(t) is the flow rate error and ec(t) is the deviation change rate.

[0040] A flow rate stabilizing system for regulating valves in a water quality monitoring system, comprising a control unit, a detection unit, and a data acquisition unit;

[0041] The control unit is equipped with a PID module, a fuzzy algorithm module and a particle population algorithm module; the control unit controls the seawater collection and distribution unit to open the pump valve as needed, so that a certain amount of water is obtained from the water storage tank, and at the same time, the first-level filter tank is used to filter the seawater, and the second-level filter tank is used to filter the seawater as needed to ensure that the detection unit can operate;

[0042] The control unit adopts control algorithms to meet detection requirements;

[0043] Data acquisition unit: uses sensors to obtain flow rate information of the water storage tank and filter tank in real time and feeds it back to the control unit;

[0044] Detection unit: detect the water level at regular intervals and adjust the flow rate in time. When the water level is higher or lower than the set value, feedback is given to the control unit to adjust the valve opening and flow rate in time to meet the water volume required by the detection unit;

[0045] After the detection unit is finished running, the control unit closes the water inlet valve, discharges the excess water in the water tank, and controls the valve of the backwash unit to flush the water storage tank and the filter tank.

[0046] A computer-readable storage medium stores a computer program, which implements the steps of the method of the present application when executed by a processor.

[0047] Compared with the prior art, the present invention has the following beneficial effects:

[0048] 1. Able to handle nonlinear, time-varying and uncertain systems, with strong adaptability and robustness.

[0049] 2. The control performance of the system can be optimized by adjusting the fuzzy rule base and PID parameters, with better anti-interference ability and dynamic response characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 Schematic diagram of the algorithm control process for regulating the stable flow of the valve.

[0051] Figure 2 Flowchart of the particle optimization algorithm.

[0052] Figure 3 The direction in which the particle will move next.

[0053] Figure 4 There are 7 fuzzy subsets divided by Gaussian membership function.

[0054] Figure 5 There are 7 fuzzy subsets divided using triangular membership functions.

[0055] Figure 6 This is a comparison chart between PID and fuzzy PID. DETAILED DESCRIPTION

[0056] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0057] The purpose of the present invention is to provide a method and system for regulating valve flow rate in a water quality monitoring system, a control algorithm for maintaining stable flow rate, and ensure that the integrated water quality monitoring system can operate stably. When the integrated water quality monitoring system is running, it is ensured that there is always seawater in the water storage tank, the first-level filter tank has regularly filtered seawater, and the second-level filter tank filters seawater as needed; and after the overall system process is completed, the water storage tank, the first-level filter tank, and the second-level filter tank are backwashed, acid-washed, and washed with tap water.

[0058] To achieve the above purpose, the present invention adopts the following specific control scheme:

[0059] When the detection unit in the integrated water quality monitoring system starts to operate, the control unit controls the seawater collection and distribution unit to open the pump valve as needed, so that a certain amount of water is obtained from the water storage tank, and at the same time, the first-level filter tank is used to filter the seawater, and the second-level filter tank is used to filter the seawater as needed to ensure that the detection unit can operate;

[0060] Use sensors to obtain flow rate information of the water storage tank and filter tank in real time and feed it back to the control unit;

[0061] The control unit uses a control algorithm that can quickly adjust the valve to maintain a stable flow rate to meet the detection requirements;

[0062] The water level is checked every 5 minutes and the flow rate is adjusted in time. When the water level is 20 cm higher or lower than the required water level, feedback is given to the control unit to adjust the valve opening and flow rate in time to meet the water volume required by the detection unit.

[0063] After the detection unit is finished running, the control unit closes the water inlet valve, discharges the excess water in the water tank, and controls the valve of the backwash unit to flush the water storage tank and the filter tank.

[0064] Figure 1 As shown, a method for adjusting a valve to stabilize flow rate in a water quality monitoring system specifically includes the following steps:

[0065] Set the target flow rate g(t) of the water tank at time t, and the actual flow rate of the water tank , calculate the velocity deviation between the two and the rate of change of deviation . Velocity Deviation and the rate of change of deviation The optimization algorithm is used for optimization. After particle iteration, the global optimal parameters based on the current group are obtained. and The optimized value is used as the input variable of the control algorithm, and the proportional coefficient is output after fuzzy algorithm processing. , integral coefficient , differential coefficient , substitute the control law of the controller, calculate the response of the system, and output the final result U(t) of controlling the valve opening.

[0066] 1. Use optimization algorithm to initialize parameters, such as Figure 2 shown.

[0067] 1) Initialization value: In the 10-dimensional search space, there are 100 particles, each particle represents a solution.

[0068] 2) Initialize the position and velocity of particles:

[0069] The initial position of the jth particle is , the initial velocity of the jth particle is .

[0070] No. j The position of a particle is expressed as:

[0071] ;

[0072] The velocity of the jth particle is expressed as:

[0073] .

[0074] 3) Initialize the best individual position and population position of particles:

[0075] For the jth particle, the individual optimal position is:

[0076] ;

[0077] For the global population, the optimal position is:

[0078] ;

[0079] By calculating the fitness function for each particle, their optimal position in the population can be evaluated.

[0080] 4) Define the fitness function: Calculate the value of the fitness function based on the position of each particle.

[0081] The formula of the fitness function is:

[0082] ;

[0083] Where, e(t) is the flow velocity deviation, is the deviation change rate, and is the inertia weight coefficient, which is adjusted by and The value of can control the balance between the flow rate deviation and the deviation change rate, so as to find the optimal solution: flow rate deviation and the rate of change of deviation .

[0084] 5) Update particle position and speed: Update the particle speed based on the particle's current position, speed, and historical optimal position and location .

[0085] The speed of the next step = inertial part + cognitive part + social part;

[0086] The inertia part is composed of the inertia weight and the particle's own velocity:

[0087] ;

[0088] is the inertia weight (usually selected between [0, 1]);

[0089] The cognitive part is the distance and direction between the particle's current position and its historical optimal position:

[0090] ;

[0091] is the individual learning factor;

[0092] The social part is the distance and direction between the current position of the particle and the historical optimal position of the group:

[0093] ;

[0094] is the group learning factor; ; , is a random number between [0, 1].

[0095] The speed formula for the next step is:

[0096] ;

[0097] Next step position = current position + next step speed * time:

[0098] .

[0099] like Figure 3 , the direction of the next move = inertia direction + individual optimal direction + group optimal direction.

[0100] 6) Iterate the fitness, speed, and position of the particle 50 times to find the optimal solution.

[0101] 7) The optimal solution value obtained is the velocity deviation and the rate of change of deviation , input into the control algorithm controller.

[0102] 2. Control the output of the optimized value:

[0103] 1) Fuzzification:

[0104] Select appropriate input variables and output variables, divide the fuzzy sets, use the membership function to describe the degree of membership of the input variables to the fuzzy sets, and convert an exact value into a fuzzy value.

[0105] The input variable selected is flow rate deviation and the rate of change of deviation , the output variable is the proportional coefficient , integral coefficient , differential coefficient . The domain V of the fuzzy subset is selected as [-6, 6]. Figure 4 , Figure 5 As shown, the input variables and output variables are evenly divided into 7 fuzzy subsets on the domain {positive large (PB), positive middle (PM), positive small (PS), zero (ZO), negative small (NS), negative middle (NM), negative large (NB)}.

[0106] In the present invention, the membership function of the input variable selects the Gaussian distribution type, and the membership function of the output variable selects the triangle.

[0107] The formula of Gaussian distribution membership function is:

[0108] ;

[0109] Where c is the center of the Gaussian membership function, The width of the Gaussian membership function can be determined. .

[0110] The formula for the triangle membership function is:

[0111] ;

[0112] in, a , b , c Determine the three vertices of the triangle membership function x coordinate.

[0113] 2) Fuzzy reasoning:

[0114] Establish the control rules of the fuzzy controller: When the flow rate deviation When larger, Take a larger value to reduce the overshoot. Should be as small as possible. Take a smaller value; when At medium size, Take the smaller value, and Take a moderate value; when When smaller, Take the larger value, Take the larger value, Take a moderate value.

[0115] 3) Defuzzification:

[0116] The area averaging method is selected for defuzzification. This method is to find the area enclosed by the fuzzy set membership function curve and the horizontal coordinate, and then find the coordinate value corresponding to the bisector that divides the area into two equal parts, and use this value to represent the fuzzy set.

[0117] The area division formula is:

[0118] ;

[0119] Where A(v) is the membership function of set A on the domain V; f , g They are the two intersection points of the fuzzy set membership function curve and the horizontal coordinate. x value.

[0120] 4) Regulate the output through PID controller.

[0121] The control law of the PID controller is:

[0122] Output = proportional coefficient * flow rate deviation + integral coefficient * area + differential coefficient * deviation change rate;

[0123] The proportionality factor is ,

[0124] The integral coefficient is , is the integration time,

[0125] The differential coefficient is , is the differential time;

[0126] ;

[0127] Where e(t) is the flow rate error and ec(t) is the deviation change rate.

[0128] After the above steps, the valve opening can be controlled to ensure the stability of the flow rate and the stable operation of the integrated water quality monitoring system.

[0129] A flow rate stabilizing system for regulating valves in a water quality monitoring system, comprising a control unit, a detection unit, and a data acquisition unit;

[0130] The control unit is equipped with a PID module, a fuzzy algorithm module and a particle population algorithm module; the control unit controls the seawater collection and distribution unit to open the pump valve as needed, so that a certain amount of water is obtained from the water storage tank, and at the same time, the first-level filter tank is used to filter the seawater, and the second-level filter tank is used to filter the seawater as needed to ensure that the detection unit can operate;

[0131] The control unit adopts control algorithms to meet detection requirements;

[0132] Data acquisition unit: uses sensors to obtain flow rate information of the water storage tank and filter tank in real time and feeds it back to the control unit;

[0133] Detection unit: detect the water level at regular intervals and adjust the flow rate in time. When the water level is higher or lower than the set value, feedback is given to the control unit to adjust the valve opening and flow rate in time to meet the water volume required by the detection unit;

[0134] After the detection unit is finished running, the control unit closes the water inlet valve, discharges the excess water in the water tank, and controls the valve of the backwash unit to flush the water storage tank and the filter tank.

[0135] The output curves of the PID valve control system and the optimized fuzzy PID valve control system are compared as follows: Figure 6 As shown in the waveform, the optimized control system has a small PID overshoot, short adjustment time and fast rise time.

[0136] A computer-readable storage medium stores a computer program, which implements the steps of the method of the present application when executed by a processor.

[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus dynamic random access memory (Rambus DRAM, referred to as RDRAM), and interface dynamic random access memory (DRDRAM).

[0138] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.

[0139] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0140] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for adjusting the stable flow rate of a valve in a water quality monitoring system, characterized in that: The following steps are included: S1. Set the target flow rate g(t) of the water tank at time t, the actual flow rate y(t) of the water tank, and calculate the flow rate deviation e(t) and the deviation change rate ec between the two; S2. The velocity deviation e(t) and the deviation change rate ec are optimized by using an optimization algorithm. After particle iteration, the global optimal parameter e based on the current population is obtained. best (t) and ec best ; The flow rate deviation e(t) and the deviation change rate ec are optimized using an optimization algorithm, including the following steps: S21. Initialization value: In the D-dimensional search space, there are M particles, each particle represents a set of solutions; S22. Initialize the position and velocity of the particle: the initial position of the jth particle is X jd (j≤M,d≤D), the initial velocity of the jth particle is V jd (j≤M,d≤D); S23. Initialize the best individual position and population position of particles: For the jth particle, the individual optimal position is: Xjd ,p_best ; For the global population, the optimal position is: Xd ,g_best ; S24. Define the fitness function: According to the position of each particle, calculate the value of the fitness function: The formula of the fitness function is: Fitness=ω1*e(t)+ω2*ec ω1 and ω2 are the inertia weight coefficients; S25. Update particle position and speed: according to the current position of the particle speed and the best historical position Update the particle's position and speed S26. Repeat iteration: iterate L times to obtain the optimal position; S27. Assigning the optimal parameters to the input of the control algorithm controller; S3. Use the optimized value as the input variable of the control algorithm, and output the proportional coefficient K after fuzzy algorithm processing p , integral coefficient K i , differential coefficient K d , substitute into the controller to calculate the response of the system, and output the final result U(t) of controlling the valve opening; Fuzzy algorithm: The selected input variable is the flow rate deviation e best (t) and the deviation change rate ec best , the output variable is the proportional coefficient K p , integral coefficient K i , differential coefficient K d ; Select the domain V of the fuzzy subset as [-6, 6]; divide the input variables and output variables into 7 fuzzy subsets on the domain evenly; The output fuzzy set is converted into a specific control quantity K using an appropriate method. p , K i , K d ; Select the area averaging method for defuzzification; the area averaging method is to find the area enclosed by the membership function curve and the horizontal coordinate of the fuzzy set, and then find the coordinate value corresponding to the bisector that divides the area into two equal parts, and use this value to represent the entire fuzzy set; The control law of the PID controller is: Output = proportional coefficient * flow rate deviation + integral coefficient * area + differential coefficient * deviation change rate The proportionality factor is K p , The integral coefficient is T i is the integration time, The differential coefficient is K d =K p *T d , T d is the differential time; Where e(t) is the flow rate error and ec(t) is the deviation change rate.

2. A method for adjusting a valve to stabilize flow rate in a water quality monitoring system according to claim 1, characterized in that: In step S25, the speed of the next step The inertia part is composed of the inertia weight and the particle's own velocity: The cognitive part is the distance and direction between the particle's current position and its historical optimal position: The social part is the distance and direction between the current position of the particle and the historical optimal position of the group: ω is the inertia weight, c1 is the individual learning factor, c2 is the group learning factor, r1 and r2 are random numbers between [0, 1].

3. The method for adjusting the stable flow rate of a valve in a water quality monitoring system according to claim 1, characterized in that: In step S25, the position of the particle is updated 4. The method for adjusting the stable flow rate of a valve in a water quality monitoring system according to claim 1, characterized in that: In step S3, the seven fuzzy subsets are {positive large (PB), positive middle (PM), positive small (PS), zero (ZO), negative small (NS), negative middle (NM), negative large (NB)}.

5. The method for adjusting the stable flow rate of a valve in a water quality monitoring system according to claim 1, characterized in that: In step S3, the control rule of the fuzzy controller is established: when the flow rate deviation e best When (t) is large, K p Take a larger value to reduce overshoot, K i Should be as small as possible, K d Take a smaller value; when e best When (t) is of medium size, K p Take a smaller value, K i and K d Take a moderate value; when ebest(t) is small, K p Take a larger value, K i Take a larger value, K d Take a moderate value.

6. A method for adjusting valves to stabilize flow rate in a water quality monitoring system according to any one of claims 1 to 5, characterized in that: It includes a control unit, a detection unit and a data acquisition unit; The control unit is equipped with a PID module, a fuzzy algorithm module and a particle population algorithm module; the control unit controls the seawater collection and distribution unit to open the pump valve as needed, so that a certain amount of water is obtained from the water storage tank, and at the same time, the first-level filter tank is used to filter the seawater, and the second-level filter tank is used to filter the seawater as needed to ensure that the detection unit can operate; The control unit adopts control algorithms to meet detection requirements; Data acquisition unit: uses sensors to obtain flow rate information of the water storage tank and filter tank in real time and feeds it back to the control unit; Detection unit: detect the water level at regular intervals and adjust the flow rate in time. When the water level is higher or lower than the set value, feedback is given to the control unit to adjust the valve opening and flow rate in time to meet the water volume required by the detection unit; After the detection unit is finished running, the control unit closes the water inlet valve, discharges the excess water in the water tank, and controls the valve of the backwash unit to flush the water storage tank and the filter tank.