1. Introduction
In addition to active power, electrical power systems supply energy for asymmetric and reactive loads. The greater the preponderance of these loads, the more the electrical system is required, resulting in higher distribution losses, voltage drop increase, and underutilization of the installed capacity [
1,
2,
3,
4].
Furthermore, with the advent of semiconductors, non-linear loads were introduced and spread all over the electrical system. These, in turn, generate current harmonics that deform the sinusoidal characteristic of the voltage at the point of common coupling, further impairing the grid power factor. In addition to having the same impacts as the reactive ones, they can cause failures in the system’s protection, generate resonances, increase maintenance costs, and reduce the average life of equipment [
5,
6].
Mainly found in industrial environments to obtain a better power factor, capacitor banks are used for reactive compensation. It is also common to install capacitor banks and reactors in transmission lines, in order to improve quality standards to supply electrical energy within those standards [
7]. However, the use of passive banks does not consider the influence of unbalanced loads and non-linear loads on the insertion of harmonics in the electrical system and the consequent impact on the functioning of these compensation elements [
8].
In this sense, new methodologies are proposed that allow analysis, monitoring, pricing, disturbance compensation, and responsible management of modern electrical systems. Among these methodologies, Active Parallel Power Filters (APPFs) have the objective of detecting and compensating the non-active current portions arising from reactive or non-linear loads and from the unbalance between the supply phases [
9]. With compensation, the system source is only responsible for the active power portion, reducing technical and economic impacts arising from the non-active currents [
10].
However, despite the APPFs presenting themselves as a viable alternative to instantaneous compensation, the employment of these devices faces two important obstacles: the calculation of the compensation currents and the implementation of power theories in embedded systems.
The first obstacle refers to the compensation currents; after all, conventional power theory is limited to the frequency domain and does not predict the behavior of non-linear loads. In this sense, modern power theories have been shown to be viable alternatives for the detection of the parcels to be compensated. Among them, the Instantaneous Power Theory (IPT) [
11] is not subjected to describing the behavior of the electrical system by redefining the powers, but operating on other bases to facilitate its manipulation. Consequently, they are more restricted to the separation between active and non-active currents. On the other hand, the Conservative Power Theory (CPT) [
12] presents new definitions for power calculus. By redefining the entire power calculus, it can be used to describe electrical circuits and power systems in a different mode than usual. It can be characterized as a more complete theory, as it also allows for the separation of each portion of power according to the electrical element that originated it. In this way, the analysis of the impact of the insertion of the different components can be carried out to provide more concise data on its real impact on the electrical system.
The second obstacle to overcome is related to the implementation of power theories in embedded systems, since the complexity of the mathematical operations and computational cost are impeditive factors to achieving good performance in different compensation scenarios. Due to these requirements, among the main digital devices for embedded logic, FPGAs (Field-Programmable-Gate-Arrays), have become a viable alternative. The FPGA has advantageous characteristics since it allows parallel processing of its data in addition to working at higher frequencies. Parallel processing allows the analysis and evaluation of different results simultaneously, and its processing time makes it ideal for embedded systems as it minimizes the delays inherent to digital implementation [
13,
14]. Additionally, the number of bits from either the acquired variables or the coefficients of a mathematical operation can be changed according to the needed precision, and its flexibility makes possible the implementation of complex control systems.
This work proposes to implement, validate, and compare the performance of an APPF whose compensation currents will be obtained from the IPT and CPT. For that, the FPGA-in-the-Loop (FIL) technique will be used, which consists of the communication between the simulator and the FPGA board. In this case, plant behavior is obtained from the simulator and the calculations of the theories and the APPF control are implemented in FPGA through a hardware description language using VHDL (VHSIC hardware description language) [
15]. It is worth mentioning that this language describes the behavior and structure of a digital system, that is, the logic units of the FPGA board are rearranged and interconnected to organize themselves in the synthesized circuitry, being able to assume the most varied circuits, according to the synthesis stage [
16,
17,
18,
19]. It is also important to highlight that FIL is a crucial tool for prototyping, since the control techniques and other calculations necessary for the operation of the desired topology can be physically validated, without the need for the physical plant itself [
20]. Additionally, aiming to guide novel proposals, this paper presents as a contribution a comparison between the processing costs of the implemented power theories.
For the comparison tests between the theories implemented in FIL, the description of the circuits was carried out in Quartus II® software and the board used was from Altera® (San Jose, CA, USA), Cyclone IV DE2-115. The simulation environment was MATLAB/Simulink® (Natick, MA, USA).
4. Programming Architecture
As can be seen in
Table 4, the use of logic elements responsible for rearranging the board hardware for the circuit described in VHDL is about 7 times higher for CPT. However, the high capacity of the FPGA board opens the possibility for the implementation of any of the tested theories in addition to more robust controllers.
Registers are not a limitation of the FPGA device once they are built with the board’s logic elements to store data. For the calculus of the CPT and control of the APPF, approximately three times more information was stored when comparing to the IPT strategy.
The pins used are the same for both implementations, as they correspond to the input and output signals. Considering a three-phase system and an APPF fed from the DC capacitance, the number of parallel processes for both theories is the same.
The multiplier elements are the board’s units, extra for the logic elements, and for executing signal multiplication operations efficiently. In this regard, CPT requires about 2.6 times more elements than IPT, occupying almost all the blocks of the board. For both cases, PLL blocks, responsible for adjusting the phase of a signal generated by the code to match an input signal, and memory bits, used for implementations using look-up tables, were not used.
Figure 4 shows a flowchart to illustrate the steps for programming the power theories with the FIL technique. The ADC represents the conversion from the simulator to the board, and the DAC represents the simulator receiving the signals. The calculus are based on the equations of
Section 3 and
Table 4.
5. Simulation Results
In
Figure 5, it is possible to observe the compensation currents for each phase and the neutral of both theories responsible for providing the reference to the APPF.
For the selected loads, it appears that the compensation currents are quite similar. This result demonstrates that for certain cases of compensation, the two theories coincide in their formulation.
For the system operating with FIL, in
Figure 6 and
Figure 7, respectively, the source currents and the voltage in the APPF capacitance for both theories are observed.
The source currents can be analyzed in three distinct periods. In the first, not considered in this work, the capacitance Cf is charged. In the second, the unbalanced currents and the presence of harmonics are observed. In the third period, both controllers are started and the APPF starts to operate.
As can be seen, as soon as the compensation starts, the CPT presents a greater transient in the currents. This transient is a consequence of the multiple integral calculus and RMS values necessary to calculate the compensation currents. However, after the end of the transitory period, the compensation is as effective as in the IPT, leading the source to feed the system with a power factor (PF) of 0.9988.
Right at the beginning of the APPF operation, there is a relevant behavior to consider. The action of compensation causes sudden changes in the currents, leading to high derivatives that are not instantly absorbed by the circuit. Therefore, a transitory period is necessary until the stabilization of the currents according to the generated references.
As for the capacitance voltage, it is noticed that its dynamics in the CPT are faster than in the IPT even though its crossing-over frequency is higher than in the CPT. This is due to the quantities that are used in the voltage loop in each of the theories. In both theories, the voltage controller receives the difference between the 400 V reference and the capacitor voltage. However, the controller at the IPT sends a power signal that is added to the theory’s calculations and then transformed into current signals. In the CPT, the controller output is already given in a current format and is added directly to the compensation currents. Furthermore, it is observed that due to the voltage transient in the IPT, its current transient is also affected, and it is slower than that noticed in TPC. Additionally, the CPT provided a less oscillatory power as observed in
Figure 7.
Because the reached PF is basically unitary, it is evident that the grid currents do not remain with some lag due to the presence of harmonics or uncompensated reactive energy. From
Figure 8 and
Figure 9, in which, respectively, the active and reactive powers supplied from the grid are presented, it is confirmed that in average terms, the entire reactive portion has been compensated.
By analyzing the Total Harmonic Distortion (THD), it is possible to observe how the harmonics were treated in the system.
Table 5 presents the data regarding the THD for the grid phases before and after the insertion of the APPF in the system.
According to the results, one can verify that the THD is considerably reduced compared to the system without APPF correction, resulting in 1.9% and 2.1%, when CPT is in operation, and in less than 1% when IPT is in operation. In
Figure 10, the harmonic content up to the fiftieth order of phase “a” is presented for the APPF running with the CPT. This behavior is similar for the remaining phases and for the IPT theory.
It is also important to verify the compensation effectiveness by observing the individual harmonics as shown in
Table 6.
Table 6 shows the individual harmonics up to the 13th. For higher orders, all verified values are lower than 0.03%. As can be seen, the CPT has a higher harmonic content than the IPT, considering the load scenario in
Table 2. However, its harmonic content is distributed among the 3rd, 5th, and 7th harmonics. As in the IPT, this content is relevant until the 13th.
Another behavior that should be highlighted is the greater impact of the third harmonic (180 Hz). For the case analyzed in
Figure 10, this harmonic corresponds to about 1.94% of the fundamental. This frequency inserted into the current is associated with the capacitor voltage control. Its power is provided by the operation as a three-phase rectifier, which, in turn, ends up generating current harmonics with triple the fundamental frequency.
Eventually, one can conclude why the harmonics of the CPT and the IPT are slightly different. Basically, it is a direct consequence of the voltage outer loop in each theory. Depending on the tuning, the outer loop dynamic can be somewhat significant on the current and the resulting THD.
In order to compare the compensation effectiveness of the present work, we have chosen two works from the current literature. The work in [
29] shows the effectiveness of an APPF regarding current compensation using a Genetic Algorithm and a Queen-Bee assisted Genetic Algorithm to optimize the controller coefficients. In [
30], the current control is performed through a model predictive control. The strategy has as its purpose balance between THD, to maintain its level below IEEE standards and the value of the switching frequency. Therefore, they used a variable switching frequency around the base value shown in
Table 7.
It is worth mentioning that in both works, resistances and inductances are used in the power source and at the point of connection of the loads, representing the cables impedance. Another important fact is the usage of an initial voltage in the DC bus capacitor. In [
29] it is assumed as 200 V, whereas in [
30], it is assumed as 100 V. In both cases, these assumptions facilitate the compensation of the APPF reducing the current peaks and settling time. Regarding the impedance, it helps the compensation currents to flow exclusively to the load. However, it is important to emphasize that in this work, the used initial capacitor voltage nor additional impedances are used.
For the comparison scenario, the grid and the power electronics converter were the same, but the loads were changed to comply with the aforementioned references. A full-wave rectifier feeds the RL loads, and these data are shown in
Table 7.
Figure 11 and
Figure 12 show the current and voltage waveforms at the power source for both load situations of [
29,
30].
Table 8 compares the THD of the current for each phase with the two mentioned controls.
Furthermore, the results of the settling time for each case are also analyzed. Observing the work of [
29], the obtained settling time was 0.23 s and for [
30], there is no available data.
Regarding the application of the PI controllers in IPT and CPT, ignoring the charging time of the capacitor, which is negligible, and knowing that the control starts to operate after two grid cycles, in t = 0.033 s, the settling time for IPT with loads of [
29,
30] are, respectively, t = 0.17 s and t = 0.10 s. As for the CPT, they are t = 0.12 s and t = 0.10 s. The steady-state regime was considered when the values were within
.
6. Conclusions
The operation of parallel processes and the high processing speed of the FPGA are significant differentials for implementing APPF with a high switching frequency. Furthermore, the usage of the simulator and the FPGA board establishing the FIL operation to validate the control and the necessary calculations proved to be a powerful prototyping tool. Such technology allowed for the comparison between the two compensation strategies, with different methods for the reference currents generation with embedded controllers without the necessity for the physical topology for validations and without changing hardware for digital implementation.
Both theories proved valid for the APPF operation, hardware synthesis, and FPGA-in-the-loop implementation. However, since the CPT presents a more complex calculus with more processes than the IPT, a great processing requirement was identified in the usage of logic elements and blocks dedicated to the multiplication on the FPGA board. As a result, the implementation of each theory must be evaluated given the needs of the project and the available computational resources. If the compensation necessity is only related to the reactive power and the available resources are of worry one may use the IPT. If the computational resource is not an important point and different portions of power are necessary to be known or compensated, the CPT is the ideal theory to be implemented.
It is noteworthy that the FIL validation technique opens doors for comparing the performance of different linear and non-linear controllers for the implementation of APPF. In addition, other topologies and control techniques for active power filters can be analyzed to reduce the consequences of their insertion into the system through the FIL implementation. Finally, it is important to verify the quality of the achieved compensation with very low remaining distortion using the FPGA in comparison to other proposals. This is related to the high switching frequency of the used APPF allowed by the high processing power of the FPGA board.