Journal of Power and Energy Engineering, 2014, 2, 271-279
Published Online April 2014 in SciRes. http://www.scirp.org/journal/jpee
http://dx.doi.org/10.4236/jpee.2014.24038
How to cite this paper: Zh ang , Y., Gong, Y.F., Che n , J.Y. and Wa ng , J. (2014) Harmonic Suppression Method Based on
Immune Particle Swarm Optimization Algorithm in Micro-Grid. Journal of Power and Energy Engineering, 2, 271-279.
http://dx.doi.org/10.4236/jpee.2014.24038
Harmonic Suppression Method Based on
Immune Particle Swarm Optimization
Algorithm in Micro-Grid
Ying Zhang, Yufeng Gong, Junyu Chen, Jing Wang
Department of Information Engineering, Zhejiang University of Technology, Hangzhou, China
Email: zizaifeihua666@163.com
Received January 2014
Abstract
Distributed generation has attracted great attention in recent years, thanks to the progress in
new-generation technologies and advanced power electronics. And micro-grid can make full use of
distributed generation, so it has been widespread concern. On the other hand due to the extensive
use of power electronic devices and many of the loads within micro-grid are nonlinear in nature,
Micro-grid generate a large number of harmonics, so harmonics pollution needs to be addressed.
Usually we use passive filter to filter out harmonic, in this paper, we propose a new method to op-
timize the filter parameters, so passive filter can filter out harmonic better. This method utilizes
immune particle swarm optimization algorithm to optimize filter parameters. It can be shown
from the simulation results that the proposed method is effective for micro-grid voltage harmon-
ics compensation.
Keywords
Micro-Grid; Immune Particle Swarm Optimization Algorithm; Harmonic Compensation
1. Introduction
New energy and renewable energy become the current research focus; micro-grid combines the advantages of
distributed generation technologies, resulting in widespread attention [1]. Micro-grid supports the power grid
effectively; micro-grid has two kinds of operation mode islanding mode and grid-connected mode [2]. The
non-linear load because of operation of inverters and other power electronic equipments which is called har-
monic has a serious impact on normal operation of Inverters and other power electronic equipments. Also har-
monic current will cause the temperature of the equipment to rise, which directly affects the service life of
equipments [3]. Currently there are many methods of micro-grid harmonic suppression which are divided into
three categories. The first category is to suppress harmonics essentially, including active mode (creating inver-
ters which only produce small harmonics) and passive mode (installing filters in the vicinity of the harmonics
source); The second category is the application of instantaneous reactive power theory, but the theory is not ma-
ture. The third category is the integration of intelligent neural network and harmonic suppression, but the effect
is not ideal when the harmonic variation is great [4]. In the first category techniques, installing the filter is the
Y. Zhang et al.
272
most common means which is the most effective and also suitable for universal application. Among them, the
passive filter (LC filter) has a simple structure with low cost and high operational reliability, so it is a widely
used harmonic treatment method [5,6].
Currently, there are many methods of optimizing LC filter parameters in micro-grid system, which can be
summed up into two categories: One is the conventional optimization methods including nonlinear programming
method, linear programming method and interior point method; the other is artificial intelligence optimization
algorithm, including genetic algorithm, particle swarm optimization algorithm, and a variety of evolutionary
programming methods. The first method’s merit is rapid calculation and reliable, but first method requires some
assumptions, such as continuous, derivable and a single peak and so on. In solving some problems, it may need
to treat integer variables as continuous variables, and then get the optimal solution so as to normalize to the
whole. But for some large-scale actual system, the error generated by normalizing to the whole is generally un-
acceptable. Genetic algorithm for optimization is most widely used in the second method, it has no continuity or
derivable requirements, it just needs an adaptive function or performance indicators, its main drawbacks are
"premature convergence" issues and the convergence rate which is difficult to meet the needs of real-time con-
trol [7]. Particle Swarm Optimization (PSO) is a global stochastic optimization algorithm proposed by American
scholars Kennedy and Eberhart in 1995 [8], and as a new intelligent computing method based on group, it shows
strong advantages in solving problems. Compared with other evolutionary algorithms, it is easy to implement,
and it has less adjustable parameters, therefore it is suitable for micro-grid system to optimize the filter parame-
ters. However, its disadvantage is easy to fall into local extreme point.
Immune algorithm simulates biological immune principle, it utilizes the diversity of immune system antibody
and self-regulatory function to maintain the diversity of population [9], and therefore it overcomes the premature
in the optimization process to ensure that the system converges to the global optimal solution quickly. In [10],
the immune algorithm and particle swarm algorithm is combined so as to propose immune particle swarm opti-
mization (IPSO). In this paper, the immune particle swarm algorithm is applied to optimize filter parameter in
micro-grid and suppress harmonic generation in micro-grid.
2. Model of Harmonic Suppression in Micro-Grid
2.1. The Model of Micro-Grid System
Micro-grid is connected together by voltage source inverter. A three-leg VSI with an LC filter with a coupling
inductor form the power circuit, whereas three control loops form the control structure. Specifically, a power
sharing controller is used to generate the magnitude and frequency of the fundamental output voltage of the in-
verter according to the droop characteristic, by emulating the operation of a conventional synchronous generator;
a voltage controller is used to synthesize the reference filter-inductor current vector [11]; and a current controller
is adopted to generate the command voltage vector to be synthesized by a space vector pulse width modulation
(SVPWM) module. The output voltage of the inverter includes not only the sinusoidal signal of 50HZ, but also
various harmonics, so it need to be filtered and then can be provided to the load.
2.2. The Objective Function
In the state of islanding or grid-connected, we usually use voltage harmonic ratio of load as the standard of eva-
luating the merits of filter parameters. Voltage harmonic distortion rate can calculated by the RMS of funda-
mental and harmonic voltage, where RMS of voltage getting from the Fourier transforming of matlab program-
ming. Therefore, the voltage harmonic distortion called THD can be obtained by Equation (1),
( )
22 33
1
nn
UU UUUU
THD U
∗+ ∗ ++∗
=
(1 )
where THD is the voltage harmonic distortion, Un is RMS of the n-th harmonic voltage, U1 is the RMS of fun-
damental voltage.
2.3. Constraints Condition
General principles of the LC filter design can be shown as follows:
Y. Zhang et al.
273
10 /10
ncs
fff≤≤
(2 )
( )
12
c ff
f LC
π
=
(3)
where fc represents the resonant frequency of LC filter; fn represents modulation wave frequency, fs represents
carrier signal frequency of SPWM.
3. Immune Particle Swarm Algorithm
3.1. Particle Swarm Algorithm
In the particle swarm optimization, the solutions of the problem are seen as particles in a search space without
size and weight. Each of particles motions in the solution space, and one speed determines its direction and dis-
tance. The particles find the optimal solutions in iterations, in the every iteration, particles tracking two extremes:
the optimal solution pbest which is found by the particles themselves so far and the optimal solution gbest which
is found by populations so far. Velocity and position of Particles are updated by the following two formulas.
()( )
1112 2
t ttttt
ididid ididid
vwvc rpxcrgx
+
= ×+ ××−+××−
(4)
11t tt
idid id
x xv
++
= +
(5 )
where d = 1,2, ···, D is the dimension of the target search space, i = 1,2, ···, N is the number of particles, vtid is the
velocity of d-dimensional of particle i at the t-th iteration , xtid is the position of d-dimensional of particle i at the
t-th iteration, ptid is individual optimal position of d-dimensional of particle i at the t-th iteration, also denoted as
pbest; gtid is global optimal position of d-dimensional of particle i at the t-th iteration , also denoted as gbest; r1
and r2 are the random numbers uniformly distributed among [0,1]; as the acceleration factors , c1 and c2 are used
to adjust the step of each iteration, ω is the inertia factor .
3.2. Immune Particle Swarm Algorithm
To overcome the problem of premature convergence of particle swarm algorithm, and to improve the global
search capability, the principles of the immune mechanisms of the immune system are introduced into particle
swarm algorithm, which is very helpful to improve the ability of the global convergence of particle swarm algo-
rithm. Immune particle swarm algorithm is an improved particle swarm algorithm based on biological immune
mechanism. The objective function of the problem that needs to be solved corresponds to the antigen which in-
vade into the biological life and the solution of the problem corresponds to antibodies which is produced in the
immune system [12].
After some successive iterations of PSO, if there are no better individuals, then the particle swarm algorithm
has been caught in a local optimum, so we need to select a certain number of individuals according to the anti-
body concentration to be replaced with randomly generated individuals, in order to maintain the population di-
versity and avoid local optima. The individual with lower adaptation value and higher concentration will have
higher probability of being replaced, [13] gives the probability that i-th individual being replaced. Definitions
are as follows:
The definitions of the probability of individual being replaced: the replacement probability of the i-th indi-
vidual called Ri is determined by the concentration probability of the individual Ric and the fitness probability of
the(M-i)-th individual called R(M-i)f. (M is the size of the population), specifically:
(6)
where fi is the fitness value of individual i,
ic m
RM
=
, m is the total number of individuals which is less than a
fixed value distance with i-th individual.
3.3. Algorithm Steps
Steps of immune particle swarm optimization algorithm are as follows:
1) Initialize parameters;
Y. Zhang et al.
274
2) Initialize the position and velocity of the particles and the fitness value;
3) Update the position and velocity of the particles according to formula (4) and (5);
4) Update the fitness value of the particles called present;
5) Evaluation of fitness, update individual historical extremum called pbest;
6) Update the global extremum called gbest;
7) If the results meet the accuracy requirements then get out of the loop, otherwise skip to step 8);
8) Use immune mechanism, when there are no obviously superior individuals in the population after the
DS-th iteration. Calculate concentration of the i-th individual and fitnesss probability called R(M-i)f of the (M-i)-th
individual, then obtain replacement rate of the i-th individual. If the replacement probability of individual is
greater than predetermined probability value, then the particle is replaced by particle which is randomly gener-
ated. Skip to step 3).
4. Application of Immune Particle Swarm Algorithm on Harmonic Suppression in
Micro-Grid
4.1. Invocation of Immune Particle Swarm Algorithm on Micro-Grid Simulation System
At present, when immune particle swarm optimization in the micro-grid system tunes the filter parameters, we
need to know the exact relationship between filter parameters and the objective function, so we should transform
micro-grid system into state equation or transfer function, and then run the IPSO program to get optimal value of
the filter parameters. However, in micro-grid with complex internal system, state equation or transfer function is
difficult to be obtained directly, so it requires much more time to get state equation or transfer function of mi-
cro-grid, thereby it increases computation, and even affects optimize efficiency.
This paper presents a new approach to solve this problem, when we use IPSO program to optimize the filter
parameters of micro-grid system, only need to know the filter parameters which are needed to be optimized and
the objective function, then write micro-grid simulation system program called fitness. In detail, firstly, open the
micro-grid simulation system with the function of open_system and set LC filter parameters which are needed to
be optimized as variables with the function of set_param, secondly, use the function of sim to control the opera-
tion of the micro-grid simulation system, thirdly, write the objective function program. Then call micro-grid si-
mulation system program fitness with IPSO program. When IPSO program gets filter parameter values, mi-
cro-grid system will run to get the value of the objective function. When we use IPSO to optimize filter parame-
ters of micro-grid system, we just only to know filter parameters of micro-grid which needed to be optimized
and the objective function as merits of the evaluation parameters. Therefore, this method can effectively reduce
the amount of calculation, and improve the efficiency of using IPSO to optimize filter parameters of the mi-
cro-grid system.
4.2. Processing Constraints
When IPSO optimize the filter parameters of micro-grid system, L and C are the parameters which need to be
optimized. Because the system has two micro-sources, there are a total of four parameters L1, L2, C1, C2 need
to be optimized. From the formula (2), (3), we know that there is relationship between L1 and C1 or L2 and C2,
and the resonance frequency of the filter fc, and the modulation frequency fn and the carrier signal frequency of
SVPWM fs are all known, so C1 can be expressed by L1 and C2 can be expressed by L2 . It can be seen we do
not need additional constraints in the immune particle swarm algorithm, and only use the function of set_pa ra m
to represent C1 by L1, also C2 can be represented by L2.To some extent, it simplify the program of immune par-
ticle swarm algorithm.
4.3. Steps of Immune Particle Swarm Algorithm Optimizing Filter Parameters of
Micro-Grid System
The steps of Immune particle swarm algorithm optimizing filter parameters of micro-grid system are as follows:
1) Initialize parameters, including the number of the maximum iterations, the number of particles, the number
of dimensions, learning factor, inertia weight, the value of the minimum distance between particles and proba-
bility of immune replacement;
2) Initialize the position and velocity of the particles and the fitness value, call program of micro-grid simula-
Y. Zhang et al.
275
tion system fitness
3) Update the position and velocity of the particle according to formula (4) and (5);
4) Call program of micro-grid simulation system fitness, and update the fitness value of particles called
Present;
5) Evaluation of fitness, update individual historical extremum called pbest and global extremum called gbest;
6) If the results meet the accuracy requirements then get out of the loop, otherwise skip to step 7);
7) Use immune mechanism, when there are no obviously superior individuals in the population after the
DS-th iteration. Calculate concentration of the i-th individual and fitnesss probability called R(M-i)f of the (M-i)-th
individual according to equation 6), then obtain replacement rate of the i-th individual. If the replacement prob-
ability of individual is greater than predetermined probability value, then the particle is replaced by particle
which is randomly generated. Skip to step 3.
Specific steps of preparing the program of objective function fitness are as follows:
a) Open the micro-grid simulation system with the function of open_system;
b) Set LC filter parameters of LC filter in the micro-grid system which is needed to be optimized as variables
denoted l and ll with the function of set_param;
c) Use the function of sim to control the operation of the micro-grid simulation system;
d) Based on filter parameters which be optimized determine the objective function and write program of the
objective function in the micro-grid, also referred to a variable called THD.
4.4. Flowchart of Immune Particle Swarm Algorithm Optimizing Filter Parameters of
Micro-Grid System
Flowchart of immune particle swarm algorithm optimize filter parameters of micro-grid system is shown in
Figure 1.
5. Simulation Results
5.1. Micro-Grid Data and Initial Parameter
Micro-grid simulation system includes two micro-sources, a power grid. Filter resonance frequency fc is 500 HZ,
the modulation frequency fn is 50 HZ and SPWM carrier signal frequency fs is 5000 HZ. Initial parameters:
maximum number of iterations is 100; the number of the initial population of 100; the dimension number is 2;
the learning factor c1 and c2 are 1.05; the maximum inertia weight is 1.5, the minimum value is 0.6; the accura-
cy of the harmonic ratio is 0.05, DS is 50, probability of replacement is 0.6, the minimum distance between the
particles is 1e-015.
5.2. Simulation Results
5.2.1. Case 1
Micro-grid operates with grid initially and simulation time is 0.1s. Power grid and two micro-sources provide
power to the load together; one micro-source disconnects with the load at 0.05s, and disconnects the grid at
0.07s, so micro-grid gets into the island state. L1 is 1.8042e-005, L2 is 1.6173e-005, and the harmonic ratio is
0.0524 by using PSO algorithm to optimize the filter parameters. L1 is 1.3642e-5, L2 is 1.4073e-5and the har-
monic ratio is 0.0379 by using IPSO algorithm to optimize the filter parameters. The comparison of A, B, C
three-phase voltage of the simulation results by using IPSO to optimize the filter parameters and A, B, C
three-phase voltage of the simulation results by using PSO to optimize the filter parameters is shown in Figure
2.
5.2.2. Case 2
Micro-grid operates islanding state and simulation time is 0.1 s, only one micro-source provides power to the
load, one micro-source connects with the load at 0.05 s, then connect the grid at 0.07 s, so Micro-grid operates
with grid-connected. L1 is 1.4042e-5, L2 is 1.4925e-5, and the harmonic ratio is 0.0596 by using PSO algorithm
to optimize the filter parameters. L1 is 1.2368e-005, L2 is 1.3010e-005 and the harmonic ratio is 0.0497 by using
IPSO algorithm to optimize the filter parameters. The comparison of A, B, C three-phase voltage of the simula-
tion results by using IPSO to optimize the filter parameters and A, B, C three-phase voltage of the simulation
Y. Zhang et al.
276
Start
Initialize parameters
Initialize the velocity ​​and position of the particle
swarm randomly
Call the program of emulation system
fitness,and calculate
the initial fitness of particle pbest
Update the position and velocity of particles
Present instead of pbest
Select the optimal value from pbest as gbest
Output gbest and the optimal parameter values
End
Call the program of emulation system fitness,and
calculate the present fitness of particle present
Whether the number of
iterations reaches limit
Whether present is better
than pbest
When the number of
iterations is greater than DS, whether the
difference between every two generation of the
optimal value of individual is less than
a very small value
Calculate the probability of particle fitness and
antibody concentration, and then draw the
probability of particle replacement
Initialize the particles
Whether the probability
of particles replacement is larger than the
fixed replacement rate
yes
no
yes
yes
no
no
yes
no
yes
Whether the algorithm meets
the accuracy requirements
Figure 1. Flowchart of immune particle swarm algorithm optimizing filter parameters of micro-grid system.
results by using PSO to optimize the filter parameters is shown in Figure 3.
5.2.3. Case 3
Initially there are only one micro-source and power grid to provide power to load and simulation time is 0.1 s.
Then disconnect the power grid at 0.05 s. L is 1.2468e-5, and the harmonic ratio is 0.0605 by using PSO algo-
rithm to optimize the filter parameters. L is 1.1259e-005 and the harmonic ratio is 0.0508 by using IPSO algo-
rithm to optimize the filter parameters. The comparison of A, B, C three-phase voltage of the simulation
Y. Zhang et al.
277
Figure 2. The load output voltage comparison chart of IPSO and PSO optimization from Grid -connected to islanding opera-
tion with two micro-sources.
Figure 3. The load output voltage comparison chart of IPSO and PSO optimization from islanding to Grid-connected opera-
tion with two micro-sources.
results by using IPSO to optimize the filter parameters and A, B, C three-phase voltage of the simulation results
by using PSO to optimize the filter parameters is shown in Figure 4.
5.2.4. Case 4
Initially there is only one micro-source to provide power to load and simulation time is 0.1 s. Then connect the
power grid with micro-grid at 0.05 s. L is 1.2582e-005, and the harmonic ratio is 0.0616 by using PSO algorithm
to optimize the filter parameters. L is 1.1158e-005 and the harmonic ratio is 0.0510 by using IPSO algorithm to
optimize the filter parameters. The comparison of A, B, C three-phase voltage of the simulation results by using
IPSO to optimize the filter parameters and A, B, C three-phase voltage of the simulation results by using PSO to
optimize filter parameters is shown in Figure 5.
Above the cases, according to the Figure 2 of the comparison of A, B, C three-phase voltage of the simula-
tion results by using IPSO to optimize the filter parameters and A, B, C three-phase voltage of the simulation
results by using PSO, we can find that the load side output voltage harmonic rate decreases from 5.24% to
3.79%. And according to the figure 4 of the comparison of A, B, C three-phase voltage of the simulation results
by using IPSO and A, B, C three-phase voltage of the simulation results by using PSO, we can find that the load
side output voltage harmonic rate decreases from 6.05% to 5.08%. Therefore, using IPSO to optimize
Y. Zhang et al.
278
Figure 4. The load output voltage comparison chart of IPSO and PSO optimization from Grid-connected to islanding opera-
tion with one micro-source.
Figure 5. The load output voltage comparison chart of IPSO and PSO optimization from islanding to Grid-connected opera-
tion with one micro-source.
filter parameters can effectively reduce output voltage harmonic ratio of the load side from grid-connected oper-
ation to islanding operation whether in a multi-sources or single-source situation.
Similarly, according to the Figure 3 of the comparison of A, B, C three-phase voltage of the simulation re-
sults by using IPSO to optimize the filter parameters and A, B, C three-phase voltage of the simulation results by
using PSO, we can find that the load side output voltage harmonic rate decreases from 5.96% to 4.97%. And
according to the Figure 5 of the comparison of A, B, C three-phase voltage of the simulation results by using
IPSO and A, B, C three-phase voltage of the simulation results by using PSO, we can find that the load side
output voltage harmonic rate decreases from 6.16% to 5.10%. Therefore, using IPSO to optimize filter parame-
ters can effectively reduce output voltage harmonic ratio of the load side from islanding operation to grid-con-
nected operation whether in a multi-sources or single- source situation.
6. Conclusion
In this paper, we proposed a method that using immune particle swarm algorithm to optimize the filter parame-
ters of micro-grid system to solve the problem of harmonics generating by micro-grid inverters and other power
electronic equipment in the micro-grid system. Immune particle swarm algorithm can effectively avoid the pre-
Y. Zhang et al.
279
mature convergence and improve the convergence rate. Through case studies, according to the comparison of
optimization parameters and objective function value with the PSO and IPSO, we can know that IPSO for the
optimization of micro-grid system filter parameters and reducing the load on the output terminal voltage har-
monic ratio is effective and feasible.
References
[1] Zhao, H.-W. and Wu, T.-T. (2008) Review of Distributed Generation Based Micro-Grid Technology. Proceedings of
the CSU-EPSA, 20, 121-126.
[2] Villeneuve, P.L. (2004) Concerns Generated by Islanding. IEEE Power and Energy Magazine, 2, 49-53.
[3] Wang, C.-S., Xiao, Z.-X. and Wan g , S.-X. (2008) Integrated Control and Analysis of Micro-Grid. Automation of Elec-
tric Power Systems, 32, 98-103.
[4] (2013) Harmonics Suppression of Current Transformer Methods and Countermeasures in Micro-Grid.
http://www.papershome.com/gongxue/dianli/15168_2.html
[5] Li, F.-X. and Zhao, B.-H. (2001) The Study and Apply of Technology about Harmonic Restraining. Proceedings of the
CSU-EPSA, 13, 5.
[6] Li, Y. , Vilat hgamuw a, D. M. and Loh, P. C. (2005) Micro -Grid Power Quality Enhancement Using a Three-Phase Four
Wire Grid-Interfacing Compensator. IEEE Transactions on Industry Applications, 41, 1707-1719.
http://dx.doi.org/10.1109/TIA.2005.858262
[7] Zhang, W. (2006) Reactive Power Optimization Research of Power System Based on Particle Swarm Algorithm.
Shandong University.
[8] Yan, J., Hu, T.S. and Huang, C.H. (2011) An Improved Particle Swarm Optimization Algorithm. Applied Mathematics
and Computation, 37, 1232-1247.
[9] Xiong, H.-G., Chang, H.-Z. and Li, H.-Z. (2006) Multi-Objective Reactive Power Optimization Based on Immune Al-
gorithm. Proceedings of the CSEE, 104-108.
[10] Liu, K.-Y., Sheng, W.-X. and Li, Y.-H. (2007) ReactiVe Power Optimization Based on Improved Immunity Genetic
Algorithm. Power System Technology, 31, 11-16.
[11] Mohamed, Y.A.-R.I. and El-Saadany, E.F. (2008) Adaptive Decentralized Droop Controller to Preserve Power Sharing
Stability of Paralleled Inverters in Distributed Generation Microgrids Power Electronics. IEEE Transactions, 2806-
2816.
[12] Han, L. (2008) The Research and Application of Immunity Swarm Algorithm. Xi’an University of Engineering, Xi’an.
[13] Nie, R. and Yue, J.-H. (2009) Seismic Wave Impedance Inversion Based Onadaptive Immune Clonal Particles Swarm
Optization. Computer Applications and Software.