Method for Forward and Reverse High-Resolution Pulse or Frequency Output

By using timers and accumulators in a bidirectional metering flowmeter, high-resolution pulses or frequency outputs are achieved in the forward and reverse direction, solving the problem that traditional flowmeters cannot recognize the flow direction and low resolution, and improving output accuracy and resolution.

CN114184247BActive Publication Date: 2025-06-13XIAN DINGZHENG PROCESS CONTROL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111411171.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-06-13
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

The single pulse/frequency output of a traditional flowmeter cannot identify the flow direction of the bidirectional meter flowmeter, and at high frequency, the resolution is low, so small flow pulses cannot be effectively output.

Method used

Using a bidirectional meter flowmeter, timer and accumulator, the forward and reverse high-resolution pulse or frequency output is achieved by setting the incremental value calculation formula and comparing the accumulator results with different times the resolution value.

Benefits of technology

It realizes the flow direction identification of the bidirectional meter flowmeter, improves the resolution of pulse or frequency output, and can accurately output small flow pulses to meet high resolution requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114184247B_ABST
    Figure CN114184247B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for positive and negative high-resolution pulse or frequency output. By setting the flowmeter, the measurement result of the flowmeter including the flow direction is converted into an increment value of the accumulator. The increment value = flow value / pulse equivalent value * resolution value * timer time. The accumulated increment value is compared with 1 / 4, 1 / 2, 3 / 4, and 1 times the set resolution value, and two-way positive and negative pulses including the flow direction are output. By using the flow information and flow direction information of the two-way metering flowmeter, the output of positive and negative high-resolution pulses is realized. The pulse resolution can be set, and the output pulse accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a signal extraction technology, and particularly to a method for positive and negative high-resolution pulse or frequency output. Background Art

[0002] Traditional flow meters only have a single-channel pulse / frequency output and cannot convey information about the flow direction of a two-way metering flow meter. Flow meters such as Coriolis mass flow meters, electromagnetic flow meters, and ultrasonic flow meters all have two-way metering functions. The pulse or frequency output of a typical flow meter is single-channel, and it is impossible to identify the flow direction of a two-way metering flow meter.

[0003] Quadrature bidirectional pulses are a typical output of an optical encoder, with two pulses A and B. When the phase of A leads the phase of B by 90 degrees, it is defined as forward, and when the phase of A lags behind the phase of B by 90 degrees, it is defined as reverse.

[0004] The methods for generating pulses or frequencies are generally the following:

[0005] 1. Obtained by dividing a natural frequency;

[0006] 2. Calculating the required timing period and implementing it through a timer.

[0007] For the first method, the natural frequency is usually 10 MHz. To generate a frequency of 10 KHz, the division factor is 1000, and at this time, the resolution can only reach 0.1%. The disadvantage of this method is that the higher the frequency, the lower the resolution.

[0008] For the second method, it depends on the timer of the processor. Usually, the timer is 16-bit, that is, the maximum count value is 65536. The higher the frequency value to be output, the smaller the count value to be set. When this common method is used for frequency output of a two-way metering flow meter, when the maximum flow resolution needs to reach 0.1%, the count is at least greater than 1000. Then, when the flow rate is as small as 1 / 65.536 of the full scale, the count value will be greater than 65536, and the timer will not work. The disadvantage of this method is that pulses cannot be output at low flow rates. Summary of the Invention

[0009] Aiming at the problem of identifying the flow direction of a two-way metering flow meter, a method for positive and negative high-resolution pulse or frequency output is proposed, which transforms the flow value and flow direction of the flow meter into a high-resolution pulse or frequency output that can distinguish between positive and negative directions.

[0010] The technical solution of the present invention is: a method for positive and negative high-resolution pulse or frequency output, including a two-way metering flow meter, a timer, and an accumulator;

[0011] First, set the incremental value calculation formula: Each time the timer reaches its time, an addition calculation is performed to increase the increment value, and the result is sent to the accumulator. The result in the accumulator is compared with 1 / 4, 1 / 2, 3 / 4, and 1 times the resolution value. Initially, both pulse / frequency outputs A and B of the two channels are zero;

[0012] When the result in the accumulator is greater than or equal to 1 / 4 of the resolution value, according to the forward and reverse flow directions, when it is forward, the output pulse A = 1 and pulse B = 0; when it is reverse, the output pulse A = 0 and pulse B = 1;

[0013] When the result in the accumulator is greater than or equal to 1 / 2 of the resolution value, according to the forward and reverse flow directions, when it is forward, the output pulse A = 1 and pulse B = 1; when it is reverse, the output pulse A = 1 and pulse B = 1;

[0014] When the result in the accumulator is greater than or equal to 3 / 4 of the resolution value, according to the forward and reverse flow directions, when it is forward, the output pulse A = 0 and pulse B = 1; when it is reverse, the output pulse A = 1 and pulse B = 0;

[0015] When the result in the accumulator is greater than or equal to the resolution value, a subtraction calculation is performed to subtract the resolution value, and the result is sent to the accumulator. Then, according to the forward and reverse flow directions, when it is forward, the output pulse A = 0 and pulse B = 0; when it is reverse, the output pulse A = 0 and pulse B = 0; thus completing one cycle.

[0016] Furthermore, the set resolution value and the selected timer frequency are greater than the highest measurement output frequency of the two-way metering flowmeter.

[0017] The beneficial effects of the present invention are as follows: The method for outputting positive and negative high-resolution pulses or frequencies of the present invention realizes the output of positive and negative high-resolution pulses according to the flow information and flow direction information of the two-way metering flowmeter. The pulse resolution can be set, and the output pulse accuracy is high. Brief Description of the Drawings

[0018] Figure 1 It is a flowchart of the present invention from the flow value to the pulse / frequency signal output.

[0019] Figure 2 It is a schematic diagram for generating two-way signals in the positive and negative directions. Detailed Embodiment

[0020] The present invention will be described in detail below in conjunction with the drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and the detailed implementation manner and specific operation process are given, but the protection scope of the present invention is not limited to the following embodiments.

[0021] The technical implementation of the present invention is to first calculate the cumulative increment value according to the flow value. The upper limit of the pulse or frequency output is 1 / 4 of the timer frequency. When the timer expires each time, the accumulator is added with an increment value, and the result is stored in the accumulator. The accumulator result is compared with the 1 / 4, 1 / 2, 3 / 4, and 1 times of the resolution value. Initially, both pulse / frequency outputs A and B are zero. When the accumulator result is greater than or equal to 1 / 4 of the resolution value (here, 1 / 4 is selected to achieve a 90-degree phase shift), according to the forward and reverse directions of the flow, A=1, B=0 is output in the forward direction; A=0, B=1 is output in the reverse direction. When the accumulator result is greater than or equal to 1 / 2 of the resolution value, according to the forward and reverse directions of the flow, A=1, B=1 is output in the forward direction; A=1, B=1 is output in the reverse direction. When the accumulator result is greater than or equal to 3 / 4 of the resolution value, according to the forward and reverse directions of the flow, A=0, B=1 is output in the forward direction; A=1, B=0 is output in the reverse direction. When the accumulator result is greater than or equal to the resolution value, the accumulator performs a subtraction of the resolution value, and the calculation result is stored in the accumulator. Then, according to the forward and reverse directions of the flow, the output A=0, B=0 is output in the forward direction; the output A=0, B=0 is output in the reverse direction, completing one cycle.

[0022] For example: the flow value is 360m 3 / h is 0.1m 3 / S, pulse equivalent is 0.0001m 3 / P, resolution is 100000, timer is 80kHz, timing time is 12.5uS. The calculated increment value is 1250. After 20 accumulations, the value of the accumulator reaches 25000, which is 1 / 4 of the resolution. At this time, the output A=1, B=0 in the forward direction; the output A=0, B=1 in the reverse direction; after another 20 accumulations, the value of the accumulator reaches 50000, which is 1 / 2 of the resolution. At this time, the output A=1, B=1 in the forward direction; the output A=1, B=1 in the reverse direction; after another 20 accumulations, the value of the accumulator reaches 75000, which is 3 / 4 of the resolution. At this time, the output A=0, B=1 in the forward direction; the output A=1, B=0 in the reverse direction; after another 20 accumulations, the value of the accumulator reaches 100000, which is the resolution value. At this time, the accumulator minus the resolution value is zero. The output A=0, B=0 in the forward direction; the output A=0, B=0 in the reverse direction. It can be seen that the period of the output pulse / frequency signal is 80 accumulations, that is, 1mS. The frequency is 1000Hz. So far, it corresponds to 360m 3 / h of forward flow, and obtained two pulse / frequency outputs of 1000Hz with A leading B by 90 degrees; corresponding to 360m 3 / h reverse flow, and obtained two pulse / frequency outputs of 1000Hz with A lagging behind B by 90 degrees, completing the conversion from flow meter flow value to forward and reverse, high-resolution pulse / frequency output.

[0023] Resolution, timer, the timing time is fixed and set as needed. For example, the full scale of a certain flowmeter is 3600 m 3 / h, and the highest output frequency is 10 kHz. Set the resolution to 100,000, the timer to 80 kHz, and the timing time to 12.5 μS. Increment value = flow value / pulse equivalent value * resolution value * timer time

[0024] The calculated increment value is 12,500. When the flow rate is 3599.712 m 3 / h, the increment value is 12,499. It can be resolved to 0.008%. At 1 / 10 of the flow rate, i.e., 360 m 3 / h, the resolution can reach 0.08%. A method to further improve the resolution is to increase the resolution from 100,000 to 1,000,000.

[0025] This method uses the interpolation method to achieve pulse output. For example, for 3599.712 m 3 / h, the increment value is 12,499, corresponding to an output frequency of 9.9992 kHz. The required timing time is 100.008 μS. After 9 accumulations, 112,491 is greater than or equal to the resolution. At this time, the output frequency is 8.889 kHz, the time is 112.5 μS. Subtract 10,000, and the remainder is 12,491. After 8 more accumulations, 112,483 is obtained. At this time, the output frequency is 10 kHz, the time is 100 μS. After outputting 1561 pulses of 10 kHz, the remainder is 3. In this way, 1562 pulses are output within 0.1562125 S, and the frequency is 9.9991998 kHz. The remainder of 3 ensures that the accuracy is not lost.

[0026] The above-described embodiments merely represent several implementation manners of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the invention patent shall be subject to the appended claims.

Claims

1. A method for positive and negative high-resolution pulse or frequency output, characterized in that, it includes a bidirectional metering flowmeter, a timer and an accumulator; First, set the incremental value calculation formula: Each time the timer reaches the set time, an addition calculation for increasing the increment value is performed, and the result is sent to the accumulator. The result of the accumulator is compared with 1 / 4, 1 / 2, 3 / 4, and 1 times the resolution value. Initially, both pulse / frequency outputs A and B are zero; When the result of the accumulator is greater than or equal to 1 / 4 of the resolution value, according to the positive and negative directions of the flow, when it is positive, the output pulse A = 1 and the pulse B = 0; when it is negative, the output pulse A = 0 and the pulse B = 1; When the result of the accumulator is greater than or equal to 1 / 2 of the resolution value, according to the positive and negative directions of the flow, when it is positive, the output pulse A = 1 and the pulse B = 1; when it is negative, the output pulse A = 1 and the pulse B = 1; When the result of the accumulator is greater than or equal to 3 / 4 of the resolution value, according to the positive and negative directions of the flow, when it is positive, the output pulse A = 0 and the pulse B = 1; when it is negative, the output pulse A = 1 and the pulse B = 0; When the result of the accumulator is greater than or equal to the resolution value, a subtraction calculation for subtracting the resolution value is performed, and the result is sent to the accumulator. Then, according to the positive and negative directions of the flow, when it is positive, the output pulse A = 0 and the pulse B = 0; when it is negative, the output pulse A = 0 and the pulse B = 0; one cycle is completed.

2. The method for positive and negative high-resolution pulse or frequency output according to claim 1, characterized in that, the set resolution value and the selected timer frequency are greater than the highest metering output frequency of the bidirectional metering flowmeter.

Citation Information

Patent Citations

  • Fluid vibration type effusion meter self-adapting FFT power spectrum analysis and signal processing method

    CN101363746A

  • Device and method for improving pulse edge time resolution

    CN103873017A