Signal processing and flow control method suitable for heat distribution type flow controller
By using mean filtering, Kalman filtering and signal processing and flow control methods of fuzzy neural network PID controller in thermal distributed flow controllers, the problems of long control response time, large time lag, large noise influence and poor stability are solved, and more efficient and more stable flow control is achieved.
Patent Information
- Application Number
- CN202411794277.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-11
AI Technical Summary
The thermal distributed flow controller has problems such as long control response time, delay, high noise influence, and poor stability.
Signal processing and flow control methods are adopted, including mean filtering, Kalman filtering based on residual judgment, fuzzy neural network PID controller and flow conversion algorithm, and the signal is output to the solenoid proportional valve through the PWM interface of the MCU, and negative feedback adjustment is realized to achieve the set flow value.
It effectively reduces the impact of noise, improves stability, shortens control response time, and improves the accuracy and fast response capability of flow control.
Smart Images

Figure CN119806219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of thermal distributed flow controllers, and in particular to a signal processing and flow control method suitable for thermal distributed flow controllers. Background Art
[0002] A thermal distributed flow meter is an instrument that uses the principle of heat transfer to measure fluid flow. It is usually used in situations with low flow rates, and is especially suitable for different types of fluids such as gas and liquid. The thermal distributed flow meter has the following advantages: 1. Due to the use of multiple temperature sensors, the thermal distributed flow meter can provide higher measurement accuracy. 2. Relatively few mechanical parts make the maintenance cost lower. 3. It does not directly contact the fluid, so it is suitable for corrosive or viscous liquids. The thermal distributed flow meter has the following disadvantages: 1. It is suitable for lower flow rates, and may cause inaccuracies when the flow rate is too high. 2. In some cases, changes in external temperature or changes in fluid properties may affect the measurement accuracy.
[0003] The thermal distributed flow controller is a combination of a thermal distributed flow meter and an electromagnetic proportional valve, which regulates the flow through a negative feedback mechanism. The current domestic technology of flow controllers is still immature, with a long control response time, time lag, great noise influence, and poor stability. Summary of the invention
[0004] In view of the technical problems existing in the prior art, the purpose of the present invention is to provide a signal processing and flow control method suitable for a thermal distributed flow controller, which solves the problems of long control response time, time lag, great influence of noise and poor stability of the thermal distributed flow controller, and improves the performance of the thermal distributed flow controller.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] A signal processing and flow control method applicable to a thermal distributed flow controller comprises the following steps:
[0007] S1: The thermal distributed flow meter collects the temperature difference AD signal through the signal acquisition circuit;
[0008] S2: accumulating the AD signal multiple times through mean filtering and taking the average as the input signal of Kalman filtering; the number of accumulation times is selected by technicians in this field according to the working conditions;
[0009] S3: Calculate the residual, set the residual threshold R, and switch the noise covariance matrix Q to Q1 when the residual is greater than R, otherwise to Q2;
[0010] S4: The Kalman filter output value is used as the final AD signal, which is converted into a flow signal and transmitted to the flow control system;
[0011] S5: The flow control system adopts the FNN-PID control method, which outputs the signal to the electromagnetic proportional valve through the PWM interface of the MCU (Microcontroller Unit, also known as the MCU control unit) to control the valve opening;
[0012] S6: The valve opening is continuously adjusted through the negative feedback mechanism to achieve the set flow value.
[0013] As a preferred embodiment, the thermal distributed flow controller includes a temperature difference sampling MEMS sensor, a housing, an electromagnetic proportional valve, and uses an internal 12-bit AD chip.
[0014] As a preferred embodiment, in step S1, the 12-bit resolution AD signal inside the AD chip is accumulated 16 times as a sampling value to improve the sampling accuracy. In step S2, the 16-bit signal is accumulated n times through mean filtering and the mean is taken as the input signal of the Kalman filter.
[0015] As a preferred embodiment, in step S2, the mean filtering algorithm is: The input parameter u(k) is a 16-bit AD value.
[0016] As a preferred embodiment, in step S3, the Kalman filtering algorithm is:
[0017] X(k|k-1)=F*X0;
[0018] P(k|k-1)=F*P(k-1|k-1)*F'+Q;
[0019] X(k|k)=X(k|k-1)+Kg(k)(Z(k)-HX(k|k-1));
[0020]
[0021] P(k|k)=(1-Kg(k)*H)*P(k|k-1);
[0022] Where X(k) is the state estimate at the current time k, F is the state transfer matrix, P(k) is the state error covariance matrix at the current time k, Q is the covariance matrix of the system process noise, Kg(k) is the Kalman gain matrix at the current time k, R is the covariance matrix of the observation noise, H is the conversion matrix from the state vector to the measurement vector, and Z(k) is the measurement vector.
[0023] As a preferred embodiment, in step S3, the residual calculation formula is:
[0024] Z(k)-X(k|k-1);
[0025] Set the residual threshold R, the noise covariance matrix Q judgment function is:
[0026]
[0027] The purpose of setting the residual judgment is to solve the problem that the flow rate changes slowly during the step response of the Kalman filter and cannot quickly reach the set value.
[0028] As a preferred embodiment, in step S4, the flow conversion formula is: Where v is the instantaneous flow rate, K is the flow meter instrument constant, A is the thermal conductivity coefficient of the heating coil and the fluid in the tube, C p is the specific heat capacity at constant pressure, and ΔT is the temperature difference between the upstream and downstream of the sensor.
[0029] As a preferred embodiment, in the flow control system of step S5, the input is a set flow value, which passes through the FNN-PID controller and outputs a signal to the electromagnetic proportional valve to control the valve opening. The thermal distributed flow meter detects the flow size and inputs it into the flow control system as a negative feedback signal, and repeats this process until the set flow value is reached.
[0030] As a preferred embodiment, in step S5, the FNN-PID controller is divided into two parts: a fuzzy neural network and a PID controller; wherein the fuzzy neural network is a four-layer structure, the input is the difference e(k) between the measured flow rate and the set flow rate and the rate of change of e(k) with respect to time, and the output is the three parameters Kp, Ki, and Kd of the PID controller, and the specific functions include:
[0031] 1) PID controller output signal: u=u_1+k p (e-e_1)+k i e+k d (e-2e_1+e_2), u=u_1+Δu, where u is the control value, u_1 is the control value at the previous moment, and e, e_1, e_2 are the deviations;
[0032] 2)PID parameter calculation:
[0033]
[0034]
[0035] is the membership calculation of the membership function layer, where x i is the input layer variable, c ij ,b ij are the center value and width of the membership function respectively; a k is the node value of the fuzzy inference layer, K l The variable value of the output layer is the controller input parameter;
[0036] 3) Parameter correction method:
[0037] epid=[e-e_1,e,e-2e_1+e_2];
[0038]
[0039] Where η is the learning rate 0.75, l = 1, 2, 3; k = 1, 2, ..., 7; j = 1, 2, ..., 7; is the first-order gradient of weights wlk, cij, bij, Δw lk , Δc ij , Δb ij is the weight update increment;
[0040] The number of nodes in the first layer of the neural network is 2, the number of nodes in the second layer is 7, the number of nodes in the third layer is 49, and the number of nodes in the last layer is 3.
[0041] As a preferred embodiment, a signal processing and flow control method suitable for a thermal distributed flow controller includes mean filtering, Kalman filtering based on residual judgment, fuzzy neural network PID, and a flow conversion algorithm.
[0042] The present invention has the following advantages:
[0043] The present invention provides a signal processing and flow control method suitable for a thermal distributed flow controller, wherein the signal processing method includes mean filtering, Kalman filtering and flow conversion algorithm, which can effectively handle the uncertainty in the system, adapt to the system model of time change, and simplify the analysis of complex systems through state space representation. Not only does it reduce the impact of noise and improve stability, but it also provides a guarantee for the subsequent control system. The flow control method adopts a PID controller based on a fuzzy neural network (FNN). FNN-PID combines the advantages of fuzzy logic control and neural networks, and significantly improves the performance of traditional PID controllers in complex systems. Its main advantage is that it can adaptively adjust control parameters. This adaptive ability enables FNN-PID to maintain high control accuracy and stability in the face of uncertainty and environmental changes, and quickly reach the set flow value. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a structural diagram of a flow control system based on the principle of heat distribution.
[0045] Figure 2 It is the signal processing-flow control flow chart of the present invention.
[0046] Figure 3 It is the principle block diagram of the FNN-PID flow control system of the present invention.
[0047] Figure 4 This is a comparison chart of Kalman filtering test results based on residual judgment of the present invention.
[0048] Figure 5 It is a schematic diagram of Matlab simulation of the FNN-PID step response of the present invention.
[0049] Figure 6 It is a schematic diagram of the response of the signal processing and flow control system of the present invention to the set flow change. DETAILED DESCRIPTION
[0050] The present invention will be further described in detail below in conjunction with specific implementation methods.
[0051] like Figure 1 As shown. This embodiment is based on a thermal distributed flow control system, including: an MCU control unit, a signal processing circuit, a MEMS sensor, an electromagnetic proportional valve, a rectifier, a flow channel and an air pump. The air pump is the signal source of the entire system. After the gas passes through the flow channel and is limited by the electromagnetic proportional valve and rectified by the rectifier, the temperature difference signal is received by the MEMS sensor and transmitted to the differential amplifier circuit. The differential amplifier circuit amplifies the voltage signal and transmits it to the MCU control unit through the ADC interface for signal processing. After the MCU control unit is processed by the algorithm of the present invention, the signal is transmitted to the electromagnetic proportional valve through the PWM interface to control the valve opening, thereby controlling the flow size. After several negative feedback adjustments, the flow reaches the set value.
[0052] Furthermore, the MEMS sensor of this embodiment collects temperature difference signals, and the MCU control unit uses buttons to set the flow rate and various parameters. The MCU control unit includes an FNN-PID controller, an LCD display of the IIC interface, an EEPROM to store key parameters, and an RS485 communication interface to communicate with the host computer. The electromagnetic proportional valve inputs a current signal, which is linearly related to the valve opening. The specific heat capacity of the gas will also have a certain impact on the flow measurement.
[0053] Furthermore, the algorithm implementation steps of this embodiment are as follows: first, after setting the target flow value, the timer of the MCU control unit collects the AD signal for a period of m, and the accumulated 16 signals are used as an output value and input into the filter. The Kalman filter algorithm based on residual judgment is: X(k|k-1)=F*X0;
[0054] P(k|k-1)=F*P(k-1|k-1)*F'+Q;
[0055] X(k|k)=X(k|k-1)+Kg(k)(Z(k)-HX(k|k-1));
[0056]
[0057] P(k|k)=(1-Kg(k)*H)*P(k|k-1);
[0058] The residual calculation formula is: z(k)-x(k|k-1);
[0059] Set the residual threshold R, and the specific system process noise covariance matrix Q judgment function is: Among them, Q1 and Q2 are selected by technical personnel in this field according to specific working conditions.
[0060] The purpose of setting the residual judgment is to solve the problem that the flow rate changes slowly during the step response of the Kalman filter and cannot quickly reach the set value. After the flow conversion processing, the filtered AD value is passed to the LCD display module and the control module. If the set value and the measured value of the flow rate are consistent at this time, there is no need to control the flow rate. Otherwise, the signal is passed to the FNN-PID controller. The input of the controller is the deviation e and the rate of change of e over time ec. The output is the control increment Δu. The control amount is passed to the electromagnetic proportional valve to control the valve opening. At the same time, the MCU control unit performs the next round of flow acquisition and judgment until the set value and the measured value are consistent. The overall flow chart is as follows Figure 2 shown.
[0061] In step S4, the flow conversion formula is: Where v is the instantaneous flow rate, K is the flow meter instrument constant, A is the thermal conductivity coefficient of the heating coil and the fluid in the tube, C p is the specific heat capacity at constant pressure, and ΔT is the temperature difference between the upstream and downstream of the sensor.
[0062] Furthermore, in this embodiment, the principle of the flow control system is as follows Figure 3 As shown. The positive feedback of the control system is realized by the electromagnetic proportional valve, and the negative feedback is realized by the thermal distributed flow meter. The FNN-PID controller is a black box model, and the output parameters will always tend to the direction where e and ec are minimum. It is worth noting that FNN-PID needs to be trained online when it is turned on to make the coefficient matrix approach the optimal parameters.
[0063] In step S5, the FNN-PID controller is divided into two parts: a fuzzy neural network and a PID controller; the fuzzy neural network is a four-layer structure, the input is the difference e(k) between the measured flow rate and the set flow rate and the rate of change of e(k) over time, and the output is the three parameters Kp, Ki, and Kd of the PID controller. The specific functions include:
[0064] 1) PID controller output signal: u=u_1+k p (e-e_1)+ki e+k d (e-2e_1+e_2), u=u_1+Δu, where u is the control value, u_1 is the control value at the previous moment, and e, e_1, e_2 are the deviations;
[0065] 2)PID parameter calculation:
[0066]
[0067] is the membership calculation of the membership function layer, where x i is the input layer variable, c ij ,b ij are the center value and width of the membership function respectively. k is the node value of the fuzzy inference layer, K l The variable values of the output layer are the input parameters of the controller.
[0068] 3) Parameter correction method:
[0069] epid=[e-e_1,e,e-2e_1+e_2];
[0070]
[0071] Where η is the learning rate 0.75, l = 1, 2, 3; k = 1, 2, ..., 7; j = 1, 2, ..., 7; is the first-order gradient of weights wlk, cij, bij, Δw lk , Δc ij , Δb ij is the weight update increment.
[0072] The number of nodes in the first layer of the neural network is 2, the number of nodes in the second layer is 7, the number of nodes in the third layer is 49, and the number of nodes in the last layer is 3.
[0073] Furthermore, the comparison of the Kalman filter signal processing test results for residual judgment is shown in the figure below: Figure 4 As shown. The flow data can be obtained through the 485 host computer, and the curve fitting can be performed in Matlab. It can be seen that the unfiltered flow data will fluctuate around the true value. The fluctuating data will not only greatly affect the measurement accuracy, but also affect the subsequent flow control, causing control lag and instability. After using the Kalman filter, the smoothness and real-time performance of the flow curve are greatly improved, ensuring the stable input of the subsequent control system.
[0074] Furthermore, the control effect of FNN-PID is as follows Figure 5As shown. The algorithm model is built using Matlab, the flow value is set to 1, and the flow curve is obtained after online training. It can be seen that between 50ms and 100ms, the controller can reach the set flow value with a small overshoot, without significant signal oscillation, and can quickly reach a stable flow value.
[0075] Figure 6 It is a schematic diagram of the response of the signal processing and flow control system to the set flow change. The test results of the whole system are shown in the figure. The system can reach the set value in 20ms and ensure the subsequent flow stability. The system has high real-time performance and stability. The parameters of the PID controller can be adaptively adjusted under different working conditions. The whole system has a high degree of integration.
[0076] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A signal processing and flow control method suitable for a thermal distributed flow controller, characterized in that: The steps include: S1: The thermal distributed flow meter collects the temperature difference AD signal through the signal acquisition circuit; S2: The AD signal is accumulated multiple times through mean filtering and the mean value is taken as the input signal of Kalman filtering; S3: Calculate the residual, set the residual threshold R, and switch the noise covariance matrix Q to Q1 when the residual is greater than R, otherwise to Q2; S4: The Kalman filter output value is used as the final AD signal, which is converted into a flow signal and transmitted to the flow control system; S5: The flow control system adopts the FNN-PID control method, which outputs the signal to the electromagnetic proportional valve through the PWM interface of the MCU to control the valve opening; S6: The valve opening is continuously adjusted through the negative feedback mechanism to achieve the set flow value.
2. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: The thermal distributed flow controller includes a temperature difference sampling MEMS sensor, a housing, an electromagnetic proportional valve, and uses an internal 12-bit AD chip.
3. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 2, characterized in that: In step S1, the 12-bit resolution AD signal inside the AD chip is accumulated 16 times as a sampling value to improve the sampling accuracy.
4. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 3, characterized in that: In step S2, the mean filtering algorithm is: The input parameter u(k) is a 16-bit AD value.
5. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: In step S3, the Kalman filtering algorithm is: X(k|k-1)=F*X0; P(k|k-1)=F*P(k-1|k-1)*F'+Q; X(k|k)=X(k|k-1)+Kg(k)(Z(k)-HX(k|k-1)); P(k|k)=(1-Kg(k)*H)*P(k|k-1); Where X(k) is the state estimate at the current time k, F is the state transfer matrix, P(k) is the state error covariance matrix at the current time k, Q is the covariance matrix of the system process noise, Kg(k) is the Kalman gain matrix at the current time k, R is the covariance matrix of the observation noise, H is the conversion matrix from the state vector to the measurement vector, and Z(k) is the measurement vector.
6. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: In step S3, the residual calculation formula is: Z(k)-X(k|k-1); Set the residual threshold R, the noise covariance matrix Q judgment function is:
7. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: In step S4, the flow conversion formula is: Where v is the instantaneous flow rate, K is the flow meter instrument constant, A is the thermal conductivity coefficient of the heating coil and the fluid in the tube, C p is the specific heat capacity at constant pressure, and ΔT is the temperature difference between the upstream and downstream of the sensor.
8. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: In the flow control system of step S5, the input is the set flow value, which passes through the FNN-PID controller and outputs a signal to the electromagnetic proportional valve to control the valve opening. The thermal distributed flow meter detects the flow size and inputs it into the flow control system as a negative feedback signal, and repeats this process until the set flow value is reached.
9. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: In step S5, the FNN-PID controller is divided into two parts: a fuzzy neural network and a PID controller; the fuzzy neural network is a four-layer structure, the input is the difference e(k) between the measured flow rate and the set flow rate and the rate of change of e(k) over time, and the output is the three parameters Kp, Ki, and Kd of the PID controller. The specific functions include: 1) PID controller output signal: u=u_1+k p (e-e_1)+k i e+k d (e-2e_1+e_2), u=u_1+Δu, where u is the control value, u_1 is the control value at the previous moment, and e, e_1, e_2 are the deviations; 2)PID parameter calculation: is the membership calculation of the membership function layer, where x i is the input layer variable, c ij ,b ij are the center value and width of the membership function respectively; a k is the node value of the fuzzy inference layer, K l The variable value of the output layer is the controller input parameter; 3) Parameter correction method: epid=[e-e_1,e,e-2e_1+e_2]; Where η is the learning rate 0.75, l = 1, 2, 3; k = 1, 2, ..., 7; j = 1, 2, ..., 7; is the first-order gradient of weights wlk, cij, bij, Δw lk , Δc ij , Δb ij is the weight update increment; The number of nodes in the first layer of the neural network is 2, the number of nodes in the second layer is 7, the number of nodes in the third layer is 49, and the number of nodes in the last layer is 3.
10. A signal processing and flow control method suitable for a thermal distributed flow controller according to claim 1, characterized in that: Including mean filtering, Kalman filtering based on residual judgment, fuzzy neural network PID, and flow conversion algorithm.