Dynamic Compensation Method, Device, Equipment and Medium for Semiconductor Gas Sensor
By dynamically compensating the heating voltage and temperature of the semiconductor gas sensor, the problem of heating energy drift is solved, and the long-term stability and accurate detection of the sensor are achieved, ensuring the efficient operation of the sensor and fault alarm in different environments.
Patent Information
- Application Number
- CN202510413481.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-03
AI Technical Summary
The existing semiconductor gas sensor heating control methods cannot effectively compensate for heating energy drift, resulting in unstable sensor performance and affect detection accuracy and reliability.
By obtaining the heating terminal voltage of the sensor, determining the circuit state and controlling the heating voltage using periodic pulse signals, calculating the deviation of the equivalent heating voltage, dynamically adjusting the heating time, and combining ambient temperature data to perform temperature compensation, realizing accurate control of heating energy and fault alarm.
It improves the long-term stability and accuracy of the sensor, reduces the impact of environmental changes and hardware errors on the detection results, ensures that the sensor has consistent measurement accuracy under different temperature conditions, and promptly alarms in abnormal situations, improving system maintenance efficiency.
Smart Images

Figure CN120121692B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sensor compensation, and in particular to a dynamic compensation method, device, equipment and medium for a semiconductor gas sensor. Background Art
[0002] At present, semiconductor gas sensors are widely used in fields such as industrial safety, home gas alarm, and environmental monitoring to detect the concentration of combustible gases and trigger an alarm when the concentration exceeds the standard. Traditional semiconductor gas sensors usually need to apply a specific heating voltage to maintain a stable operating temperature, thereby ensuring the accuracy of gas detection. However, the operating voltage of mainstream microprocessors is relatively high, and directly providing a heating voltage suitable for the sensor usually requires an additional power conversion circuit to meet the operating requirements of the sensor. Since the heating part of the gas sensor usually has a large current demand, using an independent power conversion scheme will not only increase the hardware cost of the system, but also may result in a small output signal amplitude of the sensor, making it difficult to directly interface with the microprocessor, thus requiring an additional signal amplification or conversion circuit to ensure the effective transmission and processing of the signal.
[0003] To solve the above problems, a pulse heating circuit is proposed in the prior art. By using a periodic pulse signal to control sensor heating under a higher voltage power supply condition, the normal operation of the sensor can be achieved without adding an additional power circuit. However, during long-term operation, the pulse heating circuit is easily affected by factors such as power supply fluctuations and aging of electronic components, resulting in drift of the heating voltage, causing the heating energy of the sensor to deviate from the set value, thereby affecting the sensitivity and measurement accuracy of the sensor and reducing the overall performance and reliability of the gas alarm.
[0004] The above prior art solutions have the following defects: The existing heating control methods for semiconductor gas sensors cannot effectively compensate for the drift of heating energy, resulting in unstable performance of the sensors, so there is room for improvement. Summary of the Invention
[0005] In order to improve the performance of the sensor, the present application provides a dynamic compensation method, device, equipment and medium for a semiconductor gas sensor.
[0006] The first above-mentioned invention object of the present application is achieved through the following technical solutions:
[0007] A dynamic compensation method for a semiconductor gas sensor, the method includes:
[0008] Obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and heating time;
[0009] During each heating cycle, collect the initial voltage and the ending voltage at the heating end of the sensor to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation;
[0010] Obtain ambient temperature data, determine the corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient;
[0011] Store the current heating time at a preset time interval, monitor the heating time, and trigger a fault alarm when the heating time exceeds the preset threshold.
[0012] By adopting the above technical solutions, by obtaining the voltage at the heating end of the sensor to determine the corresponding circuit state, it is possible to accurately judge the power supply state of the current sensor and the charging condition of the capacitor, thereby ensuring that the heating process is carried out under stable voltage conditions and avoiding problems of insufficient heating energy or overheating caused by power fluctuations or capacitor aging; by collecting the initial voltage and the ending voltage at the heating end of the sensor during each heating cycle to calculate the corresponding equivalent heating voltage and dynamically adjusting the heating time according to the deviation of the equivalent heating voltage, precise control of the heating energy can be achieved, thereby avoiding measurement drift caused by hardware errors or environmental changes during long-term use and improving the long-term stability and accuracy of the sensor; by obtaining ambient temperature data and performing normalization processing on the output voltage of the sensor based on the temperature compensation coefficient, the influence of ambient temperature changes on the detection results of the sensor can be effectively eliminated, thereby ensuring that the sensor has consistent measurement accuracy under different temperature conditions and improving the accuracy of gas concentration detection; by storing the current heating time at a preset time interval, monitoring the heating time, and triggering a fault alarm when the heating time exceeds the preset threshold, it is possible to ensure that the device quickly restores stable heating parameters when restarted, and at the same time issue a fault alarm in case of abnormalities in a timely manner, thereby improving the maintenance efficiency of the system and avoiding inaccurate detection caused by abnormal heating of the sensor.
[0013] In one example, the present application can be further configured as: calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage, specifically including:
[0014] According to a preset formula calculate the equivalent heating voltage VH of the current cycle, where V1 is the initial voltage, V2 is the ending voltage, t is the heating time, T is the heating cycle, and K is an operation coefficient;
[0015] Compare the equivalent heating voltage with the preset voltage floating range. If the equivalent heating voltage is not within the voltage floating range, adjust the heating time to adjust the corresponding equivalent heating voltage.
[0016] By adopting the above technical solution, by calculating the equivalent heating voltage of the current cycle according to a preset formula and comparing the equivalent heating voltage with a preset voltage floating range, it is possible to dynamically calculate a reasonable range of heating energy based on the actual heating state of the sensor, thereby ensuring that the sensor always operates under stable heating conditions and avoiding overheating or insufficient heating from affecting the detection accuracy; by comparing the equivalent heating voltage with the preset voltage floating range, if the equivalent heating voltage is not within the preset voltage floating range, the heating time is adjusted, and it is possible to automatically compensate for the heating energy deviation caused by circuit aging, power supply fluctuations or environmental changes in each heating cycle, thereby improving the accuracy and consistency of the sensor during long-term operation and reducing the influence of external factors on the operation of the sensor.
[0017] In one example of the present application, it can be further configured that: if the equivalent heating voltage is not within the voltage floating range, the heating time is adjusted, specifically including:
[0018] In the case where the equivalent heating voltage exceeds the voltage floating range, the heating time is reduced;
[0019] In the case where the equivalent heating voltage is lower than the voltage floating range, the heating time is increased.
[0020] By adopting the above technical solution, by reducing the heating time in the case where the equivalent heating voltage exceeds the voltage floating range, it is possible to effectively prevent the sensor from overheating due to too long heating time, thereby avoiding the decline of the long-term stability of the sensor and improving the service life of the sensor; by increasing the heating time in the case where the equivalent heating voltage is lower than the voltage floating range, it is possible to compensate for the insufficient heating energy caused by the decrease of the external environmental temperature or the fluctuation of the power supply voltage, thereby ensuring that the sensor is always within a suitable working temperature range and improving the stability and accuracy of gas concentration detection.
[0021] In one example of the present application, it can be further configured that: after adjusting the heating time to adjust the corresponding equivalent heating voltage if the equivalent heating voltage is not within the voltage floating range, it further includes:
[0022] After reaching the preset number of adjustment times and the equivalent heating voltage fails to reach within the voltage floating range, it is determined that an abnormal situation has occurred in the circuit;
[0023] Trigger a corresponding abnormal state handling program according to the abnormal situation and send out a corresponding alarm message.
[0024] By adopting the above technical solution, after reaching the preset number of adjustment times, if the equivalent heating voltage fails to reach the voltage fluctuation range, it is determined that an abnormal situation occurs in the circuit, which can actively identify potential hardware failures when the system continuously adjusts and still cannot compensate for the heating deviation, thus avoiding the sensor running in a long-term abnormal state and affecting the reliability of the detection result; by triggering the corresponding abnormal state handling program according to the abnormal situation and triggering the corresponding alarm message, it is possible to notify the user or the upper computer system in time after detecting the fault, ensuring that the maintenance personnel can handle the fault as soon as possible, thereby reducing the downtime of the equipment caused by heating abnormalities and improving the safety and maintainability of the system.
[0025] In one example, the present application can be further configured to: normalize the output voltage of the sensor based on the temperature compensation coefficient, specifically including:
[0026] Obtain the output voltage and input voltage of the sensor at the current ambient temperature, and convert the temperature compensation coefficient, output voltage, and input voltage into corresponding single-byte structures to obtain the corresponding input data set;
[0027] Input the input data set into a preset normalization formula Calculate to obtain the equivalent output voltage V tem , where kC is the single-byte structure of the temperature compensation coefficient, Vcc is the single-byte structure of the input voltage, Vs is the single-byte structure of the output voltage, and C is the scaling factor.
[0028] By adopting the above technical solution, by obtaining the output voltage and input voltage of the sensor at the current ambient temperature and converting the temperature compensation coefficient, output voltage, and input voltage into corresponding single-byte structures, it is possible to reduce the occupied space for data storage and transmission during the temperature compensation calculation process, thereby improving the calculation efficiency and making the temperature compensation process faster and more stable; by inputting the input data set into a preset normalization formula to calculate the equivalent output voltage, it is possible to ensure the consistency of the measurement results of the sensor under different temperature conditions, thereby avoiding gas concentration detection errors caused by changes in the ambient temperature and improving the measurement accuracy and stability of the sensor.
[0029] In one example, the present application can be further configured to: store the current heating time according to a preset time interval, monitor the heating time, and trigger a fault alarm when the heating time exceeds the preset threshold, specifically including:
[0030] Store the current heating time according to a preset time interval. Then, when the device is restarted, read the most recently stored heating time and use the heating time as the current heating time to avoid re-calibration;
[0031] Compare the heating time after each adjustment. If the heating time exceeds the preset threshold, it is determined that there is a circuit failure in the sensor, and then a fault alarm is triggered.
[0032] By adopting the above technical solution, by storing the current heating time according to the preset time interval, and then when the device is restarted, reading the most recently stored heating time and using it as the current heating time, it is possible to avoid the process of re-calibrating the heating time after the device loses power or restarts, thereby shortening the startup time of the sensor and improving the detection efficiency; by comparing the heating time after each adjustment, if the heating time exceeds the preset threshold, it is determined that there is a circuit failure in the sensor, and then a fault alarm is triggered, which can timely detect possible losses or failures in the hardware when the heating time of the sensor abnormally increases, thereby reminding the user to perform maintenance or replacement and improving the reliability and safety of the system.
[0033] The second invention object of the present application is achieved by the following technical solutions:
[0034] A dynamic compensation device for a semiconductor gas sensor, characterized in that the device includes:
[0035] A circuit state detection module, configured to obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and a heating time;
[0036] A heating compensation module, configured to collect the initial voltage and the end voltage of the sensor heating terminal in each heating period to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation;
[0037] A temperature compensation module, configured to obtain ambient temperature data, determine the corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient;
[0038] A heating time storage and monitoring module, configured to store the current heating time according to a preset time interval, and monitor the heating time, and trigger a fault alarm when the heating time exceeds a preset threshold.
[0039] By adopting the above technical solutions, by obtaining the heating-end voltage of the sensor to determine the corresponding circuit state, it is possible to accurately judge the power supply state of the current sensor and the charging condition of the capacitor, thereby ensuring that the heating process is carried out under stable voltage conditions and avoiding problems such as insufficient heating energy or overheating caused by power fluctuations or capacitor aging; by collecting the initial voltage and end voltage of the sensor heating end in each heating cycle to calculate the corresponding equivalent heating voltage and dynamically adjusting the heating time according to the deviation of the equivalent heating voltage, it is possible to achieve precise control of the heating energy, thereby avoiding measurement drift caused by hardware errors or environmental changes during long-term use and improving the long-term stability and accuracy of the sensor; by obtaining the ambient temperature data and normalizing the output voltage of the sensor based on the temperature compensation coefficient, it is possible to effectively eliminate the influence of ambient temperature changes on the sensor detection result, thereby ensuring that the sensor has consistent measurement accuracy under different temperature conditions and improving the accuracy of gas concentration detection; by storing the current heating time at preset time intervals and monitoring the heating time, triggering a fault alarm when the heating time exceeds the preset threshold, it is possible to ensure that the device quickly restores stable heating parameters when restarted and at the same time issue a fault alarm in case of an abnormality, thereby improving the maintenance efficiency of the system and avoiding inaccurate detection caused by abnormal heating of the sensor.
[0040] The above object three of the present application is achieved by the following technical solutions:
[0041] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above dynamic compensation method for a semiconductor gas sensor are implemented.
[0042] The above object four of the present application is achieved by the following technical solutions:
[0043] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the above dynamic compensation method for a semiconductor gas sensor are implemented.
[0044] In summary, the present application includes the following beneficial technical effects:
[0045] 1. By obtaining the heating-end voltage of the sensor to determine the corresponding circuit state, it is possible to accurately judge the power supply state of the current sensor and the charging condition of the capacitor, thereby ensuring that the heating process is carried out under stable voltage conditions and avoiding problems such as insufficient heating energy or overheating caused by power fluctuations or capacitor aging. By collecting the initial voltage and end voltage of the sensor heating end in each heating cycle to calculate the corresponding equivalent heating voltage and dynamically adjusting the heating time according to the deviation of the equivalent heating voltage, it is possible to achieve precise control of the heating energy, thereby avoiding measurement drift caused by hardware errors or environmental changes during long-term use and improving the long-term stability and accuracy of the sensor. By obtaining the ambient temperature data and normalizing the output voltage of the sensor based on the temperature compensation coefficient, it is possible to effectively eliminate the influence of ambient temperature changes on the sensor detection result, thereby ensuring that the sensor has consistent measurement accuracy under different temperature conditions and improving the accuracy of gas concentration detection. By storing the current heating time at preset time intervals and monitoring the heating time, and triggering a fault alarm when the heating time exceeds the preset threshold, it is possible to ensure that the device quickly restores stable heating parameters when restarted and issue a fault alarm in a timely manner in case of an abnormality, thereby improving the maintenance efficiency of the system and avoiding inaccurate detection caused by abnormal heating of the sensor.
[0046] 2. By calculating the equivalent heating voltage of the current cycle according to the preset formula and comparing the equivalent heating voltage with the preset voltage floating range, it is possible to dynamically calculate the reasonable range of heating energy based on the actual heating state of the sensor, thereby ensuring that the sensor always operates under stable heating conditions and avoiding the influence of overheating or insufficient heating on the detection accuracy. By comparing the equivalent heating voltage with the preset voltage floating range, if the equivalent heating voltage is not within the preset voltage floating range, the heating time is adjusted, and it is possible to automatically compensate for the heating energy deviation caused by circuit aging, power fluctuations or environmental changes in each heating cycle, thereby improving the accuracy and consistency of the sensor during long-term operation and reducing the influence of external factors on the operation of the sensor.
[0047] 3. By reducing the heating time when the equivalent heating voltage exceeds the voltage floating range, it is possible to effectively prevent the sensor from overheating due to too long heating time, thereby avoiding the decline of the long-term stability of the sensor and improving the service life of the sensor. By increasing the heating time when the equivalent heating voltage is lower than the voltage floating range, it is possible to compensate for the insufficient heating energy caused by the decrease of the external ambient temperature or the power supply voltage fluctuation, thereby ensuring that the sensor is always within the appropriate working temperature range and improving the stability and accuracy of gas concentration detection. Description of the Drawings
[0048] Figure 1It is a flowchart of a dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0049] Figure 2 It is a flowchart of the implementation of step S20 in the dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0050] Figure 3 It is a circuit diagram of a semiconductor gas sensor in an embodiment of the present application;
[0051] Figure 4 It is a heating timing and heating terminal waveform diagram of a semiconductor gas sensor in an embodiment of the present application;
[0052] Figure 5 It is a flowchart of the implementation of step S22 in the dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0053] Figure 6 It is a flowchart of the implementation after step S22 in the dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0054] Figure 7 It is a flowchart of the implementation of step S30 in the dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0055] Figure 8 It is a flowchart of the implementation of step S40 in the dynamic compensation method for a semiconductor gas sensor in an embodiment of the present application;
[0056] Figure 9 It is a principle block diagram of a dynamic compensation device for a semiconductor gas sensor in an embodiment of the present application;
[0057] Figure 10 It is a schematic diagram of a device in an embodiment of the present application. Specific embodiments
[0058] The following further elaborates on the present application in conjunction with the accompanying drawings.
[0059] In one embodiment, as Figure 1 shown, the present application discloses a dynamic compensation method for a semiconductor gas sensor, which specifically includes the following steps:
[0060] S10: Obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set the initial heating period and heating time.
[0061] Specifically, when obtaining the heating terminal voltage, first measure the power supply voltage in the heating circuit to confirm whether the current power supply state is stable. At the same time, collect the instantaneous voltage at the heating terminal to judge the charging condition of the capacitor. If abnormal voltage is detected, for example, the voltage value is much lower than the set range, an alarm can be triggered to avoid abnormalities during the heating process. After the voltage acquisition is completed, according to the preset heating cycle and initial heating time, by controlling the on-off of the MOS transistor, the sensor performs pulsed heating according to a fixed time sequence. When the MOS transistor is turned on, the capacitor discharges to the heating resistor, enabling the sensor to obtain heating energy. When the MOS is turned off, the heating resistor enters the heat dissipation stage to ensure temperature stability. The entire heating process is executed in a cycle according to the set period to ensure that the sensor can maintain a stable working state.
[0062] S20: During each heating cycle, collect the initial voltage and the end voltage at the heating terminal of the sensor to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation.
[0063] Specifically, during each heating cycle, collect the initial voltage at the heating terminal of the sensor at the start of heating and the end voltage before the end of heating through the AD sampling port. These two voltage values reflect the actual heating situation of the sensor. By calculating the change trend between the initial voltage and the end voltage, the equivalent heating voltage of the sensor can be deduced. Subsequently, dynamically adjust the heating time according to the equivalent heating voltage to ensure that the heating energy of the sensor remains stable during long-term operation and errors do not accumulate due to factors such as capacitor aging and power supply fluctuations.
[0064] S30: Obtain the ambient temperature data, determine the corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient.
[0065] Specifically, use a thermistor to measure the current ambient temperature and calculate the corresponding temperature compensation coefficient through a preset temperature-resistance relationship curve. This coefficient is used to correct the output signal of the sensor to eliminate errors caused by temperature changes. Subsequently, obtain the output voltage of the sensor under the current temperature condition and calculate the equivalent normalized voltage in combination with the temperature compensation coefficient to make the output of the sensor consistent under different ambient temperatures and avoid the influence of temperature drift on the gas detection result. During the calculation process, the look-up table method or the linear interpolation method can be used to improve the calculation efficiency to adapt to the computing power of the low-power microprocessor.
[0066] S40: Store the current heating time at preset time intervals and monitor the heating time. In the case where the heating time exceeds the preset threshold, trigger a fault alarm.
[0067] Specifically, at every preset time interval, such as every 5 minutes, the current heating time is stored in the EEPROM or other non-volatile memory. At the same time, after each adjustment of the heating time, it is compared with a preset threshold. If the heating time exceeds the set range for a long time, it may indicate capacitor decay, insufficient power supply voltage, or other hardware failures. In this case, a fault alarm can be triggered to remind the user to maintain or replace the device through a buzzer, LED, or other signals to ensure the reliability of the sensor.
[0068] In one embodiment, as Figure 2 shown, in step S20, that is, calculating the corresponding equivalent heating voltage and dynamically adjusting the heating time according to the deviation of the equivalent heating voltage, specifically including:
[0069] S21: Calculate the equivalent heating voltage VH of the current cycle according to the preset formula where V1 is the initial voltage, V2 is the end voltage, t is the heating time, T is the heating cycle, and K is an operation coefficient.
[0070] Specifically, as Figure 3 shown in the semiconductor gas sensor circuit diagram, and Figure 4 shown in the heating timing and heating terminal waveform diagram, within each heating cycle T, the initial voltage V1 and the voltage V2 before the end across the sensor RH are obtained through the AD sampling port, and the equivalent heating voltage VH is calculated using the formula. The calculation method of VH is based on the changes of V1 and V2 during the heating time t to ensure that the calculated VH can accurately reflect the actual value of the heating energy. During the calculation process, t and T are known fixed parameters, V1 and V2 are variables measured in real time, and K is used as a correction coefficient to compensate for the deviation caused by the power supply voltage or circuit characteristics. The calculated VH is directly used to compare with the preset target voltage range to determine whether the current heating energy meets the requirements, providing a data basis for the next adjustment of the heating time.
[0071] S22: Compare the equivalent heating voltage with the preset voltage floating range. If the equivalent heating voltage is not within the voltage floating range, adjust the heating time to adjust the corresponding equivalent heating voltage.
[0072] Specifically, after calculating VH in each heating cycle, it is compared with a preset voltage floating range, which is determined by experimental data or sensor specifications, to ensure that the heating energy of the sensor is always within an appropriate working range. If VH falls within this range, there is no need to adjust the heating time, and the current heating strategy remains unchanged. If VH exceeds the set range, the heating time t needs to be adjusted accordingly so that the heating energy in the next cycle returns to the normal range. In this process, a step-by-step adjustment strategy can be adopted. For example, the increment or decrement of t is set to a fixed step size each time to prevent violent fluctuations in the heating time from causing system oscillations, thereby affecting the stability of the sensor.
[0073] In one embodiment, as Figure 5 shown, in step S12, that is, if the equivalent heating voltage is not within the voltage floating range, the heating time is adjusted, specifically including:
[0074] S221: When the equivalent heating voltage exceeds the voltage floating range, reduce the heating time.
[0075] Specifically, when the calculated equivalent heating voltage VH exceeds the upper limit of the set voltage floating range, it indicates that the current heating energy is too high, which may cause the sensor to overheat and affect its long-term stability. To reduce the heating energy, the heating time t needs to be appropriately reduced. The reduction amplitude can be dynamically calculated based on the excessive VH or a fixed step size can be used. For example, reduce 3 μs each time to avoid instability caused by over-adjustment. After reducing t, when entering the next cycle, a new VH will be recalculated and compared again. If VH still exceeds the range, continue to reduce t until VH enters the reasonable range.
[0076] S222: When the equivalent heating voltage is lower than the voltage floating range, increase the heating time.
[0077] Specifically, when the calculated equivalent heating voltage VH is lower than the lower limit of the set voltage floating range, it indicates that the current heating energy is insufficient, which may affect the response sensitivity of the sensor. To compensate for this deviation, the heating time t needs to be appropriately increased to provide more heating energy. The increase amplitude can be calculated based on the deviation degree of VH or increased by a fixed step size. For example, increase 3 μs each time to prevent overheating from causing temperature overshoot. After increasing t, when entering the next cycle, VH will be recalculated and compared. If VH is still low, continue to increase t until VH enters the target range.
[0078] In one embodiment, as Figure 6 shown, after step S22, that is, if the equivalent heating voltage is not within the voltage floating range, the heating time is adjusted to adjust the corresponding equivalent heating voltage, it further includes:
[0079] S2201: If the equivalent heating voltage fails to reach within the voltage fluctuation range after reaching the preset number of adjustment times, it is determined that an abnormal situation has occurred in the circuit.
[0080] Specifically, when the equivalent heating voltage VH fails to enter the preset voltage fluctuation range for multiple cycles, it indicates that there may be hardware abnormalities in the system, such as capacitor aging, abnormal supply voltage, or loss of the sensor itself. To avoid the accumulation of measurement errors caused by long-term operation, a maximum number of adjustment times needs to be set. For example, if VH still cannot be stabilized after 100 consecutive adjustments of t, it is determined that there is an abnormality in the circuit. In this case, the adjustment of the heating time t will no longer continue, but instead enter the abnormal handling process to ensure the safety and reliability of the system.
[0081] S2202: Trigger the corresponding abnormal state handling program according to the abnormal situation and send the corresponding alarm message.
[0082] Specifically, after determining the circuit abnormality, first trigger the abnormal state handling program. For example, pause the heating cycle of the sensor and perform self-check to determine whether the abnormality is caused by short-term fluctuations. If the abnormality persists, trigger the alarm mechanism. The alarm methods can include the flashing of the LED indicator, the sounding of the buzzer, or sending a fault report to the host computer through the communication interface to notify the user to perform maintenance or replace the device. After the alarm is triggered, the system can enter the degraded mode. For example, reduce the heating frequency or switch to the standby sensor to ensure that the device can still provide some functions and will not completely fail.
[0083] In one embodiment, as Figure 7 shown, in step S30, that is, normalizing the output voltage of the sensor based on the temperature compensation coefficient, specifically including:
[0084] S31: Obtain the output voltage and input voltage of the sensor at the current ambient temperature, and convert the temperature compensation coefficient, output voltage, and input voltage into corresponding single-byte structures to obtain the corresponding input data set.
[0085] Specifically, after obtaining the ambient temperature, use the AD sampling port to read the output voltage Vs and input voltage Vcc of the sensor, and combine the temperature compensation coefficient k to perform data format conversion. To improve the calculation efficiency, these data can be stored in a single-byte structure. For example, multiply k by 128 for integerization processing to enable fast operation on an 8-bit processor. At the same time, perform scaling conversion on Vs and Vcc to ensure that all parameters can be calculated and stored within a fixed range, and finally form a complete input data set for subsequent normalization calculation.
[0086] S32: Input the input data set into a preset normalization formula Calculate the equivalent output voltage V tem , where kC is the single-byte structure of the temperature compensation coefficient, Vcc is the single-byte structure of the input voltage, Vs is the single-byte structure of the output voltage, and C is the scaling factor.
[0087] Specifically, use the normalization formula to calculate the equivalent output voltage Vtem to keep the output signal of the sensor consistent under different ambient temperatures. During the calculation process, first substitute Vs, Vcc, and kC into the calculation formula, and consider C as the scaling factor to ensure that the calculation result has appropriate accuracy. The calculated V tem Will be used for the final gas concentration measurement to ensure that the sensor can still provide consistent detection data under different temperature conditions.
[0088] In one embodiment, as Figure 8 Shown in step S40, that is, store the current heating time according to a preset time interval and monitor the heating time. In the case where the heating time exceeds the preset threshold, trigger a fault alarm, specifically including:
[0089] S41: Store the current heating time according to a preset time interval. Then, when the device restarts, read the most recently stored heating time and use the heating time as the current heating time to avoid recalibration.
[0090] Specifically, at every set time interval, such as 5 minutes, store the current heating time t into the EEPROM or other non-volatile memory to ensure that the latest heating parameters can still be retained after the device loses power. When the device restarts, first read the t stored in the EEPROM and directly apply it to the heating control without using the default initial value to reduce the recalibration time and enable the sensor to quickly return to the stable working state.
[0091] S42: Compare the heating time after each adjustment. In the case where the heating time exceeds the preset threshold, it is determined that there is a circuit fault in the sensor, and then a fault alarm is triggered.
[0092] Specifically, after each adjustment of the heating time t, check whether it exceeds the preset maximum or minimum limit value. If t exceeds the set range, for example, exceeds 800 μs, it indicates that there may be a fault in the sensor heating circuit. In this case, trigger a fault alarm to remind the user to perform device maintenance or replace the sensor to ensure the normal operation of the system.
[0093] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0094] In one embodiment, a dynamic compensation device for a semiconductor gas sensor is provided, and the dynamic compensation device for the semiconductor gas sensor corresponds one-to-one with the dynamic compensation method for the semiconductor gas sensor in the above embodiment. As Figure 9 shown, the dynamic compensation device for the semiconductor gas sensor includes a circuit state detection module, a heating compensation module, a temperature compensation module, and a heating time storage and monitoring module. The detailed description of each functional module is as follows:
[0095] The circuit state detection module is configured to obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and heating time;
[0096] The heating compensation module is configured to collect the initial voltage and the end voltage at the heating terminal of the sensor in each heating period to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation;
[0097] The temperature compensation module is configured to obtain ambient temperature data, determine a corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient;
[0098] The heating time storage and monitoring module is configured to store the current heating time according to a preset time interval, monitor the heating time, and trigger a fault alarm when the heating time exceeds a preset threshold.
[0099] Optionally, the heating compensation module specifically includes:
[0100] An equivalent heating voltage calculation sub-module, configured to calculate the equivalent heating voltage VH of the current period according to a preset formula where V1 is the initial voltage, V2 is the end voltage, t is the heating time, T is the heating period, and K is an operation coefficient;
[0101] A heating time adjustment sub-module, configured to compare the equivalent heating voltage with a preset voltage floating range. If the equivalent heating voltage is not within the voltage floating range, the heating time is adjusted to adjust the corresponding equivalent heating voltage.
[0102] Optionally, the heating time adjustment sub-module specifically includes:
[0103] A heating time reduction unit, configured to reduce the heating time when the equivalent heating voltage exceeds the voltage floating range;
[0104] A heating time increase unit, configured to increase the heating time when the equivalent heating voltage is lower than the voltage floating range.
[0105] Optionally, after the heating time adjustment sub-module, it further includes:
[0106] An anomaly detection sub-module, configured to determine that an abnormal situation occurs in the circuit if the equivalent heating voltage fails to reach within the voltage fluctuation range after reaching the preset number of adjustment times;
[0107] A fault alarm sub-module, configured to trigger a corresponding abnormal status handling program according to the abnormal situation and send out a corresponding alarm message.
[0108] Optionally, the temperature compensation module specifically includes:
[0109] A temperature data acquisition sub-module, configured to obtain the output voltage and input voltage of the sensor at the current ambient temperature, and convert the temperature compensation coefficient, output voltage, and input voltage into corresponding single-byte structures to obtain a corresponding input data set;
[0110] A normalization calculation sub-module, configured to input the input data set into a preset normalization formula to calculate the equivalent output voltage V tem , where kC is the single-byte structure of the temperature compensation coefficient, Vcc is the single-byte structure of the input voltage, Vs is the single-byte structure of the output voltage, and C is the scaling factor.
[0111] Optionally, the heating time storage and monitoring module specifically includes:
[0112] A heating time storage module, configured to store the current heating time according to a preset time interval, and then when the device restarts, read the most recently stored heating time and use the heating time as the current heating time to avoid re-calibration;
[0113] A heating time monitoring module, configured to compare the heating time after each adjustment. If the heating time exceeds a preset threshold, it is determined that there is a circuit fault in the sensor, and then a fault alarm is triggered.
[0114] For the specific limitations of the dynamic compensation device for the semiconductor gas sensor, reference can be made to the limitations of the dynamic compensation method for the semiconductor gas sensor in the above text, which will not be elaborated here. Each module in the above dynamic compensation device for the semiconductor gas sensor can be implemented in whole or in part by software, hardware, and their combinations. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above each module.
[0115] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 10As shown. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a dynamic compensation method for a semiconductor gas sensor.
[0116] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0117] Obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and heating time;
[0118] In each heating period, collect the initial voltage and the end voltage of the heating terminal of the sensor to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation;
[0119] Obtain environmental temperature data, determine the corresponding temperature compensation coefficient according to the environmental temperature data, and normalize the output voltage of the sensor based on the temperature compensation coefficient;
[0120] Store the current heating time at a preset time interval, monitor the heating time, and trigger a fault alarm when the heating time exceeds a preset threshold.
[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the following steps are implemented:
[0122] Obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and heating time;
[0123] In each heating period, collect the initial voltage and the end voltage of the heating terminal of the sensor to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation;
[0124] Obtain environmental temperature data, determine the corresponding temperature compensation coefficient according to the environmental temperature data, and normalize the output voltage of the sensor based on the temperature compensation coefficient;
[0125] Store the current heating time according to a preset time interval, monitor the heating time, and trigger a fault alarm when the heating time exceeds the preset threshold.
[0126] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0127] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0128] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A dynamic compensation method for a semiconductor gas sensor, characterized in that The method includes: Obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and heating time; During each heating period, collect the initial voltage and end voltage of the heating terminal of the sensor to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation; Obtain ambient temperature data, determine the corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient; Store the current heating time at a preset time interval, and monitor the heating time. In the case where the heating time exceeds a preset threshold, trigger a fault alarm.
2. The dynamic compensation method of the semiconductor gas sensor according to claim 1, characterized in that, The calculating the corresponding equivalent heating voltage and dynamically adjusting the heating time according to the deviation of the equivalent heating voltage specifically includes: According to a preset formula calculate the equivalent heating voltage VH of the current cycle, where V1 is the initial voltage, V2 is the end voltage, t is the heating time, T is the heating cycle, and K is an operation coefficient; Compare the equivalent heating voltage with a preset voltage floating range. If the equivalent heating voltage is not within the voltage floating range, adjust the heating time to adjust the corresponding equivalent heating voltage.
3. The dynamic compensation method of the semiconductor gas sensor according to claim 2, characterized in that The if the equivalent heating voltage is not within the voltage floating range, adjusting the heating time specifically includes: In the case where the equivalent heating voltage exceeds the voltage floating range, reduce the heating time; In the case where the equivalent heating voltage is lower than the voltage floating range, increase the heating time.
4. The dynamic compensation method for a semiconductor gas sensor according to claim 2, characterized in that, After the if the equivalent heating voltage is not within the voltage floating range, adjusting the heating time to adjust the corresponding equivalent heating voltage, it further includes: After reaching a preset number of adjustments, if the equivalent heating voltage fails to reach within the voltage floating range, it is determined that an abnormal situation occurs in the circuit; Trigger a corresponding abnormal state handling program according to the abnormal situation and send a corresponding alarm message.
5. The dynamic compensation method of the semiconductor gas sensor according to claim 1, wherein The performing normalization processing on the output voltage of the sensor based on the temperature compensation coefficient specifically includes: Obtain the output voltage and input voltage of the sensor at the current ambient temperature, and convert the temperature compensation coefficient, the output voltage, and the input voltage into corresponding single-byte structures to obtain a corresponding input data set; Input the input data set into a preset normalization formula Calculate the equivalent output voltage V tem , where kC is the single-byte structure of the temperature compensation coefficient, Vcc is the single-byte structure of the input voltage, Vs is the single-byte structure of the output voltage, and C is the scaling factor.
6. The dynamic compensation method of the semiconductor gas sensor according to claim 1, characterized in that, The storing the current heating time at a preset time interval, and monitoring the heating time. In the case where the heating time exceeds a preset threshold, triggering a fault alarm specifically includes: Store the current heating time according to the preset time interval. Then, when the device is restarted, read the most recently stored heating time and use the heating time as the current heating time to avoid re-calibration; Compare the heating time after each adjustment. In the case where the heating time exceeds a preset threshold, it is determined that there is a circuit fault in the sensor, and then trigger the fault alarm.
7. A dynamic compensation device for a semiconductor gas sensor, characterized in that, The device includes: A circuit state detection module, which is used to obtain the heating terminal voltage of the sensor to determine the corresponding circuit state, and then control the heating voltage of the sensor through a periodic pulse signal, and set an initial heating period and a heating time; A heating compensation module, which is used to collect the initial voltage and the end voltage of the heating terminal of the sensor within each heating period to calculate the corresponding equivalent heating voltage, and dynamically adjust the heating time according to the deviation of the equivalent heating voltage to compensate for the heating energy deviation; A temperature compensation module, which is used to obtain ambient temperature data, determine a corresponding temperature compensation coefficient according to the ambient temperature data, and perform normalization processing on the output voltage of the sensor based on the temperature compensation coefficient; A heating time storage and monitoring module, which is used to store the current heating time at a preset time interval and monitor the heating time, and trigger a fault alarm when the heating time exceeds a preset threshold; 8. The dynamic compensation device for a semiconductor gas sensor according to claim 7, characterized in that, The heating compensation module specifically includes: An equivalent heating voltage calculation sub-module, which is used to calculate the equivalent heating voltage VH of the current cycle according to a preset formula wherein, V1 is the initial voltage, V2 is the end voltage, t is the heating time, T is the heating cycle, and K is an operation coefficient; A heating time adjustment sub-module, which is used to compare the equivalent heating voltage with a preset voltage floating range. If the equivalent heating voltage is not within the voltage floating range, the heating time is adjusted to adjust the corresponding equivalent heating voltage; 9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the dynamic compensation method of the semiconductor gas sensor according to any one of claims 1 to 6 are implemented; 10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the steps of the dynamic compensation method of the semiconductor gas sensor according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Signal acquisition method and system of MEMS gas sensor array
CN117470921A
Linear optimization test method for semiconductor gas sensor
CN119666932A