# Graphical User Interface Design for Modeling and Simulation of Impedance Relays

<figure><img src="image_1.png" /></figure>

Check for
updates

Shaker M. Khudher

<figure><img src="image_2.png" /></figure>

Department of Electrical Engineering, Faculty of Engineering, University of Mosul, Mosul 41002, Iraq

Corresponding Author Email: shakeralhyane@uomosul.edu.iq

Copyright: ©2024 The author. This article is published by IIETA and is licensed under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0/).

https://doi.org/10.18280/jesa.570608

**Received:** 30 September 2024

**Revised:** 4 December 2024

**Accepted:** 17 December 2024

**Available online:** 31 December 2024

**Keywords:**

fault location, fault detection, graphic user interphase, impedance relay, power system protection

## ABSTRACT

The difficulty of dealing with impedance protection lies in the lack of familiarity with the principle of operation of this type. This paper describes the process of creating an impedance relay model using the MATLAB/Simulink package. Detailed impedance relay and transmission line modeling and fault simulation were accomplished using the SimPowerSystems toolbox. Within this modeling framework, a three-phase fault was chosen as the fault type which is considered the most dangerous fault that the system may be exposed to. To enhance the user experience, a complete graphical user interface (GUI) was created within MATLAB for this model. The interactive nature of the graphical user interface was tested by applying faults in different locations related to the first, second, and third zones and the GUI displays all system information, the location of the fault, and the impedances of the protected areas simply and clearly for the three tested faults as well as fast response to detect the fault as its clear from voltage and current waveforms after faults detections. In addition, it gave a flexible ability to change the value of elements in the power system used and the type of impedance relay.

## 1. INTRODUCTION

The biggest challenge in electrical engineering these days is to ensure a high level of continuity in the delivery of electrical services to consumers under any circumstances. However, there are situations where unforeseen natural events or human mistakes can occur which may disrupt the delivery of services to customers. The causes of accidents include lightning, wind, avalanches, falling trees, plane collisions, traffic accidents, digging underground midwives, etc. To avoid equipment damage, long interruption of electrical service to consumers, and potential personal hazards [1].

Preventive relays play a role, in addressing conditions and reducing associated risks. In the past protective relays were mostly electromechanical, a technology that is still used in systems. However solid-state relays, which were introduced in the 1950s have become increasingly popular due to their advantages such, as improved accuracy, sensitivity, ease of testing, and maintenance. Recently researchers have been exploring the potential of microprocessor technology to develop reliable, safe, and efficient relay systems. Their goal is to minimize space and power consumption while achieving response times [2, 3].

One of the used techniques to ensure the safety of transmission lines is distance protection, which is based on measuring the line's impedance continuously. There are many kinds of distance relay properties such as Mho relay, Reactance relay, Simple impedance relay, and Ideal distance relay, etc. Each type of characteristic has a function and theory [1, 4].

To understand how relays work it is important to develop

software representations of these devices. Modeling protective relays offers a cost-effective and practical option for examining how these relays perform. Electrical power equipment uses computer-based relay models to evaluate how the relays function in scenarios, such, as system disturbances and regular operations. This allows for adjusting the relay settings as required to ensure they work correctly [5, 6].

Many researchers have addressed the issue of modeling and simulation of different types of impedance relays using different engineering programs and tools such as PSCAD/EMTDC, ETAP, and MATLAB [7-11]. A few researchers deal with the use of graphical user interfaces (GUI) for different types of protective relays like differential relays [12] and distance relays [13] with simple and undetailed designs.

MATLAB / SIMULINK is a potent analysis software platform package recognized worldwide, which can model, The SimPowerSystems toolbox, a part of Simulink provides users with the capability to simulate and analyze systems in a manner. It enables the examination of components, within a system, such, as three-phase transformers, three-phase loads, distributed line factors, circuit breakers, AC and DC applications, etc. [2, 14].

In this paper, a three-phase transmission system as well as a simple impedance relay was designed. The system was tested under several fault conditions. Also, to get a better understanding and soft performance, a detailed graphical user interface (GUI) was created using the AppDesigner for the model inside the MATLAB program through the interactive GUI environment. The GUI can run the simulation as well as showing line information, fault zone, and fault location.
## 2. METHOD AND TOOLS

Impedance protection is the most widely used method to protect transmission lines, and it is based on measuring the line's impedance continuously. There are many types of impedance relays each type has its own characteristics and theory [1, 4].

The Society of Power System Protection Engineers has classified transmission line protective relays according to the principle of work and properties such as Mho relay, Reactance relay, Simple impedance relay, and Ideal distance relay, etc. [1, 4].

### 2.1 Configuring and modelling of the system

In this section, a three-phase system was designed. The system consisted of a three-phase power source, a three-phase transmission line, and the load. Table 1 and Figure 1 illustrate the chosen system-related parameters [13].

<table><caption>**Table 1.** System parameters</caption><thead><tr><th>Power System Data</th><th>Value</th><th>Unit</th></tr></thead><tbody><tr><td>Power system voltage</td><td>132,000</td><td>Volt</td></tr><tr><td>Nominal frequency</td><td>50</td><td>Hz</td></tr><tr><td>3-phase short circuit level at base voltage</td><td>300,000,000</td><td>VA</td></tr><tr><td>Source X/R ratio</td><td>6</td><td>-</td></tr><tr><td>Line length</td><td>50</td><td>km</td></tr><tr><td>Positive sequence resistance</td><td>0.01239</td><td>Ω/km</td></tr><tr><td>Zero sequence resistance</td><td>0.1239</td><td>Ω/km</td></tr><tr><td>Positive sequence inductance</td><td>0.00043386</td><td>H/km</td></tr><tr><td>Zero sequence inductance</td><td>0.00130157</td><td>H/km</td></tr><tr><td>Positive sequence capacitance</td><td>1e-9</td><td>F/km</td></tr><tr><td>Zero sequence capacitance</td><td>1e-9</td><td>F/km</td></tr><tr><td>Active power</td><td>40,000,000</td><td>W</td></tr><tr><td>Inductive reactive power</td><td>19,373,000</td><td>Var</td></tr></tbody></table>

<figure><img src="image_3.png" /><figcaption>**Figure 1.** Chosen system</figcaption></figure>

### 2.2 Modelling of the impedance relay

This section involves the modeling of each part of the impedance relay using MATLAB. The fundamental concept underlying the operation of impedance relays is based on the ratio of (V/I) at the relay location, as illustrated in Figure 2. This ratio (V/I) serves as a measurement of the impedance (Z) along the faulted line segment between the relay location and the point of the fault. Subsequently, this measured impedance is compared to a predefined threshold, and if Z falls within the specified range, the relay is activated [7].

<figure><img src="image_4.png" /><figcaption>**Figure 2.** Impedance relay location</figcaption></figure>

The impedance protection devices relied on different philosophies aimed at dividing the lines into regions, and each region has specific boundaries [15, 16].

The range of Zone 1 impedance is usually set at 80% to 85% of the total impedance of the transmission line (depending on relay accuracy), leaving the rest of the impedance line as a safety margin. The first protection zone has no delay, i.e., works instantly [17, 18].

The second zone impedance must be set to cover 120% of the total line impedance or a maximum equal to the length of the protected line including 50% of the shortest adjacent line. The time of the second zone must be matched with the operating time of the first zone plus the cut-off time of the circuit breaker [18, 19].

The main purpose of zone three is to provide a backup defense line for faults that occur in the lines close to the remote bus, the reach of the third zone must be set to cover the impedance from the end of the second zone border to the end of the second line section [18, 19].

The relay model includes the zone setting presented in Figure 3.

<figure><img src="image_5.png" /><figcaption>**Figure 3.** Impedance relay model</figcaption></figure>

### 2.3 Graphic user interface design

A user interface (UI) is a visual presentation within one or more windows that includes components, also known as elements. Without the need to write scripts or enter commands via a command line, these components enable interactive activities for the user. Users are not required to understand the complex mechanics of task performance, unlike coding activities. The term "user interface components" refers to a variety of elements, including list boxes, push buttons, radio buttons, and toolbars. A UI built with MATLAB tools can also carry out a variety of computations, manage data file operations, connect to other UIs, and display data as tables or charts [20, 21].

The mechanism of action is based on the following principle: every component (part) of the GUI and even the interface as a whole is associated with one or more user-written routines known as callbacks. This type of programming is often known as event-driven programming. The event here is pressing the button. In event-driven programming, the execution of the call is synchronous, and it is controlled by events directed from outside the software [6, 20].

A graphical user interface is a window in which user-managed components are added, these components can be selected and their size and position can be chosen. Using OM Callbacks can make Components do the work required when the user clicks on or manipulates the components, several components have been used and programmed to configure this interface and make it easier to understand the workings of the space stage.
### 2.3.1 Transmission line parameters

The used system information is displayed statically in the graphic interface, which contains line voltage, frequency, phase difference angle, resistance, inductance, line capacitance, and also the length of the transmission line used as shown in Figure 4.

<figure><img src="image_6.png" /><figcaption>Figure 4. Transmission line parameters graphic interface</figcaption></figure>

### 2.3.2 Line section and zone setting

The location of the malfunction can be controlled by making the malfunction in any required segment, by dividing the segment into two parts, with a three-phase fault in the middle, and when pressing the selected segment, the malfunction occurs in that segment as presented in Figure 5(a) while the transmission line was divided into three protection zones as mentioned earlier, and Figure 5(b) shows the three protection zones which were displayed in the graphical interface.

<figure><img src="image_7.png" /><figcaption>Figure 5. Graphic interface for (a) faulted line section (b) three protection zones</figcaption></figure>

### 2.3.3 Fault zone

In the event of a malfunction within the scope of a certain area, the interface indicates the area in which the malfunction occurred as shown in Figure 6.

<figure><img src="image_8.png" /><figcaption>Figure 6. Malfunction areas in the normal state</figcaption></figure>

### 2.3.4 Load data

The load was represented as a series RLC circuit as shown in Figure 7.

<figure><img src="image_9.png" /><figcaption>Figure 7. Load information graphic interface</figcaption></figure>

### 2.3.5 Fault location and fault resistance

The fault location is easily selected via the Slider, by which a value can be set, where L represents the fault location relative to the length of the line and the value of fault resistance can be set simply as in Figure 8.

<figure><img src="image_10.png" /><figcaption>Figure 8. Fault location and resistance graphic interface</figcaption></figure>

### 2.3.6 Relay impedance

The visible impedance is shown by the relay in the graphical user interface, in Figures 9(a) and 9(b) the value of the perceived impedance is shown in the normal state without fault and fault state at 50% of the length of the first line.

<figure><img src="image_11.png" /><figcaption>Figure 9. Relay impedance (a) without fault (b) with fault</figcaption></figure>
### 2.3.7 Relay setting

Usually, the relay is set to certain values for different regions. In the event of a fault, the impedance seen by the relay is compared with the relay setting values to determine the fault zone as shown in Figure 10.

Finally, the graphical interface used, shown in Figure 11, was obtained.

Using the system shown in Figure 12, firstly, variable fault locations were imposed in both line sections with a three-phase fault to the ground to obtain the results that represent the impedance seen by the relay in each case.

Secondly by using system voltage and current as inputs to the second stage to locate the fault. Finally testing the information displayed on the graphic interface with the hypotheses that have been relied upon to prove the efficiency and accuracy of graphic interface design.

<figure><img src="image_12.png" /><figcaption>Figure 10. Three zones adjusting</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Figure 11. Final graphical interface</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>Figure 12. Power system model used with impedance relay</figcaption></figure>

## 3. RESULTS AND DISCUSSION

After conducting the complete system model supported by GUI, the results were presented that show the voltage, current, and impedance seen by the relay for a three-phase fault to ground. Various fault locations were taken and these faults

were applied to the first line and the second line. The line was divided into two parts, a part representing (50*L) and the other part representing (50*(1-L)), to study the response of the impedance relay to different areas of faults impedance seen by relay for different locations are recorded as shown in Table 2.
<table><caption>**Table 2.** Impedance values are seen by the relay</caption><thead><tr><th>Fault Location (%)</th><th>R-Relay (ohm)</th><th>X-Relay (ohm)</th><th>Zone</th></tr></thead><tbody><tr><td>20</td><td>0.1247</td><td>1.385</td><td>1</td></tr><tr><td>40</td><td>0.249</td><td>2.727</td><td>1</td></tr><tr><td>60</td><td>0.3746</td><td>4.106</td><td>1</td></tr><tr><td>85</td><td>0.5292</td><td>5.802</td><td>2</td></tr><tr><td>95</td><td>0.5919</td><td>6.487</td><td>2</td></tr><tr><td>115</td><td>0.7176</td><td>7.86</td><td>2</td></tr><tr><td>140</td><td>0.8758</td><td>9.582</td><td>3</td></tr><tr><td>180</td><td>1.132</td><td>12.35</td><td>3</td></tr></tbody></table>

### 3.1 Fault at 20% of the first line length (first zone)

In this case, the system was exposed to a malfunction in a location close to the beginning of the line with a distance equal to 20% of the length of the first line which is at the first zone, and then displayed the results in the graphical interface. Figure 13 shows the graphical interface result and Figure 14 represents the voltage and current during a three-phase fault at 20% of the length of the first line.

<figure><img src="image_15.png" /><figcaption>**Figure 13.** Graphical interface for a three-phase fault at 20% of the length of the first line</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>**Figure 14.** Voltage and current for a three-phase fault at a distance of 20% of the length of the first line</figcaption></figure>

From Figure 13 it can be noted that the location of the fault is in the first zone and it is validated at the GUI result which is programmed to indicate “1” for the faulty zone and “0” for no fault while Figure 14 show the variation in the value of system voltage and current for one phase during fault.

### 3.2 Fault at 85% of the first line length (second zone)

In this case, the system was exposed to a fault with a distance equal to 85% of the length of the first line, and then

the results were displayed in the graphical interface as shown in Figure 15.

<figure><img src="image_17.png" /><figcaption>**Figure 15.** Graphical interface for a three-phase fault at a distance of 85% of the length of the first line</figcaption></figure>

While the system phase voltage and current are as shown in Figure 16.

The location of the fault in this case and according to the impedance relay setting is in the second zone and this is achieved through the results shown in the Graphical interface which indicate “1”. However, the changes in system voltage and current present in Figure 16.

<figure><img src="image_18.png" /><figcaption>**Figure 16.** Voltage and current for a three-phase fault at a distance of 85% of the length of the first line</figcaption></figure>

### 3.3 Fault at 40% of the second line length (third zone)

In this case, the system was exposed to a fault with a distance equal to 40% of the length of the second line, and then the results were displayed in the graphical interface. Both locations are related to the third zone setting and it is evident from the results shown in the application interface as illustrated in Figure 17, besides system voltage and current are shown in Figure 18.

<figure><img src="image_19.png" /><figcaption>**Figure 17.** Graphical interface for a three-phase fault at a distance of 40% of the length of the second line</figcaption></figure>
<figure><img src="image_20.png" /><figcaption>**Figure 18.** Voltage and current for a three-phase fault at 40% of the length of the second line</figcaption></figure>

Through the results presented for the three selected cases and a three-phase fault to ground, neglecting the effect of the fault resistance, the effectiveness of the operation of the graphical user interface was confirmed by displaying the value “1” or “0” which indicates the faulty zone, in addition to the change occurring in the values of voltage and current, and thus in the value of the impedance seeing by the relay, where are the normal voltage and current values are 5.16e4 V, 228.8 A (RMS) before fault and it notices a decrease in the value of the voltage the closer the fault is to the source side, in contrast to the current, which increases significantly with proximity to the source, and this is shown in Table 3.

<table><caption>**Table 3.** Voltage and current variation during faults</caption><thead><tr><td>Fault Location (%)</td><td>Voltage (V)</td><td>Current (A)</td><td>Zone</td></tr></thead><tbody><tr><td>20 first line</td><td>2421</td><td>1748</td><td>1</td></tr><tr><td>85 first line</td><td>8906</td><td>1529</td><td>2</td></tr><tr><td>40 second line</td><td>1.365e4</td><td>1368</td><td>3</td></tr></tbody></table>

## 4. CONCLUSIONS

In this paper, the impedance protection relay was designed and displayed using MATLAB GUI to detect faults and display the impedance seen by the relay as well as display the location and area of the fault, after implementing and testing the model, the following points were concluded:

* The simulation results for the fault type used and the location clearly show the exact performance of the impedance relay.

* The versatility of the model and its applicability enhance its use in power system simulation. It can be used to understand how the impedance relay works and how to implement settings.

* This complex security scheme can be easily implemented on a PC.

* The relay determines the fault locations as expected, as the fault location is changed, and thus the measured impedance changes.

* Through the impedance calculations seen by the relay, the model indicates the fault area in all cases.

After all the above-mentioned features of the graphical user interface in terms of ease of handling and implementation, those interested in this field can apply the steps proposed in this paper to other types of faults such as single line to ground, line to line fault, and line to line to ground faults, with and

without the effect of fault resistance, in addition to benefiting from the displayed signal of faulty zone to control the process of disconnecting the fault from the network.

## ACKNOWLEDGMENT

The authors would like to thank the University of Mosul for their assistance with this work.

## REFERENCES

[1] Ahmed, A.H., Sultan, A.J. (2019). A new approach of Mho distance relay for transmission line protection. IOP Conference Series: Materials Science and Engineering 518(4): 042027. https://doi.org/10.1088/1757-899X/518/4/042027

[2] Mrehel, O.G., Elfetori, H.B., Hawa, A.O. (2013). Implementation and evaluation a SIMULINK model of a distance relay in MATLAB/SIMULINK. International Conference on Electrical and Electronics Engineering, Clean Energy and Green Computing, 132-137. Society of Digital Information and Wireless Communication.

[3] Najem, W.M., Alyozbaky, O.S., Khudher, S.M. (2023). Effect of electric vehicle charging stations on the performance of distance relay. Al-Rafidain Engineering Journal, 28(1): 133-144. https://doi.org/10.33899/rengj.2022.135233.1194

[4] ALSTOM. (2002). Network Protection & Automation Guide.

[5] Tziouvaras, D.A., Hou, D. (2004). Out-of-step protection fundamentals and advancements. In Annual Conference for Protective Relay Engineers, College Station, TX, USA, pp. 282-307. https://doi.org/10.1109/cpre.2004.238495

[6] Al-Kaoaz, H.N.A., Alsammak, A.N.B. (2023). Performance enhancement of distance relay in presence of unified power flow controller. International Journal of Power Electronics and Drive Systems, 14(3): 1577-1588. https://doi.org/10.11591/ijpeds.v14.i3.pp1577-1588

[7] Liu, J.F., Wilson, P.L., Jayasinghe, R.P. (2004). A PSCAD/EMTDC based simulation study of protective relay. IEEE Conference Publication, 264-267. https://doi.org/10.1049/cp:20040114

[8] Deepa, S., Hindhupriya, J., Madhubala, R., Shivani, S., Srilekha, R. (2020). Relay setting coordination using ETAP. International Journal of Advanced Research and Innovative Ideas in Education, 6(4): 1180-1188.

[9] Aquiles Perez, S.G. (2006). Modeling relays for power system protection studies (Doctoral dissertation). University of Saskatchewan. http://hdl.handle.net/10388/etd-07132006-133747.

[10] Ren, J., Kezunovic, M. (2010). Modeling and simulation tools for teaching protective relaying design and application for the smart grid. In Proceedings of the International Symposium on Modern Electric Power Systems (MEPS'10).

[11] Akanksha, P., Karishma, G., Ramesh, P. (2012). Modeling of impedance relay using PSCAD/EMTDC. International Journal of Research in Engineering and Applied Sciences, 2(2): 921-939.

[12] Al-Rifaie, A.H., Ibrahim, M.A., Abdullah, H.A.T. (2022). Design and implementation of differential relay based on
graphical user interface. Przegląd Elektrotechniczny,
98(7): 188-192. https://doi.org/10.15199/48.2022.07.31

[13] Idris, M.H., Hardi, S., Hasan, M.Z. (2013). Teaching distance relay using Matlab/Simulink graphical user interface. Procedia Engineering, 53: 264-270. https://doi.org/10.1016/j.proeng.2013.02.035

[14] Tun, W.W., Lin, O.Z., Yin, H.S. (2019). Modelling and simulation of Mho type distance relay for high voltage transmission line protection using MATLAB software. Journal of Advanced Research in Electrical Engineering, 3(2): 97-103. https://doi.org/10.12962/j25796216.v3.i2.91

[15] Wu, L.C., Liu, C.W., Chen, C.S. (2005). Modeling and testing of a digital distance relay using MATLAB/SMULINK. In Proceedings of the 37th Annual North American Power Symposium, Ames, IA, USA, pp. 253-258. https://doi.org/10.1109/NAPS.2005.1560534

[16] Aker, E.E., Othman, M.L., Aris, I., Wahab, N.I.A., Hizam, H., Emmanuel, O. (2020). Transmission line fault identification and classification with integrated FACTS device using multiresolution analysis and naïve Bayes classifier. International Journal of Power Electronics and Drive Systems, 11(2): 907-913.

https://doi.org/10.11591/ijpeds.v11.i2.pp907-913

[17] Ferdous, F. (2018). Zone protection system of transmission line by distance relay using Matlab/Simulink. In 2018 International Conference on Advancement in Electrical and Electronic Engineering (ICAAEE), Gazipur, Bangladesh, pp. 1-4. https://doi.org/10.1109/ICAAEE.2018.8642978

[18] Rambabu, V.A.M., Venkatesh, M., Siva Kumar, V. (2015). Three zone protection by using distance relays in SIMULINK/MATLAB. International Research Journal of Engineering and Technology, 2(5): 810-819.

[19] Dutta, S., Chanda, S., De, A. (2021). Design and development of three-zone distance relay protection scheme at MATLAB platform. Journal of the Institution of Engineers (India): Series B, 102(1): 31-40. https://doi.org/10.1007/s40031-020-00505-1

[20] The MathWorks. (2017). Matlab App Building R2017a. The MathWorks, Inc.

[21] Al Kazzaz, S.A.S., Ismael, I., Mohammed, K.K. (2020). Fault detection and location of power transmission lines using intelligent distance relay. International Journal of Power Electronics and Drive Systems, 11(2): 726-734. https://doi.org/10.11591/ijpeds.v11.i2.pp726-734