Evaluation of harmonics impact on digital relays

Digital relay is an important part of the power system and actually is based on fundamental frequency (50–60 Hz). Digital filter is applied for further processing and performs mathematical operations on sampled values. The digital signal processing (DSP) becomes more applied and used in proactive relays. Obviously, DSP is used in wide range of application (controls, radio, communications and other devices). In this paper the comparison between the conventional digital relay and developed relay using Matlab/Simulink is performed. As known the conventional relay is using mathematics algorithm to calculate the current input signal and to evaluate the fault current, total harmonic distortion (THD) and harmonic components. Likewise, the developed relay is using the current signal and evaluates it and converts the input signal to digital signal. Since the digital signal is more flexible and easier to progress it and work on it. Importantly, the test is used to evaluate the functions and mathematics for both relays.


Introduction
In electrical engineering, the protective relay is a relay device designed to trip a circuit breaker when a fault is detected, and has the ability to measure the power system quantities through the internal logic of a microprocessor. Digital relays have become more efficient and functional, especially for each of the following processes: the digital relay features accurate methods to calculate the voltage, current measurements, and other electrical quantities, and has become a communication standard for electrical Substation Automation Systems (SAS). Digital relays include multi-protection functions such as distance protection, overcurrent protection, under-voltage protection, etc. In addition, there are many measurements that can be done using the microprocessor, such as internal/external fault diagnosis, fault measurements, zero current sequences, and disturbance recording. Additional functions of the digital relays, such as monitoring, metering, setting groups, fault recorder communication, and reports, have no direct relation to the protective elements. The hierarchy structure of power system automation comprises an electrical protection relay, control, measurement and monitoring, and data communications. Power system automation is a system that is integrated into the various components connected to the power network. The numerical relay is a focal concept of the power • Intelligent electrical devices (IED) have become more accurate in power quality measurements and less tolerant with higher frequency components than the nominal frequency of these devices. The major risk of harmonics in power systems is mal-operation of the protective relays and the thermoelectric effect accompanied by these harmonics.
The reason to study the impact of harmonics on protective relays is the existence of harmonics in current and voltage signals which can cause a mal-trip of the relay when no fault happens or the system fails to trip when there is a fault in the power system, especially when a harmonic can be noticed during faulty performance. The relay algorithm is an important factor to define the harmonic impact. There is a difference between the higher values of relay tripping thresholds and the lower values of normal operation. A large difference will cause a higher risk of failure to trip and mal operation. The power systems quantities are converted to the digital form that provides easy implementation of digital processing signal (DPS) and analysis the power quality.
Usually, the harmonic can be determined by the load characteristics; moreover, the harmonic in the current has a more intense impact than the harmonic in the voltage.
In the power system, the harmonics might reduce the power quality and cause a number of problems, such as overloads in distribution systems because of an increase in the rms current value, and harmonics can also cause a shorter lifespan of generators, transformers, motors, and other power system components. On the other hand, the sensitive loads can be affected by harmonic distortion.

Harmonic Phenomena
The total harmonic distortion (%THD) is a percentage of the rms of the fundamental component. The percentage current total harmonic distortion is where I h,rms is the current harmonic amplitude of order h (i.e., the h-th harmonic) and I rms is the current amplitude of the normal frequency and harmonic components: This subsequently leads to the formula: The total power factor PF = P V 1,rms I 1,rms 1 + THD i 100% 2 (4) The percentage voltage total harmonic distortion is where V h,rms is the voltage harmonic amplitude of order h (i.e., the hth harmonic) and V rms is the voltage amplitude of the normal frequency and harmonic components: The European energy organizations define the power quality in three parameters [2]: • Commercial quality: it refers to the services which provide by the electrical distribution companies. Voltage quality: it refers to the total harmonic distortion, frequency variation and voltage distortion can cause mal-operation. Levels of continuity of supply depend on the measurements which can be collected at all voltage level.
The IEC (International Electrotechnical Commission) is an organization for standardization comprising all national electrotechnical committees.
There are three European standards defining the limitation of harmonic currents injected to the power system. They define the limits of the harmonic component of the input current which may be produced by the equipment:

•
It is important to bear in mind that the impact of the power quality on the protection relays can cause incorrect trips and relay mal-operation, while an incorrect tripping time occurrence depends on the power frequency variations and harmonic distortion [7,16].

Description of Mathematical Model
The model is a suggested method of processing the voltage and current signals similarly to the process that takes place in relays, precisely, for the frequency variations and the number of samples per cycle. To ensure the validity of the test for this model, a comparison was made between the output of the model and the output of the physical relay located in the laboratory. The simulator generated signals for the voltage and current of a single phase fault (a short circuit) with the accompanying of these signals. These signals have been sent to the physical relay and have been recorded and changed the format to Comtrade (Common Format for Transient Data Exchange for power systems); after that the signals have been sent to the model; see Figure 1. Comtrade is a file format for status data related to a transient power system and storing signals. In addition to blocks that simulate these physical elements, the model also contains a display and calculation blocks for graphic representation of the results of simulated scenarios. The model presents the simulation and modeling of communication-based digital relay using Matlab and the model tested under abnormal conditions (short circuit) and under various fault types. The behavior of the model can be monitored and compared with the real protection relay by using the Enerlyzer in Omicron which can able to record voltage and current signals. The model reads the recorded signals by using a comtrade reader and the model offers the analysis of signals as shown in Figure 2.  The model was made in the Matlab Simulink programming environment ( Figure 2) using elements of the Sim-Power-Systems library. The first step is to get the current and voltage signals from the current and voltage transformer sides and apply some functions to them. The digital processing signal is the process of modifying a signal to improve the performance of the relay, to eliminate the high-frequency components, and to avoid the phenomenon of aliasing from a fault signal; low pass anti-aliasing analog filters with suitable cut-off frequency are used. Holding and sampling the signal is the second block of the signal process which converts the analog signal to the sample. The quantizer converts the smooth signal into a stair step output. Fast Fourier Transform (FFT) is a faster version of the Discrete Fourier Transform (DFT) which is used to find the fundamental frequency and higher frequencies contained in the input signal [6,7].

The Low Pass Filter Block
The low pass filter block can filter every channel of the input signal separately using the given design specification as shown in Figure 3 and the Table 1. A detailed description and the possibilities of determining equivalent parameters are thoroughly discussed in [9,19].  The output signal from the Finite impulse response (FIR) filter can be described by Equation (1): where: x[n] Refers to the current or voltage signals, y[n] Refers to the filtering signal, N Refers to the filter order, b i is the value of the impulse response at the ith instant for 0 ≤ i ≤ N of an Nth-order FIR filter.

Sample and Hold
The sample and hold block gets the input signal when it receives a trigger event at the trigger port. The block holds the output signal until the next triggering event occurs.

•
When the trigger input rises from a negative value to a positive value, the block starts to acquire the input signal. • When the trigger input drops from a positive value to a negative value, the block starts to acquire the input signal.

Pulse Generator
The pulse generator block is the trigger input of the sample and hold block. It generates square wave pulses at regular intervals. The block waveform parameters (amplitude, pulse width, period, and phase delay) determine the shape of the output waveform.

Fourier Block
The Fourier block offers the calculation the amplitude and phase of the input signal (current and voltage), total harmonic distortion. The block offers analysis of the signal components as a percentage of the fundamental signal.
Recall that a signal f (t) can be expressed by a Fourier series of the form where n represents the rank of the harmonics. (n = 1 corresponds to the fundamental component.) The magnitude and phase of the selected harmonic component are calculated by these equations: where a n = 2

Phase Locked Loop (PLL) System
This block is used to synchronize a variable frequency sinusoidal signal. Meanwhile, this model is used to determine the frequency and the fundamental component of the signal phase angle which can be used to track the frequency and phase of the sinusoidal signal by using an internal frequency oscillator. The control system changes the internal frequency to keep the phase difference set to 0, as shown in Figure 4.
The model discusses two cases of Power Frequency variations when the power frequency gradually increases from 50 Hz to 52 Hz and returns to the normal frequency after a period of time; see Figure 5. The model compares the conventional way of calculating the frequency variation and the proposed way using a closed circuit. The proposed method is to track the frequency and amplitude of the input wave by using the frequency oscillator. In Figure 6, in contrast, the frequency decreases by 2 Hz gradually to 48 Hz.

Relay Report and Simulink Result
Fault points were used in the tests, and a single phase with ground (SLG) was chosen; the fault points were included in the harmonic components. The points were located near the border of zone 1 and zone 2. The characteristic zones of the distance relay and the chosen points can be seen in Figure 7. As it is known, most digital relays use quadrilateral characteristics due to the many advantages which those characteristics can provide. The configuration and settings of the relay should be done in the first place; after that, exporting of these settings to CMC 256 is important to evaluate the relay functions. CMC 256 provides different platforms to test the relay with its zones setting, transmission line parameters, and time delay. Moreover, an advanced distance test displays the amplitude and phase of the three phase currents and voltages determined by the fault type and the fault location [11]. The distance relay is a universal short-circuit protection. Its mode of operation is based on the measurement and evaluation of the short-circuit impedance which, in the classic case, is proportional to the distance to the fault. Its tripping time is approximately one to two cycles (20 to 40 ms at 50 Hz) in the first zone for faults within the first 80% to 90% of the length. In the second zone, the tripping time depends on the settings which are usually 300-500 ms [20]. The parameters of the derived model are based on the physical relay, as shown in Figure 7, which presents the characteristic zones of distance relay designed in the matlab environment.

The Testing Conditions
A harmonics test allows for creating a voltage and current signals with three states: pre-signal refers to the signal with the fundamental frequency and pre-signal time can be determined according to the test conditions, signal refers to the signal accompanied by the harmonic components, post signal refers to the signal with the fundamental frequency as shown in Table 2. Harmonic can be added to the voltage an current signals individually or mixed. The test offers the file export as comtrade formate and playback. The distorted voltage and the current waveform can be composed of harmonic components; however, the distorted waveform can be decomposed into a fundamental sinusoidal waveform at nominal and harmonic frequencies. The decomposition of distorted waveforms can be done by Fourier transform, as shown in Figure 8. An evaluation of the relay function and harmonics impact can be done in this test. The test is divided into different levels. The first level is based on the harmonic effect of mixed harmonics and individual harmonics. Both are used to test the protection operation and the Simulink model, considering that protection is IED and Matlab is a Simulink model. Figure 8 shows three mixed harmonics (2nd, 4th, 6th) of the fundamental signal. The discrete Fourier transform is used to calculate the THD in the Matlab model. The DFT Spectrum of a one-cycle (20 ms) voltage signal was taken, applying the DFT to the first 20 ms of sampled signal results in the line spectrum at discrete frequencies 50, 100, 150 Hz, etc. Figure 8 shows the magnitude values of the harmonics by using Equation (8). The figure shows that the 50 Hz component dominates; it is already visible from the original signal. The voltage signal contains significant components at even harmonics of 100, 200, and 300 Hz. Figure 9 shows decomposed voltage waveform with harmonic distortions of three harmonics (3rd, 5th, 7th) using the Fourier transform/ Matlab window. The harmonic analysis was tested and measured using a Matlab model.  The test was conducted at five different fault points and a total harmonic distortion was added to each of these tests. The total harmonic distortion on the current wave added at two points (the arrow direction up) is called an overreach, and the total harmonic distortion was added to the voltage wave at three points, as shown in Figure 10. The total harmonic distortion was added as a percentage of the fundamental signal as follows: 10%, 20%, 30%, 40%, and 50%, and were colored in the following colors, respectively (violet, blue, yellow, red, and green). Overreach and underreach of protection relays are common problems in power systems; they cause a mal-operation of the protection relays and it is impossible to detect the fault in the correct zone. The overreach of the point of the fault can cause the protection relay to send a mal-trip signal, which means that the relay instead of a trip in a delayed time zone 2 will send the tripping signal in zone 1, which is not desired; as shown in Figure 10. A harmonic distortion can change the power factor which leads to a change in the measured impedance lower than the actual value. The overreach can be noticed from a distorted voltage waveform, as shown in Figure 10, due to the lagging power factor. Conversely, an underreach of the point of fault can cause the change of protection relay and the decision to send a mal-trip signal; it means that the relay instead of a trip at a delayed time zone 1 will send a tripping signal at zone 2, which is not desired, as shown in Figure 10. A harmonic distortion can change the power factor, which leads to a change in the measured impedance higher than the actual value. The underreach can be noticed from a distorted voltage waveform, as shown in Figure 10, due to the leading power factor. The overreach of the distance relays should be avoided mostly in the first zone.
The test can illustrate harmonic distortion. A single-phase fault operation of a distance digital relay was applied and, as a result, the relay made a mal-operation decision. The analysis has been summarized from the integral disturbance recorder in the relay that has an area of memory. The relay can store all events in a disturbance recorder. Figure 11 shows a single phase to earth fault on the transmission line in a power system with a high harmonic content. It is assumed that three harmonics (3rd, 5th, and 7th) exist. The distance protection relay shows the instantaneous value of the three-phase voltage with a high harmonic content once a single phase with earth occurs.

Distance Relay: Tripping Time vs. THD Level
Based on previous reports [21,22], the total harmonic distortion was measured at 30 different grids in the Czech Republic at different intervals. The measurements and evaluation of the harmonic level were made by the E.ON Distribution in the Czech Republic, operated by the company E.ON Czech Republic. More than 1000 MW of distributed energy sources (DES) are connected to this network, mainly from photovoltaic (PV) sources; see Table 3. According to the total harmonics of the measured points in grids, the distance relay was tested. Its mode of operation is based on the measurement and evaluation of the short-circuit impedance which in the classic case is proportional to the distance to the fault. This test explains how a different magnitude of the total harmonic distortion can influence the relay's operation and the tripping time of most digital protection relays used. A fault was located at zone 1 near the border zone 1-2 border (as shown in Figure 12: the tripping time for fault without distortion was 23 ms (average of 10 measurements); the tests were performed with zone 1 tripping time set to 0 ms and zone 2 tripping time set to 1000 ms. It is possible to see how the harmonic distortion can affect the distance relay's accuracy and assessment of where the fault took place. During harmonic distortion, a portion of the current is missing so an excessively large impedance is measured. In our measurements on the distance protection, the zone reach is reduced. It is acceptable for near faults, because the distance to the zone limit is long [13,16]. For faults close to the zone limit, an underreach is not permitted; the relay will trip in the second zone with a time delay [11]. Figure 12 shows the relation between the tripping time and the THD of the voltage. In this test, the THD does not exceed 4.5%. Note that the tripping time for the distance protection varies according to the added harmonic value. Figure 13 presents the harmonic influence on the tripping time of the physical distance relay, where the current and voltage signals contain harmonics at a high level. The test was repeated five times and the average tripping time is presented. The type of fault is a single phase with the ground and tripping time without added harmonics of 1 s. The rms current and rms voltage should be constant during the test. For example, when the voltage and current signals contain the second harmonic, the tripping time of the distance protection is not constant, and the tripping time starts to change from 1 s to 1.6 s, meaning that the relay algorithm calculated the impedance in the third zone when the harmonic level was 10-40% of the current and voltage signals. Moreover, when the harmonic level was 50% of the current and voltage signals, the tripping time is changed to 3 s and the distance protection decision wrongly calculated the fault in zone 4.

Comparison of Total Harmonic Measurement between Physical Relay and Model
The test involves a calculation of performance indicators concerning the level of harmonics through a commercial relay. This chapter contains a large number of measurements. The interval in the relay is 10 cycles in a 50-Hz system according to IEC 61000-4-30 and the model. The harmonics were added as the percentage of the current and voltage signals.

• Testing Conditions
To achieve a comparison between the THD in the commercial relay and the model, EnerLyzer is used to control the measuring features of the CMC test sets. It runs as a stand-alone test module. It has four modes of operation: a multimeter mode, a transient recording mode, a harmonic analysis mode, and a trend recording mode. It calculates the harmonic analysis of all configured inputs (up to 64 harmonics) and displays it in a bar graph and in a tabular format.

• Total Harmonic Distortion Detection in Physical Relay and Matlab Model
Through the test, the results show that the commercial relay of the harmonic capture ratio is lower than the original harmonic value. The total harmonic distortion is 10%, 20%, 30%, 40%, and 50% of the current signal according to the relay report. Figure 14 shows the harmonic measurements in a commercial relay. The second, third, and fourth harmonics were added as well as the three harmonics combined (2nd, 4th, 6th) and were added to the 3rd, 5th, and 7th harmonics. We can conclude that the commercial relay measures the THD with a difference of up to 35%, especially when there are three harmonics combined in the input signal, as shown in Figure 14. The digital relays start function when abnormal conditions occurred as faults. Abnormal events are accompanied by harmonics which are combined with the current and voltage signals.  Figure 14 shows the measurement of THD in a commercial relay. A harmonic measurement evaluates the error of calculation, and the calculation method described above applies to the steady state fault conditions. The measurements of the third harmonic showed that the error of calculation in the commercial relay increased according to the harmonic percentage of the signal. The error of the calculation of the third harmonic is ca. 7% when the percentage of harmonic is 0-10%. After that, the error of the calculation of the third harmonic is stabilized to 10% when the percentage of harmonic is 10-50%. The highest error of the calculation of the THD can be found in mixed harmonics, as shown in Tables 4 and 5. The THD for mixed 3rd, 5th, and 7th harmonics is ca. 10-20% when the harmonic content is 0-10%. After that, the error of the calculation of THD for mixed 3rd, 5th, and 7th harmonics is stabilized to 33% when the percentage of harmonic is 10-50%.  Figure 15 shows the measurement of THD in the model. The harmonic measurements evaluate the error of calculation. The measurements of the third harmonic show that the error of the calculation in the model is increasing according to the harmonic percentage of the signal and the error of the calculation of the third harmonic is ca. 1% when the harmonic percentage is 0-10%. After that, the error of the calculation of the third harmonic is stabilized to 2% when the harmonic percentage is 10-50%. The highest error in the calculation of THD can be found in mixed harmonics, as shown in Figure 15 and in Table 6; the THD for the 3rd + 5th + 7th harmonics is around 1-2% when the harmonic percentage is 0-10%. After that, the error in the calculation of the THD for the 3rd + 5th + 7th harmonics is stabilized to 3% when the harmonic percentage is 10-50%.  Because the model implements the voltage and current signals, it is able to measure higher THD than the physical relay, as shown in Figure 15. The model captures harmonics with accuracy of 90-95%. In the case of the individual harmonics, however, the physical relay captures with accuracy of 80-85%, as shown in Figure 14. Similarly, mixed harmonics are inserted in the physical relay accompanied by the fault current and voltage signals. The physical relay captures mixed harmonics with accuracy of 65-70%, however the model captures mixed harmonics with accuracy of 85-90% , as shown in Figures 14 and 15.
The model provides a filter to reduce the harmonic distortion; this filter is built up from passive RLC components. Their values are computed using the specified nominal reactive power, tuning frequency, and quality factor. The filter has been implemented to mitigate the total harmonic distortion of the current and voltage. In case of an abnormal condition (a short circuit), the simulation implements a fault (a single-phase with the ground) from 0.1 to 0.15 s. Conversely, the steady state has been implemented during the period from (0 to 0.1) s and (0.15 to 0.2) s. During the implementation of the simulation, the delay to start the calculation at the very beginning takes 0.02 s or 1 cycle. The steady state of the model takes place under normal operation and the calculation of voltage total harmonic distortion (VTHD) and current total harmonic distortion (ITHD) are implemented. Abnormal operation begins at 0.1 s and lasts for 0.05 s (2.5 cycles), which is accompanied by increasing the fault current and decreasing the voltage. Figure 16 shows the rms current calculation during the steady state and fault (short circuit) between phase B and the ground. The THD filter block offers the possibility to mitigate the harmonics, and the THD filter is designed to reduce the 5th, 7th, 11th, and 13th) harmonics, as it known that the physical relay has the ability to remove harmonics up to the 5th.  Figure 17 shows the comparison between the rms measured voltage with and without a THD filter. The figure confirms the assumption that the rms voltage with a THD filter is lower than the rms voltage without a THD filter.  Figure 18 shows the computed total harmonic distortion (THD) of the current signal. The THD is defined as the rms value of the total harmonic content of the signal divided by the rms value of its fundamental signal. For example, for currents, the THD is defined as I H = I 2 2 + I 3 2 + · · · + I n 2 , In: rms value of the harmonic n, I F : rms value of the fundamental current. In Figure 18, when the simulation performs a normal condition, the I THD has decreased accordingly by 1% to 2% when the filter has been implemented, during the short circuit the I THD has decreased accordingly by 0.4% to 1.7%.
In Figure 19, when the simulation was run under normal conditions, the VTHD decreased accordingly by 5% to 7%. When a filter was implemented during the short circuit, the ITHD decreased accordingly by 2% to 5%.

Conclusions
This paper explains part of the digital signal processing in a power system. Moreover, the paper provides different methods to compare the relay algorithm which can be used in a power system based on the impact of harmonics once they are injected in high values. The implementation of the test requires analyzing the occurrence of events in the power system. Each event contained in the input signals can be imported to Matlab via a Comtrade reader which reads the selected event. Digital relays are limited because they can only respond to changes in the magnitude of the fundamental current or voltage. Regarding overcurrent relays, a low level of harmonic distortion may not affect their operation. However, concerning distance relays, while the relay's ability to find faults away from zone's limit may still be reliable, when it comes to faults located near the limit of the zone, there is a possibility for the distance relay to be misguided as to the location of the fault.
Protective relays implement different techniques to measure the current and voltage. The microprocessor relays use a digital filter to take out the fundamental component. Filtering techniques were developed to accommodate a wide variety of harmonic influences. Anti-aliasing provides the ability to remove the frequencies higher than the Nyquist frequency; filter techniques should be implemented to reduce the harmonic level from the power system measurements. The THD filter implemented in this paper can mitigate the THD of the current and voltage. The calculations of the THD during abnormal and normal conditions showed that the voltage harmonics were reduced by 2-5% and the current harmonics were reduced by 0.4-1.7%.