A Power Quality Monitoring System Via the Ethernet Network Based on the Embedded System

The problems about power quality have increasingly caused a failure or a malfunction of the end user equipment for the past few years up to now. The problems have concerned with either voltage or current frequency deviation. To have the power quality monitoring done flowingly and completely, the measurement takes an important role on voltage, current, frequency, harmonic distortion and waveforms. Many researchers have used methods of power quality measurement (Dugan et al., 2002; Baggini, 2008) while other researchers have used various protocols to control the system (Auler & d’Amore, 2002). Others have presented the data acquisition based on PC (Batista et al., 2003) or Power Line Communication (Hong et al., 2005) or TMS320CV5416 DSP Processor (Rahim bin Abdullah & Zuri bin Sha’ameri, 2005). Another researcher has applied ARM and DSP processor (Yang & Wen, 2006) or has only applied DSP processor (Salem et al., 2006) to monitoring power quality in real time. In the meantime, the detecting fault signals of power fluctuation in real time and a power quality monitoring for real-time fault detection using real-time operating system (RTOS) are proposed (Yingkayun & Premrudeepreechacharn, 2008,2009) and the low cost power quality monitoring system is suggested (So et al., 2000; Auler & d’Amore, 2009), for example. This chapter has developed the idea of power quality monitoring system via the Ethernet network based on the embedded system with the two selected ARM7 microcontrollers: ADUC7024 and LPC2368. On account of ADUC7024, it has a function of sampling waveforms and of writing the sampling signals to the external memory. Meanwhile, LPC2368 can execute the main tasks: detecting the fault signals; storing fault data in SDCARD up to 2 GB; and communicating with PC or laptop via the Ethernet network. The power quality monitoring on the embedded system suggested can acquire the voltage, the status and the frequency. It can send them via network at real time, can operate as stand alone equipment and can display the fault signals in real time of power fluctuation. But anyhow, when being absent, we can download the fault data from the site place, depending on the program configuration. In this case the fault signals can be displayed on the screen of the PC or laptop at real time or can be done after as desired. Moreover, there can be a single


232
phase or a 3-phase voltage measurement supported by the power quality monitoring hardware.When working in different places, we can establish the network in various sites and connect via the Ethernet network from a single PC or laptop.The network has the capability to send from the board site to the PC or laptop with high speed up to 100 megabit per second (Mb/ s).Nevertheless, it is easy to monitor the power quality monitoring system via the Ethernet network from PC or laptop.This chapter is organized as follow: Section 2 is the architecture of the power quality monitoring being composed of 2 sets of ARM7 microcontroller boards, 3 signal conditioning modules, external memory board and energy measurement board.Section 3 is the embedded software design with the details of sampling concept, power quality monitoring concept, data frames, configuration data and Ethernet packet structures.Section 4 is the application software to interface the power quality monitoring hardware.Section 5 is the experimental results which are displaying the fault signals from AC lines while being on operation or being done after.Section 6 is the conclusion from the research with the future work suggestion.

Architecture of the power quality monitoring system
The architecture of the power quality monitoring system is planned for specific purposes which are to detect, to store, to download and to display the fault signals while being on operation or being done later on.The main structures are divided into 5 circuit boards.The block diagram of the architecture of the power quality monitoring system is shown in Fig. 1.

Signal conditioning modules (HCPL-788J)
There are actually 3 signal conditioning modules with 3 HCPL-788J integrated circuits for measuring the voltage of the three-phase AC lines in order to send the attenuated AC voltage to the waveform sampling board which the ADUC7024 microcontroller is embedded in.The 3 signal conditioning modules have used the same electronic circuit.The signal conditioning circuit is shown in Fig. 2. Fig. 2. The circuit of the signal conditioning module

The voltage and frequency measurement and fault detection board (ADE7758)
This board is the key part of monitoring system of fault detection which refers to sags and overvoltages.In this chapter, ADE7758 integrated circuit has been chosen to operate because of its suitable qualification to detect the fault signals in time.The circuit of the board is shown in Fig. 3.

Microcontroller boards (ADUC7024 and LPC2368)
As it is known that the embedded system with the two selected ARM7 microcontrollers which are ADUC7024 and LPC2368 are the developed microcontroller boards, using in this chapter.The first board is used for sampling waveforms and for writing the sampling signals to the external memory and the latter is used for various purposes: (1) reading voltage, frequency and fault detection from ADE7758; (2) storing fault data in SD-CARD up to 2 GB, for communicating with PC or laptop via the Ethernet Network and; (3) controlling the sampling process of the ADUC7024 board.The picture of the two microcontroller boards are shown in Fig. 4 and Fig. 5.

External memory board (AL440B)
This external memory board is one device of this power quality monitoring architecture to collect the fault data from ADUC7024 microcontroller into its memory in series.The data will be read by the LPC2368 microcontroller board and will be stored in SD-CARD for recalling or downloading later via the Ethernet network when of necessity needed.The circuit of the external memory board is shown in Fig. 6.

The process of the power quality monitoring system
The picture of the power quality monitoring system hardware is shown in Fig. 7, consisting of five parts as the followings: 1.The voltage and frequency measurement and fault detection board (ADE7758) 2. Signal conditioning module board (HCPL-788J) 3. ADUC7024 microcontroller board 4. LPC2368 microcontroller board 5. External memory board (AL440B) From the architecture planned, the 3-phase AC lines connect to ADE7758 and to HCPL-788J for being measured of their voltages and frequencies by the ADE7758 board which is interfaced with the LPC2368 microcontroller board in order to acquire the voltage and frequency values and also to initialize the ADE7758 for detecting fault signal at one time.Then the HCPL-788J attenuates the voltage inputs and isolates the output signals.After that, the output signal is sent to become the signal inputs to the ADUC7024 microcontroller board for sampling waveforms and writing the sampling signals to the external memory board.In the ordinary state, the ADUC7024 microcontroller board will do the sampling and will write the data frames continuously, and in the same time, the LPC2368 microcontroller board will attain the voltage and frequency data from ADE7758, as well.Fig. 7.The power quality monitoring system hardware If the fault signal which is detected , in case, is an uncommon state, LPC2368 microcontroller board will control the ADUC7024 board to stop sampling and writing process temporarily, will read the sampling signal from the external memory board and will store the signal into SD-CARD.When it comes to the normal condition, both the microcontroller board will go back to their usual tasks as before.In case of the network that has the connection with Transmission Control Protocol/ Internet Protocol (TCP/ IP) and User Datagram Protocol (UDP) is established between the LPC2368 and the PC or laptop, we can monitor the status of power quality monitoring system hardware via the network in real time.In addition, the fault data can be downloaded from the SD-CARD and displayed later when it is necessarily needed.

Embedded software design
The embedded software design is a flowchart of the two selected microcontrollers: ADUC7024 and LPC2368 used in this chapter.It is to explain the process of the power quality monitoring system based on the embedded system.For this embedded software design, there are the sampling concept, the power quality monitoring concept, data frame and the Ethernet packet structures.

Sampling concept
The flowchart of the sampling concept shown below is to illustrate how the concept direction works according to the objectives of this chapter.

Fig. 8. Flowchart of the sampling concept
To explain the process of the sampling concept flowchart in Fig. 8., it is supposed to follow as the picture shown.After the used registers and utilized variables have been initialized, the procedures will work according to the conditions.That is, if the sampling condition is on operation, the procedure will do the sampling from the analog signals to the digital ones of the 3 channels.And the next procedure is to write the digital sampling data which are packed in the form of data frames to the external memory board.But if the counted data packet from the frame count value is excessive over the maximum limit, it will seek to the beginning of the first address in the external memory.Meanwhile, the data packet which is counted will be cleared.And if the counted data packet does not reach to the limit value, it will return to the sampling condition for rechecking.In case, the sampling condition is off-operation, it will change the content of the data frame, will write it to the external memory and will return to the sampling condition to be rechecked.The procedures with the two sampling conditions mentioned above are done repeatedly time after time.

Power quality monitoring concept
It is generally a conceptual method to monitor power quality used with the embedded system of LPC2368 microcontroller board as shown in the flowchart of Fig. 9.

Fig. 9. Flowchart of the power quality monitoring concept
To run the flowchart in order, it must initialize the network chip on LPC2368 microcontroller board, SD-CARD, real-time clock, the RTOS tasks that are modified from A Power Quality Monitoring System for Real-Time Detection of Power Fluctuations (Yingkayun & Premrudeepreechacharn, 2008) and ADE7758 board to get ready for operating its functions.Next, LPC2368 microcontroller sends a control signal to ADUC7024 microcontroller board in order to start doing the sampling process.It reads the voltage and frequency data from ADE7758 board.In case, there is no any fault signals, which are read by LPC2368 microcontroller, the display information of the following values: the data of voltage; frequency; date; time; status and so on, will be sent via network to PC or laptop when it is connected.The LPC2368 microcontroller will take turn to operate its function repeatedly from the start once more.But if ADE7758 board detects the fault signals, it will send the fault signal to LPC2368 microcontroller which stops the sampling process, then, reads the fault data from the external memory board and writes the fault data in SD-CARD for storing.The fault data will be sent to PC or laptop via network when it is connected.LPC2368 microcontroller will start doing the process once more after receiving the next fault signals.

Data frame
The data frame, sending to the external memory board, is defined with the head byte, the samples of the 3-phase voltages with 12-bits A/ D resolution and the tail byte.The data frame content is shown in Fig. 10.To calculate the floating point voltages from a raw A/ D sample, it can be expressed by the computer.Actually, this application gets the display information from the hardware mentioned above and then displays on the PC or laptop screen via the Ethernet network.The application can set date and time and can also receive the fault data from the referred hardware via the Ethernet network.The ordinary state and the uncommon one of the power lines are displayed by application software on PC or laptop shown in Fig. 12 and Fig. 13 respectively.And the researchers have developed the application software for displaying the fault signal which is sent from the monitoring hardware to PC or laptop in order to illustrate the fault data.This developed application software can either save in picture file or print out to take the data under the considerable analysis of the cause in the faults at later time.The developed application software is shown in Fig. 14.

Experimental results
In order to communicate to the power quality monitoring hardware, application software is created to display and to plot the waveform.The application software connects to the monitoring hardware via the Ethernet network.It both gets the display information and saves the fault data to PC or laptop.It also shows the fault waveforms on the PC or laptop screen.The communication procedure connecting between a monitoring hardware to PC or laptop is to get the necessary information which is executed in the following steps: 1.A user sends a request signal with the application program to the power quality monitoring hardware.2. The power quality monitoring hardware receives the request signal and establishes the connection to PC or laptop.3. The power quality monitoring hardware sends the information to PC or laptop for displaying.4. If any fault occurs, the fault data will be saved into the PC or laptop storage in the specific path.5.A user can take the application software to display the fault waveform for investigating the problem in power lines from the saving path above.When the connection procedures have been already established between the hardware and the computer in consequence, the user can monitor the voltage, the frequency and the fault in power lines on the PC or laptop screen from the remote site.Additionally, the user can also open the data file which is saved in the computer.Another experiment of this chapter is applied to detect the fault on a single phase system.From Fig. 17 shown above is an example of the interruption for a short time.

Conclusion and future work
A power quality monitoring system via the Ethernet network based on the embedded system has been proposed in this chapter in order to monitor the power quality in case of faults detection and also to measure voltage and frequency in power lines.ADUC7024 and LPC2368 of ARM7 microcontroller are selected to apply in the power quality monitoring system for not only detecting the fault signals that cause any problems in either the system or the end user equipment but also reading and writing them in real time of power fluctuation.Moreover, the fault signal data can be sent and stored in SD-CARD to display later on the screen of PC or laptop at the site place.However, the users can download and analyze the fault signal data which have already sent and stored in SD-CARD via the Ethernet network using TCP/ IP and UPD protocol at some other time when of necessity needed.For future work, the researchers tend to substitute ARM7 with ARM9 in order to monitor power quality and to detect the transient in power lines.In any case, the researchers have always concerned with the same primitive ideas and objectives.

Fig. 1 .
Fig. 1.Block diagram of the architecture of the power quality monitoring system

Fig. 3 .
Fig. 3.The circuit of the voltage and frequency measurement and fault detection board

Fig. 6 .
Fig. 6.The circuit of the external memory board

Fig. 10 .
Fig. 10.Data frameThe example of data frame structure which is written in C structure format is shown below:

Fig. 14 .
Fig. 14.Application software for waveform display Fig. 15.(a) Voltage sags on phase A,B and C, (b) Voltage sag on phase A, (c) voltage sag on phase B and (d) voltage sag on phase CFor more advantage, the communication of the power quality monitoring hardware and PC or laptop is not only limited with the only one hardware but also connected to other hard- .