A PID variable frequency turbidity control method based on a neural network, a terminal and a storage medium

By constructing a three-layer backpropagation neural network and a PID variable frequency turbidity control method based on inverter frequency regulation, the problem of fixed parameters in traditional PID controllers is solved, achieving high-precision and stable turbidity control, reducing energy consumption and extending equipment life.

CN120595591BActive Publication Date: 2026-04-17JINAN BLUE OCEAN ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN BLUE OCEAN ENVIRONMENTAL PROTECTION TECH CO LTD
Filing Date
2025-06-04
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

The parameters Kp, Ki, and Kd of traditional PID controllers need to be manually tuned and cannot adapt to dynamic changes in water quality or changes in system characteristics caused by equipment aging, resulting in a decrease in the accuracy and stability of turbidity control.

Method used

A neural network-based PID variable frequency turbidity control method is adopted. The turbidity sensor collects signals in real time, constructs a three-layer backpropagation neural network, dynamically generates proportional gain parameters, integral time parameters, and derivative time parameters, and combines them with the frequency adjustment of the frequency converter to achieve dynamic control.

Benefits of technology

It improves the accuracy and stability of turbidity control, reduces control overshoot and steady-state error, lowers energy consumption and extends equipment life, and enhances system robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120595591B_ABST
    Figure CN120595591B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of industrial automation control technology, specifically relating to a PID variable frequency turbidity control method, terminal, and storage medium based on a neural network. The method includes: real-time acquisition of liquid turbidity signals via a turbidity sensor and data preprocessing; calculation of the current liquid turbidity error based on the preprocessed liquid turbidity signal and a preset turbidity threshold, and calculus and integration of the calculated liquid turbidity error; construction of a three-layer backpropagation neural network, using the liquid turbidity error, the integral of the liquid turbidity error, and the derivative of the liquid turbidity error as inputs, dynamically generating a proportional gain parameter, an integral time parameter, and a derivative time parameter; and dynamic generation of the proportional gain parameter K by constructing a three-layer backpropagation neural network with the liquid turbidity error, the integral of the liquid turbidity error, and the derivative of the liquid turbidity error as inputs. p Integration time parameter K i and differential time parameter K d This significantly improves the accuracy and stability of turbidity control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial automation control technology, specifically relating to a PID variable frequency turbidity control method, terminal, and storage medium based on neural networks. Background Technology

[0002] In the field of industrial automation control, especially in scenarios requiring high-precision real-time control of liquid turbidity such as water treatment, chemical production, and food processing, turbidity control is a crucial step. Traditional turbidity control methods mainly rely on fixed-parameter PID controllers. These controllers adjust the control output by combining three parameters—proportional (P), integral (I), and derivative (D)—to maintain turbidity near the setpoint. However, traditional PID control has significant limitations.

[0003] The parameter K of a traditional PID controller p K i K d Typically, manual tuning is required, and once set, the parameters remain unchanged, failing to adapt to dynamic changes in water quality or system characteristic changes caused by equipment aging. This parameter fixation problem is particularly prominent in cases of sudden changes in raw water turbidity or mechanical wear of the dosing pump, easily leading to control overshoot or increased steady-state error, affecting the accuracy and stability of turbidity control. Summary of the Invention

[0004] Existing technologies often rely on traditional turbidity control methods that depend primarily on fixed-parameter PID controllers, where the parameter K of the PID controller... p K i K d Typically, manual tuning is required, and once set, it remains unchanged, making it unable to adapt to changes in system characteristics caused by dynamic changes in water quality or equipment aging. This can easily lead to control overshoot or increased steady-state error, affecting the accuracy and stability of turbidity control. This invention provides a PID variable frequency turbidity control method, terminal, and storage medium based on neural networks to solve the above-mentioned technical problems.

[0005] In a first aspect, the present invention provides a PID variable frequency turbidity control method based on a neural network, comprising:

[0006] The liquid turbidity signal is collected in real time by a turbidity sensor and the data is preprocessed.

[0007] The liquid turbidity error at the current moment is calculated based on the preprocessed liquid turbidity signal and the preset turbidity threshold, and the calculated liquid turbidity error is then calculated.

[0008] A three-layer backpropagation neural network is constructed, which takes liquid turbidity error, liquid turbidity error integral and liquid turbidity error derivative as inputs, and dynamically generates proportional gain parameters, integral time parameters and derivative time parameters.

[0009] Input the proportional gain parameter, integral time parameter, and derivative time parameter of the generated PID controller into the PID controller to obtain the inverter control quantity;

[0010] The control quantity output by the PID controller is converted into the frequency command of the frequency converter, and the high-frequency regulation mode and low-frequency energy-saving mode are switched according to the turbidity error amplitude.

[0011] The system monitors the parameters of the PID controller output by the neural network in real time. When the parameters exceed the preset range, the system switches the parameters input to the PID controller to the preset PID parameter library and limits the operating frequency range of the frequency converter.

[0012] Further improvements to this technical solution include the use of an online turbidity meter, model MIK-PTU100, with a measurement range of 0.01 NTU to 4000 NTU and a sampling period of ≤1 second. The collected liquid turbidity information is converted into digital values ​​by an analog-to-digital converter module, model 6ES7 234-4HE32-0XB0.

[0013] A further improvement to this technical solution is that the liquid turbidity error at the current moment is calculated based on the preprocessed liquid turbidity signal and a preset turbidity threshold, and the calculated liquid turbidity error is then calculated. The method includes:

[0014] Liquid turbidity error The calculation formula is:

[0015] ;

[0016] in, This is the preset turbidity threshold; This refers to the real-time acquisition of liquid turbidity signals;

[0017] The calculated liquid turbidity error The formula for integration is: ,in, The sampling time interval;

[0018] The calculated liquid turbidity error The formula for differentiation is: .

[0019] Further improvements to this technical solution include constructing a three-layer backpropagation neural network, using liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs to dynamically generate the proportional gain parameter, integral time parameter, and derivative time parameter of the PID controller. The method includes:

[0020] The input layer of the three-layer backpropagation neural network includes three nodes, which correspond to the liquid turbidity error, the liquid turbidity error integral, and the liquid turbidity error differential, respectively; and the liquid turbidity error, liquid turbidity error integral, and liquid turbidity error differential input to the input layer of the three-layer backpropagation neural network are normalized to the interval [-1, 1].

[0021] The hidden layer of a three-layer backpropagation neural network contains 5 nodes, and its activation function is: Its paranoia value is fixed at 0.5;

[0022] The output layer of the three-layer backpropagation neural network linearly outputs the proportional gain parameter of the PID controller. Integration time parameters and differential time parameters .

[0023] Further improvements to this technical solution include the following training methods for the three-layer backpropagation neural network:

[0024] The loss function for a three-layer backpropagation neural network is: ;

[0025] Weight matrix of a three-layer backpropagation neural network The update formula is: , For learning rate, The error gradient of the hidden layer nodes. This is the input signal.

[0026] A further improvement to this technical solution involves inputting the generated proportional gain parameters, integral time parameters, and derivative time parameters of the PID controller into the PID controller to obtain the inverter control quantity. The method includes:

[0027] Inverter control quantity The calculation formula is: .

[0028] Further improvements to this technical solution include converting the control quantity output by the PID controller into a frequency command for the frequency converter, and switching between high-frequency regulation mode and low-frequency energy-saving mode based on the turbidity error amplitude. The method includes:

[0029] when At that time, the frequency converter is forced to operate at a high frequency of 45Hz;

[0030] when At that time, the inverter output frequency follows a linear relationship Adjustments will be made.

[0031] Further improvements to this technical solution include real-time monitoring of the PID controller parameters output by the neural network. When a parameter exceeds a preset range, the parameters input to the PID controller are switched to a preset PID parameter library, while simultaneously limiting the inverter's operating frequency range. The method includes:

[0032] Real-time monitoring of the proportional gain parameter of the neural network output Integration time parameters and differential time parameters And when detected , or When this occurs, the parameter switching mechanism is triggered;

[0033] Switch to the preset parameter set in the preset PID parameter library that best matches the current operating conditions. The critical gain of the preset parameter set is determined through step response experiments. and critical period Generate; where, , , The synchronous limiter output frequency range is 10Hz to 50Hz.

[0034] In a second aspect, the present invention provides a terminal, comprising:

[0035] Processor, memory, among which,

[0036] This memory is used to store computer programs.

[0037] The processor is used to retrieve and run the computer program from memory, causing the terminal to perform the terminal method described above.

[0038] Thirdly, the present invention provides a computer storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described in the above aspects.

[0039] The beneficial effects of this invention are as follows:

[0040] This invention constructs a three-layer backpropagation neural network, using liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs, to dynamically generate the proportional gain parameter K. p Integration time parameter K i and differential time parameter K dThis method avoids the problem of fixed parameters in traditional PID controllers, enabling the controller to adapt in real time to changes in system characteristics caused by dynamic changes in water quality or equipment aging. In cases of sudden changes in raw water turbidity or mechanical wear of the dosing pump, this invention can effectively reduce control overshoot or steady-state error, significantly improving the accuracy and stability of turbidity control.

[0041] Traditional frequency converters used in turbidity control often employ open-loop speed regulation strategies, leading to increased energy consumption and accelerated equipment wear. This invention converts the control output of the PID controller into frequency commands for the frequency converter and switches between high-frequency regulation mode and low-frequency energy-saving mode based on the turbidity error amplitude, achieving dynamic speed regulation of the frequency converter. This strategy enables the frequency converter to dynamically adjust its frequency according to actual operating conditions, avoiding prolonged full-load operation, thereby reducing energy consumption and extending equipment lifespan.

[0042] This invention monitors the parameters of the PID controller output by the neural network in real time. When a parameter exceeds a preset range, the parameters input to the PID controller are switched to a preset PID parameter library, and the operating frequency range of the frequency converter is limited. This safety protection mechanism enhances the robustness of the system. Even when faced with disturbances such as sudden fluctuations in water quality, the system can quickly adjust its control strategy to prevent control instability and ensure production safety and quality. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic flowchart illustrating a method according to an embodiment of the present invention.

[0045] Figure 2 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation

[0046] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the specific embodiments. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0048] The PID variable frequency turbidity control method based on neural networks provided in this embodiment of the invention is executed by a computer device. Figure 1 This is a schematic flowchart illustrating a method according to an embodiment of the present invention. The order of the steps in this flowchart may be changed, and some steps may be omitted, depending on different requirements.

[0049] like Figure 1 As shown, the method includes:

[0050] Step 110: Real-time acquisition of liquid turbidity signals using a turbidity sensor and data preprocessing;

[0051] Step 120: Calculate the liquid turbidity error at the current moment based on the preprocessed liquid turbidity signal and the preset turbidity threshold, and perform calculus on the calculated liquid turbidity error;

[0052] Step 130: Construct a three-layer backpropagation neural network, using liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs, to dynamically generate proportional gain parameters, integral time parameters, and derivative time parameters;

[0053] Step 140: Input the generated proportional gain parameters, integral time parameters, and derivative time parameters of the PID controller into the PID controller to obtain the inverter control quantity;

[0054] Step 150: Convert the control quantity output by the PID controller into the frequency command of the inverter, and switch between high-frequency regulation mode and low-frequency energy-saving mode according to the turbidity error amplitude.

[0055] Step 160: Monitor the corresponding parameters of the PID controller output by the neural network in real time. When the parameters are detected to exceed the preset range, switch the parameters input to the PID controller to the preset PID parameter library, and limit the operating frequency range of the frequency converter.

[0056] To facilitate understanding of the present invention, the following description further illustrates the neural network-based PID variable frequency turbidity control method provided by the present invention, using the principle of the neural network-based PID variable frequency turbidity control method of the present invention and the process of performing PID variable frequency control on a frequency converter that controls liquid turbidity based on a neural network in the embodiments.

[0057] Specifically, the turbidity sensor used is an online turbidity meter, model MIK-PTU100, with a measurement range of 0.01 NTU (Nephelometric Turbidity Unit) to 4000 NTU and a sampling period of ≤1 second. The MIK-PTU100 turbidity meter is installed at the inlet of the sedimentation tank, ensuring that the sensor probe is completely immersed in the liquid to avoid interference from air bubbles and impurities. The output signal of the turbidity meter is configured as a 4-20mA current signal to ensure compatibility with the subsequent analog-to-digital converter module. An analog-to-digital converter module, model 6ES7 234-4HE32-0XB0, is used to convert the 4-20mA current signal output by the turbidity meter into a digital signal.

[0058] The acquired digital turbidity signal is filtered to eliminate noise interference. For example, a moving average filtering algorithm is used to average the turbidity values ​​of multiple consecutive sampling points to obtain a smoothed turbidity value. The filtered turbidity data is then normalized to the range [-1, 1] required by the neural network input layer. Specifically, this can be done by subtracting the minimum measured value from the turbidity value, dividing by the measurement range (maximum value - minimum value), multiplying by 2, and then subtracting 1.

[0059] The MIK-PTU100 turbidity meter of this invention features a wide measurement range (0.01 NTU to 4000 NTU) and high accuracy (±2%), accurately reflecting subtle changes in liquid turbidity and providing a reliable data foundation for turbidity control. The turbidity meter's sampling period is ≤1 second, ensuring real-time data transmission. This high-frequency sampling capability enables the system to respond quickly to turbidity changes, providing timely data support for subsequent PID parameter optimization and inverter speed control. Filtering effectively eliminates noise interference in the turbidity signal, improving data stability and reliability. Normalization transforms the turbidity data into the range required by the neural network input layer, facilitating subsequent processing.

[0060] Furthermore, the liquid turbidity error at the current moment is calculated based on the preprocessed liquid turbidity signal and a preset turbidity threshold, and the calculated liquid turbidity error is then calculated and integrated. The method includes:

[0061] Liquid turbidity error The calculation formula is:

[0062] ;

[0063] in, This is the preset turbidity threshold; The liquid turbidity signal acquired in real time (preprocessed liquid turbidity signal);

[0064] The calculated liquid turbidity error The formula for integration is: ,in, The sampling time interval;

[0065] The calculated liquid turbidity error The formula for differentiation is: .

[0066] Based on the production process requirements and actual water quality conditions, a reasonable turbidity threshold T is preset. set This threshold serves as the target value for turbidity control and is used to calculate the turbidity error at the current moment. For example, in water treatment, the turbidity threshold can be set to 5 NTU to ensure that the effluent quality meets the standards.

[0067] use The formula calculates the liquid turbidity error at the current moment. For example, if the turbidity value at the current moment is 3 NTU and the preset turbidity threshold is 5 NTU, then the turbidity error e(t) = 5 - 3 = 2 NTU.

[0068] Use formula The integral of liquid turbidity error is calculated, reflecting the cumulative effect of turbidity error over time. In practical applications, numerical integration methods (such as the trapezoidal rule or Simpson's rule) can be used to approximate the integral of liquid turbidity error. For example, if the sampling period is 1 second, the liquid turbidity error at the current moment is 2 NTU, and the liquid turbidity error at the previous moment was 1 NTU, then the increment of the liquid turbidity error integral is (2 + 1) / 2*1 = 1.5 NTU·s.

[0069] Use formula Calculate the differential of liquid turbidity error, where e(t-1) is the liquid turbidity error at the previous moment. The differential of liquid turbidity error reflects the rate of change of liquid turbidity error, which helps the controller respond quickly to changes in liquid turbidity. For example, if the liquid turbidity error at the current moment is 2 NTU and the liquid turbidity error at the previous moment was 1 NTU, then the differential of liquid turbidity error Δe(t) = 2 - 1 = 1 NTU / s.

[0070] The calculated turbidity error e(t), error integral ∫e(t)dt, and error derivative Δe(t) are used as inputs and transmitted to a three-layer backpropagation neural network for further processing.

[0071] This invention, by calculating liquid turbidity error in real time and performing calculus processing, enables the system to more accurately reflect the difference between the current turbidity state and the target value, as well as the trend of this difference over time. This helps the neural network dynamically adjust PID parameters, making the control output more precise and thus significantly improving the accuracy of turbidity control. The introduction of the differential of liquid turbidity error allows the system to respond quickly to changes in turbidity. When liquid turbidity changes abruptly, the error differential can quickly reflect this change, prompting the neural network to adjust PID parameters in a timely manner, accelerating the control response speed, and reducing overshoot and settling time. The calculation of the integral of liquid turbidity error helps the system better predict and adjust the control output, reducing steady-state error. By comprehensively considering the current liquid turbidity error, the historical accumulation of liquid turbidity error, and the rate of change of liquid turbidity error, the neural network can generate more reasonable PID parameters, optimizing control performance. In situations of dynamic changes in water quality, such as sudden changes in raw water turbidity or mechanical wear of the dosing pump, traditional PID control methods often struggle to adapt. However, this invention, by calculating liquid turbidity error in real time and performing calculus processing, combined with the dynamic adjustment capability of the neural network, enables the system to quickly adapt to changes in water quality and maintain stable turbidity control.

[0072] In addition, a three-layer backpropagation neural network is constructed, using liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs, to dynamically generate the proportional gain parameter, integral time parameter, and derivative time parameter of the PID controller. The method includes:

[0073] S131. The input layer of the three-layer backpropagation neural network includes three nodes, which correspond to the liquid turbidity error, the liquid turbidity error integral, and the liquid turbidity error differential, respectively; and the liquid turbidity error, the liquid turbidity error integral, and the liquid turbidity error differential input to the input layer of the three-layer backpropagation neural network are normalized to the interval [-1, 1].

[0074] S132. The hidden layer of the three-layer backpropagation neural network contains 5 nodes, and its activation function is: Its paranoia value is fixed at 0.5;

[0075] S133, The output layer of the three-layer backpropagation neural network linearly outputs the proportional gain parameter of the PID controller. Integration time parameters and differential time parameters .

[0076] The three-layer backpropagation neural network structure is as follows: The input layer contains three nodes, corresponding to the liquid turbidity error e(t), the liquid turbidity error integral ∫e(t)dt, and the liquid turbidity error derivative Δe(t), respectively. These three input quantities can comprehensively reflect the current state of the turbidity control system, providing sufficient information for the neural network to dynamically adjust the PID parameters. Before entering the neural network, the input signals need to be normalized to the range [-1, 1] to accelerate network training and improve convergence speed. The hidden layer contains five nodes. The number of nodes in this layer was determined through multiple experiments and verifications to ensure network performance while avoiding overfitting. The activation function is the Sigmoid function, whose expression is: The Sigmoid function has excellent nonlinear mapping capabilities, capable of mapping input signals to the (0,1) interval, which helps neural networks learn complex nonlinear relationships. The bias term is fixed at 0.5 to simplify the network structure and reduce training parameters. The output layer contains three nodes, each corresponding to the proportional gain parameter K of the PID controller. p Integration time parameter K i and differential time parameter K d The output layer uses a linear activation function to directly output the PID parameter values ​​without further processing.

[0077] Furthermore, the training methods for a three-layer backpropagation neural network include:

[0078] The loss function for a three-layer backpropagation neural network is: ;

[0079] Weight matrix of a three-layer backpropagation neural network The update formula is: , For learning rate, The error gradient of the hidden layer nodes. This is the input signal.

[0080] The backpropagation algorithm (BP algorithm) is used for network training, and the network weights are updated by minimizing a loss function (such as mean squared error, MSE). The loss function is defined as the mean squared error between the predicted PID parameters and the actual PID parameters, i.e. , where N is the number of samples.

[0081] weight matrix The structural parameters and weight matrix of a three-layer backpropagation neural network The weight matrix represents the connection weights between the i-th node in the input layer and the j-th node in the hidden layer. Initialize the values ​​to random values ​​within the range [-0.5, 0.5]. Update the weight matrix using the backpropagation algorithm. Real-time minimization of the squared error loss function This outputs the optimal PID parameters. , , The neural network is based on real-time turbidity error signals. By utilizing the weight matrix update mechanism, it dynamically adapts to changes in water quality (such as sudden changes in influent turbidity) and improves control robustness.

[0082] The parameters (K) of the conventional PID controller of this invention p K i K d Turbidity control systems are typically fixed and struggle to adapt to dynamic changes in water quality and equipment aging. By constructing a three-layer backpropagation neural network, the system can dynamically adjust PID parameters in real time based on the current turbidity error, error integral, and error derivative, resulting in more precise control. The neural network learns from historical data and real-time inputs, capturing complex nonlinear relationships in the turbidity control system, thereby generating more suitable PID parameters, reducing overshoot and steady-state error, and improving control accuracy. Dynamically adjusting PID parameters helps to better cope with external disturbances and internal changes, such as sudden changes in influent turbidity and mechanical wear of the dosing pump, thus maintaining stable turbidity control. By monitoring and adjusting PID parameters in real time, the system can promptly correct control deviations, preventing control failure or oscillations and improving system stability.

[0083] Neural networks possess powerful learning and adaptive capabilities, automatically adjusting PID parameters based on water quality changes to maintain optimal system control. In the event of sudden water quality changes, the neural network can quickly learn new water quality characteristics and generate corresponding PID parameters, ensuring that turbidity control remains unaffected. By dynamically adjusting PID parameters, the system can better cope with uncertainties such as equipment aging and sensor drift, maintaining stable control performance. Based on real-time turbidity error signals and utilizing a weight matrix update mechanism, the neural network can adapt to water quality changes in real time, improving system robustness and anti-interference capabilities. Furthermore, traditional PID controllers require manual parameter tuning, a cumbersome and error-prone process. By constructing a three-layer backpropagation neural network, the system can automatically adjust PID parameters, reducing manual intervention and maintenance costs. The neural network can continuously learn and optimize, eliminating the need for frequent manual adjustments and improving the system's automation level and operational efficiency.

[0084] Furthermore, the proportional gain parameters, integral time parameters, and derivative time parameters of the generated PID controller are input into the PID controller to obtain the inverter control quantity. The methods include:

[0085] Inverter control quantity The calculation formula is: .

[0086] Using the real-time acquired liquid turbidity error e(t), liquid turbidity error integral ∫e(t)dt, and liquid turbidity error derivative Δe(t) as inputs, a three-layer backpropagation neural network dynamically generates the proportional gain parameter K of the PID controller. p Integration time parameter K i and differential time parameter K d Neural networks learn from historical data and real-time inputs to capture complex nonlinear relationships in turbidity control systems, thereby generating optimal PID parameter combinations. The K generated by the neural network... p K i K d The parameters are input to the PID controller in real time. Based on these parameters and the current turbidity error signal, the PID controller calculates the control output: The calculated inverter control quantity u(t) is input into the inverter to adjust the speed of the water pump or agitator, thereby changing the dosage or mixing intensity and achieving precise control of liquid turbidity. Turbidity changes are monitored in real time, and PID parameters and inverter control quantities are dynamically adjusted based on feedback signals to form a closed-loop control system, ensuring that the turbidity remains within the set range.

[0087] The dynamically generated PID parameters of this invention can better adapt to changes in water quality, enabling the PID controller to more precisely adjust the inverter's control input, thereby achieving accurate control of liquid turbidity. Through a closed-loop control system, control deviations can be corrected in real time, reducing overshoot and steady-state error, and improving control accuracy. Dynamic PID parameter adjustment helps the system better cope with external disturbances and internal changes, such as sudden changes in influent turbidity and equipment aging, maintaining stable turbidity control. Real-time monitoring and adjustment can promptly detect and address potential control problems, preventing system malfunctions or oscillations.

[0088] Furthermore, the control quantity output by the PID controller is converted into a frequency command for the frequency converter, and the high-frequency regulation mode and low-frequency energy-saving mode are switched according to the turbidity error amplitude. The method includes:

[0089] when At that time, the frequency converter is forced to operate at a high frequency of 45Hz;

[0090] when At that time, the inverter output frequency follows a linear relationship Adjustments will be made.

[0091] Add a conditional statement to the output logic of the PID controller. When a condition is detected... At this time, a high-frequency command (such as 45Hz) is directly output to the frequency converter. After receiving the command, the frequency converter immediately adjusts the output frequency to 45Hz, driving the water pump or agitator to run at high speed and quickly correct the turbidity deviation.

[0092] Based on actual production needs and equipment characteristics, a linear relationship is established, such as... Where f(t) is the output frequency of the frequency converter. In the output logic of the PID controller, when the frequency is detected... At that time, the inverter output frequency is calculated according to the above linear relationship, and the frequency command is sent to the inverter. After receiving the command, the inverter adjusts the output frequency to the calculated value, driving the water pump or agitator to run at the corresponding speed, thus achieving low-frequency energy saving.

[0093] This invention utilizes a high-frequency regulation mode, enabling the system to respond quickly to sudden changes in water quality, reducing turbidity deviation time, and improving production efficiency. Dynamically adjusting PID parameters and inverter frequency allows the system to better adapt to water quality variations and maintain stable turbidity control. The introduction of a low-frequency energy-saving mode effectively reduces the energy consumption of the inverter and water pump or agitator, lowering operating costs. By reducing high-frequency operating time, equipment wear and failure rates are reduced, extending equipment lifespan.

[0094] Subsequently, the parameters corresponding to the PID controller output by the neural network are monitored in real time. When a parameter is detected to exceed a preset range, the parameters input to the PID controller are switched to a preset PID parameter library, and the operating frequency range of the inverter is limited. The method includes:

[0095] Real-time monitoring of the proportional gain parameter of the neural network output Integration time parameters and differential time parameters And when detected , or When this occurs, the parameter switching mechanism is triggered;

[0096] Switch to the preset parameter set in the preset PID parameter library that best matches the current operating conditions. The critical gain of the preset parameter set is determined through step response experiments. and critical period Generate; where, , , The synchronous limiter output frequency range is 10Hz to 50Hz.

[0097] The critical gain and critical period of the system under different operating conditions were determined through step response experiments, providing a basis for the construction of a preset PID parameter library. First, the integral and derivative components were disconnected, i.e., the integral time constant was set. Zero, differential time parameter The value is zero, putting the system in a pure proportional control state. From Initially, gradually increase the proportional gain by 0.1 each time, observing the system response. Generate a step signal by temporarily adjusting the setpoint, for example, a sudden increase from 30 NTU to 35 NTU, simulating a sudden change in actual operating conditions. Record the fluctuation curve of the actual turbidity value until the system exhibits constant-amplitude oscillations, i.e., the amplitude no longer increases or decreases, indicating stable oscillation. When the system first exhibits constant-amplitude oscillations, the proportional gain parameter at this point... This is the critical gain. For example, if When the turbidity oscillates at a constant amplitude between 32 NTU and 38 NTU, then The time interval between two adjacent peaks (or troughs) in the oscillation curve is called the time interval. For example, if the first peak occurs at 100 seconds and the next peak occurs at 160 seconds, then... To build a comprehensive library of preset PID parameters, the above step response experiment needs to be repeated under different operating conditions to obtain the critical gain under each condition. and critical period The operating conditions can be divided based on key parameters in the actual production process, such as turbidity setpoint, flow rate, and temperature.

[0098] Critical gain determined by step response experiment and critical period The Ziegler-Nichols tuning formula is used to generate PID parameter sets for different operating conditions. The formula is as follows: , , The generated PID parameter set is applied to the actual control system, and the control effect of the system is observed and recorded. Evaluation indicators include response time, overshoot, and steady-state error. Based on the evaluation results, the parameter set is fine-tuned. Through multiple iterations and optimizations, a final preset PID parameter library is formed to ensure good control performance under different operating conditions.

[0099] The preset PID parameter library of this invention was determined through step response experiments and can adapt to control requirements under different operating conditions. In practical applications, after switching to the preset parameter group, the control accuracy of the system is improved, and control indicators such as turbidity can be maintained more stably near the set value. By limiting the output frequency range of the frequency converter, high-load operation of equipment due to frequency anomalies is avoided, effectively reducing energy consumption.

[0100] Figure 2 This is a schematic diagram of the structure of a terminal 200 provided in an embodiment of the present invention. The terminal 200 can be used to execute the PID variable frequency turbidity control method based on neural network provided in an embodiment of the present invention.

[0101] The terminal 200 may include a processor 210, a memory 220, and a communication module 230. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0102] The memory 220 can be used to store the execution instructions of the processor 210. The memory 220 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 220 are executed by the processor 210, the terminal 200 is able to perform some or all of the steps in the above method embodiments.

[0103] The processor 210 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 220, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 210 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.

[0104] The communication module 230 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It receives user data sent by other terminals or sends user data to other terminals.

[0105] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps provided in the embodiments of the present invention. The storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0106] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0107] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.

[0108] Although the present invention has been described in detail with reference to the accompanying drawings and preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made to the embodiments of the present invention by those skilled in the art without departing from the spirit and essence of the invention, and such modifications or substitutions should all be within the scope of the present invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should also be covered within the protection scope of the present invention.

Claims

1. A PID variable frequency turbidity control method based on a neural network, characterized in that, include: The liquid turbidity signal is collected in real time by a turbidity sensor and the data is preprocessed. The liquid turbidity error at the current time is calculated according to the pretreated liquid turbidity signal and a preset turbidity threshold, and the calculated liquid turbidity error is differentiated; wherein, the differentiation of the calculated liquid turbidity error comprises: The formula for integration is: , wherein, is a sampling time interval; the calculated liquid turbidity error The formula for differentiation is: ; A three-layer backpropagation neural network is constructed, taking liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs, and dynamically generating proportional gain parameters, integral time parameters, and derivative time parameters. Input the proportional gain parameter, integral time parameter, and derivative time parameter of the generated PID controller into the PID controller to obtain the inverter control quantity; The control quantity output by the PID controller is converted into the frequency command of the frequency converter, and the high-frequency regulation mode and low-frequency energy-saving mode are switched according to the turbidity error amplitude. The system monitors the corresponding parameters of the PID controller output by the neural network in real time. When the parameters exceed the preset range, the system switches the parameters input to the PID controller to the preset PID parameter library and limits the operating frequency range of the frequency converter. The method for converting the control output of the PID controller into a frequency command for the frequency converter, and switching between high-frequency regulation mode and low-frequency energy-saving mode based on the turbidity error amplitude, includes: When the frequency converter is forced to run at a high frequency of 45 Hz; When the frequency of the inverter output is adjusted in a linear relationship ; The system monitors the PID controller parameters output by the neural network in real time. When a parameter exceeds a preset range, the system switches the input parameters to the PID controller to a preset PID parameter library, including: Real-time monitoring of proportional gain parameters of neural network outputs , integral time parameters , and derivative time parameters , and triggering a parameter switching mechanism upon detection of , or ​ Switch to the preset parameter group in the preset PID parameter library that best matches the current operating conditions. 2.The neural network-based PID variable frequency turbidity control method according to claim 1, wherein, The turbidity sensor uses an online turbidity meter of model MIK-PTU100, with a measurement range of 0.01 NTU to 4000 NTU and a sampling period of ≤1 second. The collected liquid turbidity information is converted into digital quantity by an analog-to-digital converter module of model 6ES7234-4HE32-0XB0.

3. The PID variable frequency turbidity control method based on neural networks according to claim 1, characterized in that, The method for calculating the liquid turbidity error at the current moment based on the preprocessed liquid turbidity signal and the preset turbidity threshold includes: Liquid turbidity error The calculation formula is: ; in, This is the preset turbidity threshold; This refers to the liquid turbidity signal acquired in real time.

4. The PID variable frequency turbidity control method based on neural networks according to claim 3, characterized in that, A three-layer backpropagation neural network is constructed, using liquid turbidity error, liquid turbidity error integral, and liquid turbidity error derivative as inputs, to dynamically generate the proportional gain parameter, integral time parameter, and derivative time parameter of the PID controller. The method includes: The input layer of the three-layer backpropagation neural network includes three nodes, which correspond to the liquid turbidity error, the liquid turbidity error integral, and the liquid turbidity error differential, respectively; and the liquid turbidity error, liquid turbidity error integral, and liquid turbidity error differential input to the input layer of the three-layer backpropagation neural network are normalized to the interval [-1, 1]. The hidden layer of a three-layer backpropagation neural network contains 5 nodes, and its activation function is: Its paranoia value is fixed at 0.5; The output layer of the three-layer backpropagation neural network linearly outputs the proportional gain parameter of the PID controller. Integration time parameters and differential time parameters .

5. The PID variable frequency turbidity control method based on neural networks according to claim 4, characterized in that, Training methods for a three-layer backpropagation neural network include: The loss function for a three-layer backpropagation neural network is: ; Weight matrix of a three-layer backpropagation neural network The update formula is: , For learning rate, The error gradient of the hidden layer nodes. This is the input signal.

6. The PID variable frequency turbidity control method based on neural networks according to claim 4, characterized in that, The proportional gain parameter, integral time parameter, and derivative time parameter of the generated PID controller are input into the PID controller to obtain the inverter control quantity. The methods include: Inverter control quantity The calculation formula is: .

7. The PID variable frequency turbidity control method based on neural networks according to claim 4, characterized in that, The system monitors the PID controller parameters output by the neural network in real time. When a parameter exceeds a preset range, the system switches the input parameters to the preset PID parameter library and limits the inverter's operating frequency range. Other features include: The critical gain determined by the preset parameter set through step response experiments and critical period Generate; where, , , The synchronous limiter output frequency range is 10Hz to 50Hz.

8. A terminal, characterized in that, include: processor; Memory used to store the processor's execution instructions; The processor is configured to perform the method according to any one of claims 1-7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Variable-frequency speed adjustment technique-based Bang-Bang+PID (Piping and Instrument Diagram) constant pressure water supply closed-loop control method

    CN102929305A

  • Sewage treatment process control method based on neural network

    CN105843036A

  • Control method and system for seamless switching of power modules

    CN119324464A