Current Harmonics Compensation in Microgrids Exploiting the Power Electronics Interfaces of Renewable Energy Sources

: This work presents a method of current harmonic reduction in a distorted distribution system. In order to evaluate the proposed method a grid with high-order current harmonics is assumed. The reduction of current distortion is feasible due to the pulse modulation of an active filter, which consists of a buck-boost converter connected back-to-back to a polarity swapping inverter. For a practical application, this system would be the power electronic interface of a Renewable Energy Source (RES) and therefore it changes a source of harmonics to a damping harmonics system. Using the proposed method, the current Total Harmonic Distortion (THD) of the grid is reduced below the acceptable limits and thus the general power quality of the system is improved. Simulations in the MATLAB/SIMULINK platform and experiments have been performed in order to verify the effectiveness of the proposed method.


Introduction
Nowadays there is a worldwide need for renewable and clean energy. Because of this urge and thanks to technological improvements during the last decades, a lot of renewable energy generators OPEN ACCESS have been introduced throughout the world, capable of mitigating most technical challenges created by those intermitted energy sources. The great potential of such resources for green energy production has led the technological society to the implementation of a new type of distribution system, the microgrid.
The utilization of such technologies may have a lot of advantages such as improved efficiency, infinite and free raw materials and almost no environmental impact, but there are some drawbacks too. The integration of these Renewable Energy Source (RES) to the grid would not be possible without the use of power electronics devices. These devices are essential to interface these RES and Distributed Generators (DG) to the distribution system. Using power electronic devices (e.g., inverters) in order to connect the RES and DGs to the grid exhibits many advantages such as fast voltage and frequency regulation, but also displays one major disadvantage. The switching operation of the semiconductors included in the inverters causes voltage and current harmonic distortion to the grid. This distortion increases by a number of other reasons, such as the behavior of nonlinear loads (diode rectifier bridges, Personal Computers, etc.) and the switching operation of their converters. Specifically, harmonic distortion occurs due to loads supplied by converters as well as to RES interfaced to the grid through inverters. Harmonic distortion leads to poor power quality to the end user of the distribution system, as well as to increased value of line current.
For this reason a lot of active filters and power conditioners have been proposed in order to alleviate the distribution system problems from both current and voltage high-order harmonics point of view and improve power quality. Only a few of these proposals deal with grid's power quality improvement. Instead, the majority of them focus in the harmonic cancellation and power quality improvement of critical loads against the high-order harmonic distortion of the grid that they are connected to.
In reference [1], a repetitive-based control scheme for selective harmonic compensation in active power filters is proposed. This controller compensates current harmonics created by distorting loads at selected frequencies. It uses a closed-loop repetitive-based control scheme based on a finite-impulse response digital filter. Although it adequately alleviates current harmonics, additional control is needed in the case that the distortion source is the grid voltage. This problem seems to be resolved in [2], where a selective harmonic compensation control for single phase active filters is introduced. This approach exhibits satisfactory results in harmonic compensation, either when the distortion comes from non-linear loads or the grid voltage. In reference [3], a harmonic compensation method based on closed-loop synchronous frame control of line currents as well as a selective open-loop approach based on load current sensing is presented. It is concluded that the proposed method is robust enough for compensating distortions provoked by non-linear loads, but it operates only when the distorting loads have slowly varying high-order harmonics. In [4], an active power filter based on improved sliding mode for current harmonics reduction of non-linear loads is proposed. Though it shows a very good behavior, it is not clear if the harmonic distortion caused by other sources such as the switching operation of grid interfaced inverters is taken into consideration. In [5], a signal processing system for harmonic and current components calculation is introduced. This system is adopted as a part of a single-phase active power filter and provides satisfactory compensation, although it may lack ease of implementation, as both voltage and current sensors and a rather complicated control loop are required. In [6], an open-loop control method for a current-source active filter is suggested, but it is again focused to non-linear loads. References [7][8][9] present interesting alternatives for harmonic reduction, using different sliding mode control and feedback linearization control approaches for single phase shunt active power filters. Finally, references [10][11][12][13][14] propose a variety of other active filter topologies and control techniques that focus on high-order current harmonics compensation.
In most cases, grid connected RES consist of a dc/dc converter and an inverter. This is because most of these sources, such as photovoltaic arrays (PV) or fuel cells (FC), generate dc voltage which usually does not have adequate amplitude for grid connected operation, so a boosting or bucking procedure is necessary.
The converter configuration proposed in [15] and already used in [16] has been used in this work in order to reduce the current harmonic content of the grid, so that the Total Harmonic Distortion (THD) index is decreased to below acceptable limits. It consists of a dc/dc buck-boost converter connected to the grid through a simple polarity changing inverter. The buck-boost converter operates in a high switching frequency, while the polarity swapping inverter operates in a low one (e.g., 50 Hz). Consequently, switching loses are limited to the switching operation of the semiconductor of the buck-boost converter, since the corresponding loses of inverter's semiconductors are negligible. Thus, this topology operates more efficiently than the conventional ones. Therefore, the present work focuses primarily in the implementation of an active filter which compensates current harmonic distortion and thus enhances the power quality of the distribution system, based on this topology, either when this system is a microgrid or a conventional rigid distribution system. Moreover, unlike the majority of other similar proposals, this system compensates current harmonics regardless of the distortion location. Satisfactory harmonic reduction can be achieved either when the distortion source is located at the studied node or at any other node of the system. The remaining of this paper is organized as follows: Section 2 describes the microgrid structure and configuration, the operation of all parts of the proposed active filter, as well as the cancellation method of the current high-order harmonics. Section 3 presents the simulation results in the MATLAB/SIMULINK platform along with some experimental results. Conclusions are drawn in Section 4.

The Proposed Active Filter and the Studied Grid Configuration
In this section the topology and operation of the individual units of the proposed active filter and the microgrid structure are analyzed.

Topology and Operation of the Active Filter in the Studied System
The suggested active filter is connected to the Point of Common Coupling (PCC). The aim is to alleviate the already existing current high order harmonics in order to meet the Distribution and Utilization standards (IEEE519-92) [17]. These standards dictate that the percentage of the Total Harmonic Distortion (THD) in every node of the system and for every device which is connected to it should be less than 5%. Two cases where studied. Figure 1a,b shows the configuration of the studied system in these two studied cases. In the first case, shown in Figure 1a, a RES is connected to the buck-boost converter, providing it with the necessary dc voltage. In the second case, shown in Figure 1b, no RES is used and the proposed active filter operates as a self-healing shunt active filter that compensates the current harmonic distortion of the microgrid itself. In this case the necessary for the operation of the buck-boost converter dc voltage is provided by a diode rectifier, which rectifies the ac voltage of the PCC. Buck-boost converter operates at a high switching frequency (e.g., 20 KHz). The duty cycle D is being continuously calculated under the above mentioned frequency using Pulse Width Modulation (PWM) technique [13], and it is given by: creating a dc voltage. This voltage is being fed to the polarity swapping inverter that operates at a low switching frequency (50 Hz) and inverts the dc voltage to ac. Furtermore, an on-line Fast Fourier Analysis (FFT) of grid's current harmonic content at the PCC takes place, so that informationof the exact amplitude and angle of the existing high order current harmonics is obtained. The active filter injects the required amount of high order harmonics, so that the THD of grid's current is reduced. In order to eliminate the existing distortion the injected harmonic component will have the same amplitude but a 180° phase shift in relation with the one existing in the grid. This sine wave is compared to the 20 KHz PWM carrier, so that proper pulses are created in order to shape converter's output sine voltage. The buck-boost converter is connected to an inverter responsible for swapping its output voltage, so that a suitable ac voltage is generated. Therefore, the switching frequency of the inverter is grid's frequency (i.e., 50 Hz). The inverter operation in low frequency is one of the major advantages exhibited by this active filter topology, as it combines harmonic reduction along with low switching losses. Moreover harmonic suppression is achieved on constant switching frequency of the buck-boost converter. This does not happen in all active filters, for example in those using hysteresis current control techniques. A single phase full-bridge topology was selected. This topology consists of four semiconductors which are triggered in pairs (S1-S4, S2-S3). The buck-boost converter is synchronized with the inverter and with the grid. Every time buck-boost's voltage becomes zero inverter's conducting pair changes. The topology of the used inverter is shown in Figure 1a,b. The inverter is being connected to the PCC through a small resistance (R) and a low pass LC filter (only in the second case). The operation and use of these elements will be explained in detail in Section 3.

Harmonic Cancellation Method
The generation of the required harmonic component is feasible via proper pulse modulation of the buck-boost converter. The key idea is that a proper trigger pulse generation will lead the converter to create a waveform that contains the suitable current mirror harmonic content, resulting in harmonic cancellation. Buck-boost's trigger pulses are being initially created by the comparison of the rectified PCC's voltage signal and the 20 KHz reference triangle, taking into consideration the duty cycle D of buck-boost converter, given by Equation (1). An FFT analysis of microgrid distorted current is performed. The mirror harmonic of grid's current high order harmonic component, that has the same frequency and amplitude but a 180° phase shift from it, is added to the 50 Hz sine signal during the pulse generation modulation. After the mirror harmonics injection, FFT is carried out again so that information about the alternation of the harmonic content is obtained. It should be mentioned that the high-order current harmonic amplitude obtained by FFT analysis is multiplied by an integer that represents the value of the resistive load (in this case around 70). This happens because the operation of our active filter (buck-boost converter and polarity swapping inverter) is essentially similar to a voltage source. As already described the pulse modulation of the buck-boost converter-through which the harmonic compensation is possible-takes into consideration the current sine wave at the PCC and the current high-order harmonics obtained by the FFT. This study though focuses to the reduction of current high order harmonics. As a result the FFT analysis is performed to the current at the PCC. The extracted information about the amplitude and the phase angle of the current harmonics should be considered to the pulse modulation of the buck-boost converter. Current harmonic distortion is transformed into voltage harmonic distortion using Ohm's law. Specifically: where: : The high order current harmonics obtained by FFT analysis. : The resistive load at the PCC. : The high order voltage harmonics that are finally included in the pulse modulation procedure of the buck-boost converter.
In other words we obtain the information of the current harmonic content of the grid and we transform it into voltage distortion in order to create the proper pulses which will lead to current harmonic reduction at the distorted grid.
In case of a grid with non-resistive behavior (the load at the PCC is not pure resistive but also inductive or capacitive) the procedure followed is similar. The amplitude of the voltage to be included in the pulse modulation is calculated again by Ohm's law, but the phase difference introduced by the inductance or the capacitance of the grid should be considered with respect to the phase angle of the injected harmonic component through a different control loop. Usually the exact value of that load (purely resistive or not) is not known, increasing the complexity of such a control loop. These cases are out of the scope of this paper and are the subject of a future work.
To clarify the procedure of mirror harmonic injection let us assume that node's high harmonic component is hA(t) and that the active filter injects harmonic component hB(t) to the PCC so that total harmonic content would be hC(t). This would be: ℎ ( ) = sin(2 π + ) ℎ ( ) = sin(2 π + ) ℎ ( ) = sin(2 π + ) in which A, B, C and a, b, c are the amplitudes and the phase angles of the aforementioned signals respectively. Because all these signals have the same frequency , previous functions can be converted into phasors: So it can be assumed that the harmonic content C of the output can be calculated by:  Figure 3 depicts the above method theoretical analysis. It shows the distorted ac current of the PCC (a); its high order harmonic component (b); the mirror harmonic to be injected (c); and the ac current at PCC after the harmonic compensation (d).
During the initial iteration, no mirror harmonic is injected to the grid. According to Equation (6), when B = b = 0, A = C and a = c. FFT analysis of grid's current harmonic content (c and C) should be executed constantly, so that the active filter responds immediately at any random change of harmonic content (a and A). Until the active filter is synchronized with the grid there is no harmonic injection, in order to avoid overcurrent flow at the moment of synchronization that may harm the equipment. After synchronization, compensation begins and the previously described steps are being followed.
It has to be underlined that this methodology can be extended to more than one high-order harmonics simultaneously, as proved by the experimental results (Section 3.2).   Figure 4a shows the Vdc,out created by the buck-boost converter. This voltage is the one that will be inverted by the polarity swapping inverter. Figure 4b shows the comparison of the resulting carrier waveform, continuously calculated by Equation (1), with the reference triangle, so that the pulses controlling the buck-boost converter are obtained, as shown in Figure 4c.

Simulation Results
In order to verify the previously described theory, simulations have been performed on the Matlab/Simulink platform.
The current harmonic distortion in the studied grid was simulated by a controlled current source. This current source was selected to inject a 3rd harmonic distortion to the PCC of about 15% of the fundamental. As a result a significantly current distorted grid was simulated. The 3rd harmonic was randomly selected for compensation, as a difficult situation. Usually in 3-phase systems, 3rd harmonic distortion is dealt with Y-Delta transformers. However there are many cases, especially in distribution systems, that it is obligatory to use Y-Y transformers. The proposed method would avoid the cost and the space inconvenience of a bulky transformer in 3-phase applications. However a 3-phase system is not studied in this paper. The system studied here is a single-phase microgrid. This harmonic compensation method is the proposed solution for single-phase systems.
A resistance (RL) has been placed as a load at the PCC, in order to avoid any passive load filtering, or generally any affection of the load in reactive power flow study. Insulated-Gate Bipolar Transistors (IGBTs) have been simulated as semiconductors for both the buck-boost converter and the inverter. Two similar diodes have been used for the buck-boost converter. Its inductance has been selected to be as low as 1 mH and the capacitor Cin has been selected to be only 10 μF. Capacitor's value is quite small compared with capacitances used in similar applications, which are several mF.
The switching frequency of the buck-boost converter was set at 20 kHz (fbb). This particular frequency was selected mainly for three reasons. Firstly, the selected frequency is above acoustic frequencies in order to prevent any disturbance of the user noise. Secondly, this frequency is high enough that there will be filtering by the converter's passive elements. Finally, this value is a tradeoff between the abovementioned requirements and moderate switching losses. The switching frequency of the inverter was set at 50Hz (finv), as it has to match the voltage frequency at the PCC. The inverter is being connected to the PCC through a 1 Ω resistance (R) and a low pass LC filter (only in the second case). The use of this filter will be explained in the second case. Resistance R is used primarily to avoid resonances. These resonances are caused by the voltage source behavior of the proposed active filter. This voltage cannot be directly connected to the grid voltage at the PCC, because resonances and spikes are created. The use of this small resistance dampens these resonances that deteriorate the waveforms. This situation can be improved by an appropriate control action but this issue is still under investigation. The current harmonic reduction at grid's current G is being feasible due to the total current ejected by the proposed active filter at the PCC ( AF ).
The above mentioned control and circuitry parameters are gathered to Table 1. Two cases were studied. At first the dc voltage needed for the operation of the buck-boost converter was created by a 300 V dc source. This dc source could be a RES or a DG. In such a case, the RES is not only able to provide the reactive power needed for the current harmonic reduction, but also injects its active power to the grid, making the proposed topology suitable for real RES connected to the grid. The simulated system at this case is shown in Figure 1a.
In this case the proposed active filter consisting of a RES, the buck-boost converter and the inverter connected back-to-back, is used in order to alleviate the current harmonic distortion of the grid. As mentioned before the goal is to reduce the harmonic distortion of the current G below the 5% threshold dictated by standards. Grid's current G , its THD and its 3rd harmonic component are being displayed in Figure 5a-c.

Table1.
Control and circuitry parameters of the studied system.  It can be seen in Figure 5 that the proposed active filter, after a short transient time (not longer than 4-5 cycles), achieves harmonic reduction at the grid current G , compensating the THD below the 5% threshold, exhibiting satisfying behavior. In this case a low pass filter is not necessary as there are no non-linear loads or devices which would create higher high-order harmonics.
In the second case the proposed topology is used as a self-healing active filter. The topology of the studied system is shown in Figure 1b. In this case no dc source such as RES or DG is used. The necessary for the operation of the buck-boost converter dc voltage is produced by the rectified ac voltage of the microgrid at the PCC. More specifically, the ac voltage of the PCC is being fed to a simple diode rectifier through a one-phase transformer. This transformer was used in order to provide isolation between the proposed active filter and the grid at the input side of our topology. The diode rectifier provides dc voltage for the operation of the buck-boost converter. This dc voltage is being fed to the buck-boost converter and the harmonic cancellation happens as explained in Section 2.2. The selected diodes are similar to these used at the buck-boost topology.
In this case the harmonic cancellation is more difficult, because except from the already existing high-order harmonic distortion introduced by the current control source, more high-order distortion occurs due to the operation of the diode rectifier as well as the inductance of the transformer. As a result the THD before the initiation of the cancellation method is much higher than 15% that was in the first case, when the active filter had to face only the harmonic distortion produced by the controlled current source. For this reason an LC low pass filter is used after the polarity swapping inverter so that the higher high-order harmonics are suppressed. The values used are 10 mH and 7 μF respectively. Grid's current G , its THD and its 3rd harmonic component are illustrated in Figure 6a-c. As it can be seen in Figure 6 the proposed topology exhibits again satisfying behavior as it reduces the harmonic content of grid's current G below 5%. Here the transient time is longer than in the previous case (approximately 0.25-0.3 s). This is normal because in this case the active filter had to face a more severe harmonic distortion, due to the greater magnitude and spectrum of harmonics. It can be concluded that in this case the active filter manages to reduce not only the already existing current harmonics (created by the controlled current source), but also the harmonic distortion created by the operation of the other parts of the studied system.
From both previous cases it can be seen that while the studied grid is distorted only by a 3rd harmonic and the 3rd harmonic component of the grid's current is in both cases reduced below 2%, THD remains below but close to 5%. This happens mainly due to active filter's switching operation and inductances (L)-capacitances (C) interactions between active filter's components and the inductances and the capacities of the used filters that create higher harmonics (5th, 7th, etc.). During the second case this phenomenon is more severe due to the diode rectifier, which is a highly non-linear device that creates high-order harmonic components. Figure 7 verifies this assumption, showing a simulation example of the output current signal, digitally processed, so that the higher order harmonics (5th, 7th, etc.) are filtered out. It can be seen that in this case the current THD waveform is exactly the same as the 3rd harmonic waveform. This fact verifies the previous assumption about the difference between THD and 3rd harmonic waveforms in the study cases.

Experimental Results
In order to evaluate the above described simulation results a similar experimental setup was built. The main purpose of this procedure is to experimentally verify the current harmonics compensation capability of the purposed active filter. The system topology simulated in the first case was recreated in the laboratory. The dc voltage source is now a dc power supply. The maximum available dc voltage we can obtain with this setup is 45 V. As a result a transformer with ratio 1:7 was added at the output of the polarity changing inverter, so that an ac voltage with adequate amplitude for grid synchronization is created (230 V rms). The proposed active filter is synchronized with the grid, which is severally distorted due to the existence of non-linear elements. The harmonic spectra are obtained by FFT analysis performed by a TPS2024B 200 MHz oscilloscope (Tektronix, Beaverton, OR, USA). The DSP TMS320F28335 eZdSP (Spectrum Digital, Stafford, TX, USA) acquires the FFT analysis directly from the oscilloscope and performs the harmonic suppression control in the microgrid. The microgrid condition shown in Figure 8 was studied. In Figure 8a the voltage and current waveforms of the grid are presented, while in Figure 8b the harmonic spectrum of the grid current is illustrated and the amount of the 3rd harmonic is shown. As it can be seen, current THD is almost 21% (20.7%) and the 3rd harmonic distortion is almost 15% (14.48%). As a result, current waveform is quite distorted as it can be seen in Figure 8a. Initially, harmonic compensation of only 3rd harmonic was performed. The results are presented in Figure 9. As it can be seen the proposed active filter performs almost perfectly, as it reduces the 3rd harmonic below 1% of the fundamental (0.6036%). As a result the THD is reduced from 20.7% to below 12% (11.8%), but still cannot meet the 5% standards.
Afterwards 5th harmonic cancellation was executed. THD is again around 20%, as no harmonic compensation has occurred and the 5th harmonic distortion is a little over 10% (10.21%). Now harmonic cancellation of only 5th harmonic is executed and the results are shown in Figure 10. As it can be seen in Figure 10, the proposed active filter manages to practically eliminate 5th harmonic as it is reduced to 0.1285%. As a result the THD of the grid current is reduced to 16.1%. Thus it can be said that this topology operates again efficiently, but the goal of 5% is not feasible only with 5th harmonic elimination. For generality purposes cancellation of 7th harmonic was executed next. THD is again almost 21% and the 7th harmonic is 8.385%. The results are shown in Figure 11. Again the active filter operates satisfactorily, as it reduces the 7th harmonic component below 1% (0.7812%). Moreover the THD is slightly reduced after this procedure, from 20.8% to 19.5%. As in all the above cases, when only one harmonic is compensated, the THD remains quite higher than 5%. Thus it is obvious that harmonic compensation of more than one harmonics is necessary.
With this series of experiments it can be concluded that the proposed active filter can sufficiently suppress current harmonics, independently from their order.
The simultaneous compensation of more than one high order harmonics (3rd, 5th, and 7th) has also been investigated. Again the initial condition of the studied system is the same. The grid voltage and current waveforms are the same as in Figure 8a. Like in Figure 8b, THD is almost 21%, 3rd harmonic is 14.48%, 5th harmonic is 10.21% and 7th harmonic is 8.385% of the fundamental respectively.
Voltage and current waveforms and current harmonics spectrum after the simultaneous harmonic compensation of 3rd, 5th and 7th current harmonics are presented in Figure 12a,b respectively. Comparing Figure 8a and Figure 12a, it can be easily concluded that our topology improves drastically the grid current waveform. Furthermore, comparing Figures 8b and 12b, it can be observed that the proposed active filter compensates all three high order harmonics (3rd, 5th and 7th), as it can be easily seen by the drastically reduced bars of all these harmonics in Figure 12b in comparison with those of Figure 8b. As a result the THD is reduced from almost 21% to 3.82%. So the proposed topology achieves harmonic compensation of more than one harmonics at the same time, managing to comply with 5% standard. It is worth to mention, that the THD is not further reduced because of the presence of uncompensated higher harmonics (9th, 11th, 13th, etc.).
Thus it is concluded that this active filter can operate satisfactorily and efficiently compensate one or more current harmonics, resulting in improved grid current waveform and harmonic spectrum.

Conclusions
An active filter topology that consists of a dc to dc buck-boost converter connected back-to-back with a polarity swapping inverter was proposed in this paper for current harmonic reduction in a distribution system (i.e. microgrid). The main advantages of the proposed topology are its robustness, its converter's low switching losses and the simplicity of its harmonic control. Its performance was verified by a series of simulations and some experimental results. Initially the proposed topology was simulated for current harmonic reduction of a microgrid through the reactive power injection of a RES, highlighting the implementation of RES in current harmonic compensation in distribution systems (microgrids or not). Afterwards the active filter was simulated for the self-healing of a current distorted grid, reducing the already existing in the grid current harmonics as well as these that are created by the necessary for the operation nonlinear elements (diode rectifier, transformer). In the latter case no RES is used. In both cases the proposed active filter exhibits satisfying behavior. Therefore it is suitable either for simple current harmonic reduction or as a self-healing mechanism. Having in mind [16], it can be concluded that the proposed topology can provide both voltage and current harmonic reduction in microgrids (or generally in distribution systems), depending on which kind of distortion exists. Finally, the above mentioned theory and simulation results were experimentally confirmed. An experimental setup similar to the first simulated system was built. It is demonstrated that the proposed active filter can effectively compensate individual harmonics (3rd, 5th, 7th, etc.) or simultaneously a spectrum of harmonics. The results depict the improvement of power quality; The THD is reduced below the 5% threshold imposed by the existing standards.