In this paper, a real time implementation of selective harmonic elimination pulse width modulation (SHEPWM) using Real Coded Genetic Algorithm (RGA), Particle Swarm Optimization technique (PSO) and a new technique known as Linearization Method (LM) for Single Phase Matrix Converter (SPMC) is designed and discussed. In the proposed technique, the switching frequency is fixed and the optimum switching angles are obtained using simple mathematical calculations. A MATLAB simulation was carried out, and FFT analysis of the simulated output voltage waveform confirms the effectiveness of the proposed method. An experimental setup was also developed, and the switching angles and firing pulses are generated using Field Programmable Gate Array (FPGA) processor. The proposed method proves that it is much applicable in the industrial applications by virtue of its suitability in real time applications.
1. Introduction
Many applications such as industrial heating, light control, soft start induction motors and speed control of AC motors require continuously varying AC voltage from a fixed AC voltage source. AC voltage regulator with phase angle control and integral cycle control techniques is commonly employed for these requirements. The advantages of these techniques are simplicity, cost effectiveness, reliability and ability to control large amount of power. On the other hand, the delayed firing angle in these schemes causes the discontinuity in load current and higher value of lower order harmonics. To mitigate these problems, PWM AC choppers are preferred. In the PWM AC choppers, high switching frequencybased PWM is preferred for the system in which switching losses are endurable. Carrierbased Sine PWM (SPWM), Space Vector PWM (SVPWM) are examples of high switching frequency PWM techniques. Carrier based PWM technique is implemented in various ways such as suboscillation method and modified suboscillation method
[1]
. Low switching frequency based PWM is preferred for the system in which switching losses are intolerable and can tolerate the harmonics to certain extent. The low switching frequency is typically around the fundamental frequency of the output voltage. Selective Harmonic Elimination PWM (SHEPWM), Optimal Minimization of the Total Harmonic Distortion (OMTHD) and Optimized Harmonic Stepped Waveform (OHSW) are the examples of low switching frequency PWM techniques
[1]
. In these techniques, the AC chopper waveforms are analyzed using Fourier theory, and sets of nonlinear transcendental equations are derived and solved using any iterative procedure such as NewtonRapson, Random search and Rosenbrocks method. The convergence of these techniques depends on the choice of initial values. Stochastic optimization techniques overcome the drawbacks, and they are used to find the global optimum solution with a short time searching. Colony Algorithm (BCA), Firefly Algorithm, Differential Evolution (DE) are some of the optimization techniques
[2

11]
. These techniques are used for SHE in AC/AC converter also
[9

11]
. Hopfield neural networkbased approach is also used to solve the SHEPWM problem
[12]
.
In Selective harmonic mitigation (SHMPWM), the selected harmonic contents are restricted to the values specified by grid codes EN50160 and CIGRE WG 3605
[13]
. In SHEPWM technique, N1 number of harmonics can be eliminated for N switching angles but in SHMPWM, N
^{2}
number of harmonics can be limited to the values specified by any grid code for N switching angles.
Venturini & Alesina presented the basic configuration of the power circuit as a matrix of bidirectional switches that connect each load phase with the source phase. The authors introduced the name ‘matrix converter’ and proposed control theory known as Venturini modulation
[14]
. Different control techniques known as modified Venturini modulation, scalar control strategy, space vector modulation and carrier based modulation technique were proposed
[15

21]
. Zuckerberger introduced the single phase matrix converter for direct ACAC conversion
[22]
. SPMC has extended its operation to inverter, boost rectifier, buckboost rectifier and step up/down frequency conversion
[23]
. It employs the forcecommutating or selfcommutating devices.
In this paper, RGA and PSO are used for the SHE in SPMC. From the switching angle trajectory of RGA and PSO, a new technique called linearization method is proposed in this paper. The fundamental voltage, THD and the harmonic contents of the proposed technique are compared with RGA and PSO, and the results are tabulated.
2. Circuit Analysis
The single phase matrix converter consists of four switches SW
_{1}
, SW
_{2}
, SW
_{3}
, SW
_{4}
and these are illustrated in
Fig. 1(a)
. Bidirectional power flow in AC to AC converter demands the bidirectional switches that are capable of blocking voltages in both polarities and conduction of current in both directions. A discrete semiconductor fulfilling these requirements is not available in practice, and hence an antiparallel IGBT diode pair is used here. Theoretically, the switching is simultaneous and instantaneous. In real time, the finite switching times and delays in the circuit are taken into account.
(a) Circuit diagram of SPMC; (b) Synthesized output voltage (50Hz) of single phase matrix converter
The input voltage and the output voltages are given b
The switching sequences for the output frequency of 50 and 100Hz are summarized in
Table 1
. At anytime ‘t’, two switches are in
ON
state.
Switching sequences
Fig. 1(b)
shows the ideal synthesized output voltage waveform of single phase matrix converter with the output frequency of 50Hz. The waveform possesses N switching angles between 0 and
. Due to the square wave symmetry in the output waveform, all the even harmonics are eliminated and the odd harmonics alone are present in the output. In SHE technique with N switching angles, control of fundamental voltage and the elimination of N1 selected lower order harmonics are done. In this paper, seven switching angles are generated.
3. Formulation of Transcendental Equations
The Fourier Series expansion of output voltage is
where
A
_{n}
and
B
_{n}
are the Fourier coefficients

nis the order of the harmonic.

Vmis the peak value of the output voltage.
The fundamental coefficients
A
_{1}
and
B
_{1}
are expressed as
The coefficients
A
_{n}
and
B
_{n}
are expressed as
The output voltage is articulated as
where
and
Let
F
(
α
) be the objective function to be minimized and is defined as
With the constraint
where modulation index
The objective function
F
(
α
) is minimized subject to the condition in Eq. (10). Hence the desired output voltage is regulated over the range 0 to
V
_{m}
by changing the modulation index, and the selected harmonics up to 13
^{th}
order are eliminated.
4. Real Coded Genetic Algorithm (RGA)
Genetic algorithm is inherently parallel because of simultaneous evaluation of many points in search space. Hence GA has reduced the chance of converging in local optima and more chance to converge in global optima
[24]
. Initially, GA was designed to operate with binary codes. Now real coded GA is used due to their supreme behavior such as reduced computational effort, absolute precision, etc. The steps involved in RGAbased approach are illustrated.
Step 1
: Random generation of the initial population
Generating N switching angles is the solution to this problem. Each switching angle is a gene represented by real numbers. There are N genes in each chromosome. Each chromosome represents the solution to the problem. Population consists of sets of chromosomes. Population is initialized with random numbers between 0 and
Step 2
: Evaluation of the fitness function
The objective function in this study is to minimize the selected harmonics, and hence fitness function has to be minimized. Since all optimization techniques are used only for the maximization problem, the fitness function is modified as below
Fitness of each chromosome is computed.
Step 3
: Generation of offspring
Offspring is a new (Child) chromosome. From the fitness value of each chromosome, best parents are selected for reproduction. In this work, tournament selection is used as selection mechanism to avoid premature convergence. The selected parents are subjected to Simulated Binary Crossover (SBX) and polynomial mutation. Self adaptive simulated binary crossoverbased RGA was successfully applied to various engineering optimization problems
[25]
.
Simulated Binary Crossover
In SBX crossover, two children solution
y
_{i}
^{(1)}
and
y
_{i}
^{(2)}
are wrought from the parent solution
x
_{i}
^{(1)}
and
x
_{i}
^{(2)}
. The SBX operator simulates the working principle of the single point crossover on binary strings.
The spread factor
β
is defined as the ratio of absolute difference in child solution
y
_{i}
^{(1)}
and
y
_{i}
^{(2)}
values to that of parents’ values
x
_{i}
^{(1)}
and
x
_{i}
^{(2)}
.
Polynomial probability distribution
n
_{c}
is a nonnegative real number known as crossover distribution index which represents the distance of the children from the parent.
Nonuniform polynomial mutation
Newly generated children undergo polynomial mutation operation with userdefined index parameter (
n
_{m}
) to create mutated offspring. New offspring
y
_{i}
is determined using equation
where
and
are the upper and lower limit values.
δ
_{i}
is calculated from the polynomial probability distribution. The function is given by
n
_{m}
is the mutation distribution index / mutation constant and random number
r
_{i}
∈[0,1] . Newly generated offspring will become the population for the next generation. The procedure is repeated from Step 2 till the stopping criterion is reached. The parameters used in the algorithm are given in
Table 2
.
Parameters used in RGA and PSO
Parameters used in RGA and PSO
Stopping criteria
The algorithm stops when any one of the following conditions occurs.

1) When the number of iterations performed by the RGA reaches the value of the maximum iteration.

2) When the number of evaluations performed by the RGA reaches the maximum number of evaluation.

3) When the change in the objective function from one generation to the next successful poll is less than the objective function tolerance.
5. Particle Swarm Optimization (PSO)
PSO is a populationbased stochastic optimization technique developed by Eberhart and Kennedy inspired by the social behavior of bird flocking and fish schooling. The steps involved in PSO algorithm are given below.
Step 1
: Random generation of the initial population
It begins with the initialization of particle position (switching angles) between 0 to
and velocities in “N” dimensional space.
Step 2
: Evaluation of the fitness function
In each iteration, the particle moves according to the velocity and changes its position. The fitness function is evaluated for each particle.
Step 3
: Setting Pbest and Gbest
The best position reached among the particle during their search is the particle best (Pbest). The best fitness value reached by the particle in all the searches is the Global best (Gbest).
Step 4
: Updating the velocity and the position of each particle
Let
V
_{i}
and
X
_{i}
represent the velocity and the position of
i
^{th}
particle. The velocity and the position of each particle are updated as given below.
where ω
^{k}
 Inertia weight at iteration
k
,
 Velocity of
i
^{th}
particle at iteration
k
,
C
_{1}
and
C
_{2}
 Acceleration factors,
r
_{1}
and
r
_{2}
 Uniform random numbers ∈[0,1] ,
 Best position of
i
^{th}
particle at iteration
k
,
 Position of
i
^{th}
particle at iteration
k
,
 Best position of the group till iteration
k
,
ω_{max}
and
ω_{min}
are initial and final weights,
iter
_{max}
 total number of iterations.
The procedure is repeated from Step 2 till t he stopping criterion is reached. The stopping criteria of RGA are applicable to PSO also. The parameters used in PSO algorithm are shown in
Table 2
.
6. Implementation of SHEPWM using the Proposed Linearization Method (LM)
In SHE technique, initially the objective function is formulated, and the formulated function is solved either using conventional techniques or any one of the optimization techniques. In both the techniques, the switching angles are derived offline only for certain number of modulation indices due to their large convergence time. These switching angles are stored in lookup table of any controller during real time applications. The required MI is approximated to the nearest MI which is stored in the controller and this leads to inaccurate control. The proposed linearization method overcomes this drawback.
The proposed algorithm is applicable for the system in which switching losses are intolerable and can tolerate the harmonics to the certain extent. In this technique, the objective function is not needed. From the switching angle trajectory of RGA and PSO shown in
Fig. 3(a)
and
3(b)
, it is observed that the variation of switching angles is almost linear irrespective of the number of angles
[10]
. Hence a pure linear switching angle trajectory is derived in LM and it shown in
Fig. 4
. From this trajectory, the switching angles are obtained for any modulation index. The steps involved in this technique are given below.
Step 1
: Initialization of parameters

Number of switching angles =N

Modulation Index =MI

Lower LimitX1min= 0

Upper LimitXNmax= 90
Step 2
: Calculation of lower and upper limits of each switching angles
Step 3
: Determination of switching angles for the given MI
For any modulation index MI,
Switching angle trajectory using RGA and PSO
Switching angle trajectory using LM
The flow chart for the calculation of switching angles is shown in
Fig. 2
. This technique can be extended to any number of switching angles, and the modulation index can be changed in real time.
Flowchart for the calculation of switching angles
 6.1 Implementation of LM
The various steps involved in the implementation of LM are given below
Step 1
: The required MI and number of switching angles are given to the controller.
Step 2
: The controller generates the switching angles using Eqs. (2330).
Step 3
: The switching angles are compared with the carrier signal of fundamental frequency 50Hz and it is shown in
Fig. 1(a)
.
Step 4
: The output signals
A
to
G
of the comparator are used for the generation of gate pulses
S
_{1a}
to
S
_{4b}
. The circuit used for the gate pulse generation is shown in
Fig. 6
.
Circuit diagram for the generation of gate pulses
Step 5
: The generated gate pulses
S
_{1a}
to
S
_{4b}
are given to the SPMC.
7. Results and Discussions
To verify and validate the algorithms, programs are developed in MATLAB file code. The programs are run in PentiumV computer operating at 1.4GHz clock speed. The single phase matrix converter is realized in MATLAB/Simulink environment with the following parameters
V
_{imax}
=100V, R=30Ω,
f
_{in}
=50Hz,
f
_{out}
=50Hz.
Table 3
shows the harmonic contents of the order 3 to 13 for various modulation indices in RGA and PSO. The required fundamental voltage is obtained in both the techniques.
Comparison of THD and harmonic contents for different MI using RGA and PSO
Comparison of THD and harmonic contents for different MI using RGA and PSO
The seven output signals
A
to
G
from the comparator in simulation and hardware are shown in
Fig. 5(a)
and
5(b)
. From these seven signals, the eight gate pulses
S
_{1a}
to
S
_{4b}
for the SPMC are generated using the circuit shown in
Fig. 6
. The gate pulses generated in simulation and hardware are shown in
Fig. 7(a)
and
7(b)
.
Fig. 8
shows the harmonic spectrum using RGA and PSO for the modulation index of 0.6.
Fig. 9
and
10
show the harmonic spectrum of LM obtained for the modulation indices of 0.2, 0.4, 0.6 and 0.9 on the simulation and real time respectively.
Fig. 8
,
9
and
Fig. 10
confirm that the fundamental voltage is equal to the required MI and the harmonic contents H3 to H13 are minimized.
Fig. 11
shows the output voltage of SPMC for MI of 0.6 using LM on simulation and hardware.
Fig. 12
shows the comparison of harmonic contents measured using RGA, PSO and LM on simulation as well as real time with that of the grid code EN50160 for the modulation index of 0.6 and it is clear that the harmonic contents are less than the value specified by the grid code.
Fig. 13
shows the comparison of % THD using RGA, PSO and LM. It is observed that the THDs in all the techniques are almost the same.
Fig. 14
shows the experimental setup of selective harmonic elimination of single phase matrix converter.
Table 4
shows the comparison of various components using LM on simulation and hardware.
(a) Output of the comparator in simulation for MI = 0.5; (b) Output of the comparator in hardware for MI = 0.5
(a) Gate pulses for SPMC in simulation for MI = 0.5; (b) Gate pulses for SPMC in hardware for MI = 0.5
Harmonic Spectrum of GA and PSO
Harmonic Spectrum of LM for MI = 0.2, 0.4, 0.6 and 0.9 in simulation
Harmonic Spectrum of LM for MI = 0.2, 0.4, 0.6 and 0. 9 in hardware
Output Voltage on simulation and hardware with MI =0.6
Comparison of Harmonic contents.
Comparison of THD
Experimental setup of SPMC for SHE
Comparison between simulation and hardware results
Comparison between simulation and hardware results
The deviation in harmonic contents and fundamental voltage may be due to the fact that

1) The input frequency in simulation is 50Hz. In real time, the input frequency is 49.97Hz.

2) The switching angle decimal accuracy in simulation is four digits, but in real time it is two digits.

3) The ideal switches are used in the simulation where onstate resistance of the switches is zero. But in real time, the onstate resistance of the switch leads to onstate voltage drop.
8. Conclusion
A new technique known as Linearization Method is proposed in this paper for SHE in single phase matrix converter. From the results, the following conclusions are observed at:

1) The proposed algorithm is applicable for the system in which switching losses are intolerable and can tolerate the harmonics to a certain extent. The switching frequency is the fundamental output frequency of the system.

2) In this technique, the objective function is not needed. Hence the proposed method provides an alternative to engineering optimization problems, and the optimum switching angles are derived using simple calculations.

3) The selected harmonics in LM, RGA and PSO are less than that of grid code EN50160.

4) This technique can be extended to N switching angles and it eliminates N1 selected harmonics for all modulation indexes.

5) This technique can be readily implemented in hardware and is suitable for real time applications.
BIO
P. Subha Karuvelam She received BE and ME degree from PSG College of Technology, India and Anna University, Chennai respectively. She is currently working as Assistant Professor in Government College of Engineering, Tirunelveli, India. Her research interests include Optimization Techniques, Selective Harmonic Elimination in Power converters and Power electronics and Drive systems.
M. Rajaram He received B.E and M.E degree from M.K University, Madurai and Bharathiyar University, Coimbatore, India respectively. He received his Ph.D degree from Bharathiyar University, Coimbatore, India. He is currently working as ViceChancellor, Anna University, Chennai. His research interests include control systems, power electronics and electrical drives.
Hasmukh Patel S.
,
Richard Hoft G.
1973
“Generalized techniques of Harmonic Elimination and Voltage Control in thyrister Inverters: I Harmonic elimination”
IEEE Trans. Ind. Appl
IA9
(3)
310 
317
DOI : 10.1109/TIA.1973.349908
Enjeti P.
,
Lindsay J.F.
1987
“Solving Nonlinear equation of harmonic elimination PWM in power control”
IEE Electronics Letters
23
656 
657
DOI : 10.1049/el:19870469
Chiasson J. N.
,
Tolbert. L. M
,
Mc Kenzie K. J.
,
Zhong Du
2004
“A complete Solution to the Harmonic elimination Problem,”
IEEE Trans. Power Electron
19
(2)
491 
499
DOI : 10.1109/TPEL.2003.823207
Chiasson J.N.
,
Tolbert L.M
,
Mc Kenzie K.J.
,
Zhong Du
2005
“Elimination Harmonics in a multilevel converter using the theory of symmetric polynomials and control systems,”
IEEE Trans. control sys. Technol
13
(2)
216 
223
DOI : 10.1109/TCST.2004.839556
Hosseini Aghdam M. G
,
Fathi S. H
,
Gharehpetian G. B
2007
“Elimination of harmonics in a multi LevelInverter with Unequal DC sources Using the Homotopy Algorithm,”
IEEE Int. symp. ISIE2007
578 
583
Wenyi Zhang
2011
“Analyzing of voltagesource selective harmonic elimination inverter”
Proc. ICMA2011
1888 
1892
Wang Jin
,
Ahmadi Damoun
2010
“A precise and Practical Harmonic Elimination Method for Multilevel Inverters,”
IEEE Trans. Ind. Appl.
46
(2)
Ahmadi D.
2011
“A Universal Selective Harmonic Elimination Method for HighPower Inverters”
IEEE Trans. on Power Electron
26
(10)
2743 
2752
AlOthman A K.
,
Ahamed N. A
2007
“Selective harmonic Elimination on PWM AC/AC voltage regulator using Hybrid RGAPS approach”
Int J. of Electr. And Electron. Eng
1
(4)
227 
233
Dahidah M.S.A.
,
Rao M.V.C.
2007
“Hybrid Genetic Algorithm for selective harmonic elimination PWM AC/AC control”
J. of Electr Eng.
89
(4)
285 
291
DOI : 10.1007/s0020200600039
Khamsen Wanchai
,
Aurasopon Apinan
,
Sangiamvibool Worawar
2013
“Power factor improvement and voltage Harmonic reduction in PWM AC chopper using Bee Colony Optimization”
IETE Tech. review
30
(3)
Anderson James A.
1998
“An Introduction to Neural Networks”
Prentice Hall of India
New Delhi
401 
416
Napoles Javier
,
Leon J.I
,
Ramon L.
,
Franquelo G.
,
Aguirre M.A.
2010
“Selective harmonic Mitigation Technique for HighPower Converters”
IEEE Trans. on Ind. Electr”
57
(7)
2315 
2323
DOI : 10.1109/TIE.2009.2026759
Venturini M
,
Alesina A
1980
“The Generalized Transformer: A New Bidirectional Sinusoidal Waveform Frequency Converter with Continuously Adjustable Input Power Factor”
Proceedings of the IEEE conference on PESC
242 
252
Alesina A
,
Venturini M
1989
‘Analysis and design of optimum –amplitude nine switch direct ACAC converters’
IEEE Transactions on Power Electronics
4
(1)
101 
112
DOI : 10.1109/63.21879
Roy G
,
April GE
1991
‘Direct frequency changer operation under new scalar control algorithm’
IEEE Transactions on Power Electronics
6
(1)
100 
107
DOI : 10.1109/63.65008
Huber L
,
Borojevic D
1995
‘Space Vector modulated three phase to three phase matrix converter with input power factor correction’
IEEE Transactions on Industry Applications
31
(6)
1234 
1246
DOI : 10.1109/28.475693
Yoon YoungDoo
,
Sul SeungKi
2006
‘Carrier Based Modulation Technique for Matrix Converter’
IEEE Transactions on Power Electronics
21
(6)
1691 
1703
DOI : 10.1109/TPEL.2006.882935
Nguyen. T. D
,
Lee Hong Hee
2014
‘Dual ThreePhase Indirect Matrix Converter With CarrierBased PWM Method’
IEEE Transactions on Power Electronics
29
(2)
569 
581
DOI : 10.1109/TPEL.2013.2255067
Potamianos P.G.
,
Mitronikas E.D.
,
Safacas A.N
2014
‘OpenCircuit Fault Diagnosis for Matrix Converter Drives and Remedial Operation Using CarrierBased Modulation Methods’
IEEE Transactions on Industrial Electronics
61
531 
545
DOI : 10.1109/TIE.2013.2240639
Rodriguez Jose
,
Rivera Marco
,
Kolar Johan W.
,
Wheeler Patrick W.
2012
“A Review of Control and Modulation Methods for Matrix Converters”
IEEE Transactions on Industrial Electronics
59
(1)
Zuckerberger A
,
Weinstock D
,
Alexandrovitz A
1997
‘Singlephase Matrix Converter’
IEE Proc. Electric Power Applications
144
(4)
235 
240
DOI : 10.1049/ipepa:19970848
Ahirrao Divya
,
Gaware Bhagyashri
,
Kakade Prajakta
,
Kharade Pratiksha
,
Chawda Sandeep
2014
’ Analysis of Single Phase Matrix Converter’
Int. Journal of Engineering Research and Applications
4
856 
861
Willuice Iruthayaraan M.
,
Baskar S.
2009
“Evolutionary algorithm based design of multivariable PID controllers”
Expert Systems with applications
36
9159 
91677
DOI : 10.1016/j.eswa.2008.12.033
Deb K
2001
“Multiobjective optimization using evolutionary algorithms”
Wiley
Chichester, U.K.