Gas sensor-based pressure dynamic compensation gas weighing method
By acquiring pressure, temperature, and concentration signal sequences from gas sensors, the stability inside the gas cylinder is determined and the gas mass value is corrected, solving the problem of state deviation during gas mixing and achieving more accurate gas weighing and preparation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-24
- Publication Date
- 2026-05-29
Smart Images

Figure CN122108321A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas sensor technology, and more specifically to a gas weighing method based on dynamic pressure compensation using a gas sensor. Background Technology
[0002] In the preparation and metering of multi-component gases, the mass of each component gas is often determined by successive filling and weighing, serving as the basis for gas formulation. However, after filling, the gas cylinder often undergoes a mixing and diffusion process over a period of time, during which the gas pressure, temperature, and concentration of each component continuously change. During this dynamic process, adsorption and desorption may occur on the inner wall or internal structural surfaces of the cylinder, and the diffusion rates and distribution states of different components may also differ, causing a deviation between the actual gas phase state inside the cylinder and the state at the moment of filling. Furthermore, the internal pressure of the cylinder may fluctuate during the mixing cycle, and the concentration of gas components will continuously change before reaching a uniform distribution. These factors all affect the true mass distribution and component ratio of the gas inside the cylinder. When relying solely on the weighing results during the filling process as the final mass basis, it is difficult to reflect the true gas phase mass of the gas inside the cylinder under a stable state, which may lead to deviations in the calculation of the mass of each component gas. Summary of the Invention
[0003] The purpose of this invention is to provide a pressure-dynamically compensated gas weighing method based on a gas sensor, thereby solving the aforementioned technical problems.
[0004] The objective of this invention can be achieved through the following technical solutions:
[0005] The pressure-dynamically compensated gas weighing method based on gas sensors includes the following steps:
[0006] Place the cleaned, dried and evacuated gas cylinder in the weighing chamber of the balance, and record the initial tare weight of the gas cylinder after the balance reading stabilizes.
[0007] The first component gas is filled into the gas cylinder. After filling, the gas cylinder is moved back to the weighing chamber of the balance. After the outer surface of the gas cylinder and the environment of the weighing chamber reach thermal equilibrium, the total mass value after filling is recorded. The mass value of the first component gas is obtained by subtracting the initial tare mass value from the total mass value after filling.
[0008] The second and subsequent component gases are sequentially filled into the gas cylinder. After each filling, the filling mass value of the corresponding component gas is calculated. The filling mass values of all components are summed to obtain the total filling mass value.
[0009] After all component gases are filled, the gas cylinder is sealed and placed in the gas mixing and circulation unit. During the mixing and circulation process, the pressure signal sequence output by the pressure sensor, the temperature signal sequence output by the temperature sensor, and the concentration signal sequence of each component output by the gas sensor are continuously collected.
[0010] The pressure signal sequence and concentration signal sequence are used to determine whether the gas cylinder has reached a stable state. If so, the mass values of each component gas are adjusted based on the pressure signal sequence, temperature signal sequence and concentration signal sequence.
[0011] As a further aspect of the present invention: determining whether the inside of the gas cylinder has reached a stable state includes:
[0012] Extract pressure values from N consecutive sampling points in the pressure signal sequence, calculate the variance of the N pressure values, and compare the calculated variance with a preset pressure variance threshold. When the variance is less than the preset pressure variance threshold, record the time of the last sampling point among the current N sampling points as the start time of the pressure stabilization state, continue sliding the window backward, and repeat the variance calculation. When the variance calculated for M consecutive times is less than the preset pressure variance threshold, record the time of the last sampling point in the Mth calculation as the end time of the pressure stabilization state, where N is the number of sampling points corresponding to the width of the sliding window, and M is the number of consecutive judgments.
[0013] As a further aspect of the present invention: determining whether the gas cylinder has reached a stable state further includes:
[0014] The concentration values of each component are extracted from N consecutive sampling points in the concentration signal sequence. The Euclidean distance between the concentration values of each component in the N sampling points and the concentration values of the previous N sampling points is calculated. The Euclidean distances of all components are summed to obtain the comprehensive concentration change. When the comprehensive concentration change is less than the preset concentration change threshold, the time of the last sampling point in the current N sampling points is recorded as the start time of the concentration stabilization state. The window continues to slide backward and the comprehensive concentration change is calculated repeatedly. When the comprehensive concentration change obtained from M consecutive calculations is less than the preset concentration change threshold, the time of the last sampling point in the Mth calculation is recorded as the end time of the concentration stabilization state.
[0015] As a further aspect of the present invention: determining whether the gas cylinder has reached a stable state further includes:
[0016] Obtain the time period A between the start of the pressure steady state and the end of the pressure steady state;
[0017] Obtain the time period B between the start time of the concentration plateau and the end time of the concentration plateau.
[0018] If the gas cylinder reaches a stable state within the intersection of time periods A and B, an error is displayed if time periods A and B do not intersect.
[0019] As a further aspect of the present invention, the modification of the charging mass values of each component gas includes:
[0020] Extract the concentration signal sequences of each component output from the gas sensors within the intersection, calculate the arithmetic mean of the concentration signal sequences of each component within the intersection as the equilibrium concentration value of each component, and convert the equilibrium concentration values of each component into equilibrium mole fractions of each component; extract the pressure signal sequences output from the pressure sensors within the intersection, calculate the arithmetic mean of the pressure signal sequences within the intersection as the equilibrium pressure value; extract the temperature signal sequences output from the temperature sensors within the intersection, calculate the arithmetic mean of the temperature signal sequences within the intersection as the equilibrium temperature value; multiply the equilibrium pressure value by the volume of the gas phase space inside the gas cylinder to obtain the pressure-volume product, divide the pressure-volume product by the product of the universal gas constant and the equilibrium temperature value to obtain the total number of moles of gas in the gas phase, multiply the equilibrium mole fraction of each component by the total number of moles of gas in the gas phase to obtain the mole number of each component, multiply the mole number of each component by its respective molar mass to obtain the mass value of each component, and sum the mass values of each component to obtain the actual total mass value of the gas phase.
[0021] As a further aspect of the present invention, the modification of the charging mass values of each component gas also includes:
[0022] The adsorption-desorption mass difference is obtained by subtracting the total charge mass from the actual total mass of the gas phase. The adsorption-desorption mass difference is then distributed according to the equilibrium mole fraction ratio of each component in the gas phase. The distributed mass values are added to the corresponding charge mass values to obtain the corrected charge mass values of each component.
[0023] As a further aspect of the present invention, the volume of the gas phase space inside the gas cylinder is obtained by subtracting the volume occupied by each component gas in liquid or solid state from the nominal geometric volume of the gas cylinder. The volume occupied by each component gas in liquid or solid state is calculated by dividing the mass value of the component by the liquid or solid density of the component at the filling temperature. For components that always exist in gaseous form inside the gas cylinder, the volume occupied by the component is taken as zero.
[0024] As a further aspect of the present invention:
[0025] The beneficial effects of this invention compared to the prior art are as follows:
[0026] This invention, through comprehensive analysis of the gas state inside a gas cylinder, can effectively correct the mass of each component gas after the gas reaches a stable state, thereby improving the accuracy and reliability of gas weighing results. By judging the gas state change process, errors caused by data calculation before the gas has stabilized can be avoided, making the results closer to the actual gas phase state inside the cylinder. Simultaneously, through comprehensive analysis of gas state parameters, the true distribution of the gas after mixing can be more accurately reflected, making the mass calculation of each component gas more reasonable. This method can further correct the weighing results after gas preparation, making the gas preparation results more consistent with the actual state, reducing mass deviations caused by gas distribution changes, adsorption, desorption, and other factors, thereby improving the stability and consistency of the multi-component gas weighing process. Furthermore, this method can improve the quality control capability during gas preparation, making the final gas component ratio closer to the target requirements, thus enhancing the reliability and application value of the gas preparation results. Attached Figure Description
[0027] The invention will now be further described with reference to the accompanying drawings.
[0028] Figure 1 This is a schematic flowchart of the pressure dynamic compensation gas weighing method based on a gas sensor according to the present invention;
[0029] Figure 2 This is a schematic diagram of the process for correcting the mass values of each component gas in this invention. Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0031] Please see Figures 1-2 As shown, this invention is a pressure-dynamically compensated gas weighing method based on a gas sensor, comprising the following steps:
[0032] Place the cleaned, dried and evacuated gas cylinder in the weighing chamber of the balance, and record the initial tare weight of the gas cylinder after the balance reading stabilizes.
[0033] Specifically, before placing the cleaned, dried, and vacuum-treated gas cylinders into the weighing chamber of the balance, a pre-treatment process is performed to ensure uniformity. The cleaning process removes residual impurities, oil, and remnants from the previous filling. The drying process reduces the impact of moisture on the subsequent component mass and adsorption state. The vacuuming process brings the initial state of the cylinder close to that of an empty cylinder, preventing residual gas from participating in subsequent mass calculations. After entering the weighing chamber, the gas cylinders are kept stationary, allowing the temperature of the cylinder's outer wall to gradually equalize with the air temperature inside the weighing chamber. A relatively stable environmental condition is maintained within the weighing chamber to prevent airflow disturbances and temperature differences on the outer wall from causing the balance reading to drift. When the changes in the balance's output values are within the allowable fluctuation range, the mass value at that moment is recorded as the initial tare weight, which serves as the benchmark for all subsequent incremental weighings of components.
[0034] The first component gas is filled into the gas cylinder. After filling, the gas cylinder is moved back to the weighing chamber of the balance. After the outer surface of the gas cylinder and the environment of the weighing chamber reach thermal equilibrium, the total mass value after filling is recorded. The mass value of the first component gas is obtained by subtracting the initial tare mass value from the total mass value after filling.
[0035] Specifically, when filling the gas cylinder with the first component gas, the target component is introduced into the gas cylinder through the filling interface. After filling is completed, the valve is closed and the gas cylinder is moved back to the weighing chamber. Since the gas compression and flow during the filling process will cause the temperature of the outer surface of the cylinder to deviate from the ambient temperature of the weighing chamber, it needs to be left to stand again until the balance reading returns to a stable state. The total mass after stabilization is recorded as the total mass of the first stage. The mass of the first component gas is obtained by subtracting the initial tare weight from the total mass.
[0036] The second and subsequent component gases are sequentially filled into the gas cylinder. After each filling, the filling mass value of the corresponding component gas is recorded and calculated. The filling mass values of all components are summed to obtain the total filling mass value.
[0037] Specifically, the same processing logic is used when filling the second component and subsequent components. After each filling, the gas cylinder is placed back in the weighing chamber and the outer surface is allowed to reach thermal equilibrium before the new total mass is recorded. The difference between two consecutive stable total masses is the mass value of the component being filled. To avoid recording confusion, a component mass record table can be established according to the filling order. The table includes the component name, filling time, total mass before filling, total mass after filling, and the incremental mass of this filling. After all components are filled, the incremental masses are summed to obtain the total mass value of the filling. This value represents the total mass of the gas cylinder entering the cylinder during the entire filling stage.
[0038] After all component gases are filled, the gas cylinder is sealed and placed in the gas mixing and circulation unit. During the mixing and circulation process, the pressure signal sequence output by the pressure sensor, the temperature signal sequence output by the temperature sensor, and the concentration signal sequence of each component output by the gas sensor are continuously collected.
[0039] Specifically, after all components are filled, the gas cylinder is sealed and connected to a gas mixing and circulation unit for mixing and circulation. The sealed state is used to isolate external gas exchange, and the mixing and circulation is used to accelerate the diffusion and homogenization of each component within the cylinder. The mixing and circulation unit can adopt a closed-loop flow guide structure, using a circulation drive component to continuously flow the gas inside the cylinder between the inner cavity and the external circulation channel, causing the local concentration difference to gradually decrease. During the mixing and circulation process, pressure signal sequences, temperature signal sequences, and component concentration signal sequences are continuously acquired. Continuous acquisition means repeatedly recording the sensor output values at fixed time intervals, such as once every 1 second, forming a data queue arranged chronologically. The pressure signal sequence is a set of pressure values arranged according to the sampling time, the temperature signal sequence is a set of temperature values at the same time reference, and the component concentration signal sequence is a set of concentration values formed for each target component. To ensure that data from different sensors can correspond to the same moment, a unified clock is used to time-stamp each set of data during the acquisition process. If a sensor has a slower response speed, its output value is aligned to the most recent sampling time. Before further processing, the concentration values output by the gas sensor can undergo basic calibration. Basic calibration includes zero-point calibration and range calibration. Zero-point calibration involves recording the sensor baseline output under a reference atmosphere where the target component is known to be absent or negligible, and subtracting this baseline from subsequent raw readings. Range calibration involves recording the sensor response under a calibration gas condition with known standard concentrations, establishing a correspondence between the readings and the actual concentrations, and then converting the real-time readings into concentration values. If two measurement channels are configured for the same component, the average value of the two channels can be taken as the concentration value of that component at that moment to reduce the impact of single-channel fluctuations on subsequent judgments. Pressure and temperature sensors are connected to the circulation channel during installation, and their installation location is chosen in a relatively stable airflow area to reduce the impact of local pulsations on the sampling results. Once the aforementioned continuous data is obtained, the original data basis required for subsequent steady-state determination and mass correction is formed. The mass values of each component obtained in the previous stage reflect the weighing results during filling, while the pressure, temperature and concentration data continuously collected in the mixing and circulation stage reflect the real gas phase state that gradually stabilizes inside the gas cylinder. The two are connected in time sequence, which can provide a complete data source for subsequent data screening based on the stable range, equilibrium state identification and mass correction of each component.
[0040] The pressure signal sequence and concentration signal sequence are used to determine whether the gas cylinder has reached a stable state. If so, the mass values of each component gas are adjusted based on the pressure signal sequence, temperature signal sequence and concentration signal sequence.
[0041] In a preferred embodiment of the present invention, determining whether the gas cylinder has reached a stable state includes:
[0042] Extract pressure values from N consecutive sampling points in the pressure signal sequence, calculate the variance of the N pressure values, and compare the calculated variance with a preset pressure variance threshold. When the variance is less than the preset pressure variance threshold, record the time of the last sampling point among the current N sampling points as the start time of the pressure stabilization state, continue sliding the window backward, and repeat the variance calculation. When the variance calculated for M consecutive times is less than the preset pressure variance threshold, record the time of the last sampling point in the Mth calculation as the end time of the pressure stabilization state, where N is the number of sampling points corresponding to the width of the sliding window, and M is the number of consecutive judgments.
[0043] In a preferred embodiment, determining whether the gas cylinder has reached a stable state further includes:
[0044] The concentration values of each component are extracted from N consecutive sampling points in the concentration signal sequence. The Euclidean distance between the concentration values of each component in the N sampling points and the concentration values of the previous N sampling points is calculated. The Euclidean distances of all components are summed to obtain the comprehensive concentration change. When the comprehensive concentration change is less than the preset concentration change threshold, the time of the last sampling point in the current N sampling points is recorded as the start time of the concentration stabilization state. The window continues to slide backward and the comprehensive concentration change is calculated repeatedly. When the comprehensive concentration change obtained from M consecutive calculations is less than the preset concentration change threshold, the time of the last sampling point in the Mth calculation is recorded as the end time of the concentration stabilization state.
[0045] Understandably, determining whether the gas cylinder has reached a stable state also includes:
[0046] Obtain the time period A between the start of the pressure steady state and the end of the pressure steady state;
[0047] Obtain the time period B between the start time of the concentration plateau and the end time of the concentration plateau.
[0048] If the gas cylinder reaches a stable state within the intersection of time periods A and B, an error is displayed if time periods A and B do not intersect.
[0049] Specifically, after continuously obtaining pressure signal sequences, temperature signal sequences, and component concentration signal sequences during the gas mixing and circulation process, it is necessary to determine whether the gas state inside the gas cylinder has entered a stable stage.
[0050] The pressure signal sequence consists of continuously recorded pressure data with a uniform sampling period, such as a time-sequential data queue with a sampling period of 1 second. Each data point contains the sampling time and the corresponding pressure value. To determine whether the pressure change tends to stabilize, pressure values from N consecutive sampling points are extracted from the pressure signal sequence using a sliding window method. The sliding window refers to a processing method that extracts a data segment of fixed length from the data sequence and moves it forward step by step. The width of the sliding window is determined by the number of sampling points N. For example, when N is 30, it means that data from 30 consecutive sampling points are analyzed each time. The variance of these 30 pressure values is calculated. The variance describes the dispersion of the pressure data within the time window. Specifically, the average value of the 30 pressure values within the window is calculated first, then the difference between each pressure value and the average value is calculated, and these differences are squared and averaged. The resulting value is the pressure variance of the window.
[0051] To determine whether the pressure has entered a stable state, a pressure variance threshold needs to be set. This threshold can be determined through preliminary experiments. For example, under the condition that the gas inside the cylinder is completely stable, a segment of pressure data is recorded. The pressure variance of multiple windows is calculated using the same window width, and the largest of these variances is used as a reference, with a certain percentage relaxed as the threshold. If the pressure variance calculated for the current window is less than the preset pressure variance threshold, the pressure fluctuation within that time window is considered small, and the time of the last sampling point among the current N sampling points is recorded as the start time of the stable pressure state. Subsequently, the data window continues to slide backward while maintaining the same window width. The variance is recalculated every time a sampling point is moved backward. When the pressure variance calculated M times consecutively is less than the preset pressure variance threshold, the time of the last sampling point in the window corresponding to the Mth calculation is recorded as the end time of the stable pressure state. The number of consecutive judgments, M, is used to prevent misjudgments caused by accidental data fluctuations. For example, a value of 10 can be used, indicating that the variance condition needs to be met for 10 consecutive sliding windows before the pressure is considered to have entered a stable range. Through the above processing, the time interval corresponding to the stable pressure state can be obtained.
[0052] Simultaneously, it is necessary to determine the stability of the concentration changes of each component. During the mixing cycle, the gas sensor continuously outputs concentration data for each component, forming a concentration signal sequence arranged chronologically for each component. For each component, the concentration values of N consecutive sampling points are extracted from the corresponding concentration signal sequence to form a concentration window. Simultaneously, an adjacent window is taken forward in time as the concentration window for the previous moment. The concentration values at corresponding positions within the two windows are compared, the square of the concentration difference at each sampling point is calculated and summed, and the square root of the sum is taken to obtain the Euclidean distance. The Euclidean distance is used to represent the overall magnitude of the concentration change within the two time windows. For example, when N is 30, the current window contains 30 concentration values, and the previous window also contains 30 concentration values. Summing the squares of the 30 differences and then taking the square root yields the Euclidean distance of that component between the two time windows. After calculating the Euclidean distance for each component, the Euclidean distances of each component are summed to obtain the overall concentration change.
[0053] The overall concentration change reflects the degree of change in the concentration of all components between two adjacent time windows. To determine whether the concentration tends to stabilize, a concentration change threshold needs to be set. This threshold can be determined through calibration gas experiments. After homogenization, concentration data is continuously collected, and the overall concentration change between multiple windows is calculated. The larger stable-state change is then taken as a reference, and the threshold is appropriately relaxed. When the calculated overall concentration change is less than the preset concentration change threshold, the time of the last sampling point among the current N sampling points is recorded as the start time of the stable concentration state. Subsequently, the window width is maintained, and the window continues to slide backward while repeatedly calculating the overall concentration change. When the overall concentration change calculated M times consecutively is less than the threshold, the time of the last sampling point in the corresponding window of the Mth calculation is recorded as the end time of the stable concentration state.
[0054] The above steps yield the time intervals corresponding to the stable concentration state. After obtaining the stable pressure and stable concentration time intervals, time alignment is required. Time interval A is formed between the start and end times of the stable pressure state, and time interval B is formed between the start and end times of the stable concentration state. The intersection of time interval A and time interval B is calculated by comparing the start and end times of the two time intervals. The later start time is taken as the intersection start time, and the earlier end time is taken as the intersection end time. When the intersection start time is earlier than the intersection end time, it indicates that there is an overlapping interval. This overlapping interval is the time range within which the pressure and concentration inside the gas cylinder remain stable simultaneously. Within this range, the gas inside the cylinder is considered to have reached a stable state. If the calculation results show that there is no overlapping time between the two time intervals, it means that the pressure and concentration stability did not occur at the same time. In this case, it is necessary to determine that the current mixing cycle has not been completed or that there is an anomaly in the sensor data. Error information can be recorded, and the mixing cycle and data acquisition can continue until a stable interval that meets the conditions is obtained again.
[0055] In a preferred embodiment of the present invention, the correction of the charge mass values of each component gas includes:
[0056] Extract the concentration signal sequences of each component output from the gas sensors within the intersection, calculate the arithmetic mean of the concentration signal sequences of each component within the intersection as the equilibrium concentration value of each component, and convert the equilibrium concentration values of each component into equilibrium mole fractions of each component; extract the pressure signal sequences output from the pressure sensors within the intersection, calculate the arithmetic mean of the pressure signal sequences within the intersection as the equilibrium pressure value; extract the temperature signal sequences output from the temperature sensors within the intersection, calculate the arithmetic mean of the temperature signal sequences within the intersection as the equilibrium temperature value; multiply the equilibrium pressure value by the volume of the gas phase space inside the gas cylinder to obtain the pressure-volume product, divide the pressure-volume product by the product of the universal gas constant and the equilibrium temperature value to obtain the total number of moles of gas in the gas phase, multiply the equilibrium mole fraction of each component by the total number of moles of gas in the gas phase to obtain the mole number of each component, multiply the mole number of each component by its respective molar mass to obtain the mass value of each component, and sum the mass values of each component to obtain the actual total mass value of the gas phase.
[0057] In another preferred embodiment of the present invention, the correction of the charge mass values of each component gas further includes:
[0058] The adsorption-desorption mass difference is obtained by subtracting the total charge mass from the actual total mass of the gas phase. The adsorption-desorption mass difference is then distributed according to the equilibrium mole fraction ratio of each component in the gas phase. The distributed mass values are added to the corresponding charge mass values to obtain the corrected charge mass values of each component.
[0059] In a preferred embodiment, the volume of the gas phase space inside the gas cylinder is obtained by subtracting the volume occupied by each component gas in liquid or solid state from the nominal geometric volume of the gas cylinder. The volume occupied by each component gas in liquid or solid state is calculated by dividing the mass value of the component by the liquid or solid density of the component at the filling temperature. For components that always exist in gaseous form inside the gas cylinder, the volume occupied by the component is taken as zero.
[0060] Specifically, the stable range refers to the data range in which the internal pressure and concentration of each component of the gas cylinder remain relatively stable within this time range. Therefore, the data within this range can more accurately reflect the equilibrium state of the gas inside the gas cylinder.
[0061] When processing the concentration signal sequence of each component output by the gas sensor within the stable range, all concentration data corresponding to each component within the range are extracted in chronological order, and the arithmetic mean of these data is calculated. The arithmetic mean is calculated by summing all sampled concentration values of the same component within the range and then dividing by the number of sampling points, thereby obtaining the average concentration level of the component under stable conditions. This value is denoted as the component equilibrium concentration value.
[0062] Since the concentration values of different components may be output as volume fractions or volume percentages, it is necessary to convert the equilibrium concentration values of each component into equilibrium mole fractions. The equilibrium mole fraction refers to the proportion of a particular component's moles within the total number of gas moles. This conversion can be achieved by normalizing the equilibrium concentration values of all components. Specifically, the equilibrium concentration values of all components are summed to obtain a total concentration value. Then, the equilibrium concentration value of each component is divided by this total concentration value to obtain the molar proportion of each component in the gas mixture. Alternatively, it can be done as follows: 1) Extract the equilibrium concentration values of each component output by the gas sensor, wherein the unit of measurement for the equilibrium concentration values is volume concentration percentage or volume concentration parts per million; when the equilibrium concentration value is a volume concentration percentage, divide the volume concentration percentage value of each component by one hundred to obtain the volume fraction of each component, and use the volume fraction of each component as the mole fraction of each component; when the equilibrium concentration value is a volume concentration parts per million, divide the volume concentration parts per million value of each component by one million to obtain the volume fraction of each component, and use the volume fraction of each component as the mole fraction of each component; 2) when the equilibrium concentration value is a mass concentration value, extract the average molar mass of the mixed gas within the steady-state time interval, divide the mass concentration value of each component by the corresponding molar mass of each component to obtain the molar concentration value of each component, sum the molar concentration values of each component to obtain the total molar concentration value, and divide the molar concentration values of each component by the total molar concentration value to obtain the mole fraction of each component.
[0063] After obtaining the equilibrium mole fractions of each component, the pressure signal sequence output by the pressure sensor within the stable range is processed. The arithmetic mean of all pressure data within this time interval is calculated to obtain the average pressure value of the gas inside the cylinder under stable conditions; this value is used as the equilibrium pressure value. Simultaneously, the temperature signal sequence output by the temperature sensor within the stable range is processed in the same way, and the arithmetic mean of all temperature data is calculated to obtain the equilibrium temperature value of the gas inside the cylinder. The equilibrium pressure and equilibrium temperature values together characterize the thermodynamic state of the gas inside the cylinder during the stable phase. After obtaining the above data, the total molar quantity of the gas inside the cylinder needs to be calculated based on the effective volume of the gas phase space inside the cylinder. The volume of the gas phase space inside the cylinder is not entirely equivalent to the nominal geometric volume of the cylinder, because during the filling process of multi-component gases, some components may exist in liquid or solid form inside the cylinder. These liquid or solid substances will occupy a certain volume and reduce the gas phase space. The nominal geometric volume of the cylinder is the internal volume specified during cylinder manufacturing, for example, a nominal volume of 10 liters or 20 liters. If a component exists as a liquid under the current temperature conditions, its volume needs to be calculated based on the mass of the component added and its liquid density at that temperature. The liquid density can be obtained by consulting a gas property data sheet; for example, carbon dioxide has a specific liquid density value at a particular temperature. Dividing the mass of the component added by its corresponding density gives the volume occupied by that component when it forms a liquid state within the gas cylinder. If a component remains in a gaseous state inside the cylinder, such as nitrogen or helium, its volume in either liquid or solid state is considered zero. The effective volume of the gas phase space inside the cylinder is obtained by summing the calculated volumes of all possible liquid or solid components and then subtracting this summed volume from the nominal geometric volume of the gas cylinder.
[0064] Using the equilibrium pressure and temperature values, along with the aforementioned gas phase volume, the total number of moles of gas inside the cylinder under steady-state conditions can be calculated. After obtaining the total number of moles, multiplying the equilibrium mole fraction of each component by this total number of moles yields the mole quantity of each component in the gas phase of the cylinder. Each gas has a definite molar mass value; for example, nitrogen has a molar mass of 28 grams per mole, and carbon dioxide has a molar mass of 44 grams per mole. Multiplying the mole quantity of each component by its corresponding molar mass gives the mass value of each component in the gas phase. Summing up the mass values of all components gives the actual total mass of the gas phase portion inside the cylinder. This value reflects the total mass of gas actually present in the gas phase of the cylinder under steady-state conditions.
[0065] Because gas may be adsorbed onto the inner surface of the gas cylinder during the filling process or re-desorbed into the gas phase during subsequent mixing, there may be a difference between the total mass value of the filling obtained during the weighing stage and the actual total mass value of the gas phase under steady-state conditions. The adsorption-desorption mass difference can be obtained by subtracting the total filling mass value from the actual total gas phase mass value. If the difference is positive, it indicates that some gas originally adsorbed on the inner surface of the gas cylinder re-enters the gas phase during mixing; if the difference is negative, it indicates that some gas is adsorbed by the inner wall or structural surface of the gas cylinder during the steady-state phase. To correct the filling mass of each component, this mass difference needs to be allocated according to the equilibrium mole fraction ratio of each component in the gas phase. Specifically, the adsorption-desorption mass difference is multiplied by the equilibrium mole fraction of each component to obtain the mass correction amount allocated to that component. This mass correction amount is then added to the filling mass value of that component obtained during the filling stage to obtain the corrected filling mass value of each component. After the above processing, the mass value of each component reflects the mass information during the filling and weighing stage, and is also corrected by combining the gas phase composition under stable conditions, so that the final mass of each component is more consistent with the actual gas distribution inside the gas cylinder.
[0066] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0067] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the present invention.
Claims
1. A pressure-dynamically compensated gas weighing method based on a gas sensor, characterized in that, Includes the following steps: Place the cleaned, dried and evacuated gas cylinder in the weighing chamber of the balance, and record the initial tare weight of the gas cylinder after the balance reading stabilizes. The first component gas is filled into the gas cylinder. After filling, the gas cylinder is moved back to the weighing chamber of the balance. After the outer surface of the gas cylinder and the environment of the weighing chamber reach thermal equilibrium, the total mass value after filling is recorded. The mass value of the first component gas is obtained by subtracting the initial tare mass value from the total mass value after filling. The second and subsequent component gases are sequentially filled into the gas cylinder. After each filling, the filling mass value of the corresponding component gas is calculated. The filling mass values of all components are summed to obtain the total filling mass value. After all component gases are filled, the gas cylinder is sealed and placed in the gas mixing and circulation unit. During the mixing and circulation process, the pressure signal sequence output by the pressure sensor, the temperature signal sequence output by the temperature sensor, and the concentration signal sequence of each component output by the gas sensor are continuously collected. The pressure signal sequence and concentration signal sequence are used to determine whether the gas cylinder has reached a stable state. If so, the mass values of each component gas are adjusted based on the pressure signal sequence, temperature signal sequence and concentration signal sequence.
2. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 1, characterized in that, Determining whether the gas cylinder has reached a stable state includes: Extract pressure values from N consecutive sampling points in the pressure signal sequence, calculate the variance of the N pressure values, and compare the calculated variance with a preset pressure variance threshold. When the variance is less than the preset pressure variance threshold, record the time of the last sampling point among the current N sampling points as the start time of the pressure stabilization state, continue sliding the window backward, and repeat the variance calculation. When the variance calculated for M consecutive times is less than the preset pressure variance threshold, record the time of the last sampling point in the Mth calculation as the end time of the pressure stabilization state, where N is the number of sampling points corresponding to the width of the sliding window, and M is the number of consecutive judgments.
3. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 2, characterized in that, Determining whether the gas cylinder has reached a stable state also includes: The concentration values of each component are extracted from N consecutive sampling points in the concentration signal sequence. The Euclidean distance between the concentration values of each component in the N sampling points and the concentration values of the previous N sampling points is calculated. The Euclidean distances of all components are summed to obtain the comprehensive concentration change. When the comprehensive concentration change is less than the preset concentration change threshold, the time of the last sampling point in the current N sampling points is recorded as the start time of the concentration stabilization state. The window continues to slide backward and the comprehensive concentration change is calculated repeatedly. When the comprehensive concentration change obtained from M consecutive calculations is less than the preset concentration change threshold, the time of the last sampling point in the Mth calculation is recorded as the end time of the concentration stabilization state.
4. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 3, characterized in that, Determining whether the gas cylinder has reached a stable state also includes: Obtain the time period A between the start of the pressure steady state and the end of the pressure steady state; Obtain the time period B between the start time of the concentration plateau and the end time of the concentration plateau. If the gas cylinder reaches a stable state within the intersection of time periods A and B, an error is displayed if time periods A and B do not intersect.
5. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 4, characterized in that, The corrections to the charge mass values for each component gas include: Extract the concentration signal sequences of each component output from the gas sensors within the intersection, calculate the arithmetic mean of the concentration signal sequences of each component within the intersection as the equilibrium concentration value of each component, and convert the equilibrium concentration values of each component into equilibrium mole fractions of each component; extract the pressure signal sequences output from the pressure sensors within the intersection, calculate the arithmetic mean of the pressure signal sequences within the intersection as the equilibrium pressure value; extract the temperature signal sequences output from the temperature sensors within the intersection, calculate the arithmetic mean of the temperature signal sequences within the intersection as the equilibrium temperature value; multiply the equilibrium pressure value by the volume of the gas phase space inside the gas cylinder to obtain the pressure-volume product, divide the pressure-volume product by the product of the universal gas constant and the equilibrium temperature value to obtain the total number of moles of gas in the gas phase, multiply the equilibrium mole fraction of each component by the total number of moles of gas in the gas phase to obtain the mole number of each component, multiply the mole number of each component by its respective molar mass to obtain the mass value of each component, and sum the mass values of each component to obtain the actual total mass value of the gas phase.
6. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 1, characterized in that, The corrections to the charge mass values for each component gas also include: The adsorption-desorption mass difference is obtained by subtracting the total charge mass from the actual total mass of the gas phase. The adsorption-desorption mass difference is then distributed according to the equilibrium mole fraction ratio of each component in the gas phase. The distributed mass values are added to the corresponding charge mass values to obtain the corrected charge mass values of each component.
7. The pressure-dynamically compensated gas weighing method based on a gas sensor according to claim 6, characterized in that, The volume of the gas phase space inside the gas cylinder is obtained by subtracting the volume occupied by each component gas in liquid or solid state from the nominal geometric volume of the gas cylinder. The volume occupied by each component gas in liquid or solid state is calculated by dividing the mass of the component by the density of the component in liquid or solid state at the filling temperature. For components that always exist in gaseous form inside the gas cylinder, the volume occupied by the component is taken as zero.