A high-precision and fast calculation method for frequency or speed
By judging and predicting the location of the sampling point point by point, the problem of large amount of calculations at high-speed sampling rates is solved, and high-precision and rapid calculation of frequency or speed is achieved, ensuring the accuracy and real-time calculation, and eliminating the interference signal Influence.
Patent Information
- Application Number
- CN202210519764.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-05-12
AI Technical Summary
The prior art has problems such as delay in computing time or errors in data processing equipment due to large calculation amounts at high speed sampling rates.
The secondary voltage signal of the power grid is obtained through a high-speed acquisition card, high-precision analog-to-digital conversion, and the position of the threshold sampling point is determined by point, the first two sampling points are used to predict the next threshold sampling point, and the threshold is judged within the confidence interval to obtain all Threshold sampling point, calculate frequency or speed.
Without changing the calculation accuracy of frequency or speed, the calculation amount is greatly reduced, the calculation time is saved, the calculation accuracy and real-timeness are ensured, and the impact of the interference signal is eliminated through the anti-disturbance coefficient.
Smart Images

Figure CN114966199B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of frequency calculation and rotation speed calculation of periodic signals, and in particular to a high-precision and fast frequency or rotation speed calculation method. Background Art
[0002] With the improvement of technology, the industry has put forward new requirements for the real-time and accuracy of frequency or speed calculation. If you want to obtain more precise parameters, you must increase the data sampling rate. For example, a new method for real-time high-precision measurement of power grid frequency is disclosed in a Chinese patent application (application number 202010221855.2). In this method, the sampling rate reaches 100Ms / s. While high-speed sampling brings higher accuracy, it also brings huge pressure to the calculation. If the computing power or memory is insufficient, long-term operation will inevitably cause the computer to crash or even freeze. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a high-precision and fast frequency or rotational speed calculation method to solve the technical problems existing in the prior art, so as to solve the technical problems of calculation time delay or data processing equipment error that may be caused by the large amount of calculation under the current high-speed sampling rate.
[0004] The technical solution adopted by the present invention is: a high-precision and fast calculation method for frequency or rotation speed, which method is: a high-speed acquisition card obtains the secondary voltage signal of the power grid; the voltage signal is converted into a digital signal with high precision; the voltage signal is obtained by a high sampling rate for the converted signal; the voltage signal is judged point by point to obtain the sampling point positions corresponding to the first two thresholds; the frequency is calculated based on the first two thresholds; the position of the next threshold sampling point is predicted by the frequency calculated from the first two sampling points; the threshold is judged within the confidence interval of the next threshold sampling point position to obtain the sampling point position corresponding to the actual threshold; and so on, the sampling points corresponding to all thresholds in the signal are obtained; and the actual frequency or rotation speed is obtained.
[0005] A method for high-precision and fast calculation of frequency or rotation speed, the specific steps of the method are as follows:
[0006] A) Through the principle of electromagnetic induction, the primary voltage of the power grid is converted into a secondary voltage signal. The secondary voltage signal has the same frequency as the primary voltage signal, and its amplitude is proportional to the primary voltage. The data acquisition channel of the high-speed acquisition card is connected to the secondary voltage signal.
[0007] B) The secondary voltage signal is converted into a digital signal through analog-to-digital conversion by a high-speed data acquisition card;
[0008] C) converting the digital signal obtained in step B) through acquisition software, and reading the converted data into a data processing device;
[0009] D) Perform threshold judgment on the data read into the data processing device point by point until the sampling point positions corresponding to the two thresholds are found, and the interval between the two sampling points must be greater than the anti-disturbance coefficient;
[0010] E) predicting the sampling point position corresponding to the next threshold value through the two sampling point positions found, and performing threshold judgment within the confidence interval, and finding the sampling point position corresponding to the actual threshold value within the confidence interval;
[0011] F), repeating step E through the sampling point positions corresponding to the two most recent thresholds until all searches for the data read into the data processing device are completed and all sampling point positions corresponding to the thresholds are obtained;
[0012] G) Confirm the frequency through the sampling point position corresponding to the primary threshold.
[0013] The signal sequence V after the secondary voltage signal is converted into a digital signal in step B) is expressed as:
[0014] V={v0,v1,v2,…,v n …,v x}
[0015] In the formula, v x is the last element in V.
[0016] In step D), the signal is subjected to threshold determination, and the process is as follows:
[0017] v i ≤U0
[0018] v i+1 ≥U0
[0019] Among them, i ranges from 0 to x-1. If the above formulas are all true, the first i that is true is recorded as i0, and the second i that is true is recorded as i1. When two values that meet the conditions are found, the calculation is stopped, and U0 is the threshold.
[0020] In step D), the interval between the two sampling points must be greater than the anti-disturbance coefficient, and the process is as follows:
[0021] i1-i0≥r
[0022] In the formula, r is the anti-disturbance coefficient. If the above formula is not satisfied, the previous calculation process is repeated until two values that meet the conditions are found. The range of the anti-disturbance coefficient r is:
[0023] r = int[(0.1 / f)*s]
[0024] Where r is an integer, f is the center frequency, and s is the sampling rate of the data acquisition card.
[0025] In step E), the next sampling point position corresponding to the threshold is predicted by finding the positions of the two most recent sampling points. The process is as follows:
[0026] i n '=i n-1 +(i n-1 -i n-2 )
[0027] i n ' is the predicted position of the next sampling point corresponding to the threshold.
[0028] In step E), a threshold value is judged within the confidence interval, and the sampling point position corresponding to the actual threshold value is found within the confidence interval. The process is as follows:
[0029] Confidence Interval:
[0030] Z=[i' n -(i n-1 -i n-2 )·k,i' n +(i n-1 -i n-2 )·k]
[0031] z0=i' n -(i n-1 -i n-2 )·k
[0032] z1=i' n +(i n-1 -i n-2 )·k
[0033] Where k is the confidence coefficient, Z is denoted as [z0, z1], and the confidence coefficient k ranges from 0 to 1. In step E), the sampling point position corresponding to the actual threshold is found within the confidence interval, and the process is as follows:
[0034] v m ≤U0
[0035] V (m+1) ≥U0
[0036] mi (n-1) >r
[0037] m∈Z
[0038] In the formula, m ranges from z0 to z1. If the above formula holds, then i n =m.
[0039] In step F), step E is repeated through the sampling point positions corresponding to the two most recent thresholds until all searches for the data read into the data processing device are completed, and all sampling point positions corresponding to the thresholds are obtained, and the corresponding sampling point positions I are as follows:
[0040] I={i0,i1,i2,…,i z}
[0041] Where z is the subscript of the last element in the I sequence.
[0042] In step G), the frequency is confirmed by the sampling point position corresponding to the primary threshold, and the process is as follows:
[0043] T={(i1-i0)*Δt,(i2-i1)*Δt,…,(i z -i z-1 )*Δt}={t1,t2,…,t z}
[0044] F={1 / t1,1 / t2,…,1 / t z}={f1,f2,…,f z}
[0045] Where Δt is the time interval between two sampling points in the original signal sequence V, T is the period, F is the frequency or speed, and t z is the zth period of the calculated periodic sequence, f z is the zth frequency or speed of the calculated frequency or speed sequence.
[0046] Beneficial effects of the present invention: Compared with the prior art, the present invention performs threshold judgment through signals point by point, determines the positions of the first two sampling points corresponding to the threshold, and then uses the determined two sampling point positions to predict the sampling point position corresponding to the next threshold, and sets a confidence interval at the predicted sampling point, and performs threshold judgment within the interval to find the sampling point position corresponding to the actual threshold within the interval, and repeats the previous process until all the read-in data are processed. After obtaining the positions of all sampling points corresponding to the threshold, the frequency or speed is calculated. This calculation method greatly reduces the amount of calculation without changing the calculation accuracy of the frequency or speed, saves calculation time, and ensures the accuracy and real-time performance of the frequency or speed calculation. At the same time, the anti-disturbance coefficient introduced by this method eliminates the influence of interference signals and avoids the calculation errors caused thereby. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is the system flow chart;
[0048] Figure 2 This is a schematic diagram of frequency calculation;
[0049] Figure 3 This is a schematic diagram of speed calculation. DETAILED DESCRIPTION
[0050] The present invention is further described below in conjunction with specific embodiments.
[0051] Example 1: Figure 1-3 As shown, a method for high-precision and fast calculation of frequency or speed is shown, the method is: a high-speed acquisition card acquires the secondary voltage signal of the power grid; the voltage signal is converted into a digital signal with high precision; the voltage signal is acquired by a high sampling rate from the converted signal; the voltage signal is judged point by point to obtain the sampling point positions corresponding to the first two thresholds; the frequency is calculated by the first two thresholds; the position of the next threshold sampling point is predicted by the frequency calculated by the first two sampling points; the threshold is judged within the confidence interval of the next threshold sampling point position to obtain the sampling point position corresponding to the actual threshold; and so on, the sampling points corresponding to all thresholds in the signal are obtained; the actual frequency or speed is obtained; the specific steps of the method are as follows:
[0052] A) Through the principle of electromagnetic induction, the primary voltage of the power grid is converted into a secondary voltage signal. The secondary voltage signal has the same frequency as the primary voltage signal, and its amplitude is proportional to the primary voltage. The data acquisition channel of the high-speed acquisition card is connected to the secondary voltage signal.
[0053] B) The secondary voltage signal is converted into a digital signal through analog-to-digital conversion by a high-speed data acquisition card; the signal sequence V after the secondary voltage signal is converted into a digital signal is expressed as:
[0054] V={v0,v1,v2,…,v n …,v x}
[0055] In the formula, v x is the last element in V;
[0056] C) converting the digital signal obtained in step B) through acquisition software, and reading the converted data into a data processing device;
[0057] D) Perform threshold judgment on the data read into the data processing device point by point until the sampling point positions corresponding to the two thresholds are found, and the interval between the two sampling points must be greater than the anti-disturbance coefficient; perform threshold judgment on the signal, and the process is as follows:
[0058] v i ≤U0
[0059] v i+1 ≥U0
[0060] Among them, i ranges from 0 to x-1. If the above formulas are all true, the first i that is true is recorded as i0, and the second i that is true is recorded as i1. When two values that meet the conditions are found, the calculation is stopped. U0 is the threshold; the interval between the two sampling points must be greater than the anti-disturbance coefficient. The process is as follows:
[0061] i1-i0≥r
[0062] In the formula, r is the anti-disturbance coefficient. If the above formula is not satisfied, the previous calculation process is repeated until two values that meet the conditions are found. The range of the anti-disturbance coefficient r is:
[0063] r = int[(0.1 / f)*s]
[0064] In the formula, r is an integer, f is the center frequency, and s is the sampling rate of the data acquisition card;
[0065] E) Predict the sampling point position corresponding to the next threshold value through the two sampling point positions found, and make a threshold judgment within the confidence interval, and find the sampling point position corresponding to the actual threshold value within the confidence interval; predict the next sampling point position corresponding to the threshold value through the two most recent sampling point positions found, and the process is as follows:
[0066] i n '=i n-1 +(i n-1 -i n-2 )
[0067] i n ' is the predicted position of the next sampling point corresponding to the threshold.
[0068] The threshold is judged within the confidence interval, and the sampling point position corresponding to the actual threshold is found within the confidence interval. The process is as follows:
[0069] Confidence Interval:
[0070] Z=[i' n -(i n-1 -i n-2 )·k,i' n +(i n-1 -i n-2 )·k]
[0071] z0=i' n -(i n-1 -i n-2 )·k
[0072] z1=i' n +(i n-1 -i n-2 )·k
[0073] Where k is the confidence coefficient, Z is denoted as [z0, z1], and the confidence coefficient k is 0.1-1, preferably 0.1;
[0074] Find the sampling point location corresponding to the actual threshold within the confidence interval. The process is as follows:
[0075] v m≤U0
[0076] V (m+1) ≥U0
[0077] mi (n-1) >r
[0078] m∈Z
[0079] In the formula, m ranges from z0 to z1. If the above formula holds, then i n =m;
[0080] F), repeat step E through the sampling point positions corresponding to the two most recent thresholds until all searches for the data read into the data processing device are completed, and all sampling point positions corresponding to the thresholds are obtained; the sampling point positions I corresponding to all sampling point positions corresponding to the thresholds are obtained as follows:
[0081] I={i0,i1,i2,…,i z}
[0082] In the formula, z is the subscript of the last element in the I sequence;
[0083] G) confirm the frequency through the sampling point position corresponding to the primary threshold;
[0084] The frequency is confirmed by the sampling point position corresponding to the primary threshold. The process is as follows:
[0085] T={(i1-i0)*Δt,(i2-i1)*Δt,…,(i z -i z-1 )*Δt}={t1,t2,…,t z}
[0086] F={1 / t1,1 / t2,…,1 / t z}={f1,f2,…,f z}
[0087] Where Δt is the time interval between two sampling points in the original signal sequence V, T is the period, F is the frequency or speed, and t z is the zth period of the calculated periodic sequence, f z is the zth frequency or speed of the calculated frequency or speed sequence.
[0088] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for high-precision and rapid calculation of frequency or rotational speed, characterized by: The method comprises the following steps: a high-speed acquisition card acquires a secondary voltage signal of a power grid; a high-precision analog-to-digital conversion is performed on the voltage signal; a voltage signal is acquired from the converted signal at a high sampling rate; the voltage signal is judged point by point to obtain the positions of the first two sampling points that meet a threshold judgment condition; a frequency is calculated based on the first two sampling points that meet the threshold judgment condition; the position of the next sampling point that meets the threshold judgment condition is predicted based on the frequency calculated from the first two sampling points; a threshold judgment is performed within a confidence interval of the position of the next sampling point that meets the threshold judgment condition to obtain the actual sampling point position that meets the threshold judgment condition; and so on and so forth, all sampling points in the signal that meet the threshold judgment condition are acquired; and the actual frequency or rotation speed is acquired. The specific steps of this method are as follows: A) Through the principle of electromagnetic induction, the primary voltage of the power grid is converted into a secondary voltage signal. The secondary voltage signal has the same frequency as the primary voltage signal, and its amplitude is proportional to the primary voltage. The data acquisition channel of the high-speed acquisition card is connected to the secondary voltage signal. B) The secondary voltage signal is converted into a digital signal through analog-to-digital conversion by a high-speed data acquisition card; C) converting the digital signal obtained in step B) through acquisition software and reading the converted data into a data processing device; D) Perform threshold judgment on the data read into the data processing device point by point until two sampling points that meet the threshold judgment conditions are found, and the interval between the two sampling points must be greater than the anti-disturbance coefficient r; E) predicting the next sampling point position that meets the threshold judgment condition based on the two sampling point positions found, performing threshold judgment within the confidence interval, and finding the actual sampling point position that meets the threshold judgment condition within the confidence interval; F) Repeat step E through the two most recent sampling point positions that meet the threshold judgment condition until all searches of the data read into the data processing device are completed and all sampling point positions that meet the threshold judgment condition are obtained; G) confirm the frequency by the position of a sampling point that meets the threshold judgment condition; The signal sequence V after the secondary voltage signal is converted into a digital signal in step B) is expressed as: V={v0,v1,v2,…,v n …,v x } Where, v x is the last element in V; In step D), the signal is subjected to threshold determination, and the process is as follows: in i ≤U0 in i+1 ≥U0 Where i ranges from 0 to x-1. If the above equations are all true, the first i that is true is recorded as i0, and the second that is true is recorded as i1. When two values that meet the conditions are found, the calculation stops, and U0 is the threshold; In step D), the interval between the two sampling points must be greater than the anti-disturbance coefficient. The process is as follows: i1-i0≥r Where r is the anti-disturbance coefficient. If the above formula is not satisfied, the previous calculation process is repeated until two values that meet the conditions are found. The range of the anti-disturbance coefficient r is: r=int[(0.1 / f)*s] Where r is an integer, f is the center frequency, and s is the sampling rate of the data acquisition card; In step E), the next sampling point position that meets the threshold judgment condition is predicted by finding the positions of the two most recent sampling points. The process is as follows: i’ n =i n-1 +(i n-1 -i n-2 ) i' n is the predicted position of the next sampling point corresponding to the threshold; In step E), a threshold judgment is performed within the confidence interval, and the actual sampling point position that meets the threshold judgment condition is found within the confidence interval. The process is as follows: Confidence Interval: Z=[i' n -(i n-1 -i n-2 )·k,i' n +(i n-1 -i n-2 )·k] z0=i' n -(i n-1 -i n-2 )·k z1=i' n +(i n-1 -i n-2 )·k In the formula, k is the confidence coefficient, Z is recorded as [z0, z1], and the confidence coefficient k ranges from 0 to 1; In step E), the actual sampling point position that meets the threshold judgment condition is found within the confidence interval, and the process is as follows: in m ≤U0 In (m+1) ≥U0 m-i (n-1) >r m∈Z In the formula, m is from z0 to z1. If the above formula is established, then i n =m; In step F), step E is repeated using the two most recent sampling point positions that meet the threshold judgment condition until all searches of the data read into the data processing device are completed, and all sampling point positions that meet the threshold judgment condition are obtained. The corresponding sampling point positions I are as follows: I={i0,i1,i2,…,i z } Where z is the subscript of the last element in the I sequence; In step G), the frequency is confirmed by the position of a sampling point that meets the threshold judgment condition. The process is as follows: T={(i1-i0)*Δt,(i2-i1)*Δt,…,(i z -i z-1 )*Δt}={t1,t2,…,t z } F={1 / t1,1 / t2,…,1 / t z }={f1,f2,…,f z } Where Δt is the time interval between two sampling points in the original signal sequence V, T is the period, F is the frequency or speed, and t z is the zth period of the calculated periodic sequence, f z is the zth frequency or speed in the calculated frequency or speed sequence.
