Adaptive notch filter solution under unbalanced and/or distorted point of common coupling voltage for three-phase four-wire shunt active power filter with sinusoidal utility current strategy

In this study, the three-phase four-wire shunt active power filter (ShAPF) dealing with non-ideal point of common coupling (PCC) voltages will be presented. The instantaneous power theory is applied to design the ShAPF controller which shows reliable performances. An adaptive notch filter (ANF) is proposed to process those unbalanced and/or distorted PCC voltage. The power balance among utility, load and ShAPF while applying ANF is clarified by an in-depth explanation. The simulation results prove that the ANF can successfully facilitate the ShAPF in terms of compensating unbalanced/distorted current of loads under a non-ideal PCC voltage circumstance.


Introduction
Harmonics currents of non-linear loads involve critical issues in power system [1][2][3]. Instead of passive inductor capacitor (LC) filter, the active power filter (APF) is applied as a better solution to filter out the harmonics [2,4] because of its ability to suppress the harmonic currents and even to compensate for the reactive power. Fig. 1 shows the compensation principle of the three-phase four-wire shunt APF (ShAPF), which is the subject of this paper. The targets are to make the current (i s ) from utility become sinusoidal and to cancel neutral currents from utility even when the load current is unbalanced and/or distorted. They are implemented by controlling the power converter to generate a compensation current that is equal to the harmonic and the reactive load currents. Each element of this test system will be explained in detail in Section 3.
Among many methods, the instantaneous power theory of Akagi et al. [5] proved to be successful with its design in controlling three-phase three-wire APF systems. In 1993, 1995 and 1997, Watanabe et al. [6], Aredes and Watanabe [7] and Aredes et al. [8] extended that theory to three-phase four-wire application where the zero-sequence (Zs) components including voltage v 0 , current i 0 and power p 0 existed and three line currents in three phases are independent. Besides solving the problems of current harmonics, reactive power, load current balancing, the three-phase four-wire ShAPF can eliminate the neutral current flow in the utility neutral line.
The common point of the control techniques is the requirement of a grid voltage measurement [9]. However, the non-ideal voltages usually occur because of the variations in the load characteristics over time and/or the unbalanced nature of the load, which could arise, for example, from the different phases of the load current because of the alterations of the impedances. Therefore the dynamic characteristics of the harmonic detection methods would probably be adversely affected without a proper consideration of the condition of grid voltages and currents. As a result, under non-ideal voltage, instantaneous power theories of Akagi do not show good performance. Previous researches proposed solutions for this matter [10][11][12][13][14][15][16][17]. The papers [10][11][12][13] used pure utility currents as a target function to calculate compensated currents which make the controller dynamic more sensitive to any disturbance. The papers [14,15] were based on a complex calculation while a dynamic response to load change of APF was not mentioned. Furthermore, those approaches did not testify in all general cases of point of common coupling (PCC) voltages. In another direction, papers [16][17][18][19][20][21][22] used the dq-coordinate and low-pass filter (LPF) to implement compensation which required reference frame transformation and led to a more complicated design of the controller. In short, these algorithms demand some low-pass or high-pass filters to extract the fundamental or the harmonic components. In [23,24], a neural network-based solution was proposed for the control of the ShAPFs operating under the non-ideal voltage conditions. Some other approaches applied self-tuning filter (STF) to solve the control problem of the ShAPFs in the non-ideal voltage conditions and showed significant performance which are referred as the STF-based pq theory (STF-pq) and the STF-based dq method (STF-dq), respectively [25][26][27][28][29][30][31][32][33][34][35][36]. All aforementioned references deal with three-phase three-wire APF and the STF-based methods need to use the phase-locked loop (PLL) for implementation.
As a result, a powerful signal processing tool to solve the PCC non-ideal voltages is demanded. In this paper, adaptive notch filter (ANF) [37,38] with its excellent performance is used to extract positive-sequence component (Ps-component) from non-ideal voltages, thanks to its fast reaction in comparison with other types of signal processing units. For about 30 years, the adaptive filter method has been developed and, under the environment of the statistical characteristics, its filtering performance is far more than the general fixed parameters filter. The concept of ANF looks very much similar to that of a PLL. However, the PLL is fundamentally different from the ANF in the way that it actively generates its output signal, whereas the ANF (which is frequency based) extracts passively the required output from the input signal [37]. The ANF offers a high degree of insensitivity to power system disturbances, harmonics and other types of pollution existing in the grid signal and structural simplicity because it requires no voltage-controlled oscillator as the PLL does. The ANF is a basic adaptive structure that can be used to extract the desired sinusoidal component of a given periodic signal by tracking its frequency variations [39][40][41][42][43][44]. Advanced signal processing methods in both time-and frequency-domains have been developed in the past [45,46]. Frequency-domain approaches are fast Fourier transform and discrete Fourier transform techniques. Important time-domain schemes are the instantaneous dq, the synchronous dq, notch filters, approximated band-pass resonant filters and the stationary frame filters.
The application of ANF in an APF has not been presented in previous approaches, whereas a powerful APF should contain an advanced signal processing performance that can additionally extract sequence components for compensation purpose. This paper gradually shows the following key points: † The ANF can facilitate duties of APF under non-ideal voltages with a low investment. † Symmetrical component transformation is not required in the control of ShAPF to carry out the proposed solution easier. † The proposed controller integrated ANF for ShAPF is feasible to various tested cases. † That controller has an explicit algorithm, which allows compensating harmonics, reactive power and imbalance currents under unbalanced non-linear load and non-ideal voltages at PCC. † Current extraction eliminates the requirement of any high-pass or low-pass filtering as otherwise required by the dq-filter method, p-q and p-q-r theories and so on. The algorithm can also be successfully applied under variable load conditions. It is noted that during ShAPF working, currents from the utility are called as compensated currents and currents from ShAPF as compensating currents or eliminated currents. The target of controller is a sinusoidal utility current controlling instead of the constant utility instantaneous power strategy; since with non-ideal PCC voltage, it is impossible to satisfy both conditions at the same time.
The main contributions of this paper are three-folded: † For the first time, ANF is applied to control a three-phase four-wire APF in both abc-coordinate and αβ-coordinate. The algorithm does not necessitate pre-processing, such as high-pass and low-pass filtering, in order to separate the fundamental and the harmonic components. † Instead of using LPF of the conventional instantaneous power theory used to filter out the average load power, the ANF is applied to implement that duty. This finding brings a better APF performance. † Performance of the system is evaluated under the distorted and/or the unbalanced utility voltages and with the unbalanced, the non-linear and the variable load groups.

Proposed controller
In three-phase four-wire ShAPF, two kinds of converters, the three-leg one [7] or four-leg one [17], are used. The dc/ac converter of ShAPF should provide the compensation current to make utility current sinusoidal. The controller is established based on the instantaneous power theory where all the parameters are processed instantaneously. The input signals of the controller include utility voltage (v abc ), load current (i abcL ), converter output current (i abcAF ) and dc voltage V dc , V ref dc (to prevent overcharge dc capacitor). Since the target is laid on the load, its consuming power is continuously measured and analysed. ANF is applied to obtain fundamental Ps-component from the non-ideal voltage instantaneously and accurately. Therefore the controller can exactly determine the fundamental reactive power of the load and then produce fundamental Ps-sequence ac current orthogonal to the fundamental Ps-sequence ac voltage to provide only that fundamental reactive power. Furthermore, symmetrical component transformation is not required in the control of the active filter making the proposed solution easier to implement in practice.

Controller based on instantaneous power theory and ANF
The sensors measure three-phase voltage signals at PCC. For a three-phase sinusoidal signal u(t) given by The ANF will be used to process this voltage. The dynamic behaviour of the ANF is characterised by the following set of differential equationsẍ where u(t) is the input signal, e(t) is the error signal, θ is the estimated frequency and ζ and γ are adjustable real positive parameters. ζ is the damping ratio which determines the estimation accuracy. The smaller ζ increases a convergence speed but leads to a higher overshooting. γ is the adaptation gain representing capability of the algorithm in tracking the signal characteristics variations. The higher γ makes a smaller variation but simultaneously degrades the convergence speed. The values of those parameters are given in Table 1 under the rules in the paper [39]. The ANF structure has three integrators. The initial condition for the one that outputs the frequency, ω, is set to the nominal power system frequency, of (2π × 50) rad/s as in this paper. The initial conditions for all other integrators are set to zero. A three-phase ANF for three-phase systems using a seven-order dynamical ANF system is introduced as follows. Considering three identical ANFs [38] where θ is an estimate for ω. The update law for frequency estimation is proposed to beu The dynamical system given by (3) and (4) has a unique periodic orbit located at and u = v. For the three-phase ANF, in the steady state, the defined outputsẋ V and θx Ω are where ẋ V is the fundamental component and −u x V is its 90°p hase-shift which is represented by S 90°. When PCC voltage contains harmonic components, the filter dynamics in (2) is identical to a resonator,ẍ + u 2 x = 0, that is forced by error signal e(t). That error signal incorporates the signal x(t) under the update law of (2). In addition, the second component of the periodic orbit of (5), ẋ V = A V sin vt + f V ,i s equal to the fundamental component of the input signal, u(t). A new structure composed of n parallel adaptive sub-filters is implemented to directly estimate frequencies of u(t) = n i=1 A Vi sin v i t + f i . Thus, the ith sub-filter of each phase is formulated as (7) (removed Ω). In this simulation study, ζ i is chosen to be equal to ζ 1 /ï The multi-block ANF allows an increase in the filter's bandwidth, and thus in the filter's convergence speed as well. The sub-filters in that structure remove low-frequency harmonics and output a signal for the main ANF that contains no low-order harmonics. This structure eliminates undesired low-order harmonics that are the closest ones to the fundamental, whereas higher-order harmonics are naturally eliminated by the ANF.

ANF stability analysis:
To filter out the fundamental components, the ANF tracks that fundamental frequency based on (3) and (4). A detailed stability analysis of ANF and characteristics of the ANF algorithm is in Appendix A of the study [47] based on the theory of the paper [48]. Simply, the ANF stability can be proved below. The update law in (4) can be rewritten aṡ When this estimation is close to the periodic orbit p Ω (t), the u = v 0 and¨ x V =−v 2 0 x V . Then, the update law in this point iṡ This equation shows that close to the periodic orbit of p Ω (t), the adaptation process is slow and the search in the θ space will go into the correct direction since The fast and accurate detection of the Ps-components of ANF is necessary under non-ideal PCC voltage. The input signals of ANF, u(t) can be decomposed into Ps-, negative-sequence (Ns) and Zs components as u(t)=u + (t)+u − (t)+u 0 (t) and they are related to the input signal u(t) by these equations [38] u where I is a [3 × 3] identity matrix; T 1 and T 2 are 3 × 3 matrices given in the following equations After receiving Ps-voltage from measured v abc by using ANF, the instantaneous real power ( p L ) and imaginary power (q L ) of load can be calculated using the Clarke transformation as shown in the following equations v 1+ Preferably, the ANF can also be applied directly in the αβ0-coordinate in order to simplify the calculation, in which only two axes are taken into account. The Clarke transformation in (12) is (3) and (4) are rewritten in αβ0-coordinatë Applying (11) and ẋ C , −u x C are estimated from (15), the Ps-components of voltages in αβ0-coordinate are calculated by the where ' 1+ ' means only fundamental Ps-components are considered in this equation. Therefore symmetrical component transformation with a-operator (a =e j120°) is not required in this paper. The Zs-component does not exist in the Clarke voltage transformation since the fundamental Ps-sequence voltages have been extracted from the non-ideal voltages. In general, the real and imaginary powers include two parts which are average (superscript) one and oscillating (superscript ) one. They are realised through an LPF (or rarely a high-pass filter). The LPF cut-off frequency must be selected carefully because of the inherent dynamics of loads to compensation errors during transients. Unfortunately, the unavoidable time delay of LPF may degrade the controller's performance. In practice, a fifth-order Butterworth LPF with a cut-off frequency between 20 and 100 Hz has been used successfully depending on the spectral components in oscillating part that is to be compensated

Find average power by using ANF:
Conventionally, LPF is used to filter out the average power. In this paper, applying ANF to find the average power shows better performance and that LPF can be eliminated. First, by using ANF, the fundamental Ps-component of current is obtained where i Ψ (t) is the three-phase current of load. According to (16), the Ps-components of currents similarly in αβ0-coordinate are calculated Although fundamental Ps-component of voltage is utilised from (16), the fundamental average component of load power is provided The p L is then calculated by using (17). Compared with the LPF, the utility will supply more pure Ps-component power to the load, whereas the APF simultaneously provides only the oscillating component.
In (17), the average part derives from fundamental component of load current, whereas the oscillating part is made by harmonics and Ns components. After a successful compensation, the imaginary power and the oscillating part of real power will be provided by the ShAPF. The utility in that case supplies only the average power of the load demand. The rest is supposed to be fed from the ShAPF. Additionally, the dc voltage regulator determines an extra amount of real power ( p loss ) that causes additional flow of energy to (from) dc capacitor C DC in order to keep its voltage around a fixed reference value. That real power is fed by utility. Furthermore, the dc voltage regulation passes through a proportional-integral (PI) controller after via LPF which filters out the switching harmonics existing in the dc capacitor voltage. The PI parameters are adjusted to provide adequate dynamic to neutralise the dc-bus voltage variations. Alternatively, a proportional gain can also be calculated to implement this V dc control as in Section 2.2. The p loss plays an important role in providing energy balance inside the ShAPF as explained in more details in the next section. It forces the pulse-width modulation (PWM) inverter to absorb (deliver) energy from (to) the utility to charge the dc capacitor.
All of the imaginary powers, q L = p L +q L , are compensated for unified power factor and balancing while only oscillating parts of real power are compensated for a harmonic elimination. Therefore the reference powers are Since the Zs-current flowing within the neutral line must be compensated, the reference current at 0-axis, i 0 , is obtained from (13). By this way, the whole i 0 of the load is supplied by the ShAPF. Since the Zs voltages do not exist in the system, p 0 and i 0 can be compensated without the existence of energy balance inside the ShAPF Using the reverse Clarke transformation, the reference current values in three phases are generated as seen in (23) and (24). Finally, the commutation technique is the hysteresis-band PWM current control to obtain the inverter pulses for each inverter branch. The actual three-leg (or four-leg) ShAPF line currents are monitored simultaneously and then compared with the reference currents generated by the control algorithm If the four-leg inverter is applied, the final equation for neutral reference current is calculated by this equation Fig. 2 summarises the complete algorithm of a controller for a three-phase four-wire ShAPF.

V dc controlling
(1) Modelling: Power dissipation on the dc-bus capacitor where v c and i c are voltage and current of the capacitor. Eliminating the internal resistance of the capacitor, i c can be calculated by where C is the capacitance of the capacitor. Hence, (26) is rewritten Assuming P loss and v c are power dissipation and dc-bus voltage at the equilibrium, respectively. Note that P loss = 0. In the case that v c varies a very small amount of voltages calledv c , dissipation power p loss (t) will be p loss (t) = P loss +p loss (t) = By applying the Laplace transformation on (29), transfer function P (s) from p loss to v c will be where T is the time constant in seconds. Therefore To filter out the 50 Hz oscillation in terminal voltage of dc-bus capacitor, the crossing frequency of close system is chosen at 10 Hz. Thus, time constant T is 100 ms. Voltage controller will be a proportional gain, determined by

Only fundamental Ps-component is fed by utility
This section demonstrates the ability of the proposed controller in compensating utility currents by formulas. Those power components are introduced in [7]. However, the general formulations considering all harmonic components were neither released by that study nor in recent researches. To make the compensated currents sinusoidal and balanced, the ShAPF should compensate all harmonic components as well as the fundamental components that differ from the fundamental Ps-current and only this component is supplied from the utility. In general cases, the periodic voltages and currents include both the fundamental component and harmonic components. Each order component consists of Ps-, Ns-and Zs components (see equation (34) at the bottom of the next page) Applying Clarke transformation, the voltages and currents in αβ0 where subindexes +n, −n and 0 are Ps, Ns and Zs voltages or current components for the nth harmonic; V and I are root-mean-square (RMS) value of voltage and current; ω n is the nth harmonic angular frequency; f represents phase angle of voltage of all components, whereas δ represents the angle of those of current. It is realised that the Ps and Ns components contribute to α-axis and β-axis, whereas the 0-axis voltage and current comprise only Zs components. Besides, that Zs voltage and current do not contribute to the p and q as the following equations (see (36)) All harmonics in voltages and frequency can contribute to average powers p and q if they have the same frequency and the same sequence component. Moreover, the presence of more than one harmonic frequency and/or sequence components also producep andq. Compared with the conventional control block, the proposed controller adds the ANF block that simultaneously extracts the fundamental Ps-voltage,V +1 . Thus, the calculated powers in Fig. 2 do not match the actual power of the load since the imbalance and harmonics in voltage are not being considered. However, that calculated power is still useful for determining all imbalances and harmonics presented in the load current. The Clarke transformation for currents determines exactly all current components in the load currents withV +1 that producep and q. Using (36), since onlyV +1 is considered, onlyİ +1 produces p and q and all powers calculated are seen in (37). Besides, theV 0 is eliminated, leading to the null p 0 (see equation (37) at the bottom of the next page) If the ShAPF compensates the oscillating powersp cal andq cal (compensates also q cal for power factor purpose) in the above-calculated powers, it will compensate all the components in load current that are different fromİ +1 of the load. The compensated currents in (37) are guaranteed that onlyİ +1 current (or p cal ) would flow from the utility to the downstream. The compensating powersp cal and q cal in the ShAPF include all fundamental Ns powers, the fundamental reactive power, as well as the harmonic power. Generally, the ShAPF handles the load as 'connected to a sinusoidal balanced voltage source'. As a result, if p cal and q cal are compensated by the ShAPF, the source current must be sinusoidal and contain only the active portion of the fundamental Ps-sequence current that is in phase withV +1 . The Ns and Zs components in voltages would make other powers response to harmonic current will be compensated in p loss controlling. Since the ShAPF considers onlyV +1 , in the controller Zs-power p 0 is in fact always zero.
Actually, the dc voltage regulator that determines the p loss has an additional task that is correcting errors in power compensation. This is because the ShAPF now cannot calculate correctly the actual value of p of the load. This mistake in power compensation can be understood as follows. BesidesV +1 , other powers in calculating withV +−0n (n≠1) in (38) (see (38)) In any case, if there are other components of voltages exceptingV +1 , the powers in (38) exist even if they are not considered in the ShAPF controllers. In that case, the ShAPF will accordingly supply or absorb these powers, causing voltage variation in the dc capacitors. The feedback control loop of the dc voltage regulator has a slower response than that ofp cal which senses it. The p loss will make the ShAPF absorb or supply the unconsidered power to neutralise the voltage variation. Furthermore, during the transient responses of the ShAPF, the p loss helps to correct voltage variation because of compensation errors. The p 0 is similar to that in (36) and is compensated via i 0 of the controller.

Power flow among systems
Although inserting a ShAPF for compensating purpose, the power flows of all components are modified. Different from three-phase three-wire ShAPF, the Zs voltage, current and power exist in the three-phase four-wire ShAPF as seen in Fig. 3. Most power components are calculated by equations proved in the previous section.
Real power p is calculated by using v, i at ac side which is the same as in dc side v dc × i dc of the inverter if no loss is assumed. On the other hand, the imaginary power is calculated at ac side only. The average real power p represents the energy flow per time in one direction consistently that is effectively converted into  work. Therefore it has to be supplied from the utility, while oscillating real powerp represents oscillating energy flow per time. q corresponds to conventional three-phase reactive power, has no contribution to transferred power, whereasq power is exchanged among three phases. Since the oscillating components make no contribution to instantaneous or average energy flow and their average value is zero, they should be supplied by the ShAPF. The ShAPF needs no power supply but the energy storage elements are necessary.
There is power balance among three systems at the PCC point. If the ShAPF can supply undesirable powers to the load, the utility will only supply necessary powers. The controlling mechanism is to define that undesirable powers from the load and then to make the ShAPF generate those powers. Obviously, the rest of the required power is from the utility. There is another approach where the utility constant power or sinusoidal currents is the control target.
The p 0 has the same characteristics as the instantaneous power in a single-phase circuit and completely separates from Ps and Ns  components. It has an average value p 0 such as average active power and an oscillating componentp 0 transferring power instantaneously whose average value is zero. The p 0 increases the total energy transfer but thep 0 always comes along with p 0 . Thus, only the p 0 cannot be supplied from utility. The solution is to let the ShAPF provide entire p 0 = p 0 +p 0 and this Zs power is eliminated from the utility. In this case, the p 0 is supplied by the utility through αβ axes concerning real power p Uti . Regarding that viewpoint, the p 0 would require higher capacitance of the ShAPF. The real powers including p and p 0 are supplied in a one-way direction by αβ axes. The p 0 is then fed to the load through 0-axis. The other power components of load are exchanged with the ShAPF. By keeping the v dc at a reference value, the power balance inside the capacitor is guaranteed. The required real powers which the ShAPF needs to supply for the load under that mechanism will be taken by balance powers from the utility. Furthermore, the undesirable powers (q cal , q other ,p cal ,p other andp 0 ) are compensated by the ShAPF.

Simulation validation
To demonstrate the performance of the proposed control method, the results from the numerical simulation are conducted by using PSIM. The simulation block diagram of the proposed method controlled the three-phase four-wire APF is shown in Fig. 4, whereas that of the controller is shown in Fig. 5.
The simulation results under all cases of the non-ideal PCC voltages are presented comparing the proposed control method with the well-known dq-filter method [17]. Since in the paper [17], the dq-filter method shows better performance than the p-q and p-q-r theories, there is no need to compare the proposed method with those two. Load and source conditions in this paper are based on [17].
The system in Fig. 1 is built using the controller design shown in Fig. 2 which consists of programmable utility, the unbalanced non-linear load combining a three-phase thyristor rectifier and single-phase diode rectifier and the ShAPF module. A single-phase diode rectifier load is added between phase A and neutral line to create unbalanced loads. The dc side load configuration includes registor LC. Another single-phase diode rectifier is switched during simulated time to change the harmonic or reactive power required by the load in order to evaluate the dynamic performance of the proposed ShAPF. That is the reason why when the non-ideal load is applied and then the load current waveforms change as seen in the following Figs. 6, 9 and 12, the new compensation is adaptive to that change.
The main parameters of the system used in simulation study are indicated in Table 1. The simulation runs in 0.4 s. The time instants of events are as follows: at 0.2 s, turn on ShAPF with the proposed APF controller; at 0.3 s, add more single-phase loads with the proposed APF controller. The non-ideal PCC voltage happens during all the running time.

Unbalanced PCC voltage
The unbalanced voltage ratio (UVR), defined as the ratio of negative to Ps voltage, is calculated by In this case, the unbalanced three-phase PCC voltages are shown in (40) with UVR = 10%.
The simulation result is shown in Fig. 6. Without the ShAPF, utility current becomes distorted under unbalanced PCC voltage and  non-ideal loads. However, during applying the proposed controller, it recovers to the sinusoidal shape. Furthermore, the neutral current from utility is eliminated and instead the ShAPF provides it. It should be noted that if there is only Zs voltage beside Ps voltage, the Akagi theory succeeds in making sinusoidal utility currents since the rational scalar is constant, and then the Zs components are independent. From Fig. 6, after activating the ShAPF, the utility current will be in phase with utility voltage as the entire load imaginary power is compensated by ShAPF. The system in this case obtains unified power factor. Fig. 7 shows the real and imaginary powers from utility. Before activating the ShAPF, the utility feeds both oscillating powers to loads. Theoretically, under the effect of ShAPF, the utility provides mostly constant active power and zero imaginary power to the loads. In this simulation, as the non-ideal PCC voltages (v α , v β ) vary in (12) at frequency 50 Hz, the utility actually supplies oscillating active and imaginary powers at 100 Hz. It is seen that almost ripple powers are compensated by ShAPF. However, from the viewpoint of ANF, the utility provides pure sinusoidal voltages and constant powers.
Harmonic spectra of utility current of phase C under this unbalanced case is shown in Fig. 8. The detailed summary of load currents, utility currents and their total harmonic distortion (THD) level and RMS values are shown in Table 2. As mentioned at Section 1, in 2005, the paper [16] and in 2008, the paper [17] introduced the dq-filter to deal with the non-ideal PCC voltage for three-phase three-wire and three-phase four-wire, respectively. The mechanism is to put the v abc to dq-coordinate and then using LPF to obtain average values of d-voltage and q-voltage. Those average values represent fundamental Ps-component. After that, the v αβ continues their function in the instantaneous power theory controller. From this table, the comparison regarding THD index and neutral current to dq-filter theory is seen. Although the load current THD level in phase C is 43.89% before 0.3 s and 54.70% after 0.3 s, the THD levels of utility currents beyond the compensation are 2.88 and 2.84%, respectively. In the dq-filter method, those values of utility currents are 3.43 and 4.28%, respectively. Shortly, The THD levels of all three phases in Table 2 express that there is a significant reduction in THD level with the proposed technique. Moreover, the neutral currents in both load cases are smaller than those of dq-filter method, that is, 1.68-1.73% at light loads, whereas 1.67-1.72% at heavy loads. Shortly, the ANF-based ShAPF performs better whenever there are unbalanced components in the PCC voltage.

Balanced-distorted PCC voltage
The distorted voltage ratio (DVR) at each harmonic order, defined as the ratio of magnitude of voltage at that harmonic order to magnitude of fundamental Ps voltage, is calculated by In this case, PCC voltages contain harmonic components except fundamental component. To simulate the real case distorted level, the PCC voltage has the dominant 5th harmonic component (DVR 5 = 6%) and also has the 3rd (DVR 3 = 1.2%), 7th (DVR 7 = 1.45%) and 11th (DVR 11 = 1%) harmonic components. The balanced-distorted three-phase PCC voltages are expressed in (42) (see (42)) The simulation results are depicted in Fig. 9. The harmonic filtering and load current balancing by the proposed method are shown. The neutral current of utility is eliminated and the reactive power compensation is implemented by using the ANF controller. Fig. 10 shows the real and imaginary powers from utility. The results are almost similar to Fig. 7 except the fact that actual powers oscillate at a higher frequency which is the frequency of harmonics orders existing in PCC voltages.
Harmonic spectra of utility current of phase C under this balanced-distorted case is shown in Fig. 11. The detailed summary of load currents, utility currents and their THD level and RMS values are shown in Table 3. The comparison with dq-filter theory is seen. In both methods, the THD of current is lower than 5% which meets the requirement of IEEE standards. Although the load current THD level in phase C is 72.74% before 0.3 s and 72.84% after 0.3 s, and the THD levels of utility currents beyond the compensation are 3.04 and 2.95% with the proposed technique compared with 3.58 and 4.45% values of the dq-filter method, respectively. Those high reductions show the effect of the proposed controller.

Unbalanced-distorted PCC voltage
In this severe case, the unbalanced-distorted three-phase PCC voltages which consist of both Ns components and harmonic components are expressed in (43). The PCC voltage regarding UVR and DVR h in this case are created simply by combining voltage waveforms of two above cases (see equation (43) at the bottom of the next page) The simulation result is shown in Fig. 12. The ANF may be able to handle where the reactive current of the load is compensated, the power factor is improved and the Zs-current components are eliminated. Fig. 13 shows the real and imaginary powers from utility. The actual active and imaginary powers oscillate at a shape responding to PCC voltage waveforms.
Harmonic spectra of utility current of phase C under this unbalanced-distorted case is shown in Fig. 14. The detailed summary of load currents, utility currents and their THD levels and RMS values are shown in Table 4. The comparison with dq-filter theory is also presented. Although the load current THD level in phase C is 43.7% before 0.3 s and 55.22% after 0.3 s, the THD levels of utility currents beyond the compensation are 3.10 and 2.99%, respectively. Meanwhile, by using the dq-filter method, those values of utility currents are 3.76 and 4.48%, respectively. The performance of the proposed method again is better than that of dq-filter solution. This severe PCC voltage case will not affect the ShAPF performance by applying the ANF technique.
In all the cases, the proposed controller succeeds in regulating compensated currents from the ShAPF when additional single-phase loads are switched at 0.3 s during non-ideal point of common coupling voltage. Thus, its dynamic performance is qualified. This ability is similar to conventional pq theory controller under ideal point of common coupling voltage only. From three verified cases of non-ideal voltage, the ANF controller's performance is better if load is heavier.
The volt-ampere rating the ShAPFs in [kilovolt amperes] loads using both the dq-filter method and the proposed method are compared in Table 5. Accordingly, the volt-ampere rating is calculated by Table 5 shows a novel performance of the ANF-based ShAPF regarding power rating as the following concluding remarks: † The ANF-based ShAPF has lower power rating in all the cases compared with dq-filter-based ShAPF. † Power supply from the utility is lower while using the ANF-based APF. † Power rating of ShAPF in case of balanced-distorted voltage is lower than in the case of unbalanced one within this paper. This statement might change if the unbalanced voltage ratio increases. † Power rating of ShAPF in the case of unbalanced-distorted voltage is even lower than in case of unbalanced one. The reason is that the unbalanced current ratio of load which is represented by the neutral current in unbalanced voltage case (Table 2) is higher than that in unbalanced-distorted voltage case (Table 4).   In this paper, a three-phase four-wire ShAPF controller using improved ANF in αβ0-coordinate is proposed under non-ideal PCC voltage. The numerical simulation has validated the effectiveness of that controller compared with conventional methods. The controller is very promising as an alternative to dq-filter application in distribution system where the unbalanced non-linear voltage is still predominant. At our laboratory, the experimental implementation will be conducted. At first, this experiment tests the three-phase three-wire APF. The dSPACE DS1104 real-time devices will be used to test the digital controller designed in the MATLAB/SIMULINK. The necessary seven signals (three supply voltages, three load currents and the dc-bus voltage) are measured by the sensors, MyWay MWPE-VS/IS-01. These real-time signals are available in the MATLAB/SIMULINK platform on the host computer through the ADC ports of DS1104 and are utilised to generate the reference utility currents based on the ANF-based controller. These generated reference APF currents are taken out of the DSP through DAC ports. Using MyWay sensors, the actual APF current signals are also taken out from the MyWay inverter, MWINV-1R022 which implements APF function. An external analogue hysteresis current control board is developed to perform PWM. The actual and reference APF current signals are then compared, and the six necessary switching pulses for the MyWay inverter are generated. Finally, these six switching/ gate pulses are utilised to control the ShAPF in real time. After setting up the equipment and simulating the PCC non-ideal voltages, the test results for selective harmonic compensation [49] would be released soon.

Acknowledgment
This work was financially supported by the Environment Research and Technology Development Fund (F-1201) of the Ministry of the Environment, Japan.