Gas concentration detection method based on Kalman filtering temperature and humidity compensation

By defining the state vector and establishing the model using the Kalman filter algorithm, the problem of temperature and humidity interference in traditional gas concentration detection methods is solved, thus achieving accuracy and reliability in gas concentration detection.

CN120948703APending Publication Date: 2025-11-14HENAN POLYTECHNIC UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511075987.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Traditional gas concentration detection methods are easily affected by changes in ambient temperature and humidity, resulting in significant measurement errors. Hardware compensation has limited accuracy, software compensation cannot dynamically track sudden changes in temperature and humidity, and multi-sensor data has not been optimized collaboratively.

Method used

The Kalman filter algorithm is used to define the state vector, which includes gas temperature, humidity and concentration. A prediction and observation model is established, and the temperature and humidity compensation gas concentration is calculated in real time through Kalman filtering, and the compensation parameters are dynamically adjusted.

Benefits of technology

This enables the sensor to quickly adapt to environmental changes, maintain measurement stability, reduce error accumulation, and improve the accuracy and reliability of gas concentration detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120948703A_ABST
    Figure CN120948703A_ABST
Patent Text Reader

Abstract

The invention discloses a gas concentration detection method based on Kalman filtering temperature and humidity compensation, and the method comprises the steps: S1, defining state vectors which comprise gas temperature, gas humidity and gas concentration; s2, establishing a prediction model about a state vector, wherein the prediction model is used for predicting the state vector at the current moment according to the temperature, humidity and concentration of the gas at the previous moment; s3, establishing an observation model about the state vector, wherein the observation model is used for expressing the relationship between the measured value of the sensor and the state vector; s4, according to the prediction model and the observation model, combining Kalman filtering to iteratively calculate the gas concentration of temperature and humidity compensation in real time; according to the invention, the gas concentration detection is not influenced by temperature and humidity, and the detection result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas concentration detection, and in particular to a gas concentration detection method based on Kalman filter temperature and humidity compensation. Background Technology

[0002] Gas concentration detection is a key technology in industrial production and environmental monitoring. However, in practical applications, sensors are easily affected by changes in ambient temperature and humidity, leading to significant measurement errors. Traditional solutions mainly fall into two categories: Hardware compensation methods employ temperature and humidity compensation circuits or independent sensors to correct the original signal through hardware circuitry. However, these methods have drawbacks: compensation accuracy depends heavily on the stability of the circuit design, making it difficult to adapt to a wide range of dynamically changing temperature and humidity environments. Furthermore, the hardware is costly and has limited ability to suppress multi-parameter coupling interference (such as the synergistic effect of temperature and humidity).

[0003] Software compensation methods employ static compensation models based on temperature, humidity, and gas concentration established through calibration experiments (e.g., lookup table method, polynomial fitting), or combine them with low-pass filtering algorithms to suppress noise. Limitations: Static models have limitations: fixed compensation coefficients cannot dynamically track sudden changes in temperature and humidity, leading to accumulated errors over long-term use (e.g., sensor drift caused by diurnal temperature variations). Insufficient noise handling: traditional filtering algorithms (e.g., moving average) struggle to distinguish between actual gas concentration changes and environmental noise, easily causing signal delays or distortion. Fragmented multi-source data: decoupling of temperature and humidity data from gas concentration processing fails to achieve collaborative optimization of multi-sensor data. Summary of the Invention

[0004] The purpose of this invention is to provide a gas concentration detection method based on Kalman filter temperature and humidity compensation, which aims to solve the problem of accurate gas concentration detection.

[0005] This invention provides a gas concentration detection method based on Kalman filter temperature and humidity compensation, comprising: S1. Define a state vector, which includes: gas temperature, gas humidity, and gas concentration; S2. Establish a prediction model for the state vector, which is used to predict the state vector at the current moment based on the gas temperature, humidity and concentration at the previous moment; S3. Establish an observation model for the state vector, which is used to describe the relationship between sensor measurements and the state vector; S4. Based on the prediction model and the observation model, the gas concentration with temperature and humidity compensation is calculated in real time using Kalman filtering.

[0006] By employing the embodiments of the present invention, both accuracy and real-time performance are achieved through dynamic balancing of prediction and observation weights using Kalman gain.

[0007] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0008] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0009] Figure 1 This is a flowchart of a gas concentration detection method based on Kalman filter temperature and humidity compensation according to an embodiment of the present invention. Detailed Implementation

[0010] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0011] Example According to embodiments of the present invention, a gas concentration detection method based on Kalman filter temperature and humidity compensation is provided. Figure 1 This is a flowchart of a gas concentration detection method based on Kalman filter temperature and humidity compensation according to an embodiment of the present invention, as shown below. Figure 1 As shown, it specifically includes: S1. Define a state vector, which includes: gas temperature, gas humidity, and gas concentration; S2. Establish a prediction model for the state vector, which is used to predict the state vector at the current moment based on the gas temperature, humidity and concentration at the previous moment; The prediction model uses the following formula: ; in, A represents the temperature, humidity, and concentration of the gas at the previous moment; A is the state transition matrix. This represents the state vector at the previous moment. It is process noise, and it follows a Gaussian distribution. Q represents the prediction covariance.

[0012] When the gas concentration changes slowly, A takes the identity matrix; when the gas concentration changes rapidly, A takes... , , Temperature and humidity attenuation coefficient (usually taken as a value close to 1, such as 0.99).

[0013] S3. Establish an observation model for the state vector, which is used to describe the relationship between sensor measurements and the state vector; The observation model uses the following formula: ; Among them, z k H represents the observation values ​​obtained from the gas temperature sensor, gas humidity sensor, and gas concentration sensor. H is the observation matrix. α and β are the influence coefficients of temperature and humidity on concentration compensation, v k It is observation noise, which follows a Gaussian distribution. R is the observation covariance.

[0014] The determination of α and β involves measuring changes in gas concentration under constant temperature and humidity, establishing a nonlinear relationship between temperature, humidity, and gas concentration, and obtaining α and β through regression fitting.

[0015] S4. Based on the prediction model and the observation model, the gas concentration with temperature and humidity compensation is calculated in real time using Kalman filtering.

[0016] S4 specifically includes: S41. Set the initial predicted value and the initial error covariance. Input the initial predicted value into the prediction model to predict the predicted value at the current time. Calculate the prediction error covariance based on the initial error covariance and the prediction covariance Q. In this embodiment of the invention, the sensor observation value at the first moment can be directly used as the initial prediction value; In another embodiment of the present invention, the initial predicted value can be calculated from the first measurement values ​​of multiple sensors by weighted averaging or least squares method to calculate the initial state; In this embodiment of the invention, the initial covariance matrix is ​​set as follows: Assume that each state component is independent, and the covariance matrix is ​​a diagonal matrix, with the diagonal elements being the variances of each state component; ; The variance of the gas concentration estimate is determined by the sensor accuracy. , : These represent the measurement variances of the temperature and humidity sensors, respectively.

[0017] Specifically, taking methane as an example: Methane gas sensor: range 0-5% LEL, accuracy ±0.1% LEL; Temperature sensor: range -40~85°C, accuracy ±0.5°C; Humidity sensor: measuring range 0-100% RH, accuracy ±3% RH; Methane concentration variance: ; Temperature variance: ; Humidity variance: .

[0018] The initial predicted value is input into the prediction model to predict the current predicted value. The prediction error covariance is calculated based on the initial error covariance and the prediction covariance Q using the following formula: ; This represents the predicted value at the current moment. Let A represent the initial predicted value, and A be the state transition matrix. ; This represents the prediction error covariance. This represents the initial error covariance. This represents the transpose of A.

[0019] S42. Calculate the Kalman gain based on the observation covariance R and the prediction error covariance; The Kalman gain is calculated based on the observation covariance R and the prediction error covariance using the following formula: ; This represents the transpose of the observation matrix.

[0020] Based on the Kalman gain correction of the current time prediction value and the correction of the prediction error covariance, the gas concentration in the current time prediction value is output. The current predicted value and the corrected prediction error covariance based on Kalman gain are calculated using the following formula: ; This represents the corrected prediction value at the current moment; ; This represents the corrected prediction error covariance at the current moment. I represents the identity matrix.

[0021] S43. Input the current predicted value and the corrected prediction error covariance as the initial predicted value and the initial error covariance into S41, respectively.

[0022] This invention provides a gas concentration detection device based on Kalman filter temperature and humidity compensation, comprising: Temperature sensor, humidity sensor, gas sensor and control module; The temperature sensor, humidity sensor, and gas sensor are respectively connected to the control module; The temperature sensor is used to convert temperature into an electrical temperature signal and send it to the control module. The humidity sensor is used to convert humidity into an electrical humidity signal and send it to the control module. The gas sensor is used to convert gas concentration into a concentration electrical signal and send it to the control module. The controller executes a gas concentration detection method based on Kalman filter temperature and humidity compensation.

[0023] The beneficial effects of this invention are as follows: In practical applications, sensor operating environments are complex and variable, with constantly fluctuating temperature and humidity. Kalman filtering temperature and humidity compensation enables sensors to quickly adapt to these changes, automatically adjust compensation parameters, maintain the stability of measurement output, and avoid large fluctuations or errors in measurement values ​​due to environmental changes.

[0024] Correcting the predicted values ​​yields a better estimate, and updating the covariance reduces the uncertainty of the estimate.

[0025] By using gas concentration, temperature, and humidity as state vectors, a model is constructed, and the cross-influence is quantified through the covariance matrix, making temperature and humidity compensation more accurate.

[0026] Traditional filtering methods may suffer from error accumulation, with errors increasing over long periods of measurement. Kalman filtering, by continuously updating the system state estimate, effectively reduces error accumulation and ensures the reliability of measurement results during long-term sensor operation.

[0027] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions to the technical solutions of the embodiments of the present invention do not cause the essence of the corresponding technical solutions to deviate from the scope of the present solution.

Claims

1. A gas concentration detection method based on Kalman filter temperature and humidity compensation, characterized in that, include: S1. Define a state vector, which includes: gas temperature, gas humidity, and gas concentration; S2. Establish a prediction model for the state vector, which is used to predict the state vector at the current moment based on the state vector at the previous moment. S3. Establish an observation model for the state vector, which is used to describe the relationship between sensor measurements and the state vector; S4. Based on the prediction model and the observation model, the gas concentration with temperature and humidity compensation is calculated in real time using Kalman filtering.

2. The method according to claim 1, characterized in that, The prediction model uses the following formula: ; Where A is the state transition matrix, This indicates the temperature, humidity, and concentration of the gas at the previous moment. This indicates the temperature, humidity, and concentration of the gas at the previous moment. It is process noise, and it follows a Gaussian distribution. Q represents the prediction covariance.

3. The method according to claim 2, characterized in that, The observation model uses the following formula: ; Among them, z k H represents the observation values ​​obtained from the gas temperature sensor, gas humidity sensor, and gas concentration sensor. H is the observation matrix. α and β are the coefficients for the influence of temperature and humidity on concentration compensation. It is observation noise, which follows a Gaussian distribution. R is the observation covariance.

4. The method according to claim 3, characterized in that, S4 specifically includes: S41. Set the initial predicted value and the initial error covariance. Input the initial predicted value into the prediction model to predict the predicted value at the current time. Calculate the prediction error covariance based on the initial error covariance and the prediction covariance Q. S42. Calculate the Kalman gain based on the observation covariance R and the prediction error covariance, correct the current prediction value and the prediction error covariance based on the Kalman gain, and output the gas concentration in the corrected current prediction value. S43. Input the current predicted value and the corrected prediction error covariance as the initial predicted value and the initial error covariance into S41, respectively.

5. The method according to claim 4, characterized in that, The initial predicted value is input into the prediction model to predict the current predicted value. The prediction error covariance is calculated based on the initial error covariance and the prediction covariance Q using the following formula: ; This represents the predicted value at the current moment. Indicates the initial predicted value; ; This represents the prediction error covariance. This represents the initial error covariance. This represents the transpose of A.

6. The method according to claim 5, characterized in that, The Kalman gain based on the observation covariance R and the prediction error covariance is calculated using the following formula: ; This represents the transpose of the observation matrix.

7. The method according to claim 6, characterized in that, The corrected prediction value at the current time and the corrected prediction error covariance based on Kalman gain are calculated using the following formula: ; This represents the corrected prediction value at the current moment; ; Let I represent the corrected prediction error covariance at the current moment, and let I represent the identity matrix.