Subscribe Now Subscribe Today
Fulltext PDF
Research Article
Power Quality Enhancement using Shunt Active Power Filter Based on Particle Swarm Optimization

Brahim Berbaoui and Chellali Benachaiba
This study deals with the design, analysis and simulation of shunt active power filter SAPF which compensate harmonic currents and reactive power under balanced supply network. An optimal control theory for currents compensation based on particle swarm optimization is developed in this study. The SAPF is connected in parallel with a nonlinear load which has caused current harmonics in industrial power plants and utility power distribution systems. The proposed optimal PI current controller using particle swarm algorithm determines the switching signals of the SAPF and the algorithm based on instantaneous power (p-q) theory has been used to determine the suitable current reference signals. The simulation results show that the new control method using PSO approach is not only easy to be implanted but also very effective in reducing the unwanted harmonics and compensating reactive power. The studies carried out have been accomplished using the MATLAB Simulink Power System Toolbox.
Related Articles in ASCI
Similar Articles in this Journal
Search in Google Scholar
View Citation
Report Citation

  How to cite this article:

Brahim Berbaoui and Chellali Benachaiba, 2011. Power Quality Enhancement using Shunt Active Power Filter Based on Particle Swarm Optimization. Journal of Applied Sciences, 11: 3725-3731.

DOI: 10.3923/jas.2011.3725.3731

Received: July 30, 2011; Accepted: November 09, 2011; Published: December 29, 2011


Recent wide increase of power electronic equipment has caused an augment of the harmonic disturbances in the power systems. The nonlinear loads draw harmonic and reactive power components of current from ac mains. The Current harmonic generated by nonlinear loads has caused problems in power systems and in consumer products such as equipment overheating, capacitor blowing, motor vibration and low power factor. Dynamic and flexible solutions to the power quality problems have been examined by researchers and power system (Peng, 1998). Usually, passive filters have been used to eliminate current harmonics and to increase the power factor. However, the use of passive filter has many disadvantages of large size resonance and fixed compensation behavior so this conventional solution becomes ineffective (Huang and Wu, 1999).

The shunt active with several topologies (Jou, 1995; Akagi et al., 1983; Huang and Wu 1999; Asiminoaei et al., 2006; Clerc and Kennedy, 2002; Aredes, 1996) is generally used instead of passive filters to improve the power quality by injecting compensating currents (Berbaoui et al., 2010; Peng, 1998; Gu and Xu, 2003; Kennedy and Eberhart, 1995; Jou, 1995; Akagi et al., 1983; Huang and Wu, 1999; Asiminoaei et al., 2006; Clerc and Kennedy, 2002; Aredes, 1996; Mattavelli, 2001; Karsli et al., 2003) a very great for the compensation not only of current harmonics produced by distorting loads but also of reactive power of non-linear loads (Mattavelli, 2001). In order to determine the current reference signals a proposed theory based on instantaneous power (p-q theory) has been used this theory was introduced by Akagi et al. (1983) in Japanese.

The presented work spotlights on novel control method for compensating current which known as PI-PSO optimized PI controller using particle swarm algorithm. The optimization of PI regulator’s parameters is crucial (Gu and Xu, 2003). In this study, the problem of design current PI controller is formulated as an optimization problem. The problem formulation assumes in this study, two performance indexes are the integral absolute error of step response and maximum overshoot as the objective function to determine the PI control parameters for getting a well performance under a given system. We propose an optimization method for SAPF in the aim to improve the compensation performances and reduce harmonic distortion through electrical lines distribution under all voltages conditions. These objectives are obtained by minimizing the fitness function.

The proposed solution algorithm based on Particle Swarm Optimization (PSO) technique that is based on a metaphor of social interaction. It searches a space by adjusting the trajectories of individual vectors, called ‘particles’, as they are conceptualized as moving as points in multidimensional space. The individual particles are drawn stochastically towards the positions of their own previous best performances and the best previous performance of their neighbours. Since its inception, two famous improvements have been introduced on the initial PSO which attempt to strike a balance between two conditions. The first one introduced by Shi and Eberhart (1998) uses an extra ‘inertia weight’ term which is used to scale down the velocity of each particle and this term is typically decreased linearly throughout a run. The second version introduced by Clerc and Kennedy (2002) involves a ‘constriction factor’ in which the entire right side of the formula is weighted by a coefficient. Their generalized particle swarm model allows an infinite number of ways in which the balance between exploration and convergence can be controlled.


Particle Swarm Optimization (PSO) is a population based stochastic optimization technique inspired by social behavior of bird flocking or fish schooling (Kennedy and Eberhart, 1995). PSO learns from the scenario and uses it to solve the optimization problems. In PSO, each single solution is a "bird" in the search space. We call it "particle". All particles have fitness values which are evaluated by the fitness function to be optimized and have velocities which direct the flying of the particles. The particles fly through the problem space by following the current optimum particles.

PSO is initialized with a group of random particles (solutions) and then searches for optima by updating generations. In each iteration, every particle is updated by following two "best" values. The first one is the best solution (fitness) it has achieved so far. (The fitness value is also stored). This value is called Pbest. Another "best" value that is tracked by the particle swarm optimizer is the best value, obtained so far by any particle in the population. This best value is a global best and called gbest.

For example, the ith particle is represented as xi = (xi1, xi2,........, xid) in the d-dimensional space. The best previous position of the ith particle is recorded and represented as:


The index of best particle among all of the particles in the group is gbest. The velocity for particle i is represented as vi = (vi1, vi2,......, vid). The modified velocity and position of each particle can be calculated using the current velocity and the distance from Pbest-id. to gbest-id as shown in the following formulas (Gaing, 2004):




n = Number of particles in the group
d = Dimension
t = Pointer of iterations (generations)
v(t)im = Velocity of particle t at iteration t
w = Inertia weight factor
c1, c2 = Acceleration constant
rand ( ) = Random number between 0 and 1
v(t)id = Current position of particle i at iterations
Pbest = Best previous position of the ith particle
Gbest = Best particle among all the particles in the population


In this study, the procedure of PSO Algorithms is used. A production initial population is the first step of PSO. The population is composed of the chromosomes that are real codes. The corresponding evaluation of a population is called the “fitness function”. It is the performance index of a population (Berbaoui et al., 2010). The fitness value is bigger and the performance is better. The fitness function is defined as follow:


The optimized parameters objects are proportional gain kp and integral gain ki, the transfer function of PI controller is defined by:


The gains kp and ki of PI controller are generated by the PSO algorithm for a given plant. As shown in Fig. 1. The output u (t) of PI controller is (Eq. 6):


For a given plant, the problem of designing a PI controller is to adjust the parameters kp and ki for getting a desired performance of the considered system.

Fig. 1: PI control system

Both the amplitude and time duration of the transient response must be kept within tolerable or prescribed limits, for this condition, two key indexes performance of the transient response is utilized to characterize the performance of PI control system. These key indexes are integral absolute control error and maximum overshoot.

The maximum overshoot is defined as:


where, ymax characterize the maximum value of y and yss denote the steady-state value.

The integral of the absolute magnitude of control error is written as:



The principal function of the Shunt Active Power Filter (SAPF) is to generate just enough reactive and harmonic current to compensate the nonlinear loads in the line. A multiplicity of methods is used for instantaneous current harmonics detection in active power filter such as FFT (Fast Fourier Technique) technique, instantaneous p-q theory and synchronous d-q reference frame theory (Asiminoaei et al., 2006).

The main circuit of the SAPF control is shown in Fig. 2.

The reference current consists of the harmonic components of the load current which the active filter must supply. This reference current is fed through a controller and then the switching signal is generated to switch the power switching devices of the active filter such that the active filter will indeed produce the harmonics required by the load (Huang and Wu, 1999). Finally, the AC supply will only need to provide the fundamental component for the load, resulting in a low harmonic sinusoidal supply.

Fig. 2: Equivalent schematic of shunt APF

Instantaneous active and reactive P-Q power method: The identification theory that we have used on shunt APF is known as instantaneous power theory or PQ theory. It is based on instantaneous values in three-phase power systems with or without neutral wire and is valid for steady-state or transitory operations, as well as for generic voltage and current waveforms. The PQ theory consists of an algebraic transformation (Clarke transformation) of the three phase voltages and current in the abc coordinates to the αβ coordinates (Akagi et al., 1983):



The instantaneous power is calculated as:


The harmonic component of the total power can be extracted as:



= The DC component
= Harmonic component



Finally, we can calculate reference current as:




Optimized current controller pi parameters using PSO algorithm: In this study, we present the SAPF as controlled plant; the SAPF diagram is shown in Fig. 3.

The inconvenience of the conventional PI controller is its incapability to improve the transient response of the system. The conventional PI controller has the form as follow:



y = The control output
kp = Proportional gain
ki = Integral gain

The control output is fed to inverter PWM signal generator. The difference between the injected current and the reference current. Kennedy and Eberhart (1995) is known by error signal. The design of the conventional PI controller dependent on the knowledge of the expert, in this study the trial and error method has been used to determine the parameters Kp and Ki.

The key contribution in this study is the proposed approach to find the optimal PI parameters Fig. 4 in order to ensure that the steady-state error of the system is reduced to minimum. The objective of an optimal design of currents PI controller for given plant is to find a best parameters Kp and Ki of PI control system such that the performance indexes on the transient response is minimum.

The evolution procedure of PSO Algorithms is presented as shown Fig. 5. Producing initial populations is the first step of PSO. The population is composed of the chromosomes that are real codes.

Fig. 3: Control diagram of SAPF system

Fig. 4: Control of the injected current using optimized PI controller

Fig. 5: The evolution procedure of PSO Algorithms

The corresponding evaluation of a population is the “fitness function” which is the performance index of a population. The fitness value is bigger and the performance is better. After the fitness function has been calculated, the fitness value and the number of the generation determine whether or not the evolution procedure is stopped (Maximum iteration number reached?). After this, calculate the Pbest of each particle and gbest of population (the best movement of all particles). Then update the velocity, position, gbest and Pbest of particles and give a new best position.

Table 1: Parameters of PSO algorithm

Table 2: SAPF parameters

Table 3: Harmonic contents of the supply currents

Design of optimizing algorithm: The parameters values for the particle swarm used in this study are presented in the Table 1.


The proposed PI controller of currents compensation designed by PSO on filtering system that was set in Matlab/Simulink environment to predict performance of the proposed method.

The SAPF model parameters are shown in the following Table 2.

First case: Conventional current PI controller: The SAPF is connected in parallel with nonlinear load, in this case the conventional PI controller is used to see the current regulation and its effect in damping harmonics current and reducing total harmonic distortion, the parameters Kp and Ki has been determined by trial and error method. The PI control design involves regulation of injected current for harmonic and reactive power compensation. Simulation results show the line currents and its spectrum before compensation (Fig. 6, 7) the line current and its spectrum after compensation shown in Fig. 8 and 9 using shunt active power filter based on conventional PI controller, the Total Harmonic Distortion (THD) has been reduced from 26.87 to 1.16%.

Table 3 illustrates the individual amplitude of low-order harmonics in the supply current as a percentage of the fundamental component compared to individual harmonics given in IEC 1000-3-4.

Fig. 6: Supply current waveform of single phase

Fig. 7: Harmonic spectrum of supply current

Fig. 8: Supply current waveform of single phase after compensation using conventional PI control

Fig. 9: Harmonic spectrum of supply current after compensation using conventional PI control

Second case: Optimal current PI controller: The proposed idea is to improve the power quality using optimal shunt active power filter based on Particle Swarm Optimization algorithm (PSO).

Fig. 10a: Supply current waveform of single phase after compensation using optimal PI control

Fig. 10b: The SAPF compensation current composed to its reference current

Fig. 10c: The SAPF compensation current composed to its reference current in the interval (0.01-0.025 sec)

The main objective for the system control hugged to minimization of fitness function which is defined by the following equation:


Fig. 10d: Harmonic spectrum of supply current

Fig. 11: Source voltage waveform

Table 4: Comparisons of SAPF indexes between used and unused particle swarm optimization

In this case, α value has been fixed have to 1.5, to give an importance for the integral error in formulation function. The value of system indexes are compared in Table 4, in this novel contribution that has improved performance system.

Simulation studies are carried out to predict performance of the proposed method. Figure 10 shows the simulation results which have been obtained under the same pervious condition of the conventional PI controller.

Through the Fig. 10a-d and calculation the THD of source current with SAPF, the THD is reduced from 1.16% value obtained by means of PI controller to 0.92% value obtained by proposed control algorithm. The harmonic contents repartition in the supply current before and after compensation using the two methods, under balanced voltage source conditions Fig. 11, is resumed in Table 5.

Table 5: Harmonic contents of the supply currents

Table 6: Comparison of supply current THD and power factor


In this study an optimal control for current compensation filter has been presented and applied to shunt active power filter under balanced voltages. Amalgamation of the new approach based on particle swarm optimization improves the dynamic of the harmonic compensation and improving the input power factor. PSO technique is inspired by nature and has proved itself to be successful solution to optimization problems. The main objective of this work is to design the parameters of SAPF-based current controller.

In general, the results presented indicate that the PSO has a good sharp for finding the optimal fitness function and has proved its effeteness in finding optimal parameters Kp and Ki for current-SAPF controller, it can be seen that after SAPF with PSO-PI controller runs, the current total harmonic distortion to 0.92 from 1.16% and the power factor to 0.90 from 0.87 (Table 6).

According to the previous results the proposed controller (PI-PSO) has good dynamic performance and robustness. The control method applied to SAPF has demonstrated good routine for harmonic elimination and reactive power compensation.

Akagi, H., Y. Kanazawa, K. Fujita and A. Nabae, 1983. Generalized theory of instantaneous reactive power and its application. Electric. Eng. Japan, 103: 58-66.
CrossRef  |  

Aredes, M., 1996. Active power line conditioners. Ph.D. Thesis, Technical University of Berlin, Berlin.

Asiminoaei, L., F. Blaabjerg, S. Hansen and P. Thoegersen, 2006. Adaptive compensation of reactive power with shunt active power filters. Proceedings of the IEEE Industry Applications Conference, 41st IAS Annual Meeting and Conference Record of the 2006, October 8-12, 2006, Tampa, FL., pp: 191-197.

Berbaoui, B., C. Benachaiba, R. Dehini and O. Harici, 2010. Design of DC link voltage controller using ant colony optimization for shunt active power filter. J. Electric. Eng. Theory Appl., 1: 92-99.
Direct Link  |  

Clerc, M. and J. Kennedy, 2002. The particle Swarm-explosion, stability and convergence in a multidimensional complex space. IEEE Trans. Evol. Comput., 6: 58-73.
CrossRef  |  Direct Link  |  

Gaing, Z.L., 2004. A particle swarm optimization approach for optimum design of PID controller in AVR system. IEEE Trans. Energy Conver., 19: 384-391.
CrossRef  |  PubMed  |  Direct Link  |  

Gu, J.J. and D.G. Xu, 2003. Active power filters technology and its development. Electric Machines Control, 7: 126-132.

Huang S.J. and J.C. Wu, 1999. A control algorithm for three-phase three wired active power filter under non ideal mains voltages. IEEE Transa. Power Electronics, 14: 753-760.
CrossRef  |  

Jou, H.L., 1995. Performance comparison of the three-phase active-power-filter algorithms. IEE Proc. Generation, Transmiss. Distrib., 142: 646-652.

Karsli, V.M., M. Tumay and B. Susluoglu, 2003. An evaluation of time domain techniques for compensating currents of shunt active power filters. Proceedings of the International Conference on Electrical and Electronics Engineering, December 3-5, 2003, Bursa, Turkey, -.

Kennedy, J. and R. Eberhart, 1995. Particle swarm optimization. Proc. IEEE Int. Conf. Neural Networks, 4: 1942-1948.
CrossRef  |  Direct Link  |  

Mattavelli, P., 2001. A closed-loop selective harmonic compensation for active filters. IEEE Trans. Ind. Appl., 37: 81-89.
CrossRef  |  Direct Link  |  

Peng, F.Z., 1998. Application issues of active power filters. IEEE Indus. Applic. Mag., 4: 21-30.
CrossRef  |  

Shi, Y. and R. Eberhart, 1998. A modified particle swarm optimizer. Proceedings of the World Congress on Computational Intelligence and IEEE International Conference on Evolutionary Computation, May 4-9, 1998, Anchorage, AK., pp: 69-73.

©  2018 Science Alert. All Rights Reserved
Fulltext PDF References Abstract