Gas sensing compensation method and device and computer equipment
By constructing a gas sensing compensation model and combining hardware and software compensation technology, the problem of interference in measurement accuracy of gas sensors in complex environments is solved, and the stable and accurate measurement of gas sensors in variable environments is achieved.
Patent Information
- Application Number
- CN202510159790.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The measurement accuracy of gas sensors under complex and variable environmental conditions is easily disturbed by factors such as temperature, humidity, air pressure and gas concentration, resulting in measurement errors.
A gas sensing compensation method is adopted to correct the gas sensor output signal in real time by obtaining environmental parameters and building a gas compensation model, combining hardware compensation (such as series and parallel circuit design) and software algorithm compensation (such as temperature compensation, humidity compensation, gas concentration compensation and zero-point offset calibration algorithm).
Effectively correct the measurement error caused by the external environment and its own characteristics, so that the gas sensor can output measurement results stably and accurately in complex environments, improving the overall performance and practicality of the gas sensor.
Smart Images

Figure CN119619423A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a gas sensor compensation method, device and computer equipment. Background Art
[0002] With the rapid development of science and technology, the application of gas sensors in many key fields such as environmental monitoring, industrial control, and medical health is becoming more and more widespread and indispensable. Gas sensors usually work based on specific physical or chemical principles. However, their measurement accuracy is easily affected by external environmental factors. For example, fluctuations in ambient temperature will change the physical properties of the sensor material; changes in humidity may cause moisture absorption or dehydration on the sensor surface, interfering with the interaction between gas molecules and the sensing surface; changes in atmospheric pressure will also affect the diffusion and adsorption behavior of the gas, causing deviations in the sensor output signal; in addition, the dynamic range of the measured gas concentration itself and the possible zero drift problem of the sensor are also important factors affecting the measurement accuracy.
[0003] In practical application scenarios, such as accurate monitoring of harmful gas concentrations in industrial production processes, accurate determination of various pollutant contents in ambient air quality monitoring, and precise analysis of exhaled gas components in the medical and health field, these measurement errors may lead to serious consequences, including industrial production safety accidents, inaccurate environmental assessments, and medical diagnosis errors. Therefore, an effective solution is urgently needed to reduce the impact of the environment on gas sensor measurements. Summary of the invention
[0004] The main purpose of the present invention is to provide a gas sensor compensation method, device and computer equipment to achieve all-round correction of measurement errors caused by various factors, ensure that the gas sensor can stably and accurately output measurement results under complex and changeable environmental conditions, provide reliable data support for applications in various fields, and improve the overall performance and practicality of the gas sensor.
[0005] To achieve the above object, the present invention provides a gas sensing compensation method, comprising the following steps: Obtain the original output signal of the gas sensor under various environmental conditions within a preset time, and record the corresponding environmental parameters at the same time, wherein the environmental parameters include temperature, humidity, air pressure and gas concentration data, wherein the gas sensor is divided into a reference group and a test group, wherein the reference group is used to collect data to develop an algorithm, and the test group is used to verify the algorithm for actual gas detection; Based on the collected original output signal and the corresponding environmental data, a gas compensation model is constructed to describe the intrinsic relationship between the sensor output, environmental parameters and actual gas concentration. The gas compensation model integrates hardware compensation and software algorithm compensation. The hardware compensation performs preliminary compensation for the gas in the environment through a series-parallel circuit design. The software algorithm compensation includes a temperature compensation algorithm, a humidity compensation algorithm, a gas concentration compensation algorithm and a zero offset calibration algorithm. The current environmental parameters are acquired in real time through the gas sensor, the current environmental parameters are input into the gas compensation model, and the gas sensor output signal is corrected and calculated through the gas compensation model to obtain a compensated gas concentration signal.
[0006] Furthermore, the circuit design in the hardware compensation performs preliminary compensation for multiple environmental factors at the hardware level by connecting a thermistor and a humistor in series or in parallel in the circuit, using the thermistor to adjust the gas sensor output signal based on changes in ambient temperature, and using the humistor to adjust the gas sensor output signal based on changes in ambient humidity.
[0007] Furthermore, the temperature compensation algorithm uses multi-sensor compensation and software algorithm for compensation, and uses the difference in signal outputs of gas sensor A and gas sensor B with similar characteristics and within a preset response time to calculate the temperature compensation algorithm formula:
[0008] In the formula, S A (T) is the output signal of gas sensor A at temperature T, S B (T, C) is the original output signal of gas sensor B at temperature T and gas concentration C, S' B (T,C) Gas sensor B output signal after temperature compensation, β T is the influence coefficient of temperature on the output of gas sensor B, T0 is the standard temperature;
[0009] Calculate and adjust the signal output of gas sensor B, wherein the gas sensor A is sealed as a temperature sensor and is only used to obtain ambient temperature changes, and the gas sensor B is used for actual gas detection and receiving the temperature compensation signal from the gas sensor A.
[0010] Furthermore, the humidity compensation algorithm adds a hygroscopic resistor in the circuit to monitor the change of ambient humidity within a preset humidity response range with a preset response time, and adjusts the output of the gas sensor through the circuit using a humidity software algorithm according to the output signal of the hygroscopic resistor. The humidity compensation algorithm formula includes:
[0011] In the formula, Rh is the resistance value of the hyristor at the current humidity H, R h0 is the resistance value under standard humidity H0, α h is the sensitivity coefficient of the humidity sensor;
[0012] S is the actual output signal of the gas sensor, S0 is the output signal under standard humidity, β H is the influence coefficient of humidity on sensor output;
[0013] S c It is the sensor output signal after humidity compensation.
[0014] Furthermore, the gas concentration compensation algorithm uses standard gas to calibrate the gas sensor, establishes a mathematical model formula between the gas concentration and the sensor output, and adjusts the output of the gas sensor in real time according to the established mathematical model. The mathematical model formula includes:
[0015] C is the gas concentration, S is the sensor output signal, and f is a specific functional relationship;
[0016] a and b are coefficients determined by calibration.
[0017] Furthermore, the zero point offset calibration algorithm automatically calibrates the gas sensor regularly or in real time, compares the current gas sensor output value with a preset zero point reference value, and when the deviation exceeds a set threshold, calculates the zero point drift value according to the zero point adjustment formula and adjusts the gas sensor output signal.
[0018] Furthermore, the algorithm in the software algorithm compensation in the gas compensation model has adaptive capabilities, and dynamically adjusts and selects compensation parameters according to the change rate and fluctuation range of environmental factors and preset judgment logic rules to correct the output signal of the gas sensor under different environmental conditions, wherein the judgment logic rule is that when the environmental parameter change rate is greater than a preset first change rate and the fluctuation range is greater than a preset first fluctuation range, enhanced compensation is performed; when the environmental parameter change rate is less than a preset second change rate and the fluctuation range is less than a preset second fluctuation range, conventional compensation is performed.
[0019] Furthermore, the hardware compensation in the gas compensation model, in addition to preliminary compensation through series-parallel circuit design, also adjusts the gas sensor output signal according to the output of the environmental sensor through voltage-dividing resistors and operational amplifiers, thereby performing comprehensive compensation for multiple environmental factors at the hardware level; during operation, the algorithms of the software algorithm compensation are used separately or in combination according to the actual environment and measurement requirements to compensate for the output signal of the gas sensor in various environments.
[0020] The present invention also provides a gas sensor compensation method, device and computer equipment, including: A data acquisition module is used to obtain the original output signal of the gas sensor under various environmental conditions within a preset time period, and record the corresponding environmental parameters at the same time. The environmental parameters include temperature, humidity, air pressure and gas concentration data. The gas sensor is divided into a reference group and a test group. The reference group is used to collect data to develop algorithms, and the test group is used to verify the algorithm for actual gas detection; A model building module, for building a gas compensation model for describing the intrinsic relationship between sensor output, environmental parameters and actual gas concentration based on the collected original output signal and the corresponding environmental data, wherein the gas compensation model integrates hardware compensation and software algorithm compensation, wherein the hardware compensation performs preliminary compensation for the gas in the environment through a series-parallel circuit design, and the software algorithm compensation includes a temperature compensation algorithm, a humidity compensation algorithm, a gas concentration compensation algorithm and a zero offset calibration algorithm; The calculation compensation module is used to obtain the current environmental parameters in real time through the gas sensor, input the current environmental parameters into the gas compensation model, and perform correction calculation on the gas sensor output signal through the gas compensation model to obtain a compensated gas concentration signal.
[0021] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned gas sensor compensation method when executing the computer program.
[0022] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned gas sensor compensation method are implemented.
[0023] The gas sensing compensation method and device provided by the present invention have the following beneficial effects: (1) By considering factors that affect measurement accuracy, such as temperature, humidity, air pressure, dynamic changes in gas concentration, and zero-point drift, and building a gas compensation model for corresponding compensation, the measurement error caused by the external environment and its own characteristics can be effectively corrected, so that the gas sensor can output measurement results stably and accurately in a complex and changeable environment, and obtain reliable gas concentration data.
[0024] (2) A combination of hardware compensation and software algorithm compensation is adopted. Hardware compensation can adjust the gas sensor output signal according to the output of the environmental sensor through series-parallel circuit design (such as series or parallel thermistors, hygrometers, etc.) and the use of voltage divider resistors, operational amplifiers, etc., to perform preliminary and comprehensive compensation for multiple environmental factors at the hardware level; software algorithm compensation covers a variety of targeted algorithms such as temperature compensation algorithm, humidity compensation algorithm, gas concentration compensation algorithm and zero offset calibration algorithm, and each algorithm can be used alone or in combination according to the actual environment and measurement requirements. It also has adaptive capabilities and can dynamically adjust and select compensation parameters according to the preset judgment logic rules based on the change rate and fluctuation amplitude of environmental factors, thereby adapting to environmental conditions with different changes, greatly enhancing the practicality of gas sensors in various scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a gas sensor compensation method in one embodiment of the present invention; Figure 2 is a structural block diagram of a gas sensor compensation device in one embodiment of the present invention; Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0026] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0028] Reference Figure 1 , is a flow chart of a gas sensing compensation method proposed by the present invention, comprising the following steps: S1, obtaining the original output signal of the gas sensor under various environmental conditions within a preset time, and recording the corresponding environmental parameters, wherein the environmental parameters include temperature, humidity, air pressure and gas concentration data, wherein the gas sensor is divided into a reference group and a test group, wherein the reference group is used to collect data to develop an algorithm, and the test group is used to verify the algorithm for actual gas detection; S2, based on the collected original output signal and the corresponding environmental data, a gas compensation model is constructed to describe the intrinsic relationship between the sensor output, environmental parameters and actual gas concentration. The gas compensation model integrates hardware compensation and software algorithm compensation. The hardware compensation performs preliminary compensation for the gas in the environment through a series-parallel circuit design. The software algorithm compensation includes a temperature compensation algorithm, a humidity compensation algorithm, a gas concentration compensation algorithm and a zero offset calibration algorithm. S3, obtaining current environmental parameters in real time through a gas sensor, inputting the current environmental parameters into the gas compensation model, and performing correction calculation on the gas sensor output signal through the gas compensation model to obtain a compensated gas concentration signal.
[0029] As described in step S1 above, the original output signal of the gas sensor under various environmental conditions within a preset time is obtained, and the corresponding environmental parameters are recorded at the same time. The environmental parameters include temperature, humidity, air pressure and gas concentration data, wherein the gas sensor is divided into a reference group and a test group, the reference group is used to collect data to develop algorithms, and the test group is used to verify the algorithm for actual gas detection. Within a specific time range, the original output signals of the gas sensor are collected. These signals are the values directly output by the sensor after sensing the gas based on the environment without any compensation correction. At the same time, the corresponding environmental parameters, including temperature, humidity, air pressure and gas concentration data, are recorded synchronously. The temperature will affect the physical properties of the sensor material, thereby changing the sensor output; the change in humidity may cause moisture absorption or dehydration on the sensor surface, interfering with the interaction between gas molecules and the sensing surface, affecting the output; the change in air pressure will affect the diffusion and adsorption behavior of the gas, resulting in deviations in the sensor output; and the gas concentration itself is also an important factor to be considered in subsequent analysis and compensation, because the performance of the sensor output is also different at different concentrations. Among them, the gas sensors are divided into a reference group and a test group. The reference group is used to collect data to develop algorithms. For example, the reference group is used to analyze the intrinsic relationship between environmental factors and output signals under different environmental conditions such as temperature and humidity, as well as the corresponding output signals, so as to provide original data materials for the development of temperature compensation algorithms, humidity compensation algorithms, etc. The test group focuses on the effectiveness of the actual gas detection verification algorithm. After the corresponding compensation algorithm is developed based on the data collected by the reference group and the gas compensation model is formed, it is necessary to use the test group in the actual gas detection scenario to verify whether these algorithms and models can really correct the measurement error and improve the measurement accuracy.
[0030] As described in the above step S2, based on the collected original output signal and the corresponding environmental data, a gas compensation model is constructed to describe the intrinsic relationship between the sensor output, environmental parameters and actual gas concentration. The gas compensation model integrates hardware compensation and software algorithm compensation. The hardware compensation performs preliminary compensation for the gas in the environment through a series-parallel circuit design. The software algorithm compensation includes a temperature compensation algorithm, a humidity compensation algorithm, a gas concentration compensation algorithm and a zero offset calibration algorithm.
[0031] The gas compensation model is constructed based on the original output signal obtained in step S1 and the corresponding environmental data. The original output signal reflects the actual measurement performance of the gas sensor under different environmental conditions without correction, and the environmental data (such as temperature, humidity, air pressure, gas concentration, etc.) reflects the specific situation of external influencing factors. Through a large amount of analysis, induction and mathematical modeling of these two aspects of data, the inherent and regular relationship between the sensor output, environmental parameters and actual gas concentration is found, and then the gas compensation model is constructed. The purpose of this model is to output a compensated and corrected gas concentration signal that is closer to the true value through internal calculation processing by inputting relevant data such as environmental parameters and the original output signal of the sensor. Hardware compensation mainly realizes preliminary compensation for gases in the environment through series-parallel circuit design. For example, specific electronic components such as thermistors and hygrometers are connected in series or parallel in the circuit. Thermistors will change their resistance value as the ambient temperature changes, and then adjust the gas sensor output signal based on this resistance change, so that it can offset the measurement error caused by temperature fluctuations to a certain extent; hygroscopic resistors change their resistance accordingly according to the change in ambient humidity, so as to adjust the gas sensor output signal through circuit action and reduce the interference caused by humidity changes. For thermistors, let the resistance value of the thermistor at the current temperature T be R T The resistance value at standard temperature T0 is R T0 , the temperature coefficient of the thermistor is α T ,but , the change of resistance value affects the circuit voltage division or current division, and then adjusts the gas sensor output signal; for the humidity sensitive resistor, the resistance value of the humidity sensitive resistor at the current humidity H is R h The resistance value at standard humidity H0 is R h0 , the sensitivity coefficient of the humidity sensor is α h ,but , and also affects the gas sensor output in the hardware circuit based on its resistance change.
[0032] For the temperature compensation algorithm, when the ambient temperature changes, the output of the gas sensor will be affected. This algorithm is designed to correct the error caused by temperature changes. For example, by utilizing the difference in signal outputs of gas sensor A and gas sensor B, which have similar characteristics and are within a preset response time, the signal output of gas sensor B is calculated and adjusted according to a specific temperature compensation algorithm formula. Gas sensor A can be used as a simple temperature sensor after being sealed, and is only used to obtain ambient temperature changes, while gas sensor B is used for actual gas detection and receives temperature compensation signals from gas sensor A, thereby compensating for the influence of temperature factors. Suppose the output signal of gas sensor A at temperature T is S A (T), the original output signal of gas sensor B at temperature T and gas concentration C is S B (T,C), the output signal of gas sensor B after temperature compensation is S' B (T, C), the influence coefficient of temperature on the output of gas sensor B is β T ,but , where T0 is the standard temperature.
[0033] For the temperature compensation algorithm, a hygroscopic resistor is added to the circuit to monitor the change in ambient humidity, and the response time is limited to the preset humidity response range. The hygroscopic resistor will output a corresponding signal according to the humidity change, and then use the signal to further adjust the output of the gas sensor through the circuit according to the humidity software algorithm, so that the output result can reduce the deviation caused by humidity factors and more accurately reflect the actual gas concentration. Suppose the resistance value of the hygroscopic resistor at the current humidity H is R h The resistance value at standard humidity H0 is R h0 , the sensitivity coefficient of the humidity sensor is α h ,but ; Assume that the actual output signal of the gas sensor is S, the output signal under standard humidity is S0, and the influence coefficient of humidity on the sensor output is β H , then S=S0(1+β H H); the sensor output signal after humidity compensation is S c ,but .
[0034] For the pressure compensation algorithm, the gas sensor is calibrated with standard gas, that is, a standard gas of known concentration is determined in advance, the sensor is allowed to act with it and the corresponding output signal is recorded. Based on these data, a mathematical model formula between gas concentration and sensor output is established (such as the formula containing coefficients a, b and specific functional relationship f, etc.). In subsequent actual measurements, this established mathematical model can be used to adjust the sensor in real time according to the real-time output signal of the sensor, so that the measured gas concentration is closer to the true value. Let the gas concentration be C, the sensor output signal be S, and the mathematical model obtained by the calibration experiment is C=f(S), where f is a specific functional relationship, for example, C=aS+b (a, b are coefficients determined by calibration). According to this model, when the sensor output signal S is obtained, the corresponding gas concentration C can be calculated, and the sensor output can be adjusted accordingly.
[0035] For the zero-point compensation algorithm, the gas sensor may have a zero-point drift problem during use, that is, even in the absence of target gas, its output may deviate from the preset zero-point reference value. The algorithm can automatically calibrate the gas sensor regularly or in real time, compare the current gas sensor output value with the preset zero-point reference value, and once the deviation exceeds the set threshold, the zero-point drift value will be accurately calculated according to the zero-point adjustment formula, and the gas sensor output signal will be adjusted accordingly to ensure the accuracy of the sensor in the zero-point state and avoid the increase of measurement error due to the accumulation of zero-point drift. Suppose the current gas sensor output value is S current The preset zero point reference value is S zero , set the threshold to ΔS, when | S current -S zero | > ΔS, zero drift value ΔS zero = S current -S zero , the adjusted gas sensor output signal S adjusted = S current -S zero .
[0036] Among them, the algorithm in the software algorithm compensation has adaptive ability, and dynamically adjusts and selects compensation parameters according to the change rate and fluctuation range of environmental factors according to preset judgment logic rules to correct the output signal of the gas sensor under different environmental conditions. Among them, the judgment logic rule is that when the environmental parameter change rate is greater than the preset first change rate A1 and the fluctuation range is greater than the preset first fluctuation range A1, enhanced compensation is performed; when the environmental parameter change rate V2 is less than the preset second change rate and the fluctuation range is less than the preset second fluctuation range A2, conventional compensation is performed.
[0037] Assume that the change of environmental parameters (such as temperature, humidity, etc.) from time t1 to t2 is ΔE, then the rate of change is The fluctuation range A can be calculated by counting the maximum value E of the environmental parameter within a period of time. max With the minimum value E min The difference is obtained, that is, In enhanced compensation and conventional compensation, the correlation coefficients in each compensation algorithm (temperature, humidity, gas concentration, zero offset calibration) (such as β in temperature compensation) T , β in humidity compensation H etc.) will be adjusted according to preset rules. For example, when strengthening compensation, the correlation coefficient will increase by a certain proportion.
[0038] As described in the above step S3, the current environmental parameters are acquired in real time through the gas sensor, the current environmental parameters are input into the gas compensation model, and the gas sensor output signal is corrected and calculated through the gas compensation model to obtain a compensated gas concentration signal.
[0039] By utilizing the environmental perception function of the gas sensor, various parameters of the current environment are obtained in real time, and the current environmental parameters just obtained in real time are input into the previously constructed gas compensation model. This gas compensation model is formed based on a large number of original output signals and corresponding environmental data collected in the early stage, through a series of operations such as analysis and modeling. It has determined the intrinsic relationship between sensor output, environmental parameters and actual gas concentration, and integrates multiple compensation mechanisms such as hardware compensation and software algorithm compensation. After receiving the input current environmental parameters, the gas compensation model will carry out comprehensive and targeted correction calculations on the original signal currently output by the gas sensor based on its internal integrated hardware compensation logic (for example, adjusting the influence of temperature and humidity changes through series-parallel thermistors, hygrometers and other components in the circuit) and software algorithm compensation logic (such as temperature compensation algorithm, humidity compensation algorithm, gas concentration compensation algorithm, zero offset calibration algorithm, etc., respectively correcting the measurement errors caused by different factors). For example, if the current ambient temperature rises, the temperature compensation algorithm will be based on the input temperature parameters and the correlation coefficient of the predetermined temperature on the sensor output, and the various compensation mechanisms will work together.
[0040] After the correction calculation process inside the gas compensation model, the compensated gas concentration signal can be finally obtained. Compared with the original signal initially output by the gas sensor, this signal has eliminated or greatly reduced the measurement error caused by environmental interference and the sensor's own characteristics (such as zero drift, etc.), and more accurately reflects the actual gas concentration in the current environment.
[0041] In one embodiment, four gas sensors A, B, C and D with similar characteristics are selected, and sensor A is divided into the reference group as a reference sensor for collecting data to develop algorithms; sensors B, C, and D are divided into the test group for actual gas detection and verification of algorithms. Gas sensors A and B are installed on the circuit board, and temperature sensors (such as thermistors) are placed near them to ensure that these sensors can accurately sense environmental changes and are connected to the data acquisition circuit. When the ambient temperature changes, the resistance of the temperature sensor (thermistor) changes accordingly, and the output signal S of gas sensor A is changed through circuit components such as voltage divider resistors and operational amplifiers. A (T) changes, and the original output signal S of gas sensor B B (T, C) is also affected (where T is the current temperature and C is the gas concentration). The microprocessor collects the output signal S of gas sensors A and B in real time through the A / D converter. A (T) and S B (T,C).
[0042] It is known that the output signal of gas sensor A at standard temperature T0 is S A (T0), and the temperature effect coefficient β on the output of gas sensor B T . Calculate according to the temperature compensation algorithm formula:
[0043] For example, if the standard temperature T0 = 25°C, S A (25) = 1.0, when the ambient temperature T = 30 °C, S A (30)=1.2, S B (30,C)=1.5,β T =0.05. Then β T (S A (T)-S A (T0))=0.05*(1.2-1.0)=0.01, and finally the output signal of gas sensor B after temperature compensation is S'B(30,C)=1.5-0.01=1.49. At this time, only temperature compensation is considered, and the output signal of gas sensor B after temperature compensation is S' B (T,C) is used in subsequent gas concentration calculations or other data processing steps to observe the effect of temperature compensation alone on improving measurement accuracy.
[0044] If the ambient humidity also changes while the above temperature changes, according to the humidity compensation algorithm, the resistance value of the hygrometer at the standard humidity H0=50% is R h0 , the sensitivity coefficient of the humidity sensor is α h, the current humidity H0 = 60%, then the humidity sensitive resistor value The standard output signal of the gas sensor under standard humidity is S0=2.0, and the influence coefficient of humidity on the sensor output is β H =0.03, according to the formula Calculate the actual output signal S after being affected by humidity, that is, S=2.0*(1+0.03*60%)=2.036. Then according to the humidity compensation formula Calculate the compensated sensor output signal Sc = 2.036*(1-0.03*60%) = 1.994. Then the humidity compensated signal S c The temperature compensated signal S' B (T, C) are combined and processed according to specific fusion rules (such as weighted average, etc.) to obtain the output signal of gas sensor B after considering both temperature and humidity compensation, which is used for more accurate gas concentration calculation or data processing to demonstrate the improvement of the effect when temperature and humidity parameters are combined for compensation.
[0045] Further consider other environmental parameters such as air pressure (assuming that the air pressure sensor is also installed and collects data) and the combined application of the gas concentration compensation algorithm and the zero offset calibration algorithm. For air pressure compensation, assuming that the air pressure sensor measures the current air pressure P, the standard air pressure P0, and the influence coefficient of air pressure on the output of gas sensor B is β P , the output signal change caused by the pressure change ΔS P = β P (P - P0), then the gas sensor B output signal after pressure compensation is (Here S' B (T, C) is the original output signal without air pressure compensation).
[0046] Then the temperature, humidity, and air pressure compensated signals are combined. A common combination method is weighted averaging. Let the weight of the temperature compensation signal be ω T , the humidity compensation signal weight is ω H , the air pressure compensation signal weight is ω P (and ω T +ω H +ω P =1), the combined signal is:
[0047] The mathematical model between gas concentration and sensor output established by calibrating the gas sensor with standard gas (For example, C=0.5S+5, where is the coefficient obtained by calibration). Substitute into the gas concentration compensation model to obtain the preliminary gas concentration compensation value .
[0048] According to the zero offset calibration algorithm, the zero reference value S is preset. zero = 0.1, set the threshold ΔS = 0.05, and monitor the sensor output value S in real time during the measurement process current (The S here current It is the signal after the previous temperature, humidity, air pressure, and gas concentration compensation. If | S current -S zero | > ΔS, then calculate the zero drift value ΔS zero =S current -S zero , the adjusted gas sensor output signal S adjusted = S current -S zero .
[0049] Finally, the signal S after zero offset calibration is adjusted Substitute the gas concentration compensation model again The final high-precision gas concentration value C is obtained final = f ( S adjusted ). This final value is then compared with the data collected by sensors C and D under the same environment for verification. If a deviation is found, the coefficients in each compensation algorithm (such as the β of temperature compensation) are adjusted according to the deviation. T , humidity compensation β H , pressure compensated β P , a, b in the gas concentration compensation model, etc.) to optimize the entire multi-parameter combination compensation algorithm and improve the measurement accuracy and reliability of the gas sensor under different environmental conditions.
[0050] Through such a multi-parameter combination compensation algorithm, the impact of environmental factors on the gas sensor output can be comprehensively considered, the error can be minimized and the measurement accuracy can be improved.
[0051] In another embodiment, the gas sensor is tested using the reference group sensor A and standard gases of different concentrations (such as C1 = 10ppm, C2 = 20ppm, C3 = 30ppm, etc.) to obtain corresponding sensor output signals S1, S2, S3, etc. A mathematical model between gas concentration and sensor output is established through data fitting . Assume that the fitted model is C=0.5S+5.
[0052] In actual measurement, the microprocessor collects the output signal S of the test group gas sensors (such as B, C, and D). Substitute S into the model C=0.5S+5 to calculate the gas concentration C. For example, when S=15, C=0.5*15+5=12.5ppm. At this time, the gas concentration compensation algorithm is used alone to calculate the preliminary gas concentration value and observe its accuracy.
[0053] In another embodiment, in an industrial waste gas emission monitoring scenario, a gas analyzer integrated with the gas sensor compensation technology of the present invention is used. The gas analyzer is equipped with multiple gas sensors for detecting harmful gas components such as sulfur dioxide (SO2), nitrogen oxides (NOx), and carbon monoxide (CO) in the waste gas.
[0054] During the calibration phase of the instrument, the gas sensors are divided into a reference group and a test group. The sensors in the reference group are placed in a laboratory environment where the temperature, humidity, air pressure and other parameters can be precisely controlled. The sensors are tested using standard gases of different concentrations (e.g., SO2 concentrations of 5ppm, 10ppm, 20ppm, etc.; NOx concentrations of 1ppm, 5ppm, 10ppm, etc.; CO concentrations of 2ppm, 5ppm, 8ppm, etc.), while recording the original output signals of the sensors and the corresponding environmental parameters. These data are used to build a gas compensation model.
[0055] For the hardware compensation part, high-precision thermistors and hygrometers are connected in series in the sensor circuit. Taking the sensor for detecting SO2 as an example, when the ambient temperature rises, the resistance of the thermistor changes. Through a specific circuit design, the supply voltage or current of the sensor is changed, thereby making a preliminary adjustment to the output signal of the SO2 sensor. At the standard temperature of 25°C, the resistance of the thermistor is R1. When the temperature rises to 35°C, according to the temperature coefficient of the thermistor, its resistance changes to R2. This change allows the sensor output signal to be compensated to a certain extent at the hardware level, reducing the impact of temperature on the measurement results. Similarly, the hygrometer adjusts the sensor output according to changes in ambient humidity. When the humidity increases from 40%RH to 60%RH, the resistance of the hygrometer changes, which in turn affects the circuit parameters and compensates for the measurement deviation caused by humidity factors.
[0056] In terms of software algorithm compensation, corresponding compensation algorithms are applied to sensors of different gases. For the temperature compensation algorithm of the SO2 sensor, two gas sensors A and B with similar characteristics are provided, and sensor A is sealed as a temperature sensor. During a measurement, the ambient temperature changes from 20°C to 30°C. It is known that when the standard temperature T0 = 25°C, the output signal of sensor A is SA(25) = 0.8, and when T = 30°C, SA(30) = 1.0. The original output signal of sensor B at temperature T = 30°C and SO2 concentration C = 10ppm is SB(30, 10) = 1.3, and the temperature influence coefficient on the output of sensor B is βT = 0.04. Calculate according to the temperature compensation algorithm formula: S'B(30, 10) = SB(30, 10) - βT(SA(T) - SA(T0)) = 1.3 - 0.04×(1.0 -0.8) = 1.292 In the humidity compensation algorithm, the resistance value of the hygrometer at the standard humidity H0 = 50% is Rh0, and the sensitivity coefficient is αh. When the current humidity H = 70%, the resistance value of the hygrometer changes accordingly. It is known that the standard output signal S0 of the SO2 sensor at standard humidity is 1.5, and the coefficient of humidity on the sensor output is βH = 0.03. First, calculate the actual output signal S after being affected by humidity: S = S0(1 + βHH) = 1.5×(1 + 0.03×70%) = 1.5315 Then calculate the compensated sensor output signal Sc according to the humidity compensation formula: Sc = S×(1 - βHH) = 1.5315×(1 - 0.03×70%) = 1.483 The gas concentration compensation algorithm uses a mathematical model established by pre-calibrated standard gas data for compensation. For example, for a SO2 sensor, the mathematical model obtained through calibration is C = 0.6S + 3 (where a = 0.6, b = 3). In actual measurement, when the sensor output signal S = 1.292 (the signal after temperature compensation), the preliminary gas concentration compensation value C is calculated: C = 0.6×1.292 + 3 = 3.7752ppm The zero offset calibration algorithm automatically calibrates the sensor periodically. zero = 0.05, set the threshold ΔS = 0.03. During the measurement process, if the current sensor output value S current With S zero If the deviation of exceeds the threshold, adjustment is made.current = 0.08, calculate the zero drift value ΔS zero = S current -S zero =0.03, the adjusted gas sensor output signal S adjusted = S current - ΔS zero = 0.05.
[0057] After the application and debugging of the gas sensor compensation technology, the gas analyzer was tested for accuracy. The instrument was tested using a series of standard gases with known concentrations, and the error between the measurement results and the standard value was recorded.
[0058] For SO2 gas detection, in the standard gas test with a concentration of 5ppm, when the compensation technology is not applied, the measured value fluctuates between 4.5ppm and 5.5ppm, and the average error is ±0.5ppm; after applying the compensation technology of the present invention, the measured value is stabilized in the range of 4.9ppm to 5.1ppm, and the average error is reduced to ±0.1ppm. In the standard gas test of 10ppm and 20ppm, the errors are ±1ppm and ±1.5ppm respectively when not compensated, and the errors are reduced to ±0.2ppm and ±0.3ppm after compensation.
[0059] For NOx gas detection, under the 1ppm standard gas test, the uncompensated measurement error can reach ±0.2ppm, and the error is controlled within ±0.05ppm after compensation; in the 5ppm and 10ppm standard gas tests, the uncompensated average error is ±0.5ppm and ±0.8ppm, while after applying the compensation technology, it is reduced to ±0.1ppm and ±0.2ppm respectively.
[0060] For CO gas detection, in the standard gas tests of 2ppm, 5ppm and 8ppm, the uncompensated measurement error ranges are ±0.3ppm, ±0.6ppm and ±0.9ppm respectively. After compensation, the errors are significantly reduced to ±0.05ppm, ±0.1ppm and ±0.15ppm respectively.
[0061] In the actual industrial waste gas emission monitoring process, the gas analyzer's sensor obtains the current environmental parameters (temperature, humidity, air pressure, etc.) and gas concentration signals in real time. These environmental parameters are input into the constructed gas compensation model, and the hardware compensation and software algorithm compensation in the model work together to correct and calculate the sensor output signal. For example, for the NOx sensor, after considering the compensation of factors such as temperature, humidity, air pressure and zero offset, the compensated gas concentration signal is obtained and displayed on the instrument's display screen, providing accurate waste gas composition monitoring data for the environmental protection department to ensure that the waste gas emissions of industrial enterprises meet environmental protection standards.
[0062] It can be seen from this embodiment that the gas sensor compensation technology of the present invention is applied to gas detection instruments, which can effectively improve the accuracy and reliability of the instrument in detecting multiple gases in complex industrial environments and meet the needs of practical applications.
[0063] Reference Figure 2 , is a structural block diagram of a gas sensor compensation device in one embodiment of the present invention, comprising: A data acquisition module is used to obtain the original output signal of the gas sensor under various environmental conditions within a preset time period and record the corresponding environmental parameters; A model building module, for building a gas compensation model for describing the intrinsic relationship between sensor output, environmental parameters and actual gas concentration based on the collected original output signal and corresponding environmental data; The calculation compensation module is used to obtain the current environmental parameters in real time through the gas sensor, input the current environmental parameters into the gas compensation model, and perform correction calculation on the gas sensor output signal through the gas compensation model to obtain a compensated gas concentration signal.
[0064] For the specific implementation of each module in the above device example, please refer to the above method embodiment, which will not be repeated here.
[0065] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0066] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.
[0067] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0068] In summary, the present invention provides a gas sensor compensation method, which obtains the original output signal of the gas sensor under various environmental conditions within a preset time period and records the corresponding environmental parameters at the same time; based on the collected original output signal and the corresponding environmental data, a gas compensation model is constructed to describe the intrinsic relationship between the sensor output, environmental parameters and actual gas concentration; the current environmental parameters are obtained in real time through the gas sensor, and the current environmental parameters are input into the gas compensation model, and the gas sensor output signal is corrected and calculated through the gas compensation model to obtain a compensated gas concentration signal, so as to achieve all-round correction of measurement errors caused by various factors, ensure that the gas sensor can stably and accurately output measurement results under complex and changeable environmental conditions, provide reliable data support for applications in various fields, and improve the overall performance and practicality of the gas sensor.
[0069] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.
[0070] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0071] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A gas sensing compensation method, characterized in that: The following steps are involved: Obtain the original output signal of the gas sensor under various environmental conditions within a preset time, and record the corresponding environmental parameters at the same time, wherein the environmental parameters include temperature, humidity, air pressure and gas concentration data, wherein the gas sensor is divided into a reference group and a test group, wherein the reference group is used to collect data to develop an algorithm, and the test group is used to verify the algorithm for actual gas detection; Based on the collected original output signal and the corresponding environmental data, a gas compensation model is constructed to describe the intrinsic relationship between the sensor output, environmental parameters and actual gas concentration. The gas compensation model integrates hardware compensation and software algorithm compensation. The hardware compensation performs preliminary compensation for the gas in the environment through a series-parallel circuit design. The software algorithm compensation includes a temperature compensation algorithm, a humidity compensation algorithm, a gas concentration compensation algorithm and a zero offset calibration algorithm. The current environmental parameters are acquired in real time through the gas sensor, the current environmental parameters are input into the gas compensation model, and the gas sensor output signal is corrected and calculated through the gas compensation model to obtain a compensated gas concentration signal.
2. The gas sensing compensation method according to claim 1, characterized in that: The circuit design in the hardware compensation performs preliminary compensation for multiple environmental factors at the hardware level by connecting thermistors and hygroshield resistors in series or in parallel in the circuit, using thermistors to adjust the gas sensor output signal based on changes in ambient temperature, and using hygroshield resistors to adjust the gas sensor output signal based on changes in ambient humidity.
3. The gas sensing compensation method according to claim 1, characterized in that: The temperature compensation algorithm adopts multi-sensor compensation and software algorithm for compensation. The temperature compensation algorithm formula is: In the formula, S A (T) is the output signal of gas sensor A at temperature T, S B (T, C) is the original output signal of gas sensor B at temperature T and gas concentration C, S' B (T,C) Gas sensor B output signal after temperature compensation, β T is the influence coefficient of temperature on the output of gas sensor B, T0 is the standard temperature; Calculate and adjust the signal output of gas sensor B, wherein the gas sensor A is sealed as a temperature sensor and is only used to obtain ambient temperature changes, and the gas sensor B is used for actual gas detection and receiving the temperature compensation signal from the gas sensor A.
4. The gas sensing compensation method according to claim 1, characterized in that: The humidity compensation algorithm adds a hygroscopic resistor to the circuit, monitors the change of ambient humidity within a preset humidity response range with a preset response time, and adjusts the output of the gas sensor through the circuit using a humidity software algorithm according to the output signal of the hygroscopic resistor. The humidity compensation algorithm formula includes: In the formula, R h is the resistance value of the hyristor at the current humidity H, R h0 is the resistance value under standard humidity H0, α h is the sensitivity coefficient of the humidity sensor; S is the actual output signal of the gas sensor, S0 is the output signal under standard humidity, β H is the influence coefficient of humidity on sensor output; S c It is the sensor output signal after humidity compensation.
5. The gas sensing compensation method according to claim 1, characterized in that: The gas concentration compensation algorithm uses standard gas to calibrate the gas sensor, establishes a mathematical model formula between the gas concentration and the sensor output, and adjusts the output of the gas sensor in real time according to the established mathematical model. The mathematical model formula includes: C is the gas concentration, S is the sensor output signal, and f is a specific functional relationship; a and b are coefficients determined by calibration.
6. The gas sensing compensation method according to claim 1, characterized in that: The zero offset calibration algorithm automatically calibrates the gas sensor regularly or in real time, compares the current gas sensor output value with a preset zero reference value, and when the deviation exceeds a set threshold, calculates the zero drift value according to the zero adjustment formula and adjusts the gas sensor output signal.
7. The gas sensing compensation method according to claim 1, characterized in that: The algorithm in the software algorithm compensation in the gas compensation model has adaptive capabilities. According to the change rate and fluctuation range of the environmental factors, the compensation parameters are dynamically adjusted and selected according to the preset judgment logic rules to correct the output signal of the gas sensor under different environmental conditions. The judgment logic rules are as follows: when the environmental parameter change rate is greater than the preset first change rate and the fluctuation range is greater than the preset first fluctuation range, enhanced compensation is performed; when the environmental parameter change rate is less than the preset second change rate and the fluctuation range is less than the preset second fluctuation range, conventional compensation is performed.
8. The gas sensing compensation method according to claim 1, characterized in that: The hardware compensation in the gas compensation model, in addition to the preliminary compensation by series-parallel circuit design, also adjusts the gas sensor output signal according to the output of the environmental sensor through voltage-dividing resistors and operational amplifiers, so as to perform comprehensive compensation for multiple environmental factors at the hardware level; during the operation process, the algorithms of the software algorithm compensation are used separately or in combination according to the actual environment and measurement requirements to compensate for the output signal of the gas sensor in various environments.
9. A gas sensing compensation device, characterized in that: include: A data acquisition module is used to obtain the original output signal of the gas sensor under various environmental conditions within a preset time period and record the corresponding environmental parameters; A model building module, for building a gas compensation model for describing the intrinsic relationship between sensor output, environmental parameters and actual gas concentration based on the collected original output signal and corresponding environmental data; The calculation compensation module is used to obtain the current environmental parameters in real time through the gas sensor, input the current environmental parameters into the gas compensation model, and perform correction calculation on the gas sensor output signal through the gas compensation model to obtain a compensated gas concentration signal.
10. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the gas sensor compensation method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Gas analyzer data compensation method, device, equipment and medium
CN111679035A
Temperature and humidity compensation method and device for gas sensor
CN114461621A
Gas concentration detection method, air conditioner, storage medium and device
CN114857753A
Method and equipment for detecting malodorous gas
CN115389705A
Zero correction method and device, equipment and storage medium
CN118244378A
Cited By
Gas concentration detection compensation method and system, electronic equipment and storage medium
CN120405052A
Gas concentration detection compensation method, system, electronic device and storage medium
CN120405052B
Autonomous intelligent wake-up gas sensing system and working method thereof
CN120703300A
Micro differential pressure type airflow sensor integrated with temperature and humidity compensation
CN120740698A
Method, system and program for simultaneously measuring concentrations of benzene, toluene and xylene
CN120761478A