A synchronous sampling method for infrared gas data
By using synchronous sampling of light cutters and photoelectric sensors driven by synchronous motors in infrared gas analyzers, and using fast Fourier transformation algorithm, the problems of spectrum leakage and phase error in infrared gas analyzers are solved, achieving high accuracy and fast sampling process.
Patent Information
- Application Number
- CN202210884393.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-07-26
AI Technical Summary
The existing infrared gas analyzers have problems of spectrum leakage and phase error during the sampling process, resulting in calculation errors, and the existing synchronous sampling method increases CPU processing time and data volume.
The light cutting sheet and photoelectric sensor driven by a synchronous motor are used to realize synchronous sampling through square wave signals, and the frequency, amplitude and phase of infrared light are calculated using the fast Fourier transform algorithm to avoid windowing processing and secondary sampling.
Synchronous sampling of infrared gas data is realized, spectrum leakage is suppressed, algorithms are simplified, calculation accuracy is improved and sampling speed is accelerated.
Smart Images

Figure CN115266628B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data sampling, and in particular to a method for synchronously sampling infrared gas data. Background Art
[0002] Infrared gas analyzer is an instrument that uses infrared rays to analyze gases. Infrared gas analyzer is an analytical method based on the selective absorption of infrared light by the measured gas components, which belongs to molecular absorption spectroscopy. The light source emits infrared light in a certain wavelength range, and the infrared analyzer converts the infrared light into pulsed infrared radiation, which enters the detector through the measuring gas chamber. During the detection process, the measured gas continuously flows into the measuring gas chamber, and the reference gas chamber is filled with a background gas with no absorption properties. When the concentration of the measured gas in the measuring gas chamber changes, the amount of absorbed infrared light will change accordingly, while the amount of light of the reference light beam of the reference gas chamber will not change. Then, the difference in the amount of light emitted from the measuring gas chamber and the reference gas chamber passes through the detector, which will cause the detector to generate a pressure difference and be converted into an electrical signal by the detector. The electrical signal is amplified and transmitted to the control unit for processing. The control unit collects the electrical signal generated by the detector through the AD chip, performs FFT operation on the collected electrical signal, and the size of the final output signal is proportional to the component concentration of the measured gas.
[0003] Existing infrared gas sampling usually has two modes: asynchronous sampling and synchronous sampling. In asynchronous sampling, for example Figure 3 As shown in the figure, the phase of each sampling is different, and the sampling result has several sine wave signals. The FFT algorithm is used to Figure 3 Calculating the sampling results shown in the figure will cause spectrum leakage and fence effect, which will cause large errors in subsequent spectrum analysis and harmonic measurement, especially phase errors. Although the windowing algorithm can be used to correct the calculation results, the windowing algorithm will increase the calculation steps and calculation time, thereby increasing the CPU processing time and reducing the response speed. Moreover, there are many types of window functions, and not all window functions can correct the calculation results, so the selection of window functions is more complicated. In synchronous sampling, continuous signals are usually sampled at a constant speed, and a set of asynchronous sampling sequences are obtained. Then, the sampling sequence is subjected to secondary synchronous sampling. This method will increase the amount of sampled data, and the secondary sampling calculation amount is large, which will also increase the CPU processing time and reduce the response speed. Summary of the invention
[0004] The purpose of the present invention is to provide an infrared gas data synchronous sampling method to address the deficiencies in the prior art, which can achieve synchronous sampling of infrared light data, simplify algorithms, and improve calculation accuracy.
[0005] The technical solution of the present invention is: a method for synchronous sampling of infrared gas data, the steps are as follows:
[0006] 1) A light-cutting piece driven by a synchronous motor is set in the infrared gas analyzer as a light-cutting device, and a photoelectric sensor is set on the rotation path of the light-cutting piece, so that the switching frequency of the photoelectric sensor is the same as the light-cutting frequency of the light-cutting piece, and a square wave signal is sent to the control unit through the photoelectric sensor; a capacitance detector is set in the infrared gas analyzer to convert the light quantity difference between the measuring gas chamber and the reference gas chamber into an electrical signal and transmit it to the control unit;
[0007] 2) The control unit sets the sampling period, and sets the data sampling flag to true when no sampling is performed, and the data sampling flag to false when sampling is performed;
[0008] 3) The control unit uses the square wave signal sent by the photoelectric sensor as the external interrupt source. At the beginning of each switching cycle of the square wave signal, it enters the interrupt function and determines whether the sampling flag is true:
[0009] If the data sampling flag is true, the control unit starts the timed sampling according to the set sampling period and sets the data sampling flag to false at the same time;
[0010] If the data sampling flag is false, the control unit exits the interrupt function and continues to wait for the next cycle of the square wave signal;
[0011] 4) After the control unit completes sampling and calculation of the sampled data, it sets the data sampling flag to true and starts the next cycle of sampling.
[0012] Furthermore, the control unit uses the rising edge of the square wave electrical signal of the photoelectric sensor as an interrupt mark.
[0013] Furthermore, the control unit uses the falling edge of the square wave electrical signal of the photoelectric sensor as an interrupt mark.
[0014] Furthermore, the control unit uses a fast Fourier transform algorithm to calculate the frequency, amplitude and phase of the infrared light.
[0015] The beneficial effects of adopting the above technical solution are as follows: This method synchronously samples the electrical signal of the capacitive detector of the infrared gas analyzer, which can suppress the spectrum leakage effect. At the same time, it does not need to window the data, increase the sampling volume and secondary sampling processing, which can simplify the algorithm implementation and speed up the sampling execution speed, thereby improving the calculation accuracy.
[0016] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a logic flow chart of the present invention;
[0018] Figure 2This is a sampling result diagram of Example 1 of the present invention;
[0019] Figure 3 This is a sampling result diagram for existing asynchronous sampling. DETAILED DESCRIPTION
[0020] See also Figure 1 , a synchronous sampling method for infrared gas data, the specific steps are as follows:
[0021] 1) A light-cutting piece driven by a synchronous motor is set in the infrared gas analyzer as a light-cutting device, and a photoelectric sensor is set on the rotation path of the light-cutting piece, so that the switching frequency of the photoelectric sensor is the same as the light-cutting frequency of the light-cutting piece, and a square wave signal is sent to the control unit through the photoelectric sensor;
[0022] A capacitance detector is provided in the infrared gas analyzer to convert the light quantity difference between the measuring gas chamber and the reference gas chamber into an electrical signal and transmit it to the control unit;
[0023] The cutter rotates periodically under the rotation of the synchronous motor, continuously and periodically blocks the light source, cuts the infrared light according to a certain period, turns the infrared light into pulsed infrared radiation, and frequency modulates the infrared light, so that the signal generated by the capacitance detector is an AC signal.
[0024] 2) The control unit sets a sampling period, which can be set according to actual data needs, and sets a data sampling flag to true when no sampling is being performed, and a data sampling flag to false when sampling is being performed.
[0025] 3) The control unit uses the square wave signal sent by the photoelectric sensor as the external interrupt source. At the beginning of each switching cycle of the square wave signal, it enters the interrupt function. This embodiment uses either the rising edge of the square wave signal as the interrupt flag or the falling edge of the square wave signal as the interrupt flag, and determines whether the data sampling flag is true:
[0026] If the data sampling flag is true, the control unit starts the timed sampling according to the set sampling period, and sets the data sampling flag to false at the same time, so as to avoid the control unit starting the next sampling before the current sampling is finished, thus ensuring the synchronization of data sampling;
[0027] If the data sampling flag is false, it means that data sampling is currently in progress, then the control unit exits the interrupt function and continues to wait for the next cycle of the square wave signal.
[0028] 4) After the control unit completes sampling and calculation of the sampled data, it sets the data sampling flag to true and starts the next cycle sampling. This embodiment uses the fast Fourier algorithm to calculate the frequency, amplitude and phase of the infrared light. The algorithm can directly call the FFT algorithm module of the control unit.
[0029] Embodiment 1, as Figure 2 As shown, the sampling results of the synchronous sampling method described above have the same initial phase for each sampling, and the sampling result has only one sine wave signal, which can achieve the effect of synchronous sampling. This sampling result does not require secondary synchronous sampling processing.
[0030] In this sampling method, the control unit controls the sampling time of each time at the same point, so that each sampling starts from the same phase of the electrical signal output by the capacitance detector, ensuring that the initial phase of each sampling is the same. When the initial sampling phase and the sampling period are the same, it can be ensured that the sampling frequency and phase will not change, thereby achieving the purpose of synchronous sampling.
Claims
1. A method for synchronous sampling of infrared gas data, characterized in that Here are the steps: 1) A light-cutting piece driven by a synchronous motor is set in the infrared gas analyzer as a light-cutting device, and a photoelectric sensor is set on the rotation path of the light-cutting piece, so that the switching frequency of the photoelectric sensor is the same as the light-cutting frequency of the light-cutting piece, and a square wave signal is sent to the control unit through the photoelectric sensor; a capacitance detector is set in the infrared gas analyzer to convert the light quantity difference between the measuring gas chamber and the reference gas chamber into an electrical signal and transmit it to the control unit; 2) The control unit sets the sampling period, and sets the data sampling flag to true when no sampling is performed, and the data sampling flag to false when sampling is performed; 3) The control unit uses the square wave signal sent by the photoelectric sensor as the external interrupt source. At the beginning of each switching cycle of the square wave signal, it enters the interrupt function and determines whether the sampling flag is true: If the data sampling flag is true, the control unit starts the timed sampling according to the set sampling period and sets the data sampling flag to false at the same time; If the data sampling flag is false, the control unit exits the interrupt function and continues to wait for the next cycle of the square wave signal; 4) After the control unit completes sampling and calculation of the sampled data, it sets the data sampling flag to true and starts the next cycle of sampling.
2. The infrared gas data synchronous sampling method according to claim 1, characterized in that: The control unit uses the rising edge of the square wave electrical signal of the photoelectric sensor as an interrupt mark.
3. The infrared gas data synchronous sampling method according to claim 1, characterized in that: The control unit uses the falling edge of the square wave electrical signal of the photoelectric sensor as an interrupt mark.
4. The infrared gas data synchronous sampling method according to claim 1, characterized in that: The control unit uses a fast Fourier transform algorithm to calculate the frequency, amplitude and phase of the infrared light.
Citation Information
Patent Citations
Highway addressable remote transducer (HART) modulator-demodulator and data transmission method thereof
CN103067324A
Infrared spectrometer signal drift error tracking system
CN103542933A