A data-driven method for fault diagnosis of sewage treatment sensors
The KPCA method is combined with the RBF kernel function, SPE and T2 indicators, and the sensor effectiveness index SVI to solve the accuracy problem of sewage treatment sensor fault diagnosis, achieve accurate detection and data recovery of sewage treatment sensor faults, and improve the sewage treatment process. monitoring and control effects.
Patent Information
- Application Number
- CN202310160516.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2043-02-24
AI Technical Summary
Existing signal processing methods have poor diagnostic effect on sewage treatment sensor faults, making it difficult to accurately determine the location and occurrence time of the faulty sensor.
The KPCA method is combined with the RBF kernel function, the SPE and T2 indicators are used to determine sensor faults, and the location of the faulty sensor is found by calculating the sensor effectiveness index SVI. Finally, the fault data is restored through the loop iteration method.
It achieves accurate detection and location determination of sewage treatment sensor faults, restores fault data, and improves the monitoring and control effects of the sewage treatment process.
Smart Images

Figure CN116046048B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of fault diagnosis of sewage treatment plants, and in particular to a data-driven sewage treatment sensor fault diagnosis method. Background Art
[0002] The activated sludge method is currently the main method for urban sewage treatment in my country. The activated sludge treatment process includes five parts: pretreatment, primary sedimentation, aeration, secondary sedimentation, and sludge return. The inlet sewage enters the primary sedimentation tank after pretreatment, and enters the aeration tank after initial sedimentation. The microbial community decomposes organic pollutants under anaerobic, anoxic, and aerobic conditions, and removes nitrogen and phosphorus. The mixed effluent from the aeration tank flows into the secondary sedimentation tank, and the clarified water is discharged after solid-liquid separation. A part of the sludge produced in the secondary sedimentation tank is returned to the aeration tank to maintain the number of microorganisms in the aeration tank at an appropriate level. The remaining sludge is mixed with the sludge in the primary sedimentation tank, and then digested, dehydrated, and reused. The aeration and secondary sedimentation process is very complicated and involves many physical and biochemical reactions. In order to reduce casualties and unqualified sewage treatment caused by failures, it is very necessary to conduct comprehensive detection and diagnosis of various processes in sewage treatment plants through existing technical means.
[0003] The sewage treatment process is a complex biochemical reaction process with the characteristics of time-varying, large lag, strong coupling, and significant nonlinearity. The mathematical modeling process is extremely complex and requires many idealized assumptions. Therefore, it is very difficult to establish an analytical model for fault diagnosis. The data-driven method does not require prior knowledge and mathematical models, and is suitable for the diagnosis of sewage treatment processes with sufficient data. Because all data involved in the sewage treatment process are based on data collected by normal sensors. Once a sensor fails, the collected data will lose reliability, and it will be meaningless to use it for process control and monitoring. The ability to detect sensor failures is crucial for comprehensive monitoring of sewage treatment processes through process information from sensors. However, the sewage treatment process has serious uncertainty, time-varying, and sensitivity to interference, which means that it is difficult to determine the location and occurrence time of the faulty sensor based on experience alone. At present, the commonly used signal processing method based on PCA (principal component analysis) has a very poor processing effect on nonlinear signals, so KPCA (kernel principal component analysis) is needed to process it. Summary of the invention
[0004] Based on the traditional PCA method, the present invention uses the RBF kernel as the kernel function, designs a method to complete the KPCA modeling using the actual data collected by the relevant sensors, and uses SPE and T 2 The indicator determines whether a sensor failure has occurred, finds the location of the faulty sensor after determining that a fault has occurred, and finally restores the data of the faulty sensor.
[0005] The purpose of the present invention is to provide a data-driven sewage treatment sensor fault diagnosis method to solve the problem that existing signal processing methods have poor effects and are difficult to accurately diagnose sensor faults.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a data-driven sewage treatment sensor fault diagnosis method, characterized by comprising the following steps:
[0007] S1: Collect the real data of each sensor in the sewage treatment plant when it is working, complete the normalization operation of the obtained data, extract the data during normal working according to the proportion as the training set of the model, and the remaining data as the test set of the model;
[0008] S2: Use the training set data processed in the previous step to complete the KPCA modeling, calculate the confidence limit value CL, substitute the test set data into the model to calculate the squared prediction error value SPE and Hotelling statistic T 2 Metrics; Compare SPE and T of test data 2 Whether the value exceeds the confidence limit CL; if it exceeds this value, it is determined that the sensor has failed, otherwise it is determined that the sensor is normal;
[0009] S3: Once it is determined that a sensor has a fault, it is necessary to classify the fault. According to the fault characteristics, it can be divided into four categories: fixed deviation fault, drift fault, accuracy degradation fault and complete fault;
[0010] S4: Find the location of the faulty sensor by calculating the sensor validity index SVI;
[0011] S5: Use the loop iteration method to complete the reconstruction and recovery of fault data.
[0012] A further technical solution is that the specific steps of step S1 are as follows:
[0013] S1-1. The relevant data of a certain type of m sensors in a sewage treatment plant in a certain city are sampled n times at the same time, and a total of m×n sampling data are selected;
[0014] S1-2. In order to eliminate the dimensional influence between data features, the sample data of S1-1 is normalized. This paper normalizes the sample data to the interval [-1,1]. The specific normalization formula is as follows:
[0015]
[0016] where x i is the original data sample before normalization, is the normalized data sample, x max 、x minare the maximum and minimum values in the original data samples respectively;
[0017] S1-3. Extract the data when the sensor is working normally from the normalized sample data of S1-2, accounting for 80% of the total sample data, and use it as the training set of the model. The remaining 20% of the data sample set is used as the test set. For the two types of data, the data matrix is established as follows:
[0018]
[0019] Among them, x m (n) represents the nth sampling data of the mth sensor;
[0020] A further technical solution is that the specific steps of step S2 are as follows:
[0021] S2-1. Decompose the training set data of the sampled signal in a specific space and divide the space into PCS (principal component space) and RS (residual space);
[0022] S2-2. Calculate the confidence limit CL of the system where the sensor is located as 0.1;
[0023] S2-3. Calculate the SPE value and T of the test set data of S1 2 If the calculated SPE value and T 2 The value is always lower than the confidence limit CL calculated by S2-2, it can be determined that all sensors of the system are not faulty; if after a certain sample point, the SPE value and T 2 If the value exceeds the set threshold, it can be determined that there is a faulty sensor in the system;
[0024] S3: Among the faulty sensors identified in S2-2, if the SPE value and T 2 The value increases rapidly and exceeds the set threshold, it can be determined that the fault is a fixed deviation fault; if the SPE value of the faulty sensor and T 2 If the value far exceeds the confidence limit and grows exponentially, it can be determined that the fault is a drift fault; if the faulty sensor reading is the maximum reading or zero when the sensor is designed, it can be determined that the fault is a complete fault; if the SPE value and T 2 The values are all greater than the set threshold, and very few indicator values are below the confidence limit. 2 The fluctuation of the value index increases, showing obvious volatility. It can be determined that the fault is a precision degradation fault.
[0025] A further technical solution is that the specific steps of step S4 are as follows:
[0026] S4-1. First, we need to assume that each sensor in the system has a fault. Reconstruct the sensor sampling data that has been determined to have one of the four known fault types in step S3. Now assume that the i-th sensor in sample X has a fault, then reconstruct the value of the sensor measurement value The calculation formula is as follows:
[0027]
[0028] in, Indicates that the i-th column of matrix C is replaced by 0; c ii ≠1;
[0029] S4-2. The SPE value calculated after data reconstruction in step S4-1 is calculated as follows:
[0030]
[0031] Among them, SPE(x′ j ) represents the SPE value calculated after data reconstruction of the measured data x in the jth direction; the fault location rules are as follows:
[0032] If SVI j If it is close to 0, direction j is the sensor fault direction, then the sensor is a faulty sensor under this fault type;
[0033] If SVI j If it is close to 1, direction j is not the sensor fault direction, and the sensor is not a faulty sensor under this fault type;
[0034] S5: Use the anti-normalization method to reconstruct the sampling data of the faulty sensor found in step S4, restore the faulty data, and compare the changes in the system SPE value before and after data recovery.
[0035] Compared with the prior art, the beneficial effects of the present invention are: providing a sensor fault diagnosis method for a sewage treatment plant based on KPCA and SPE indicators, performing fault detection on sensors in the sewage treatment process, using the sensor effectiveness index SVI to determine the location of the faulty sensor, and finally using the inverse normalization method to complete the reconstruction of the sensor sampling data to achieve the recovery of the faulty data. By comparing the changes in the system SPE value before and after data recovery, it is proved that the method has a good effect and can meet the actual industrial needs to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a fault diagnosis flow chart of the present invention.
[0037] Figure 2The SPE value and T of the No. 1 flow sensor with a fixed deviation fault 2 Value curve graph.
[0038] Figure 3 This is the SVI indicator curve graph for flow sensors No. 1-5.
[0039] Figure 4 The figure is a curve diagram of the system SPE value before and after data recovery. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings.
[0041] Figure 1 A data-driven sewage treatment sensor fault diagnosis method is shown, comprising the following steps:
[0042] S1: Collect the real data of each sensor in the sewage treatment plant when it is working, complete the normalization operation of the obtained data, extract the data during normal operation according to a certain proportion as the training set of the model, and the remaining data as the test set of the model.
[0043] S1-1. The relevant data of a certain type of m sensors in a sewage treatment plant in a certain city are sampled n times at the same time, and a total of m×n sampling data are selected;
[0044] S1-2. In order to eliminate the dimensional influence between data features, the sample data of S1-1 is normalized. This paper normalizes the sample data to the interval [-1,1]. The specific normalization formula is as follows:
[0045]
[0046] where x i is the original data sample before normalization, is the normalized data sample, x max 、x min are the maximum and minimum values in the original data samples respectively;
[0047] S1-3. Extract the data of the sensor working normally from the normalized sample data of S1-2, accounting for 80% of the total data sample volume, and use it as the training set of the model. The remaining 20% of the data sample set is used as the test set. For the two types of data, the data matrix is established as follows:
[0048]
[0049] Among them, x m (n) represents the nth sampling data of the mth sensor.
[0050] S2: Use the training set data processed in the previous step to complete the KPCA modeling, calculate the confidence limit value CL, substitute the test set data into the model to calculate the squared prediction error value SPE and Hotelling statistic T 2 Indicator. Compare the SPE and T of the test data 2 Whether the value exceeds the confidence limit CL. If it exceeds this value, it can be determined that the sensor has failed, otherwise it is determined that the sensor is normal.
[0051] S2-1. Decompose the training set data of the sampled signal in a specific space and divide the space into PCS (principal component space) and RS (residual space);
[0052] S2-2. The confidence limits CL of the calculated sensor system are all 0.1;
[0053] S2-3. Calculate the SPE value and T of the test set data of the sampled signal 2 If the calculated SPE value and T 2 The value is always lower than the confidence limit CL calculated by S2-2, it can be determined that all sensors of the system are not faulty; if after a certain sample point, the SPE value and T 2 If the value exceeds the set threshold, it can be determined that there is a faulty sensor in the system.
[0054] S3: Among the faulty sensors identified in S2-2, if the SPE value and T 2 The value increases rapidly and exceeds the set threshold, it can be determined that the fault is a fixed deviation fault; if the SPE value of the faulty sensor and T 2 If the value far exceeds the confidence limit and grows exponentially, it can be determined that the fault is a drift fault; if the reading of the faulty sensor is the maximum reading designed for the sensor or zero, it can be determined that the fault is a complete fault; if the SPE value and T 2 The values are all greater than the set threshold, and very few indicator values are below the confidence limit. 2 The fluctuation of the value index increases, showing obvious volatility. It can be determined that the fault is a precision degradation fault.
[0055] S4: Find the location of the faulty sensor by calculating the sensor validity index SVI.
[0056] S4-1. First, we need to assume that each sensor in the system has a fault. Reconstruct the sensor sampling data that has been determined to have one of the four known fault types in step S3. Now assume that the i-th sensor in sample X has a fault, then reconstruct the value of the sensor measurement value The calculation formula is as follows:
[0057]
[0058] in, Indicates that the i-th column of matrix C is replaced by 0; c ii ≠1;
[0059] S4-2. The SPE value calculated after data reconstruction in step S4-1 is calculated as follows:
[0060]
[0061] Among them, SPE(x′ j ) represents the SPE value calculated after data reconstruction of the measured data x in the jth direction; the fault location rules are as follows:
[0062] If SVI j If it is close to 0, direction j is the sensor fault direction, then the sensor is a faulty sensor under this fault type;
[0063] If SVI j If it is close to 1, direction j is not the sensor fault direction, and the sensor is not a faulty sensor under this fault type.
[0064] S5: Use the anti-normalization method to reconstruct the sampling data of the faulty sensor found in step S4, restore the faulty data, and compare the changes in the system SPE value before and after data recovery.
[0065] The actual data of 5 liquid level sensors in a sewage treatment plant in Qingdao in November was used as the research object. The sampling interval was 5 minutes. A total of 3750 sampling data of 5 liquid level sensors were selected for this month and divided into two groups according to a certain ratio for model training and testing respectively. The data matrix is established as follows:
[0066]
[0067] Among them, flow 1 (1) represents the first sampling data of the first flow sensor.
[0068] Figure 2 is the SPE value and T of the system where the flow sensor test set data is located 2 It can be seen that after the 50th sample point, the system's SPE value and T 2 The value increases rapidly and exceeds the set threshold. It can be determined that there is a faulty sensor in the system. And in this case, the SPE value and T after the fault are 2The value does not rise all the time, but fluctuates within a certain range, so the fault type of the detected sensor is determined to be a fixed deviation fault. Then the SVI index of each sensor is calculated for the sampling data of flow sensors 1-5. Figure 3 The SVI indexes of flow sensors 1-5 are shown respectively. From the SVI index graph of the above five sensors, it can be seen that the indexes of flow sensors 2-4 are all close to 1, while the SVI index of flow sensor 1 is different from the above four sensors and approaches 0 after the 50th point. Therefore, it can be concluded that flow sensor 1 is the faulty sensor in the system. Then the anti-normalization method is used to process the reconstructed data of flow sensor 1 to realize the recovery of faulty data. Figure 4 The changes in the system SPE value before and after data recovery are given. It can be seen that the recovered data can almost replace the real data, and the relative deviation is small, which proves that the method can achieve the recovery of fault data.
[0069] The described embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
Claims
1. A data-driven sewage treatment sensor fault diagnosis method, characterized in that The following steps are involved: S1: Collect the real data of each sensor in the sewage treatment plant when it is working, complete the normalization operation of the obtained data, extract the data during normal working according to the proportion as the training set of the model, and the remaining data as the test set of the model; S2: Completed using the training set data processed in the previous step Modeling and calculating confidence limits , substitute the test set data into the model to calculate the squared prediction error value and Hotelling statistic Indicators; Comparison of test data and Whether the value exceeds the confidence limit ; If it exceeds this value, it is determined that the sensor has failed, otherwise it is determined that the sensor is normal; S3: When the sensor fails, the fault is classified into four categories: fixed deviation fault, drift fault, accuracy degradation fault and complete fault according to the fault characteristics; S4: By calculating the sensor effectiveness index , find the location of the faulty sensor; S5: Use the loop iteration method to complete the reconstruction and recovery of the fault data; The specific steps of step S1 are as follows: S1-1. The relevant data of the sensors are sampled simultaneously times, a total of Sampling data; S1-2. In order to eliminate the dimensional influence between data features, the sample data of S1-1 is normalized to the interval [-1,1]. The specific normalization formula is as follows: in is the original data sample before normalization, is the normalized data sample, , are the maximum and minimum values in the original data samples respectively; S1-3. Extract the data when the sensor is working normally from the normalized sample data of S1-2, accounting for 80% of the total sample data, and use it as the training set of the model. The remaining 20% of the data sample set is used as the test set. For the two types of data, the data matrix is established as follows: in, Indicates The sensor sub-sampled data; The specific steps of step S2 are as follows: S2-1. Decompose the training set data of the sampled signal in a specific space and divide the space into a principal component space and a residual space; S2-2. Calculate the confidence limits of the sensor system is 0.1; S2-3. Calculate the test set data of S1 Value and Value, if calculated Value and The value is always lower than the confidence limit calculated by S2-2 , it is determined that all sensors of the system are not faulty; if after a certain sample point, the system Value and When the value exceeds the set threshold, it is determined that there is a faulty sensor in the system; The step S3 is specifically to: if the faulty sensor is Value and The value increases rapidly and exceeds the set threshold, and the fault is judged to be a fixed deviation fault; if the faulty sensor Value and If the value far exceeds the confidence limit and grows exponentially, the fault is determined to be a drift fault; if the reading of the faulty sensor is the maximum reading designed for the sensor or zero, the fault is determined to be a complete fault; if the reading of the faulty sensor is Value and The values are all greater than the set threshold, and very few indicator values are below the confidence limit. Value and The fluctuation of the value index increases, showing obvious volatility, and the fault is determined to be a precision degradation fault; The specific steps of step S4 are as follows: S4-1. First, we need to assume that each sensor in the system has a fault; reconstruct the sensor sampling data of one of the four known fault types determined in step S3; specifically: Now assume that in the sample Middle If a sensor fails, the reconstructed value of the sensor measurement value The calculation formula is as follows: in, Represents the matrix No. The columns are replaced with 0; ; S4-2. Reconstruct the data calculated in step S4-1 The value is calculated as follows: in, Indicates measurement data In the After data reconstruction in all directions, the value; the fault location rules are as follows: if Close to 0, direction is the sensor fault direction, then the sensor is a faulty sensor under this fault type; if Close to 1, direction If it is not the sensor fault direction, then the sensor is not a faulty sensor under this fault type; The step S5 specifically uses the anti-normalization method to reconstruct the sampling data of the faulty sensor found in step S4, recover the faulty data, and compare the system performance before and after data recovery. Changes in value.
