Microgrid protection method based on voltage waveform comparison of improved cosine similarity algorithm and related device
By improving the cosine similarity algorithm and EDR algorithm to process the microgrid voltage waveform, the accuracy and adaptability problems of microgrid protection in different operating modes are solved, and efficient fault judgment in grid-connected and off-grid modes is achieved.
Patent Information
- Application Number
- CN202510462906.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-09-12
AI Technical Summary
The fault characteristics of microgrid protection methods vary greatly between grid-connected and off-grid operation modes. Traditional protection methods cannot guarantee measurement accuracy and adaptability, and have high communication requirements, making it difficult to accurately determine the fault location.
An improved cosine similarity algorithm is used to obtain the measured voltage and reference voltage, and the amplitude and phase differences are eliminated. The EDR algorithm is used to distort the phase difference of the aligned signals, and the cosine similarity is calculated to determine the fault area. The protection criterion is set to 0.7 to distinguish between internal and external faults.
The adaptability of protection methods in grid-connected and off-grid modes is achieved, the accuracy and reliability of fault diagnosis are improved, the dependence on communication is reduced, and the possibility of protection misoperation or refusal to operate is reduced.
Smart Images

Figure CN120638255A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a microgrid protection method. Background Art
[0002] This section merely provides background information related to the present disclosure and is not necessarily prior art.
[0003] Unlike traditional single-power distribution networks, the internal power flow of microgrids is highly random. The distributed power sources of microgrids are generally wind turbines or photovoltaic power sources that are greatly affected by external factors. The randomness of the output of these micro-sources means that when a microgrid fault occurs, it is no longer a simple one-way power flow, and may even leave a reverse current. When the microgrid is connected to the grid, it is similar to the distribution network, but in the off-grid state it is only powered by distributed power sources, and the fault current is very small. Therefore, the fault characteristics of the microgrid in the two operating modes of grid connection and off-grid are quite different. The inventors have found that the current protection of microgrids still has the following problems: considering that the microgrid lines are relatively short, the accuracy of impedance measurement cannot be guaranteed when performing distance protection; traditional longitudinal differential protection has high communication requirements; when switching back and forth between grid connection and off-grid, the fault current size varies significantly, which is not conducive to the determination of the setting value in adaptive protection. Summary of the Invention
[0004] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm.
[0005] To achieve the above objectives, the present invention provides a microgrid protection method for voltage waveform comparison based on an improved cosine similarity algorithm, comprising:
[0006] Get measured voltage: Get the measured voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t i The measured voltage at the measuring point on the M side at the moment, u N (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length;
[0007] Calculate the reference voltage: Based on the measured voltage u at the M-side measurement point M (ti ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN ;The reference point is outside the protected line;
[0008] Fault location on the M side: Measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault.
[0009] N-side fault area location: Measure the voltage waveform u on the N-side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault.
[0010] Longitudinal protection: When the M side is judged to have an internal fault and the N side is judged to have an internal fault, the protection action is executed.
[0011] The distance between the reference point and its corresponding measuring point is 1.2±0.05 times the total length of the protected line.
[0012] The reference voltage u of the reference point on the M side RM (t i ) and the reference voltage u of the N-side reference point RN (t i ) is calculated as follows:
[0013]
[0014] Among them, uM (t i ),u N (t i ) are the measured voltages of the measuring points on the M side and the N side, i M (t i ),i N (t i ) are the measured currents at the measuring points on the M side and the N side respectively, R is the resistance of the protected line, and L is the inductance of the protected line.
[0015] The amplitude and phase difference elimination process is to use normalization to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference. Specifically, the measured voltage waveform u and the reference voltage waveform u are R After normalization, the signal is reconstructed into a measured voltage sequence u 1 , reference voltage sequence u 1 R ; With the normalized reference voltage sequence u 1 R To align the standard, the EDR algorithm is used to eliminate the phase difference between the measured voltage and the reference voltage to obtain the measured voltage sequence u after EDR transformation. 2 .
[0016] Calculate u 2 and u 1 R The cosine similarity method is:
[0017] The protection criterion is set to 0.7; when the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
[0018] The present invention also provides a microgrid protection device for voltage waveform comparison based on an improved cosine similarity algorithm, comprising:
[0019] The measurement voltage acquisition module is used to obtain the measurement voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t iThe measured voltage at the measuring point on the M side at the moment, u N (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length;
[0020] Reference voltage calculation module, used to obtain the measured voltage u of the M side measurement point M (t i ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN ;The reference point is outside the protected line;
[0021] M side fault area positioning module, used to measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault.
[0022] N-side fault area positioning module, used to measure the voltage waveform u on the N side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault.
[0023] The longitudinal protection module is used to execute protection action when the M side is judged to have an internal fault and the N side is judged to have an internal fault.
[0024] The reference voltage of the reference point on the M side is
[0025] The reference voltage of the N-side reference point is
[0026] Among them, u M (t i ),u N (t i ) are the measured voltages of the measuring points on the M side and the N side, i M (t i ),i N (t i ) are the measured currents at the measuring points on the M side and the N side respectively, R is the resistance of the protected line, and L is the inductance of the protected line.
[0027] The amplitude and phase difference elimination process is to use normalization to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference. Specifically, the measured voltage waveform u and the reference voltage waveform u are R After normalization, the signal is reconstructed into a measured voltage sequence u 1 , reference voltage sequence u 1 R ; With the normalized reference voltage sequence u 1 R To align the standard, the EDR algorithm is used to eliminate the phase difference between the measured voltage and the reference voltage to obtain the measured voltage sequence u after EDR transformation. 2 .
[0028] u 2 and u 1 R The cosine similarity is:
[0029] The protection criterion is set to 0.7; when the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
[0030] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the microgrid protection method for voltage waveform comparison based on the improved cosine similarity algorithm as described in the first aspect is implemented.
[0031] Another aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the microgrid protection method for voltage waveform comparison based on the improved cosine similarity algorithm as described in the first aspect is implemented.
[0032] Compared with the prior art, the beneficial effects of the present invention are: 1) The protection method proposed in the present invention can be applied to both grid-connected and islanded operation modes without any modification to the method. 2) When calculating waveform similarity, the present invention can overcome the influence of phase difference, improve the accuracy of protection, and prevent protection failure or malfunction. 3) Compared with traditional current protection and differential protection, the degree of dependence on current information is reduced, and the communication requirements are not high. It only needs to longitudinally compare the detection results of the opposite end of the line to determine the fault location. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Flowchart of this method.
[0034] Figure 2 Schematic diagram of RL type circuit model.
[0035] Figure 3 It is the network model of the electrical quantities of the protected lines and ports.
[0036] Figure 4 Flowchart of the improved waveform similarity judgment method.
[0037] Figure 5 This is a simple fault diagram.
[0038] Figure 6 It is a 10kV medium voltage AC microgrid simulation model.
[0039] Figure 7 When 0.6069 is corrected to 0.9073, the phase difference effect is overcome.
[0040] Figure 8 When 0.697 is corrected to 0.9237, the phase difference effect is overcome.
[0041] Figure 9 This is the waveform diagram of the measured voltage and reference voltage of the out-of-zone line.
[0042] Figure 10 The waveform diagram of the measured voltage and reference voltage of the lines in the area.
[0043] Figure 11 When the value is changed from 0.6423 to 0.9331, the phase difference effect is overcome.
[0044] Figure 12 When the value is changed from 0.7542 to 0.9177, the phase difference effect is overcome.
[0045] Figure 13 This is the waveform diagram of the measured voltage and reference voltage of the out-of-zone line.
[0046] Figure 14The waveform diagram of the measured voltage and reference voltage of the lines in the area. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without carrying out creative work are within the scope of protection of the present invention.
[0048] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0049] The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm provided by the present invention comprises the following steps:
[0050] Get measured voltage: Get the measured voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t i The measured voltage at the measuring point on the M side at the moment, u N (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length;
[0051] Calculate the reference voltage: Based on the measured voltage u at the M-side measurement point M (t i ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN;The reference point is outside the protected line;
[0052] Fault location on the M side: Measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault.
[0053] N-side fault area location: Measure the voltage waveform u on the N-side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault.
[0054] Longitudinal protection: When the M side is judged to have an internal fault and the N side is judged to have an internal fault, the protection action is executed.
[0055] like Figure 1 As shown, the concept of the present invention is to define a two-port model. Port one is called the measurement point, where the electrical quantities are recorded as measured voltage and measured current. Port two is called the reference point, where the electrical quantities are calculated using custom mathematical expressions (different line parameter models correspond to different expressions). To ensure the reliability and sensitivity of the protection, the reference point is set outside the protected line. However, a location too far away will affect the protection accuracy. Taking into account factors such as errors, the reference point is set at a position 1.2 times the total length of the line. After obtaining the two sets of voltage signal waveforms, data processing is performed. First, the voltage signals are normalized to eliminate amplitude differences. Then, signals with large phase differences are warped and aligned using the EDR algorithm to eliminate phase differences. The cosine similarity of the processed signals is calculated. Based on whether the waveform similarity between the measured voltage and the reference voltage meets the protection threshold, the protection judgment result is first given at the local end. The judgment results obtained at the beginning and end of the line are then exchanged to the opposite end line for longitudinal comparison. If the calculated similarity results at both ends of the line are less than the set threshold, it is determined that the fault has occurred within the area and the protection is reliably activated. Otherwise, it is considered that the fault has occurred outside the area or the line is operating normally.
[0056] Calculate the reference voltage, including:
[0057] Establish a two-port network. According to the basic principle of circuit, when the system is operating normally, the voltage and current at any set reference point R can be calculated based on the voltage and current at the measurement point. Taking the RL model as an example, the measured voltage at the measurement point on the M side and the N side is recorded as u M (t i ),u N (t i ), the measured current is recorded as i M (t i ),i N (t i ), R is the resistance of the protected circuit, L is the
[0058] The inductor, through the differential equation to calculate the corresponding custom reference point voltage:
[0059] Reference voltage of the reference point on the M side
[0060] Reference voltage of N-side reference point
[0061] In microgrids, distributed power sources (DGs) vary widely, each employing different control strategies and exhibiting significantly different fault output characteristics. However, if one focuses solely on the electrical quantities at the protected port, once the line model is determined, the mathematical relationships between these quantities are also defined. Thus, a unique correspondence exists between port voltage and port current, unaffected by the influence of different DGs.
[0062] Commonly used line models include RL type model and π type model in the concentrated parameter model and distributed parameter model. Figure 3 , the two-port network of RL circuit model is taken as an example for analysis.
[0063] The measured voltage is recorded as u m , the reference voltage is denoted as u R .
[0064] Mathematical equation expression of two-port electrical quantity:
[0065]
[0066] In the above formula, R is the resistance of the protected circuit, and L is the inductance of the protected circuit.
[0067] Select the protected line to construct a dual-port model.
[0068] Define the head end of the protected line as the measuring point, 1.2 times the line as the reference point, and measure the voltage u at the known measuring point mand the measured current i m The instantaneous sampling value of the reference voltage u at the reference point R is calculated according to the mathematical differential equation R .
[0069]
[0070] (1) When the line operates normally, the protected line model is intact and the measured voltage and reference voltage waveforms are similar.
[0071] (2) When a fault occurs outside the forward zone,
[0072] Measuring voltage:
[0073]
[0074] Reference voltage:
[0075]
[0076] R k and L k Represent the impedance between the measurement point and the fault point, R R and L R Represent the impedance between the measurement point and the reference point respectively.
[0077] At this time, the measured voltage and reference voltage waveforms also appear similar.
[0078] (3) When a fault occurs outside the reverse zone,
[0079] Measuring voltage:
[0080]
[0081] Reference voltage:
[0082]
[0083] At this time, the measured voltage and reference voltage waveforms also appear similar.
[0084] (4) When an internal fault occurs, the protected object is destroyed and the line model is no longer complete. The expression of the reference voltage is rewritten as:
[0085]
[0086] The measured voltage obtained at this time has a waveform change trend opposite to that of the reference voltage.
[0087] It can be seen that when the fault is outside the zone or the line is in normal operation, regardless of the amplitude difference, the two voltage waveforms are similar; when the fault is inside the zone, regardless of the amplitude difference, the two voltage waveforms are not similar and have opposite trends.
[0088] Based on the above principle, by selecting a waveform comparison method that can measure the similarity of the two voltages, an accurate fault judgment can be made.
[0089] Ideally, when the line is operating normally or an out-of-zone fault occurs, the waveform change trends of the measured voltage and the reference voltage are the same. If the waveform similarity is calculated using cosine similarity, it should be close to 1; when an in-zone fault occurs, the waveform similarity should be close to -1.
[0090] However, considering the large number of new energy distributed power sources put into use in microgrids and the increasing proportion of new loads, the volatility of the power grid has increased, and the fault characteristics have become complex and diverse. The support capacity and anti-disturbance capability of the new "dual-high" power system have declined.
[0091] Connecting a high proportion of renewable energy to the grid via new power electronic converters has become a key trend in the development of new power systems. This undoubtedly poses greater challenges to the safe and stable operation of power systems. Distributed power sources primarily rely on power electronic converters, which employ a variety of control strategies. Converter control methods can be broadly categorized into two types based on synchronization: grid-following control and grid-forming control. Root-grid control relies heavily on the grid for frequency regulation, making it suitable only for microgrid-connected operation and lacking sufficient frequency support capabilities. Grid-forming converters can operate both in microgrid-connected mode and in islanded mode, ensuring frequency stability.
[0092] The use of inverters with various control strategies has resulted in a variety of output characteristics after grid faults, which has also put forward higher requirements for protection, and traditional protection methods are unable to cope with it.
[0093] If the actual line contains capacitance to ground or includes reactive power compensation or capacitive load, there will be a certain phase difference between the measured voltage at the same port of the line and the calculated reference voltage.
[0094] In the isolated operation mode of the microgrid, due to the lack of support from a large power source, it is only powered by the distributed power supply within the microgrid, which will also lead to a large phase difference.
[0095] In addition, adverse factors such as measurement errors and noise will also cause phase differences in the waveform.
[0096] Ideally, when the waveforms are changing in the same direction, the phase difference between the two waveforms should be close to 0 degrees, assuming the phase difference fluctuates between -90 and 90 degrees. When the waveforms are changing in opposite directions, the phase difference between the two waveforms should be close to 180 degrees, assuming the phase difference fluctuates between -90 + Π and 90 + Π. Therefore, protection criteria should have a certain margin.
[0097] Considering that microgrids operate in both grid-connected and islanded modes, and that their internal inverters employ various control strategies, the impact on electrical quantities is significant when a line fault occurs within the grid. This technology appropriately increases the protection threshold for intra-grid faults. The protection criterion should include a margin. Taking all of the above factors into consideration and retaining a margin, the protection criterion is set to 0.7, i.e., cos<0.7.
[0098] When the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
[0099] The above analysis shows that waveform phase differences affect protection criteria, necessitating twist alignment of waveform signals with phase differences. EDR compares the similarity between two signal sequences of different lengths. This technology uses the EDR algorithm to correct waveform phase differences before performing a cosine similarity comparison to resolve signal time asynchrony.
[0100] Common methods for measuring time series similarity include model-based, shape-based, and data compression-based similarity metrics. These methods generally define a distance function and calculate the distance between sequences. The smaller the distance, the higher the similarity.
[0101] The EDR algorithm is an extension of the ED algorithm. The edit distance (ED) is the minimum number of transformations required to align two strings. This is mapped to the desired time signal sequence, that is, the target signal is converted into a string, and a custom distance function is used to determine the similarity of the strings (i.e., the time signal sequence).
[0102] The EDR algorithm is an algorithm that measures the similarity of time series signals based on edit distance. It uses point fuzzy matching to perform trajectory matching and belongs to a type of shape-based measurement method. The similarity distance of sequence signals is defined as the minimum number of operations required to convert one set of sequences into another. The error accuracy can be customized, that is, a threshold limit is set. Within the defined error range, the two sets of signal trajectories are considered similar. Advantages: The algorithm itself can effectively reduce the noise of the signal, uniformly quantize the signal elements to 0 or 1, and avoid the influence of noise on the distance calculation, so it is insensitive to errors; the algorithm can process signal sequences of inconsistent lengths and solve the problem of time synchronization; the algorithm has good robustness against abnormal data. Disadvantages: Triangle inequality is not supported.
[0103] The above analysis shows that a large protection margin is retained for intra-zone faults, allowing identification of intra-zone faults despite the complex fault characteristics of the microgrid. This improves protection accuracy and reliability compared to other microgrid protection methods. However, for extra-zone faults, when there is a large phase difference, there may be ambiguity near the boundary value of 0.7, affecting the judgment result and potentially leading to refusal or false operation. To improve protection accuracy, this technology first performs warp alignment on the signal to eliminate phase differences. By specifying the tolerance parameter range of the EDR algorithm, a cosine similarity comparison is then performed on the corrected signals.
[0104] The amplitude and phase difference elimination process is to use normalization processing to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference.
[0105] (1) Data preprocessing: normalization
[0106] The waveforms u of the two sets of voltage signals (measured voltage and reference voltage) obtained are M (t i ),u RM (t i ) first perform normalization processing and reconstruct the signal into and
[0107] When the line length is too long, the amplitude of the measured voltage and the reference voltage can differ significantly. To address this issue, the EDR algorithm is affected by amplitude differences, and cosine similarity measures the trend rather than the amplitude of the signal. This technology first normalizes the signal waveform to eliminate the influence of amplitude. Normalization involves converting data to a fixed range; this technology sets the normalization range to [-1, 1].
[0108] The measured voltage u M (t i ) and reference voltage u RM (t i ) After the signal is normalized, the normalized signal is recorded as and
[0109] (2) The EDR algorithm distorts and aligns signals with large phase differences
[0110] The normalized reference voltage In order to align the standard (i.e., to eliminate the phase difference between the measured voltage and the reference voltage by taking the reference voltage as the reference), the measured voltage sequence is calibrated by the EDR algorithm. Delete, insert, replace, and turn into a sequence Denote as the measured voltage sequence after EDR transformation. The minimum number of operations among these operations is the edit distance. The mth element in The cumulative distance before the nth element is recorded as d EDR .
[0111]
[0112] EDR sets the matching distance threshold to match two different signals with lengths of m and n. and Alignment is performed, and the calculated EDR distance represents the number of insertion, deletion, and replacement operations required to modify from A to B, thereby solving data asynchrony, that is, eliminating phase difference.
[0113] Sequence As the alignment standard, the sequence Do the following:
[0114] a) Delete. Delete An element in d EDR Adding one to (m-1,n) indicates that an operation has been performed.
[0115] b) Insert. Insert an element in d EDR Adding one to (m,n-1) indicates that an operation has been performed.
[0116] c) Replacement. If the difference in the modulus values of the two signals is less than or equal to the set threshold, the two signals are considered similar and no further operation is performed. The existing edit distance remains unchanged. If the difference is greater than the set threshold, the signal is replaced.
[0117] d EDR Adding one to (m-1,n-1) indicates that an operation has been performed.
[0118] These three operations and The constructed cost matrix reflects vertical movement, horizontal movement and diagonal movement when selecting a path.
[0119] The essence of the EDR algorithm is to find the optimal path from D(1,1) to D(m,n) in the cost matrix according to the set operation rules, transforming it into a local cumulative optimization problem. The optimization process is subject to the following constraints: a) Path boundary constraint. The path to find the minimum distance must start from D(1,1) and end at D(m,n). b) Monotonicity constraint. The algorithm's cumulative distance value is monotonically non-decreasing, avoiding the inclusion of return paths in the path and thus ensuring the order of elements in the signal matching path.
[0120] After this series of operations, the phase difference between the measured voltage and the reference voltage can be eliminated. In actual use, you can use the algorithm that comes with EDR and import it using MATLAB code.
[0121] u 2 M and,u 1 RM The cosine similarity is:
[0122] u 2 N and u 1 RN The cosine similarity is:
[0123] If the cosine similarity method is used to determine the similarity between the measured voltage and the reference voltage, ideally, when the line is operating normally or an out-of-zone fault occurs, the waveform similarity should be close to 1; when an in-zone fault occurs, the waveform similarity should be close to -1.
[0124] like Figure 4 As shown, the improved waveform similarity judgment method can be summarized as follows:
[0125] a) Normalize the two sets of voltage signal waveforms obtained and reconstruct the signals into and
[0126] b) Twist and align the signals to eliminate phase differences. The resulting signal is recorded as and
[0127] c) Calculate the correlation between the processed signals using cosine similarity, compare the calculated correlation coefficient with the set threshold, and then give a judgment result.
[0128] After the line headend and the end end give their judgment results, they exchange their results with the other end for longitudinal comparison, such as Figure 5 As shown in the figure, when a fault occurs at k3, the protection on the M side determines that the fault is an internal fault, and the protection on the N side also determines that the fault is an internal fault. By comparing the judgment results of the M and N sides, it is believed that the fault occurs inside the protected line and the protection should be reliably operated. When the fault occurs at k2, the protection is determined to be an internal fault from the N side, but it is determined to be an external fault on the M side, and the protection action conditions are not met. Ultimately, it is believed that the fault occurs outside the protected line and the protection does not operate. When the fault occurs at k4, the protection is determined to be an internal fault from the M side, but it is determined to be an external fault on the N side, and the protection action conditions are not met. Ultimately, it is believed that the fault occurs outside the protected line and the protection does not operate.
[0129] Taking into account the rapidity and reliability of protection, this technology sets the sampling frequency to 4kHz, selects a 2.5ms data window, that is, 10 sampling points, and records the voltage and current information of these sampling points. Calculate the reference voltage u corresponding to each sampling point RM (t i ). Compare the phase difference between the reference voltage and the measured voltage. If it exceeds the threshold, the waveform is distorted and aligned to obtain the processed measured voltage. Then take these sampling points to calculate the cosine similarity. The protection criterion is defined as a logical quantity.
[0130]
[0131] Sj=1 indicates an internal fault and Sj=0 indicates an external fault.
[0132] Specific examples:
[0133] Build a 10KV microgrid model: Use PSCAD to build Figure 6 The 10kV medium voltage AC microgrid simulation model is shown.
[0134] The system is connected to the grid via a 110 / 10kV transformer. When the system is grid-connected, DG1 to DG3 use PQ control, while DG4 uses VSG control. When the system is off-grid, DG1 and DG2 use PQ control, DG3 uses VSG control, and DG4 uses VF control, providing voltage and frequency support for the system.
[0135] The active power of the four distributed power sources is set to 0.4MW, 5MW, 0.3MW, and 0.15MW respectively, and the reactive power is set to 0. The distributed power sources are all equipped with current limiting modules, and the maximum short-circuit current is limited to 1 to 2 times the rated current in the event of a fault. The load is a resistive and inductive load, and the load sizes are S Load1 =0.76+j0.25MVA, S Load2 =0.54+j0.26MVA, S Load3 =0.233+j0.092MVA, S Load1 =0.425+j0.263MVA. The line is an RL model, the line unit impedance is Z=(0.7+j0.3455)Ω / km, the line lengths are L1=6km, L2=1km, L3=4km, L4=1.5km, L5=2.5km, L pcc =2km.
[0136] The length of this level line BD is 1.5km, and the length of the upper level line AB is 6km.
[0137] A metallic three-phase short-circuit fault was set on line BD. To prevent the disconnection of renewable energy sources from the grid in the event of a fault, a small transition resistor was set to prevent the voltage from dropping to near zero. The fault occurred at 0.5 seconds, lasted for 0.2 seconds, and had a sampling frequency of 10 kHz. Considering extreme cases where the fault occurred at the beginning of the line or at the end of the line near the inverter-type distributed power source, the accuracy of the protection method was verified for three scenarios: the beginning, the middle, and the end of the protected line.
[0138] (1) Grid-connected operation:
[0139] The original result without phase error correction 1:
[0140] Table 1
[0141]
[0142] Phase difference correction is performed on the results with unclear protection threshold boundaries, and the results after phase difference correction are shown in Table 2.
[0143] Table 2
[0144]
[0145] When 0.6069 is corrected to 0.9073, the effect of overcoming the phase difference is as follows Figure 7 .
[0146] When 0.6970 is corrected to 0.9237, the effect of overcoming the phase difference is as follows Figure 8 .
[0147] Taking the fault in the middle of the line as an example, the waveforms of the measured voltage and reference voltage of the lines inside and outside the area are shown in Figure 9 、 Figure 10 , where the black solid line represents the reference voltage of the out-of-area line head-end protection r1, and the black dotted line represents the measured voltage of the out-of-area line head-end protection r1; the green solid line represents the reference voltage of the out-of-area line terminal protection r2, and the green dotted line represents the measured voltage of the out-of-area line terminal protection r2; the blue solid line represents the reference voltage of the in-area line head-end protection r3, and the blue dotted line represents the measured voltage of the in-area line head-end protection r3; the red solid line represents the reference voltage of the in-area line terminal protection r4, and the red dotted line represents the measured voltage of the in-area line terminal protection r4.
[0148] (2) Island operation:
[0149] The microgrid operation mode is switched to island operation, and the original results are shown in Table 3.
[0150] Table 3
[0151]
[0152] Phase difference correction is performed on the results with unclear protection threshold boundaries, and the results after phase difference correction are shown in Table 4.
[0153] Table 4
[0154]
[0155] The effect of overcoming the phase difference when 0.6423 changes to 0.9331 is as follows Figure 11 .
[0156] When 0.7542 changes to 0.9177, the effect of overcoming the phase difference is as follows Figure 12 .
[0157] Taking the fault in the middle of the line as an example, the waveforms of the measured voltage and reference voltage of the lines inside and outside the area are shown in Figure 13 、 Figure 14 .
[0158] To further demonstrate this protection strategy, the technology continues to analyze the applicability of this protection method for different microgrid operating scenarios. By adding reactive compensation or reactive load branches, the measured voltage and reference voltage at the same end will have a larger phase difference.
[0159] A reactive compensation reactive load branch of 5MVar is added at the head end of the BD line, and the three-phase metallic short circuit fault is first analyzed.
[0160] (1) Grid-connected operation:
[0161] The raw results without correcting the phase difference are shown in Table 5:
[0162] Table 5
[0163]
[0164] The results after correcting the phase difference are shown in Table 6:
[0165] Table 6
[0166]
[0167] (2) Island operation:
[0168] The raw results without correcting the phase difference are shown in Table 8:
[0169] Table 8
[0170]
[0171] The results after correcting the phase difference are shown in Table 9:
[0172] Table 9
[0173]
[0174] In order to further prove the protection strategy, the RL model is transformed into a π-type model line by adding distributed capacitance to the ground, and the applicability of the protection method is analyzed.
[0175] A distributed capacitance of 0.071Uf / km is added to the original line.
[0176] (1) Grid-connected operation:
[0177] The raw results without correcting the phase difference are shown in Table 10:
[0178] Table 10
[0179]
[0180] The results after correcting the phase difference are shown in Table 11:
[0181] Table 11
[0182]
[0183] (2) Island operation:
[0184] The raw results without correcting the phase difference are shown in Table 12:
[0185] Table 12
[0186]
[0187] The results after correcting the phase difference are shown in Table 13:
[0188] Table 13
[0189]
[0190] An embodiment of the present invention further provides a microgrid protection device for voltage waveform comparison based on an improved cosine similarity algorithm, comprising:
[0191] The measurement voltage acquisition module is used to obtain the measurement voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t i The measured voltage at the measuring point on the M side at the moment, uN (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length;
[0192] Reference voltage calculation module, used to obtain the measured voltage u of the M side measurement point M (t i ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN ;The reference point is outside the protected line;
[0193] M side fault area positioning module, used to measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault.
[0194] N-side fault area positioning module, used to measure the voltage waveform u on the N side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault.
[0195] The longitudinal protection module is used to execute protection action when the M side is judged to have an internal fault and the N side is judged to have an internal fault.
[0196] The reference voltage of the reference point on the M side is
[0197] The reference voltage of the N-side reference point is
[0198] Among them, u M (t i ),u N (t i ) are the measured voltages of the measuring points on the M side and the N side, i M (t i ),i N (t i ) are the measured currents at the measuring points on the M side and the N side respectively, R is the resistance of the protected line, and L is the inductance of the protected line.
[0199] The amplitude and phase difference elimination process is to use normalization to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference. Specifically, the measured voltage waveform u and the reference voltage waveform u are R After normalization, the signal is reconstructed into a measured voltage sequence u 1 , reference voltage sequence u 1 R ; With the normalized reference voltage sequence u 1 R To align the standard, the EDR algorithm is used to eliminate the phase difference between the measured voltage and the reference voltage to obtain the measured voltage sequence u after EDR transformation. 2 .
[0200] u 2 and u 1 R The cosine similarity is:
[0201] The protection criterion is set to 0.7; when the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
[0202] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the microgrid protection method for voltage waveform comparison based on the improved cosine similarity algorithm as described in the first aspect is implemented.
[0203] Another aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the microgrid protection method for voltage waveform comparison based on the improved cosine similarity algorithm as described in the first aspect is implemented.
[0204] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0205] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0206] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0207] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0208] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm, characterized by: include: Get measured voltage: Get the measured voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t i The measured voltage at the measuring point on the M side at the moment, u N (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length; Calculate the reference voltage: Based on the measured voltage u at the M-side measurement point M (t i ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN ;The reference point is outside the protected line; Fault location on the M side: Measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault. N-side fault area location: Measure the voltage waveform u on the N-side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault. Longitudinal protection: When the M side is judged to have an internal fault and the N side is judged to have an internal fault, the protection action is executed.
2. The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to claim 1, characterized in that: The distance between the reference point and its corresponding measuring point is 1.2±0.05 times the total length of the protected line.
3. The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to claim 1, characterized in that: The reference voltage u of the reference point on the M side RM (t i ) and the reference voltage u of the N-side reference point RN (t i ) is calculated as follows: Among them, u M (t i ),u N (t i ) are the measured voltages of the measuring points on the M side and the N side, i M (t i ),i N (t i ) are the measured currents at the measuring points on the M side and the N side respectively, R is the resistance of the protected line, and L is the inductance of the protected line.
4. The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to claim 1, wherein: The amplitude and phase difference elimination process is to use normalization to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference. Specifically, the measured voltage waveform u and the reference voltage waveform u are R After normalization, the signal is reconstructed into a measured voltage sequence u 1 , reference voltage sequence u 1 R ; With the normalized reference voltage sequence u 1 R To align the standard, the EDR algorithm is used to eliminate the phase difference between the measured voltage and the reference voltage to obtain the measured voltage sequence u after EDR transformation. 2 .
5. The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to claim 4, characterized in that: Calculate u 2 and u 1 R The cosine similarity method is:
6. The microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to claim 1, characterized in that: The protection criterion is set to 0.7; when the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
7. A microgrid protection device for voltage waveform comparison based on an improved cosine similarity algorithm, characterized by: include: The measurement voltage acquisition module is used to obtain the measurement voltage u of the measurement point on the M side within a certain time window M (t i ), the measured voltage u at the N-side measuring point N (t i ) forms the voltage waveform u measured on the M side M , N side measured voltage waveform u N ; Among them, the M side measurement point and the N side measurement point are the two ends of the protected line; u M (t i ) is t i The measured voltage at the measuring point on the M side at the moment, u N (t i ) is t i The measured voltage at the measurement point on the N side at time i = 1, 2, ..., n, where n is the number of sampling points, n = F × T, where F is the sampling frequency and T is the time window length; Reference voltage calculation module, used to obtain the measured voltage u of the M side measurement point M (t i ), the measured voltage u at the N-side measuring point N (t i ), calculate the reference voltage u of the reference point on the M side RM (t i ), the reference voltage u of the N-side reference point RN (t i ), forming the M side reference voltage waveform u RM , N-side reference voltage waveform u RN ;The reference point is outside the protected line; M side fault area positioning module, used to measure the voltage waveform u on the M side M , M side reference voltage waveform u RM Perform amplitude and phase difference elimination processing to obtain u 2 M 、u 1 RM ; Calculate u 2 M and,u 1 RM The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the M side is judged to have an internal fault. N-side fault area positioning module, used to measure the voltage waveform u on the N side N , N-side reference voltage waveform u RN Perform amplitude and phase difference elimination processing to obtain u 2 N 、u 1 RN ; Calculate u 2 N and u 1 RN The cosine similarity is compared with the protection criterion. If it is less than the protection criterion, the N side is judged to have an internal fault. The longitudinal protection module is used to execute protection action when the M side is judged to have an internal fault and the N side is judged to have an internal fault.
8. The microgrid protection device for voltage waveform comparison based on the improved cosine similarity algorithm according to claim 7, characterized in that: The reference voltage of the reference point on the M side is The reference voltage of the N-side reference point is Among them, u M (t i ),u N (t i ) are the measured voltages of the measuring points on the M side and the N side, i M (t i ),i N (t i ) are the measured currents at the measuring points on the M side and the N side respectively, R is the resistance of the protected line, and L is the inductance of the protected line.
9. The microgrid protection device for voltage waveform comparison based on the improved cosine similarity algorithm according to claim 7, characterized in that: The amplitude and phase difference elimination process is to use normalization to eliminate the amplitude difference, and use the EDR algorithm to distort and align the normalized signal to eliminate the phase difference. Specifically, the measured voltage waveform u and the reference voltage waveform u are R After normalization, the signal is reconstructed into a measured voltage sequence u 1 , reference voltage sequence u 1 R ; With the normalized reference voltage sequence u 1 R To align the standard, the EDR algorithm is used to eliminate the phase difference between the measured voltage and the reference voltage to obtain the measured voltage sequence u after EDR transformation. 2 .
10. The microgrid protection device for voltage waveform comparison based on the improved cosine similarity algorithm according to claim 9, characterized in that: u 2 and u 1 R The cosine similarity is:
11. The microgrid protection device for voltage waveform comparison based on the improved cosine similarity algorithm according to claim 7, characterized in that: The protection criterion is set to 0.7; when the cosine similarity is less than 0.7, that is, the cosine similarity is within the interval [-1, 0.7], it is judged that an in-zone fault has occurred; when the cosine similarity is not less than 0.7, that is, the cosine similarity is within the interval [0.7, 1], it is judged to be a normal operating state or an out-of-zone fault.
12. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the microgrid protection method for voltage waveform comparison based on the improved cosine similarity algorithm as described in any one of claims 1 to 6 is implemented.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the microgrid protection method based on voltage waveform comparison using an improved cosine similarity algorithm according to any one of claims 1 to 6 is implemented.