Share this

Research on the Application of RBF Neural Network in Pressure Compensation of Infrared CO2 Sensor

2026-04-06 04:14:02 · · #1
0 Introduction Among the various types of CO2 sensors currently available, infrared optical sensors have become the most commonly used method for CO2 gas analysis due to their advantages such as small size, long lifespan, fast response, and high accuracy. However, the influence of total ambient pressure remains one of the main problems that is difficult to solve in this analytical method, thus greatly limiting its applicability. In practical applications, these sensors are usually used in standard atmospheric pressure environments, where the total ambient pressure remains basically constant and is not affected by total pressure. Currently, some high-precision infrared CO2 sensors employ pressure compensation measures to ensure analytical measurement accuracy. One relatively simple and common mathematical method is to use the least squares method to perform linear, exponential, or polynomial fitting on the measurement error of CO2 gas with different partial pressure values ​​caused by changes in total ambient pressure. This compensation algorithm has achieved good results in applications with small variations in total ambient pressure, but the error increases with the increase of the measured partial pressure of CO2 gas, and the compensation effect becomes very poor when the range of changes in total ambient pressure is large. This paper proposes constructing a radial basis function (RBF) neural network model and applying it as a pressure compensation method to an infrared CO2 sensor to predict the partial pressure of CO2 gas, hoping to effectively solve the problem of poor accuracy under large variations in total ambient pressure. 1. Structure and Principle of Infrared CO2 Sensor The design of the infrared CO2 sensor utilizes the principle of infrared absorption, whose absorption relationship follows Lambert-Beer's law. In the formula, I0 is the incident light intensity; I is the emitted light intensity; c is the linear density of molecules per unit area; l is the spatial length of infrared light transmission; and u is the absorption coefficient, which is related to factors such as ambient pressure, temperature, gas type, and the spectral wavelength of the incident light. The infrared CO2 sensor used in this experiment is a single-beam dual-wavelength structure, as shown in Figure 1. One infrared light source and two detectors are selected, with the light source and detectors installed at opposite ends of a sampling gas chamber. One detector has a filter that transmits infrared light with a wavelength of 4.26 μm installed in front of it. CO2 gas absorbs infrared light with a wavelength of 4.26 μm, so it can be used to detect the CO2 signal U1, forming a measurement optical path. The other detector has a filter that transmits infrared light with a wavelength of 4 μm installed in front of it. CO2 gas does not absorb infrared light with a wavelength of 4 μm, so it can be used as a reference signal U0 for detecting the CO2 signal, forming a reference optical path. The ratio between the measured signal and the reference signal can be obtained. In the formula, k is the coefficient for converting light energy into an electrical signal; Δr is the environmental interference signal. It can be seen from formula (2) that the effective signal is only the parameter related to the gas absorption capacity, which is independent of the performance of the sensor system components. In this way, the effects of changes in the radiation intensity of the light source, contamination of optical components, and detector drift can be eliminated. This ratio will be used as the output signal of the sensor in this paper. In addition, a thermistor is built into the sensor to output the temperature signal, and the environmental pressure is measured by a pressure sensor. Pressure compensation analysis of the sensor studies the mapping relationship between the ratio signal output by the sensor and the partial pressure of CO2 gas to be measured, under the premise of constant output temperature signal, when the total ambient pressure is different. 2. RBF Network Model Design 2.1 RBF Neural Network Theory The RBF network belongs to the feed-forward network category. It establishes an analysis model using data composed of system inputs and outputs, and achieves learning through convergence rules. It is a local approximation network that can approximate any continuous function with arbitrary precision. Its structure is shown in Figure 2. The RBF network consists of three layers. The hidden layer nodes are composed of Gaussian activation functions. The output of the j-th node in the hidden layer can be expressed as Equation (4). For the pressure compensation model of the infrared CO2 sensor, there is a corresponding relationship between the partial pressure of CO2 gas and the ratio signal of the sensor output. After adding the influence of total pressure, a two-to-one structure is formed. Therefore, the input sample is represented as x = (x1, x2)T, where x1 represents the ratio signal of the sensor output, x2 represents the total pressure value, L is the number of output layer nodes, which is 1, representing the partial pressure value of CO2 gas to be predicted, wkj, cj, σj are network parameters, and m is the number of hidden layer nodes, which is determined to be 14 through experiments during the subsequent network training process. 2.2 Sample data acquisition and preprocessing After selecting the input and output modes of the network, a certain amount of comprehensive sample data needs to be acquired to train and test the network. The acquisition process adopted a method of fixing the CO2 partial pressure and gradually increasing the total pressure, with the total pressure range being 30-110 kPa, and each point being 5 kPa. All experiments were conducted at a constant temperature (27℃). After the experiment, 187 sets of sample data were obtained. Data from one pressure point among the CO2 partial pressure values ​​were selected to form test samples, totaling 11 sets, and the remaining 176 sets of data were used as training samples. To make these data easier for the network to train and learn, scaling was performed to change them to the [0, 1] interval. 2.3 Network Algorithm Based on the scaled sample data, the network algorithm can be divided into the following steps: 1) Select the center vector cj and the standardization constant σj of the network. Here, the k-means clustering method is used to solve it, which can accurately calculate the optimal initial values ​​of these two parameters. Compared with the commonly used method of setting the initial values ​​to random values, this algorithm effectively speeds up the convergence speed of the network. 2) Solve for the initial weights wkj of the network model. There are 14 hidden layer nodes. After the initial center vector and standardization constant are obtained by clustering, the output matrix can be deduced for 176 training samples. The optimal initial weights of the network are obtained by formula (5), which also plays a significant role in accelerating the convergence speed of the network. 3) After solving steps (1) and (2), the initial parameters of the network model have been determined. During the network propagation process, the steepest slope method is used to correct the parameters of the hidden layer and the output layer through the error function. The error function is expressed by the total system error as follows: where p is the number of training samples, which is 176; ti and yi are the expected output and actual output of the output node under the action of sample i, respectively. The formula for correcting the coefficients after training (n+1) relative to the coefficients after training (n) is as follows: where n is the number of training sessions; η is the learning rate, which is 0.001; Z = wj, cj, σj. 4) After continuous forward propagation and backward correction, the final parameters of the network are obtained, and the network performance is then tested using test sample data. 2.4 Network Model Result Analysis Utilizing the powerful numerical matrix operations and plotting capabilities of MATLAB, the entire network algorithm was compiled by writing an M-file. When testing with test sample data, the network parameters were kept constant, and the network was run forward. Each training iteration was followed by a test with the test data. The mean squared error (MSE) curve showing the change with the number of training iterations is shown in Figure 3. The error curve shows that the MSE initially decreases when tested with test data, gradually approaching equilibrium as the number of training iterations increases. The principle for selecting the number of training iterations is to choose as few iterations as possible to obtain the smallest possible test MSE, thus enabling the network to have good generalization ability. Here, 50,000 training iterations were chosen, with a training time of approximately 4 minutes. The training MSE reached 0.0281, and the test MSE reached 0.001527. The optimal network structure consisted of 14 hidden layer nodes. This was determined experimentally by comparing the MSE with different numbers of hidden layer nodes. Figure 4 compares the predicted and actual values ​​of the network model for the training samples, and Figure 5 compares the predicted and actual values ​​of the network model for the test samples. Figure 4 shows that the network model's predictions for training samples are basically consistent with the actual outputs, with an average error of 0.038 kPa, an accuracy of 1.26%, and a maximum error of 0.12 kPa. Figure 5 shows that the network model can also provide accurate predictions for untrained test samples, with an average error of 0.035 kPa, an accuracy of 1.18%, and a maximum error of 0.079 kPa. The test data analysis proves that the network model has excellent generalization ability and solves the problem of poor accuracy when the partial pressure of CO2 gas is high. 3. Conclusion Based on the above analysis and comparison, it can be seen that when the environmental pressure varies greatly, applying a neural network to construct a pressure compensation model, collecting sensor output ratio signals and pressure signals to form samples, classifying and preprocessing them, and then using an RBF network based on k-means clustering and the steepest slope method to establish a mapping relationship between input and output variables based on the samples, in order to predict the partial pressure of CO2 gas contained in the measured gas. This network model uses an experimental method to determine the optimal network structure and employs fine-tuning in the selection of initial network parameters, resulting in a fast convergence speed. Experimental results show that this algorithm model achieves good results. It is foreseeable that neural networks will develop into a feasible and effective tool for predicting the output signals of sensors in complex environments.
Read next

CATDOLL 123CM Victoria (TPE Body with Hard Silicone Head)

Height: 123cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/54/70cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22