Hardware for classification of power quality problems in three phase system using Microcontroller

: Power quality is a growing concern as the number of electric sensitive loads is increasing day by day in all fields. Poor power quality is badly affecting sensitive loads causing instability, malfunctioning, loss of data and great loss of economy. Thus, there is a need to improve power quality for which it is required to identify power quality problems occurring in the power system. This paper presents a low cost hardware to detect and classify most occurring power quality problems in the power system such as voltage sag, swell, interruption and unbalance using PIC microcontroller 18F452 for a 3-phase system. An algorithm is developed and the program is written into the microcontroller for classification. The program checks the conditions of the power quality problems based on the magnitudes of 3-phase voltages and classifies them. The sys-tem mainly consists of voltage sensing unit and microcontroller which senses 3-phase voltages, identifies the problem and gives output through LCD display, buzzer and LEDs showing type of power quality problem and p.u. voltage values. The circuit also trips load during power quality problems and connects it during normal conditions. The outputs of the hardware are given for various cases of the power quality problems.


PUBLIC INTEREST STATEMENT
An electrical power system is expected to deliver undistorted sinusoidal rated voltage and current continuously at rated frequency to the end users for proper functioning of the equipment. However, various Power Quality (PQ) disturbances in the power system, such as voltage sag, swell, interruption, unbalance, etc. cause malfunctioning of the devices, damage to equipment, scrambling of data and may even cause shut down of manufacturing processes. Therefore, it is important to detect and classify PQ events to take counter measures against them and improve power quality. This paper presents a low cost, compact & standalone digital system using microcontroller for detecting and classifying potential PQ events of sag, swell, interruption and unbalance in a 3-phase system. The hardware clearly shows the type of PQ problem occurring in the system through LCD message. Persons are alerted through buzzer sound and LEDs activation. The load is also protected by disconnecting it during PQ events.

Introduction
Now-a-days, electrical equipment ranging from personal computers to automated manufacturing process are more susceptible to power quality problems. Thus, power quality has become the main interest of the power systems research community. In an electrical network, power disturbances such as sag, swell, unbalance, interruption, harmonic distortion, flicker and transient are causing adverse impact on customer devices. The effects are malfunctioning of equipment, scrambling of data, interruption in communication, a frozen mouse, equipment failure and cost of lost production (Aswathy & Jayabarathi, 2014;Won, Ahn, Chung, Kim, & Moon, 2003). Use of solid state converters and nonlinear electronic loads are introducing harmonics, notches and transients into the power signals (Dey, Chatterjee, Chakravorti, & Munshi, 2008;Frankowiak, Grosvenor, & Prickett, 2005;Tong, Song, Lin, & Zhao, 2006).The main reasons of the power quality problems are lightning strikes, trees falling on the lines, lines short circuit faults, transformers energising, starting of large capacity induction motors, routine switching operations or human error (Ding, Cai, Suo, Wang, & Xu, 2009). Blackouts are regarded as low-probability events but they carry immense socioeconomic costs. In such events, the burden of responsibility often lies with extreme weather events, cascading failures, or similar low-probability, high-impact incidents. The resilience of the power grid against rising incidences of extreme weather such as thunderstorms, hurricanes, and blizzards predicted by climate models can be enhanced through microgrid facilities (Gholami, Aminifar, & Shahidehpour, 2016).
Power quality is a set of boundaries of electrical properties that allows electrical systems to function in their intended manner without significant loss of performance or life. Quality power supply is the one which is made available, within the voltage and frequency tolerances with a pure sinusoidal waveform (Valluvan, 2009). Power quality monitoring systems are very important for the appropriate functioning of the power system network. With the use of digital measurement technology, the quantity of accessible information about waveforms of currents and voltages increases (Wcislik, Kazala, & Laskawski, 2010). By sensing, detecting, classifying and characterising different power quality problems (Asha Kiranmai & Jaya Laxmi, 2014, 2015, 2016Biswal, Dash, & Panigrahi, 2009;Dalai, Chatterjee, Dey, & Chakravorti, 2013;Masoum, Jamali, & Ghaffarzadeh, 2010), the sources of power quality disturbances can be known. This helps in maintaining good power quality by introducing power electronic equipment at suitable locations to mitigate the problems occurring in the system.
In Tunaboylu, Collins, and Chaney (1998) and Xiangning, Yonghai, and Lianguang (2000), sag was extracted using a low pass filter and instantaneous reactive power theory. But these methods are hard to be implemented using a microcontroller or digital signal processor. In Vetrivel, Jovitha, and Malmurugan (2013), mathematical models were developed and voltage sags and voltage swells were detected in single phase power supply. Later, low cost microcontroller based systems were developed to detect sag, swell in single phase system (Baby Shalini, 2014;Santhanayaki & Valluvan, 2013;Saranya, Sriranjane, & Vanitha, 2014). These works didn't cover the detection of other most occurring problems of interruption and unbalance. Also, hardware systems were built to detect problems in only single-phase system, but considering problems in a three-phase system are more practical. Thus, taking into account all the three phase voltages, a simple and cost effective hardware is presented here for the classification of power quality problems in three phase system. Along with voltage sag and swell classification, the hardware classifies interruption and unbalance also. A microcontroller based hardware system is designed for this purpose. The system is standalone, compact, low cost and the designed hardware is not complex when compared to other systems. Microcontroller used in this hardware is PIC18F452 which is low cost, high speed, low power consumption and easy handling device. This paper is organised as follows: Section 2 deals with block diagram representation of the circuit and describes the functionality of each block. The circuit diagram and its sub-circuits are explained in Section 3. Algorithm used for the classification is described in Section 4. Section 5 shows the developed hardware setup. Hardware testing and results during normal condition and power quality problems are discussed in Section 6. The final conclusions are drawn in Section 7.

Block diagram
Block diagram representing various building blocks and their interconnection for the classification of power quality problems is shown in Figure 1. The main component, PIC Microcontroller is powered from a regulated power supply which provides constant 5 V DC from 230 V AC supply. Microcontroller receives three input signals corresponding to three phase voltages from voltage sensing unit. The program written in microcontroller checks the voltage signals and gives signals to output devices: Liquid Crystal Display (LCD), Light Emitting Diodes (LEDs), buzzer and the load relay. The relay is activated and load is switched ON only under normal condition. The faulty conditions of voltage sag, swell, interruption and unbalance are indicated by the respective LEDs, buzzer sound and LCD display message. LCD clearly indicates the type of power quality problem occurred along with the p.u. voltage values. Figure 2 shows the circuit for classification of power quality problems. The overall circuit diagram comprises six sub-circuits: Regulated DC power supply circuit, Voltage sensing unit, LCD interfacing circuit, Buzzer interfacing circuit, LED interfacing circuit and Relay interfacing circuit. The functionality of each sub-circuit is explained as follows:

Regulated DC power supply circuit
In electronic systems, AC input voltage should be converted to DC voltage with the correct value and degree of stabilisation. The common DC voltages that are required to power up the devices are generally in the range of 3-30 V DC. Typically, the fixed types of DC voltages are 5, 9, 12, 15, and 18 V. The regulated power supply unit converts AC to constant 5 V DC to give supply to the microcontroller.
230 V, 1-phase AC supply is given to step down transformer which step downs to 12 V AC. This 12 V AC supply is given to the diode bridge rectifier which converts AC supply to DC supply. The DC supply is passed through a filter which removes ripples in unidirectional supply from the bridge rectifier. The filtered DC supply is given to 7805 regulator to regulate the voltage at 5 V and is given to power the PIC Microcontroller.

Voltage sensing unit
The voltage sensing unit senses 3-phase AC voltages and converts them into the required form to be given to the microcontroller for processing. 230 V AC supply is stepped down to 12 V AC by using a transformer. 12 V AC is rectified, filtered and regulated to 5 V DC by using the diode bridge rectifier, filter and voltage regulator respectively. Three voltage signals obtained from the three voltage sensing units are given to analog to digital converter pins of PIC18F452 microcontroller, to generate three digital signals internally required by the microcontroller. Here, three potentiometers (R-POT, Y-POT and B-POT) one for each phase, are used at the output of regulators to generate different voltage conditions to be given to the microcontroller for classification of power quality problems. Voltage can be varied from 0 to 5 V using POTs. Microcontroller is programmed to take the low voltage level of 0 V as 0.0 p.u. and the high voltage level of 5 V as 1.8 p.u. This enables it to detect both under and over voltages of wide ranges.

LCD interfacing circuit
A 16 × 2 LCD is used to display normal and abnormal conditions along with the voltage values in p.u. The LCD is connected to port B terminals of the microcontroller. LCD receives signals from microcontroller and displays as "NC", "SAG", "SWELL", "INTERRUPTON" and "UNB" for normal condition, voltage sag, swell, interruption and unbalance condition, respectively.

Buzzer interfacing circuit
A piezo electric buzzer is used to give an audible sound whenever voltage sags, swell, interruption or unbalance is detected in the system. The buzzer is connected to the microcontroller through an NPN transistor. The base of the transistor is connected to the microcontroller D1 pin. When any of the power quality problems occur, D1 goes high activating the transistor and thus the buzzer.

LED interfacing circuit
Four different coloured LEDs are used to indicate different power quality problems occurring in the system. Red, yellow, white and green coloured LEDs are connected to microcontroller D2, D3, C4 and C5 pins respectively. Here, red, yellow, white and green LEDs indicate the occurrence of voltage unbalance, sag, swell and interruption, respectively. The microcontroller activates the corresponding LED when any power quality problem occurs.

Relay interfacing circuit
An electromagnetic relay is used to protect the load under power quality problems by disconnecting it from the supply. The relay interfacing circuit consists of an NPN transistor, relay and the load. DC supply is connected to the relay coil through NPN transistor, and AC power supply is connected to the load through relay output terminals. The transistor base is connected to the microcontroller D7 pin. During normal conditions, D7 is high, the transistor is ON and hence relay coil is energised. The load gets AC supply through terminals of the relay. During any of the power quality problems, D7 goes low, switching OFF the transistor and thus de-energising relay coil. The terminals of the relay get opened, thereby disconnecting the load from the AC supply.

Algorithm for detection of power quality problems
The algorithm of the program written in microcontroller for the classification of power quality problems is as follows: (1) Initially, set D7 high to activate the relay and to switch ON load; set D1 low to deactivate buzzer; set D2, D3, C4 and C5 low to deactivate LEDs; activate LCD though B2 to B7 and display "DETECTION OF VOLTAGE PROBLEMS" on it.
(2) Read the voltage signals of R, Y and B phases from voltage sensing unit through port-A pins-A0, A1 and A2.
(3) If the voltages are unbalanced, go to step 4 otherwise go to step 5.
(4) Reset D7 to low, set D1, D2 high and display "UNB", percentage of unbalance and the three phase voltage values in p.u. on LCD. Go to step 2.
(5) If the voltage values are between 0.9 and 1.1 p.u., display "NC" and p.u. voltage values on the LCD indicating normal condition. Then, go to step 2 else go to step 6.
(6) If the voltage values are between 0.1 and 0.9 p.u., reset D7 to low, set D1, D3 high and display "SAG" and p.u. voltage value of the sag on LCD. Then go to step 2 otherwise go to step 7.
(7) If the voltage values are between 1.1 and 1.8 p.u., reset D7 to low, set D1, C4 high and display "SWELL" and p.u. voltage value of the swell on LCD. Then go to step 2 otherwise go to step 8.
(8) If the voltage values are less than 0.1 p.u., reset D7 to low, set D1, C5 high and display "INTERRUPTION" and p.u. voltage value of the interruption on LCD. Then go to step 2.
The program for microcontroller is coded in Embedded C language using PIC compiler software. The program is then compiled and is converted into hex code. The hex code is dumped into the microcontroller by using Proteus software by connecting a dumper. Figure 3 shows the hardware setup that is arranged to conduct the experiments to test the performance of the hardware built up. To generate power quality problems with varied magnitudes, three potentiometers of 100 kΩ are used at the outputs of rectifiers in three phases. The resistances of these potentiometers are varied to get different voltage conditions. A PIC18F452 microcontroller is used to store and execute the program written for classification of power quality problems based on the inputs received from the potentiometers. Microcontroller is interfaced with LCD, buzzer and LEDs for indicating the occurrence of power quality problems. A 10 W lamp is used as a load which gets switched ON or OFF based on the signal given by the microcontroller to load relay. The hardware constructed is compact and low cost, which costs around ₹1,200 only.

Hardware testing and results
Hardware is tested for different voltage conditions such as normal voltage, voltage sag, swell, interruption and unbalance conditions.

Normal condition
Hardware is tested without any power quality disturbance. Normal condition is created in the hardware by varying the three potentiometers to obtain voltages in the range of 0.9-1.1 p.u. Figure 4 shows the output for one of the settings of the potentiometers. It is observed that the lamp load is ON and the LCD shows normal condition and voltage values displayed for three phases are 1.00, 1.00 and 1.00 p.u. The buzzer and LEDs are OFF which indicates no disturbance in the system.

Voltage sag condition
Hardware is tested for voltage sag condition by setting the input voltages between 0.1 and 0.9 p.u., by decreasing the resistance of potentiometers. The output for one of the settings is shown in Figure 5. The LCD displayed sag condition with sag voltage of 0.60 p.u. The sag condition is also indicated through activation of buzzer and yellow LED. Relay got OFF and lamp load is disconnected from the supply.

Voltage swell condition
Swell condition is created by increasing the resistance of potentiometers, i.e. the voltages are set between 1.1 and 1.8 p.u. The output for one of the settings is shown in Figure 6. The LCD displayed swell condition with swell voltage of 1.42 p.u. The buzzer is activated and white LED has switched ON. The relay is switched OFF and load is disconnected from the supply.     1.20 p.u., 1.00 p.u., 1.10 p.u.

Interruption condition
Hardware is tested for interruption condition, by setting the input voltages below 0.1 p.u., by reducing potentiometers' resistances. The output observed is shown in Figure 7. The LCD displayed interruption condition with voltage of 0.00 p.u. The interruption condition is also indicated through activation of buzzer and green LED. Relay tripped off the load from the supply.

Voltage unbalance condition
Unbalance condition is created in the hardware model by varying the three potentiometers differently. The output for one of the settings is shown in Figure 8. The LCD displayed unbalance condition with 30.76% of unbalance percentage and three phase voltage values of 1.2, 1.8 and 1.12 p.u. The buzzer got activated and red LED has switched ON. The relay is tripped OFF and load is disconnected from the supply.
The outputs of the hardware are observed by testing it for different voltage conditions and some of the values noted for each condition are summarised in Table 1.

Conclusion
The hardware for classification of power quality problems in a 3-phase system is constructed and tested. The test outputs show that the hardware circuit correctly detected normal conditions, voltage sags, swells, interruptions and unbalances. When normal conditions occur in the system, LCD indicates the condition and the 3-phase p.u. voltages. During sags, swells and interruptions, LCD indicate the type of power quality problem and the magnitude of the voltage in p.u. In the event of unbalance conditions, LCD displays the condition, unbalance percentage and the 3-phase p.u. voltage values. During all the power quality problems considered, relay tripped OFF the load from the supply, buzzer is activated to alert the persons informing that some fault has occurred in the system. Different coloured LEDs got switched on for different power quality problems, thus giving the indication about the type of disturbance occurring in the system. This hardware system is simple, secure, standalone and low cost. The proposed method is simple, convenient and less expensive compared to very expensive data acquisition systems. It can be easily operated by anyone who knows nothing about the software in it. The classification helps in taking effective steps to mitigate the effects of power quality problems.