Common mode voltage calibration method, apparatus, and flow meter

By comparing the common-mode voltage with the first voltage range in real time after it is established, the establishment status is dynamically determined, and voltage traversal is performed immediately after the establishment is confirmed. This solves the time and power consumption problems caused by invalid calibration and achieves efficient common-mode voltage calibration.

CN122195191APending Publication Date: 2026-06-12HANGZHOU RUIMENG TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU RUIMENG TECH
Filing Date
2026-03-11
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing common-mode voltage calibration methods suffer from problems such as invalid calibration leading to excessively long total calibration time and additional measurement power consumption.

Method used

The common-mode voltage is compared with a first voltage range immediately after it is established. If it does not fall within the range, charging continues until it falls within the range. Then, voltage traversal is performed to determine the detection value. The voltage range can be optionally narrowed for further traversal. Dynamic judgment is made using the comparator and bias voltage control module in the flow meter.

Benefits of technology

It effectively shortens the total time of common-mode voltage calibration, improves calibration efficiency, and reduces additional power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122195191A_ABST
    Figure CN122195191A_ABST
Patent Text Reader

Abstract

The application discloses a common-mode voltage calibration method, device and flowmeter, and relates to the field of ultrasonic measurement. In view of the problem that invalid calibration exists in the current common-mode voltage calibration process, the total calibration time is too long, and additional measurement power consumption is caused, a common-mode voltage calibration method is provided, which comprises the following steps: after starting to charge the coupling capacitor, the common-mode voltage is compared with a first voltage range; wherein the first voltage range is determined based on a traversal voltage range; the traversal voltage range is a voltage range used when the common-mode voltage is voltage-traversed; if the common-mode voltage does not fall within the first voltage range, the coupling capacitor continues to be charged, and the step of comparing the common-mode voltage with the first voltage range is returned to; if the common-mode voltage falls within the first voltage range, the common-mode voltage is voltage-traversed to determine a detection value of the common-mode voltage. The method can shorten the total calibration time, improve the calibration efficiency, and reduce the generation of additional power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of ultrasonic measurement, and in particular to a common-mode voltage calibration method, apparatus and flow meter. Background Technology

[0002] A common type of flow meter (water meter, gas meter) detects flow rate based on ultrasonic waves. After receiving the echo of the ultrasonic wave, the flow meter typically uses the first wave detection to filter out noise. The first wave voltage threshold of the comparator used for noise filtering needs to be set based on the common-mode voltage (i.e., the voltage value of the common-mode voltage signal input to the comparator). However, the common-mode voltage can deviate due to variations in power supply voltage, temperature, and manufacturing process, leading to inaccurate comparator decisions. Therefore, common-mode voltage calibration is necessary.

[0003] Currently, common-mode voltage calibration typically involves establishing the common-mode voltage and then traversing its possible range to determine the actual common-mode voltage and complete the calibration. Since the ultrasonic flowmeter uses AC coupling, establishing the common-mode voltage requires charging the external coupling capacitor. Therefore, the total calibration time is the sum of the charging time and the voltage traversal time.

[0004] In the above scheme, since the actual magnitude of the common-mode voltage cannot be determined before the traversal is complete, the charging time required to establish this common-mode voltage cannot be determined either. Therefore, currently, a large fixed value is generally set as the charging time to ensure that the common-mode voltage can be established. It is evident that a large and fixed charging time does not accurately reflect the actual time required for the common-mode voltage to establish, resulting in an overall increase in calibration time and reduced calibration efficiency. Furthermore, the resulting invalid calibration time also leads to additional measurement power consumption, which does not meet the needs of practical applications.

[0005] Therefore, those skilled in the art urgently need a common-mode voltage calibration method to solve the problem that invalid calibration exists in the current common-mode voltage calibration process, resulting in excessively long total calibration time and additional measurement power consumption. Summary of the Invention

[0006] The purpose of this application is to provide a common-mode voltage calibration method, apparatus, and flow meter to solve the problem that invalid calibration exists in the current common-mode voltage calibration process, resulting in excessively long total calibration time and additional measurement power consumption.

[0007] To address the aforementioned technical problems, this application provides a common-mode voltage calibration method, comprising: After charging of the coupling capacitor begins, the common-mode voltage is compared with a first voltage range; wherein the first voltage range is determined based on a traversal voltage range; the traversal voltage range is the voltage range used when traversing the common-mode voltage. If the common-mode voltage does not fall within the first voltage range, the coupling capacitor continues to be charged, and the process returns to the step of comparing the common-mode voltage with the first voltage range. If the common-mode voltage falls within the first voltage range, then voltage traversal is performed on the common-mode voltage to determine the detected value of the common-mode voltage.

[0008] In one alternative embodiment, the first voltage range is equal to the traversed voltage range; Before performing voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage, the method further includes: A second voltage range is obtained based on the first voltage range; wherein the second voltage range is smaller than the first voltage range; The second voltage range is compared with the common-mode voltage; If the common-mode voltage falls within the second voltage range, then the second voltage range is used as the new traversal voltage range, and the process proceeds to the step of performing voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage.

[0009] In one optional embodiment, both the first voltage range and the second voltage range are symmetrical intervals; Wherein, the center value of the first voltage range and the second voltage range is a preset value of the common-mode voltage; the preset value of the common-mode voltage is: the center value of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval; The deviation value of the first voltage range is a boundary threshold, and the deviation value of the second voltage range is N times the boundary threshold; N is any value greater than 0 and less than 1; the boundary threshold is: the deviation value of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval.

[0010] In an optional embodiment, after comparing the second voltage range with the common-mode voltage, the method further includes: If the common-mode voltage does not fall within the second voltage range, then repeat the step of comparing the common-mode voltage with the second voltage range; If the number of repetitions of the step of comparing the second voltage range with the common-mode voltage exceeds a preset repetition threshold, then the preset value of the common-mode voltage is used as the detection value of the common-mode voltage, and the method is terminated.

[0011] In one alternative embodiment, comparing the common-mode voltage with a first voltage range includes: The common-mode voltage is compared with the first voltage range using a comparator in the flow meter.

[0012] In an optional embodiment, comparing the common-mode voltage with the first voltage range using a comparator in the flow meter includes: The bias voltage connected to the negative input terminal of the comparator is controlled to periodically alternate between the upper and lower limits of the first voltage range; The output signals of the comparator are acquired over multiple cycles to determine the output code pattern; Compare whether the output code pattern is consistent with the feature code pattern; wherein, the feature code pattern is composed of alternating 0s and 1s; If they match, then the common-mode voltage is determined to fall within the first voltage range.

[0013] In one optional embodiment, performing voltage strobe on the common-mode voltage to determine the detected value of the common-mode voltage includes: A step control strategy is implemented for the bias voltage connected to the negative input terminal of the comparator in the flow meter; wherein, the step control strategy is: starting from any boundary value of the traversed voltage range, moving closer to another boundary value of the traversed voltage range with a preset step size. Monitor the output signal of the comparator; When the output signal of the comparator flips, the bias voltage applied to the comparator at the time of the flip is determined to be the detected value of the common-mode voltage; If the comparator's output signal does not flip during the entire step traversal process, the preset value of the common-mode voltage is used as the detected value of the common-mode voltage.

[0014] To address the aforementioned technical problems, this application also provides a common-mode voltage calibration device, comprising: A voltage comparison module is used to compare the common-mode voltage with a first voltage range after charging of the coupling capacitor begins; wherein the first voltage range is determined based on a traversed voltage range; the traversed voltage range is the voltage range used when traversing the common-mode voltage. A charge holding module is used to continue charging the coupling capacitor and re-trigger the voltage comparison module if the common-mode voltage does not fall within the first voltage range. The voltage traversal module is used to perform voltage traversal on the common-mode voltage to determine the detection value of the common-mode voltage if the common-mode voltage falls within the first voltage range.

[0015] In one optional embodiment, the voltage comparison module includes an echo receiver comparator in the flow meter; the charge holding module includes a charging circuit in the flow meter; and the voltage traversal module includes a bias voltage control module in the flow meter. The charging circuit is connected to the coupling capacitor in the flow meter to charge the coupling capacitor and generate a common-mode voltage; the non-inverting input of the echo receiver comparator is connected to the coupling capacitor to receive the common-mode voltage. The first input terminal of the bias voltage control module is connected to the output terminal of the echo receiver comparator, the second input terminal of the bias voltage control module is connected to a common-mode voltage preset value, and the third input terminal of the bias voltage control module is connected to a boundary threshold. The bias voltage control module is used to: determine the traversed voltage range based on a symmetrical interval obtained with the common-mode voltage preset value as the center point and the boundary threshold as the deviation value, and sequentially generate bias voltages corresponding to the upper and lower limits of the traversed voltage range; the inverting input terminal of the echo receiver comparator is connected to the output terminal of the bias voltage control module to receive the bias voltage. The output terminal of the comparator is connected to the input terminal of the bias voltage control module; the bias voltage control module is further configured to: output the bias voltage that satisfies the step control strategy; monitor the output signal of the comparator; when the output signal of the comparator flips, determine that the bias voltage connected to the comparator at the time of flipping is the detected value of the common-mode voltage; if the output signal of the comparator does not flip during the entire step traversal process, then use the preset value of the common-mode voltage as the detected value of the common-mode voltage; The step control strategy includes: starting from any boundary value of the traversed voltage range, moving closer to another boundary value of the traversed voltage range with a preset step size.

[0016] To address the aforementioned technical problems, this application also provides a flow meter, including the common-mode voltage calibration device described above.

[0017] This application provides a common-mode voltage calibration method that compares the common-mode voltage with a first voltage range immediately after charging the coupling capacitor begins, i.e., after the common-mode voltage is established. The first voltage range is determined based on a traversal voltage range. When the common-mode voltage falls within the first voltage range, it is considered stable, and subsequent voltage traversal can begin. Otherwise, charging of the coupling capacitor continues until the common-mode voltage falls within the first voltage range, indicating that the common-mode voltage has been established and stabilized. Therefore, this method can dynamically determine in real-time when the common-mode voltage has been established, without needing to set and wait for a fixed charging time. Performing voltage traversal immediately after the common-mode voltage is established effectively shortens the charging time during calibration, thereby reducing the total calibration time, improving calibration efficiency, and reducing additional power consumption.

[0018] The common-mode voltage calibration device and flow meter provided in this application correspond to the above method and have the same effect. Attached Figure Description

[0019] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a structural diagram of a flow meter; Figure 2 A flowchart of a common-mode voltage calibration method provided in an embodiment of the present invention; Figure 3 A schematic diagram illustrating the principle of a common-mode voltage calibration method provided in an embodiment of the present invention; Figure 4 A flowchart of another common-mode voltage calibration method provided in an embodiment of the present invention; Figure 5 This is a structural diagram of a common-mode voltage calibration device provided in an embodiment of the present invention; Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0022] The core of this application is to provide a common-mode voltage calibration method, device, and flow meter.

[0023] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] In related technologies, common-mode voltage calibration involves two parts: the common-mode voltage establishment process and the common-mode voltage traversal process. Specifically, the common-mode voltage establishment process includes... Figure 1 As shown: A charging circuit or similar structure is needed to charge the coupling capacitor to generate a voltage difference across its terminals. The voltage value applied to the positive terminal of the comparator by this voltage difference is the common-mode voltage.

[0025] Only after the common-mode voltage has been established can a voltage traversal be performed on the common-mode voltage to determine the actual detected value of the common-mode voltage, thereby achieving common-mode voltage calibration. Therefore, the total time of the entire common-mode voltage calibration process includes the sum of the charging time (the time required to charge the coupling capacitor to establish the common-mode voltage) and the traversal time (the time required to perform a voltage traversal on the common-mode voltage).

[0026] Currently, since the common-mode voltage cannot be predetermined, it is also impossible to predict the duration of the charging process for the coupling capacitor. A fixed value is typically estimated as the charging duration. Furthermore, to ensure the common-mode voltage can be established successfully, this fixed value is usually set relatively high. Therefore, in actual calibration, it is easy for the common-mode voltage to have actually been established, but because the preset fixed charging duration has not yet been reached, the calibration process is still in the waiting period for charging to finish. This period is considered an invalid measurement segment in the overall calibration process, leading to a longer total calibration time, reduced calibration efficiency, and additional measurement power consumption.

[0027] To address the aforementioned problems, this application provides a common-mode voltage calibration method, such as... Figure 2 As shown, it includes: S11: After starting to charge the coupling capacitor, compare the common-mode voltage with the first voltage range.

[0028] S12: If the common-mode voltage does not fall within the first voltage range, continue charging the coupling capacitor and return to step S11.

[0029] S13: If the common-mode voltage falls within the first voltage range, then the common-mode voltage is traversed to determine the detected value of the common-mode voltage.

[0030] The first voltage range is determined based on the traversal voltage range, which is the voltage range used when performing voltage traversal on the common-mode voltage. It should be noted that the aforementioned first voltage range is used to determine whether the common-mode voltage has been established, i.e., whether subsequent voltage traversal can proceed. Therefore, to ensure the success rate of subsequent voltage traversal processes, the first voltage range should not exceed the traversal voltage range.

[0031] However, beyond the conditions described above, this embodiment does not restrict the relationship between the first voltage range and the traversal voltage range. For example, the first voltage range can be equal to or less than the traversal voltage range. It should also be noted that the first voltage range should not be set too small, otherwise fluctuations caused by noise and other interference will prevent it from falling within the first voltage range. Furthermore, setting the first voltage range too small will also make it more difficult for the common-mode voltage to fall within the first voltage range, resulting in an excessively long charging time from the start of charging the coupling capacitor to entering step S13 (i.e., the charging time), thus actually lengthening the total calibration time. Therefore, an optional implementation is that the first voltage range is equal to the traversal voltage range.

[0032] It is also necessary to clarify the size relationship between the voltage ranges mentioned above, that is, the inclusion relationship between the two value intervals represented by the voltage ranges. For example, if the first voltage range is smaller than the traversed voltage range, it means that the first voltage range is truly included in the traversed voltage range. That is, the lower limit of the first voltage range is greater than or equal to the lower limit of the traversed voltage range, and the upper limit of the first voltage range is less than or equal to the upper limit of the traversed voltage range, but the two boundary values ​​of the first voltage range are not both equal to the two boundary values ​​of the traversed voltage range.

[0033] Step S11 involves comparing the common-mode voltage at the time of execution with a first voltage range, and determining whether the common-mode voltage has been established based on whether it falls within the first voltage range. Specifically, the comparison between the common-mode voltage and the first voltage range is essentially a comparison between the common-mode voltage and the upper and lower limits of the first voltage range. When the common-mode voltage is greater than (or equal to) the lower limit of the first voltage range and less than (or equal to) the upper limit of the first voltage range, it can be considered that the common-mode voltage falls within the first voltage range. Therefore, the comparison between the common-mode voltage and the first voltage range can be achieved by comparing two voltage values. Voltage comparison is the most basic function of various voltage comparison devices. That is, step S11 can be implemented using comparators, voltage comparison circuits, or other complex devices with voltage comparison functions. Examples of other complex devices with voltage comparison functions include: Central Processing Unit (CPU), Microcontroller Unit (MCU), and Field-Programmable Gate Array (FPGA).

[0034] For step S12, the triggering condition is that the common-mode voltage does not fall within the first voltage range. Since step S11 of this method is performed immediately after the charging of the coupling capacitor begins, the triggering of step S12 usually means that the common-mode voltage is too small and has not entered the first voltage range, that is, the common-mode voltage has not been fully established. At this time, it is necessary to continue charging the coupling capacitor so that the common-mode voltage can be successfully established. It is also necessary to return to step S11 to re-compare the common-mode voltage with the first voltage range. At this time, the comparison performed in step S11 can also be considered to be periodically triggered. The triggering period is the sum of the execution time of one step S11 and the execution time of one step S12, or any value greater than this sum. This embodiment does not limit this.

[0035] For step S13, the trigger condition is that the common-mode voltage falls within the first voltage range, meaning that the common-mode voltage can be determined to be established at this point, allowing for subsequent voltage traversal. Therefore, step S13 is the process of performing voltage traversal on the common-mode voltage. As can be seen from the above description of the relevant technical sections, voltage traversal of the common-mode voltage is also required in the original flowmeter common-mode voltage calibration process. In other words, mature solutions for performing voltage traversal on the common-mode voltage already exist, so this embodiment will not elaborate further.

[0036] In summary, this application provides a common-mode voltage calibration method that dynamically determines whether the common-mode voltage has been established by comparing it with a first voltage range, without requiring a fixed charging time. Once the common-mode voltage is established, this method can immediately determine this result and begin the subsequent voltage traversal process without waiting for a preset fixed charging time. In other words, this method can shorten the charging time in the common-mode voltage calibration process, reduce invalid calibration portions, and achieve the goals of shortening the total calibration time, improving calibration efficiency, and reducing additional power consumption.

[0037] On the other hand, as can be seen from the above description of the relevant technical sections, the total verification time, in addition to the charging time, also includes the duration of the voltage traversal process, i.e., the traversal time. Therefore, this application also provides a corresponding embodiment for shortening the traversal time: the first voltage range is equal to the traversal voltage range. Before step S13 above, this method further includes: S21: Obtain the second voltage range based on the first voltage range.

[0038] The second voltage range is smaller than the first voltage range.

[0039] S22: Compare the second voltage range with the common-mode voltage.

[0040] S23: If the common-mode voltage falls within the second voltage range, then the second voltage range is used as the new traversal voltage range, and proceed to step S13.

[0041] In this embodiment, after it is determined that the common-mode voltage has been established (i.e., the common-mode voltage falls within the first voltage range), the first voltage range is narrowed down to obtain a second voltage range, which is step S21 of this embodiment. Then, the comparison as described in step S11 above is performed again based on the second voltage range, which is step S22 of this embodiment. If the common-mode voltage also falls within the second voltage range, it indicates that the detected value of the common-mode voltage should also be within the second voltage range. As previously stated, the first voltage range can be equal to the traversal voltage range, and the second voltage range is smaller than the first voltage range. That is, the possible range of the true value of the common-mode voltage can be further narrowed from the original traversal voltage range to the second voltage range. At this time, using the smaller second voltage range as the new traversal voltage range for common-mode voltage traversal can effectively shorten the time required for the voltage traversal process, thereby achieving the goal of shortening the total verification time from another perspective.

[0042] It should be noted that the core idea of ​​this embodiment is that after the common-mode voltage is established in steps S11-S13, a new round of comparison is performed using the same method but with a smaller voltage range (i.e., the second voltage range). If the common-mode voltage still falls within this smaller voltage range, it is equivalent to narrowing the possible range of the true value of the common-mode voltage. Therefore, when traversing the common-mode voltage, a smaller voltage traversal range can be used to shorten the traversal time. Based on this idea, the voltage range can be narrowed and the voltage comparison performed any number of times, and it is not limited to one time. That is, after falling into the second voltage range, a smaller third voltage range can be determined based on the second voltage range, and the above process can be repeated until the traversed voltage range is narrowed to the expected value.

[0043] However, it's important to note that, firstly, as illustrated in the aforementioned embodiments regarding the first voltage range, the voltage range used for comparison with the common-mode voltage is not necessarily better the smaller it is. That is, this embodiment does not aim to minimize the traversal voltage range to its extreme. Secondly, since each reduction in the voltage range requires at least one voltage comparison, this process also takes time, increasing the total calibration time. Therefore, whether to further reduce the voltage range should comprehensively consider the relationship between the reduction in traversal time and the increased comparison time due to repeated voltage comparisons, avoiding a situation where endlessly shortening the traversal voltage range actually increases the total calibration time.

[0044] Similarly, based on the principles mentioned above, the value of the second voltage range should not be too large or too small. If the value of the second voltage range is too large, the shortened traversal time will be less than the time required for repeated voltage comparisons. If the value of the second voltage range is too small, the common-mode voltage will be difficult to fall within the second voltage range, thus making it difficult to achieve the goal of narrowing the traversal voltage range to shorten the traversal time.

[0045] On the other hand, regarding the determination of the aforementioned first and second voltage ranges, one optional embodiment is to predetermine corresponding upper and lower limits to define a specified voltage range. In this case, the upper and lower limits of the first voltage range are determined based on traversing the voltage ranges, as described in the previous embodiment. For the second voltage range, its upper limit can be any value less than the upper limit of the first voltage range, and its lower limit can be any value greater than the upper limit of the first voltage range.

[0046] In another alternative embodiment, the first and second voltage ranges described above can be obtained using symmetrical intervals. A symmetrical interval is determined by a center value and a deviation value; adding or subtracting the deviation value from the center value yields the upper and lower limits of the symmetrical interval. This method also requires only two values ​​to determine a voltage range. Based on this method, this embodiment provides an optional scheme for determining the first and second voltage ranges: Both the first and second voltage ranges are symmetrical intervals. The center value of both the first and second voltage ranges is a preset common-mode voltage value. The preset common-mode voltage value is the center value X of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval. The deviation value of the first voltage range is a boundary threshold, and the deviation value of the second voltage range is N times the boundary threshold. N is any value greater than 0 and less than 1. For example, in an optional embodiment, N can be 0.5. The boundary threshold is the deviation value A of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval.

[0047] In other words, this embodiment is more convenient in determining the second voltage range, which is smaller than the first voltage range. It only requires multiplying the deviation value A of the first voltage range by a preset ratio N to obtain the second voltage range based on the newly obtained deviation value NA and the original center value X. Secondly, this embodiment can use fewer values ​​to represent the first and second voltage ranges. That is, only three values—X, A, and NA—are needed to represent the two voltage ranges that were originally represented by four boundary values. Thirdly, generally, as long as the traversal voltage range is not set too unreasonably, the probability that the true value of the common-mode voltage will fall into the middle region of the traversal voltage range after its establishment is greater than the probability that it will fall into the edge region of the traversal voltage range. In other words, the true value of the common-mode voltage is more likely to be close to the aforementioned center value X. Therefore, determining the second voltage range based on the scheme of this embodiment allows the second voltage range to occupy the most central region of the traversal voltage range, thereby increasing the probability that the common-mode voltage will subsequently fall into the second voltage range.

[0048] Furthermore, the above embodiments provide that when the common-mode voltage falls within the second voltage range, the traversal voltage range can be narrowed using the second voltage range to shorten the traversal time. However, in practical applications, it is possible that the common-mode voltage falls within the first voltage range but not within the second voltage range. To address this situation, this embodiment also provides an optional solution: after step S22, the above method further includes: S24: If the common-mode voltage does not fall within the second voltage range, repeat step S22.

[0049] S25: If the number of repetitions in step S22 exceeds the preset repetition threshold, the preset value of the common-mode voltage will be used as the detection value of the common-mode voltage, and the method will be terminated.

[0050] In this embodiment, the specific value of the repetition threshold is not limited and can be arbitrarily selected according to actual needs. A repetition threshold that is too large will result in a longer time spent in loops, thus slowing down the entire calibration process; while a repetition threshold that is too small will make it easier to fail to narrow the traversal voltage range due to noise interference. One optional implementation is a repetition threshold of 3.

[0051] Furthermore, regarding step S25 of this embodiment, as described above, when the number of repetitions in step S22 exceeds the preset repetition threshold, it can be considered that the flow meter is experiencing significant and continuous interference. Continuing to perform voltage comparison at this point will not achieve the desired result. Therefore, this embodiment directly uses a pre-determined common-mode voltage preset value as the common-mode voltage detection value to complete the calibration. This ensures the smooth completion of the common-mode voltage calibration while also preventing the process from entering an infinite loop, which would affect the overall calibration time, efficiency, and power consumption.

[0052] On the other hand, as explained in the above embodiments, the voltage comparison in step S11 can be implemented by any device with voltage comparison functionality. Similarly, the voltage comparison in step S22 is also implemented in this way, and will not be repeated in this embodiment. In an optional implementation, an MCU can be added to the flow meter to implement the voltage comparison function. The MCU typically works with an analog-to-digital converter (ADC) to convert analog signals (common-mode voltage) into digital signals for the MCU to receive and process.

[0053] However, adding additional components such as an MCU incurs extra costs and increases the complexity of the flow meter circuit, making implementation difficult. Therefore, this embodiment also provides another optional embodiment, in which the voltage comparison performed in step S11 specifically includes: S111: The bias voltage connected to the negative input terminal of the control comparator is periodically switched between the upper and lower limits of the first voltage range.

[0054] S112: Obtain the output signal of the comparator over multiple cycles to determine the output code pattern.

[0055] S113: Compare the output code pattern with the feature code pattern. If they match, determine that the common-mode voltage falls within the first voltage range. The feature code pattern consists of alternating 0s and 1s.

[0056] like Figure 1As shown, the comparator used in this embodiment is the same comparator originally used by the flowmeter for the first wave of detection. It should be noted that reusing this existing comparator for the voltage comparison in step S11 does not require changing the connection relationship of the original comparator in the flowmeter. Only a bias voltage control module is needed at the negative input terminal of the comparator to control the voltage connected to the negative input terminal. This bias voltage control module can be implemented using any hardware with voltage control functionality, which will not be elaborated upon in this embodiment. It should also be noted that this bias voltage control module is an optional component in the original flowmeter. That is, in some scenarios, the flowmeter already requires changing the negative bias voltage of the comparator during the first wave of detection; in this case, a bias voltage control module is also needed to achieve the above purpose. In other words, this embodiment can be completely implemented by reusing the existing components and circuit structure in the flowmeter without adding any additional components or lines.

[0057] Furthermore, this embodiment does not impose any restrictions on the specific value of the period for the alternating switching of the bias voltage in step S111 above, and a suitable value can be selected according to actual needs. For example, to ensure that the change in the comparator output caused by the switched bias voltage can be identified and participate in subsequent steps S112 and S113, this switching period should be greater than the detection period required to detect the comparator output, and also greater than the calculation period required to complete subsequent method steps S112 and S113.

[0058] Furthermore, the bias voltage in step S111 repeatedly switches between the upper limit (upper limit voltage) and lower limit (lower limit voltage) of the first voltage range. This embodiment, using the example of a symmetrical first voltage range with a center value of X and a deviation value of A given in the above embodiment, illustrates this: the comparator's bias voltage switches periodically in the manner of ...X+A, XA, X+A, XA...

[0059] Next, regarding steps S112 and S113, based on the comparator's operating principle: when the voltage value connected to the positive input terminal of the comparator (common-mode voltage) is greater than the voltage value connected to the negative input terminal (bias voltage), the comparator outputs a high level (logic "1"); when the voltage value connected to the positive input terminal of the comparator (common-mode voltage) is less than the voltage value connected to the negative input terminal (bias voltage), the comparator outputs a low level (logic "0"). Therefore, as... Figure 3As shown, if the common-mode voltage falls within the corresponding first voltage range, the comparator will output the characteristic code "101010" (the same applies to the second voltage range). It should be noted that since this embodiment does not limit the number of switching cycles required to determine the output code, the number of bits in the characteristic code is not fixed. The "101010" example given above is based on 6 switching cycles. Furthermore, for example, when the switching cycle is 7, the characteristic code would be "1010101".

[0060] It should also be noted that although this embodiment provides an optional specific implementation of the voltage comparison in step S11, the voltage comparison in step S22 differs from that in step S11 only in the voltage range; all other aspects are the same, and the comparison method provided in this embodiment also applies. Figure 3 As shown, assuming the second voltage range is obtained with N=0.5, that is, the upper limit of the second voltage range is X+A / 2 and the lower limit is XA / 2. In this case... Figure 3 As shown, if the common-mode voltage can fall within the second voltage range, the traversal voltage range can be reduced to half of the original, thereby significantly shortening the traversal time.

[0061] As described above, this embodiment provides a specific scheme for comparing common-mode voltage with voltage ranges (first and second voltage ranges) based on a comparator. By controlling the bias voltage applied to the negative input terminal of the comparator and comparing the output code of the comparator with the characteristic code, it is possible to conveniently and quickly determine whether the common-mode voltage falls within the corresponding voltage range, ensuring that the voltage comparison process is implemented quickly and efficiently.

[0062] On the other hand, after the common-mode voltage is established, it is necessary to perform a voltage traversal on the common-mode voltage to determine a detection value that reflects the true value of the common-mode voltage for subsequent calibration. In the above embodiment, a voltage comparison scheme is provided that can be implemented without changing any circuit structure of the flowmeter or adding new hardware. Furthermore, this embodiment also provides an optional voltage traversal scheme that can be implemented using the existing components and structure of the flowmeter. Step S13 specifically includes: S131: Step control strategy for the bias voltage connected to the negative input terminal of the comparator in the flow meter.

[0063] The step control strategy is as follows: starting from any boundary value (such as the lower limit) of the traversed voltage range, the step size approaches another boundary value (such as the upper limit) of the traversed voltage range with a preset step size. It should be noted that this embodiment does not limit the specific value of the preset step size; it should be determined according to the actual traversal accuracy requirements. For example, in one optional embodiment, the preset step size can be 2mV.

[0064] S132: The output signal of the monitoring comparator.

[0065] S133: When the output signal of the comparator flips, determine that the bias voltage connected to the comparator at the time of the flip is the detected value of the common-mode voltage.

[0066] S134: If the comparator's output signal does not flip during the entire step traversal process, the preset value of the common-mode voltage will be used as the detected value of the common-mode voltage.

[0067] Specifically, such as Figure 3 As shown, it can be observed that when the bias voltage connected to the negative input terminal of the comparator exceeds the common-mode voltage, the comparator output flips from "1" to "0". This bias voltage can be determined as the detected value of the common-mode voltage, serving as the calibrated common-mode voltage value. However, if the comparator output signal does not flip throughout the entire step traversal process, it indicates a possible abnormal situation causing the common-mode voltage to deviate from the traversal voltage range. In this case, the voltage traversal cannot obtain an accurate detected value. To avoid the method entering an infinite loop (if an error retry mechanism is used) and to prevent missing results, this embodiment further uses a pre-obtained preset value of the common-mode voltage as the result of this voltage traversal, i.e., the detected value of the common-mode voltage, allowing the process to continue normally.

[0068] As can be seen from the above, the common-mode voltage traversal implemented in this embodiment can also be achieved using the existing hardware and structure of the flow meter. The common-mode voltage traversal can be completed simply by controlling the bias voltage connected to the negative input terminal of the comparator and monitoring the comparator's output and determining whether it is flipping. The entire solution is efficient, easy to implement, and does not incur additional hardware costs.

[0069] Finally, this embodiment also takes the feature code "1010101" as an example to give an overall process that combines the methods provided in the above embodiments, as follows: Figure 4 As shown: 1. After the charging circuit starts, it begins to charge the coupling capacitor, with the target being the preset common-mode voltage. The bias voltage control module receives the calibration command, presets the common-mode voltage value and boundary threshold, and begins to set the negative terminal bias voltage.

[0070] 2. The bias voltage control circuit sets the negative terminal bias voltage to the lower limit voltage = preset common mode voltage - boundary threshold; after one clock cycle, it generates the upper limit voltage = preset common mode voltage value + boundary threshold, repeats 3 times, and then sets the output voltage to (preset common mode voltage - boundary threshold).

[0071] It should be noted that the reason for inserting one (or more) clock cycles of switching after the three repeated bias voltage switching steps is to improve the reliability of the entire method. By inserting one (or more) clock cycles during the voltage range switching (the voltage range compared with the common-mode voltage switches from the first voltage range to the second voltage range), the comparator output can be effectively prevented from flipping due to interference during the switching, thus avoiding misjudgment.

[0072] 3. The bias voltage control circuit receives the comparator's output for 7 clock cycles (6 clock cycles for three repeated switchings, plus 1 clock cycle inserted during voltage range switching, totaling 7 clock cycles), stores it, and compares it with the fixed code 1010101. If they are the same, it proceeds to the second stage of detection and judgment; if they are different, it waits for 2 clock cycles, repeats step 2, and compares the output for 7 cycles. If the judgment results are different for 3 consecutive times, it stores the preset common-mode voltage as the calibrated common-mode voltage and exits the calibration.

[0073] 4. Second stage detection: The bias voltage control circuit sets the negative terminal bias voltage to a new lower limit voltage = preset common mode voltage - boundary threshold / 2; after one clock cycle, a new upper limit voltage is generated = preset common mode voltage value + boundary threshold / 2, repeating 3 times, and then the output voltage is set to (preset common mode voltage - boundary threshold / 2).

[0074] 5. The logic control circuit receives the comparator's output over 7 clock cycles, stores it, and compares it with the fixed code 1010101. If they are the same, it enters the traversal stage; if they are different, it waits for 2 clock cycles, repeats step 4, and compares the output over 7 cycles. If the results of 3 consecutive comparisons are different, it stores the preset common-mode voltage as the calibrated common-mode voltage and exits the calibration.

[0075] 6. Traversal Phase: Set the negative terminal bias voltage to (preset common-mode voltage - boundary threshold / 2), and increase the output voltage by 2mV in each subsequent clock cycle until it reaches (preset common-mode voltage + boundary threshold / 2); simultaneously receive the output of the detection comparator. If a high-to-low transition occurs, store the negative terminal bias voltage at this time as the calibrated common-mode voltage; if the comparator output does not transition within the entire traversal voltage range, store the preset common-mode voltage as the calibrated common-mode voltage and exit calibration.

[0076] In the above embodiments, a common-mode voltage calibration method has been described in detail. This application also provides an embodiment corresponding to a common-mode voltage calibration device. It should be noted that this application describes the device embodiment from two perspectives: one based on functional modules and the other based on hardware.

[0077] From the perspective of functional modules, such as Figure 5 As shown, this embodiment provides a common-mode voltage calibration device, including: The voltage comparison module 11 is used to compare the common-mode voltage with a first voltage range after the coupling capacitor starts charging; wherein the first voltage range is determined based on the traversal voltage range; the traversal voltage range is the voltage range used when traversing the common-mode voltage.

[0078] The charge holding module 12 is used to continue charging the coupling capacitor and re-trigger the voltage comparison module if the common-mode voltage does not fall within the first voltage range.

[0079] The voltage traversal module 13 is used to perform voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage if the common-mode voltage falls within the first voltage range.

[0080] Since the embodiments of the device section and the embodiments of the method section correspond to each other, please refer to the description of the embodiments of the method section for the embodiments of the device section, and they will not be repeated here. However, the above method embodiments clearly state that the above method can be implemented based on the original structure of the flow meter. Furthermore, this embodiment combines... Figure 1 The flowmeter structure shown illustrates how this device can be implemented using the existing flowmeter structure.

[0081] In one alternative embodiment: the voltage comparison module includes an echo receiver comparator in the flow meter; the charge holding module includes a charging circuit in the flow meter; and the voltage traversal module includes a bias voltage control module in the flow meter.

[0082] like Figure 1 As shown, the charging circuit is connected to the coupling capacitor in the flow meter to charge the coupling capacitor and generate a common-mode voltage; the non-inverting input of the echo receiver comparator is connected to the coupling capacitor to receive the common-mode voltage.

[0083] The first input terminal of the bias voltage control module is connected to the output terminal of the echo receiver comparator, the second input terminal of the bias voltage control module is connected to the common-mode voltage preset value, and the third input terminal of the bias voltage control module is connected to the boundary threshold. The bias voltage control module is used to: determine the traversal voltage range based on the symmetrical interval obtained with the common-mode voltage preset value as the center point and the boundary threshold as the deviation value, and sequentially generate the bias voltage corresponding to the upper and lower limits of the traversal voltage range. The inverting input terminal of the echo receiver comparator is connected to the output terminal of the bias voltage control module to receive the bias voltage.

[0084] The comparator's output is connected to the input of the bias voltage control module. The bias voltage control module is also used to: output a bias voltage that satisfies the step control strategy; monitor the comparator's output signal; determine the bias voltage applied to the comparator at the time of the flip as the common-mode voltage detection value when the comparator's output signal flips; and if the comparator's output signal does not flip during the entire step traversal, use the preset common-mode voltage value as the common-mode voltage detection value. The step control strategy includes: starting from any boundary value of the traversal voltage range, moving closer to another boundary value of the traversal voltage range with a preset step size.

[0085] Figure 6 A structural diagram of an electronic device provided in another embodiment of this application, such as... Figure 6 As shown, an electronic device includes: a memory 20 for storing computer programs; The processor 21 is used to execute a computer program to implement the steps of a common-mode voltage calibration method as described in the above embodiment.

[0086] The electronic device provided in this embodiment may include, but is not limited to, a flow meter, a computer, etc.

[0087] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0088] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of a common-mode voltage calibration method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, a common-mode voltage calibration method.

[0089] In some embodiments, an electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0090] Those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on an electronic device and may include more or fewer components than shown.

[0091] An electronic device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a common-mode voltage calibration method.

[0092] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0093] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0094] The common-mode voltage calibration method, apparatus, and flow meter provided in this application have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

[0095] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A common-mode voltage calibration method, characterized in that, include: After charging of the coupling capacitor begins, the common-mode voltage is compared with a first voltage range; wherein the first voltage range is determined based on a traversal voltage range; the traversal voltage range is the voltage range used when traversing the common-mode voltage. If the common-mode voltage does not fall within the first voltage range, the coupling capacitor continues to be charged, and the process returns to the step of comparing the common-mode voltage with the first voltage range. If the common-mode voltage falls within the first voltage range, then voltage traversal is performed on the common-mode voltage to determine the detected value of the common-mode voltage.

2. The common-mode voltage calibration method according to claim 1, characterized in that, The first voltage range is equal to the traversed voltage range; Before performing voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage, the method further includes: A second voltage range is obtained based on the first voltage range; wherein the second voltage range is smaller than the first voltage range; The second voltage range is compared with the common-mode voltage; If the common-mode voltage falls within the second voltage range, then the second voltage range is used as the new traversal voltage range, and the process proceeds to the step of performing voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage.

3. The common-mode voltage calibration method according to claim 2, characterized in that, Both the first voltage range and the second voltage range are symmetrical intervals; Wherein, the center value of the first voltage range and the second voltage range is a preset value of the common-mode voltage; the preset value of the common-mode voltage is: the center value of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval; The deviation value of the first voltage range is a boundary threshold, and the deviation value of the second voltage range is N times the boundary threshold; N is any value greater than 0 and less than 1; the boundary threshold is: the deviation value of the traversed voltage range after considering the initial traversed voltage range as a symmetrical interval.

4. The common-mode voltage calibration method according to claim 3, characterized in that, After comparing the second voltage range with the common-mode voltage, the method further includes: If the common-mode voltage does not fall within the second voltage range, then repeat the step of comparing the common-mode voltage with the second voltage range; If the number of repetitions of the step of comparing the second voltage range with the common-mode voltage exceeds a preset repetition threshold, then the preset value of the common-mode voltage is used as the detection value of the common-mode voltage, and the method is terminated.

5. The common-mode voltage calibration method according to claim 1, characterized in that, The comparison of the common-mode voltage with the first voltage range includes: The common-mode voltage is compared with the first voltage range using a comparator in the flow meter.

6. The common-mode voltage calibration method according to claim 5, characterized in that, The comparison of the common-mode voltage with the first voltage range using a comparator in the flow meter includes: The bias voltage connected to the negative input terminal of the comparator is controlled to periodically alternate between the upper and lower limits of the first voltage range; The output signals of the comparator are acquired over multiple cycles to determine the output code pattern; Compare whether the output code pattern is consistent with the feature code pattern; wherein, the feature code pattern is composed of alternating 0s and 1s; If they match, then the common-mode voltage is determined to fall within the first voltage range.

7. The common-mode voltage calibration method according to any one of claims 1 to 6, characterized in that, The step of performing voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage includes: A step control strategy is implemented for the bias voltage connected to the negative input terminal of the comparator in the flow meter; wherein, the step control strategy is: starting from any boundary value of the traversed voltage range, moving closer to another boundary value of the traversed voltage range with a preset step size. Monitor the output signal of the comparator; When the output signal of the comparator flips, the bias voltage applied to the comparator at the time of the flip is determined to be the detected value of the common-mode voltage; If the comparator's output signal does not flip during the entire step traversal process, the preset value of the common-mode voltage is used as the detected value of the common-mode voltage.

8. A common-mode voltage calibration device, characterized in that, include: A voltage comparison module is used to compare the common-mode voltage with a first voltage range after charging of the coupling capacitor begins; wherein the first voltage range is determined based on a traversed voltage range; the traversed voltage range is the voltage range used when traversing the common-mode voltage. A charge holding module is used to continue charging the coupling capacitor and re-trigger the voltage comparison module if the common-mode voltage does not fall within the first voltage range. The voltage traversal module is used to perform voltage traversal on the common-mode voltage to determine the detected value of the common-mode voltage if the common-mode voltage falls within the first voltage range.

9. The common-mode voltage calibration device according to claim 8, characterized in that, The voltage comparison module includes an echo receiver comparator in the flow meter; the charge holding module includes a charging circuit in the flow meter; the voltage traversal module includes a bias voltage control module in the flow meter. The charging circuit is connected to the coupling capacitor in the flow meter to charge the coupling capacitor and generate a common-mode voltage; the non-inverting input of the echo receiver comparator is connected to the coupling capacitor to receive the common-mode voltage. The first input terminal of the bias voltage control module is connected to the output terminal of the echo receiver comparator, the second input terminal of the bias voltage control module is connected to a common-mode voltage preset value, and the third input terminal of the bias voltage control module is connected to a boundary threshold. The bias voltage control module is used to: determine the traversed voltage range based on a symmetrical interval obtained with the common-mode voltage preset value as the center point and the boundary threshold as the deviation value, and sequentially generate bias voltages corresponding to the upper and lower limits of the traversed voltage range; the inverting input terminal of the echo receiver comparator is connected to the output terminal of the bias voltage control module to receive the bias voltage. The output terminal of the comparator is connected to the input terminal of the bias voltage control module; the bias voltage control module is further configured to: output the bias voltage that satisfies the step control strategy; monitor the output signal of the comparator; when the output signal of the comparator flips, determine that the bias voltage connected to the comparator at the time of flipping is the detected value of the common-mode voltage; if the output signal of the comparator does not flip during the entire step traversal process, then use the preset value of the common-mode voltage as the detected value of the common-mode voltage; The step control strategy includes: starting from any boundary value of the traversed voltage range, moving closer to another boundary value of the traversed voltage range with a preset step size.

10. A flow meter, characterized in that, Includes the common-mode voltage calibration device as described in claim 8 or 9.