A sewage aeration dissolved oxygen fuzzy PID optimization control method based on improved CPSO
By improving the CPSO algorithm to optimize the input quantization factor and output proportional factor of the fuzzy PID controller, the problems of traditional PID parameter tuning relying on manual experience and inaccurate matching of fuzzy PID factors are solved, thereby improving the stability and anti-disturbance capability of wastewater aeration dissolved oxygen control.
Patent Information
- Application Number
- CN202610720159.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-25
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-05-25
AI Technical Summary
Traditional PID parameter tuning relies on human experience, fuzzy PID key factors are difficult to match accurately, and standard particle swarm optimization algorithms are prone to premature convergence, leading to unstable dissolved oxygen control in wastewater aeration and increased energy consumption.
An improved CPSO algorithm, employing a Logistic chaotic mapping initialization strategy and nonlinear dynamic inertia weight adjustment, optimizes the input quantization factor and output proportional factor of the fuzzy PID controller. By improving the CPSO algorithm to optimize the parameters of the fuzzy PID controller, the stability and anti-disturbance capability of aeration dissolved oxygen control are enhanced.
It improves the stability and parameter tuning efficiency of dissolved oxygen control in wastewater aeration, reduces energy consumption, enhances the system's adaptability, and is suitable for closed-loop control in wastewater treatment plants.
Smart Images

Figure CN122284273B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wastewater treatment process control and PID control optimization technology, and particularly relates to a fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO. Background Technology
[0002] Wastewater aeration is a crucial step in urban wastewater treatment and industrial wastewater biochemical treatment. Its main function is to supply oxygen to the water in the aerobic biological reaction zone and promote thorough mixing of wastewater, activated sludge, and dissolved oxygen through bubble agitation. Dissolved oxygen concentration is an important indicator for evaluating the operational status of the aeration process. Too low a concentration will affect the activity of aerobic microorganisms and reduce the pollutant removal efficiency, while too high a concentration will increase the energy consumption of blowers and pipeline systems. Therefore, achieving stable, rapid, and low-energy control of dissolved oxygen concentration in the aeration tank under constantly changing conditions such as influent load, water temperature, sludge concentration, and aeration equipment status is an important technical issue in the refined operation of wastewater treatment plants.
[0003] PID control is widely used for regulating blower speed or duct valve opening in wastewater aeration systems due to its simple structure, ease of implementation, and strong engineering applicability. However, wastewater aeration systems typically exhibit nonlinearity, long time delay, strong coupling, and time-varying characteristics. The proportional, integral, and derivative coefficients of traditional fixed-parameter PID controllers often rely on manual experience for tuning, making it difficult to maintain optimal control performance under different water quality loads and operating conditions. Fuzzy PID control can correct PID parameters online based on dissolved oxygen concentration deviations and their rate of change, improving system adaptability. However, its input quantization factor and output proportional factor still have a decisive impact on control performance. If the parameters are not selected properly, problems such as overshoot, oscillation, long settling time, or large steady-state error may still occur.
[0004] Chaotic Particle Swarm Optimization (CPSO) is an intelligent optimization algorithm based on a particle swarm cooperative search mechanism and incorporating the idea of chaotic mapping. It guides the population to iteratively search in the solution space by using the historical optimal position of individual particles and the global optimal position of the swarm. At the same time, it utilizes the ergodicity, randomness, and initial value sensitivity of chaotic sequences to enhance the diversity of population distribution. The algorithm has a simple structure, few parameters, and fast convergence speed, and is suitable for scenarios such as PID parameter tuning, process control optimization, and nonlinear system optimization. However, traditional CPSO may still have problems such as insufficient local search ability, decreased convergence accuracy in the later stages, and easy getting trapped in local optima in complex constraints or multimodal optimization problems. Further improvement strategies are needed to enhance the global optimization ability and robustness of the algorithm. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing wastewater aeration dissolved oxygen control methods, such as the reliance on manual experience for traditional PID parameter tuning, the difficulty in accurately matching key factors of fuzzy PID, and the premature convergence of standard particle swarm optimization algorithms. This invention proposes a fuzzy PID optimization control method for wastewater aeration dissolved oxygen based on an improved CPSO algorithm. This method improves the uniformity and diversity of the initial population through a Logistic chaotic mapping initialization strategy, balances global search and local optimization through a nonlinear dynamic inertia weight adjustment strategy, and then uses the improved CPSO algorithm to optimize the input quantization factor and output proportional factor of the fuzzy PID controller. This improves the stability, disturbance rejection capability, and parameter tuning efficiency of aeration dissolved oxygen control.
[0006] To achieve the above objectives, the present invention adopts the following technical solution.
[0007] A fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on an improved CPSO algorithm is proposed. The method improves the initialization strategy and inertia weight update strategy of the chaotic particle swarm optimization algorithm and optimizes the parameters of the fuzzy PID controller using the improved CPSO algorithm. The specific steps are as follows.
[0008] S1. Construct a closed-loop control system for dissolved oxygen in wastewater aeration. The system includes an error calculation module, a fuzzy PID controller module, an improved CPSO algorithm module, an aeration actuator module, a controlled object module for the aeration system, and a dissolved oxygen concentration detection module.
[0009] S2. Improve the CPSO algorithm. Specific improvement strategies include: S21. A Logistic chaotic mapping initialization strategy is adopted to generate an initial population of particles, and the chaotic sequence is mapped to the search space of the parameters to be optimized in order to improve the uniformity and diversity of the initial population. S22. A nonlinear dynamic inertia weight adjustment strategy is adopted to improve the particle velocity update process, which enhances the global search capability in the early stage and the local optimization capability in the later stage.
[0010] S3. The improved CPSO algorithm is used to optimize the input quantization factor and output proportional factor of the fuzzy PID controller. The dissolved oxygen control effect under different parameter combinations is evaluated by the fitness function to obtain the optimal parameter combination.
[0011] S4. Input the optimal parameter combination into the fuzzy PID controller, output the control quantity to adjust the blower speed or the opening of the air duct valve, and feed the actual dissolved oxygen concentration back to the error calculation module to form a closed-loop control of dissolved oxygen in wastewater aeration.
[0012] Preferably, in step S1, the dissolved oxygen concentration detection module collects the actual dissolved oxygen concentration value of the aeration tank. The error calculation module will set the dissolved oxygen value. Compared with the actual dissolved oxygen concentration value By comparison, the dissolved oxygen concentration deviation is obtained. and the rate of change of deviation Its mathematical expression is as follows: ; ;
[0013] In equations (1) and (2), The sampling period is and It serves as the input variable for the fuzzy PID controller and is continuously updated by the closed-loop feedback link.
[0014] Preferably, the fuzzy PID controller quantizes the input variables, and Converted into quantized fuzzy variables respectively and Its mathematical expression is: ; ;
[0015] In equations (3) and (4), and These are the fuzzy variables representing the quantified dissolved oxygen concentration deviation and the deviation change rate, respectively. and These are the input quantization factors, respectively. and Located within a preset fuzzy domain, the quantized variables undergo fuzzification, fuzzy inference, and defuzzification to output standardized PID parameter corrections. , , .
[0016] Preferably, the standardized PID parameter correction is converted into the actual PID parameter correction through the output proportional factor, and then superimposed with the PID reference parameters to obtain the final PID control parameters, the mathematical expression of which is as follows: , , ; , , ;
[0017] In equations (5) and (6), , , To output the scaling factor, , , For PID baseline parameters, , , The final PID control parameters are obtained by superimposing the actual PID parameter corrections. , , These are the actual proportional parameter correction, actual integral parameter correction, and actual differential parameter correction after conversion by the output proportional factor, respectively.
[0018] Preferably, the fuzzy PID controller generates the aeration control quantity based on the final PID control parameters. Its mathematical expression is as follows: ;
[0019] In equation (7), To output the control quantity to the aeration actuator, the aeration actuator, according to... Adjust the blower speed or the opening of the duct valve.
[0020] Preferably, in step S2, a Logistic chaotic mapping initialization strategy is used to generate the initial particle population, and the first... The particle and the first dimensional chaotic variables The process involves iteration, mapping the chaotic variables to the search space of the parameters to be optimized. The mathematical expression for this is as follows: ; ; In equations (8) and (9), This is the Logistic control parameter with a value of 4. and The first The lower and upper limits of the search for each parameter to be optimized. For the first The first particle The actual parameter value of the dimension.
[0021] Preferably, in step S2, a nonlinear dynamic inertia weight adjustment strategy is used to improve the particle velocity update process, and the inertia weight... The mathematical expression is as follows: ;
[0022] In equation (10), This represents the current iteration number. The maximum number of iterations, and These are the minimum and maximum values of the inertia weight, respectively. It is a non-linear adjustment factor and >1, For a random disturbance term with a mean of 0, Let be the disturbance intensity coefficient; when When the value exceeds the range, a limit is applied.
[0023] Preferably, in step S3, tuning the input quantization factor and output scaling factor of the fuzzy PID controller using the improved CPSO algorithm specifically includes: S31. Initialize the population size, maximum number of iterations, problem dimension, and upper and lower bounds of the search space; S32. Initialize the population based on the Logistic chaotic mapping; S33. Establish the mapping relationship between particle position and fuzzy PID optimization parameters; S34. Calculate the fitness value of individual populations and determine the current global optimal position; S35. Update particle velocity and position based on inertia weights; S36. Determine if the current iteration count has reached the maximum iteration count. If not, return to S34. If it has, output the parameter combination corresponding to the globally optimal position.
[0024] Preferably, in step S33, each particle position vector corresponds to a set of fuzzy PID parameters to be optimized, and their mathematical expression is as follows: ; ; ;
[0025] Equation (11) represents the particle position vector under the optimization mode with input quantization factor, while equations (12) and (13) represent the particle position vector under the simplified optimization mode. Under the simplified optimization mode, and Take the same value Population size =50, maximum number of iterations max_iter=100, upper and lower bounds of parameter search space are... = .
[0026] Preferably, in step S34, the fitness function uses the finite-time ITAE criterion to evaluate the dissolved oxygen control effect under different parameter combinations. The mathematical expressions in continuous and discrete forms are as follows: ; ;
[0027] In equations (14) and (15), To control the evaluation time, The sampling period is To evaluate the number of sampling points in the time domain, The smaller the value, the smaller the cumulative control error of the corresponding parameter combination.
[0028] Preferably, in step S35, the mathematical expressions for particle velocity update and position update are as follows: ; ;
[0029] In equations (16) and (17), For the first The first particle The speed of the next iteration For the first The first particle The position of the next iteration. For the individual's historical best position, The optimal position for the entire population. and As a learning factor, and for Random numbers within an interval.
[0030] Preferably, the closed-loop control method is applicable to conditions such as step changes in dissolved oxygen setpoint, external disturbances, changes due to detection lag, and dynamic updates of dissolved oxygen setpoint. The aeration actuator includes a blower speed adjustment mechanism and / or a duct valve opening adjustment mechanism, and continuously corrects the aeration through closed-loop feedback. This is to achieve stable control of dissolved oxygen concentration during wastewater aeration.
[0031] By adopting the above technical solution, the present invention has the following beneficial effects.
[0032] First, this invention combines fuzzy control with PID control, using dissolved oxygen concentration deviation and deviation change rate as fuzzy inference inputs. It can correct PID parameters online according to the operating status of the aeration system, reducing the dependence of fixed parameter PID on human experience.
[0033] Second, this invention generates an initial population through Logistic chaotic mapping, which makes the particles more evenly distributed in the parameter search space, improves the global search coverage in the early stage of the algorithm, and reduces the probability that the algorithm will fall into a local area from the initial stage.
[0034] Third, this invention adjusts the particle velocity update process through nonlinear dynamic inertia weight, enabling the algorithm to have strong exploration capabilities in the early stage and high local convergence accuracy in the later stage, thereby improving the optimization accuracy of fuzzy PID quantization factors and scaling factors.
[0035] Fourth, this invention uses the ITAE criterion as the fitness evaluation basis, which can comprehensively consider the error duration and error amplitude in the dissolved oxygen control process, making the obtained parameter combination more suitable for aeration control scenarios with long time delay and strong disturbance.
[0036] Fifth, the present invention can control the aeration volume by adjusting the blower speed or the opening of the air duct valve, which is convenient to integrate with existing sewage treatment plant aeration systems, PLC control systems and online DO sensor systems, and has good engineering application adaptability. Attached Figure Description
[0037] Figure 1 This is an overall flowchart of a wastewater aeration dissolved oxygen fuzzy PID optimization control method based on an improved CPSO according to the present invention.
[0038] Figure 2 This is a schematic diagram of the traditional PID aeration control principle.
[0039] Figure 3 This is a schematic diagram of the fuzzy PID aeration control principle.
[0040] Figure 4 This is a flowchart of the design of a fuzzy PID controller.
[0041] Figure 5 The waveform of the membership function between the quantified deviation change rate fuzzy variable EC and the standardized proportional parameter correction amount ΔKp′ is shown.
[0042] Figure 6 This is a schematic diagram of CPSO-Fuzzy-PID control.
[0043] Figure 7 The fitness convergence curve and parameter optimization curve of the CPSO algorithm are shown.
[0044] Figure 8 This is a step response curve.
[0045] Figure 9 The simulation curves are for simulating random disturbance scenarios.
[0046] Figure 10 This is a simulation curve for a long time delay condition.
[0047] Figure 11 The simulation curve of the operating condition is dynamically updated based on the DO concentration setpoint. Detailed Implementation
[0048] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. The described embodiments are only some embodiments of the present invention, and not all embodiments. Other implementation methods obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the protection scope of the present invention.
[0049] Please see Figures 1 to 11 This embodiment provides a fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on an improved CPSO algorithm. The method uses the dissolved oxygen concentration in the aerobic biological tank of the wastewater treatment plant as the controlled variable and the blower speed or duct valve opening as the executed variable. A closed-loop control loop is formed by a dissolved oxygen concentration detection module, an error calculation module, a fuzzy PID controller module, an improved CPSO algorithm module, an aeration actuator module, and a controlled object module of the aeration system.
[0050] like Figure 1 As shown, the overall process of this embodiment includes four steps: Step 1, constructing a wastewater aeration dissolved oxygen control system model, clarifying the controlled object, detection variables, actuators, and closed-loop feedback relationships; Step 2, designing an improved CPSO algorithm, introducing a Logistic chaotic mapping initialization strategy and a nonlinear dynamic inertia weight adjustment strategy respectively; Step 3, using the improved CPSO algorithm to optimize the quantization factor and proportional factor of the fuzzy PID controller; Step 4, substituting the optimal parameters into the fuzzy PID controller, and using the aeration actuator to perform closed-loop regulation of the dissolved oxygen concentration.
[0051] S1. Construct a closed-loop control system for dissolved oxygen in wastewater aeration. The system can be applied to wastewater treatment processes that include aerobic aeration sections, such as A²O, oxidation ditch, SBR, and MBR. Taking the aerobic section of the A²O process as an example, the blower sends air into the aerobic tank through the air duct and aeration device. The bubbles rise in the tank and complete the oxygen transfer. Microorganisms use dissolved oxygen to degrade organic matter and carry out nitrification. The DO sensor collects the dissolved oxygen concentration in the tank in real time and feeds it back to the control system.
[0052] Furthermore, the aeration actuators include, but are not limited to, centrifugal blowers, Roots blowers, screw blowers, frequency converters, duct valves, and electric actuators. In this embodiment, a centrifugal blower is preferred as the aeration power equipment because it is suitable for continuous air supply scenarios in large and medium-sized wastewater treatment plants, can achieve air volume adjustment within a wide range, and can be used in conjunction with frequency conversion control to achieve control quantity. Smooth transition to airflow output.
[0053] Furthermore, the error calculation module receives the dissolved oxygen setpoint. and actual test value The dissolved oxygen concentration deviation is calculated according to equations (1) and (2). and the rate of change of deviation ,when When it is lower than the set value, If the value is positive, the controller should increase the aeration rate. When it is higher than the set value, If the value is negative, the controller should reduce the aeration rate; the deviation change rate is... It reflects the trend of error changes and is used to determine whether the system is approaching or moving away from the set value.
[0054] Furthermore, dissolved oxygen setpoint It can be set to a fixed value according to process operation requirements, or it can be dynamically updated according to water quality load, effluent ammonia nitrogen, denitrification requirements, or segmented aeration strategy. In actual wastewater treatment plants, The setting is usually set within a range that meets the needs of aerobic biological treatment and avoids energy waste from over-aeration. This embodiment does not limit the specific setting value.
[0055] Actual aeration systems involve multiple dynamic components, including oxygen transfer, microbial oxygen consumption, blower response, valve opening changes, and sensor detection hysteresis. To facilitate controller design and simulation analysis, this embodiment treats the aeration system as an equivalent first-order inertial object with pure time delay, and its mathematical model can be expressed as follows: ;
[0056] In equation (1), G(s) is the transfer function of the aeration system, Ka is the aeration process gain, Ta is the time constant, τ is the pure time delay of the system, and s is the Laplace transform complex frequency domain variable. This model is used to describe the hysteresis and inertial response of DO concentration after the control quantity changes. In practical applications, Ka, Ta and τ can be identified based on the on-site step test, historical operating data or equipment calibration data.
[0057] As a specific implementation example, in a wastewater treatment plant simulation model, the aeration system model can be set as follows: ;
[0058] In equation (2), the system gain is 15.25, the time constant is 63.69s, and the pure time delay is 10s. This parameter is only one value in the simulation verification of this embodiment, used to illustrate the implementation process of the control method of the present invention, and does not constitute a limitation on the parameters of different sewage treatment plants or different aeration equipment.
[0059] Traditional PID controllers, such as Figure 2 As shown, its control quantity consists of three parts: proportional, integral, and derivative. The control quantity is generated according to equation (7). The proportional element is used to quickly respond to the current deviation, the integral element is used to eliminate steady-state error, and the derivative element is used to suppress overshoot in advance according to the error change trend. The shortcomings of traditional PID control are that... , , Once the settings are completed, they are usually kept fixed. When the influent load, aeration equipment efficiency, or sensor hysteresis changes, it is difficult to maintain optimal control performance with fixed parameters.
[0060] In this embodiment, traditional PID parameters can be used as reference parameters for the fuzzy PID controller. , , The reference parameters can be obtained by engineering trial and error, critical proportionality method, step response method or historical operation data fitting method. In order to ensure the basic stability of the controller during the start-up phase, the reference parameters are first checked for safety before entering the fuzzy self-tuning stage to avoid excessive integral action or excessive derivative action causing frequent action of the actuator.
[0061] Furthermore, the fuzzy PID controller, the fuzzy PID controller as... Figure 3 As shown, it includes six parts: input quantization, fuzzification, fuzzy rule reasoning, defuzzification, proportional factor conversion, and PID parameter update. Its core idea is to transform the operator's experience in adjusting the aeration system into fuzzy rules, and then... and The current status is output in real time to adjust the PID parameters.
[0062] Furthermore, the input variable of the fuzzy PID controller is and The output variable is the standardized PID parameter correction. , , Input quantization factor and These are used to convert the actual deviation and the rate of change of deviation to the fuzzy universe of discourse, respectively, and output the scaling factor. , , These five factors are used to convert the standardized parameter corrections into actual corrections. Together, they determine the response speed, steady-state accuracy, and disturbance rejection capability of the fuzzy PID controller.
[0063] Furthermore, considering the common operating range of DO concentration in wastewater aeration systems, the dissolved oxygen concentration deviation... and rate of change of deviation First, input the quantization factor respectively. and Converted to quantized fuzzy variables and Then, it enters the preset fuzzy domain, which can be determined based on the DO sensor range, sampling period, aeration tank operating data, and control accuracy requirements. As a preferred implementation, the quantized deviation change rate fuzzy variable... The universe of discourse can be set to [-6, 6], and the normalized scaling parameter correction amount is... The output universe of discourse can be set to [-1, 1]. and The standardized output domain can also be set to [-1,1]. Under different sewage treatment plants, different pool types, or different sensor ranges, the above domain range can also be reset according to the actual operating data.
[0064] Furthermore, the fuzzy subset is divided into seven linguistic variables: NB, NM, NS, ZO, PS, PM, and PB, representing negative large, negative medium, negative small, zero, positive small, positive medium, and positive large, respectively. The membership function can be a triangular membership function or a trapezoidal membership function. This embodiment prefers the triangular membership function to balance computational simplicity and resolution control. Figure 5 The fuzzy variable representing the rate of change of the quantified deviation is shown. and standardized proportional parameter correction amount A preferred membership function waveform, wherein, Figure 5 The horizontal axis ec represents the quantity. The simplified diagram, x-axis For standardized proportional parameter correction amount The diagram is a simplified version.
[0065] Furthermore, the fuzzy control rules are formulated based on the following principles: when the error is large and is still increasing, the proportional action should be increased to speed up the response, and the integral action should be appropriately suppressed to avoid overshoot; when the error is small and close to steady state, the integral action should be enhanced to eliminate residual error, while the derivative action should be reduced to reduce noise amplification; when the error changes rapidly, the derivative action should be enhanced to improve system damping and suppress oscillation.
[0066] Furthermore, The fuzzy control rules are used to adjust the proportional gain strength to improve system response speed and suppress overshoot. The input variables involved in fuzzy inference are quantized... and Both are represented using seven language variables: NB, NM, NS, ZO, PS, PM, and PB, according to... The linguistic variables are in the order NB, NM, NS, ZO, PS, PM, PB, when When it is NB, Take PB, PB, PM, PM, PS, PS, ZO in sequence; when When it is NM, Take PB, PB, PM, PM, PS, ZO, ZO in sequence, when When it is NS, Take PM, PM, PM, PS, ZO, NS, NM in sequence; when When it is ZO, Take PM, PS, PS, ZO, NS, NM, NM in sequence, when When using PS, Take PS, PS, ZO, NS, NS, NM, NM in sequence; when When it is PM, Take ZO, ZO, NS, NM, NM, NM, NB in sequence; when When it is PB, By taking ZO, NS, NS, NM, NM, NB, and NB in sequence, the proportional gain is enhanced when the deviation is large and still has a tendency to increase, and the proportional gain is appropriately reduced when the deviation decreases or approaches stability, so as to balance response speed and control stability.
[0067] Furthermore, The fuzzy control rule is used to adjust the intensity of the integral action to eliminate steady-state error and avoid integral saturation. Specifically, according to... The linguistic variables are in the order NB, NM, NS, ZO, PS, PM, PB, when When it is NB, Take NB, NB, NM, NM, NS, ZO, ZO in sequence, when When it is NM, Take NB, NM, NM, NS, NS, ZO, PS in sequence; when When it is NS, Take NM, NM, NS, NS, ZO, PS, PS in sequence, when When it is ZO, Take NM, NS, NS, ZO, PS, PS, PM in sequence, when When using PS, Take NS, NS, ZO, PS, PS, PM, PM in sequence; when When it is PM, Take NS, ZO, PS, PS, PM, PM, PB in sequence; when When it is PB, By taking ZO, ZO, PS, PM, PM, PB, and PB in sequence, the integral action is weakened when the system error is large or changes drastically to reduce the risk of overshoot caused by integral accumulation, and the integral action is strengthened when the error is small and gradually approaches steady state to improve steady-state accuracy.
[0068] Furthermore, The fuzzy control rule is used to adjust the intensity of the differential action to reflect the error change trend and suppress dissolved oxygen concentration fluctuations. Specifically, according to... The linguistic variables are in the order NB, NM, NS, ZO, PS, PM, PB, when When it is NB, Take PS, NS, NB, NB, NB, NM, PS in sequence, when When it is NM, Take PS, NS, NB, NM, NM, NS, ZO in sequence; when When it is NS, Take ZO, NS, NM, NM, NS, NS, ZO in sequence; when When it is ZO, Take ZO, NS, NS, NS, NS, NS, ZO in sequence; when When using PS, Take ZO, ZO, ZO, ZO, ZO, ZO, ZO in sequence; when When it is PM, Take PB, NS, PS, PS, PS, PS, PB in sequence; when When it is PB, By taking PB, PM, PM, PM, PS, PS, and PB in sequence, the derivative adjustment is enhanced when the rate of change of deviation is large, so as to improve the system damping and reduce oscillation. When the system is close to stability or the deviation change is small, the derivative action is appropriately reduced to avoid noise amplification and frequent operation of the actuator.
[0069] Furthermore, the fuzzy inference method adopts the Mamdani inference method, and the defuzzification method adopts the area center method. The Mamdani inference method can intuitively express the experience of sewage aeration control, and the area center method can output continuous and smooth parameter corrections, reducing the adverse effects of sudden changes in control quantities on blowers and valve actuators.
[0070] S2. Design an improved CPSO algorithm and optimize fuzzy PID parameters. In the standard PSO algorithm, each particle represents a set of candidate solutions. The particle updates its velocity and position based on its historical best position and the global best position of the population. For the fuzzy PID controller, the particle position corresponds to the quantization factor and scaling factor to be optimized. The algorithm aims to find the optimal solution for the fitness function. The smallest combination of parameters.
[0071] Furthermore, in the subsequent optimization of S3 parameters, under the separate optimization mode of the input quantization factor, each particle is encoded into a five-dimensional vector according to equation (11). Under the simplified optimization mode, the input quantization factor is set to... and Take the same value Each particle is encoded as a four-dimensional vector according to Equation (12). The simplified optimization mode can reduce the search dimension and improve the algorithm running speed. The separate optimization mode can enable the deviation and the deviation change rate to have independent scaling capabilities, which is suitable for scenarios with higher control precision requirements.
[0072] S21. The population is initialized using Logistic chaotic mapping. Specifically, xij(0) is randomly generated in (0,1), and then a chaotic sequence is generated iteratively according to Equation (8). Subsequently, it is mapped to the search interval of each parameter according to Equation (9). Since the Logistic chaotic sequence has ergodicity, this initialization method can enable the initial particles to cover more search areas, thereby improving the starting quality of global optimization.
[0073] Furthermore, in this embodiment, Take 4, population size The learning factor is set to 50, the maximum number of iterations (max_iter) is set to 100. and A value of 2 can be chosen. The parameter search range can be uniformly set to [0,10], or different upper and lower limits can be set according to the physical meaning of each parameter. For example... , Mainly affects input scaling. , , The main influence is the magnitude of parameter correction, and the feasible range of both can be adjusted based on historical operating data and actuator constraints.
[0074] S22. A nonlinear dynamic inertia weight adjustment strategy is adopted. Specifically, in the initial stage of particle iteration, A larger value allows the particles to retain stronger inertia and expands the search range, which is beneficial in the later stages of iteration. The value gradually decreases as k increases, causing the particle to perform a local fine search around the current favorable region. The random perturbation term in equation (10) This is used to increase the randomness of the search and reduce the possibility that particles cannot escape once they are concentrated near a local optimum.
[0075] Furthermore, when the calculated Exceeding the preset range , When [the signal is], it is subjected to amplitude limiting to make [the signal]... By keeping it within a controllable range, amplitude limiting can prevent particles from going out of bounds or oscillating due to excessive inertial weights, and it can also prevent the algorithm from losing its exploration ability prematurely due to excessively small inertial weights.
[0076] S3. Optimize the parameters of the fuzzy PID controller using the improved CPSO algorithm. Specifically, each particle position corresponds to a set of parameters to be optimized, including the input quantization factor and the output scaling factor. The algorithm aims to minimize the fitness function and, after population initialization, fitness calculation, individual historical best position update, global best position update, velocity update, position update and termination condition judgment, outputs the parameter combination corresponding to the global best position.
[0077] S31. Initialize the population size, maximum number of iterations, problem dimension, and upper and lower bounds of the search space;
[0078] S32, Logistic chaotic initialization of the population;
[0079] S33. Establish the mapping between particle positions and parameters to be optimized;
[0080] S34. Calculate fitness and update individual optimality and global optimality;
[0081] S35, Update inertia weights, particle velocity, and position;
[0082] Determine the termination condition and output the optimal parameters.
[0083] As a specific implementation method, in the simplified optimization mode, the parameter to be optimized is: , , , During the algorithm iteration process, each particle represents a set of candidate parameter combinations. After the candidate parameter combinations are substituted into the fuzzy PID controller, the control error is calculated through simulation or online evaluation, and then the fitness value is obtained. The smaller the fitness value, the smaller the cumulative DO control error under the parameter combination.
[0084] Under the simulation conditions of this embodiment, the improved CPSO algorithm can stabilize within a finite number of iterations and obtain a set of preferred parameter combinations. After adjusting the fuzzy PID controller, the controller outputs a smoother aeration control quantity and maintains good control stability when the DO setpoint changes, external disturbances and system time delay changes. The above simulation parameters are only used to illustrate the implementation of the present invention and do not limit the parameter values in actual engineering applications.
[0085] S4. Input the optimal parameter combination into the fuzzy PID controller to form a closed-loop control. Specifically, input the optimal parameter combination output from the improved CPSO algorithm. , , , , or , , , Write the parameters into the fuzzy PID controller parameter area, and the controller completes input quantization, fuzzy inference, parameter correction and control output according to equations (3) to (7).
[0086] Furthermore, control quantity It can be converted into blower frequency command, blower speed command, or valve opening command. To meet equipment safety constraints, upper and lower limits, rate of change limits, and dead zone handling can be set at the control output terminal to avoid frequent start-stop of the blower or short-cycle reciprocating action of the valve. This safety constraint belongs to the execution layer protection and does not affect the core control logic of the improved CPSO and optimized fuzzy PID parameters of this invention.
[0087] Furthermore, the dissolved oxygen concentration detection module will... Feedback is sent to the error calculation module, which is continuously updated. and The fuzzy PID controller corrects its behavior based on the real-time status. , , Therefore, the control system can adjust the aeration rate according to the actual dissolved oxygen change trend in each sampling cycle, thus achieving closed-loop control.
[0088] To verify the effectiveness of the control method in this embodiment, simulation models of three control strategies—traditional PID, Fuzzy-PID, and CPSO-Fuzzy-PID—can be built using Matlab and Simulink. In the simulation models, traditional PID uses fixed parameters, Fuzzy-PID uses empirically set quantization and proportional factors, and CPSO-Fuzzy-PID uses a combination of factors optimized by an improved CPSO algorithm.
[0089] The first simulation condition is the step response condition, such as... Figure 8 As shown, the step response can reflect the rise time, overshoot, settling time and steady-state error of the control system. In this embodiment, when the DO setpoint changes by a step, the traditional PID is prone to significant overshoot and oscillation. Fuzzy-PID is better than the traditional PID, while the response curve of CPSO-Fuzzy-PID is smoother and the adjustment process is more stable.
[0090] The second simulation condition is the external random disturbance condition, such as... Figure 9 As shown, in actual wastewater treatment plants, influent water quality, water quantity, temperature, and aeration head status can cause random fluctuations in DO concentration. By applying a disturbance signal during the simulation, the disturbance recovery capabilities of different control methods can be compared. CPSO-Fuzzy-PID enhances the matching of parameter correction through optimized quantization and proportional factors, which can reduce the magnitude of deviation from the set value after disturbance and shorten the recovery time.
[0091] The third simulation condition is the condition of detecting changes in lag, such as... Figure 10 As shown, the aeration system suffers from DO sensor detection lag, oxygen diffusion lag, and actuator response lag. When the system lag time increases, the fixed-parameter PID is prone to oscillation. The CPSO-Fuzzy-PID, through the parameter combination obtained by improving CPSO optimization, can maintain better damping characteristics and stability under large lag conditions.
[0092] The fourth simulation condition is the dynamic update condition of the DO setpoint, such as... Figure 11 As shown, the wastewater treatment plant can adjust the DO setpoint according to different operating periods, influent load and effluent index requirements. The CPSO-Fuzzy-PID controller can quickly track the new target value when the setpoint changes in segments and reduce overshoot and oscillation during the setpoint switching process.
[0093] Under the four operating conditions described above, the CPSO-Fuzzy-PID control method exhibits stronger parameter adaptation capabilities compared to traditional PID and empirical Fuzzy-PID. This is because the fuzzy PID controller can correct its behavior in real time based on the error state. , , The improved CPSO algorithm further solves the problem that the quantization factor and the proportional factor depend on empirical settings, making the fuzzy rule output more compatible with the dynamic characteristics of the actual aeration object.
[0094] The method described in this embodiment can also be deployed in the automatic control system of an actual wastewater treatment plant. During deployment, the improved CPSO parameter optimization program can be run by the host computer or edge computing unit, or the optimal parameters can be obtained in the offline simulation stage and then written into the PLC or DCS control system. For sites with high real-time requirements, a periodic offline update method can be adopted; for sites with sufficient computing power, an online rolling optimization method can be adopted.
[0095] When using offline optimization, an aeration system identification model can be established using historical operating data of the wastewater treatment plant. Then, the improved CPSO algorithm can be run to obtain the optimal parameter combination. Finally, the optimal parameters can be input into the fuzzy PID controller for operation. When using online optimization, the fitness value can be calculated and the parameters updated within a set time window, provided that the equipment safety and effluent stability are guaranteed. However, the range of parameter changes should be limited to avoid sudden changes in controller parameters.
[0096] Furthermore, to improve engineering reliability, this embodiment can filter and process outlier values in the DO sensor signal. Short-term spikes, disconnections, or drifts in the sensor may cause abnormal error calculations, thereby affecting the correction of fuzzy PID parameters. Therefore, median filtering, moving average, or upper and lower limit checks can be set before the error calculation module to ensure the accuracy of the input controller. It has a high degree of credibility.
[0097] Furthermore, to reduce aeration energy consumption, this embodiment can add energy consumption-related constraints or penalty terms to the fitness function. For example, based on the ITAE error evaluation, penalty coefficients can be set for the amplitude of control variable changes, blower operating frequency, or valve action frequency, so that the optimization results reduce unnecessary aeration output while ensuring DO control accuracy. This energy consumption constraint is an extended implementation of the present invention.
[0098] Furthermore, this embodiment can be configured with single-tank control or multi-tank collaborative control according to the number of aeration tanks. For single-tank control, each aerobic tank operates independently with a CPSO-Fuzzy-PID controller. For multi-tank collaborative control, the DO deviation of each tank, the duct pressure, and the total air volume of the blower can be used as joint constraints, and the opening degree of each branch valve can be allocated at the execution layer.
[0099] Furthermore, the present invention does not limit the specific hardware implementation method. The dissolved oxygen concentration detection module can use an optical DO probe or an electrochemical DO probe, the aeration actuator can use a variable frequency blower, a regulating valve or a combination of the two, and the improved CPSO algorithm module can be deployed in an industrial computer, a PLC expansion module, an edge controller or a cloud optimization platform.
[0100] Furthermore, this invention does not limit the specific tabular form of the fuzzy control rules, as described above. , , The control rule is an optimal rule. Under different wastewater treatment processes, water quality conditions, aeration equipment and control objectives, the rule can be locally adjusted based on operating experience, and the rule table can also be data-driven corrected based on historical operating data. However, it still belongs to the control method of using improved CPSO to optimize the quantization factor and proportional factor of fuzzy PID.
[0101] Furthermore, this invention does not limit the evaluation time domain length of the improved CPSO algorithm. and sampling period , It can be determined based on the time constant and lag time of the wastewater aeration system. It can be determined based on the DO sensor sampling frequency, PLC scan cycle, and actuator response speed. Typically, The value should not be too large, lest it fail to reflect changes in DO concentration in a timely manner; nor should it be too small, lest the sensor noise affect the rate of change of deviation. This has caused too much impact.
[0102] Furthermore, when the five-dimensional optimization mode of equation (11) is adopted, and It can adapt to different scales of DO deviation and deviation change rate respectively. When the four-dimensional simplified optimization mode of equation (12) is adopted, and Take the same value Using the same quantization factor Both methods can reduce the computational load of the algorithm and achieve the purpose of this invention. In actual engineering, the choice can be made based on the computational resources and control precision requirements.
[0103] Furthermore, during the particle position update process, boundary truncation, random reset, or mirror bounce strategies can be used to handle out-of-bounds particles. Boundary truncation is simple to implement and suitable for engineering control. Random reset can increase population diversity. Mirror bounce can maintain the continuity of particle search. The above boundary handling methods do not change the core structure of the improved CPSO algorithm of this invention.
[0104] Furthermore, the optimal parameters output by the improved CPSO algorithm can be saved as controller parameter files or database records. When the operating conditions of the wastewater treatment plant change significantly, such as seasonal water temperature changes, sludge concentration changes, aeration equipment maintenance, or sensor replacement, parameter optimization can be re-executed to match the controller parameters with the new operating conditions.
[0105] Furthermore, the CPSO-Fuzzy-PID controller in this embodiment can be used in conjunction with existing process control strategies. For example, when the ammonia nitrogen in the effluent is high, the DO setpoint can be appropriately increased. During low-load periods, the DO setpoint can be decreased and the aeration rate reduced. The controller is responsible for tracking the setpoint and suppressing disturbances, while the process strategy is responsible for determining the setpoint, thereby balancing treatment effect and operating energy consumption.
[0106] Furthermore, the closed-loop control method described in this invention can be used for operating conditions such as step changes in dissolved oxygen setpoint, external disturbances, changes in detection lag, and dynamic updates of DO setpoint. For all of these operating conditions, the controller provides real-time feedback. Continuous calculation and Dynamic updates , , and output Adjust the aeration actuator to achieve stable control of DO concentration.
[0107] In summary, this embodiment optimizes the key factors of the fuzzy PID controller by improving the CPSO algorithm, overcoming the problem that traditional PID and empirical fuzzy PID parameter tuning relies on manual experience. It can improve the stability, tracking performance and anti-disturbance ability of dissolved oxygen control in wastewater aeration. The above embodiments are only used to illustrate the technical solution of the present invention and are not intended to limit the scope of protection of the present invention. All equivalent substitutions, improvements or combinations made within the concept and principles of the present invention should fall within the scope of protection of the present invention.
Claims
1. A fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO, characterized in that, The initialization strategy and inertia weight update strategy of the chaotic particle swarm optimization algorithm are improved, and key parameters such as the input quantization factor and output scaling factor of the fuzzy PID controller are optimized. The specific steps are as follows: S1. Construct a closed-loop control system for dissolved oxygen in wastewater aeration. The system includes an error calculation module, a fuzzy PID controller module, an improved CPSO algorithm module, an aeration actuator module, a controlled object module for the aeration system, and a dissolved oxygen concentration detection module. S2. Improve the CPSO algorithm. Specific improvement strategies include: S21. The initial population of particles is generated by using the Logistic chaotic mapping initialization strategy, and the chaotic sequence is mapped to the search space of the parameters to be optimized. S22. A nonlinear dynamic inertia weight adjustment strategy is adopted to improve the particle velocity update process, which enhances the global search capability in the early stage and the local optimization capability in the later stage. S3. The improved CPSO algorithm is used to optimize the input quantization factor and the output scaling factor. The fitness function is used to evaluate the dissolved oxygen control effect under different parameter combinations and obtain the optimal parameter combination. S4. Input the optimal parameter combination into the fuzzy PID controller, output the control quantity to adjust the blower speed or the opening of the air duct valve, and feed back the actual dissolved oxygen concentration to the error calculation module to form a closed-loop control.
2. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 1, characterized in that, In step S1, the dissolved oxygen concentration detection module collects the actual dissolved oxygen concentration value of the aeration tank. The error calculation module will set the dissolved oxygen value. and By comparison, the dissolved oxygen concentration deviation is obtained. and the rate of change of deviation Its mathematical expression is: ; ; In equations (1) and (2), For the sampling period, the and It serves as the input variable for the fuzzy PID controller and is continuously updated by the closed-loop feedback link.
3. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 2, characterized in that, The fuzzy PID controller quantizes the input variables, and Converted into quantized fuzzy variables respectively and Its mathematical expression is: ; ; In equations (3) and (4), and These are the fuzzy variables representing the quantified dissolved oxygen concentration deviation and the deviation change rate, respectively. and These are the input quantization factors, respectively. and Each variable is located within a preset fuzzy domain, which is determined based on the dissolved oxygen sensor range, sampling period, and aeration system operating data. After fuzzification, fuzzy inference, and defuzzification, the quantized variables are output as standardized PID parameter correction values. , , .
4. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 3, characterized in that, The standardized PID parameter correction is converted into the actual PID parameter correction through the output proportional factor, and then superimposed with the PID reference parameters to obtain the final PID control parameters. Its mathematical expression is: , , ; , , ; In equations (5) and (6), , , To output the scaling factor, , , For PID baseline parameters, , , The final PID control parameters are obtained by superimposing the actual PID parameter corrections. , , These are the actual proportional parameter correction, actual integral parameter correction, and actual differential parameter correction after conversion by the output proportional factor, respectively.
5. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 4, characterized in that, The fuzzy PID controller generates the aeration control quantity based on the final PID control parameters. Its mathematical expression is: ; In equation (7), The control quantity output to the aeration actuator is based on... Adjust the blower speed or the opening of the duct valve.
6. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 5, characterized in that, In S2, a Logistic chaotic mapping initialization strategy is used to generate the initial particle population, and for the first... The particle and the first dimensional chaotic variables The process involves iteration, mapping the chaotic variables to the search space of the parameters to be optimized. The mathematical expression for this is: ; ; In equations (8) and (9), This is the Logistic control parameter with a value of 4. and The first The lower and upper limits of the search for each parameter to be optimized. For the first The first particle The actual parameter value of the dimension.
7. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 6, characterized in that, In step S2, a nonlinear dynamic inertia weight adjustment strategy is used to improve the particle velocity update process, and the inertia weight... The mathematical expression is: ; In equation (10), This represents the current iteration number. The maximum number of iterations, and These are the minimum and maximum values of the inertia weight, respectively. It is a non-linear adjustment factor and >1, For a random disturbance term with a mean of 0, Let be the disturbance intensity coefficient; when When the value exceeds the range, a limit is applied.
8. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO according to claim 7, characterized in that, In step S3, the input quantization factor and output scaling factor of the fuzzy PID controller are tuned using the improved CPSO algorithm, specifically including: S31. Initialize the population size, maximum number of iterations, problem dimension, and upper and lower bounds of the search space; S32. Initialize the population based on the Logistic chaotic mapping; S33. Establish the mapping relationship between particle position and fuzzy PID optimization parameters; S34. Calculate the fitness value of each individual in the population, and update the historical best position and the current global best position of each individual; S35. Update particle velocity and position based on inertia weights; S36. Determine if the current iteration count has reached the maximum iteration count. If not, return to S34. If it has, output the parameter combination corresponding to the globally optimal position.
9. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 8, characterized in that, In step S33, each particle position vector corresponds to a set of fuzzy PID parameters to be optimized, and its mathematical expression is: ; In the simplified optimization mode, input the quantization factor. and Take the same value The mathematical expression for the particle position vector is: ; ; In equations (12) and (13), the population size =50, maximum number of iterations max_iter=100, upper and lower bounds of parameter search space are... = .
10. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO according to claim 9, characterized in that, In S34, the fitness function uses the finite-time ITAE criterion to evaluate the dissolved oxygen control effect under different parameter combinations. The continuous and discrete mathematical expressions are as follows: ; ; In equations (14) and (15), To control the evaluation time, The sampling period is To evaluate the number of sampling points in the time domain, The smaller the value, the smaller the cumulative control error of the corresponding parameter combination.
11. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO according to claim 10, characterized in that, In S35, the mathematical expressions for particle velocity update and position update are as follows: ; ; In equations (16) and (17), For the first The first particle The speed of the next iteration For the first The first particle The position of the next iteration. For the individual's historical best position, The optimal position for the entire population. and As a learning factor, and for Random numbers within an interval.
12. The fuzzy PID optimization control method for dissolved oxygen in wastewater aeration based on improved CPSO as described in claim 11, characterized in that, The closed-loop control method is applicable to conditions such as step changes in dissolved oxygen setpoint, external disturbances, changes due to detection lag, and dynamic updates of dissolved oxygen setpoint. The aeration actuator includes a blower speed adjustment mechanism or a duct valve opening adjustment mechanism, and is continuously corrected through closed-loop feedback. This is to achieve stable control of dissolved oxygen concentration during wastewater aeration.
Citation Information
Patent Citations
Method and system for wastewater treatment of dissolved oxygen control based on fuzzy neural network
CN102122134A
Urban sewage treatment process optimization control method based on dynamic multi-objective particle swarm optimization algorithm
CN110161995A
