With the recent developments of low cost semi converter devices and high speed digital processors, PWM inverters have become cost effective. PWM Inverters are increasingly employed in wide range of industrial and commercial applications such as Variable speed induction motor drives, Induction heating, Welding machines, UPS systems, Standalone solar Photovoltaic systems. Further, in distributed generation plant, the generated DC power is converted to AC with required voltage and frequency via PWM inverters and Multilevel Inverter [1-3]. The most commonly favored switching schemes for inverter output voltage regulation is Pulse Width Modulation (PWM) method.
Among various PWM methods; Selective Harmonic Elimination PWM (SHEPWM) method has been the main focus of research since it offers several advantages compared to traditional methods which includes acceptable performance with low switching frequency to fundamental frequency ratios, direct control over output waveform harmonics, and the ability to leave triplen harmonics uncontrolled to take advantage of circuit topology in three phase systems . This technique was first examined by  and later developed into matured form in [6, 7]. The common characteristic of these methods is the waveform analysis is done in Fourier domain. A set of non-linear, transcendental equations is then derived and the solution is obtained using iterative procedure, mostly by the Newton-Raphson method. This method is derivative dependent and may end in local optima; further, a judicial choice of initial values alone will guarantee convergence . Another approach is the use of Walsh functions [9, 10]. By using Walsh function method, the switching angles are optimized by solving linear equations instead of solving non-linear transcendental equations. Moreover, in  it is pointed out that the method fails if there exists a solution that requires two or more angles to vary in the same selected interval. In  Walsh function based harmonic elimination method is applied in PWM inverter. The calculation of optimum switching angles for the elimination of selective harmonics imposes heavy computational burden; due to associated nonlinear transcendental equations having multiple solutions. Therefore the methods used must have the capability to handle large solution space with multiple solutions. Hence, an optimization method based on population search is a suitable choice for solving such nonlinear transcendental equations. Further, these methods have the advantage of starting with a random initial guess, converging to the global optimal value and multiple optimal solutions compared to single solution in conventional search.
Genetic Algorithm (GA), inspired by the laws of natural selection and genetics, has been widely discussed in the literature for harmonic elimination problem [12-16]. Genetic Algorithm has simple structure and converges to near optimum solution. However, it has the inherent drawback of slower convergence and convergence to local optima . Very recently, a new evolutionary computation technique, called Bacterial Foraging Algorithm (BFA) has been proposed in  and has been successfully applied to various engineering optimization problems [19-23]. This method is based on the foraging (methods for locating, handling, and ingesting food) behavior of E. coli bacteria present in our intestines and the foraging strategy is governed by four processes, namely, chemo taxis, swarming, reproduction, and elimination and dispersal. BFA has been reported to have better performance than GA  in terms of convergence to global minimum solution.
Hence, in this paper, a novel algorithm based on BFA is proposed for selective harmonic elimination in PWM inverter. The dual objective of harmonic elimination together with output voltage regulation is suitably framed as an optimization task and the switching instances are identified through the steps of BFA. The performance of BFA is estimated and later compared with calculus based Newton-Raphson method and Genetic Algorithm. Simulation and experimental results are taken for the proposed methods.
2. Problem Formulation
The output voltage of single-phase PWM inverter with k pulses per half cycle is shown in Fig. 1. For generality, the output voltage is assumed to have k pulses with switching angles symmetrical with respect to π/2 . The value of k is an odd number and it varies from three, five, seven, nine, etc. The output voltage can be expressed using Fourier series as,
Fig. 1.PWM inverter output voltage waveforms
Where n = 1, 2, 3, 4, 5….
Due to quarter wave symmetry of the output voltage, even harmonics are absent. Further, the coefficients An and a0 are zero. Thus the above equation reduces to,
where n=1, 3, 5,…..
The value of Bn is computed using
The fundamental component is given by
In selective harmonic elimination the problem objective is to find the switching angles such that where refers to the desired fundamental voltage component and the remaining harmonic components are equated to zero. The above objective can be framed as an optimization problem by defining function F(α) satisfying the constraints. The framed optimization problem then mathematically written as
Subject to constraints:
0 ≤ α1 ≤ α2....... ≤ αk-1 ≤ αk ≤ π/2
3. Bacterial Foraging Algorithm
Bacteria Foraging Algorithm (BFA) was proposed by Passino and a new addition to the family of nature-inspired optimization algorithms . The algorithm is based upon the fact that the genes of the fitter species, having successful foraging strategy, are likely to survive and get propagated in the evolution chain. Escherichia coli bacteria present in human intestine also undergo foraging strategy and can be explained by four processes, namely chemotaxis, swarming, reproduction, elimination and dispersion. Application of group foraging strategy of a swarm of E.coli bacteria in multi-optimal function optimization is the key idea of this new algorithm.
The following section explanations the various BFA operations followed by steps involved in the implementation of BFA approach for harmonic elimination in PWM inverter. Various operators of BFA include chemotaxis, swarming, reproduction, elimination and dispersion chromosomes.
Chemotaxis: During chemotaxis a bacterium involves two processes namely swimming and tumbling, both refers to the movement of E. coli cell. It can either swim for a period of time in the same direction or it may tumble, and alternate between these two modes of operation for the entire lifetime. Each bacteria tumbles, a unit length movement in a random direction φ(i) , to find a new direction of movement. The direction of movement after a tumble is represented by
θi ( j , k ,l) represents i-th bacterium at j-th chemotactic, k-th reproductive and l-th elimination-dispersal step. c(i) is the size of the step taken in the random direction specified by the tumble (run length unit). Δ(i) ∈ℜP random number in the range of [-1,1]
The bacteria continued to swim after the tumble if the present direction is rich in nutrients (food), but only up to a maximum number of steps, Ns.
Swarming: During this process, the bacterium that has already followed the optimum path try to attract the other bacteria so that they swarm together to the desired location. The bacteria congregate into groups and, hence, move as groups in concentric patterns with high bacterial density. The mathematical representation for swarming can be represented by
Where, Jcc ( θ, P( j, k, l)) is the objective function value to be added to the actual objective function (to be minimized) to present a time varying objective function. “S” is the total number of bacteria, “P” is the number of variables to be optimized, which are present in each bacterium and dattract , wattract , hrepelent , wrepelent are different coefficients that should be chosen properly.
Reproduction: The least healthy bacteria eventually die while each of the healthier bacteria (those yielding lower value of the objective function) split into two, maintaining the population of bacteria constant.
Elimination and Dispersal: Gradual or sudden changes in the local environment, due to various reasons, may kill a group of bacteria or disperse a group of bacteria into a new location. This process reduces the chance of convergence to local optimum position.
Table 1.Parameters used for BFA
Aforementioned BFA processes of chemotaxis, swarming, reproduction and elimination dispersion are implemented by applying the following steps. The following table shows the parameter values used in this work and these values are initialized at the start.
The following section discusses the chemotaxis loop, swarming, reproduction, and elimination and dispersion of a bacterium. Any ith bacteria at the jth chemotatic, kth reproduction and lth elimination stage is given by θi ( j , k ,l) and its corresponding objective function is J (i, j , k ,l) . In the present work, the value of ith bacteria θi( j , k ,l) refers to set of switching angles (α1, α2, ....., αk). For example, if there are three pulses per half cycle their respective ‘ α ’ values are α1, α2, α3 . These values are denoted by bacteria θi ( j , k ,l) in BFA where each ‘α ’ value is indicated by using variable ‘P’. Hence, a bacterium denotes a potential solution to the problem. Bacteria indicating ‘ α ’ values are evaluated using the objective function J (i, j , k ,l) in BFA. The values of θi ( j , k ,l) and J (i, j , k ,l) are updated using the following steps.
Step 1: Step Elimination-dispersal loop l =l +1 Step 2: Reproduction loop k = k +1 Step 3: Chemotaxis loop j = j +1
A) For each bacterium, i =1, 2, 3 ,......., S compute objective function J (i, j , k ,l) .
a. LetJsw(i, j, k, l)=J(i, j, k, l)+Jcc( θi( j, k, l),P( j, k, l)) Where, Jcc( θ, P( j, k, l)) is the objective function value to be added to the actual objective function (to be minimized) to present a time varying objective function. b. Let Jlast= Jsw(i, j, k, l), to save this value since the objective is a minimization function. c. End of the loop
B) Tumble and swim:
a. Let m = 0 (counter length for swim) b. While m ＜ NS i. Let m=m+1 Generate a random vector Δ(i) ∈ℜP with each element being a random number in the range of [-1,1]. c. Move: To generate new ‘α ’ values each bacteria is allowed to move fixed step length of C(i) with random tumble direction defined by φ(i) . The newly computed ‘α ’ values is represented by is given by
θi (j +1, k ,l)=θi ( j , k ,l)+C(i)φ(i)
C) Compute J (i, j +1, k ,l) and then let Jsw(i, j+1, k, l)= J(i, j+1, k, l)+Jcc(θi(j+1, k, l), P(j+1, k, l)) ii. If Jsw(i, j +1, k, l ) ＜ Jlast then Jlast = Jsw(i, j +1, k, l ) θi (j +1, k ,l)=θi ( j , k ,l)+C(i)φ(i) and use the above θi (j +1, k ,l) to compute new J (i, j +1, k ,l) iii. Else m = NS
D) Go to next bacterium (i +1) till all the bacteria undergoes chemotaxis.
Step 4: If j ＜ Nc , (go to step 3). In this case, continue chemotaxis since the life of the bacteria is not over. Step 5: Reproduction: a. For the given k and l, for each i =1, 2, 3,.............., S , let be the health of i th bacterium and sort Jhealth in ascending order b. The bacteria with the highest Jhealth values die and those with minimum values split and the copies that are made already, now placed at the same location as their parent. Step 6: If k ＜ Nre , go to step 2. In this case, we have not reached the number of specified reproduction steps, so we start the next generation in the chemotactic loop. Step 7: Elimination-dispersal: for i=1, 2, 3,.............., S , a random number is generated and if it is less than or equal to Ped , then that bacterium is dispersed to a new random location else it remains at its original location. Step 8: If l ＜ Ned , then go to step 1; otherwise end. The flowchart corresponding to the implementation steps is given in Fig. 2.
Fig. 2.Flowchart for bacterial foraging algorithm
4. Simulation Results
A dedicated software program is developed in MATLAB for application of BFA for voltage harmonic elimination problem in PWM inverter. The efficacy of the BFA methods relies on selection of parameters; since the speed of convergence and convergence to global minimum are greatly affected by the parameter selection. The parameters are selected via a trial and error process to achieve best solution set. The program is made to run for different voltage conversion ratios and with different number of pulses per half cycle. The convergence characteristics of proposed algorithm with different pulses per half cycle under certain run are plotted and it is shown in Fig. 3. From the graph; one important observation is that, the fitness function starts with a lowest value of 0.25 and converges steadily towards global optimum value of 0.003845 at 100th iteration irrespective of the number of pulses per half. The behavior of the proposed methods is studied and it remains same for different run. The proposed algorithm is stable and the objective function continues to converge to the global optimum even with different initial values.
Fig. 3.Convergence characteristics of proposed BFA method
Further, to demonstrate the effectiveness of the proposed approach, the results obtained with BFA are compared with Newton-Raphson and GA method; since both methods are extensively employed in literature for harmonic elimination problem [11-15]. The convergence characteristics of all methods are plotted in Fig. 4. When NR method is applied for harmonic elimination problem it is found that the convergence strongly depends on the initial value selected and it fails to converge with random initial guess.
Fig. 4.Comparative convergence characteristics of BFA, GA, NR method
However, the above shortcoming is absent with GA and BFA since both the methods share the basic property of population based methods. It is interesting to compare the convergence characteristics of both methods. Both the methods start with a random initial guess and tries to converge to optimum value. In BFA, global optimum is guaranteed because during the elimination and dispersion it kill a group of bacteria or disperse a group of bacteria into a new location. However, in GA no such process exists. When both the algorithm were executed on 2.4GHz Intel i3 processor BFA and GA takes 0.3 sec and 0.25 sec respectively. Further, with iteration limit, BFA converges to optimum value of 0.00324 at 62nd iteration whereas GA converges to 0.09 at 200th iteration.
To validate the guaranteed global optima with BFA, harmonic spectra are computed for different operating point and compared with GA. The computed harmonic spectra taken for k = 3, 5, 7, 9 pulses per half cycles are shown in Fig. 5. In the computation, stress is given to alleviate the possible harmonics by suitably defining hc . For instance, with 3 pulses per half cycle 2 harmonic are eliminated and hc is written as hc = ｜B3｜ + ｜B5｜ and with 5 pulses per half cycle hc is modified to hc = ｜B3｜ + ｜B5｜ + ｜B7｜ + ｜B9｜ and so on. From the spectra, it is evident that BFA works successfully for the present problem by completely eliminating the desired voltage harmonics by selectively choosing ‘ α ’ values. The algorithm works even with higher switching pulses per half cycles with less computation time.
Fig. 5.Simulated harmonic spectra with (a) k=3 pulses per half cycle (b) k=5 pulses per half cycle (c) k=7 pulses per half cycle (d) k=9 pulses per half cycle
5. Experimental Results
In order to validate the theoretical findings a hardware prototype was fabricated in the laboratory and the same was used to drive a 220V; 55 Watts, 1250 rpm capacitor run induction motor driving a domestic fan load. Aurdino processor was used to generate switching pulses to the IGBTs; the switching angles are shown in Table 2. The switching angles were calculated off-line for different operating points of the inverter and are subsequently stored in the processor. Experiments were carried out for different voltage conversion ratios and for different values of switching pulses per half cycle. The measured harmonic spectra are shown in Fig. 6, it is apparent from the figure that, there is good agreement between the computed harmonic spectra and measured values. The small discrepancies could be attributed to the fact that while simulation results are obtained for 50Hz, the same frequency could not be maintained in the hardware implementation to avoid switching dead times. The inverter was supplied a constant dc source of 200V. The measured motor temrinal voltage waveform is taken for 3 pulses per half cycle and Vdc = 200V, Vo*=145V is presented in Fig. 7. In order to vaildate output voltage regulation, the BFA and GA are switched different switching angle at the output voltage of Vo*=165V for 7 pulses per half cycle and Vo*=135V for 9 pulse per half cycles for variable speed purpose. It is evident from the expermental figure 6.c and 6.d the BFA method is achieved perfect output voltage together with harmonics elimination.
Table 2.Firing Angle for BFA and GA
Fig. 6.Experimental harmonic spectra with (a) k = 3 pulses per half cycle (b) k =5 pulses per half cycle (c) k =7 pulses per half cycle (d) k =9 pulses per half cycle.
Fig. 7.Experimental Motor terminal voltage waveform for k = 3 and Vdc=200V, Vo*=145V
The problem of harmonic elimination in PWM inverter is drafted as an optimization task and the same is solved using Bacterial Foraging Algorithm and the results are presented in this paper. From the results, it is observed that Bacterial Foraging Algorithm works efficiently well for output voltage regulation together with harmonic elimination. The proposed algorithm completely eliminates desired harmonics together voltage regulation. To test the feasibility and quality of the solution, a mat lab program is developed and successfully implemented for different operating conditions. A hardware prototype of single phase inverter is also built to compare and validate the computed results. It is observed that, the simulated results agree well with experimental values.