A frequency measurement method and system based on second pulses
Patent Information
- Application Number
- CN202611425064.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-03
AI Technical Summary
In the impedance measurement of transmission lines, the accuracy of frequency measurement based on the interval between two adjacent second pulses is low, and the reliability of the continuous second pulse frequency measurement scheme is low under strong interference environment, making it difficult to meet the requirements of high accuracy and high reliability.
An edge-triggered counter with a preset capture window is used to successfully capture the initial frequency measurement value through multiple rounds. The capture window is then set using reliable measurement values in subsequent measurements. By combining adjacent and interval second pulse edge-triggered counters, interference effects are reduced, and the reliability and accuracy of frequency measurement are improved.
This significantly reduces the impact of interference on frequency measurement, improving the reliability and accuracy of frequency measurement. In particular, by measuring the average value of the counter triggered by pulse edges at intervals of M seconds, the accuracy of frequency measurement is further improved.
Smart Images

Figure CN123029264A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of frequency measurement technology, and more specifically to a frequency measurement method and system based on second pulses. Background Technology
[0002] Impedance measurement of transmission lines requires injecting a sinusoidal voltage signal of a specific frequency into the transmission line. The impedance is then calculated by detecting a sinusoidal current signal of the same frequency. The accuracy of the impedance measurement is highly dependent on the frequency accuracy and stability of the injected sinusoidal voltage signal. Transmission line impedance measurements are performed within substations. High-voltage and ultra-high-voltage lines (110kV, 220kV, 500kV, etc.) within substations can generate high-frequency electromagnetic interference on the measuring equipment due to corona discharge. Furthermore, power frequency interference can occur through electric and magnetic field coupling. To achieve high-precision impedance measurement of transmission lines, the measuring equipment needs to generate a highly reliable and accurate clock even in environments with strong interference.
[0003] Intelligent power equipment typically incorporates intelligent processing components such as MCUs, DSPs, and FPGAs. These components include high-frequency oscillators capable of generating high-frequency square waves, which can serve as clocks for these processing components and for counting operations. However, the actual frequency of the oscillator deviates from its nominal frequency over time and with temperature variations, preventing the generation of a high-precision clock. GPS or BeiDou modules can output high-precision second pulse signals at 1-second intervals. Intelligent processing components measure the frequency of their own oscillators by counting the intervals between adjacent second pulses, thus improving clock accuracy. However, when applied to transmission line impedance measurement equipment, frequency measurement based on the interval between adjacent second pulses cannot meet high-precision requirements. Furthermore, strong interference can cause the GPS or BeiDou module to lose second pulses and generate false rising edges, making conventional frequency measurement schemes based on continuous second pulses unreliable. Summary of the Invention
[0004] In view of this, the present invention provides a frequency measurement method and system based on second pulses, which solves the problems of low accuracy in frequency measurement based on the time interval between two second pulses and low reliability of continuous second pulse frequency measurement schemes under strong interference.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: On one hand, the present invention discloses a frequency measurement method based on a second pulse, the method comprising the following steps: The automatic counting reset is initiated by triggering a counter on the edge of two adjacent second pulses and initializing the counter to capture the first second pulse; The second pulse is captured by a counter triggered by the edges of two adjacent second pulses, and in continuous... After a successful capture, initialization is completed to obtain the average value of a stable count; in the event of a capture failure, the edge-triggered counter is reset and the count value is compensated based on the existing measurement results; After the two adjacent second pulse edge trigger counters have completed initialization, start Interval of automatic count reset Each second pulse edge-triggered counter, and respectively for the... Each counter is initialized to capture the corresponding interval. One second pulse; As stated Interval Each second pulse edge-triggered counter separately records the interval Each second pulse is captured, and in their respective continuous pulses After a successful capture, initialization is completed, and each stable count value is obtained; in the event of a capture failure, the corresponding counter is reset and the count value is compensated based on the existing measurement results; According to the above Interval The stable count value of each pulse edge-triggered counter is output. Each frequency measurement value, and the The average of the measured frequencies is used as the final frequency measurement result.
[0006] Preferably, the initialization process of the two adjacent second pulse edge-triggered counters includes: setting the initial edge capture window to... , Set the upper limit of the oscillator frequency for the intelligent processing unit; after capturing the first second pulse, set the edge capture window to... , This is the lower limit of the oscillator frequency for the intelligent processing unit.
[0007] Preferably, the two adjacent second pulse edge trigger counters are continuous. The specific process of successfully capturing the second pulse and completing initialization includes: The counter is triggered by the edges of two adjacent second pulses to capture adjacent second pulses sequentially. The current count value is recorded each time a second pulse is successfully captured. When consecutive second pulses are captured... If all captures are successful, use the recorded data. Calculate the average value of each count. Initialization complete; During normal operation after initialization, the current counter value is recorded cyclically, and the recorded count is used. The average value is updated by the count value. .
[0008] Preferably, the capture interval of the two adjacent second pulse edge-triggered counters during normal operation is set as follows: based on the average of the count values. and the maximum frequency offset in 1 second Set the capture interval for the next second pulse as follows: .
[0009] Preferably, the reset and compensation methods for the two adjacent second pulse edge-triggered counters when capture fails include: If no second pulse is captured within the preset counting window, the counter counts according to its current value. and the average of the count values Determine the compensation value ; Using the average value As the count value of the currently missing second pulse, before the update The average count value is used to set the capture interval for the next second pulse based on the compensated result. .
[0010] Preferably, the Interval of automatic count reset The initialization process for each of the second pulse edge-triggered counters includes: For the The counter is set to [number], and the initial edge capture window is set to [value]. After capturing the first second pulse, adjust the edge capture window to... .
[0011] Preferably, the Interval of automatic count reset Each second pulse edge-triggered counter is continuously triggered. The specific process of initialization after a successful capture includes: For the Each of the aforementioned counters sequentially captures the interval. The second pulse is recorded each time a second is successfully captured, and the current count value is recorded. When continuous If all captures are successful, use the recorded data. Calculate the average value of each count. Initialization complete; During normal operation after initialization, the current counter value is recorded cyclically, and the recorded count is used. The average value is updated by the count value. and according to Output the first Frequency measurement value .
[0012] Preferably, the first Interval The capture interval setting method for the pulse edge-triggered counter during normal operation is as follows: based on the average value... and Set the next interval The second pulse capture interval is 1 second. .
[0013] Preferably, the Interval The reset and compensation methods for the pulse-edge triggered counter in the second-second timeout when capture failure include: For the The counter, when no interval is captured within the preset counting window. Every second pulse, based on the current count value of the counter. and the average count value of the counter Determine the compensation value ; Using the average value As the currently missing interval Update the counter with the count value of the previous second pulse. Average of count values, output frequency measurement value: And set the next interval of the counter based on the compensated result. The capture interval of a pulse per second; Set the next second pulse capture interval: Set a capture failure flag.
[0014] On the other hand, the present invention discloses a frequency measurement system based on a second pulse, comprising: A second pulse signal source, used to output second pulse signals at fixed time intervals; The intelligent processing unit has a built-in oscillator to provide the counting clock signal; The first counting measurement module, connected to the second pulse signal source and the intelligent processing unit, is used to measure the counting interval between two adjacent second pulse edges using the oscillator as the clock, and to continuously... After successfully capturing the second pulse, output a stable first frequency reference value; A second counting and measurement module is connected to the second pulse signal source and the intelligent processing unit, respectively, and is activated after the first counting and measurement module completes initialization. Each module uses the oscillator as its clock to set intervals. The counting interval between the edges of the pulses is measured and output separately. One frequency measurement value; The processing module, respectively with the A second counting and measurement module is connected to it for using the... The average of the frequency measurements is output as the final frequency measurement result. The edge triggering of the first counting measurement module and each of the second counting measurement modules is valid within a preset counting window. When there is no edge triggering within the preset counting window, the corresponding counting measurement module is reset and the counting value is compensated based on the existing measurement results.
[0015] As can be seen from the above technical solution, compared with the prior art, the beneficial effects of the present invention are as follows: The frequency measurement value initialization is completed only after multiple successful captures are achieved by using the edge-triggered counter of the preset capture window. In subsequent measurements, the capture window of the edge-triggered counter is set using the reliable measurement values that have been obtained. This greatly reduces the impact of false second pulses caused by interference on the frequency measurement and improves the reliability of the frequency measurement. An edge-triggered counter with an interval of M seconds can improve the frequency measurement accuracy compared to an edge-triggered counter with adjacent second pulses. Using the average of the average values of M edge-triggered counters with an interval of M seconds as the frequency measurement value can further improve the frequency measurement accuracy. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 The flowchart of a highly reliable and high-precision frequency measurement method based on second pulses provided by the present invention is shown.
[0018] Figure 2 Initialize the process of capturing the first and second second pulses by triggering the counter for two adjacent second pulse edges; Figure 3 After the counters trigger normal capture of two adjacent second pulse edges, the next second pulse capture interval is set; Figure 4 If the counter fails to capture a second pulse after two adjacent second pulse edges are triggered, the next second pulse capture interval will be set. Figure 5 Initialize the process of capturing the first second pulse and M+1 second pulses for the edge-triggered counter with an interval of M second pulses; Figure 6To set the next M-second pulse capture interval after the edge-triggered counter normally captures M-second pulses at intervals of M seconds; Figure 7 To set the next M-second pulse capture interval after the edge-triggered counter fails to capture an M-second pulse interval, the interval is set. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The second pulse signal source is a GPS or BeiDou module. After the second pulse emitted by the second pulse signal source is captured by the intelligent processing unit, the time corresponding to the count of the intelligent processing unit's oscillator period can be obtained. Assuming the oscillator frequency of the intelligent processing unit is... The cycle is The time interval between two second pulses is counted as Because the intelligent processing unit can only operate at a certain frequency Sampling the second pulse and timing the edge of the second pulse introduces a time error. Assuming the count of the arrival time of the previous second pulse is The actual arrival time count is in Between, the count of the arrival time of the next second pulse is Counting the actual arrival time Therefore, the minimum count between two second pulses is: The maximum value is: = The actual counting of the oscillator in the intelligent processing unit is the frequency: ~ Frequency error ±1.
[0021] If we measure the interval instead of two adjacent second pulses... The time interval between pulses per second, assuming the previous interval The count is the time when the pulse arrives in seconds. The actual arrival time count is in Between, the next interval The count is the time when the pulse arrives in seconds. The actual arrival time count is in Therefore, the minimum count between M second pulse intervals is: The maximum value is: The actual counting of the oscillator in the intelligent processing unit is the frequency: ~ Frequency error ±1 / Frequency error can be reduced times.
[0022] Assuming the oscillator's nominal frequency =100MHz, =1000, take =10, =10, =10.
[0023] The method provided by this invention, such as Figure 1 As shown, it includes the following steps: Step 1: The automatic counting reset is triggered by the edge of the two adjacent second pulses to initialize the counter, assuming it is triggered by the rising edge.
[0024] Step 11: Due to the oscillator's nominal frequency =100MHz, =1000kHz, the maximum oscillator count value corresponding to 1 second is The maximum count value of the counter at the current start time is triggered by the rising edge of the first second pulse and the two adjacent second pulse edges of the automatic count reset. The count value for capturing the rising edge of the first second pulse is set to: 0~1001000; For example... Figure 2 As shown (the process of capturing the first second pulse).
[0025] Step 12: After capturing the rising edge of the first second pulse, the automatic count reset is triggered by the edges of two adjacent second pulses, automatically resetting the counter to 0 and restarting the count. The minimum count value between the rising edge of the second second pulse and the rising edge of the first second pulse is... The maximum count value between the rising edge of the second second pulse and the rising edge of the first second pulse is... The edge capture window is set to 999000~1001000, and an array containing 10 count values is initialized. Initialize the current second pulse count. The initialization flags of the two adjacent second pulse edge-triggered counters for automatic counting reset are set to 0, and the capture failure flags of the two adjacent second pulse edge-triggered counters are set to 0; for example Figure 2 As shown (the process of capturing the second second pulse).
[0026] Step 13: If a second pulse is captured, assume that the counter count value is triggered by the edges of two adjacent second pulses during the automatic count reset. If the counter initialization flag is triggered by the edges of two adjacent second pulses during automatic count reset, if , , Using what has already been captured The average of the count values: ; if The automatic count reset is triggered by the edges of two adjacent second pulses, setting the counter initialization flag to 1. =10, Calculate the average of the 10 captured counts: ; if Current pulse count per second =0, set the initialization flags of the two adjacent second pulse edge-triggered counters that are automatically reset to 0, set the capture failure flags of the two adjacent second pulse edge-triggered counters to 0, return to step 11, and start initialization again; Step 14: If a second pulse is captured, assume that the counter count value is triggered by the edges of two adjacent second pulses during the automatic count reset. If the counter initialization flag is set to 1 on the edge of two adjacent second pulses during automatic counting reset, or if the counter capture failure flag is set to 1 on the edge of two adjacent second pulses, the count value needs to be increased by a compensation value. , = + Set the capture failure flag of the two adjacent second pulse edge trigger counters to 0. , = +1, if =10, then let =1, Calculate the average of the 10 captured count values: ; if Current pulse count per second =0, set the initialization flags of the two adjacent second pulse edge-triggered counters that are automatically reset to 0, set the capture failure flags of the two adjacent second pulse edge-triggered counters to 0, return to step 11, and start initialization again; Step 15: As Figure 3 As shown, based on the average count value and the maximum frequency offset over 1 second... Set the next second pulse capture interval: , ; ; Assuming =1000233, the next second pulse capture range: 999233~1001000; ; ; Assuming =999758, the next second pulse capture range: 999000~1000758; ; ; Return to step 13; Step 16: If no second pulse is captured, the automatic count reset is triggered by the edges of two adjacent second pulses when the count value reaches [a certain value]. It will automatically reset and start counting again. If the counter initialization flag is triggered by the two adjacent second pulse edges of the automatic counting reset, return to step 11. Step 17, as follows Figure 4 As shown, if no second pulse is captured, if the initialization flag of the two adjacent second pulse edge-triggered counters is 1, and if the capture failure flag of the two adjacent second pulse edge-triggered counters is 0, then the capture failure flag of the two adjacent second pulse edge-triggered counters is set to 1, based on the current counter value. and Determine the counter compensation value: ; Assuming =1000233, current count value =1001000, indicating that the second pulse should occur at a count value of 1001000. When the time comes, this position is used as the trigger position for the missing second pulse. The counter triggered by the edge of two adjacent second pulses should restart counting at this position, but in reality, it starts counting after reaching the count value. The counting restarts at time 1, and the difference between the two is: =1001000-1000233=767; The counter triggered by the edges of two adjacent second pulses is equivalent to a count of 767 less.
[0027] if , = +1, if =10, then let =1, Calculate the average of the 10 captured count values: ; Assuming =1000233, =3, then =1000233, the remaining count values are the actual count values obtained from the edge-triggered counters of two adjacent second pulses. Assume the new average value is calculated based on these 10 count values as: =1000217; Set the next second pulse capture interval: ; =999000; =1001000; Return to step 15; if Current pulse count per second =0, set the initialization flags of the two adjacent second pulse edge-triggered counters that are automatically reset to 0, set the capture failure flags of the two adjacent second pulse edge-triggered counters to 0, return to step 11, and start initialization again; Step 18: If no second pulse is captured, and if the initialization flags of the two adjacent second pulse edge-triggered counters for automatic count reset are 1, and the capture failure flags of the two adjacent second pulse edge-triggered counters are 1, set the initialization flags of the two adjacent second pulse edge-triggered counters for automatic count reset to 0, set the capture failure flags of the two adjacent second pulse edge-triggered counters to 0, return to step 11, and start initialization again.
[0028] Step 2 specifically includes the following steps: Step 21: As Figure 5 As shown in the initial capture process, following step 14, if the two adjacent second pulse edge-triggered counters that have been automatically reset can capture the second pulse normally for 10 consecutive times, then the first to the tenth automatic count reset interval 10 second pulse edge-triggered counters are activated sequentially. The initial edge capture window is set as follows: , ; = ; Used to capture the first A pulse per second ~ to the 1st The rising edge of a 0-second pulse, It is a positive integer, corresponding to a second pulse cycle with a period of 10; Step 22: As Figure 6 As shown in the settings window after normal capture, if the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter did not capture the first After one second pulse, return to step 21 and continue initialization; Step 23: As Figure 7 As shown (compensation settings after capture failure), if the first indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter captures the first... The second pulse, the... The automatic counter resets to 0 every 10 seconds at which a pulse edge triggers the counter, restarting the count. The capture window for each second pulse is set as follows: .
[0029] Assuming at this time =1000233, ; ; No. The capture window for the pulse per second is 9992330~10010000.
[0030] Initialization includes 10th... indivual( =1~10) An array of counter count values triggered by a 10-second pulse edge after automatic count reset. , =1~10, initialize the first indivual( =1~10) Automatic count reset interval 10 second pulse edge trigger counter current second pulse count. , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to ; Step 24: If the first indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter captures the first... The nth second pulse, assuming the nth second pulse... indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter count value If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is ; if , , ; Using what has already been captured The average of the count values : ; if , set the indivual( =1~10) Automatic count reset interval 10 seconds pulse edge trigger counter initialization flag The capture failure flag of the counter triggered by the edge of two adjacent second pulses is set to 0. =10, Calculate the average of the 10 captured counts: ; if The initialization includes 10 first-order... An array of counter count values triggered by a 10-second pulse edge, with m=1~10 automatic count reset intervals. , =1~10, initialize the first indivual( =1~10) Automatic count reset interval 10 second pulse edge trigger counter current second pulse count. , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to Return to step 21; Step 25: If the first indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter captures the first... The nth second pulse, assuming the nth second pulse... indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter count value If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to , No. indivual( =1~10) Automatic counter reset interval is 10 seconds. Pulse edge triggering counter value needs to be added to the compensation value. , , set the indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to , if if , then , ; Calculate the average of the 10 counts already captured. : ; if The initialization includes 10 first-order... indivual( =1~10) An array of counter count values triggered by a 10-second pulse edge after automatic count reset. , =1~10, initialize the first indivual( =1~10) Automatic count reset interval 10 second pulse edge trigger counter current second pulse count. , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to Return to step 21; Step 26: Based on the average of the count values and the maximum frequency offset in 1 second , set the first indivual( =1~10) Automatic count reset interval: 10-second pulse edge triggers the counter to capture the next second pulse: , ; ; Assuming =10002337, the automatic count reset interval is 10 second pulses. The next second pulse capture range is triggered by the edge of the counter: 9992337~10010000; ; ; Assuming =9997585, the automatic count reset interval is 10 second pulses. The next second pulse capture range is triggered by the edge of the counter: 9990000~10007585; ; ; If the indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is Output / 10=999758.5, which, as the frequency measurement value, shows that it is relative to the measurement value obtained by the counter triggered by the edge of two adjacent second pulses. =1000233, the frequency measurement accuracy obtained by the pulse edge trigger counter with a 10-second interval is higher.
[0031] Return to step 23; Step 27: If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter did not capture the first The nth second pulse, assuming the nth second pulse... indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter count value If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to , Set the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to 1. Based on the current counter value and Determine the counter compensation value: Assuming =10002337, current count value =10010000, indicating that the second pulse should occur at a count value of 10010000. When the time arrives, use this position as the trigger position for the missing second pulse, the first... indivual( =1~10) Automatic count reset interval: 10 seconds. Pulse edge trigger counter: The counter should restart counting at this position, but in reality, it restarts counting after reaching the count value. The counting restarts at time 1, and the difference between the two is: =10010000-10002337=7663; No. indivual( =1~10) Automatic counting reset interval of 10 seconds pulse edge trigger counter is equivalent to a count of 7663 less.
[0032] if if , then , Calculate the number of times using the 10 already captured count values. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter trigger counter average count value: ; Assuming =10002337, 3, then =1000233, the remaining count values are the actual count values obtained from the edge-triggered counters of two adjacent second pulses. Assume the new average value is calculated based on these 10 count values as: =10002175 Set the next second pulse capture interval: , ; Output / 10=1000217.5, which, as the frequency measurement value, shows that it is relative to the measurement value obtained by the edge-triggered counter of two adjacent second pulses. =1000233, the frequency measurement accuracy obtained by the pulse edge trigger counter with a 10-second interval is higher.
[0033] Return to step 23; if The initialization includes 10 first-order... indivual( =1~10) An array of counter count values triggered by a 10-second pulse edge after automatic count reset. , =1~10, initialize the first indivual( =1~10) Automatic count reset interval 10 second pulse edge trigger counter current second pulse count n , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to Return to step 21; Step 28: If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter did not capture the first The nth second pulse, assuming the nth second pulse... indivual( =1~10) Automatic counting reset interval 10 seconds pulse edge triggered counter count value If the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is =1, if the first indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to 1. Initialization includes 10... indivual( =1~10) An array of counter count values triggered by a 10-second pulse edge after automatic count reset. , =1~10, initialize the first indivual( =1~10) Automatic count reset interval 10 second pulse edge trigger counter current second pulse count. , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter initialization flag is , No. indivual( =1~10) Automatic count reset interval 10 seconds pulse edge triggered counter capture failure flag set to Return to step 21; The various embodiments in this 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 they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0034] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A frequency measurement method based on second pulses, characterized in that, The specific steps are as follows: The automatic counting reset is initiated by triggering a counter on the edge of two adjacent second pulses and initializing the counter to capture the first second pulse; The second pulse is captured by a counter triggered by the edges of two adjacent second pulses, and in continuous... After a successful capture, initialization is completed to obtain the average value of a stable count; in the event of a capture failure, the edge-triggered counter is reset and the count value is compensated based on the existing measurement results; After the two adjacent second pulse edge trigger counters have completed initialization, start Interval of automatic count reset Each second pulse edge-triggered counter, and respectively for the... Each counter is initialized to capture the corresponding interval. One second pulse; As stated Interval Each second pulse edge-triggered counter separately records the interval Each second pulse is captured, and in their respective continuous pulses After a successful capture, initialization is completed, and each stable count value is obtained; in the event of a capture failure, the corresponding counter is reset and the count value is compensated based on the existing measurement results; According to the above Interval The stable count value of each pulse edge-triggered counter is output. Each frequency measurement value, and the The average of the measured frequencies is used as the final frequency measurement result.
2. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The initialization process of the two adjacent second pulse edge-triggered counters includes: setting the initial edge capture window to... , Set the upper limit of the oscillator frequency for the intelligent processing unit; after capturing the first second pulse, set the edge capture window to... , This is the lower limit of the oscillator frequency for the intelligent processing unit.
3. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The two adjacent second pulse edge trigger counters are consecutive The specific process of successfully capturing the second pulse and completing initialization includes: The counter is triggered by the edges of two adjacent second pulses to capture adjacent second pulses sequentially. The current count value is recorded each time a second pulse is successfully captured. When consecutive second pulses are captured... If all captures are successful, use the recorded data. Calculate the average value of each count. Initialization complete; During normal operation after initialization, the current counter value is recorded cyclically, and the recorded count is used. The average value is updated by the count value. .
4. The frequency measurement method based on a second pulse according to claim 3, characterized in that, The capture interval of the two adjacent second pulse edge-triggered counters during normal operation is set as follows: based on the average of the count values. and the maximum frequency offset in 1 second Set the capture interval for the next second pulse as follows: .
5. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The reset and compensation methods for the two adjacent second pulse edge-triggered counters when capture failure include: If no second pulse is captured within the preset counting window, the counter counts according to its current value. and the average of the count values Determine the compensation value ; Using the average value As the count value of the currently missing second pulse, before the update The average count value is used to set the capture interval for the next second pulse based on the compensated result. .
6. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The Interval of automatic count reset The initialization process for each of the second pulse edge-triggered counters includes: For the The counter is set to [number], and the initial edge capture window is set to [value]. After capturing the first second pulse, adjust the edge capture window to... .
7. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The Interval of automatic count reset Each second pulse edge triggers a counter continuously The specific process of initialization after a successful capture includes: For the Each of the aforementioned counters sequentially captures the interval. The second pulse is recorded each time a second is successfully captured, and the current count value is recorded. When continuous If all captures are successful, use the recorded data. Calculate the average value of each count. Initialization complete; During normal operation after initialization, the current counter value is recorded cyclically, and the recorded count is used. The average value is updated by the count value. and according to Output the first Frequency measurement value .
8. The frequency measurement method based on a second pulse according to claim 7, characterized in that, The first Interval The capture interval setting method for the pulse edge-triggered counter during normal operation is as follows: based on the average value... and Set the next interval The second pulse capture interval is 1 second. .
9. The frequency measurement method based on a second pulse according to claim 1, characterized in that, The Interval The reset and compensation methods for the pulse-edge triggered counter in the second-second timeout when capture failure include: For the The counter, when no interval is captured within the preset counting window. Every second pulse, based on the current count value of the counter. and the average count value of the counter Determine the compensation value ; Using the average value As the currently missing interval Update the counter with the count value of the previous second pulse. The average of the count values is used to set the next interval of the counter based on the compensated result. Set the capture interval for the current second pulse, and then set the capture interval for the next second pulse: Set a capture failure flag.
10. A frequency measurement system based on a second pulse, characterized in that, include: A second pulse signal source, used to output second pulse signals at fixed time intervals; The intelligent processing unit has a built-in oscillator to provide the counting clock signal; The first counting measurement module, connected to the second pulse signal source and the intelligent processing unit, is used to measure the counting interval between two adjacent second pulse edges using the oscillator as the clock, and to continuously... After successfully capturing the second pulse, output a stable first frequency reference value; A second counting and measurement module is connected to the second pulse signal source and the intelligent processing unit, respectively, and is activated after the first counting and measurement module completes initialization. Each module uses the oscillator as its clock to set intervals. The counting interval between the edges of the pulses is measured and output separately. One frequency measurement value; The processing module, respectively with the A second counting and measurement module is connected to it for using the... The average of the frequency measurements is output as the final frequency measurement result. The edge triggering of the first counting measurement module and each of the second counting measurement modules is valid within a preset counting window. When there is no edge triggering within the preset counting window, the corresponding counting measurement module is reset and the counting value is compensated based on the existing measurement results.
