Power grid phase difference detection method and system
Technical Field
The invention relates to the technical field of power grid connection management, in particular to a power grid phase difference detection method and system.
Background
In a conventional power system, the connection relationship of power supply lines is generally adjusted according to the load situation. Taking a 35kV grid as an example, the grid can be obtained by a 220kV line or a 110kV line through a step-down transformer. In a practical power grid, a star connection is generally adopted for transformers on the 220kV side, and an angle connection is mainly adopted for transformers on the 110kV side and the 35kV side. This results in a voltage phase difference between a 35kV line obtained from 220kV grid step down and a 35kV line obtained from 110kV grid step down. If the phase difference is too large, the operations of grid connection, loop closing and the like cannot be performed, otherwise huge fault current can be generated, the power grid equipment is damaged, and the power system is in fault.
The existing phase difference detection method adopts a scheme of hardware zero crossing point detection as shown in fig. 1: the respective zero crossing time of the two sine waves is detected firstly, and then the difference is made to obtain the phase difference. For example, a sine wave is compared with a zero voltage by using a comparator, and a zero crossing point is obtained according to the turning time of an output signal of the comparator. But schemes based on zero crossing detection are susceptible to interference from factors such as electromagnetic and signal distortion. How to overcome the interference of factors such as electromagnetism and signal distortion in the phase difference detection process and improve the accuracy of phase difference detection becomes a technical problem to be solved urgently.
Disclosure of Invention
The invention aims to provide a power grid phase difference detection method and a power grid phase difference detection system, so as to overcome the interference of factors such as electromagnetism and signal distortion in the phase difference detection process and improve the phase difference detection precision.
In order to achieve the purpose, the invention provides the following scheme:
a power grid phase difference detection method comprises the following steps:
respectively obtaining the voltage values of a first power grid and a second power grid at the current sampling moment and n-1 historical sampling moments before the current sampling moment to obtain a voltage time sequence of the first power grid and a voltage time sequence of the second power grid, and respectively storing the voltage time sequence of the first power grid and the voltage time sequence of the second power grid into a first array and a second array;
the phase of the voltage time sequence of the second power grid is shifted forwards by 90 degrees, and the voltage time sequence of the second power grid after phase shifting is stored in a third array;
multiplying the first n-m elements in the first array and the first n-m elements in the second array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a first calculation result; the first calculation result is S times of a cosine value of a phase difference between the first power grid and the second power grid, and m represents the number of sampling moments corresponding to a phase interval of 0-90 degrees of the first power grid or the second power grid;
multiplying the first n-m elements in the first array and the n-m elements in the third array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a second calculation result; the second calculation result is S times of the sine value of the phase difference between the first power grid and the second power grid;
and calculating the phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result.
Optionally, the phase of the voltage time series of the second power grid is shifted forward by 90 degrees, and the voltage time series of the second power grid after the phase shift is stored in the third array, which specifically includes:
and storing the last n-m elements in the second array into a third array.
Optionally, the calculating a phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result specifically includes:
and calculating an arc tangent value of a ratio of the first calculation result to the second calculation result as a phase difference between the first power grid and the second power grid.
Optionally, the calculating a phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result, and then further includes:
judging whether the phase difference is smaller than a potential difference threshold value or not to obtain a judgment result;
if the judgment result shows that the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment are acquired, and the first array and the second array are updated by using the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment; returning to the step of shifting the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase shifting into a third array;
and if the judgment result shows that the first power grid and the second power grid are not connected in parallel, stopping the grid connection and loop closing of the first power grid and the second power grid.
Optionally, the updating the first array and the second array by using the voltage value of the first power grid and the voltage value of the second power grid at the next sampling time specifically includes:
respectively removing the last element of the first array and the second array;
respectively shifting the first n-1 elements of the first array and the second array backwards by one element;
and respectively taking the voltage value of the first power grid and the voltage value of the second power grid acquired at the next sampling moment as first elements of the first array and the second array.
A grid phase difference detection system, the detection system comprising:
the data acquisition module is used for respectively acquiring the voltage values of the first power grid and the second power grid at the current sampling moment and n-1 historical sampling moments before the current sampling moment to obtain a voltage time sequence of the first power grid and a voltage time sequence of the second power grid, and respectively storing the voltage time sequence of the first power grid and the voltage time sequence of the second power grid into the first array and the second array;
the phase translation module is used for translating the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase translation into a third array;
the first calculation module is used for multiplying the first n-m elements in the first array and the first n-m elements in the second array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a first calculation result; the first calculation result is S times of a cosine value of a phase difference between the first power grid and the second power grid, and m represents the number of sampling moments corresponding to a phase interval of 0-90 degrees of the first power grid or the second power grid;
the second calculation module is used for multiplying the first n-m elements in the first array and the n-m elements in the third array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a second calculation result; the second calculation result is S times of the sine value of the phase difference between the first power grid and the second power grid;
and the phase difference calculation module is used for calculating the phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result.
Optionally, the phase shift module specifically includes:
and the phase shifting submodule is used for storing the last n-m elements in the second array into the third array.
Optionally, the phase difference calculating module specifically includes:
and the phase difference calculation submodule is used for calculating an arc tangent value of a ratio of the first calculation result to the second calculation result, and the arc tangent value is used as the phase difference of the first power grid and the second power grid.
Optionally, the detection system includes:
the judging module is used for judging whether the phase difference is smaller than a potential difference threshold value to obtain a judgment result;
the array updating module is used for waiting for acquiring the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment and updating the first array and the second array by using the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment if the judgment result shows that the first array and the second array are the same; returning to the step of shifting the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase shifting into a third array;
and the grid connection and loop closing stopping module is used for stopping the grid connection and loop closing of the first power grid and the second power grid if the judgment result shows that the first power grid and the second power grid are not connected.
Optionally, the array updating module specifically includes:
the first array updating submodule is used for respectively removing the last element of the first array and the last element of the second array;
the second array updating submodule is used for respectively shifting the first n-1 elements of the first array and the second array backwards by one element;
and the third array updating submodule is used for respectively taking the voltage value of the first power grid and the voltage value of the second power grid acquired at the next sampling moment as the first elements of the first array and the second array.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a power grid phase difference detection method and a system, wherein the detection method comprises the steps of firstly, respectively obtaining the voltage values of a first power grid and the voltage values of a second power grid at the current sampling moment and n-1 historical sampling moments before the current sampling moment to obtain the voltage time sequence of the first power grid and the voltage time sequence of the second power grid, and respectively storing the voltage time sequences into a first array and a second array; the phase of the voltage time sequence of the second power grid is shifted forwards by 90 degrees, and the voltage time sequence of the second power grid after phase shifting is stored in a third array; then, multiplying the first n-m elements in the first array and the first n-m elements in the second array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a first calculation result; multiplying the first n-m elements in the first array and the n-m elements in the third array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a second calculation result; and calculating the phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result. According to the detection method, historical data are used, the phase difference between the first power grid and the second power grid is calculated based on a calculus principle (namely the first calculation result is S times of a cosine value of the phase difference between the first power grid and the second power grid, and the second calculation result is a conclusion that the S times of the sine value of the phase difference between the first power grid and the second power grid is calculated based on the calculus principle).
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a hardware zero-crossing point detection system in the prior art provided by the present invention;
fig. 2 is a flowchart of a power grid phase difference detection method provided by the present invention;
fig. 3 is a hardware structure diagram of a power grid phase difference detection method and system according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure based on which a power grid phase difference detection method and system according to an embodiment of the present invention are provided;
fig. 5 is a flowchart of a program of a single chip microcomputer in a hardware structure according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a power grid phase difference detection method according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a power grid phase difference detection method and a power grid phase difference detection system, so as to overcome the interference of factors such as electromagnetism and signal distortion in the phase difference detection process and improve the phase difference detection precision.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
As shown in fig. 2, the present invention provides a method for detecting a phase difference of a power grid, where the method includes the following steps:
step 201, respectively obtaining a voltage value of a first power grid and a voltage value of a second power grid at a current sampling time and n-1 historical sampling times before the current sampling time to obtain a voltage time sequence of the first power grid and a voltage time sequence of the second power grid, and respectively storing the voltage time sequence of the first power grid and the voltage time sequence of the second power grid into a first array and a second array.
Step 202, shifting the phase of the voltage time sequence of the second power grid by 90 degrees forwards, and storing the voltage time sequence of the second power grid after phase shifting into a third array; the method specifically comprises the following steps: and storing the last n-m elements in the second array into a third array.
Step 203, multiplying the first n-m elements in the first array and the first n-m elements in the second array in a one-to-one correspondence manner respectively, and adding the obtained products to obtain a first calculation result; the first calculation result is S times of a cosine value of a phase difference between the first power grid and the second power grid, and m represents the number of sampling moments corresponding to a phase interval of 0 to 90 degrees of the first power grid or the second power grid.
Step 204, multiplying the first n-m elements in the first array and the n-m elements in the third array in a one-to-one correspondence manner respectively, and adding the obtained products to obtain a second calculation result; the second calculation result is S times of a sine value of a phase difference between the first power grid and the second power grid.
Step 205, calculating a phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result; the method specifically comprises the following steps: and calculating an arc tangent value of a ratio of the first calculation result to the second calculation result as a phase difference between the first power grid and the second power grid.
Step 205, calculating a phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result, and then further includes: judging whether the phase difference is smaller than a potential difference threshold value or not to obtain a judgment result; if the judgment result shows that the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment are acquired, and the first array and the second array are updated by using the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment; returning to the step of shifting the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase shifting into a third array; and if the judgment result shows that the first power grid and the second power grid are not connected in parallel, stopping the grid connection and loop closing of the first power grid and the second power grid.
The method includes the steps that the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment are used for updating the first array and the second array, and specifically includes the following steps: respectively removing the last element of the first array and the second array; respectively shifting the first n-1 elements of the first array and the second array backwards by one element; and respectively taking the voltage value of the first power grid and the voltage value of the second power grid acquired at the next sampling moment as first elements of the first array and the second array.
The invention also provides a power grid phase difference detection system, which comprises:
the data acquisition module is used for respectively acquiring the voltage values of the first power grid and the second power grid at the current sampling moment and n-1 historical sampling moments before the current sampling moment to obtain a voltage time sequence of the first power grid and a voltage time sequence of the second power grid, and respectively storing the voltage time sequence of the first power grid and the voltage time sequence of the second power grid into the first array and the second array;
the phase translation module is used for translating the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase translation into a third array; the phase shift module specifically includes: and the phase shifting submodule is used for storing the last n-m elements in the second array into the third array.
The first calculation module is used for multiplying the first n-m elements in the first array and the first n-m elements in the second array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a first calculation result; the first calculation result is S times of a cosine value of a phase difference between the first power grid and the second power grid, and m represents the number of sampling moments corresponding to a phase interval of 0 to 90 degrees of the first power grid or the second power grid.
The second calculation module is used for multiplying the first n-m elements in the first array and the n-m elements in the third array in a one-to-one correspondence mode respectively, and adding the obtained products to obtain a second calculation result; the second calculation result is S times of a sine value of a phase difference between the first power grid and the second power grid.
And the phase difference calculation module is used for calculating the phase difference between the first power grid and the second power grid according to the first calculation result and the second calculation result. The phase difference calculation module specifically includes: and the phase difference calculation submodule is used for calculating an arc tangent value of a ratio of the first calculation result to the second calculation result, and the arc tangent value is used as the phase difference of the first power grid and the second power grid.
The detection system comprises: the judging module is used for judging whether the phase difference is smaller than a potential difference threshold value to obtain a judgment result; the array updating module is used for waiting for acquiring the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment and updating the first array and the second array by using the voltage value of the first power grid and the voltage value of the second power grid at the next sampling moment if the judgment result shows that the first array and the second array are the same; returning to the step of shifting the phase of the voltage time sequence of the second power grid by 90 degrees forwards and storing the voltage time sequence of the second power grid after phase shifting into a third array; and the grid connection and loop closing stopping module is used for stopping the grid connection and loop closing of the first power grid and the second power grid if the judgment result shows that the first power grid and the second power grid are not connected.
The array updating module specifically includes: the first array updating submodule is used for respectively removing the last element of the first array and the last element of the second array; the second array updating submodule is used for respectively shifting the first n-1 elements of the first array and the second array backwards by one element; and the third array updating submodule is used for respectively taking the voltage value of the first power grid and the voltage value of the second power grid acquired at the next sampling moment as the first elements of the first array and the second array.
The invention also provides a specific embodiment.
According to the embodiment of the invention, a 35kV power grid generated by 220kV voltage reduction is used as a first power grid, and a 35kV power grid generated by 110kV voltage reduction is used as a second power grid. The hardware configuration of the present embodiment is shown in fig. 3, and the schematic diagram of the hardware configuration is shown in fig. 4.
As shown in fig. 3 and 4, the hardware structure is composed of a voltage acquisition part and a phase difference calculation part, wherein the voltage acquisition part can adopt elements such as a voltage sensor, a mutual inductor and the like to convert the voltage of the power grid into digital quantity; the phase difference calculating part calculates the phase difference according to the voltage digital quantity.
The phase difference calculating part of the hardware structure provided by the invention can be realized by a singlechip, a digital control chip or a computer. Taking the use of a single chip microcomputer as an example, the program flow is shown in fig. 5.
As shown in fig. 6, the phase difference calculation section of the present invention specifically performs the phase difference calculation by:
step 1: the power grid voltage collected from a 35kV power grid generated by 220kV voltage reduction is represented by U1 and stored in an array S1 containing 1050 elements, the elements are S1[0] to S1[1049], respectively, S1[0] is the latest obtained data, and the data of S1 is the power grid voltage values obtained at different times, which is a discrete sine wave.
Step 2: the power grid voltage collected from a 35kV power grid generated by 110kV voltage reduction is represented by U2 and stored in an array S2 containing 1050 elements, the elements are S2[0] to S2[1049], respectively, S2[0] is the latest obtained data, and the data of S2 is the power grid voltage values obtained at different times, which is a discrete sine wave.
And step 3: the phase shift is carried out on the power grid voltage acquired from a 35kV power grid generated by 110kV voltage reduction, namely elements S2[50] to S2[1049] in an array S2 are stored in an array S3 with the capacity of 1000, wherein the elements are S3[0] to S3[999 ].
And 4, step 4: the elements S1[0] to S1[999] in the array S1 are multiplied by the elements S2[0] to S2[999] in the array S2, respectively, and the products are added to obtain voltage data A.
And 5: the elements S1[0] to S1[999] in the array S1 are multiplied by the elements S3[0] to S3[999] in the array S3, respectively, and the products are added to obtain voltage data B.
Step 6: the phase difference X is obtained by taking the arctan of the ratio of data B to data a, i.e., X ═ tg-1(B/A);
And 7: the voltage data in array S1 is sorted such that the values (i.e., voltage values) of elements S [1049] to S [1] are replaced by the values (i.e., voltage values) of elements S [1048] to S [0], respectively.
And 8: the data in array S1 is collated and the values (i.e., voltage values) of elements S [1049] to S [1] are replaced by the values (i.e., voltage values) of elements S [1048] to S [0], respectively.
And step 9: after waiting for 0.1ms, the next voltage value is obtained from step 1.
Compared with the prior art, the invention has the beneficial effects that:
(1) the power grid phase difference detection method is based on historical data, and detection errors caused by voltage and frequency fluctuation and other problems of a conventional hardware circuit can be effectively avoided.
(2) The power grid phase difference detection method only needs multiple times of multiplication and addition operation, the calculation amount of the algorithm is small, and the detection precision can be further improved by increasing the capacity of the array.
The equivalent embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts between the equivalent embodiments can be referred to each other.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In summary, this summary should not be construed to limit the present invention.