Research on Voltage Sag Detection Algorithm based on Regional Transmission System

: Voltage sag is the most common power quality issue and often brings huge economic losses. To achieve voltage sag prevention and compensation, it is necessary to effectively detect voltage sag characteristics. An IEEE-39 node system model is built using Simulink, combined with common aer transformation methods and αβ. The transformation method accurately detects voltage sag accidents and incorporates a derivative algorithm, greatly reducing the detection delay and meeting the real-time and accuracy requirements of actual systems.


Introduction
Voltage sag is a phenomenon in the power system. According to the definition of the International Institute of Electrical and Electronic Engineers (IEEE), voltage sag refers to the phenomenon where the root means square value of voltage in certain areas of the power supply network decreases to 90% to 10% of the rated voltage under the action of power frequency voltage, lasting for a short period of half a cycle to 1 minute, and then returns to normal on its own [1][2][3]. There are many reasons for voltage sag in the power system, including system phase to phase short circuit faults and ground short circuit faults, lightning strikes, capacitor bank switching, start-up of large capacity induction motors, and switch on/off operations. Among them, the vast majority of voltage sags are caused by inter phase short circuit faults and ground short circuit faults. After a short circuit fault occurs in the system, the current in the circuit sharply increases, causing a voltage drop. The closer the fault point is, the lower the voltage, which affects the normal operation of the equipment and causes a large number of economic losses.
In the analysis and calculation of voltage sag, the three most recognized main characteristic quantities are the amplitude value, duration, and phase jump of voltage sag. These characteristic quantities can be used to describe the severity and impact range of voltage sags. According to the definition of voltage sag, it can be known that the amplitude of voltage sag is the depth at which the sag occurs, which is the root mean square value of the voltage. It is commonly expressed as a unit value in calculations. The duration of voltage sag is the time difference between the occurrence and end of the sag [4][5][6]. In actual engineering measurements, the duration of the sag process varies depending on the magnitude of the voltage sag. In addition, before and after the accident, the phase angle may undergo a jump phenomenon [7]. This type of jump usually occurs in systems with high impedance or three-phase asymmetric faults. The principle of the effective value calculation method is relatively simple and the calculation speed is fast, but in practical analysis, the phase jump of voltage sag cannot be detected, and there is still a period of delay. The wavelet transform method has many advantages, but it relies on the selection of wavelet bases and has not yet been widely applied [8,9].
This article focuses on the research of commonly used detection algorithms and adopts a transformation method based on derivative improvement, which greatly shortens the delay problem of conventional detection methods and accurately detects the amplitude and start stop time of voltage sag.

Effective Value Calculation Method
The effective value calculation method determines the time domain in which voltage sag occurs by the ratio of the effective value of the voltage to the rated value within a certain time period, and then obtains it by sampling the root mean square value of a cycle within the time domain. The voltage data collected in practical applications is often integer or natural data, so the calculation formula is as follows: In the formula, k is the number of sampling cycles, and N is the number of sampling times per cycle. IEC61000-4-30 recommends using full wave as a sampling period and updating the sampling data every half cycle [10,11].
In order to detect voltage sag accidents in real time, in practical applications, the unit is usually the collected voltage data of one cycle, and then the sliding average method is used to calculate. By using the sliding average method to calculate, a new voltage effective value can be obtained to replace the previous effective value, thus achieving continuous updates of the voltage effective value at each sampling point. The formula is as follows: The simulation diagram of the effective value calculation method is shown in the following figure:    Figure 1 shows the voltage sag waveform, with a set voltage sag amplitude of 0.5 p.u., a frequency of 50 Hz, and a sag duration of approximately three cycles, which is 60 ms. Figure 2 shows the calculation results of the effective value of voltage sag using one cycle. From the figure, it can be analyzed that there is a delay time of up to one cycle before the voltage sag reaches the set sag amplitude, and there is still a delay time of one cycle before the end of the voltage sag. This is because the sliding average value uses data of one cycle, so its real-time performance in practical applications is not good. Figure 3 shows the calculation results of the effective value of voltage sag using a half cycle method. From the analysis in the figure, it can be seen that although the delay time of the half cycle method is reduced by half compared to the positive cycle method, there is still a delay time of one cycle before the sag reaches the set amplitude. In practical applications, this sampling method must increase the number of sampling points to reduce detection errors, but the sampling data of the first half cycle needs to be used in the calculation, So the real-time performance is not enough, and this method cannot clearly provide the start and end time of voltage sag, and further improvement is needed.

Defect Voltage Method
The defect voltage method is defined as a method that uses the difference between the actual voltage and the ideal rated voltage on the time axis to quickly determine the actual voltage sag amplitude and phase change.
The ideal voltage U r is: The voltage U sag after a transient occurs is: The difference between the above two voltages leads to the defect voltage U rs being: According to the calculation principle of trigonometric functions, the amplitude U 3 and phase of the defect voltage can be obtainedφ 3 , the formula is as follows: The simulation diagram of the defect voltage method is shown in the following figure:

Wavelet Transform Method
The wavelet transform method, as an improved method based on Fourier transform, is a mathematical tool that can analyze both frequency and time domains simultaneously. Compared to the traditional Fourier transform, the wavelet transform method introduces a scaling factor and a delay factor to construct a time-frequency adjustable window for signal analysis. This method can use wavelet basis functions with different features to represent the signal, thus obtaining the multi-resolution characteristics of the signal and solving the defect that Fourier transform cannot analyze the timefrequency domain simultaneously [12]. The basic principle is as follows: The formula for wavelet decomposition of signal f(t)is: In the above equation, The expressions P j f(t)and D j f(t)are: In the above equation, The voltage sag signal decomposed by wavelet transform method is shown in Figure 6. From the figure, it can be seen that the two points where the modulus maximum appears in the d1 layer correspond to the starting and ending times of the voltage sag, which also indicates a sudden change in the signal at that time. It can be clearly seen that the wavelet transform method can accurately determine when the voltage sag occurs and when it ends. At the same time, the wavelet transform can obtain the characteristic quantity of the voltage sag amplitude value changing over time without losing data. However, the wavelet transform method also has drawbacks. The essence of using the wavelet transform method to solve the calculation is to analyze the convolution of the temporary signal and the wavelet basis, and the temporary signal is projected on different scales of wavelet basis to extract the time-frequency characteristics of the temporary signal. However, the characteristics of the wavelet are different, and the wavelet basis needs to be selected. Therefore, the accuracy of signal detection depends on the selection of wavelet basis.

Dq0 Transformation Method
The principle of instantaneous reactive power theory is to use Park transform to convert the three-phase voltage AC component of the system into the DC component in the dq0 rotating coordinate, and then conduct real-time analysis of these electrical quantities.
Converting from abc coordinate system to dq coordinate system: In the equation, C is the transformation matrix from the abc coordinate system to the dq coordinate system, and the expression for C is as follows: In the equation, sin(ωt), cos(ωt) is a sine and cosine signal with the same phase as the A-phase voltage. The ideal threephase voltage signal is shown in equation (12) From the equation, it can be seen that the three-phase voltage transformation results in the DC component Ud, and the transformation result is: From the above formula, it can be seen that the d-axis component reflects the effective value of the voltage, which is obtained by dq0 transformation to obtain the effective value of the three-phase voltage. Because there is no phase jump problem in a symmetrical three-phase voltage sag, considering that the phase has been recalculated, the result of equation (13) can be obtained. Therefore, based on this method, the amplitude of the sag voltage can be determined instantaneously. However, in practical power systems, most of the faults that occur on the transmission line are voltage sags caused by asymmetric short circuit faults. At this time, the voltage phase will change, so the above methods cannot solve this problem. Therefore, in practical engineering applications, the method of instantaneous reactive power is rarely considered. But based on this, many scholars have proposed new methods that can detect voltage sags in actual power systems. The instantaneous dq transformation method described in the next section is an improvement of this method.

Application Analysis based on dq Transformation Method
The dq transformation method of virtual three-phase voltage is a detection algorithm evolved based on the abc-dq transformation idea. Its construction process is based on three-phase symmetry, utilizing the phase difference characteristic of 120 ° between three-phase voltages in a symmetrical system, selecting one of the phase voltages as the input signal, and generating a virtual three-phase voltage signal for detection through dq0 transformation.
Assuming phase a as an example, the root mean square value of the fundamental voltage is U and the initial phase is 0. Consider the disturbance as the sum of all high-frequency oscillation signals, where the phase voltage is: In the formula, Uh is the root mean square value of the h high-frequency signal θh is the initial phase angle and h t e  is the attenuation index.
Using the A-phase voltage ua as the reference voltage, a virtual three-phase voltage can be constructed by leading and lagging them by 120 ° respectively. That is, by delaying ua 60°, -uc can be obtained. Then, by using ua+ub+uc=0, ub can be obtained. Then, ub and uc are represented as: Decompose the above ua, ub and uc into fundamental and high-frequency components, and substitute them into equation (10). After calculation, it can be obtained that: From the above two equations, it can be seen that the fundamental effective value of the voltage in ud is reflected as the DC component, and the h-th high-frequency oscillation component can be obtained by adding h±1 high-frequency oscillation component. Due to the absence of a direct current component in the mathematical operation results of uq, and the similarity between the d-axis conversion and the highfrequency oscillation signal transformation, ud cannot reflect the effective value of the fundamental voltage. In order to obtain the root, mean square value of the response in an instant, it is necessary to use filtering technology to decompose the DC component of the d-axis when the system is subjected to severe interference.
When there is no phase angle change during a voltage sag accident, the DC component can be decomposed using the above method to obtain the root mean square value of the fundamental voltage. The existence of a voltage sag accident can be confirmed based on whether the root mean square value has changed. When there is a phase angle change during a voltage sag accident, assuming that the effective value of the voltage is Usag and the phase jump angle is α.The fundamental component of phase A voltage can be expressed as a Assuming that there are still high-frequency oscillation components in the voltage when the phase angle changes, in order to obtain the b and c twophase voltages, the above method can be used to delay the a phase voltage by 60 °,and the obtained three-phase voltage can be substituted into (10) to calculate the DC component Ud in the d and q voltage components, respectively Udα and Uqα,Obtain the following expression: The above two DC components Udα and Uqα For known quantities, the amplitude and phase jump of the sag voltage can be obtained separately based on the above two equations, and the expression is as follows: Can accurately and quickly decompose two DC components U dα and U qα , The voltage sag amplitude and phase jump can be obtained. Currently, low-pass filters (LPF) are commonly used to decompose the DC components from the dq transform. Figure 7 is a flowchart for constructing a virtual three-phase voltage detection voltage sag. The application analysis of the sag amplitude detection waveform in the 39-node model using the dq transformation method has been conducted in the following chapter, and will not be repeated here [13][14][15].

Be based on αβ Application Analysis of Transformation Method
αβ The transformation method is a commonly used method in power system control, which originates from the dq transformation method. By converting the three-phase voltage in the abc coordinate system into a static one αβ Under the coordinate system, the amplitude of the required voltage signal can be obtained. The specific formula is as follows: Voltage U at α axis and the projection of the β axis represents the voltage at the instantaneous components in the αβ coordinate system are ud=Ucosφ and uq=Usinφ. uα and uβ the formula for transforming to the dq coordinate system is as follows: d α q β cos sin sin cos The transformation between the αβ coordinate system and dq coordinate system is shown in Figure 8: According to relevant calculations, the amplitude and phase of the voltage can be obtained as: In the power system, single-phase to ground short circuit fault is the most common type of fault. To detect such faults, it is possible to use αβ Transform method to obtain amplitude information of voltage sag. Specifically, in the αβ In the transformation method, it is necessary to construct the threephase voltage of the system and convert it to a static state αβ In the coordinate system. Due to uα to be ahead of uβ 90°, therefore single-phase voltage can be set as a reference signal to achieve rotation of the coordinate system: Delay uα by 90 ° again to obtain: The above formulas will αβ coordinate method is directly converted to the dq transformation method to calculate the amplitude of the voltage. The following is passed αβ transformation method is used to simulate the simulation detection circuit of voltage sag. Similar to the dq transformation method detection circuit, a second-order Butterworth filter is used, with a cutoff frequency of 60 Hz. By setting the filter, the impact of noise signals on the detection results can be effectively reduced, and the stability and reliability of the system can be improved. The system sampling frequency is set to 100 KHz, αβ transformation method detection circuit is shown in Figure 9: The waveform of the obtained voltage sag amplitude is shown in Figure 10: From the simulation results, it can be seen that using αβ effect of using transformation method to detect voltage sag is very obvious and can accurately detect voltage sag accidents. However, it should be noted that when constructing threephase voltage, αβ transformation method requires a 90 ° delay. This means that this method has certain limitations in realtime performance and cannot meet the requirements of modern power systems for real-time monitoring and protection of sensitive equipment.

Based on Improvement αβ Application Analysis of Transformation Method
The above two sections discuss the dq transformation method and αβ The application of transformation method in IEEE-39 node system has analyzed and clarified the delay problem caused by these two methods in constructing threephase voltage of the system. In response to this issue, this section continues to discuss the methods used to construct the three-phase voltages ua, ub and uc of the system. To solve the delay problem generated during the construction process, which is to solve the conventional dq transformation method and αβ The problem of data asynchrony caused by delay in the transformation method will continue to be addressed αβ Transformation method for improvement.
in the light of αβ. The delay problem in the transformation method is addressed in this section by using the method of function differentiation to construct the three-phase voltage of the system. Specifically, it is known that α Calculate the voltage phasor of the shaft and the derivative value of its voltage phasor, and then use α Derive the voltage phasor of the shaft β The voltage phasor of the axis is directly derived through differentiation, without directly transforming the delay problem of the coordinate axis, so it can solve the conventional problem of asynchronous data during detection using αβ transformation methods.
Derive equation (27) According to the convention αβ The process of transformation is calculated. Improved αβ The detection circuit of the transformation method is shown in Figure 10, and the improved method has set up ∆u/∆t modules to simulate the derivative transformation. The sampling frequency of the system remains unchanged, and a secondorder Butterworth filter with a cutoff frequency of 60 Hz is continued for filtering. The waveform of the voltage transient amplitude value obtained is shown in Figure 11: From the amplitude detection waveform of the voltage sag mentioned above, it can be seen that the improved αβ transformation method can effectively detect voltage sags, as previously constructed αβ. The shaft voltage has not undergone delay conversion, so this method has good realtime performance. In addition, improved αβ transformation method can reduce the impact of system oscillation in the process of waveform detection. By using Butterworth filter, the anti-interference ability to harmonics and distortion is enhanced.