Improving Power Quality by a Four-Wire Shunt Active Power Filter: A Case Study

: This paper presents the use of a three-phase four-wire shunt active power ﬁlter to improve the power quality in the Department of Industrial Electronics of a large enterprise from Romania. The speciﬁcity is given by the predominant existence of single-phase consumers (such as personal computers, printers, lighting and AC equipment). In order to identify the power quality indicators and ways to improve them, an A-class analyzer was used to record the electrical quantities and energy parameters in the point of common coupling (PCC) with the nonlinear loads for 27 h. The analysis shows that, in order to improve the power quality in PCC, three goals must be achieved: the compensation of the distortion power, the compensation of the reactive power and the compensation of the load unbalance. By using the conceived three-leg shunt active power ﬁlter, controlled through the indirect current control method in an original variant, the power quality at the supply side is very much improved. In the proposed control algorithm, the prescribed active current is obtained as a sum of the loss current provided by the DC voltage and the equivalent active current of the unbalanced load. The performance associated with each objective of the compensation is presented and analyzed. The results show that all the power quality indicators meet the speciﬁc standards and regulations and prove the validity of the proposed solution.


Introduction
The power quality problems in the low-voltage three-phase four-wire systems have become very important in recent years, due to the growing existence of single-phase nonlinear loads, such as personal computers, lighting, printers and air conditioning installations.
A characteristic of these single-phase nonlinear loads is that in the spectrum of current harmonics there are significantly low-frequency harmonics, and the triplen harmonics, which have a zero rotational sequence, are added up in the common neutral wire which is subjected to currents from all three phases.In addition, the unbalance leads to additional zero rotational sequence currents and thus, the neutral conductor is overloaded [1,2].
Therefore, the development of high-performance filtering systems for three-phase four-wire networks to reduce the impact of non-linear unbalanced loads on the power supply system is a topical issue.
The main design features, advantages, and drawbacks of passive, active and hybrid active power filters used to comply with the applicable standards in industrial applications (such as IEEE 519-2014) were recently summarized [6].Among these, the active power filters are the most attractive topology for low voltage networks, as they are the most flexible and the most cost-effective solution.
In Dovgun at al. [1], a conditioning system consisting of several hybrid filter units which are installed in various nodes of the distribution network is proposed for compensation of excessive neutral currents and voltage distortions.The selective compensation of distorted voltages and currents, by the interdependent control of harmonic components, is approached.
For low-voltage applications, the preferred topology of active power filters in the market is the shunt active power filter (SAPF) based on a two-level voltage source converter (VSC) [6].Starting from the basic three-wire APF structure, by connecting the fourth wire from the neutral point of the DC-bus to the grid neutral, the cheaper topology of the three-leg APF is obtained.As an alternative, there is the four-leg APF topology in which the fourth wire of the grid is connected to an additional leg of the VSC.The three-leg APF is less costly and less complex compared to the four-leg APF, due to fewer switching legs.On the DC-side of APF, there is the DC-link split capacitor and, on the AC-side, an output coupling filter is used for the connection to the grid in the point of common coupling (PCC) to reduce the current switching harmonics [6,13].
In the control system of a SAPF, there is generally an external control loop for the DC-voltage regulation and an internal control loop for the compensating current regulation [14][15][16].
There are many approaches in the DC-voltage control of a shunt APF.The dynamics of the DC-voltage is an indirect measure of the APF's performance.Commonly, a PI controller ensures voltage control with good performance [7,8,[16][17][18][19].In Xiuyun et al. [20], a hybrid fuzzy PI control strategy combining traditional PI control and fuzzy control is adopted to optimize power loss and compensation performance.The Artificial Neural network (ANN)-tuned adaptive PI controller proposed in Bhattacharya et al. [21] ensures both faster reference generation and better control of the DC voltage.
To generate the prescribed compensating current, the use of the so-called instantaneous powers technique, or p-q theory, is the most common choice as it ensures a good compromise between accuracy and computational complexity [8,10,17,18,[22][23][24][25][26].Besides this, the instantaneous active and reactive current (id-iq) method leads to a good result under unbalanced and non-sinusoidal voltage conditions [8,11].The synchronous reference frame method is also a technique frequently adopted to calculate the reference current [13,17,22,27,28] using the sensed load current and voltage in PCC.
The current controller is a very important component of the APF system.There are linear controllers, such as simple proportional current controllers [29,30], complex proportional multi-resonant controllers for selective harmonic compensation [27,29], or quasi-proportional-resonant controllers [29,31].It must be mentioned that it is difficult to achieve simultaneously small steady-state error and fast dynamic responses by using linear controllers [29].As an alternative, the use of nonlinear controllers can lead to good performance in steady-state regimes and fast dynamic responses [23,32,33].The hysteresis current controller provides a very fast response and acceptable steady-state performance [7,[10][11][12]14,15,19,[24][25][26]29,30,34].The simple implementation, robustness under load parameters variation and enhanced system stability are other advantages of the hysteresis control method.Therefore, the hysteresis control method is widely used in practical applications.However, by using the hysteresis band control method, variable switching frequency results and, therefore, high-frequency current harmonics can be injected into the power supply.Nevertheless, by choosing a proper hysteresis band and by its correlation with the inductivities in the circuit, the switching frequency of the transistors can be kept below their capability [12,16,26,34].
Low steady-state error, fast transient response, fixed switching frequency, good robustness and grid disturbance rejection capability are the main advantages of the second-order sliding-mode control, which is a more complex control proposed in Gong et al. [29].
Energies 2021, 14, 1951 3 of 20 A vector proportional-integral current controller is proposed in Gong et al. [18] for a three-leg APF.This controller ensures good performance even under minimum DC-link voltage conditions and provides ideally zero steady-state current tracking error at selected harmonic frequencies and optimizes transient response.
The authors of Orts-Grau et al. [35] propose a novel, one-cycle digital current controller based on the minimization of the integral error of the current for the control of a three-leg four-wire shunt active power filter.The method is complex, as the optimal ON time is obtained for every switching period.
In Pandove et al. [19], the authors proposed a discrete repetitive control technique for three-phase four-wire shunt APF, where the regular repetitive control is modified by squaring its sensitivity function, in order to improve the stability.
To control the current provided by APF, two current control methods can be adopted: the direct current control (DCC) [10,11,13,14,16,18,23,24,26,29,32,36] and the indirect current control (ICC) [19,34,[37][38][39][40][41].As the name suggests, in the case of DCC, the nonsinusoidal current at the inverter output is directly controlled after comparing its measured value with the prescribed value.The prescribed compensating current is generated based on the measured load current.Unlike DCC, in the case of ICC, the inverter output current is controlled indirectly, by means of the supply current control.For this, a sinusoidal prescribed current at the supply side is generated for the purpose of total compensation, and its value is compared with the measured supply current.By regulating the almost sinusoidal supply current, the control of the non-sinusoidal current provided by APF is ensured.
In recent years, ICC is preferred over DCC as it uses a simpler control scheme, the related calculation is simpler and leads to better performance [19,34,[37][38][39][40][41].Specifically, the compensated supply current is closer to a sinusoid than in the case of DCC [38,41].
In the case study presented in this paper, a four-wire three-leg shunt active power filter is the adopted solution to improve the power quality in a concrete application.The rest of the paper is organized as follows.After presenting the main power quality indicators before compensation in Section 2, Section 3 introduces the experimental setup.The next section is devoted to the control of the four-wire three-leg shunt active power filter.The performance of the active filtering system is presented in Section 5 and, finally, some concluding remarks are drawn.
The main contributions of the paper are as follows: performing a complex energetic analysis based on measurements performed in a real industrial environment; -experimental validation of the indirect current control variant, proposed by the authors; -defining a new indicator for assessing the energy performance of the active power filter, respectively the percentage of reduction of losses upstream of the CCP; -experimental validation of the solution for improving the power quality and compliance with existing harmonic pollution norms.

Case Study and Power Quality Indicators in PCC
The power quality improvement has been achieved for the specific case of the department of Industrial Electronics Design of a large enterprise in Romania.The nonlinear loads to be compensated are predominant single-phase consumers (multiple personal computers (PCs), printers, lighting and AC equipment).
The electrical quantities and energy parameters in the point of common coupling with the nonlinear loads were recorded by using a Fluke 435 analyzer (Fluke Corporation, Everett, WA, USA) for 27 h, between 9 January 2020, 09:58-10 January 2020, 13:09.The sampling period was 60 s, and 1632 recordings were made.
In addition to the recorded data, the following are highlighted: A. The total apparent power is expressed by the known relationship specific to the operation in a non-sinusoidal regime [42,43]: where U A , U B , U C and I A , I B , I C are the RMS values of the phase voltages and currents.B. The total non-active power (S compt ), which is the power to be compensated, is expressed by: where P t is the total active power.Following the analysis of the recorded data, the overall picture of power quality aspects resulted in the following: 1.
The voltages are sinusoidal and symmetrical, and thus the associated power quality indicators are in accordance with the existing regulations; 2.
The waveforms of the fundamental currents (Figure 1) were synthesized based on the values recorded for the weight of the current harmonics, on each phase.The total phase currents are distorted and unbalanced (Figure 2); 3.
The total power factor is affected by the unbalanced and distorting regime (Figure 3); 4.
The maximum values of the power to be compensated (S compM ) were identified, in the two time periods analyzed.Thus: A. For the first period: S compM = 4518 VA, recorded on 9 January 2020, 12:11:34; B. For the second period: S compM = 4565 VA, recorded on 10 January 2020, 12:00:34.
The electrical quantities and energy parameters in the point of common coupling with the nonlinear loads were recorded by using a Fluke 435 analyzer (Fluke Corporation, Everett, WA, USA) for 27 h, between 9 January 2020, 09:58-10 January 2020, 13:09.The sampling period was 60 s, and 1632 recordings were made.
As the Industrial Electronics department works in the 07:30-16:00 time range, the analysis of the results was performed on two time periods, which correspond to the working periods of two consecutive days as follows: -Period I: 9 January 2020; 10:00-16:00; 6 h; -Period II: 10 January 2020; 07:30-13:00; 5.5 h.
In addition to the recorded data, the following are highlighted: A. The total apparent power is expressed by the known relationship specific to the operation in a non-sinusoidal regime [42,43]: where UA, UB, UC and IA, IB, IC are the RMS values of the phase voltages and currents.B. The total non-active power (Scompt), which is the power to be compensated, is expressed by: where Pt is the total active power.Following the analysis of the recorded data, the overall picture of power quality aspects resulted in the following: 1.The voltages are sinusoidal and symmetrical, and thus the associated power quality indicators are in accordance with the existing regulations; 2. The waveforms of the fundamental currents (Figure 1) were synthesized based on the values recorded for the weight of the current harmonics, on each phase.The total phase currents are distorted and unbalanced (Figure 2); 3. The total power factor is affected by the unbalanced and distorting regime (Figure 3     5.It is found that the most unfavorable situation in terms of compensated power was registered in period II (recorded on 10 January 2020, 12:00:34) and it corresponds to a distorting and strongly unbalanced regime, respectively: -The current total harmonic distortion factors (THD) on the three phases have the values 41.74%, 17.77% and 46.56% (Figure 4); - The unbalance factor is 46.66% (Figure 5).
6.The currents on phases A and C (Figure 2) have the typical waveforms of the current absorbed by the uncontrolled rectifiers in an uninterrupted current regime and correspond to the switching sources of the PCs. 7. The current on phase B is less distorted (THD ≈ 18%).8.It is emphasized the unbalance introduced by phase B (the current is more than twice as high as that of phases A and C).

5.
It is found that the most unfavorable situation in terms of compensated power was registered in period II (recorded on 10 January 2020, 12:00:34) and it corresponds to a distorting and strongly unbalanced regime, respectively: -The current total harmonic distortion factors (THD) on the three phases have the values 41.74%, 17.77% and 46.56% (Figure 4); - The unbalance factor is 46.66% (Figure 5).

Experimental Setup
The analysis shows that in order to improve the power quality in PCC, three goals must be achieved: compensation of the distortion power, compensation of the reactive power and compensation of the load unbalance.To achieve them, a four-wire three-leg shunt active power filter was designed, the connection with the transformer neutral point being obtained by dividing the compensation capacity.
The main parameters of the power system are included in Table 1.
Table 1.The main parameters of the system.

6.
The currents on phases A and C (Figure 2) have the typical waveforms of the current absorbed by the uncontrolled rectifiers in an uninterrupted current regime and correspond to the switching sources of the PCs. 7.
The current on phase B is less distorted (THD ≈ 18%).8.
It is emphasized the unbalance introduced by phase B (the current is more than twice as high as that of phases A and C).

Experimental Setup
The analysis shows that in order to improve the power quality in PCC, three goals must be achieved: compensation of the distortion power, compensation of the reactive power and compensation of the load unbalance.To achieve them, a four-wire three-leg shunt active power filter was designed, the connection with the transformer neutral point being obtained by dividing the compensation capacity.
The main parameters of the power system are included in Table 1.
Table 1.The main parameters of the system.The active power filter, which is being developed as a prototype; 2.

Supply
An industrial computer (IC), which ensures the proper SAPF control through the dSPACE 1103 prototyping board (dSPACE GmbH, Paderborn, Germany); 3.
Two Fluke 435 power quality analyzers connected upstream and downstream of the PCC; 4.
A METRIX OX 7042 oscilloscope (Chauvin Arnoux Group, Paris, France) to record the waveforms of the quantities of interest; shown in Figure 6 has been conceived.It includes: 1.The active power filter, which is being developed as a prototype; 2. An industrial computer (IC), which ensures the proper SAPF control through the dSPACE 1103 prototyping board (dSPACE GmbH, Paderborn, Germany); 3. Two Fluke 435 power quality analyzers connected upstream and downstream of the PCC; 4. A METRIX OX 7042 oscilloscope (Chauvin Arnoux Group, Paris, France) to record the waveforms of the quantities of interest; 5.A Fluke 41B analyzer (Fluke Corporation, Everett, WA, USA) to record the waveforms and power quality indicators at the time of measurement.A picture of the experimental stand is given in Figure 7, which highlights the connection of the transducers in PCC, the cabinet in which the SAPF components are mounted, the industrial computer and the devices used.A picture of the experimental stand is given in Figure 7, which highlights the connection of the transducers in PCC, the cabinet in which the SAPF components are mounted, the industrial computer and the devices used.
shown in Figure 6   A picture of the experimental stand is given in Figure 7, which highlights the connection of the transducers in PCC, the cabinet in which the SAPF components are mounted, the industrial computer and the devices used.

Four-Wire Three-Leg SAPF and the Control System
The four-wire SAPF with split compensation capacitor has a known structure and is made with IGBT transistors (Figures 8 and 9).

Four-Wire Three-Leg SAPF and the Control System
The four-wire SAPF with split compensation capacitor has a known structure and is made with IGBT transistors (Figures 8 and 9).The SAPF is controlled by implementing the indirect current control method in an original variant.Thus, the active prescribed current is obtained as a sum of the loss current provided by the DC voltage controller and the equivalent active current of the unbalanced load.
All the control algorithms were created in Matlab/Simulink (R2014a, MathWorks, Natick, MA, USA) and implemented on the DS1103 PPC Controller Board for rapid control prototyping.(Figure 10).
These are acquired through analog to digital converters (ADCs) and appropriate scaling factors that multiply the ADCs' outputs (KTUd, KTI, KTU) are required to obtain quantities in absolute units.
A phase-locked loop (PLL) circuit [16] provides three sinusoidal signals of unity magnitude in phase with the fundamentals of phase voltages (the signal "sincro") and having their frequency (freq).
The original method adopted for the indirect current control involves the control of the grid current by prescribing the total active current ( * gr i ), which is obtained as the sum The four-wire SAPF with split compensation capacitor has a known structure and is made with IGBT transistors (Figures 8 and 9).The SAPF is controlled by implementing the indirect current control method in an original variant.Thus, the active prescribed current is obtained as a sum of the loss current provided by the DC voltage controller and the equivalent active current of the unbalanced load.
All the control algorithms were created in Matlab/Simulink (R2014a, MathWorks, Natick, MA, USA) and implemented on the DS1103 PPC Controller Board for rapid control prototyping.(Figure 10).
These are acquired through analog to digital converters (ADCs) and appropriate scaling factors that multiply the ADCs' outputs (KTUd, KTI, KTU) are required to obtain quantities in absolute units.
A phase-locked loop (PLL) circuit [16] provides three sinusoidal signals of unity magnitude in phase with the fundamentals of phase voltages (the signal "sincro") and having their frequency (freq).
The original method adopted for the indirect current control involves the control of the grid current by prescribing the total active current ( * gr i ), which is obtained as the sum The SAPF is controlled by implementing the indirect current control method in an original variant.Thus, the active prescribed current is obtained as a sum of the loss current provided by the DC voltage controller and the equivalent active current of the unbalanced load.
All the control algorithms were created in Matlab/Simulink (R2014a, MathWorks, Natick, MA, USA) and implemented on the DS1103 PPC Controller Board for rapid control prototyping.(Figure 10).
The quantities required to implement the control algorithm are as follows: the voltage on the compensation capacitor (u dc ), load currents (i LA , i LB , i LC ), mains currents (i grA , i grB , i grC ) and phase voltages in PCC (u grA , u grB , u grC ).
These are acquired through analog to digital converters (ADCs) and appropriate scaling factors that multiply the ADCs' outputs (K TUd , K TI , K TU ) are required to obtain quantities in absolute units.
A phase-locked loop (PLL) circuit [16] provides three sinusoidal signals of unity magnitude in phase with the fundamentals of phase voltages (the signal "sincro") and having their frequency (freq).The two components of the current, on each phase, are obtained by multiplying the corresponding magnitudes with the "sincro" signal.The magnitude of the current related to losses (IalossM) is obtained from the output of the capacitor voltage controller (y_Ruc), transformed into amps (Figure 11).A detailed description of the blocks in Figure 11 can be found in [44].The magnitude of the balanced active current of the load (IaLM) is calculated in provided at the output of the multiplication block Product1 (Figure 10) and supposes the completion of the following stages: (a) Calculate the active power on each phase of the load in the "Mean" blocks (Figure 10), The original method adopted for the indirect current control involves the control of the grid current by prescribing the total active current (i * gr ), which is obtained as the sum of two components (the current corresponding to the losses in SAPF (i aloss ) and the load-balanced active current (i aL ).
i * gr = i aloss + i aL . ( The two components of the current, on each phase, are obtained by multiplying the corresponding magnitudes with the "sincro" signal.The magnitude of the current related to losses (I alossM ) is obtained from the output of the capacitor voltage controller (y_Ruc), transformed into amps (Figure 11).A detailed description of the blocks in Figure 11 can be found in [44].The two components of the current, on each phase, are obtained by multiplying the corresponding magnitudes with the "sincro" signal.The magnitude of the current related to losses (IalossM) is obtained from the output of the capacitor voltage controller (y_Ruc), transformed into amps (Figure 11).A detailed description of the blocks in Figure 11 can be found in [44].The magnitude of the balanced active current of the load (IaLM) is calculated in provided at the output of the multiplication block Product1 (Figure 10) and supposes the completion of the following stages: (a) Calculate the active power on each phase of the load in the "Mean" blocks (Figure 10), The magnitude of the balanced active current of the load (I aLM ) is calculated in provided at the output of the multiplication block Product1 (Figure 10) and supposes the completion of the following stages: (a) Calculate the active power on each phase of the load in the "Mean" blocks (Figure 10), (b) Calculate the RMS value of the phase voltages in the "RMS" blocks (Figure 10), (c) Calculate the magnitude of the balanced active current of the load, Thus, the total active current prescribed to the current controller is obtained by multiplying the total magnitude with the "sincro" signal (Figure 11), It must be specified that: the variables vINC and vCOMP (Figure 10) validate the control of active charging of the compensation capacitor and the control of compensation, respectively; -the voltage controller is of PI type and was designed based on the modulus criterion in Kessler variant [45], and its parameters (K pu and T iu ) but also the prescribed DC-voltage U dcp (Figure 10) can be modified by means of a conceived graphical interface which was created with dSPACE's ControlDesk (R2016-B, dSPACE GmbH, Paderborn, Germany) (Figure 12) that allows the system monitoring and acquisition of the required quantities for further processing; -the current controllers on each phase are of the hysteresis type.
Energies 2021, 14, x FOR PEER REVIEW 10 of 20 (b) Calculate the RMS value of the phase voltages in the "RMS" blocks (Figure 10), (c) Calculate the magnitude of the balanced active current of the load, ( ) Thus, the total active current prescribed to the current controller is obtained by multiplying the total magnitude with the "sincro" signal (Figure 11),

(
)sincro It must be specified that: the variables vINC and vCOMP (Figure 10) validate the control of active charging of the compensation capacitor and the control of compensation, respectively; -the voltage controller is of PI type and was designed based on the modulus criterion in Kessler variant [45], and its parameters (Kpu and Tiu) but also the prescribed DCvoltage Udcp (Figure 10) can be modified by means of a conceived graphical interface which was created with dSPACE's ControlDesk (R2016-B, dSPACE GmbH, Paderborn, Germany) (Figure 12) that allows the system monitoring and acquisition of the required quantities for further processing; -the current controllers on each phase are of the hysteresis type.

Active Filtering System Performance
The adopted control method has the advantage that, the influence of the voltage controller output oscillations on the waveform of the prescribed grid current is practically eliminated.It is known that the voltage on the compensation capacitor has oscillations of a frequency multiple of the grid voltage frequency, and these oscillations are inherently reflected in the output of the voltage controller, which, in addition, has a specific noise due to converter switching (Figure 13).Through the adopted control method, only the current related to losses is affected by the output of the voltage controller.As it represents only 1-3% of the total current, the prescribed current has a practically sinusoidal shape (Figure 14).

Active Filtering System Performance
The adopted control method has the advantage that, the influence of the voltage controller output oscillations on the waveform of the prescribed grid current is practically eliminated.It is known that the voltage on the compensation capacitor has oscillations of a frequency multiple of the grid voltage frequency, and these oscillations are inherently reflected in the output of the voltage controller, which, in addition, has a specific noise due to converter switching (Figure 13).Through the adopted control method, only the current related to losses is affected by the output of the voltage controller.As it represents only 1-3% of the total current, the prescribed current has a practically sinusoidal shape (Figure 14).After the commissioning of SAPF, the waveforms of currents and voltages were oscillographed and recorded over short time intervals.The power quality indicators were recorded over one time period with a Fluke 41B analyzer and with two Fluke 435 analyzers for 165 min.
The objective of multiple registrations was to verify and demonstrate the effectiveness of the proposed solution in several ways.
Due to the limitation of the number of measuring devices' input channels, the results presented in the different figures do not correspond to the same time interval, without affecting the proposed goal.

Compensation of the Distortion Power
The compensation of the distortion power is illustrated by the waveforms of the load phase currents and grid phase currents (Figure 15).

Active Filtering System Performance
The adopted control method has the advantage that, the influence of the voltage controller output oscillations on the waveform of the prescribed grid current is practically eliminated.It is known that the voltage on the compensation capacitor has oscillations of a frequency multiple of the grid voltage frequency, and these oscillations are inherently reflected in the output of the voltage controller, which, in addition, has a specific noise due to converter switching (Figure 13).Through the adopted control method, only the current related to losses is affected by the output of the voltage controller.As it represents only 1-3% of the total current, the prescribed current has a practically sinusoidal shape (Figure 14).After the commissioning of SAPF, the waveforms of currents and voltages were oscillographed and recorded over short time intervals.The power quality indicators were recorded over one time period with a Fluke 41B analyzer and with two Fluke 435 analyzers for 165 min.
The objective of multiple registrations was to verify and demonstrate the effectiveness of the proposed solution in several ways.
Due to the limitation of the number of measuring devices' input channels, the results presented in the different figures do not correspond to the same time interval, without affecting the proposed goal.

Compensation of the Distortion Power
The compensation of the distortion power is illustrated by the waveforms of the load phase currents and grid phase currents (Figure 15).After the commissioning of SAPF, the waveforms of currents and voltages were oscillographed and recorded over short time intervals.The power quality indicators were recorded over one time period with a Fluke 41B analyzer and with two Fluke 435 analyzers for 165 min.
The objective of multiple registrations was to verify and demonstrate the effectiveness of the proposed solution in several ways.
Due to the limitation of the number of measuring devices' input channels, the results presented in the different figures do not correspond to the same time interval, without affecting the proposed goal.

Compensation of the Distortion Power
The compensation of the distortion power is illustrated by the waveforms of the load phase currents and grid phase currents (Figure 15).The distortion of the load currents is different in the three phases, respectively THD is of 10-40% (Figures 16-19).After the harmonic compensation, THD is reduced to 3.5-5% (Figures 16-18).The distortion of the load currents is different in the three phases, respectively THD is of 10-40% (Figures 16-19).After the harmonic compensation, THD is reduced to 3.5-5% (Figures 16-18).The distortion of the load currents is different in the three phases, respectively THD is of 10-40% (Figures 16-19).After the harmonic compensation, THD is reduced to 3.5-5% (Figures 16-18).The distortion of the load currents is different in the three phases, respectively THD is of 10-40% (Figures 16-19).After the harmonic compensation, THD is reduced to 3.5-5% (Figures 16-18).Correlating the values recorded at the same time points (Figure 19), the filtering effi ciency on each phase has the values: on phase A, between 3.25 and 7.7; on phase B, be tween 4 and 9; on phase C, between 3.12 and 9.1.The filtering efficiency is calculated a the ratio of THD factors before and after harmonic compensation.

Reactive Power Compensation
The reactive power compensation is illustrated through waveforms of the phase volt ages and currents at the grid side (Figures 20 and 21), which show that their phases coin cide.It is also shown that the power factors on each phase, measured with the Fluke 41B analyzer, are unitary (Figure 21).The evolution of the total power factor during the re cordings upstream and downstream of the PCC shows very good performance, both in compensating the distortion power and in compensating the reactive power (Figure 22) Thus, the power factor at the load side (downstream of the PCC), for most of the interval has values between 0.8 and 0.9, and, after compensation, upstream of the PCC, the value become practically unitary.Correlating the values recorded at the same time points (Figure 19), the filtering efficiency on each phase has the values: on phase A, between 3.25 and 7.7; on phase B, between 4 and 9; on phase C, between 3.12 and 9.1.The filtering efficiency is calculated as the ratio of THD factors before and after harmonic compensation.

Reactive Power Compensation
The reactive power compensation is illustrated through waveforms of the phase voltages and currents at the grid side (Figures 20 and 21), which show that their phases coincide.It is also shown that the power factors on each phase, measured with the Fluke 41B analyzer, are unitary (Figure 21).The evolution of the total power factor during the recordings upstream and downstream of the PCC shows very good performance, both in compensating the distortion power and in compensating the reactive power (Figure 22).Thus, the power factor at the load side (downstream of the PCC), for most of the interval, has values between 0.8 and 0.9, and, after compensation, upstream of the PCC, the values become practically unitary.Correlating the values recorded at the same time points (Figure 19), the filtering efficiency on each phase has the values: on phase A, between 3.25 and 7.7; on phase B, between 4 and 9; on phase C, between 3.12 and 9.1.The filtering efficiency is calculated as the ratio of THD factors before and after harmonic compensation.

Reactive Power Compensation
The reactive power compensation is illustrated through waveforms of the phase voltages and currents at the grid side (Figures 20 and 21), which show that their phases coincide.It is also shown that the power factors on each phase, measured with the Fluke 41B analyzer, are unitary (Figure 21).The evolution of the total power factor during the recordings upstream and downstream of the PCC shows very good performance, both in compensating the distortion power and in compensating the reactive power (Figure 22).Thus, the power factor at the load side (downstream of the PCC), for most of the interval, has values between 0.8 and 0.9, and, after compensation, upstream of the PCC, the values become practically unitary.

Unbalance Compensation
As stated, the load is strongly unbalanced, and a measure of the unbalance is give by the ratio of the RMS current through the neutral wire and the sum of the RMS value of the currents in phases, ( ) ( During the recordings, the load current unbalance changes between 13% and 58% with rapid changes (Figure 23).Regarding the grid currents, zero value was recorded fo the current in the neutral wire, although the rms values of the phase currents are slight different.
To characterize the remaining unbalance after compensation, the deviation of th RMS value of the phase current from the average value of current on phases (Iav) was used In addition, the indicator defined as the ratio of the maximum deviation and the sum o the RMS values of the phase currents was introduced, as follows:

Unbalance Compensation
As stated, the load is strongly unbalanced, and a measure of the unbalance is given by the ratio of the RMS current through the neutral wire and the sum of the RMS values of the currents in phases, ) During the recordings, the load current unbalance changes between 13% and 58%, with rapid changes (Figure 23).Regarding the grid currents, zero value was recorded for the current in the neutral wire, although the rms values of the phase currents are slightly different.
To characterize the remaining unbalance after compensation, the deviation of the RMS value of the phase current from the average value of current on phases (Iav) was used.In addition, the indicator defined as the ratio of the maximum deviation and the sum of the RMS values of the phase currents was introduced, as follows:

Unbalance Compensation
As stated, the load is strongly unbalanced, and a measure of the unbalance is given by the ratio of the RMS current through the neutral wire and the sum of the RMS values of the currents in phases, ) During the recordings, the load current unbalance changes between 13% and 58%, with rapid changes (Figure 23).Regarding the grid currents, zero value was recorded for the current in the neutral wire, although the rms values of the phase currents are slightly different.
To characterize the remaining unbalance after compensation, the deviation of the RMS value of the phase current from the average value of current on phases (Iav) was used.In addition, the indicator defined as the ratio of the maximum deviation and the sum of the RMS values of the phase currents was introduced, as follows:

Unbalance Compensation
As stated, the load is strongly unbalanced, and a measure of the unbalance is given by the ratio of the RMS current through the neutral wire and the sum of the RMS values of the currents in phases, During the recordings, the load current unbalance changes between 13% and 58%, with rapid changes (Figure 23).Regarding the grid currents, zero value was recorded for the current in the neutral wire, although the rms values of the phase currents are slightly different.

C B A
The values of this indicator are in the range 0-2.15% and show that the grid current unbalance is negligible.
By processing the records, the electrical losses saved upstream of the PCC were estimated, which highlights the positive effects of connecting the active filtering system.For this, the compensated unbalance active power and the compensated apparent power were calculated.

Compensated Unbalance Active Power
Given that the load unbalance is fully compensated, the compensated unbalance active power was calculated by the expression: where PLA,B,C are the active powers on each phase of the load, and PLt is the total active power taken over by the load (the sum of the active powers per phase).Its evolution shows rapid and frequent variations, the minimum value being 0% and the maximum value about 57% (Figure 24).

Compensated Apparent Power
The compensated apparent power was calculated by the expression: To characterize the remaining unbalance after compensation, the deviation of the RMS value of the phase current from the average value of current on phases (I av ) was used.In addition, the indicator defined as the ratio of the maximum deviation and the sum of the RMS values of the phase currents was introduced, as follows: The values of this indicator are in the range 0-2.15% and show that the grid current unbalance is negligible.
By processing the records, the electrical losses saved upstream of the PCC were estimated, which highlights the positive effects of connecting the active filtering system.For this, the compensated unbalance active power and the compensated apparent power were calculated.

Compensated Unbalance Active Power
Given that the load unbalance is fully compensated, the compensated unbalance active power was calculated by the expression: where P LA,B,C are the active powers on each phase of the load, and P Lt is the total active power taken over by the load (the sum of the active powers per phase).Its evolution shows rapid and frequent variations, the minimum value being 0% and the maximum value about 57% (Figure 24).
The values of this indicator are in the range 0-2.15% and show that the grid current unbalance is negligible.
By processing the records, the electrical losses saved upstream of the PCC were estimated, which highlights the positive effects of connecting the active filtering system.For this, the compensated unbalance active power and the compensated apparent power were calculated.

Compensated Unbalance Active Power
Given that the load unbalance is fully compensated, the compensated unbalance active power was calculated by the expression: where PLA,B,C are the active powers on each phase of the load, and PLt is the total active power taken over by the load (the sum of the active powers per phase).Its evolution shows rapid and frequent variations, the minimum value being 0% and the maximum value about 57% (Figure 24).

Compensated Apparent Power
The compensated apparent power was calculated by the expression: ( ) Figure 24.Evolution of the compensated unbalance active power during the recordings (p.u.).

Compensated Apparent Power
The compensated apparent power was calculated by the expression: It has a minimum value of 24% and a maximum value of 60% (Figure 25).It is significant that, during the recordings, in the longest period, the values are in the range of 40-50%.

Saved Electrical Losses Upstream of the SAPF Connection Point
In assessing the relative decrease in electrical losses upstream of the SA point the Joule effect losses were taken into account, which are proportiona of the rms value of the current.
Thus, the equivalent grid current in the absence of SAPF (Ie1) and the e current in the presence of SAPF (Ie2) were calculated as follows: where Sgrt is the total apparent power at the grid side after compensation.Further, if the equivalent resistance downstream of the PCC is conside stant, the saved electrical losses can be expressed as: The evolution of the relative decrease of the electrical losses upstream tion point of the SAPF changes between 0% and 35%, with an average valu (Figure 26).It is appreciated that this result also supports the efficiency of th ing system.

Saved Electrical Losses Upstream of the SAPF Connection Point
In assessing the relative decrease in electrical losses upstream of the SAPF connection point the Joule effect losses were taken into account, which are proportional to the square of the rms value of the current.
Thus, the equivalent grid current in the absence of SAPF (I e1 ) and the equivalent grid current in the presence of SAPF (I e2 ) were calculated as follows: where S grt is the total apparent power at the grid side after compensation.Further, if the equivalent resistance downstream of the PCC is considered to be constant, the saved electrical losses can be expressed as: The evolution of the relative decrease of the electrical losses upstream of the connection point of the SAPF changes between 0% and 35%, with an average value of about 20% (Figure 26).It is appreciated that this result also supports the efficiency of the active filtering system.
The evolution of the relative decrease of the electrical losses upstream of the connection point of the SAPF changes between 0% and 35%, with an average value of about 20% (Figure 26).It is appreciated that this result also supports the efficiency of the active filtering system.

1.
The energetic analysis performed by the recordings with the Fluke 435 analyzer in the PCC of the Industrial electronic department of a large enterprise showed that the regime is strongly distorted and unbalanced.

2.
In order to improve the power quality, a four-wire three-leg SAPF with compensation split-capacitor, which was connected in the PCC, was designed and achieved, as a prototype.

3.
The control algorithm based on an original indirect current control by using the active component of the load current was implemented on the DSP prototyping system dSPACE 1103.4.
Experimental tests and data collection were performed by four means: -DSP board dSPACE 1103 through the graphical interface created for this purpose; - The two-channel oscilloscope METRIX OX 7042; -Fluke 41B Analyzer; -Fluke 435 Analyzer (two devices).

5.
The energy parameters were recorded simultaneously, upstream and downstream of the SAPF connection point, for about 3 h (165 min).6.
The recorded waveforms at different time points (using the oscilloscope and Fluke 41B analyzer), correlated with the processing of data recorded with Fluke 435 analyzers, highlight the very good performance obtained by active filtering, respectively: -The total harmonic distortion factors of the phase grid currents have values between 3.5% and 5% and fall within the imposed limits.After correlation with the values recorded at the same time, points for load currents, a filtering efficiency between 3.12 and 9.1, is obtained; -Both the compensation of the distortion power and the compensation of the reactive power are obtained, which makes the supply power factor, after the compensation, to be almost unitary; - The load current unbalance varies between 13% and 58%, whereas, at the grid side, it is negligible (maximum 2.15%); -It was estimated that, through the proposed solution, a decrease of electrical losses is obtained upstream of the SAPF connection point of up to 35%, with an average value of about 20%.

Conclusions
It has been proven experimentally that the proposed solution (three-phase four-wire SAPF with split-capacitor and the control algorithm) for solving the problems of power quality in the considered case study is appropriate in order to achieve total compensation (distortion power, reactive power and unbalance power).
The research presented in the paper contains at least two novelty elements:

Figure 1 .
Figure 1.The fundamental components of the load phase currents in the most unfavorable case.Figure 1.The fundamental components of the load phase currents in the most unfavorable case.

Figure 1 . 20 Figure 2 .
Figure 1.The fundamental components of the load phase currents in the most unfavorable case.Figure 1.The fundamental components of the load phase currents in the most unfavorable case.Energies 2021, 14, x FOR PEER REVIEW 5 of 20

Figure 2 .
Figure 2. The load phase currents in the most unfavorable case.Figure 2. The load phase currents in the most unfavorable case.

Figure 2 .Figure 3 .
Figure 2. The load phase currents in the most unfavorable case.

Figure 3 .
Figure 3.The power factor for each phase: (a) during the first period (9 January 2020); (b) during the second period (10 January 2020).

Figure 5 .
Figure 5.The load unbalance reflected by the neutral wire current: (a) during the first period (9 January 2020); (b) during the second period (10 January 2020).
analyzer (Fluke Corporation, Everett, WA, USA) to record the waveforms and power quality indicators at the time of measurement.

Figure 6 .
Figure 6.The structure of the experimental setup.

Figure 7 .
Figure 7. Picture of the experimental setup.

Figure 6 .
Figure 6.The structure of the experimental setup.
has been conceived.It includes:1.The active power filter, which is being developed as a prototype; 2.An industrial computer (IC), which ensures the proper SAPF control through the dSPACE 1103 prototyping board (dSPACE GmbH, Paderborn, Germany); 3. Two Fluke 435 power quality analyzers connected upstream and downstream of the PCC; 4. A METRIX OX 7042 oscilloscope (Chauvin Arnoux Group, Paris, France) to record the waveforms of the quantities of interest; 5.A Fluke 41B analyzer (Fluke Corporation, Everett, WA, USA) to record the waveforms and power quality indicators at the time of measurement.

Figure 6 .
Figure 6.The structure of the experimental setup.

Figure 7 .
Figure 7. Picture of the experimental setup.Figure 7. Picture of the experimental setup.

Figure 7 .
Figure 7. Picture of the experimental setup.Figure 7. Picture of the experimental setup.

Figure 8 .
Figure 8.The power structure of SAPF.

Figure 9 .
Figure 9. Picture of the shunt active power filter.

Figure 8 .
Figure 8.The power structure of SAPF.

Figure 8 .
Figure 8.The power structure of SAPF.

Figure 9 .
Figure 9. Picture of the shunt active power filter.

Figure 9 .
Figure 9. Picture of the shunt active power filter.
of two components (the current corresponding to the losses in SAPF (ialoss) and the loadbalanced active current (iaL).

Figure 10 .
Figure 10.The scheme of the control algorithm implemented on the DS1103 PPC Controller Board.

Figure 11 .
Figure 11.The structure of the SAPF control.

Figure 10 .
Figure 10.The scheme of the control algorithm implemented on the DS1103 PPC Controller Board.

2021, 14 ,Figure 10 .
Figure 10.The scheme of the control algorithm implemented on the DS1103 PPC Controller Board.

Figure 11 .
Figure 11.The structure of the SAPF control.

Figure 11 .
Figure 11.The structure of the SAPF control.

Figure 13 .
Figure 13.Oscillograms of voltages across the compensation capacitor (V+V-and V+N).

Figure 14 .
Figure 14.Balanced active voltages and currents (prescribed) on the load phases (provided by the graphical interface).

Figure 13 .
Figure 13.Oscillograms of voltages across the compensation capacitor (V+V-and V+N).

Figure 13 .
Figure 13.Oscillograms of voltages across the compensation capacitor (V+V-and V+N).

Figure 14 .
Figure 14.Balanced active voltages and currents (prescribed) on the load phases (provided by the graphical interface).

Figure 14 .
Figure 14.Balanced active voltages and currents (prescribed) on the load phases (provided by the graphical interface).

Figure 15 .
Figure 15.Oscillograms of currents on phases A (a) and B (b), downstream (top) and upstream (bottom) of the PCC.

Figure 16 .Figure 17 .
Figure 16.Harmonic spectra of currents on phases A (a) and C (b): downstream of the PCC (in black); upstream of the PCC (in red).

Figure 15 .
Figure 15.Oscillograms of currents on phases A (a) and B (b), downstream (top) and upstream (bottom) of the PCC.

Figure 15 .
Figure 15.Oscillograms of currents on phases A (a) and B (b), downstream (top) and upstream (bottom) of the PCC.

Figure 16 .Figure 17 .
Figure 16.Harmonic spectra of currents on phases A (a) and C (b): downstream of the PCC (in black); upstream of the PCC (in red).

16 .Figure 15 .
Figure 15.Oscillograms of currents on phases A (a) and B (b), downstream (top) and upstream (bottom) of the PCC.

Figure 16 .Figure 17 .
Figure 16.Harmonic spectra of currents on phases A (a) and C (b): downstream of the PCC (in black); upstream of the PCC (in red).

17 .
Waveform, harmonic spectrum and THD of the current on phase A: downstream of the (a-c); upstream of the PCC (d-f).

Figure 18 .
Figure 18.Waveform, harmonic spectrum and THD of the current on phase B: downstream of the PCC (a-c); upstream of the PCC (d-f).

Figure 19 .
Figure 19.Evolutions of current distortion factors on phase A (a), phase B (b) and phase C (c): downstream of PCC (in black); upstream of the PCC (in blue).

Figure 18 .Figure 18 .
Figure 18.Waveform, harmonic spectrum and THD of the current on phase B: downstream of the PCC (a-c); upstream of the PCC (d-f).

Figure 19 .
Figure 19.Evolutions of current distortion factors on phase A (a), phase B (b) and phase C (c): downstream of PCC (in black); upstream of the PCC (in blue).

Figure 19 .
Figure 19.Evolutions of current distortion factors on phase A (a), phase B (b) and phase C (c): downstream of PCC (in upstream of the PCC (in blue).

Figure 20 .Figure 21 .
Figure 20.Oscillograms of voltages and currents on phase A (a) and phase B (b), upstream of the PCC.

Figure 22 .
Figure 22.Evolution of the total power factor during recordings.

Figure 20 .Figure 20 .Figure 21 .
Figure 20.Oscillograms of voltages and currents on phase A (a) and phase B (b), upstream of the PCC.

Figure 22 .
Figure 22.Evolution of the total power factor during recordings.

Figure 21 .
Figure 21.Powers and power factors in phases upstream of the PCC, measured at three moments of time: (a-c).

Figure 20 .Figure 21 .
Figure 20.Oscillograms of voltages and currents on phase A (a) and phase B (b), upstream of the PCC.

Figure 22 .
Figure 22.Evolution of the total power factor during recordings.

Figure 22 .
Figure 22.Evolution of the total power factor during recordings.

Figure 23 .
Figure 23.Evolution of load current unbalance (in black) and grid current unbalance (in blue) during recordings (%).

Figure 24 .
Figure 24.Evolution of the compensated unbalance active power during the recordings (p.u.).

Figure 23 .
Figure 23.Evolution of load current unbalance (in black) and grid current unbalance (in blue) during recordings (%).

Figure 23 .
Figure 23.Evolution of load current unbalance (in black) and grid current unbalance (in blue) during recordings (%).

Figure 24 .
Figure 24.Evolution of the compensated unbalance active power during the recordings (p.u.).

nergies 2021 ,
14, x FOR PEER REVIEW It has a minimum value of 24% and a maximum value of 60% (Figure icant that, during the recordings, in the longest period, the values are in th 50%.

Figure 25 .
Figure 25.Evolution of the compensated apparent power during the recordings (p.

Figure 25 .
Figure 25.Evolution of the compensated apparent power during the recordings (p.u.).

Figure 26 .
Figure 26.Evolution of the relative decrease of electrical losses upstream of the connection point, during the recordings (p.u.).

Figure 26 .
Figure 26.Evolution of the relative decrease of electrical losses upstream of the connection point, during the recordings (p.u.).