Gas sensor environment interference compensation method
By adding temperature and humidity sensors to the gas sensor, combining time domain and frequency domain analysis, designing a deep learning model and adopting a dynamic drift compensation mechanism, the problems of low measurement accuracy and poor compensation effect of gas sensors in complex environments are solved, and the detection accuracy and model development efficiency are improved.
Patent Information
- Application Number
- CN202510798163.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-23
AI Technical Summary
Existing gas sensors have low measurement accuracy in complex environments, poor environmental interference compensation effect, and low efficiency in calibration and detection algorithm model development, making it difficult to cope with the differences between individual sensors.
Add high-precision temperature sensors and humidity sensors, combine time domain and frequency domain analysis, design deep learning models, fuse multi-sensor data, adopt dynamic drift compensation mechanism and Bayesian reasoning to update the model, and realize comprehensive monitoring and compensation of environmental interference.
It improves the detection accuracy and adaptability of gas sensors in multi-gas environments, reduces the impact of cross-interference, improves the generalization ability and compensation effect of the model, and significantly reduces the cost of manual intervention.
Smart Images

Figure CN120685855A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sensor technology, and in particular to a method for compensating for environmental interference of a gas sensor. Background Art
[0002] At present, gas sensors play an important role in environmental monitoring and industrial detection. However, environmental interference has a significant impact on the measurement accuracy of gas sensors, and identifying, filtering and compensating for these interferences are challenging. For example, existing technologies such as CN114461621A use an artificial bee colony algorithm to optimize the BP neural network for temperature and humidity compensation, but the initial weights and thresholds of the BP neural network rely on random initialization, which may cause the model to fall into a local optimum, thereby affecting the compensation accuracy. In addition, this method mainly targets temperature and humidity interference, and does not involve compensation for other environmental factors such as airflow. In order to address the shortcomings of the existing technology, the present invention proposes a method that integrates time domain and frequency domain analysis, fuses multi-sensor data and optimizes the algorithm model to achieve more comprehensive environmental interference compensation.
[0003] At the same time, the calibration and detection algorithm model development processes for gas sensors suffer from inefficiencies. Existing technologies, such as BP neural networks, require extensive manual parameter adjustments during training and are inadequately adaptable to issues such as sensor nonlinearity and production consistency. Existing optimization algorithms (such as particle swarm optimization (PSO) and artificial bee colony algorithms) are susceptible to the effects of initial parameter settings when optimizing neural networks, resulting in limited model generalization and difficulty in effectively addressing the differences between individual sensors.
[0004] Therefore, in response to the above problems, the present invention provides a gas sensor environmental interference compensation method, which can be applied to gas sensors of industrial and commercial gas detectors, household gas alarms, air quality monitors and other products to reduce the impact of cross-interference and enhance adaptability to multiple gas environments. Summary of the Invention
[0005] The purpose of the present invention is to overcome the deficiencies in the prior art, solve or at least alleviate the problems of low measurement accuracy and poor compensation effect of gas sensors under complex environmental interference, and provide a gas sensor environmental interference compensation method that integrates time domain and frequency domain analysis, fuses multi-sensor data and optimizes the algorithm model.
[0006] To achieve the above objectives, the present invention provides the following technical solutions: A method for compensating for environmental interference in a gas sensor, comprising the following steps: S1. Add high-precision temperature sensors and humidity sensors to the gas detection equipment to collect data synchronously with the gas sensors; S2. During the calibration phase, the standard gas concentration, ambient temperature, humidity and timestamp data are recorded and a calibration data set is constructed. S3. Obtain the time domain and frequency domain characteristics of the temperature effect on gas concentration detection by calibrating the experimental data in the data set; S4. Extracting the response curves of humidity in the time domain and frequency domain based on experimental data; S5. Comprehensively analyze the time domain and frequency domain features, design a deep learning model, and integrate the sensor response data of temperature, humidity, and the gas to be measured for training; S6. Iteratively optimize the deep learning model based on actual gas concentration data to form a diagnostic model and algorithm; S7. Apply the optimized deep learning model to production calibration and actual gas detection.
[0007] In order to further realize the present invention, the following technical solutions may be preferably used: Preferably, the time domain characteristics include slope, response time constant and peak voltage; The slope calculation formula is Slope=(VWE_max-VWE_min) / Δt, where VWE_max is the maximum value of the working electrode voltage, VWE_min is the minimum value of the working electrode voltage, and Δt is the time it takes for the signal to rise from the minimum value to the maximum value; The response time constant fitting formula is V(t)=Vsteady(1-et / τ), where V(t) is the response voltage at time t, Vsteady is the stable voltage, τ is the response time constant, e is the base of the natural logarithm, and t is the time variable; The peak voltage calculation formula is Vpeak=max(VWE_t)−VWE_base, where max(VWE_t) is the maximum voltage in the cycle and VWE_base is the base voltage.
[0008] Preferably, the frequency domain feature converts the time domain signal into a frequency domain signal through fast Fourier transform, and the fundamental frequency amplitude is the amplitude of the fundamental frequency component in the frequency domain signal, which reflects the intensity of the main frequency component in the signal and is related to the periodic changes of the gas concentration or environmental factors.
[0009] Preferably, a dynamic drift compensation mechanism is adopted in the model training process, including calculating the long-term trend of the sensor output signal, extracting the drift characteristics, judging whether the model needs to be updated based on Bayesian reasoning, and triggering the model self-update when the fault characteristic coefficient is greater than the set threshold; The dynamic drift compensation mechanism also includes monitoring the changing trend of gas concentration within a time window, and adjusting the model weights to adapt to the new environmental conditions when the changing trend deviates from the expected value.
[0010] Preferably, the deep learning model adopts a neural network architecture that fuses multimodal data. The input layer contains the original voltage signal, temperature, humidity of the gas sensor, and time domain features and frequency domain features extracted through complex feature engineering. The feature fusion layer adopts a bidirectional LSTM network, combining the past and future information of the time series to capture the dependency of the sensor output signal in the time dimension.
[0011] Preferably, the step S7 is specifically as follows: Analyze the deviation between the corrected gas concentration value and the actual gas concentration value, determine the type of environmental interference, and select a compensation strategy based on the interference type; Types of environmental interference include temperature drift, humidity fluctuation, air flow disturbance and noise interference; Among them, temperature drift is manifested as the output signal of the gas sensor showing a monotonic trend with temperature changes, humidity fluctuation is manifested as the output signal fluctuates periodically with humidity changes, airflow disturbance is manifested as the output signal changes dramatically in a short period of time, and noise interference is manifested as the presence of random high-frequency components in the output signal.
[0012] Preferably, step S7 includes the following steps: S71. When the environmental interference type is temperature drift and the deviation value is less than the first temperature drift threshold, perform online adjustment on the deep learning model; when the deviation value is greater than the first temperature drift threshold and less than the second temperature drift threshold, trigger a level 1 alarm; when the deviation value is greater than the second temperature drift threshold, trigger a level 2 alarm and start a dynamic drift compensation mechanism; S72. When the environmental interference type is humidity fluctuation and the deviation value is less than the first humidity fluctuation threshold, the deep learning model is adjusted online; when the deviation value is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, a first-level alarm is triggered; when the deviation value is greater than the second humidity fluctuation threshold, a second-level alarm is triggered and the working mode of the gas sensor is adjusted.
[0013] Preferably, after executing step S72, the following steps are further executed: S72a. When the deviation value is greater than the first humidity fluctuation threshold, calculate the frequency characteristic of the humidity fluctuation. If the frequency characteristic is lower than the first set value, determine that the interference is caused by slow humidity change; if the frequency characteristic is higher than the second set value, determine that the interference is caused by rapid humidity change. S72b, when the deviation value of the current time window is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, triggering a level 1 alarm and increasing the data sampling frequency; S72c: When the deviation value of the current time window is greater than the second humidity fluctuation threshold, a secondary alarm is triggered and the working mode of the gas sensor is adjusted to reduce sensitivity; S72d: When the deviation value of the current time window is greater than the third humidity fluctuation threshold, a level 3 alarm is triggered and the gas detection operation is suspended.
[0014] Preferably, the step S72 further includes the following steps: S72e: When the deviation values in the subsequent multiple time windows are all less than the first humidity fluctuation threshold, it is determined to be a transient interference, the first-level alarm is lifted, and the default sampling frequency is restored; S72f, when the maximum of the deviation values in the subsequent multiple time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, proceed to step S72c; S72g: When each deviation value in a subsequent plurality of time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, adjust the working mode of the gas sensor.
[0015] Preferably, before executing step S7, the following steps are further included: S701, removing the change value of the signal caused by environmental factors from the output signal of the gas sensor in the previous multiple time windows to generate a determination signal; S702, determining the cause of the interference based on the determination signal. If the signal shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by a sudden change in the external environment. The determination method of the determination signal in step S702 is: In a stable environment, if the signal of the gas sensor shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by periodic changes in the external environment.
[0016] The beneficial effects of the present invention are: This invention achieves comprehensive monitoring of environmental interference factors by adding high-precision temperature and humidity sensors. Combining time-domain and frequency-domain feature analysis improves the ability to identify environmental interference. A deep learning model that integrates multimodal data can more accurately capture the impact of environmental interference on gas concentration detection, effectively compensating for measurement errors caused by environmental factors such as temperature and humidity.
[0017] The present invention also addresses the issue of sensor drift degradation over long periods of use through a dynamic drift compensation mechanism. A Bayesian inference-based model update strategy determines whether a model update is necessary based on the sensor's actual operating conditions, ensuring the continuity and stability of the compensation effect.
[0018] Furthermore, by analyzing the differences in the responses of different gases in the time and frequency domains and combining them with multi-source data fusion technology, the present invention improves the sensor's selectivity in multi-gas environments, reduces the effects of cross-interference, and enhances its adaptability to multi-gas environments. Experimental verification has shown that the technical solution of the present invention has increased gas detection accuracy to over 95%, while also increasing the efficiency of developing calibration and detection algorithm models by 40%, significantly reducing manual intervention costs and providing reliable technical support for the practical application of gas sensors. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is the overall flow chart of the present invention.
[0020] Figure 2 FIG. 4 is a flow chart of the dynamic drift compensation mechanism of the present invention.
[0021] Figure 3 2 is a block diagram of the deep learning model of the present invention.
[0022] Figure 4 This is a flow chart of the environmental interference type determination and compensation strategy of the present invention.
[0023] Figure 5 Detailed flow chart of humidity fluctuation compensation of the present invention.
[0024] Figure 6 This is a flow chart for determining the cause of interference according to the present invention. DETAILED DESCRIPTION
[0025] In the description of the present invention, it should also be noted that, unless otherwise expressly specified or limited, the terms "disposed," "installed," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0026] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.
[0027] Example 1 Gas sensors play a vital role in environmental monitoring and industrial testing. However, environmental interference significantly impacts the measurement accuracy of gas sensors. Furthermore, the calibration and detection algorithm model development processes for gas sensors are inefficient. Existing technologies, such as BP neural networks, require extensive manual parameter adjustments during training and are inadequately adaptable to issues such as sensor nonlinearity and production consistency. Existing optimization algorithms (such as particle swarm optimization (PSO) and artificial bee colony algorithms) are susceptible to the effects of initial parameter settings when optimizing neural networks, resulting in limited model generalization and difficulty in effectively addressing differences between individual sensors.
[0028] Reference Figure 1 This embodiment discloses a method for compensating for environmental interference of a gas sensor, which is characterized by comprising the following steps: S1. Add high-precision temperature sensors and humidity sensors to the gas detection equipment to collect data synchronously with the gas sensors; S2. During the calibration phase, the standard gas concentration, ambient temperature, humidity and timestamp data are recorded and a calibration data set is constructed. S3. Obtain the time domain and frequency domain characteristics of the temperature effect on gas concentration detection by calibrating the experimental data in the data set; S4. Extracting the response curves of humidity in the time domain and frequency domain based on experimental data; S5. Comprehensively analyze the time domain and frequency domain features, design a deep learning model, and integrate the sensor response data of temperature, humidity, and the gas to be measured for training; S6. Iteratively optimize the deep learning model based on actual gas concentration data to form a diagnostic model and algorithm; S7. Apply the optimized deep learning model to production calibration and actual gas detection.
[0029] In the gas detection equipment, a high-precision temperature sensor is added to realize real-time monitoring of the ambient temperature, while retaining the collaborative work of the humidity sensor and the gas sensor to ensure the synchronous collection of multi-source data.
[0030] During the equipment calibration phase, standard gas concentration, ambient temperature, and timestamp data are recorded synchronously to form a calibration data set. During sampling, sensor output signals and temperature data are collected at a fixed interval of 1 second to construct a time series database.
[0031] After the original signal is preprocessed, the time domain features are calculated, including slope, response time constant and peak voltage; The slope calculation formula is Slope=(VWE_max-VWE_min) / Δt, where VWE_max is the maximum value of the working electrode voltage, VWE_min is the minimum value of the working electrode voltage, and Δt is the time it takes for the signal to rise from the minimum value to the maximum value; The response time constant fitting formula is V(t)=Vsteady(1-et / τ), where V(t) is the response voltage at time t, Vsteady is the stable voltage, τ is the response time constant, e is the base of the natural logarithm, and t is the time variable; The peak voltage calculation formula is Vpeak=max(VWE_t)−VWE_base, where max(VWE_t) is the maximum voltage in the process, VWE_base is the base voltage, and the peak voltage is the maximum value of the sensor response signal in the entire process.
[0032] Frequency domain feature calculation converts the sensor's time domain response signal into the frequency domain through Fourier transform, thereby analyzing the signal's frequency components and distribution. Fast Fourier transform is an algorithm that efficiently calculates discrete Fourier transforms, converting time domain signals into frequency domain signals. The calculation method is: For a time domain signal x(n) of length N, the calculation formula for X(k) is: , where k=0. The fundamental frequency amplitude is the amplitude of the fundamental frequency component in the frequency domain signal, which reflects the strength of the main frequency component in the signal. In the application of gas sensors, the fundamental frequency amplitude is related to the periodic changes of gas concentration or environmental factors. The calculation method of the fundamental frequency amplitude is to obtain X(k) through fast Fourier transform, and then find the frequency component k1 corresponding to the fundamental frequency, then Total harmonic distortion indicates the relative content of harmonic components in the signal, which reflects the degree of signal distortion. The calculation method is: , where Ai is the amplitude of the i-th harmonic, and A1 is the fundamental frequency amplitude. In this paper, time-domain and frequency-domain features are used to construct a deep learning model to compensate for environmental interference in gas sensors. Features such as slope, response time constant, fundamental frequency amplitude, and total harmonic distortion are used as inputs to the model. The model learns the relationship between these features and environmental factors (such as temperature and humidity) to correct sensor measurements.
[0033] Reference Figure 3 The deep learning model of the present invention adopts a deep neural network architecture that integrates multimodal data, which is significantly different from the existing technology that mostly uses single modal data or simple neural network structures. The specific architecture is as follows: Input layer: Existing technologies typically use only temperature and humidity data and raw gas sensor measurements as input. However, the input layer of this invention not only includes the raw gas sensor voltage signals (V_WE, V_AE), temperature (T), and humidity (H), but also incorporates time-domain features (such as slope and response time constant) and frequency-domain features (such as fundamental frequency amplitude, total harmonic distortion, and phase difference) extracted through complex feature engineering. This fusion of multimodal data provides the model with richer information, helping to more accurately capture the impact of environmental interference on gas concentration detection.
[0034] Feature fusion layer: The present invention adopts a bidirectional LSTM network, which can simultaneously consider the past and future information of the time series, and has unique advantages in capturing the dependencies of sensor output signals in the time dimension. For example, when processing the changes in the response signal of the gas sensor over time, the bidirectional LSTM can better understand the dynamic change trend of the signal, thereby more accurately analyzing the impact of environmental interference. In addition, unlike the existing technology that simply relies on the fully connected layer for feature processing, the present invention introduces a 1D convolution layer to extract frequency domain features. The 1D convolution layer can automatically learn local patterns in frequency domain features and effectively extract the frequency domain information of the signal. Through the convolution operation, the model can identify the impact of different frequency components on gas concentration detection, further improving the model's ability to identify environmental interference. The specific formula is Output layer: This invention employs more complex weight adjustments and nonlinear activation functions in its output layer design to ensure the accuracy and stability of the output results. Compared to the simple linear output methods of existing technologies, this output layer can better fit the complex nonlinear relationship between gas concentration and environmental interference.
[0035] Reference Figure 2 In terms of model training and optimization, most existing technologies do not consider the long-term drift problem of sensors. However, this invention establishes a dynamic drift compensation mechanism. The specific steps are as follows: Drift feature extraction: Calculate the long-term trend of the sensor output signal, analyze historical data, and extract features that can reflect the sensor drift.
[0036] Bayesian Inference: , set the threshold θ=0.9, if P , then the model self-update is triggered. This judgment method based on Bayesian reasoning can determine whether the model needs to be updated and compensate for the drift effect according to the actual operation of the sensor.
[0037] In actual scenarios, such as industrial waste gas monitoring systems, gas sensors are used to detect the concentration of harmful gases in the waste gas, while temperature sensors and humidity sensors monitor the ambient temperature and humidity, respectively. When the ambient temperature or humidity changes, the output signal of the gas sensor will be disturbed, resulting in measurement errors. Through the method and system of the present invention, it is possible to monitor changes in environmental parameters in real time, and compensate for interference factors through a deep learning model module, thereby improving the accuracy of gas concentration detection. During long-term operation, the sensor may drift. At this time, the model is updated through a dynamic drift compensation mechanism to ensure the continuity and stability of the compensation effect.
[0038] This invention achieves comprehensive monitoring of environmental interference factors by adding high-precision temperature and humidity sensors. Combining time-domain and frequency-domain feature analysis improves the ability to identify environmental interference. A deep learning model that integrates multimodal data can more accurately capture the impact of environmental interference on gas concentration detection, effectively compensating for measurement errors caused by environmental factors such as temperature and humidity.
[0039] The present invention also addresses the issue of sensor drift degradation over long periods of use through a dynamic drift compensation mechanism. A Bayesian inference-based model update strategy determines whether a model update is necessary based on the sensor's actual operating conditions, ensuring the continuity and stability of the compensation effect.
[0040] Example 2 In order to improve the selectivity of the sensor in a multi-gas environment, reduce the influence of cross-interference, and enhance the adaptability to a multi-gas environment by analyzing the response characteristics of different gases in the time domain and frequency domain and combining multi-source data fusion technology.
[0041] Reference Figure 4 - Figure 6 In this embodiment, a method for compensating for environmental interference of a gas sensor is provided, wherein step S7 is specifically as follows: Analyze the deviation between the corrected gas concentration value and the actual gas concentration value, determine the type of environmental interference, and select a compensation strategy based on the interference type; Types of environmental interference include temperature drift, humidity fluctuation, air flow disturbance and noise interference; Among them, temperature drift is manifested as the output signal of the gas sensor showing a monotonic trend with temperature changes, humidity fluctuation is manifested as the output signal fluctuates periodically with humidity changes, airflow disturbance is manifested as the output signal changes dramatically in a short period of time, and noise interference is manifested as the presence of random high-frequency components in the output signal.
[0042] The step S7 comprises the following steps: S71. When the environmental interference type is temperature drift and the deviation value is less than the first temperature drift threshold, perform online adjustment on the deep learning model; when the deviation value is greater than the first temperature drift threshold and less than the second temperature drift threshold, trigger a level 1 alarm; when the deviation value is greater than the second temperature drift threshold, trigger a level 2 alarm and start a dynamic drift compensation mechanism; S72. When the environmental interference type is humidity fluctuation and the deviation value is less than the first humidity fluctuation threshold, the deep learning model is adjusted online; when the deviation value is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, a first-level alarm is triggered; when the deviation value is greater than the second humidity fluctuation threshold, a second-level alarm is triggered and the working mode of the gas sensor is adjusted.
[0043] After executing step S72, the following steps are further executed: S72a. When the deviation value is greater than the first humidity fluctuation threshold, calculate the frequency characteristic of the humidity fluctuation. If the frequency characteristic is lower than the first set value, determine that the interference is caused by slow humidity change; if the frequency characteristic is higher than the second set value, determine that the interference is caused by rapid humidity change. S72b, when the deviation value of the current time window is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, triggering a level 1 alarm and increasing the data sampling frequency; S72c: When the deviation value of the current time window is greater than the second humidity fluctuation threshold, a secondary alarm is triggered and the working mode of the gas sensor is adjusted to reduce sensitivity; S72d: When the deviation value of the current time window is greater than the third humidity fluctuation threshold, a level 3 alarm is triggered and the gas detection operation is suspended.
[0044] S72e: When the deviation values in the subsequent multiple time windows are all less than the first humidity fluctuation threshold, it is determined to be a transient interference, the first-level alarm is lifted, and the default sampling frequency is restored; S72f, when the maximum of the deviation values in the subsequent multiple time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, proceed to step S72c; S72g: When each deviation value in a subsequent plurality of time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, adjust the working mode of the gas sensor.
[0045] Before executing step S7, the following steps are also included: S701, removing the change value of the signal caused by environmental factors from the output signal of the gas sensor in the previous multiple time windows to generate a determination signal; S702, determining the cause of the interference based on the determination signal. If the signal shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by a sudden change in the external environment. The determination method of the determination signal in step S702 is: In a stable environment, if the signal of the gas sensor shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by periodic changes in the external environment.
[0046] In practical applications, the specific implementation steps are as follows: 1. Data preprocessing and interference determination The output signals of the gas sensor in the first 10 time windows (30 seconds per window) are input into the environmental compensation module. The baseline drift caused by temperature and humidity factors is removed by wavelet transform, and a judgment signal is generated. The trend analysis of the judgment signal is performed: If the signal shows a monotonic trend with an absolute slope greater than 0.05mV / s in five consecutive windows (e.g., the signal value decreases linearly from 2.1V to 1.8V), it is determined that the sensor performance has degraded due to aging. If the judgment signal presents a sinusoidal fluctuation with a period of 2 to 5 minutes (such as a periodic change of amplitude ±0.3V), it is determined that there is periodic humidity fluctuation in the external environment.
[0047] 2. Temperature drift compensation When temperature drift is detected (for example, the sensor case temperature rises from 25°C to 40°C, causing the output signal to shift by 15%): When the deviation value Δ=12% (lower than the first temperature threshold T1=15%), the weight parameters of the deep learning model are adjusted through the online back-propagation algorithm, and the compensation coefficient α=0.85; When the deviation value Δ=18% (between T1=15% and T2=20%), a level 1 alarm is triggered and the PWM temperature control module is activated to keep the sensor temperature at 35°C. When the deviation value Δ=22% (exceeds T2=20%), the second-level alarm is triggered and dynamic drift compensation is started. The sliding window least squares method is used to fit the temperature-voltage characteristic curve in real time. The compensation formula is: V_comp = V_raw × [1 - 0.03×(T-25)].
[0048] 3. Humidity Fluctuation Handling When humidity fluctuations are detected (such as periodic fluctuations in ambient humidity between 60% and 80% RH): When the deviation value Δ=8% (lower than H1=10%), adjust the forget gate parameter in the LSTM neural network to 0.65; When the deviation value Δ=13% (between H1=10% and H2=15%): the humidity fluctuation frequency f=0.2Hz (lower than the set value F1=0.5Hz) is calculated, which is determined to be a slow humidity change, triggering a level 1 alarm and increasing the sampling frequency from 1Hz to 5Hz; When the deviation value Δ=17% (exceeds H2=15% but is lower than H3=20%): adjust the operating mode to low sensitivity and reduce the electrochemical sensor bias voltage to 0.3V; When Δ>15% for three consecutive windows, the system switches to the backup sensor array and starts the cross-validation mechanism.
[0049] 4. Noise suppression When random high-frequency noise is detected (e.g., an abnormal peak >3dB appears in the signal spectrum between 100 and 500 Hz): The improved empirical mode decomposition (EMD) algorithm was used to decompose the signal into six intrinsic mode functions (IMFs). The entropy of each IMF sample was calculated, and high-frequency components with entropy values greater than 1.2 were denoised using wavelet thresholding. After reconstructing the signal, secondary smoothing was performed using a Kalman filter.
[0050] In a temperature shock test, when the ambient temperature suddenly increased from 25°C to 45°C, the concentration measurement error of the traditional method reached ±25%. However, this embodiment, through a dynamic drift compensation mechanism, controlled the error to within ±6.8%. In a humidity cycle test (30% to 70% RH cyclic changes), the system improved detection stability by 41% by switching operating modes after triggering the second-level alarm.
[0051] The above are only preferred specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solutions and inventive concepts of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A method for compensating for environmental interference of a gas sensor, characterized in that: The following steps are involved: S1. Add high-precision temperature sensors and humidity sensors to the gas detection equipment to collect data synchronously with the gas sensors; S2. During the calibration phase, the standard gas concentration, ambient temperature, humidity and timestamp data are recorded and a calibration data set is constructed. S3. Obtain the time domain and frequency domain characteristics of the temperature effect on gas concentration detection by calibrating the experimental data in the data set; S4. Extracting the response curves of humidity in the time domain and frequency domain based on experimental data; S5. Comprehensively analyze the time domain and frequency domain features, design a deep learning model, and integrate the sensor response data of temperature, humidity, and the gas to be measured for training; S6. Iteratively optimize the deep learning model based on actual gas concentration data to form a diagnostic model and algorithm; S7. Apply the optimized deep learning model to production calibration and actual gas detection.
2. A method for compensating for environmental interference of a gas sensor according to claim 1, characterized in that: The time domain characteristics include slope, response time constant and peak voltage. The frequency domain characteristics convert the time domain signal into a frequency domain signal through fast Fourier transform. The fundamental frequency amplitude is the amplitude of the fundamental frequency component in the frequency domain signal, which reflects the intensity of the main frequency component in the signal and is related to the periodic changes of gas concentration or environmental factors.
3. A method for compensating for environmental interference of a gas sensor according to claim 1, characterized in that: The model training process adopts a dynamic drift compensation mechanism, which includes calculating the long-term trend of the sensor output signal, extracting drift characteristics, judging whether the model needs to be updated based on Bayesian reasoning, and triggering model self-update when the fault characteristic coefficient is greater than a set threshold.
4. A method for compensating for environmental interference of a gas sensor according to claim 4, characterized in that: The dynamic drift compensation mechanism also includes monitoring the changing trend of gas concentration within a time window, and adjusting the model weights to adapt to the new environmental conditions when the changing trend deviates from the expected value.
5. A method for compensating for environmental interference of a gas sensor according to claim 1, characterized in that: The deep learning model adopts a neural network architecture that fuses multimodal data. The input layer contains the original voltage signal, temperature, humidity of the gas sensor, as well as time domain features and frequency domain features extracted through complex feature engineering. The feature fusion layer uses a bidirectional LSTM network to combine the past and future information of the time series to capture the dependency of the sensor output signal in the time dimension.
6. A method for compensating for environmental interference of a gas sensor according to claim 1, characterized in that: The step S7 is specifically as follows: Analyze the deviation between the corrected gas concentration value and the actual gas concentration value, determine the type of environmental interference, and select a compensation strategy based on the interference type; Types of environmental interference include temperature drift, humidity fluctuation, air flow disturbance and noise interference; Among them, temperature drift is manifested as the output signal of the gas sensor showing a monotonic trend with temperature changes, humidity fluctuation is manifested as the output signal fluctuates periodically with humidity changes, airflow disturbance is manifested as the output signal changes dramatically in a short period of time, and noise interference is manifested as the presence of random high-frequency components in the output signal.
7. A method for compensating for environmental interference of a gas sensor according to claim 6, characterized in that: The step S7 comprises the following steps: S71. When the environmental interference type is temperature drift and the deviation value is less than the first temperature drift threshold, perform online adjustment on the deep learning model; when the deviation value is greater than the first temperature drift threshold and less than the second temperature drift threshold, trigger a level 1 alarm; when the deviation value is greater than the second temperature drift threshold, trigger a level 2 alarm and start a dynamic drift compensation mechanism; S72. When the environmental interference type is humidity fluctuation and the deviation value is less than the first humidity fluctuation threshold, the deep learning model is adjusted online; when the deviation value is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, a first-level alarm is triggered; when the deviation value is greater than the second humidity fluctuation threshold, a second-level alarm is triggered and the working mode of the gas sensor is adjusted.
8. A method for compensating for environmental interference of a gas sensor according to claim 7, characterized in that: After executing step S72, the following steps are further executed: S72a. When the deviation value is greater than the first humidity fluctuation threshold, calculate the frequency characteristic of the humidity fluctuation. If the frequency characteristic is lower than the first set value, determine that the interference is caused by slow humidity change; if the frequency characteristic is higher than the second set value, determine that the interference is caused by rapid humidity change. S72b, when the deviation value of the current time window is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, triggering a level 1 alarm and increasing the data sampling frequency; S72c: When the deviation value of the current time window is greater than the second humidity fluctuation threshold, a secondary alarm is triggered and the working mode of the gas sensor is adjusted to reduce sensitivity; S72d: When the deviation value of the current time window is greater than the third humidity fluctuation threshold, a level 3 alarm is triggered and the gas detection operation is suspended.
9. A method for compensating for environmental interference of a gas sensor according to claim 8, characterized in that: The step S72 further includes the following steps: S72e: When the deviation values in the subsequent multiple time windows are all less than the first humidity fluctuation threshold, it is determined to be a transient interference, the first-level alarm is lifted, and the default sampling frequency is restored; S72f, when the maximum of the deviation values in the subsequent multiple time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, proceed to step S72c; S72g: When each deviation value in a subsequent plurality of time windows is greater than the first humidity fluctuation threshold and less than the second humidity fluctuation threshold, adjust the working mode of the gas sensor.
10. A method for compensating for environmental interference of a gas sensor according to claim 9, characterized in that: Before executing step S7, the following steps are also included: S701, removing the change value of the signal caused by environmental factors from the output signal of the gas sensor in the previous multiple time windows to generate a determination signal; S702, determining the cause of the interference based on the determination signal. If the signal shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by a sudden change in the external environment. The determination method of the determination signal in step S702 is: In a stable environment, if the signal of the gas sensor shows a monotonically increasing or decreasing trend, the interference is determined to be caused by sensor aging; if the signal shows a periodic fluctuation trend, the interference is determined to be caused by periodic changes in the external environment.
Citation Information
Patent Citations
Temperature and humidity compensation method and device for gas sensor
CN114461621A
Cited By
High-precision detection method for trace gas in transformer oil based on error compensation
CN122218203A