Disclosure of Invention
The invention provides a non-contact rapid assessment method for the mixing state of residual gas in a submerged gas cylinder, which aims to rapidly and accurately assess the proportion of the residual gas in the gas cylinder.
The non-contact rapid assessment method for the residual gas mixing state of the submerged gas cylinder comprises the following steps:
Transmitting sound waves with continuously variable frequency through a sound wave transmitter, after the sound waves penetrate through the wall of the submerged gas cylinder and the residual gas in the interior, acquiring the sound wave signals after penetrating through the sound wave transmitter in real time by a sound wave receiver, recording the time difference from the transmission to the reception of the sound waves, and calculating an original sound velocity value by combining with a fixed transmission distance;
Filtering noise interference based on the acoustic wave signals acquired by the receiver in real time, and calculating an amplitude attenuation spectrum and a phase shift spectrum of the acoustic wave signals based on the filtered clean acoustic wave signals;
Based on the surface temperature of the gas cylinder and the pressure data of the gas cylinder, carrying out physical correction on the original sound velocity value to obtain a standardized sound velocity value irrelevant to the environment;
and calling a trained inversion model based on the minimum attenuation frequency, the maximum phase difference and the standardized sound velocity value to obtain a gas grouping predicted value.
According to the invention, sound waves with continuously variable frequencies are emitted through the sound wave emitter, the wall of the gas cylinder and the residual gas in the gas cylinder are penetrated, the receiver collects signals and calculates time difference, so that an original sound velocity value is obtained, meanwhile, the surface temperature and pressure data of the gas cylinder are collected, the sound velocity is used for carrying out physical correction, the influence of environmental factors is eliminated, a standardized sound velocity value is obtained, the sound wave signals are filtered, the amplitude attenuation spectrum and the phase deviation spectrum are calculated, the minimum attenuation frequency and the maximum phase difference are extracted, the standardized sound velocity value is combined, a trained inversion model is called, the gas grouping proportion is predicted, no air is discharged or a sensor is required to be disassembled, the efficiency and the safety are improved, the cost is reduced, meanwhile, the accurate evaluation of the helium proportion in the helium-oxygen mixed gas cylinder is ensured, and the safety of a diver is ensured.
Preferably, the filtering noise interference includes the following steps:
Filtering the original sound wave signal by adopting an FIR filter, wherein the coefficients of the FIR filter are designed by using a Kezier window;
and applying a hanning window to the filtered signal, and multiplying the filtered signal by the hanning window to obtain a windowed signal, namely a filtered clean sound wave signal.
Preferably, the FIR filter adopts a 128-order filter, and the shape parameter of the corresponding keze window is 8.6.
Preferably, obtaining the minimum attenuation frequency comprises the steps of:
performing fast Fourier transform on the received signal and the transmitted signal respectively, calculating the frequency spectrums of the received signal and the transmitted signal, and calculating the attenuation of each frequency point based on the frequency spectrums;
and searching a continuous frequency band which meets the attenuation smaller than a preset threshold value in a preset frequency band, and extracting the lowest frequency of the continuous frequency band as the minimum attenuation frequency.
Preferably, obtaining the maximum phase difference includes the steps of:
positioning a preset frequency point, extracting the phase angle of a received signal and a transmitted signal at the preset frequency point, calculating the difference value of the phase angles of the received signal and the transmitted signal, performing phase unwrapping processing, and finally calculating the absolute value of the phase difference after unwrapping as the maximum phase difference.
Preferably, the physical correction of the original sound velocity value includes the steps of:
Converting the measured temperature from the temperature to Kelvin, establishing a polynomial regression model according to experimental data, calculating a temperature correction factor, and multiplying an original sound velocity value by the temperature correction factor to obtain a sound velocity after temperature correction;
establishing polynomial regression model according to experimental data, calculating pressure correction factor, multiplying temperature corrected sound velocity by pressure correction factor to obtain pressure corrected sound velocity, i.e. normalized sound velocity value, or,
And applying a physical compensation formula to obtain the normalized sound velocity.
Preferably, the inversion model adopts a lightweight neural network model, wherein the lightweight neural network model comprises an input layer, two hidden layers and an output layer;
The input layer comprises three characteristics of three nodes corresponding to input vectors, the first hidden layer comprises 8 nodes, the second hidden layer comprises 5 nodes by using a ReLU activation function, and the output layer comprises n nodes corresponding to the mole fraction of the gas in n;
wherein the output of the lightweight neural network model satisfies the constraint that the sum of the mole fractions of all gases is 1, with the mole fraction of each gas ranging between 0 and 100%.
Preferably, in each detection cycle, on-line error compensation is performed, including the steps of:
In each detection cycle, acquiring a current predicted value, temperature and pressure of the gas component, adjusting the reference sound velocity according to the change of the temperature and the pressure by using the reference sound velocity as a benchmark, calculating the influence on the sound velocity based on the specific heat ratio and the mole fraction of each gas component, and calculating the theoretical sound velocity based on the influence and the adjusted reference sound velocity;
And calculating the difference value between the theoretical sound velocity and the standardized sound velocity, judging whether the absolute value of the difference value is larger than a preset threshold value, and if the absolute value of the difference value exceeds the preset threshold value, adopting a Kalman filter to correct inversion model parameters.
Preferably, the correction of the inversion model parameters by the kalman filter comprises the following steps:
The method comprises the steps of defining Kalman filter parameters, wherein a weight matrix of an inversion model is used as a state variable, standardized sound velocity and a gas component predicted value are used as observation data, a constant model is adopted as a state transition matrix, the change of the weight matrix is described by process noise, the difference value between the detected sound velocity and the theoretical sound velocity is used as an observation signal by an observation model, and an observation error is described by the observation noise;
The Kalman filter updating is that a weight matrix of the current moment is estimated by using a weight matrix of the last moment, and the current prediction error covariance is updated based on the prediction error covariance and the process noise covariance of the previous moment;
Calculating Kalman gain according to the current prediction error covariance and the observed noise covariance, adjusting a weight matrix based on the calculated Kalman gain, and updating the error covariance based on the Kalman gain;
And reloading the updated weight matrix into an inversion model for subsequent gas component prediction.
The beneficial effects of the invention include:
according to the invention, sound waves with continuously variable frequencies are emitted through the sound wave emitter, the wall of the gas cylinder and the residual gas in the gas cylinder are penetrated, the receiver collects signals and calculates time difference, so that an original sound velocity value is obtained, meanwhile, the surface temperature and pressure data of the gas cylinder are collected, the sound velocity is used for carrying out physical correction, the influence of environmental factors is eliminated, a standardized sound velocity value is obtained, the sound wave signals are filtered, the amplitude attenuation spectrum and the phase deviation spectrum are calculated, the minimum attenuation frequency and the maximum phase difference are extracted, the standardized sound velocity value is combined, a trained inversion model is called, the gas grouping proportion is predicted, no air is discharged or a sensor is required to be disassembled, the efficiency and the safety are improved, the cost is reduced, meanwhile, the accurate evaluation of the helium proportion in the helium-oxygen mixed gas cylinder is ensured, and the safety of a diver is ensured.
Detailed Description
In order to make the technical problems, technical schemes and beneficial effects to be solved more clear, the application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Referring to fig. 1, the non-contact rapid assessment method for the residual gas mixing state of the submerged gas cylinder comprises the following steps:
S1, transmitting sound waves with continuously-changed frequency through a sound wave transmitter, after the sound waves penetrate through the wall of a submerged gas cylinder and residual gas in the interior, acquiring sound wave signals after penetrating through the sound waves in real time by a sound wave receiver, recording the time difference from the transmission to the reception of the sound waves, and calculating an original sound velocity value by combining with a fixed transmission distance;
In the embodiment, the sound wave transmitter and the sound wave receiver are symmetrically arranged on the diving gas cylinder, trigger signals are synchronously started through the main controller during data acquisition, and meanwhile, sweep frequency signal generation of the ultrasonic wave transmitting device and ADC sampling clocks of the temperature and pressure sensors are started, namely, the main controller transmits a hardware trigger pulse through the GPIO pin, the pulse ultrasonic wave transmits the pulse ultrasonic wave, the temperature and pressure sensors receive the trigger signals, the ultrasonic wave transmitter immediately starts generation of linear scanning signals after receiving the trigger signals, and the ADC sampling clocks of the temperature and pressure sensors are synchronously started to ensure that temperature and pressure data and the sound wave signals are acquired simultaneously.
The link for acquiring the sound wave signals is specifically as follows:
Firstly, an acoustic wave transmitting device generates a sweep frequency signal with the frequency of 0.5MHz linearly increased to 1.5MHz according to a trigger signal of a main controller, the duration of the sweep frequency signal is 1ms, the sweep frequency signal is ensured to propagate in helium-oxygen mixed gas for a sufficient time, the generated sweep frequency signal is amplified by power, the acoustic wave signal is ensured to have sufficient strength to penetrate helium-oxygen mixed gas, the specific amplified speed is not limited, the acoustic wave transmitting device is regulated according to practical conditions, and the amplified signal drives a piezoelectric transducer to generate mechanical vibration, so that electric energy is converted into acoustic energy.
For the purpose of the above-mentioned specific frequency sweep parameter which is linearly increased is only exemplary, it should be noted that the frequency sweep is based on increasing the penetration probability, i.e. dynamically changing the signal frequency in a certain frequency range (such as continuously scanning from low frequency to high frequency), and the frequency most suitable for penetrating the target medium (bottle wall) is screened out by testing the transmission effect of signals with different frequencies.
The piezoelectric transducer at the receiving end captures the sound wave signal transmitted from the transmitting end, the sound velocity of helium-oxygen mixed gas is different from that of pure air, the sound wave signal is affected by gas components in the transmission process, so that the frequency, amplitude and phase of the signal are changed, and the received sound wave signal is very weak, so that the signal to noise ratio is improved by amplifying and filtering through a signal conditioning circuit, wherein the signal conditioning circuit comprises a preamplifier and a low-pass filter and is used for amplifying the weak signal and filtering high-frequency noise, and the invention is not repeated in the conventional technical means in the field.
The conditioned signal is input to a special audio processing chip (such as an ADAU 1772) for 24-bit ADC sampling, the sampling rate is set to at least 3.2MHz to meet the Nyquist theorem and ensure that the high frequency components of the signal can be accurately captured, wherein the audio processing chip records the starting moment of transmitting the signal and the arrival moment of receiving the signal, and the original sound velocity value is calculated by combining a fixed transmission distance (namely the installation distance between a sound wave transmitter and a sound wave receiver, and the distance between the sound wave transmitter and the sound wave receiver is also known because the diameter of a gas cylinder is known), wherein the specific expression is as follows:; Wherein: representing a time difference; indicating the arrival time of the received signal; Indicating the starting moment of the transmitted signal; representing a fixed transmission distance; representing the raw sound velocity value.
And finally, the original sound velocity value, the acquired temperature and pressure and the original sound wave sampling data are required to be packaged through a main controller to form a data packet for subsequent analysis.
And finally, the original sound velocity value, the acquired temperature and pressure and the original sound wave sampling data are required to be packaged through a main controller to form a data packet for subsequent analysis.
S2, filtering noise interference based on the acoustic wave signals acquired by the receiver in real time, and calculating an amplitude attenuation spectrum and a phase shift spectrum of the acoustic wave signals based on the filtered clean acoustic wave signals;
one possible implementation in this embodiment is:
The method comprises the steps of receiving original sound wave signals, synchronously receiving reference signals, namely original sweep signals of a transmitting end, wherein the length of the original sweep signals is 3200 sampling points, the length of the original sweep signals corresponds to 1ms, the sampling rate is 3.2MHz, namely 320 ten thousand sampling points per second, and the quantization precision is 24 bits;
in this embodiment, denoising is performed on data by bandpass filtering and windowing, which is specifically as follows:
The band-pass filter removes frequency components below 0.4MHz and above 1.6MHz in the signal, reduces noise influence, specifically adopts a 128-order Finite Impulse Response (FIR) filter, the filter coefficient is calculated through a Kezier window, and the window parameter beta=8.6, wherein the passband frequency range of the filter is The filter only retains signals in a preset frequency range and removes signals of other frequencies;
for each sample point n (n from 0 to 3199), a filtered signal value is calculated: Wherein: Representing the filtered signal; Representing the filter coefficients, based on a keze window design;
the Hanning window is used for reducing frequency spectrum leakage, and the windowing processing is carried out on the obtained filtering signal values, wherein the specific expression is as follows: Wherein: Representing hanning window coefficients, N representing signal length, 3200, and N representing sample index. Wherein: representing the windowed signal, based on which a filtered clean acoustic signal is obtained.
The method comprises the steps of respectively carrying out 4096-point fast Fourier transform on a received signal and a transmitted signal, calculating the frequency spectrums of the received signal and the transmitted signal, and calculating the attenuation of each frequency point based on the frequency spectrums, wherein the specific expression is as follows:;; Wherein: Representing the spectrum of the received signal; representing the frequency spectrum of the reference signal; Representing the windowed received signal; k represents a frequency index from 0 to 4095; An index representing a current time sampling point; Representing complex exponential factors for converting the time domain signal into weights of the frequency domain signal; Representing frequency The attenuation amount is L, L represents a fixed transmission distance, whereinThe frequency resolution is calculated according to the sampling rate and the FFT point number;
scanning the frequency band of 0.4-1.6MHz to find out the satisfaction And outputs the lowest frequency of the band.
Locating a predetermined frequency point 1MHz (index) Extracting the phase angle of the received signal and the transmitted signal at a predetermined frequency point:; Wherein: Representing the phase angle of the received signal at 1 MHz; Representing the phase angle of the reference signal at 1 MHz; And Representing the imaginary and real parts of the spectrum, respectively; Representing the received signal spectrum at a frequency index of 1280; representing the spectrum of the reference signal at a frequency index of 1280;
Calculating the difference value of the phase angles of the received signal and the transmitted signal, performing phase unwrapping treatment, and finally calculating the absolute value of the phase difference after unwrapping to be used as the maximum phase difference, wherein the expression is as follows: Wherein: Representing the maximum phase difference; The de-wrapping function is shown for processing the phase jumps to continue the phase difference.
The embodiment also comprises an exception handling mechanism, which is specifically as follows:
When meeting the requirements When the current frame data is discarded, the re-acquisition is triggered;
When there is no satisfaction of Setting up the continuous frequency band of dB/cm,Is the lowest decaying frequency.
In the embodiment set, the cooperation of high frequency selectivity and strong noise suppression is realized through the combination of the 128-order FIR filter and the beta=8.6keze window, wherein the 128-order FIR filter ensures that the transition band is extremely narrow, the target frequency region is precisely locked, signals needing to be reserved are prevented from being filtered, the selection of the beta=8.6keze window ensures that side lobe attenuation in the stop band reaches 80dB, the problem that the noise needing to be filtered is not filtered cleanly is avoided, and meanwhile, the linear phase characteristic of the FIR and the smooth transition of the keze window ensure that the amplitude and phase information of the target signals are free from distortion.
S3, based on the surface temperature of the gas cylinder and the pressure data of the gas cylinder, performing physical correction on an original sound velocity value to obtain a standardized sound velocity value irrelevant to the environment;
Referring to fig. 2, as an implementation manner of the present embodiment, the physical correction of the original sound velocity value includes the following steps:
converting the measured temperature from degrees celsius to kelvin I.e.,Establishing a polynomial regression model according to experimental data, calculating a temperature correction factor, and multiplying an original sound velocity value by the temperature correction factor to obtain a sound velocity after temperature correction;;
Wherein: sparse in the polynomial regression model is determined through experimental data fitting, and a third-order polynomial regression model is adopted in the embodiment; Representing a temperature correction factor; ;
Wherein: representing the sound velocity after temperature correction; Representing an original sound velocity value;
Establishing a polynomial regression model according to experimental data, calculating a pressure correction factor, and multiplying the sound velocity after temperature correction by the pressure correction factor to obtain a standardized sound velocity, wherein the polynomial regression model refers to the polynomial regression model of the temperature correction factor, and the difference is that a one-segment polynomial or a second-order polynomial regression model is adopted for the polynomial regression model after pressure correction in the embodiment, wherein the expression for obtaining the sound velocity after pressure correction is as follows: ;
Wherein: representing a pressure correction factor; representing the sound velocity after pressure correction; representing a normalized sound velocity.
As another implementation manner of the present embodiment, a physical compensation formula is applied to obtain a normalized sound velocity, and the specific expression is as follows:;
Wherein: The reference temperature, the temperature under standard conditions, is set to 293k (20 ℃); the reference pressure, the pressure under standard conditions, is set to 1 atmosphere (atm); The environmental temperature is expressed in Kelvin, and is measured in real time by a sensor, and the environmental pressure is expressed in P, and is measured in real time by a sensor.
S4, calling a trained inversion model based on the minimum attenuation frequency, the maximum phase difference and the standardized sound velocity value to obtain a gas grouping predicted value.
Referring to fig. 3, the inversion model adopts a lightweight neural network model, wherein the lightweight neural network model comprises an input layer, two hidden layers and an output layer;
The input layer comprises three characteristics of input vectors corresponding to three nodes The first hidden layer comprises 8 nodes, the ReLU activation function is used, the second hidden layer comprises 5 nodes, the ReLU activation function is used, the output layer comprises n nodes corresponding to the mole fraction of the gas in n, the exemplary n is 2, and the mole fraction of the helium and the oxygen is output, which is only an exemplary technical scheme, and the invention is not limited.
Wherein the output of the lightweight neural network model satisfies the constraint that the sum of the mole fractions of all gases is 1, with the mole fraction of each gas ranging between 0 and 100%.
In each detection cycle, on-line error compensation is performed, including the steps of:
In each detection cycle, acquiring a current predicted value, temperature and pressure of the gas component, adjusting the reference sound velocity according to the change of the temperature and the pressure by using the reference sound velocity as a benchmark, calculating the influence on the sound velocity based on the specific heat ratio and the mole fraction of each gas component, and calculating the theoretical sound velocity based on the influence and the adjusted reference sound velocity;
;
Wherein: Representing a theoretical sound velocity calculated based on the aerodynamic formula; Representing the reference sound velocity, which is the sound velocity under standard environmental conditions (e.g., 20 ℃ C., 1 standard atmosphere), T representing the temperature measured by the current sensor, P representing the pressure measured by the current sensor; representing a reference temperature; Representing a reference pressure; the specific heat ratio of the gas component in the ith is represented as the ratio of the specific heat capacity of the constant pressure to the specific heat capacity of the constant capacity; represents the mole fraction of the gas component in the i;
And calculating the difference value between the theoretical sound velocity and the standardized sound velocity, judging whether the absolute value of the difference value is larger than a preset threshold value (2 m/s), and if the absolute value of the difference value exceeds the preset threshold value, correcting inversion model parameters by adopting a Kalman filter.
The Kalman filter for correcting inversion model parameters comprises the following steps:
Defining Kalman filter parameters by inverting a weight matrix of the model (e.g And) As a state variable, normalizing sound velocityAnd gas composition predicted valueAs observation data, wherein the state transition matrix adopts a constant model ,Representing process noise; Representing state estimation (weight matrix) at the kth iteration, wherein the change of the weight matrix is described by process noise, wherein the observation model takes the difference value between the detected sound velocity and the theoretical sound velocity as an observation signal, and the observation noise describes observation errors: , Representing the observed value; representing observed noise;
The Kalman filter updating is to estimate the weight matrix of the current moment by using the weight matrix of the last moment: Wherein Representing a prediction state estimate; representing the last updated state estimate;
and updating the current prediction error covariance based on the prediction error covariance and the process noise covariance of the previous time instant : WhereinRepresenting a process noise covariance; Representing the error covariance matrix after the last update;
Calculating Kalman gain according to the current prediction error covariance and the observed noise covariance: Wherein Representing an observation matrix; representing an observed noise covariance matrix; Representing a transpose of the observation matrix;
Adjusting a weight matrix based on the calculated kalman gain: Wherein Representing the updated state estimate;
Updating an error covariance based on the Kalman gain; Wherein Representing the identity matrix;
And reloading the updated weight matrix into an inversion model for subsequent gas component prediction.
In the embodiment, only the standardized sound velocity value, the minimum attenuation frequency and the maximum phase difference are taken as input characteristics, the three characteristics are orthogonal and complementary, the standardized sound velocity value reflects the overall elasticity characteristic of gas, the attenuation frequency reflects the absorption characteristic of gas and the phase difference reflects the propagation characteristic of gas, the three characteristics describe gas components from different dimensions, the information redundancy is low, and the embodiment does not need to consider gas cylinder parameters after considering the three characteristics, the concrete reasons are that the gas cylinder diameter is calculated as a known parameter when the original sound velocity is calculated, so that repeated input is not needed, the influence of sound wave penetrating shielding is processed through signal filtering, the design of a sweep frequency signal ensures that the sound wave can effectively penetrate the wall of a cylinder and fully act on internal gas, secondly, the material and the volume of the gas cylinder are fixed in the experimental training process, the influence of the sound wave is contained in the systematic error of a model training stage, the gas cylinder parameter does not need to be taken as variable input, the anti-interference capability of the model is not needed to be enhanced, the gas cylinder parameters (such as rust and surface aging) can change along with time due to the essential relation between the gas components and the acoustic characteristics, the measured error is increased, and the physical correction of the measured error is increased, the influence of the physical quality and the gas stability is more focused on the gas model is eliminated after the physical quality is processed.
And finally, dynamically correcting model weights through differences between sound speeds and standardized sound speeds by a Kalman filter, and ensuring prediction accuracy through self-adaptive adjustment even if the influence of unmodeled gas cylinder parameters (such as wall thickness deviation) exists.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the application.