Dual-channel gain adaptive photoelectric detection and processing method for gas detection
By employing a dual-channel gain adaptive photoelectric detection and processing method, the problem of signal dynamic range in gas detection is solved, achieving high-precision and rapid gas concentration measurement, which is suitable for gas detection systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI QINGXIN SENSING TECH CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-04-28
AI Technical Summary
In existing gas detection technologies, fixed-gain amplifier circuits are difficult to adapt to the extremely wide dynamic range of the gas concentration to be measured, resulting in weak signals being submerged or strong signals being saturated. Furthermore, the zero-point drift and transient oscillations caused by automatic gain control are difficult to meet real-time requirements.
A dual-channel gain adaptive photoelectric detection method is adopted. By acquiring and processing signals through the reference channel and the measurement channel, the signal amplitude is monitored in real time. Progressive gain adjustment and dynamic dark voltage subtraction technology are used to ensure that the signal is within the linear response range. Combined with temperature compensation, high-precision gas concentration calculation is achieved.
It achieves high-precision gas detection over a wide range, avoids signal flooding and saturation, improves system robustness and response speed, and eliminates nonlinear errors and transient oscillation interference in concentration calculation.
Smart Images

Figure CN121933458A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas photoelectric detection technology, specifically a dual-channel gain adaptive photoelectric detection and processing method for gas detection. Background Technology
[0002] Currently, in the field of gas detection based on tunable semiconductor laser absorption spectroscopy (TDLAS) or non-dispersive infrared (NDIR) technology, photoelectric detection systems typically employ transimpedance amplifier circuits to convert weak photocurrents into voltage signals. However, the concentration of the gas being detected often exhibits a very wide dynamic range, from parts per million (ppm) at the initial stage of a leak to percentages (%) at the explosion limit. Traditional fixed-gain detection circuits face an intractable contradiction: If a high gain is set to detect weak signals, the signal is very likely to exceed the linear region of the amplifier and be saturated when the gas concentration increases; if a low gain is set to prevent saturation, the weak low-concentration signal will be submerged in the quantization noise floor of the circuit, making it impossible to effectively extract the useful signal.
[0003] Although existing technologies have introduced automatic gain control (AGC) to attempt to solve the aforementioned dynamic range problem, it has led to new conflicting technical challenges in practical applications: First, the dark voltage (including dark current and offset voltage) of the amplifier circuit varies significantly under different gain factors. The concentration inversion formula based on the Beer-Lambert law is extremely sensitive to zero-point drift, and direct logarithmic calculation will lead to serious nonlinear calculation errors. Secondly, at the moment of gain switching, the circuit will inevitably generate transient oscillations and overshoots. The existing fixed delay shielding strategy has a conflict between time and accuracy: too short a delay will lead to the acquisition of incorrect oscillation signals, thus triggering false alarms, while too long a delay will increase the system blind zone time, which cannot meet the stringent real-time requirements of gas leak monitoring. Summary of the Invention
[0004] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, the objective of this invention is to propose a dual-channel gain adaptive photoelectric detection and processing method for gas detection, to achieve high-precision detection over a wide measurement range.
[0005] To achieve the above objectives, a first aspect of the present invention proposes a dual-channel gain adaptive photoelectric detection and processing method for gas detection, comprising the following steps: Acquire the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module; Perform a linear response determination step to determine whether the real-time amplitude of the measured channel voltage signal is within a preset linear response range; If the determination result is negative, the gain adaptive adjustment process is triggered. The target gain multiple is determined based on the deviation between the real-time amplitude and the linear response range, and a gain switching command is sent to the programmable gain amplifier until the amplitude of the measured channel voltage signal returns to the linear response range. Perform the concentration inversion step, and calculate the real-time concentration value of the gas to be measured based on the measurement channel voltage signal after gain switching, the reference channel voltage signal, and the target gain factor; The process of determining the target gain factor includes: in response to the real-time amplitude of the measured channel voltage signal being lower than the lower threshold of the linear response interval, increasing the gain factor step by step according to a preset progressive gain enhancement strategy, and re-detecting the real-time amplitude after each enhancement, until the real-time amplitude is higher than the lower threshold and lower than the upper threshold of the linear response interval.
[0006] To achieve the above objectives, a second aspect of the present invention provides a dual-channel gain adaptive photoelectric detection and processing system for gas detection, the system comprising: The signal acquisition module is used to acquire the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module; The linear response determination module is used to perform the linear response determination step to determine whether the real-time amplitude of the measured channel voltage signal is within the preset linear response range. The gain adaptive control module is used to trigger the gain adaptive adjustment process when the linear response determination module determines that the real-time amplitude deviates, determine the target gain multiple, and send a gain switching command to the programmable gain amplifier. The concentration inversion calculation module is used to perform the concentration inversion step and calculate the real-time concentration value of the gas to be measured based on the measurement channel voltage signal after gain switching, the reference channel voltage signal, and the target gain factor. The process of determining the target gain factor in the gain adaptive control module includes: in response to the real-time amplitude of the measured channel voltage signal being lower than the lower limit threshold of the linear response interval, the gain factor is gradually increased according to a preset progressive gain enhancement strategy until the real-time amplitude returns to the effective range of the linear response interval.
[0007] To achieve the above objectives, a third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the above-described dual-channel gain adaptive photoelectric detection and processing method for gas detection.
[0008] Compared with the prior art, the beneficial effects of the present invention are as follows: The dual-channel gain adaptive photoelectric detection and processing method for gas detection in this invention achieves high-precision detection over a wide measurement range by introducing a dual-channel gain adaptive and gradient verification mechanism into the photoelectric detection and processing. Its core advantage lies in: By monitoring in real time whether the signal amplitude of the measurement channel deviates from the linear response range, and by adopting a progressive strategy to adaptively adjust the amplification factor, it is ensured that the signal is always in the detector's optimal operating linear range, regardless of whether the concentration is extremely low or high, effectively solving the problems of small signals being submerged and large signals being saturated. In particular, this scheme incorporates a dynamic dark voltage subtraction technique that is strictly tied to the target gain, eliminating the interference of synchronous amplification of dark voltage under high gain on the logarithmic concentration formula and restoring the physical accuracy of concentration inversion. At the same time, it uses a steady-state verification mechanism based on signal gradient convergence to replace the traditional fixed delay, outputting data only when the signal fluctuation amplitude falls within the steady-state noise tolerance. This avoids false alarms caused by gain switching oscillations and minimizes the system's measurement blind zone time, significantly improving the system's robustness and response speed. Attached Figure Description
[0009] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein: Figure 1 This is a flowchart illustrating the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention. Figure 2 This is a comparison diagram of the dual-channel signal moving average filtering effect in the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention; Figure 3 This is a schematic diagram of the detector linear response range and threshold determination in the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention. Figure 4 This is a timing simulation diagram of the progressive gain adaptive adjustment process in the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention; Figure 5 This is a temperature compensation correction surface plot over the entire temperature range in the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention. Figure 6 This is a comparison diagram of low-concentration inversion errors before and after dynamic dark voltage subtraction in the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by the present invention. Figure 7This is a comparison chart of the response speeds of the dual-channel gain adaptive photoelectric detection and processing method for gas detection provided by this invention, based on gradient convergence criteria and fixed delay strategy. Figure 8 This is a schematic diagram illustrating the implementation of the dual-channel gain adaptive photoelectric detection and processing system for gas detection provided by the present invention. Figure 9 This is a schematic diagram of the electronic device provided by the present invention. Detailed Implementation
[0010] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0011] The following description, with reference to the accompanying drawings, describes a dual-channel gain adaptive photoelectric detection and processing method, system, and electronic device for gas detection according to embodiments of the present invention. Example 1
[0012] This embodiment provides a dual-channel gain adaptive photoelectric detection and processing method for gas detection. This method is configured to run within a signal processing unit inside the gas detection device. This signal processing unit can be a microcontroller unit, a digital signal processor, or a field-programmable gate array (FPGA), or other computing cores with logical operation capabilities. The core concept of this embodiment is to resolve the contradiction between weak signal overload and strong signal saturation in wide-range gas detection. Through strict timing control and logical judgment, high-precision acquisition and processing of photoelectric signals are achieved.
[0013] S1: System architecture and signal acquisition initialization.
[0014] Specifically, the hardware architecture underlying this embodiment includes a dual-channel photodetector structure, comprising a reference channel and a measurement channel. The gain factor of the signal amplification circuit corresponding to the voltage signal of the reference channel is configured to a fixed value, while the measurement channel is equipped with a programmable gain amplifier.
[0015] It is also important to note that the reference channel is typically used to monitor the original intensity of the light source. Its optical path does not pass through the gas being measured or is encapsulated within an inert gas chamber. Therefore, the light intensity it receives is primarily affected by light source aging, temperature drift, or power supply fluctuations, resulting in a relatively stable, slowly varying signal. Fixing the gain of the reference channel provides a solid and consistent benchmark for subsequent ratio calculations, avoiding the accumulation of additional gain errors introduced by simultaneously varying the gain of both channels. Conversely, the optical path of the measurement channel passes directly through the gas environment being measured, and its signal amplitude fluctuates dramatically across orders of magnitude with changes in gas concentration. Therefore, an adaptive gain adjustment process must be performed on the programmable gain amplifier corresponding to the voltage signal of the measurement channel.
[0016] For example, before formally entering the measurement cycle, the signal processing unit first performs a preprocessing step to ensure data accuracy. After the system is powered on or reset, the photodetector module starts working. Due to the thermal equilibrium process of semiconductor lasers or infrared light sources, the initial output light intensity often fluctuates. At this time, the signal processing unit continuously acquires the reference channel voltage signal and the measurement channel voltage signal output by the photodetector module.
[0017] To filter out high-frequency thermal noise, shot noise, and random glitches introduced by external electromagnetic interference, which are prevalent in the circuit, the system performs moving average filtering on the reference channel voltage signal and the measurement channel voltage signal. Specifically, a fixed-length first-in-first-out (FIFO) data queue is constructed. Whenever a new voltage sampling point is acquired, it is pushed to the end of the queue, while the oldest sampling point at the head of the queue is removed. The arithmetic mean of all data in the queue is then calculated as the current effective voltage value. This processing method can smooth out high-frequency random noise with a zero mean while maintaining the signal trend response.
[0018] like Figure 2 The study demonstrates a significant difference in the effect of the signal acquisition module performing moving average filtering on the dual-channel signal output from the photodetector before and after processing.
[0019] Figure 2 The horizontal axis represents physical time (unit: millisecond), and the vertical axis represents the amplitude of the voltage signal (unit: volt).
[0020] Figure 2 The upper sub-plot corresponds to the reference channel, and the lower sub-plot corresponds to the measurement channel. The gray waveform with severe glitches represents the unprocessed raw voltage signal, which is superimposed with a large number of high-frequency random fluctuations caused by circuit thermal noise, shot noise, and external electromagnetic interference.
[0021] In stark contrast is the overlaid colored smooth curve, representing the output signal after a moving average calculation over a preset time window, such as 20 milliseconds. It is clearly observed that this filtering process significantly reduces zero-mean random noise interference, resulting in a stable DC reference characteristic for the reference channel. Simultaneously, when the gas concentration in the measurement channel undergoes a step change at 200 milliseconds, a clear signal decline trend is still preserved, and the signal-to-noise ratio is greatly improved. This comparison demonstrates that this preprocessing step provides a clean and high-confidence voltage data foundation for subsequent linear response determination and concentration inversion, effectively preventing system false triggering due to noise misjudgment.
[0022] Furthermore, the system needs to ensure that the light source has entered a stable emission state. The signal processing unit continuously monitors the volatility of the filtered reference channel voltage signal, which can be obtained by calculating the standard deviation or range of the reference channel voltage signal per unit time. The system determines whether the volatility is less than a preset light source stability judgment threshold, which is an empirical value pre-set based on the light source device's specifications and long-term aging test data. If the calculated volatility is greater than the threshold, it indicates that the light source is still in the preheating stage or there is a power supply failure, and the system remains in a waiting state. If the volatility is less than the light source stability judgment threshold, it indicates that the light source's luminous power has tended to be constant, and the system then generates an acquisition enable signal to trigger the subsequent formal acquisition steps.
[0023] S2: Linear response determination logic.
[0024] In response to the acquisition enable signal, the signal processing unit officially begins acquiring the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module. At this time, the system executes the linear response determination step, which is the first step to ensure measurement accuracy.
[0025] Specifically, both the photodetector and its downstream operational amplifier circuit have a physically linear operating range. When the incident light intensity is too high, causing the output voltage to approach the power supply voltage rail, the signal will experience saturation distortion, i.e., clipping. When the incident light intensity is too low, causing the output voltage to approach zero volts or be submerged in circuit noise, the signal will lose its signal-to-noise ratio. To identify these two abnormal states, the system executes specific judgment logic: The system first acquires pre-calibrated saturation voltage threshold and noise floor threshold. The saturation voltage threshold is typically set to 90% to 95% of the operational amplifier's maximum output swing; for example, in a 3.3-volt power supply system, this threshold might be set to around 3 volts to allow for a safety margin. The noise floor threshold is set based on the circuit's dark voltage and thermal noise level in a completely dark environment. It defines the lower limit of valid signals; any signal below this threshold is considered unreliable noise.
[0026] like Figure 3 This demonstrates the voltage response characteristics of the photoelectric detection module under different incident light intensities and the physical basis of the linear response determination logic described in this invention. Figure 3 The horizontal axis represents the normalized incident light intensity, and the vertical axis represents the amplified output voltage of the measurement channel.
[0027] Figure 3 The solid black line curve depicts the typical photoelectric conversion response trajectory of the photodetector and operational amplifier circuit. This curve exhibits an S-shaped characteristic, with nonlinear curves at both ends and an approximately straight line in the middle. To avoid nonlinear distortion at both ends, this embodiment defines three key functional regions along the vertical axis using two horizontal dashed lines, corresponding to the saturation distortion region filled in light red at the top, the noise cutoff region filled in gray at the bottom, and the effective linear response region filled in light green in the middle.
[0028] When the real-time amplitude of the measured channel voltage signal falls within the light green effective linear response region, it indicates that the detector is operating at its optimal state, the output voltage and light intensity have a good linear proportional relationship, and the data is valid. Conversely, if the signal amplitude rises above the saturation voltage threshold and enters the light red region, it indicates that the signal has undergone clipping distortion and the linearity has dropped sharply; if the signal amplitude falls below the noise floor threshold and enters the gray region, it indicates that the effective signal has been submerged in the circuit noise floor, and the signal-to-noise ratio has been severely degraded.
[0029] This intuitive interval division and color warning effect vividly illustrates the working mechanism of the linear response determination module in this embodiment. Once the real-time voltage signal is detected to have deviated from the middle light green area, the system will immediately identify the amplitude abnormality and trigger the subsequent gain adaptive adjustment process, thereby ensuring that the measurement data is always locked in the green channel with high linearity and high signal-to-noise ratio.
[0030] Next, the signal processing unit compares the measured channel voltage signal with the saturation voltage threshold and the noise floor threshold, respectively. This comparison is performed in real time and point by point.
[0031] If the measured channel voltage signal is greater than the saturation voltage threshold, it means that the current signal strength is too high and the gain factor is too high, causing the circuit to enter the saturation region. At this time, the acquired voltage value cannot accurately reflect the light intensity, and there is a serious nonlinear error. If the measured channel voltage signal is less than the noise floor threshold, it means that the current signal strength is too weak and the gain factor is too low, resulting in a small effective signal amplitude, and the quantization error and background noise account for too large a proportion, which also cannot be used for accurate calculation.
[0032] If any of the above conditions occur, i.e., if the measured channel voltage signal is greater than the saturation voltage threshold or less than the noise floor threshold, the signal processing unit immediately generates a judgment result indicating an amplitude anomaly, determining that the real-time amplitude is not within the linear response range. This judgment result will be directly used as a control signal to trigger the subsequent gain adjustment process.
[0033] S3: Gain adaptive adjustment process.
[0034] When the linear response determination step outputs a negative result, indicating that the measured channel voltage signal has deviated from the optimal operating range, the system immediately triggers the gain adaptive adjustment process. The core objective of this process is to determine the target gain factor based on the deviation of the real-time amplitude from the linear response range, and to send a gain switching command to the programmable gain amplifier until the amplitude of the measured channel voltage signal returns to the linear response range.
[0035] It is important to note that, in cases where the gas concentration may rise slowly or suddenly from an extremely low concentration, this embodiment employs a special adjustment strategy: when the system responds to the real-time amplitude of the voltage signal of the measurement channel being lower than the lower threshold of the linear response interval, i.e., when the signal is too weak, the system does not blindly jump directly to the maximum gain, but instead increases the gain factor step by step according to a preset progressive gain increase strategy, and re-detects the real-time amplitude after each increase, until the real-time amplitude is higher than the lower threshold and lower than the upper threshold of the linear response interval.
[0036] For example, this progressive gain enhancement strategy is designed to be segmented to balance adjustment speed and adjustment accuracy. The system internally sets a first threshold, which is strictly lower than the lower threshold. This first threshold effectively subdivides the weak signal state into an extremely weak signal region and a slightly weaker signal region.
[0037] When the real-time amplitude is lower than the first threshold, it indicates that the current signal is extremely weak and far from the target linear region. At this point, in order to quickly increase the signal amplitude and reduce the number of iterations required for adjustment, the system adopts an aggressive adjustment method, namely, increasing the gain by a first gain step size. The first gain step size is a large value, such as directly doubling the gain or increasing it by a large fixed decibel, with the aim of quickly moving the signal out of the extremely weak region.
[0038] When the real-time amplitude is higher than the first threshold but still lower than the lower threshold, it indicates that although the current signal is weak, it is approaching the edge of the target linear region. At this point, continuing with large gain jumps could easily lead to over-adjustment, causing the signal to directly exceed the upper threshold and saturate, resulting in oscillations. Therefore, the system automatically switches to fine-tuning mode, increasing the gain by a second gain step size. Specifically, the first gain step size is explicitly defined as greater than the second gain step size. This strategy of starting fast and then slowing down, coarse and then fine, ensures that the gain adjustment process is both efficient and stable, avoiding repeated fluctuations near the critical point.
[0039] like Figure 4 The dual-axis timing simulation curves reveal the gradual adjustment strategy and dynamic response process adopted by the gain adaptive control module for weak signals in this embodiment.
[0040] Figure 4 The horizontal axis represents the time progress as the adjustment cycle advances, the vertical axis on the left corresponds to the voltage amplitude output by the measurement channel, and the vertical axis on the right corresponds to the real-time gain of the programmable gain amplifier.
[0041] Figure 4 The solid blue line depicts the trajectory of the output voltage gradually increasing as the gain is adjusted under the initial condition of constant and weak input light intensity, while the dashed yellow line simultaneously shows the stepwise change of the gain factor.
[0042] from Figure 4 Two significant adjustment phases can be clearly observed: In the initial phase, since the voltage signal of the measurement channel is lower than the first boundary threshold shown by the orange dotted line, the system determines that it is in the extremely weak signal area. The control module executes the coarse adjustment mode, and the gain factor shows a significant leap, which makes the voltage signal quickly leave the noise floor area. Subsequently, when the voltage signal crosses the first threshold but has not yet reached the lower limit of the linear interval shown by the green dashed line, the system automatically switches to the weaker signal region, the rise rate of the gain factor slows down significantly, and enters the fine-tuning mode to approach the target value with a smaller step size.
[0043] This step-by-step, fast-then-slow adjustment pattern intuitively demonstrates that the progressive gain enhancement strategy not only ensures the response speed at extremely low concentrations but also effectively prevents the risk of the signal directly exceeding the lower threshold or even triggering saturation overshoot due to excessive single gain adjustment. Ultimately, it ensures that the measured channel voltage falls smoothly and accurately within the optimal linear response range.
[0044] Optionally, the physical characteristics of the hardware circuit must be considered during gain switching. When the programmable gain amplifier receives a gain switching command and reconstructs its internal resistor network, and during the process of the operational amplifier re-establishing steady state under the new closed-loop gain, the output voltage signal may exhibit unpredictable transient responses, such as overshoot, ringing, or brief DC level drift. Acquiring data during this unstable period will introduce significant errors and may even falsely trigger other protection logic.
[0045] To address this issue, this embodiment employs timing control logic: after sending the gain switching command to the programmable gain amplifier, the signal processing unit does not immediately read the conversion result from the analog-to-digital converter (ADC), but instead initiates a stabilization delay timing logic. This logic utilizes a hardware timer or software loop counting to shield the acquisition operation of the measurement channel voltage signal within a preset circuit stabilization time, i.e., suspending the ADC or discarding all conversion results within that time period. This preset circuit stabilization time is precisely calculated and set with a margin based on the amplifier's settling time, bandwidth, and the charge / discharge constant of the filter capacitor.
[0046] When the stable delay timing logic determines that the timing has ended, it indicates that the circuit has passed the transient oscillation period and entered a new steady-state DC operating point. At this time, the system generates a data acquisition restart signal to obtain the measurement channel voltage signal after gain switching. This mechanism ensures that every voltage value involved in the logic judgment or concentration calculation is a true and reliable steady-state value.
[0047] S4: Concentration inversion and calculation.
[0048] When the gain adaptive adjustment process ends and the latest measurement channel voltage signal has been confirmed to be within the linear response range, the system executes the concentration inversion step. This step calculates the real-time concentration value of the gas to be measured based on the measurement channel voltage signal after gain switching, the reference channel voltage signal, and the target gain factor.
[0049] Specifically, based on the physical principle of Beer-Lambert's law and combined with the characteristics of dual channels and variable gain, the specific calculation logic in this embodiment is as follows: First, to eliminate the influence of light intensity fluctuations, the system needs to calculate the light intensity transmittance. Since the measurement channel and the reference channel may operate at different gain ratios (the reference channel is fixed, while the measurement channel is variable), directly comparing voltages is physically meaningless; they must be normalized to the same gain level.
[0050] The system first performs the first step: calculating the product of the reference channel voltage signal and the target gain ratio to obtain the normalized reference voltage. Here, the target gain ratio refers to the proportional relationship between the target gain ratio used by the current measurement channel and the fixed gain ratio of the reference channel. The physical meaning of this step is: assuming the reference channel also uses the same gain ratio as the measurement channel, what voltage value should it theoretically output? Through this step, the reference signal is virtually amplified or reduced to the same order of magnitude as the measurement signal.
[0051] Next, the system performs the second step: calculating the ratio of the measured channel voltage signal after gain switching to the normalized reference voltage to obtain the light intensity transmittance. Ideally, if there is no gas to be measured in the gas chamber, the ratio of the light intensity of the measured channel to the light intensity of the reference channel should be a fixed system constant, typically calibrated to 1. When gas absorption occurs, the light intensity of the measured channel attenuates, and this ratio will be less than 1. This ratio directly reflects the degree of gas absorption of light energy, and since the numerator and denominator also include factors related to the light source intensity, the division operation perfectly cancels out the influence of light source fluctuations.
[0052] Finally, the system performs the third step: calculating the natural logarithm of the light intensity transmittance and multiplying this natural logarithm by the negative value of a preset gas absorption coefficient constant to obtain the real-time concentration value of the gas to be measured. This can be expressed by the formula: ; In the formula: Defined as the real-time concentration value of the gas to be measured, its unit is usually parts per million or percentage volume concentration; Defined as a preset constant related to the gas absorption coefficient, this constant is determined by the type of gas, the intensity of the absorption spectral line, and the effective optical path length of the gas absorption cell. It is usually obtained through standard gas calibration experiments and stored in the system memory. Defined as the voltage signal of the measurement channel after gain switching, that is, the steady-state voltage value after acquisition and filtering at the optimal gain multiple; Defined as the reference channel voltage signal, that is, the reference channel voltage value acquired at the same time; Defined as the ratio of the target gain factor to the reference channel gain factor, it is used to correct for proportional differences caused by different gains.
[0053] Using the above formula, the system accurately converts photoelectric signals into the physical concentration value of the gas.
[0054] S5: Ambient temperature compensation.
[0055] In practical applications, changes in ambient temperature have multiple effects on gas detection. On the one hand, according to the ideal gas law, temperature changes cause changes in gas molecule density; on the other hand, the center wavelength of the semiconductor laser and the photoelectric conversion efficiency of the photodiode also drift with temperature. To further improve detection accuracy, this embodiment also performs a temperature compensation step, specifically: After calculating the real-time concentration value of the gas to be tested, or during the calculation process, the signal acquisition unit acquires the current ambient temperature data through an integrated temperature sensor or an external thermistor.
[0056] The system has a pre-stored temperature compensation database, which is stored in the form of lookup tables or polynomial coefficients. The system retrieves a temperature correction coefficient from the pre-stored temperature compensation database that matches the ambient temperature data. This correction coefficient is based on a large amount of experimental data across the entire temperature range and quantifies the concentration measurement deviation caused by the temperature effect at a specific temperature point.
[0057] Finally, the system multiplies the real-time concentration value by the temperature correction coefficient, and uses the product as the final gas concentration output value. This step is equivalent to adding a temperature-dimensional correction factor to the original calculation result, so that the final output concentration value indicates the equivalent concentration at standard temperature, or a high-precision concentration after error correction, thereby eliminating the interference of ambient temperature fluctuations on the measurement results.
[0058] like Figure 5 The performance of the ambient temperature compensation module in this embodiment is illustrated using a three-dimensional surface plot. The three axes in the plot represent the real-time temperature of the detection environment, the actual gas concentration in the gas chamber, and the final measured concentration output by the system.
[0059] Figure 5 The image shows two distinct curved surfaces. The colored surface with gradient colors and obvious warping at the edges represents the original response characteristics of the system when the temperature compensation function is not enabled. It can be clearly observed that the surface is significantly distorted as the temperature deviates from the room temperature point, especially in the high temperature and high concentration region where it shows a large positive drift, while in the low temperature region it shows a negative collapse. This vividly reveals the measurement nonlinearity error caused by the thermal effect of semiconductor lasers and photodetectors.
[0060] In stark contrast is the U-shaped gray grid plane located in the middle of the layer. This plane represents the final output result after the system uses a pre-stored temperature correction coefficient to multiply and correct the real-time concentration value. This calibration plane remains flat throughout the entire temperature range and maintains a strict linear correspondence with the actual gas concentration axis. This means that through the temperature compensation step of this invention, the originally distorted physical response surface is successfully pulled back to the ideal linear reference plane. This proves that the system can maintain extremely high measurement accuracy and stability even under complex and variable industrial environmental temperatures, eliminating the interference of environmental thermal noise on the gas detection results.
[0061] In summary, this embodiment constructs a closed-loop gain adaptive control system, combined with rigorous signal preprocessing, linearity determination, graded gain adjustment, timing shielding, and temperature compensation mechanisms, to form a complete gas detection method.
[0062] This method ensures that the measurement channel always operates in the linear region with the optimal signal-to-noise ratio, solves the dynamic range problem of wide-range detection, effectively identifies the saturation and cutoff states of the signal by using threshold determination, avoids the input of erroneous data, and provides a stable comparison benchmark for complex and ever-changing measurement environments by fixing the gain of the reference channel.
[0063] Those skilled in the art should understand that although this embodiment is mainly described using a microcontroller as the execution subject, in actual industrial applications, the logic of each step described above can be embedded into the internal logic of an application-specific integrated circuit (ASIC) or compiled into embedded software code to run on various processor platforms. Any simple modifications based on the technical concept of this embodiment, such as adjusting the length of the filter queue, changing the specific setting value of the threshold, or using different temperature sensors, do not depart from the protection scope of this invention. Example 2
[0064] This embodiment is an advanced technical solution proposed on the basis of the architecture built in Embodiment 1, which addresses the common problems of dark voltage drift and nonlinear coupling of gain in high-precision gas detection scenarios.
[0065] It should be noted that although Implementation Example 1 successfully solved the dynamic range problem of signal amplitude through adaptive gain adjustment, in actual photoelectric detection physics, the dark current of the photodiode itself, the input offset voltage of the operational amplifier, and the leakage current of the circuit board will superimpose at the signal output to form a non-photoinduced voltage component, collectively referred to as dark voltage. At low gain, this dark voltage accounts for a very small proportion relative to the strong light signal and can often be ignored. However, when the system automatically switches to a high gain factor (e.g., 100x or higher) to detect extremely low concentrations of weak signals, tiny input offset voltages are amplified synchronously, resulting in millivolt-level or even volt-level output errors. In this case, if the logic of directly calculating the ratio using the measured voltage as in Example 1 is still used, background noise will be incorrectly included in the light intensity signal, causing the calculated gas concentration to deviate significantly from the true value. Therefore, Example 2 introduces a dynamic dark voltage background subtraction technique.
[0066] Specifically, after executing the gain adaptive adjustment process described in Embodiment 1 and determining the optimal target gain factor, and before formally executing the concentration inversion step, the method of this embodiment forcibly inserts and executes a dynamic dark voltage background subtraction step. This step no longer relies on the fixed zero point calibrated at the factory, but establishes a dynamic mechanism of real-time measurement and real-time subtraction to cope with dark voltage drift caused by changes in ambient temperature or device aging.
[0067] For example, the initiation of this dynamic dark voltage background subtraction step depends on precise control of the probe optical path state. The system first controls the light source drive circuit to cut off the power supply to the semiconductor laser or infrared light source, or drives the mechanical shutter to close the optical path, thereby creating a dark field state with no external light signal input. In this state, the photodetector theoretically does not generate photocurrent, and the circuit's output voltage consists entirely of the dark current and the circuit offset voltage.
[0068] It is also important to note that, to ensure the accuracy of the subtraction, the circuit state during dark voltage acquisition must be highly consistent with that during bright-field measurement. When the probe path is in dark-field mode, the system does not reset the programmable gain amplifier to its initial state, but rather controls it to strictly maintain the target gain factor. This operation is crucial because the output offset voltage of the operational amplifier is typically a function of the gain, and the dark voltage floor varies significantly across different gain levels. Using the dark voltage at a low gain to correct the measurement signal at a high gain, or using a uniform average dark voltage for correction, cannot eliminate the nonlinear error introduced by gain switching. Therefore, the system must acquire the measured dark voltage of the measurement channel and the reference dark voltage of the reference channel under the exact same gain configuration as in bright-field measurement.
[0069] Specifically, under dark conditions and gain-locked conditions, the signal acquisition module performs multi-point sampling and filtering at the outputs of the measurement channel and the reference channel to obtain two key correction parameters. These two parameters are defined as the dark voltage of the measurement channel and the dark voltage of the reference channel, respectively. The dark voltage of the measurement channel characterizes the inherent DC bias of the measurement channel circuit at the current specific target gain; the dark voltage of the reference channel characterizes the inherent DC bias of the reference channel circuit.
[0070] In response to the completion of the acquisition of the two dark voltage parameters mentioned above, the system restarts the light source, restores the bright field state, and acquires the original voltage value containing the light signal and background noise. At this time, the system no longer uses the basic formula in Example 1, but instead modifies the calculation logic for the real-time concentration value in the concentration inversion step to a more rigorous net signal inversion algorithm.
[0071] For example, the revised computational logic comprises four progressively layered sub-steps designed to strip away background interference and restore a pure photoelectric response: The first step is for the system to perform net signal extraction. For the measurement channel, the system calculates the difference between the measurement channel voltage signal after gain switching and the measurement dark voltage to obtain the net measurement voltage. This value physically represents the portion of voltage gain generated only by the incident light intensity, eliminating the inherent characteristics of the circuit itself. Similarly, for the reference channel, the system calculates the difference between the reference channel voltage signal and the reference dark voltage to obtain the net reference voltage. Since the reference channel gain is fixed, its reference dark voltage is usually relatively stable, but to pursue ultimate accuracy, this embodiment still performs real-time subtraction on it.
[0072] The second step involves constructing a normalized light intensity model. After obtaining the net measured voltage and net reference voltage, it is necessary to eliminate the proportional differences caused by the inconsistency in the dual-channel gain. The system uses the previously determined target gain factor to calculate the ratio of the net measured voltage to the product of the net reference voltage and the target gain factor, thus obtaining the net light intensity transmittance.
[0073] To more clearly illustrate this mathematical process, let's break it down into its physical meaning: the denominator is composed of the net reference voltage multiplied by the target gain ratio, where the target gain ratio is the ratio of the target gain currently used in the measurement channel to the fixed gain ratio of the reference channel. This multiplication operation is equivalent to virtually amplifying the signal in the reference channel to the same gain level as the measurement channel. Subsequently, dividing the net measurement voltage in the numerator by this virtually amplified reference voltage yields a pure, dimensionless physical quantity: the net light intensity transmittance. This ratio accurately reflects the degree of attenuation of the light beam after passing through the gas under test and completely eliminates interference from dark voltage and gain differences.
[0074] The third step involves the system performing a logarithmic inversion operation. Based on Beer-Lambert's law of exponential decay, the gas concentration is proportional to the logarithm of the transmittance. Therefore, the system calculates the natural logarithm of the net light intensity transmittance and combines it with the gas absorption coefficient constant to obtain the real-time concentration value.
[0075] like Figure 6The significant effect of the dynamic dark voltage background subtraction technology in this embodiment on low-concentration detection scenarios is visually demonstrated through the comparison curves. Figure 6 The horizontal axis represents the actual concentration value of the standard gas, and the vertical axis represents the measured concentration value output by the system inversion calculation.
[0076] Figure 6 The solid blue line represents the inversion result after the dynamic dark voltage subtraction step in this embodiment. The curve has a standard diagonal shape, indicating that the calculated concentration is highly consistent with the actual concentration, and the system maintains excellent linear response characteristics throughout the entire range.
[0077] In comparison, Figure 6 The red dashed line represents the inversion result in the traditional mode without dark voltage subtraction. It can be clearly observed that the curve gradually bends downward and deviates as the concentration increases, exhibiting significant nonlinear saturation characteristics. This is because, at high gain, the proportion of the inherent dark voltage component in the total signal cannot be ignored, which leads to the denominator of the light intensity transmittance calculation being incorrectly raised, thus seriously distorting the logarithmic operation logic based on Beer-Lambert's law.
[0078] The comparison chart demonstrates that by locking the gain in the dark and subtracting background noise in real time, the present invention successfully eliminates the systematic errors caused by device offset voltage and dark current, ensuring that the gas detection device can still obtain accurate and linear measurement data in the extremely low concentration range.
[0079] Specifically, the entire revised logical process described above can be expressed by the following formula: ; In the formula: Defined as the final calculated real-time concentration value of the gas to be tested, this value has undergone dynamic dark voltage correction and has a higher confidence level; Defined as a preset constant related to the gas absorption coefficient, it is a positive number greater than 0, characterizing the absorption capacity of specific gas molecules for specific wavelengths of light; Defined as the raw voltage signal of the measurement channel acquired by the system at the target gain multiple under bright field conditions, it contains both optical signal components and dark voltage components. Defined as the dark voltage of the measurement channel, that is, the voltage value of the measurement channel acquired in the dark field state and when the gain is kept constant at the target gain. Defined as the raw voltage signal of the reference channel acquired under bright field conditions; It is defined as the reference channel dark voltage, that is, the reference channel voltage value acquired in the dark field state; Defined as the ratio of the target gain factor to the reference channel gain factor, it is used to mathematically align the signals of the two channels to the same gain baseline. To represent the natural logarithm operation, that is, with a constant Logarithm with base 0.
[0080] Optionally, in actual operation, an extreme situation may occur where, due to random fluctuations in measurement noise, the instantaneous value of the measured dark voltage is slightly greater than the measured voltage under a bright field, or the calculated net light intensity transmittance is greater than 1 due to disturbance. Mathematically, the natural logarithm of a number greater than 1 is positive, and multiplying it by a negative coefficient... This will result in a negative concentration value, which is physically meaningless.
[0081] Therefore, this embodiment adds a boundary protection logic to the algorithm: when the calculated boundary protection logic is applied... When the value is greater than or equal to 1, the system forcibly determines that the real-time concentration of the gas to be tested is 0. This logic not only avoids non-physical results from logarithmic calculations, but also conforms to reality, because a transmittance greater than or equal to 1 usually means that no gas absorption has occurred.
[0082] It is also worth noting that this dynamic dark voltage background subtraction scheme has a significant advantage in handling drift issues during long-term operation. Traditional gas detection equipment typically requires periodic manual calibration to eliminate zero-point drift caused by component aging. This embodiment, however, achieves a self-calibration mechanism by automatically inserting a dark field acquisition step into each measurement cycle or at specific time intervals. Regardless of changes in ambient temperature leading to an increase in the dark current of the photodiode, or minor fluctuations in the supply voltage causing a change in the operational amplifier offset voltage, this error will be simultaneously reflected in... and In the middle. Through subtraction, these common-mode errors are perfectly canceled out, thus ensuring... Long-term stability of the value.
[0083] In summary, this embodiment adds control over the dark field state at the hardware level and reconstructs the concentration inversion formula at the software algorithm level. This improvement enables the dual-channel gain adaptive method of this invention not only to adapt to a wide range of signal amplitude variations, but also to maintain extremely high measurement accuracy and linearity under extreme detection conditions of high gain and high sensitivity, completely solving the technical problem of weak signals being submerged or distorted by dark voltage. This has irreplaceable technical value for the detection of highly hazardous gases with extremely low lower explosive limits, or for industrial process analysis with extremely high detection accuracy requirements. Example 3
[0084] This embodiment, based on the overall method architecture described in Embodiment 1, creatively improves the signal acquisition timing control strategy, particularly for the transient response characteristics during gain switching in photoelectric detection systems, especially under the requirements of high sensitivity and fast response gas detection. The core of this embodiment lies in introducing an active signal quality assessment mechanism to replace the traditional passive fixed-delay strategy, thereby significantly improving the dynamic response speed of the system while ensuring measurement accuracy. Specifically: In Example 1, when the system performs adaptive gain adjustment, a stable delay timing logic based on a preset fixed time is used to avoid circuit oscillations caused by the programmable gain amplifier switching gain. Although this strategy is simple and reliable, it is not flexible enough when facing complex and ever-changing actual operating conditions.
[0085] Specifically, the settling time of an operational amplifier is not a constant value; it is closely related to the range of gain changes, the amplitude of the final output voltage, and the parasitic capacitance distribution of the circuit board. When the gain switches slightly from a low to a medium factor, the circuit may stabilize in microseconds; however, when the gain jumps sharply from a low to a very high factor, the amplifier may experience severe overshoot and damped oscillations, and the settling time may extend to the millisecond level. If a uniform fixed delay is used, a long wait time must often be set to accommodate the worst-case scenario. This inadvertently wastes a significant number of rapid measurement opportunities, leading to a decrease in the system's data update rate and making it difficult to capture transient gas leak signals. Conversely, if the delay is set too short, the system may collect data before the circuit has fully converged, causing the oscillating waveform to be misinterpreted as a gas concentration signal, triggering a false alarm.
[0086] To resolve the contradiction between fixed delay and dynamic response, this embodiment performs a signal steady-state verification process based on gradient convergence criteria before generating the acquisition restart signal. This process no longer relies on rigid time counting, but intelligently determines whether the circuit has reached a steady state suitable for measurement by analyzing the time-domain morphological characteristics of the signal in real time.
[0087] Specifically, this process is embedded after the gain switching command is issued. After the system completes the hardware-level reconstruction of the gain resistor network, the signal processing unit does not immediately output the final measurement result, but instead enters a high-speed transient monitoring loop.
[0088] First, the system performs the first step: continuously collecting a preset number of voltage sampling points to construct a voltage sampling sequence.
[0089] For example, the preset number here is a carefully designed system parameter, typically ranging from five to ten sampling points. This order of magnitude has profound physical significance: if too few sampling points are used, such as only two, the system is highly susceptible to random high-frequency noise and cannot accurately reflect the overall trend of the signal; if too many sampling points are used, such as one hundred, unnecessary computational delays are introduced, violating the principle of fast response. The system continuously reads data at the highest sampling rate achievable by the analog-to-digital converter and stores this data sequentially into the processor's register array or first-in-first-out queue, forming a continuous voltage sampling sequence on the time axis. We can define this sequence as a set. , which includes Discrete voltage values to .
[0090] Next, the system performs the second step: calculating the difference between the maximum and minimum voltage values in the voltage sampling sequence, which is defined as the sequence fluctuation amplitude.
[0091] Specifically, the signal processing unit traverses the above set. Find the maximum value among them. and minimum value Then, a subtraction operation is performed. This calculation result is assigned a uniquely and precisely defined physical quantity name: sequence fluctuation amplitude, denoted as... This can be expressed by the formula: ; this Physically, this characterizes the peak-to-peak fluctuation of the signal within the current observation time window. This fluctuation may consist of two parts: one is the inherent thermal noise and shot noise of the circuit itself; the other is the low-frequency oscillations or DC drift tendency remaining due to the gain switching not yet being stable, i.e., the gradient. If the circuit is still in a period of severe oscillation, The value will be significantly greater than the circuit's noise floor; if the circuit is already stable, the signal should be a horizontal DC line superimposed with a small amount of random noise. It should be very small, reflecting only the noise level.
[0092] Subsequently, the system performs the third step: determining whether the amplitude of the sequence fluctuation is less than or equal to the steady-state noise tolerance threshold corresponding to the current gain.
[0093] It's also important to note that the steady-state noise tolerance threshold here is not a globally fixed constant, but a dynamic parameter highly tied to the current gain. According to basic electronic circuit principles, the output noise voltage of an amplifier is proportional to the gain. At low gain, the output noise is very small, and the tolerance threshold should be set more strictly; at high gain, the output noise floor naturally rises, and the tolerance threshold should be correspondingly relaxed. If a uniform low threshold is used to constrain the high-gain state, the system will never meet the convergence condition, leading to an infinite loop; conversely, if a high threshold is used to constrain the low-gain state, it may be mistakenly judged as convergence before the signal is fully stable. Therefore, the system internally stores a gain-threshold mapping table. Before performing a judgment, the system first obtains the pre-calibrated steady-state noise tolerance threshold at the current gain, denoted as […]. .
[0094] Based on the above comparison results, the system enters two distinct logical branches, forming a closed-loop control circuit.
[0095] Branch 1: Handling the non-convergent state of transient oscillations.
[0096] If the judgment result is negative, that is, the calculated sequence fluctuation amplitude Greater than the steady-state noise tolerance threshold The system determines that the circuit is in a transient oscillation state that has not converged.
[0097] Specifically, this means that the voltage sampling sequence acquired at this point contains unacceptably drastic fluctuations, which may be due to overshoot caused by the amplifier's step response or transient interference on the power line. The data at this point is unreliable and cannot be used for subsequent concentration calculations. Therefore, the system performs an operation to clear the voltage sampling sequence, returning the previously acquired data to its original state. All data is discarded to free up storage space.
[0098] Meanwhile, to allow the circuit more time to physically stabilize, the system delays the retry wait period by a preset time slice, such as tens of microseconds. After the delay ends, the system does not give up but re-triggers the continuous acquisition steps. This constitutes a detection-judgment-wait-retry loop mechanism. The system continuously polls the signal state until the signal naturally decays to a steady-state range. This mechanism ensures that the system does not rigidly adhere to a fixed long delay but waits for the necessary time appropriately based on the actual performance of the circuit.
[0099] Branch 2: Convergence Confirmation and Final Output.
[0100] If the judgment result is yes, that is, the calculated sequence fluctuation amplitude Less than or equal to the steady-state noise tolerance threshold The system determines that the circuit has converged.
[0101] For example, this indicates that within the current observation window, the amplitude of the signal variation has fallen within the noise background range allowed for that gain level. Even if the signal may still have extremely small drift, this drift is less than the system's measurement accuracy or noise floor and no longer affects the accuracy of the concentration calculation.
[0102] At this point, to further improve the signal-to-noise ratio, the system performs the final data processing step: calculating the arithmetic mean of all voltage sampling points in the voltage sampling sequence, and outputting it as the measurement channel voltage signal after gain switching. The final output measurement channel voltage signal can be expressed as a formula. Defined as: ; in, For the first in the sequence One sampling point, The sequence length is denoted as . This averaging operation is equivalent to performing a low-pass digital filter on the already stabilized signal, further smoothing out random white noise and making the voltage value fed into the subsequent concentration inversion formula more accurate and stable.
[0103] like Figure 7 The waveform comparison demonstrates the signal steady-state verification process based on the gradient convergence criterion in this embodiment, showcasing its significant advantages over traditional fixed-delay strategies in improving system response speed. In the figure, the horizontal axis represents time, and the vertical axis represents the amplitude of the output voltage of the measurement channel.
[0104] The solid blue line in the figure depicts the typical transient response of the programmable gain amplifier, where the output voltage experiences impulse and damped oscillations before eventually stabilizing at the moment of gain switching. The light green horizontal band represents the pre-calibrated steady-state noise margin region at the current gain. The red dotted line represents the fixed-delay sampling time used in existing technologies to ensure data security; this time is typically set conservatively to cover the worst-case oscillation scenarios. The green dashed line represents the gradient convergence confirmation time determined by this invention through real-time calculation of the voltage sampling sequence fluctuation amplitude.
[0105] As can be clearly observed from the figure, when the oscillation amplitude of the signal decays and falls completely into the steady-state noise tolerance region, the present invention can immediately determine that the circuit has reached a steady state and trigger sampling, without having to wait until the traditional fixed delay ends.
[0106] The time difference between these two vertical lines vividly represents the reduction in measurement blind zone time achieved by the present invention, proving that the technical solution can significantly improve the dynamic response capability of the gas detection system while ensuring the accuracy of measurement data, and achieve rapid capture of transient signals.
[0107] In summary, Example 3 introduces a signal steady-state verification process based on gradient convergence criteria, which represents a significant technical upgrade to the timing control in Example 1.
[0108] Optionally, this technical solution is particularly suitable for application scenarios with extremely high response time requirements and complex operating conditions. For example, during vehicle-mounted gas inspection, the detection equipment moves at high speed with the vehicle, and the background environment and gas concentration change rapidly, requiring frequent gain switching. If a fixed delay is used, the accumulated time loss will lead to missed detections. However, with the gradient verification strategy of this embodiment, for small gain adjustments, the system may determine convergence in the first detection cycle due to the extremely fast circuit stabilization, achieving almost zero-wait measurement; while for large range jumps, the system automatically extends the waiting cycles to ensure that no false values are output.
[0109] This adaptive speed characteristic enables the present invention to achieve a perfect balance between measurement speed and measurement accuracy. It not only solves the problem of transient interference caused by gain switching, but also pushes the dynamic performance of photoelectric detection systems to new heights. Example 4
[0110] like Figure 8 As shown, this embodiment provides a dual-channel gain adaptive photoelectric detection and processing system for gas detection. This system is a hardware carrier for executing the methods described in Embodiments 1 to 3 above. Through the coordinated work of various functional modules, it solves the wide-range detection problem mentioned in the background art and achieves the high precision and fast response described in the beneficial effects.
[0111] Specifically, the system mainly consists of four core logic modules, which can be integrated into a single microcontroller or distributed in a heterogeneous architecture of digital signal processors and field-programmable gate arrays.
[0112] First, the system includes a signal acquisition module. This module, serving as the system's front-end sensing interface, is physically connected to a high-precision analog-to-digital converter (ADC) and is used to acquire the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module. To complement the preprocessing logic in Embodiment 1, this signal acquisition module also integrates a digital filtering unit, capable of performing a moving average processing on the raw acquired data and monitoring the stability of the light source. Only when the light source volatility meets preset conditions will this module transmit the purified voltage data downstream, thereby ensuring the signal-to-noise ratio foundation for subsequent processing stages.
[0113] Secondly, the system includes a linear response determination module. This module is the intelligent decision-making center of the system, specifically designed to execute the linear response determination step. It receives real-time data from the signal acquisition module and determines whether the real-time amplitude of the measured channel voltage signal is within a preset linear response range. In actual operation, this module internally stores saturation voltage thresholds and noise floor thresholds that match the characteristics of the hardware circuitry. Through real-time comparison, this module can accurately identify whether the signal is saturated and truncated due to excessive concentration or submerged in background noise due to excessively low concentration, thus providing a decision-making basis for subsequent gain control.
[0114] Third, the system includes a gain adaptive control module. This is the core actuator for achieving wide dynamic range detection. This module is configured to immediately trigger the gain adaptive adjustment process when the linear response determination module determines a real-time amplitude deviation. Its main function is to determine the target gain factor based on the current signal state and send a gain switching command to the programmable gain amplifier.
[0115] It is worth noting that, to address the difficulties in small signal extraction and gain switching oscillations mentioned in the background technology, this module integrates a complex control strategy. Especially for weak signal scenarios, the determination of the target gain factor in this module strictly follows specific logic: in response to the real-time amplitude of the measured channel voltage signal falling below the lower threshold of the linear response interval, the module does not directly pull the gain to full amplitude, but instead gradually increases the gain factor according to a preset progressive gain enhancement strategy. This strategy avoids overshoot by iterating in stages and re-detecting the real-time amplitude after each enhancement until the real-time amplitude returns to the effective range of the linear response interval. Furthermore, this module also integrates the gradient convergence verification logic described in Embodiment 3, which can intelligently identify transient oscillations in the circuit, ensuring that the gain is locked only after the signal stabilizes.
[0116] Finally, the system includes a concentration inversion calculation module. This module is the core of the calculation that outputs the final measurement results and is used to perform the concentration inversion step. Based on the physical model constructed in Example 2, it calculates the real-time concentration value of the gas to be measured based on the measurement channel voltage signal after gain switching, the reference channel voltage signal, and the target gain factor. To overcome the dark voltage drift problem under high gain, this module automatically calls the dynamic dark voltage subtraction algorithm during calculation, normalizes the signal using the target gain factor ratio, and combines the natural logarithm operation with the gas absorption coefficient to output high-precision concentration data. This module can also further combine ambient temperature data and use pre-stored compensation coefficients to correct the results to eliminate interference from environmental factors.
[0117] In summary, the dual-channel gain adaptive photoelectric detection and processing system for gas detection provided in Embodiment 4 fully realizes the technical concept of this invention at both the hardware and logic levels through the close cooperation of the signal acquisition module, linear response determination module, gain adaptive control module, and concentration inversion calculation module. The interaction between these modules not only achieves closed-loop control of the photoelectric signal but also, through deep integration of hardware and software, ensures that the system maintains extremely high detection sensitivity and long-term operational stability even in complex and ever-changing gas leak scenarios. Example 5
[0118] Corresponding to the above embodiments, the present invention also proposes an electronic device.
[0119] like Figure 9 The diagram shows a structural schematic of an electronic device according to the present invention. The electronic device 100 includes a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, for example, via a bus 102. Optionally, the electronic device 100 may further include a transceiver 104. It should be noted that in practical applications, the transceiver 104 is not limited to one unit, and the structure of this electronic device 100 does not constitute a limitation on the embodiments of the present invention.
[0120] Processor 101 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 101 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0121] Bus 102 may include a pathway for transmitting information between the aforementioned components. Bus 102 may be a PCI bus or an EISA bus, etc. Bus 102 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0122] The memory 103 stores a computer program corresponding to the dual-channel gain adaptive photoelectric detection and processing method for gas detection in the above embodiments of the present invention. This computer program is executed under the control of the processor 101. The processor 101 executes the computer program stored in the memory 103 to implement the content shown in the aforementioned method embodiments.
[0123] Among them, electronic devices 100 include, but are not limited to: mobile terminals such as laptops and PADs (tablet computers) and fixed terminals such as desktop computers. Figure 9The electronic device 100 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0124] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A dual-channel gain adaptive photoelectric detection and processing method for gas detection, characterized in that, Includes the following steps: Acquire the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module; Perform a linear response determination step to determine whether the real-time amplitude of the measured channel voltage signal is within a preset linear response range; If the determination result is negative, the gain adaptive adjustment process is triggered. The target gain multiple is determined based on the deviation between the real-time amplitude and the linear response range, and a gain switching command is sent to the programmable gain amplifier until the amplitude of the measured channel voltage signal returns to the linear response range. Perform the concentration inversion step, and calculate the real-time concentration value of the gas to be measured based on the measurement channel voltage signal after gain switching, the reference channel voltage signal, and the target gain factor; The process of determining the target gain factor includes: in response to the real-time amplitude of the measured channel voltage signal being lower than the lower threshold of the linear response interval, increasing the gain factor step by step according to a preset progressive gain enhancement strategy, and re-detecting the real-time amplitude after each enhancement, until the real-time amplitude is higher than the lower threshold and lower than the upper threshold of the linear response interval.
2. The method according to claim 1, characterized in that, The linear response determination step includes: Obtain the pre-calibrated saturation voltage threshold and noise floor threshold; The measured channel voltage signal is compared with the saturation voltage threshold and the noise floor threshold, respectively. If the measured channel voltage signal is greater than the saturation voltage threshold or less than the noise floor threshold, a judgment result characterizing the amplitude abnormality is generated, determining that the real-time amplitude is not within the linear response range.
3. The method according to claim 1, characterized in that, The concentration inversion step specifically includes: The normalized reference voltage is obtained by multiplying the reference channel voltage signal by the ratio of the target gain factor. The ratio of the measured channel voltage signal after gain switching to the normalized reference voltage is calculated to obtain the light intensity transmittance. Calculate the natural logarithm of the light intensity transmittance and multiply the natural logarithm by the negative value of a preset gas absorption coefficient constant to obtain the real-time concentration value of the gas to be tested.
4. The method according to claim 3, characterized in that, Before the concentration inversion step, a dynamic dark voltage background subtraction step is also included: When the probe optical path is in a dark field state, the programmable gain amplifier is controlled to maintain the target gain multiple, and the measured dark voltage of the measurement channel and the reference dark voltage of the reference channel are collected respectively. The calculation logic for the real-time concentration value in the concentration inversion step is revised as follows: The difference between the measurement channel voltage signal after gain switching and the measurement dark voltage is calculated to obtain the net measurement voltage; The difference between the reference channel voltage signal and the reference dark voltage is calculated to obtain the net reference voltage; The net light intensity transmittance is obtained by calculating the ratio of the product of the net measured voltage, the net reference voltage, and the target gain factor. The real-time concentration value is obtained by calculating the natural logarithm of the net light intensity transmittance and combining it with the gas absorption coefficient constant.
5. The method according to claim 1, characterized in that, After calculating the real-time concentration value of the gas to be measured, the method further includes: Collect current ambient temperature data; Retrieve a temperature correction coefficient from a pre-stored temperature compensation database that matches the detected ambient temperature data; The real-time concentration value is multiplied by the temperature correction coefficient, and the product is used as the final gas concentration output value.
6. The method according to claim 1, characterized in that, Before the reference channel voltage signal and the measurement channel voltage signal output by the photoelectric detection module, the following is also included: The reference channel voltage signal and the measurement channel voltage signal initially output by the photoelectric detection module are continuously acquired, and a moving average filtering process is performed. Monitor the fluctuation rate of the filtered reference channel voltage signal and determine whether the fluctuation rate is less than a preset light source stability judgment threshold. If the voltage is less than the light source stability threshold, a data acquisition enable signal is generated, triggering the steps of the reference channel voltage signal and the measurement channel voltage signal output by the data acquisition photoelectric detection module.
7. The method according to claim 1, characterized in that, After sending the gain switching command to the programmable gain amplifier, the method further includes: The stable delay timing logic is activated, and within the preset circuit stabilization time, the acquisition operation of the voltage signal of the measurement channel is blocked. In response to the stable delay timing logic determining the end of timing, a data acquisition restart signal is generated to obtain the measurement channel voltage signal after gain switching.
8. The method according to claim 1, characterized in that, After sending the gain switching command to the programmable gain amplifier, a signal steady-state verification process is also included to obtain the measurement channel voltage signal after gain switching: A preset number of voltage sampling points are continuously collected to construct a voltage sampling sequence; The difference between the maximum and minimum voltage values in the voltage sampling sequence is calculated and defined as the sequence fluctuation amplitude. Determine whether the amplitude of the sequence fluctuation is less than or equal to the steady-state noise tolerance threshold corresponding to the target gain factor; If so, the circuit is determined to have converged, and the arithmetic mean of the voltage sampling sequence is calculated as the voltage signal of the measurement channel after the gain switching. If not, the circuit is determined to be in a transient oscillation unconverged state, the voltage sampling sequence is cleared, and after a preset retry waiting period, the step of continuously acquiring a preset number of voltage sampling points is retried.
9. The method according to claim 1, characterized in that, The progressive gain enhancement strategy includes: A first boundary threshold is set, which is less than the lower limit threshold. When the real-time amplitude is lower than the first threshold, the gain is increased by the first gain step size. When the real-time amplitude is higher than the first boundary threshold but still lower than the lower limit threshold, the gain is increased by the second gain step amplitude. Wherein, the first gain step size is greater than the second gain step size.
10. The method according to claim 1, characterized in that, The gain factor of the signal amplification circuit corresponding to the reference channel voltage signal is configured to a fixed value, and the gain adaptive adjustment process is only executed for the programmable gain amplifier corresponding to the measurement channel voltage signal.
Citation Information
Patent Citations
Control method and device for water dispenser, storage medium and processor
CN112971533A
Method and device for automatically adjusting gain coefficient smoothing time and electronic equipment
CN116318001A
High-precision methane infrared spectrogram intelligent detection method and system
CN120558887A
Wide dynamic range methane detection system based on synchronous accumulation and system reconstruction
CN121612826A
Apparatus for determining when an automatic gain control circuit has settled
US20220352861A1