PID frequency conversion turbidity control method based on neural network, terminal and storage medium
Through the neural network dynamically generates PID parameters and frequency adjustment of the inverter, the problem that traditional PID controllers cannot adapt to water quality changes and equipment aging is solved, and high-precision and stable turbidity control is achieved, reducing energy consumption and extending the equipment life.
Patent Information
- Application Number
- CN202510739154.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-04
AI Technical Summary
The parameters Kp, Ki, and Kd of traditional PID controllers need to be manually tidy and cannot adapt to changes in system characteristics caused by dynamic changes in water quality or equipment aging, resulting in a decrease in turbidity control accuracy and stability.
Using the PID frequency conversion turbidity control method based on neural network, the turbidity sensor collects signals in real time, build a three-layer backpropagation neural network to dynamically generate PID parameters, and input them into the PID controller. Combined with the frequency conversion of the inverter, it can achieve dynamic adaptation to water quality changes and equipment aging.
It improves the accuracy and stability of turbidity control, reduces control overshoot and steady-state errors, reduces energy consumption and extends equipment life, and enhances the robustness of the system.
Smart Images

Figure CN120595591A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial automation control, and in particular relates to a PID variable frequency turbidity control method based on a neural network, a terminal and a storage medium. Background Art
[0002] Turbidity control is a critical component in industrial automation control, particularly in applications such as water treatment, chemical production, and food processing, where high-precision, real-time control of liquid turbidity is required. Traditional turbidity control methods rely primarily on fixed-parameter PID controllers. These controllers adjust the control output through a combination of proportional (P), integral (I), and differential (D) parameters to maintain turbidity near the set point. However, traditional PID control has significant limitations.
[0003] Parameter K of traditional PID controller p , K i , K d Manual tuning is often required, and once set, it remains fixed, making it unable to adapt to changes in system characteristics caused by factors such as dynamic changes in water quality or equipment aging. This parameter fixation problem is particularly prominent in situations such as sudden changes in raw water turbidity or mechanical wear of the dosing pump, which can easily lead to control overshoot or increased steady-state error, affecting the accuracy and stability of turbidity control. Summary of the Invention
[0004] The traditional turbidity control method in the prior art mainly relies on the PID controller with fixed parameters. The parameter K of the PID controller is p , K i , K d Manual adjustment is usually required, and once set, it remains unchanged. It cannot adapt to changes in system characteristics caused by factors such as dynamic changes in water quality or equipment aging, and is prone to cause control overshoot or increased steady-state error, affecting the accuracy and stability of turbidity control. The present invention provides a PID variable frequency turbidity control method, terminal and storage medium based on a neural network to solve the above technical problems.
[0005] In a first aspect, the present invention provides a PID variable frequency turbidity control method based on a neural network, comprising: The turbidity sensor is used to collect the liquid turbidity signal in real time and perform data preprocessing; Calculating the current liquid turbidity error according to the preprocessed liquid turbidity signal and the preset turbidity threshold, and performing calculus on the calculated liquid turbidity error; A three-layer back-propagation neural network is constructed, which takes the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as inputs and dynamically generates the proportional gain parameter, the integral time parameter and the differential time parameter; The generated proportional gain parameter, integral time parameter and differential time parameter of the PID controller are input 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 adjustment mode and the low-frequency energy-saving mode are switched according to the turbidity error amplitude; The corresponding parameters of the PID controller output by the neural network are monitored in real time. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited at the same time.
[0006] A further improvement of this technical solution is that the turbidity sensor adopts an online turbidity meter with model MIK-PTU100, whose measurement range is 0.01NTU to 4000NTU and the sampling period is ≤1 second, and the collected liquid turbidity information is converted into digital quantity through the analog-to-digital conversion module with model 6ES7 234-4HE32-0XB0.
[0007] A further improvement of the present technical solution is to calculate the current liquid turbidity error based on the preprocessed liquid turbidity signal and a preset turbidity threshold, and perform calculus on the calculated liquid turbidity error. The method includes: Liquid turbidity error The calculation formula is: ; in, is the preset turbidity threshold; It is the liquid turbidity signal collected in real time; Error in calculated liquid turbidity The formula for integration is: ,in, is the sampling time interval; Error in calculated liquid turbidity The formula for differentiation is: .
[0008] A further improvement of the technical solution is to construct a three-layer back propagation neural network, using the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as inputs to dynamically generate the proportional gain parameter, the integral time parameter and the differential time parameter of the PID controller, the method comprising: The input layer of the three-layer back-propagation neural network includes three nodes, corresponding 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 into the input layer of the three-layer back-propagation neural network are normalized to the interval [-1, 1]; The hidden layer of the three-layer back-propagation neural network contains 5 nodes, and its activation function is: , its bias term is fixed at 0.5; The proportional gain parameter of the linear output PID controller in the output layer of the three-layer back-propagation neural network , integral time parameters and derivative time parameters .
[0009] A further improvement of this technical solution is that the training method of the three-layer back propagation neural network includes: The loss function of the three-layer back-propagation neural network is: ; Three-layer back-propagation neural network weight matrix The update formula is: , is the learning rate, is the error gradient of the hidden layer nodes, is the input signal.
[0010] A further improvement of the technical solution is to input the generated proportional gain parameter, integral time parameter and differential time parameter of the PID controller into the PID controller to obtain the inverter control quantity, and the method includes: Inverter control quantity The calculation formula is: .
[0011] A further improvement of this technical solution is to convert the control quantity output by the PID controller into a frequency instruction of the frequency converter, and switch between the high-frequency adjustment mode and the low-frequency energy-saving mode according to the turbidity error amplitude. The method includes: when When the inverter is forced to run at a high frequency of 45Hz; when When the inverter output frequency is linearly proportional to Make adjustments.
[0012] A further improvement of this technical solution is to monitor the corresponding parameters of the PID controller output by the neural network in real time. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited. The method includes: Real-time monitoring of the proportional gain parameters of the neural network output , integral time parameters and derivative time parameters , and upon detection 、 or , the parameter switching mechanism is triggered; Switch to the preset parameter group in the preset PID parameter library that best matches the current working conditions. The preset parameter group has the critical gain determined by the step response experiment. and critical period Generate; among them, , , ; The synchronous limit inverter output frequency range is 10Hz to 50Hz.
[0013] In a second aspect, the present invention provides a terminal, comprising: processor, memory, wherein The memory is used to store computer programs, The processor is used to call and run the computer program from the memory, so that the terminal executes the above-mentioned terminal method.
[0014] In a third aspect, the present invention provides a computer storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the methods described in the above aspects.
[0015] The beneficial effects of the present invention are: The present invention constructs a three-layer back propagation neural network, takes the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as input, and dynamically generates the proportional gain parameter K p , integral time parameter K i and the differential time parameter K d This approach 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 factors such as dynamic changes in water quality or equipment aging. In situations such as sudden changes in raw water turbidity or mechanical wear of the dosing pump, this method can effectively reduce control overshoot or steady-state error, significantly improving the accuracy and stability of turbidity control.
[0016] Traditional frequency converters used in turbidity control often employ open-loop speed regulation, resulting in increased energy consumption and accelerated equipment wear. This invention achieves dynamic frequency regulation by converting the control variable output by a 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. This strategy enables the frequency converter to dynamically adjust frequency based on actual operating conditions, avoiding long-term full-load operation, thereby reducing energy consumption and extending the service life of the equipment.
[0017] This system monitors the PID controller parameters output by the neural network in real time. If a parameter exceeds a preset range, it switches the input PID controller parameters to a pre-set PID parameter library and limits the inverter's operating frequency range. This safety protection mechanism enhances system robustness. Even in the face of sudden disturbances such as water quality fluctuations, the system can quickly adjust its control strategy to prevent control instability and ensure production safety and quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A schematic flow chart of a method according to an embodiment of the present invention.
[0020] Figure 2 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, features, and advantages of the present invention more obvious and easy to understand, the technical solutions of the present invention will be clearly and completely described below in conjunction with the drawings in the specific embodiments. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0023] The PID variable frequency turbidity control method based on neural network provided in the embodiment of the present invention is executed by a computer device. Figure 1 1 is a schematic flow chart of a method according to an embodiment of the present invention, wherein the order of the steps in the flow chart may be changed and some steps may be omitted according to different requirements.
[0024] like Figure 1 As shown, the method includes: Step 110, collecting liquid turbidity signals in real time through a turbidity sensor and performing data preprocessing; Step 120, calculating the current liquid turbidity error based on the preprocessed liquid turbidity signal and a preset turbidity threshold, and performing calculus on the calculated liquid turbidity error; Step 130: construct a three-layer back propagation neural network, taking the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as inputs, and dynamically generating a proportional gain parameter, an integral time parameter and a differential time parameter; Step 140, inputting the generated proportional gain parameter, integral time parameter, and differential time parameter of the PID controller into the PID controller to obtain the inverter control variable; Step 150: convert the control quantity output by the PID controller into a frequency command of the frequency converter, and switch between a high-frequency adjustment mode and a low-frequency energy-saving mode according to the turbidity error amplitude; Step 160 , real-time monitoring of the corresponding parameters of the PID controller output by the neural network. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited.
[0025] To facilitate understanding of the present invention, the following further describes the neural network-based PID frequency conversion turbidity control method provided by the present invention based on the principle of the neural network-based PID frequency conversion turbidity control method of the present invention, combined with the process of performing PID frequency conversion control on the frequency converter for controlling liquid turbidity based on the neural network in the embodiment.
[0026] Specifically, the turbidity sensor used is a MIK-PTU100 online turbidity meter 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 sedimentation tank entrance, ensuring that the sensor probe is fully immersed in the liquid to prevent air bubbles and impurities from interfering with the measurement. The turbidity meter output signal is configured as a 4-20mA current signal to ensure compatibility with the subsequent analog-to-digital conversion module. A 6ES7 234-4HE32-0XB0 analog-to-digital conversion module is used to convert the 4-20mA current signal output by the turbidity meter into a digital value.
[0027] The collected digital turbidity signal is filtered to eliminate noise. For example, a sliding average filter algorithm can be used to average the turbidity values of multiple consecutive sampling points to obtain a smoothed turbidity value. The filtered turbidity data is normalized to the [-1, 1] range required by the neural network input layer. This can be done by subtracting the minimum measured value from the turbidity value, dividing it by the measurement range (maximum value - minimum value), multiplying it by 2, and then subtracting 1.
[0028] The MIK-PTU100 turbidity meter offers a wide measurement range (0.01 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. This high-frequency sampling capability enables the system to rapidly respond 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 converts the turbidity data to the range required by the neural network input layer, facilitating subsequent processing.
[0029] 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 subjected to calculus. The method includes: Liquid turbidity error The calculation formula is: ; in, is the preset turbidity threshold; is the liquid turbidity signal collected in real time (the liquid turbidity signal after preprocessing); Error in calculated liquid turbidity The formula for integration is: ,in, is the sampling time interval; Error in calculated liquid turbidity The formula for differentiation is: .
[0030] According to the production process requirements and actual water quality, a reasonable turbidity threshold T is preset. set This threshold is used as the target value for turbidity control and is used to calculate the turbidity error at the current moment. For example, in a water treatment process, the turbidity threshold can be set to 5 NTU to ensure that the effluent water quality meets the standard.
[0031] use The formula calculates the liquid turbidity error at the current moment. For example, if the turbidity value at the current moment is 3NTU and the preset turbidity threshold is 5NTU, the turbidity error e(t)=5-3=2NTU.
[0032] Using the formula Calculate the liquid turbidity error integral, which reflects the cumulative effect of turbidity error over time. In practical applications, numerical integration methods (such as the trapezoidal method or Simpson's method) can be used to approximate the liquid turbidity error integral. 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, the increment of the liquid turbidity error integral is (2 + 1) / 2*1=1.5 NTU·s.
[0033] Using the formula Calculate the liquid turbidity error differential, where e(t-1) is the liquid turbidity error at the previous moment. The liquid turbidity error differential reflects the rate of change of the liquid turbidity error, helping the controller respond quickly to changes in liquid turbidity. For example, if the current liquid turbidity error is 2 NTU and the previous moment was 1 NTU, the liquid turbidity error differential Δe(t) = 2 - 1 = 1 NTU / s.
[0034] The calculated turbidity error e(t), error integral ∫e(t)dt and error differential Δe(t) are taken as input and transmitted to a three-layer back-propagation neural network for further processing.
[0035] By calculating the liquid turbidity error in real time and performing a calculus-based process, the present invention enables the system to more accurately reflect the difference between the current turbidity state and the target value, as well as the temporal trend of this difference. This facilitates the neural network to dynamically adjust PID parameters, resulting in more precise control outputs and significantly improved turbidity control accuracy. The introduction of the liquid turbidity error differential enables the system to rapidly respond to turbidity changes. When the liquid turbidity changes suddenly, the error differential quickly reflects this change, prompting the neural network to promptly adjust the PID parameters, accelerating control response and reducing overshoot and settling time. Calculating the liquid turbidity error integral helps the system better predict and adjust the control output, reducing steady-state error. By comprehensively considering the current liquid turbidity error, the accumulated historical liquid turbidity error, and the rate of change of the liquid turbidity error, the neural network can generate more optimal PID parameters, optimizing control performance. Conventional PID control methods often struggle to adapt to dynamic changes in water quality, such as sudden changes in raw water turbidity or mechanical wear of dosing pumps. However, by calculating the liquid turbidity error in real time and performing a calculus-based process, combined with the dynamic adjustment capabilities of the neural network, the present invention enables the system to rapidly adapt to changing water quality and maintain stable turbidity control.
[0036] In addition, a three-layer back propagation neural network is constructed, which takes the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as inputs to dynamically generate the proportional gain parameter, the integral time parameter and the differential time parameter of the PID controller, and the method includes: S131, the input layer of the three-layer back propagation neural network includes three nodes, corresponding 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 into the input layer of the three-layer back propagation neural network are normalized to the interval [-1, 1]; S132. The hidden layer of the three-layer back-propagation neural network contains 5 nodes, and its activation function is: , its bias term is fixed at 0.5; S133, the proportional gain parameter of the linear output PID controller of the output layer of the three-layer back propagation neural network , integral time parameters and derivative time parameters .
[0037] The network structure of the three-layer back-propagation neural network is as follows: the input layer contains 3 nodes, corresponding to the liquid turbidity error e(t), the liquid turbidity error integral ∫e(t)dt and the liquid turbidity error differential Δe(t). These three input quantities can fully reflect the state of the current turbidity control system and provide sufficient information for the neural network to dynamically adjust the PID parameters. Before entering the neural network, the input signal needs to be normalized and converted to the range of [-1,1] to accelerate network training and increase convergence speed. The hidden layer contains 5 nodes. The number of nodes in this layer has been determined through multiple experiments and verifications. It can avoid overfitting while ensuring network performance. The activation function uses the Sigmoid function, which is expressed as follows: The Sigmoid function has good nonlinear mapping capabilities and can map the input signal to the (0,1) interval, which helps the neural network learn complex nonlinear relationships. The bias term is fixed to 0.5 to simplify the network structure and reduce the training parameters. The output layer contains 3 nodes, corresponding to the proportional gain parameter K of the PID controller. p , integral time parameter K i and the differential time parameter K d The output layer uses a linear activation function to directly output the PID parameter values without further processing.
[0038] Furthermore, the training method of the three-layer back-propagation neural network includes: The loss function of the three-layer back-propagation neural network is: ; Three-layer back-propagation neural network weight matrix The update formula is: , is the learning rate, is the error gradient of the hidden layer nodes, is the input signal.
[0039] The back propagation algorithm (BP algorithm) is used for network training to update the network weights by minimizing the loss function (such as mean square error MSE). The loss function is defined as the mean square error between the predicted PID parameters and the actual PID parameters, that is, , where N is the number of samples.
[0040] Weight Matrix The structural parameters of the three-layer back-propagation neural network, the weight matrix Represents the connection weight from the i-th node in the input layer to the j-th node in the hidden layer; the weight matrix Initialize to a random value in the interval [-0.5, 0.5]. Update the weight matrix through the back propagation algorithm , minimizing the squared error loss function in real time , thereby outputting the optimal PID parameters ( , , ). Neural network based on real-time turbidity error signal , using the update mechanism of the weight matrix, it dynamically adapts to water quality changes (such as sudden changes in influent turbidity) and improves control robustness.
[0041] The parameters of the conventional PID controller of the present invention (K p , K i , K d ) are usually fixed and have difficulty adapting to dynamic changes in water quality and equipment aging. By constructing a three-layer back-propagation neural network, the system can dynamically adjust the PID parameters in real time based on the current turbidity error, error integral, and error differential, making control more precise. By learning from historical data and real-time input, the neural network can capture the complex nonlinear relationships in the turbidity control system, thereby generating more appropriate PID parameters, reducing overshoot and steady-state error, and improving control accuracy. Specifically, dynamic adjustment of PID parameters helps to better cope with external interference and internal changes, such as sudden changes in inlet water turbidity and mechanical wear of the dosing pump, thereby maintaining stable turbidity control. By monitoring and adjusting PID parameters in real time, the system can promptly correct control deviations, avoid control loss or oscillation, and improve system stability.
[0042] Neural networks possess powerful learning and adaptive capabilities, automatically adjusting PID parameters based on water quality changes to maintain optimal control. In the event of sudden changes in water quality, the neural network can quickly learn the new water characteristics and generate corresponding PID parameters, ensuring that turbidity control remains effective. 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 the system's robustness and anti-interference capabilities. Traditional PID controllers require manual parameter tuning, a tedious and error-prone process. By constructing a three-layer back-propagation neural network, the system can automatically adjust PID parameters, reducing manual intervention and lowering maintenance costs. The neural network's continuous learning and optimization capabilities eliminate the need for frequent manual adjustments, improving the system's automation and operational efficiency.
[0043] In addition, the generated proportional gain parameter, integral time parameter, and differential time parameter of the PID controller are input into the PID controller to obtain the inverter control quantity, and the method includes: Inverter control quantity The calculation formula is: .
[0044] The three-layer back propagation neural network dynamically generates the proportional gain parameter K of the PID controller by taking the real-time collected liquid turbidity error e(t), liquid turbidity error integral ∫e(t)dt and liquid turbidity error differential Δe(t) as input. p , integral time parameter K i and the differential time parameter K d The neural network captures the complex nonlinear relationship in the turbidity control system by learning historical data and real-time input, thereby generating the optimal PID parameter combination. p , K i , K d The parameters are input into 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 variable u(t) is input into the inverter to adjust the speed of the water pump or agitator, thereby changing the dosage or mixing intensity, achieving precise control of liquid turbidity. Turbidity changes are monitored in real time, and PID parameters and inverter control variables are dynamically adjusted based on feedback signals, forming a closed-loop control system to ensure that turbidity always remains within the set range.
[0045] The dynamically generated PID parameters of the present invention can better adapt to changes in water quality, enabling the PID controller to more accurately adjust the inverter control variable, thereby achieving precise control of liquid turbidity. Through a closed-loop control system, control deviations can be corrected in real time, reducing overshoot and steady-state errors, and improving control accuracy. Dynamic PID parameter adjustment helps the system better cope with external interference and internal changes, such as sudden changes in influent turbidity and equipment aging, while maintaining stable turbidity control. Through real-time monitoring and adjustment, potential control issues can be promptly identified and addressed, preventing system runaway or oscillation.
[0046] Furthermore, the control quantity output by the PID controller is converted into a frequency instruction of the frequency converter, and the high-frequency adjustment mode and the low-frequency energy-saving mode are switched according to the turbidity error amplitude. The method includes: when When the inverter is forced to run at a high frequency of 45Hz; when When the inverter output frequency is linearly proportional to Make adjustments.
[0047] In the output logic of the PID controller, add a conditional statement. When the frequency converter receives the command, it immediately adjusts the output frequency to 45Hz, driving the water pump or agitator to run at high speed, quickly correcting the turbidity deviation.
[0048] According to actual production requirements and equipment characteristics, set a linear relationship, such as , where f(t) is the inverter output frequency. In the output logic of the PID controller, when it is detected When the inverter output frequency is calculated according to the above linear relationship, the frequency command is sent to the inverter. After receiving the command, the inverter adjusts the output frequency to the calculated value and drives the water pump or agitator to run at the corresponding speed, achieving low-frequency energy saving.
[0049] This invention utilizes a high-frequency regulation mode, enabling the system to rapidly respond to sudden changes in water quality, reducing turbidity deviation duration and improving production efficiency. Dynamic adjustment of PID parameters and inverter frequency allows the system to better adapt to water quality changes and maintain stable turbidity control. The introduction of a low-frequency energy-saving mode effectively reduces energy consumption in the inverter and pump or agitator, lowering operating costs. By reducing high-frequency operation time, equipment wear and failure rates are reduced, extending equipment life.
[0050] Afterwards, the corresponding parameters of the PID controller output by the neural network are monitored in real time. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited. The method includes: Real-time monitoring of the proportional gain parameters of the neural network output , integral time parameters and derivative time parameters , and upon detection 、 or , the parameter switching mechanism is triggered; Switch to the preset parameter group in the preset PID parameter library that best matches the current working conditions. The preset parameter group has the critical gain determined by the step response experiment. and critical period Generate; among them, , , ; The synchronous limit inverter output frequency range is 10Hz to 50Hz.
[0051] Through step response experiments, the critical gain (and critical period) of the system under different working conditions are determined to provide a basis for the construction of the preset PID parameter library. First, disconnect the integral and differential links, that is, set the integral time constant Zero, differential time parameter is zero, making the system in pure proportional control state. Initially, gradually increase the proportional gain by 0.1 each time and observe the system response. Generate a step signal by temporarily adjusting the set value, for example, a sudden increase from 30 NTU to 35 NTU, to simulate the sudden change in actual working conditions. Record the fluctuation curve of the actual turbidity value until the system exhibits constant amplitude oscillation, that is, the amplitude no longer increases or decreases, and the oscillation is stable. When the system exhibits constant amplitude oscillation for the first time, the proportional gain parameter at this time is , which is the critical gain , for example, if When the turbidity oscillates between 32 NTU and 38 NTU, . The time interval between two adjacent peaks (or troughs) in the oscillation curve is For example, if the first peak appears at 100 seconds and the next peak appears at 160 seconds, then In order to build a comprehensive preset PID parameter library, it is necessary to repeat the above step response experiment under different working conditions to obtain the critical gain under each working condition. and critical period The working conditions can be divided according to the key parameters in the actual production process, such as turbidity set value, flow rate, temperature, etc.
[0052] Critical gain determined based on step response experiments and critical period , use the Ziegler-Nichols tuning formula to generate PID parameter groups under different working 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, steady-state error, etc. Based on the evaluation results, the parameter set is fine-tuned. Through multiple iterations and optimization, the final preset PID parameter library is formed to ensure good control effect under different operating conditions.
[0053] The preset PID parameter library of this invention, determined through step response experiments, can adapt to control requirements under different operating conditions. In practical applications, switching to the preset parameter set improves system control accuracy, and control indicators such as turbidity can be more stably maintained near set values. By limiting the inverter output frequency range, high-load equipment operation caused by frequency anomalies is avoided, effectively reducing energy consumption.
[0054] Figure 2 This is a structural diagram of a terminal 200 provided in an embodiment of the present invention. The terminal 200 can be used to execute the neural network-based PID variable frequency turbidity control method provided in an embodiment of the present invention.
[0055] 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 appreciate that the server structure shown in the figure does not limit the present invention. The server structure may be a bus structure or a star structure, and may include more or fewer components than shown, or may combine certain components or arrange the components differently.
[0056] The memory 220 can be used to store 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 memory, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 220 are executed by the processor 210, the terminal 200 can perform some or all of the steps in the above-described method embodiments.
[0057] The processor 210 is the control center of the storage terminal. It uses various interfaces and lines to connect various parts of the entire electronic terminal. It executes various functions of the electronic terminal and / or processes data by running or executing software programs and / or modules stored in the memory 220, and calling data stored in the memory. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 210 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0058] The communication module 230 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals, or send user data to other terminals.
[0059] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program that, when executed, may include some or all of the steps of each embodiment provided herein. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0060] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes 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, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code, and includes instructions for causing a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0061] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0062] Although the present invention has been described in detail with reference to the accompanying drawings and in conjunction with preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, persons of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and such modifications or substitutions shall be within the scope of the present invention. Any changes or substitutions that can be easily conceived by persons skilled in the art within the technical scope disclosed in the present invention shall be within the scope of protection of the present invention.
Claims
1. A PID variable frequency turbidity control method based on neural network, characterized in that: include: The turbidity sensor is used to collect the liquid turbidity signal in real time and perform data preprocessing; Calculating the current liquid turbidity error according to the preprocessed liquid turbidity signal and the preset turbidity threshold, and performing calculus on the calculated liquid turbidity error; A three-layer back-propagation neural network is constructed, which takes the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential as inputs and dynamically generates the proportional gain parameter, the integral time parameter and the differential time parameter; The generated proportional gain parameter, integral time parameter and differential time parameter of the PID controller are input 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 adjustment mode and the low-frequency energy-saving mode are switched according to the turbidity error amplitude; The corresponding parameters of the PID controller output by the neural network are monitored in real time. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited at the same time.
2. The neural network-based PID variable frequency turbidity control method according to claim 1, characterized in that: The turbidity sensor uses an online turbidity meter model MIK-PTU100, with a measurement range of 0.01NTU to 4000NTU and a sampling period of ≤1 second. The collected liquid turbidity information is converted into digital quantity through an analog-to-digital conversion module model 6ES7 234-4HE32-0XB0.
3. The neural network-based PID variable frequency turbidity control method according to claim 1, characterized in 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 subjected to calculus. The method includes: Liquid turbidity error The calculation formula is: ; in, is the preset turbidity threshold; It is the liquid turbidity signal collected in real time; Error in calculated liquid turbidity The formula for integration is: ,in, is the sampling time interval; Error in calculated liquid turbidity The formula for differentiation is: .
4. The neural network-based PID variable frequency turbidity control method according to claim 3, characterized in that: A three-layer back propagation neural network is constructed, and the liquid turbidity error, the liquid turbidity error integral and the liquid turbidity error differential are used as inputs to dynamically generate the proportional gain parameter, the integral time parameter and the differential time parameter of the PID controller. The method includes: The input layer of the three-layer back-propagation neural network includes three nodes, corresponding 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 into the input layer of the three-layer back-propagation neural network are normalized to the interval [-1, 1]; The hidden layer of the three-layer back-propagation neural network contains 5 nodes, and its activation function is: , its bias term is fixed at 0.5; The proportional gain parameter of the linear output PID controller in the output layer of the three-layer back-propagation neural network , integral time parameters and derivative time parameters .
5. The neural network-based PID variable frequency turbidity control method according to claim 4, characterized in that: The training method of the three-layer back-propagation neural network includes: The loss function of the three-layer back-propagation neural network is: ; Three-layer back-propagation neural network weight matrix The update formula is: , is the learning rate, is the error gradient of the hidden layer nodes, is the input signal.
6. The neural network-based PID variable frequency turbidity control method according to claim 4, characterized in that: The generated proportional gain parameter, integral time parameter, and differential time parameter of the PID controller are input into the PID controller to obtain the inverter control quantity, and the method includes: Inverter control quantity The calculation formula is: .
7. The neural network-based PID variable frequency turbidity control method according to claim 6, characterized in that: The control quantity output by the PID controller is converted into a frequency instruction of the frequency converter, and the high-frequency adjustment mode and the low-frequency energy-saving mode are switched according to the turbidity error amplitude. The method includes: when When the inverter is forced to run at a high frequency of 45Hz; when When the inverter output frequency is linearly proportional to Make adjustments.
8. The neural network-based PID variable frequency turbidity control method according to claim 4, characterized in that: The corresponding parameters of the PID controller output by the neural network are monitored in real time. When it is detected that the parameters exceed the preset range, the parameters input to the PID controller are switched to the preset PID parameter library, and the operating frequency range of the inverter is limited. The method includes: Real-time monitoring of the proportional gain parameters of the neural network output , integral time parameters and derivative time parameters , and upon detection 、 or , the parameter switching mechanism is triggered; Switch to the preset parameter group in the preset PID parameter library that best matches the current working conditions. The preset parameter group has the critical gain determined by the step response experiment. and critical period Generate; among them, , , ; The synchronous limit inverter output frequency range is 10Hz to 50Hz.
9. A terminal, characterized in that: include: processor; a memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
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
PID parameter switching method and device of speed regulating system of hydroelectric generating set, and storage medium
CN110752608A
PID controller parameter setting method, apparatus and device, and storage medium
CN113485091A
Coagulation dosing method and system
CN115108617A