SciELO - Scientific Electronic Library Online

 
vol.42 número1Contribución marginal de factores a las ganancias de energía de los paneles bifacialesMejoras a las protecciones de los Grupos Electrógenos MAN. Caso de estudio Centra Ariguanabo índice de autoresíndice de materiabúsqueda de artículos
Home Pagelista alfabética de revistas  

Servicios Personalizados

Revista

Articulo

Indicadores

  • No hay articulos citadosCitado por SciELO

Links relacionados

  • No hay articulos similaresSimilares en SciELO

Compartir


Ingeniería Energética

versión On-line ISSN 1815-5901

Energética vol.42 no.1 La Habana ene.-abr. 2021  Epub 01-Mar-2021

 

Trabajo Teórico Experimental

Harmonic detection and energy optimization of electrical installations using an Arduino microcontroller system

Detección de armónicos y optimización energética de instalaciones eléctricas mediante un sistema de microcontrolador Arduino

José Leovaldo da Silva Mello1 
http://orcid.org/0000-0003-1900-0791

Douglas Antônio Amâncio1 
http://orcid.org/0000-0002-9890-9508

Michel Chagury1 
http://orcid.org/0000-0002-8409-3499

Luiz Antônio Rasia2 
http://orcid.org/0000-0001-8334-0956

Humber Furlan1  * 
http://orcid.org/0000-0001-9686-0133

Mariana Amorim Fraga3 
http://orcid.org/0000-0001-6976-8550

1Centro Estadual de Educação Tecnológica Paula Souza, São Paulo, Brazil.

2Universidade Regional do Noroeste do Estado do Rio Grande do Sul, Ijuí, Brazil.

3Universidade Federal de São Paulo, Brazil.

ABSTRACT

Solutions for harmonic problems in electrical distribution networks have been frequently discussed in the recent literature. This article evaluates the use of Arduino microcontroller system connected with the power grid to reduce harmonic distortions and power factor correction. For this, it was developed a system capable of distinguishing the harmonic components of up to 13th order in a single-phase electrical system (phase-neutral) taking readings of voltage and electric current using an Arduino Due board based on a 32-bit ARM core microcontroller. We seek to analyze and propose corrections for harmonic distortions into small frames by implementing a parallel active filter to be used in harmonic elimination, as well as reactive compensation and load current balancing. The results demonstrated that a control strategy was achieved without requiring a long time in the data analysis or delay time in measurement and corrections.

Keywords: Arduino microcontroller; Fourier analysis; harmonic detection; electric power correction

RESUMEN

Las soluciones para los problemas de armónicos en las redes de distribución eléctrica se han discutido con frecuencia en la literatura reciente. Este artículo evalúa el uso del sistema de microcontrolador Arduino conectado a la red eléctrica para reducir las distorsiones armónicas y la corrección del factor de potencia. Para ello, se desarrolló un sistema capaz de distinguir los componentes armónicos de hasta 13o orden en un sistema eléctrico monofásico (fase-neutro) tomando lecturas de voltaje y corriente eléctrica utilizando una placa Arduino Due basada en un ARM de 32 bits. microcontrolador central. Buscamos analizar y proponer correcciones para distorsiones armónicas en pequeños marcos implementando un filtro activo paralelo para ser utilizado en eliminación de armónicos, así como compensación reactiva y balanceo de corriente de carga. Los resultados demostraron que se logró una estrategia de control sin requerir mucho tiempo en el análisis de datos ni retrasos en la medición y correcciones.

Palabras clave: Microcontrolador Arduino; Análisis de Fourier; detección de armónicos; corrección de potencia eléctrica

INTRODUCTION

The use of devices with non-linear charges has increased among the consumers, promoting distortions in the distribution line of electricity. Electric components such as controlled rectifiers, reactors, current and voltage inverters, switched mode power suppliers, have contributed to the quality decrease in the energy supply due to reactive generation and the draining in the lines with high harmonic content.

Harmonic currents interact with the electrical impedance in the line, provoking new harmonics e voltage failures. This interaction may lead to neutral currents in balanced charges or to the devices overheat. These distortions also may lead to fluctuations of short-term voltage, power factors and voltage unbalance.In the installations mentioned above, it is important to mitigate possible existing distortions, because when new loads are connected, pre-existing distortions can be created or increased, as the effect can spread throughout the plant. Thus, for better energy production, it is of fundamental importance to monitor and minimize the effects of low power factors and distortions by harmonic currents.

Quality problems of power are manifested in temporary or stationary voltage or frequency deviations, such as impulsive or oscillatory transients, voltage drops, ripples, harmonics, rectifiers, and imbalances that cause discomfort to consumers and economic losses for industries 1. The electric energy produced by alternating voltage generators is sinusoidal. The power quality (PQ) is fundamental in an electric power system. Guaranteeing the PQ means keeping the electric current purely sinusoidal and in phase with the sinusoidal electric voltage. PQ declines due to current and voltage harmonics, high power factor, voltage drops, voltage increases, voltage fluctuations, and interruptions 2. Electrical components such as controlled rectifiers, reactors, voltage, and current inverters, switching sources, have contributed to the fall in the PQ in electrical power systems, not only by the generation of reactive but also by draining current networks with high harmonic content. The harmonic currents generated in the system, when interacting with the line impedance, create distortions in the power waveform that is made available to users connected to the electrical system. Effects such as the appearance of neutral currents in balanced loads or excessive heating of transformers and motors can be noticed. These distortions can cause short-term voltage variations, increased power factor, voltage fluctuations and imbalances 3.

In three-phase circuits, the odd harmonic currents in the neutral are added instead of cancelling out, in some situations these currents can reach amplitudes greater than the phase currents, causing heating and damage to the insulation of the neutral conductor 3. Pulse width modulated power converters are widely used in energy conversion applications, for example, uninterruptible power supply systems, no breaks, renewable energy converting sources, solar panels, and other power electronics applications that are elements that cause distortions in the power grid. These power supply systems suffer from various modelling and frequency fluctuation disturbances in practical applications. The control method for these systems must be stable and robust in the face of frequency fluctuations and load variations 4. However, the use of these devices is justified, since the benefits resulting from their use are much more visible than the harmful effects caused. Despite this fact, the proliferation of electronic equipment that operates as non-linear loads causing harmonic distortions in the currents and voltages of the electrical systems has been relevant in the world electrical sector. Under these perspectives, increasingly, the harmonic currents generated by predominantly domestic consumers are being added to those emitted by industrial complexes and consumers in the service sector. This fact has systematically contributed to the loss of quality of the electricity available, resulting in serious consequences for consumers and companies in the electricity distribution sector 2) .Harmonic currents increase hysteresis losses, eddy currents, and losses in the cores of generators, transformers, and induction motors, causing circuit breakers, fuses, protection relays, and control systems to malfunction. Harmonics affect power quality and increase system losses by up to 20% 1.

Controlling power quality, directly connected to the power grid, has been a major challenge and is acquiring more and more skills. The reduction in power fluctuations leads to a decrease in the low-frequency oscillation current. As a result, the reduction of low-frequency ripple also decreases the average current and temperature, increasing the useful life of the installation components, increasing their durability 5. The use of non-linear loads in industrial, commercial, and residential applications requires a supply of reactive and harmonic energy that reduces losses and maintains the quality of energy in the system. Conventional compensation approaches, such as passive filters, synchronous capacitor banks, and others, are implemented to improve energy quality 2. An alternative to minimize these power quality problems would be to employ the use of parallel active power filters. This solution is very efficient for the correction of harmonic voltage distortion 3. In this context, the objective of this article is the development of a prototype to analyze the power quality in low voltage systems through an intelligent measurement and correction system in a low-cost platform.

THEORETICAL BACKGROUND

Parallel Active Power Filters (PAPF)

The purpose of using parallel active power filters (PAPF) is to reduce the currents of the non-linear loads of the power system together with improving the power factor. The active filter is designed not only to reduce the current that contains harmonics but also to reduce the power factor on the side of the alternating current 6. A robust method should be used to analyse the harmonic currents so that the filters operation is adequate. The PAPF algorithms must be insensitive to variations in real systems 7. The numerical algorithm most used to estimate harmonic distortion is the discrete Fourier transform. However, it cannot be applied in real-time because it requires the collection of a significant number of samples to make the estimate.

In control methods for active damping in the network, the use of PAPF is proposed, with the function of mitigating the effects of harmonic distortion. The purpose of acquiring signals is not to change the system's signal, but to obtain accurate information that can help decision making. To achieve this goal, harmonic scaling is performed in the model of Taylor-Kalman-Fourier filters 8. The PAPF is formed by a power interface with the network, responsible for injecting or draining the currents in the power system, and a control loop, responsible for coordinating the current level injected into the network.

The harmonic acquisition is one of the most important parts of parallel active power filters (PAPF). One of the most used harmonic acquisition methods is based on the theory of instantaneous reactive power. This method is easy to implement, but the extracted harmonics are mixed, which makes them devoid of flexibility. Recently, the use of different versions of the transformation matrices has started to be used to take harmonics into account. The discrete wavelet transform is one application of this method of evaluating unbalanced and distorted components 9.

The Fast Fourier Transform (FFT) calculates the total harmonic distortion and harmonic factors in the power grid. The FFT of the output current evaluates and measures the different harmonic components of the waveform, in addition to the fundamental amplitude of 60 Hz, of the network current. The Total Harmonic Distortion, or THD, of a signal, is a measure of the harmonic distortion present in the system and is defined as the ratio of the sum of all amplitudes of all harmonic components to the frequency amplitude fundamental 10. The discrete Fourier transform, typically implemented by FFT, is a superior method for harmonic analysis. However, in the application of the active power filter, the use of an FFT algorithm is not practical, since active parallel power filters need a harmonic current reference in real-time to plot the change in the load current 11.

Microcontroller Devices

The harmonic components generate distortion in the waveform. It is necessary to analyse the harmonic spectrum of the voltage and current signal of the network to obtain an accurate measurement that can be made through the decomposition of these harmonics in the system, through the Fourier Series 12.

The FFT is a possible way of decomposing the network harmonics for analysis by microcontroller systems. It is necessary hardware implemented by a digital signal processor to visualize the values of input voltage, input current, and output voltage and estimate the maximum power in the electrical network as well as generating the clock for the active filters of parallel power 2.

Usually, this analysis type is performed by a Digital Signal Processor (DSP). Such device costs more than ordinary microcontrollers. Therefore, it is necessary to seek an alternative to the use of DSPs to enable the construction of a low-cost device capable of executing the FFT algorithm.

Arduino is a single-board microcontroller designed to make more accessible the using electronics in multidisciplinary projects. The hardware consists of an open-source code device. Initially, it was designed for 8-bit Atmel AVR microcontrollers. Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 processor. It is the first Arduino board based on a 32-bit ARM microcontroller instead of the usual 8-bit processor of the other Arduino variants. It runs at a frequency of 84 Mhz and has 512 KB of flash memory. Due to its optimized design, it provides great processing power.

Experimental procedure

The experimental measurements of this study were carried out in the computer labs of the technical school ETEC Paulino Botelho, in São Carlos, Brazil. Initially, measurements of voltage and electrical currents in the electrical supply system of these laboratories were performed. Then, the diagnosis of the situation of these consumption units was carried out in relation to harmonic distortions of current and power factor, compared to the criteria recommended by the legislation.

The quantities analyzed are described as follows: (i) effective voltages and currents in the distribution network, (ii) total harmonic distortions of voltages and currents, (iii) voltage and current harmonic amplitudes, and (iv) consumed power and power factor.

For the evaluation of performance and power quality, different analytical tools can be applied. The Fast Fourier Transform (FFT) calculates the total harmonic distortion and harmonic factors in the power grid. The FFT of the output current evaluates and measures the different harmonic components of the waveform, in addition to the fundamental amplitude of 60 Hz, of the network current. The Total Harmonic Distortion, or THD, of a signal is a measure of the harmonic distortion present in the system being defined as the ratio of the sum of all amplitudes of all harmonic components with the amplitude of the fundamental frequency 10.

The evaluation presented seeks to provide real data on the installation's operating conditions. In order to investigate data and calculate FFT under different load conditions, a prototype connected to a current transducer for real-time data acquisition capable of capturing and analysing the network current signal was implemented as shows figure 1.

Fig. 1 Schematic representation of the experimental prototype. 

The components of the system are:

  1. Power source: 127 V / 60Hz

  2. Linear load: Power resistors.

  3. Non-linear load: Computers and electronic ballasts

  4. Arduino microcontroller (Atmel SAM3X8E ARM Cortex-M3)

  5. Current transducer

  6. Instrumentation amplifiers

  7. Notebook

  8. Digital oscilloscope (Minipa, model MO-2061)

  9. Ammeter (Minipa, model ET-3200)

Figure 2, shows the block diagram of this project. It consists of a current transducer connected to the instrumentation operational amplifier, whose output sends a sampled signal to the microcontroller that performs the capture of the samples and applies the FFT algorithm. The second microcontroller receives the result of the sampled FFT, filters the value of the fundamental frequency of the current signal and calculates its inverse transform, only with the upper and lagged harmonics at one hundred and eighty degrees. The sum of the resulting sine functions is properly synchronized in time and applied to the analog output of the second microcontroller that acts as the parallel active power filter (PAPF) control.

Fig. 2 Block diagram of the project. 

For sample validation, we chose to connect the detection module, output from the analog instrument amplifier, to the digital oscilloscope in order to perform an initial Fourier analysis. With the detection module prepared for processing, a C ++ program was developed for Arduino to perform the data acquisition and calculate the amplitude and phase values of the frequency spectrum using the FFT algorithm. To calculate the FFT of the input signal, a routine was implemented to read a vector of 1024 samples of the values of the input signal, equally spaced in time. FFT operations are performed and two vectors of 512 size of the amplitude and phase values of these frequencies are returned. Figure 3, shows the program flowchart developed to evaluate the FFT algorithm and send it to the Arduino serial outputs.

Fig. 3 Process flowchart of the Arduino FFT program.  

A C ++ routine was also developed to perform the reverse FFT. As the reverse FFT generation algorithm must be in an infinite loop in the same way as the capture algorithm, it was decided to use a second Arduino to perform the reverse FFT. Figure 4, shows the flowchart of the algorithm to perform the inverse FFT.

Fig. 4 Process flowchart of the Arduino reverse FFT program. 

Due to these limitations, mainly the processing time, it was decided to keep the microcontroller for the analysis of signal distortions and to implement an active analog filter for the filtering of harmonic currents. The models used for the filter construction used were Butterworth polynomials. This type of filter was chosen due to its frequency being flat in the passband and approaching zero in the rejection band. The simplicity of the Butterworth filter construction is that it maintains the same format for low projects and also for higher orders, but with a very steep slope in the attenuation band while other types of filters, Bessel, Chebyshev, have different formats for higher orders therefore more complex in their design and construction. We opted to simulate the disturbances caused by these non-linear loads by evaluating the behavior of analog filters designed from amplifiers in different situations. For filter tests, Multisim software version 11 was used. Figure 5, shows a block diagram of the normalized transfer function of an 8-order filter. For the construction of even-order filters, it is enough to associate second-order filters in series.

Fig. 5 8-order Butterworth filter transfer function. 

To validate the filter's operation, four operational amplifiers were used, each configured as a second-order filter, which together perform the function of an eighth-order filter as shown in figure 6.

Fig. 6 8th order filter diagram with operational. 

In the preliminary prototype, a detection module was used to send the detection signals of the load current to the microcontroller module, which stored the data in a vector and then executed the FFT analysis algorithm. The time of 2 microseconds for data acquisition was measured with the Arduino UNO Microcontroller. The time required to run the FFT was 2.80 seconds for a vector of 512 samples, and the algorithm used approximately 78% of the dynamic memory of the microcontroller. Due to the processing limitation of the Arduino UNO, it was decided to connect the detection module to an Arduino Due. We obtained a sample processing time of 40ms and use of 4% of the dynamic memory of this microcontroller. In addition, we chose to validate the samples by connecting the analog detection module to a digital oscilloscope for this initial analysis.

RESULTS AND DISCUSSION

Figure 7, shows the waveform and harmonic spectra of a current of 1.4 Amps in a resistive load. The loads present in the purely resistive power circuits produce a current with the waveform shown in figure 1. A current signal like a slightly distorted sinusoidal signal was observed. Performing the FFT analysis, we observe the presence of harmonic distortion, indicated by the fundamental frequency and its harmonics (3H, third; 5H, fifth; 7H, seventh).

Fig. 7 Wave and current spectrum under resistive load obtained in the oscilloscope. 

Figure 8, shows the waveform and harmonic spectrum of a 0.4 ampere current in a computer source. Analyzing figure 7, it is possible to observe the distortion in the shape of the current that feeds the computer which are the main harmonics that affect the power system and establish control strategies.

Fig. 8 Waveform and harmonic spectrum of a computer source obtained by the oscilloscope. 

Figure 9, shows a current of 3.2 amps in the supply of 8 computers. A distorted sine waveform is observed, and which are the main harmonics (3H, third; 5H, fifth; 7H, seventh; etc.) that affect this power system. Once the amplitudes of the distortions are identified, control strategies can be established to correct and minimize these currents.

Fig. 9 Waveform and harmonic spectra of the source of eight computers obtained by the oscilloscope. 

In order to perform the routine tests, a signal generator was used to produce sine, triangular and square waves of fundamental frequency 60Hz. Thus, these signals were captured, analyzed and processed in Arduino Due to verify the behavior of the generated spectra. After building the data acquisition system, the Fourier series graphics were obtained using the Arduino IDE interface to visualize the results of the developed algorithm. Figure 10, shows the waveform of the electrical current consumed by the power supply of a notebook. The number of sinoids corresponds to the size of the window chosen for the FFT. The Hamming window was used.

Fig. 10 Current from a notebook source captured by Arduino Due. 

Figure 11, shows the result of the FFT executed by Arduino Due. It was used 1024 samples of the captured signal. Figure 12, shows the normalized FFT data, where the insignificant distortion values for the calculation of the inverse FFT were disregarded.

Fig. 11 Fast Current Fourier Transform from a notebook source captured by Arduino Due. 

Fig. 12 Fast Fourier Transform (normalized current). 

After the FFT execution, it was identified the existence of harmonics in the investigated loads. Also, from the stored vectors, which harmonics could be eliminated. For this purpose, the inverse FFT execution routine was applied to the calculated complex vector. Figures 13, 14 and 15, show the inverse Fourier transform performed by the microcontroller. Figure 13 shows the inverse transform for all FFT harmonic indices. Figure 14, shows the waveform of the inverse FFT applied over the normalized harmonics above order 2, frequencies below 80Hz were suppressed for the calculation. Finally, Figure 15 indicates the inverse transform of the fundamental frequency, values around 60Hz.

Fig. 13 Inverse Fourier Transform (normalized current). 

Fig. 14 Waveform of harmonics of order greater than 2. 

Fig. 15 Signal fundamental frequency waveform. 

CONCLUSIONS

In this article, we discuss the use of the Arduino platform as a solution to reduce the effects of harmonics in low power distribution networks. Because of the processing limitations of Arduino UNO and the high cost of DSP devices, we opted to use Arduino Due. Using this component, the sample processing time was 40ms and 4% of its dynamic memory was used. This indicates that the use of Arduino Due is fast enough for processing and generating correction signals. The use of FFT analysis allows the feedback of the network current data to cancel the harmonics. In summary, this study achieved the objective it had proposed that was to present a simple control strategy using microcontrollers, i.e. without requiring a long time in the data analysis or the delay time in measurement and small corrections.

REFERENCES

(1) KALAIR, A. et al. ``Review of harmonic analysis, modeling and mitigation techniques´´. Renewable and Sustainable Energy Reviews. 2017/10/01, vol. 78, p. 1152-1187. ISSN 1364-0321. Disponible en: https://www.sciencedirect.com/science/article/abs/pii/S1364032117306226Links ]

(2) SRINATH, S.; et al. ``PV Integrated Shunt Active Filter for Harmonic Compensation´´. Energy Procedia. 2017/06/01/, vol. 117, p. 1134-1144. ISSN 1876-6102. Disponible en: https://www.sciencedirect.com/science/article/pii/S1876610217324797Links ]

(3) CAMPANHOL, L.; et al. ``FILTRO ATIVO DE POTÊNCIA PARALELO APLICADO EM SISTEMAS TRIFÁSICOS A QUATRO-FIOS´´. Cornélio Procópio 2013, vol. 18, n. 1, p. 782-792. Disponible en: https://www.sobraep.org.br/site/uploads/2018/09/rvol18no1p11.pdfLinks ]

(4) LIU, Z. et al. ``Virtual Variable Sampling Discrete Fourier Transform Based Selective Odd-Order Harmonic Repetitive Control of DC/AC Converters´´. IEEE Transactions on Power Electronics. 2018, vol. 33, n. 7, p. 6444-6452. ISSN 0885-8993. Disponible en: https://ieeexplore.ieee.org/document/8070364Links ]

(5) MORIANO, J. et al. ``A Novel Multi frequency Current Reference Calculation to Mitigate Active Power Fluctuations´´. IEEE Transactions on Industrial Electronics. 2018, vol. 65, n. 1, p. 810-818. ISSN 0278-0046 1557-9948. Disponible en: https://ieeexplore.ieee.org/document/7884983Links ]

(6) MUKHERJEE, D. ``Comparative Analysis of Different Filters in Power Line Harmonic Reduction´´. International Conference on Applied and Theoretical Computing and Communication Technology (iCATccT). Oct 29-31, 2015. Disponible en: https://ieeexplore.ieee.org/abstract/document/7456943Links ]

(7) NICOLAE, P. M. `` Improvement of the Controller Algorithms for Active Power Filters Operating under Distorted and Unbalanced Grid Voltages´´. IEEE 14th International Conference on Industrial Informatics (INDIN). July 19-21, 2016. Disponible en: https://ieeexplore.ieee.org/document/7819172Links ]

(8) MALDONADO, J. R. ``Total Harmonic Distortion Estimation, Minimization Inter Harmonic Amplitude and Expanding Bands Rejection in TKF filters´´. IEEE Latin America Transactions. Feb 2016, vol. 14, n. 2, p. 652-656. ISSN 1548-0992. Disponible en: https://ieeexplore.ieee.org/document/7437206Links ]

(9) CHICCO, G. et al. ``Assessment of unbalance and distortion components in three-phase systems with harmonics and interharmonics´´. Electric Power Systems Research. 2017, vol. 147, p. 201-212. ISSN 0378-7796. Disponible en: https://www.sciencedirect.com/science/article/abs/pii/S0378779617300731Links ]

(10) ZHAO, C. ``Research and Implementation of Harmonic Detection and Current Compensation Technology in Active Power Filter´´. 35th Chinese Control Conference (CCC). July 19-27, 2016. Disponible en: https://ieeexplore.ieee.org/abstract/document/7554938Links ]

(11) LING, F.; WEIYAN, Y.; YONG, W. ``A novel DFT algorithm used in active power filter under frequency distortion´´. 2017 IEEE 3rd International Future Energy Electronics Conference and ECCE Asia (IFEEC 2017 - ECCE Asia), 2017, 3-7 June 2017. p.1375-1379. Disponible en: https://ieeexplore.ieee.org/document/7992244?deniedLinks ]

(12) SIMON, H, BARRY, V. ``Sinais e Sistemas´´. 1.ed, Bookman, Porto Alegre, 2001. Disponible en: https://books.google.com.br/books/about/Sinais_E_Sistemas.html?hl=pt-BR&id=tdNYclZwaYICLinks ]

Received: December 02, 2020; Accepted: February 15, 2021

*Corresponding author: humber@fatecsp.br

The authors declare that there are no conflicts of interest.

MSc. José Leovaldo da Silva Mello: Research design, data collect, analysis of the results, writing the draft of the article, critical review of its content and the final approval.

MSc. Douglas Antônio Amâncio: Research design, data collect, analysis of the results, critical review of its content and the final approval.

MSc. Michel Chagury: Research design, data collect, analysis of the results, critical review of its content and the final approval.

Dr. Luiz Antônio Rasia: Research design, analysis of the results, critical review of its content and the final approval.

Dr. Humber Furlan: Research design, data collect, analysis of the results, writing the draft of the article, critical review of its content and the final approval.

Dr. Mariana Amorim Fraga: Analysis of the results, writing the draft of the article, critical review of its content and the final approval.

Creative Commons License This is an open-access article distributed under the terms of the Creative Commons Attribution License