A Novel Bio-Inspired Algorithm Applied to Selective Harmonic Elimination in a Three-Phase Eleven-Level Inverter

Universidad Tecnológica de Altamira, Boulevard de los Rı́os Km. 3+100, Puerto Industrial Altamira, Altamira 89601, Tamaulipas, Mexico Instituto Politécnico Nacional CICATA Altamira, Km. 14.5 carretera Tampico-Puerto Industrial Altamira, Altamira 89600, Tamaulipas, Mexico TecNM/Instituto Tecnológico de Ciudad Madero, Juventino Rosas y Jesús Urueta s/n, Col. Los Mangos, Cd. Madero 89318, Tamaulipas, Mexico CINVESTAV del IPN-Unidad Guadalajara, Guadalajara, Jalisco 45019, Mexico


Introduction
Inverters are power electronics devices capable of providing an alternating output waveform from a direct current source at the required frequency and output voltage design specifications. Square or quasi-square output waveform inverters are among the most common and basic inverter types. Similar to simple inverters, a multilevel inverter converts a dc source into an alternating output. However, the output current is generated as a multiple-step waveform at many voltage levels. Multilevel inverters (MLI) were first introduced midway during the seventies decade. However, due to their versatility, they have been consistently applied as medium high voltage inverters, industrial drivers, and static VAR compensators, as well as for transmission and distributions systems, just to mention some [1,2]. eir main advantage resides on their higher power quality, low switching losses, and better electromagnetic compatibility. Even though there have been a few decades since they were initially developed, researchers are still designing new topologies and modulation strategies to improve the multilevel inverters' performance, including, but not limited to, increasing their efficiency and to reduce harmonic content and electromagnetic interference (EMI) [3,4]. e best possible MLI performance arises from a combination of selecting a given topology and matching it with the right modulation strategy.
In terms of inverter topologies, the most common MLI types found in the literature are diode-clamped, capacitorclamped, and cascaded H-bridge inverters. From the modulation strategies perspective, MLI are categorized in two main groups: fundamental switching frequency and highswitching frequency. Each of these groups has two subdivisions, where selective harmonic elimination and space vector control are considered part of the fundamental switching frequency group, whereas the second group includes the high-switching frequencies, pulsed width modulation strategies (PWM): space vector and multilevel sinusoidal. [3,4].
Particularly, for the purpose of this research, this study uses the cascaded H-bridge multilevel topology and the selective harmonic elimination (SHE) control strategy [5,6]. e cascaded H-Bridge multilevel topology consists of multiple H-bridge inverter modules with separate dc sources, connected in cascade or series. e typical staircase voltage output with selective harmonics elimination for multilevel inverters is generated by the correct angle switching and synchronization of power device semiconductors. By Fourier transforming the voltage output, a series of nonlinear equations need to be solved for the unknown angles per quarter of the fundamental cycle. Basically, SHE aims for the elimination of the low-order harmonics by making them equal to zero, while keeping the fundamental component equal to the desired amplitude [7][8][9][10][11]. Several techniques have been applied to solve this set of equations, ranging from iterative methods such as Newton-Raphson [12] to stochastic methods such as genetic algorithms (GA) [13][14][15] and particle swarm optimization (PSO) [16,17]. However, each of these techniques has their own drawbacks that reduce their use in selective harmonic elimination. Use of the Newton-Raphson method is not recommended to solve for a high number of angles as in multilevel inverters, whereas genetic algorithms' main limitation is its convergence rate, which is very slow when compared to other algorithms. On the contrary, PSO [18], a swarm-based metaheuristic, has a very good convergence rate, but suffers from stagnation when searching for the local minima. In order to overcome some of these issues, metaheuristics such as the bee [19], ant colony [20], modified version of the fish algorithm [21], and firefly algorithms [22] have also been applied to SHE in multilevel inverters, achieving better results than PSO. Recently, two new metaheuristic, the whale optimization algorithm (WOA) [23] and a modified version of grey wolf optimization [24] (MGWO), have been applied to the SHE technique. Routray et al. in [25] show that the MGWO algorithm outperforms the grey wolf optimization GWO, the genetic algorithm (GA), and the particle swarm optimization (PSO) methods. Similarly, Kar et al. in [26] compared WOA with PSO and the firefly algorithm, showing WOA's faster response and less computation time. Each of these optimization methods requires a suitable objective function that includes the SHE set of equations with the proper constraints. Several objective functions have been described in the literature [10,14,[25][26][27][28] for the SHE problem. In this paper, the objective function defined in [26,27] is used. Currently, researchers are still applying new methods to solve the SHE technique, such as the flower pollination algorithm [29], teaching-learning-based optimization [28] and a differential harmony search algorithm [30], demonstrating the continuous interest in this topic.
is paper aims to establish the black widow optimization algorithm theoretical foundations as a new alternative method to solve the SHE set of equations.

Selective Harmonic Elimination Problem Formulation.
As previously mentioned, the cascaded H-bridge multilevel topology integrates several H-bridge modules with isolated dc sources connected either in series or parallel, as seen in Figure 1. e mathematical relationship between the isolated dc sources (s) and the number of levels (n) is defined as n � 2s + 1.
(1) e number of power devices semiconductors N sw can be calculated by whereas the peak voltage (V p ) of the phase voltages V A− N , V B− N and V C− N can be defined as follows: Figure 2 illustrates the staircase waveform output for a 3 phase n-level MLI and its functional relationship with the number of switches and switching times, whereas in Figure 3, the typical staircase phase voltage (V A− N ) waveform output for a MLI with isolated sources is also illustrated, where the switching angles are subject to Additionally, the mathematical representation of Figure  3 is described as in the following equation:  Figure 2: General representation and operation of a 3ϕ phase voltage of an n-level multilevel inverter. e Fourier series expansion of the output multilevel inverter presented in Figure 3 can be defined as follows: Due to the nature of the waveform and the quarter wave symmetry, the dc component A 0 and the Fourier coefficient A n will be both equal to 0. erefore, the equation can be rewritten as follows: Substituting equation (5) in (7), the Fourier series expansion of the MLI staircase output waveform is defined as follows: 4V dc nπ cos nα 1 + · · · + cos nα n , for odd n, 0, for even n.
In this work, as a case of study, a 3ϕ eleven-level multilevel inverter is selected.

Black Widow Optimization Algorithm
In this section, the inspiration of the proposed method is first discussed. en, the mathematical model is provided.

Biological Fundamentals.
e western black widow spider (Latrodectus hesperus or L. hesperus) is a venomous spider species found from western Canada to southern Mexico. e venom, present in female black widows, contains a potent neurotoxin active against a range of animals. Furthermore, the said venom is one of the most dangerous for humans given that just one bite can cause death. ese spiders feed on insects such as cockroaches, beetles, and butterflies; they weave their web in trees and inhabit forests and swamps. Males, who use sex pheromones to discern female mating status, are known to show no interest in mating with starving and poorly fed females, as females can exhibit cannibalistic behavior. Further details about the black widow spiders' behaviour can be found in [31,32].

Mathematical Model.
In this section, the mathematical model of spiders' different movement strategies for courtship-mating and the pheromone rate is first provided. Afterwards, the black widow algorithm is then proposed.

Strategy: Movement and Pheromones
(1) Movement. As part of the moving strategies, the spider's movements within the web were modelled as linear and spiral, as described in equation (11)  x (2) Pheromones. Pheromones perform a very important role in the courtship-mating of L. hesperus spiders. In [31], the link between the spiders diet and the change in pheromone signals that affects the quality and quantity of silk is shown. In other words, well-fed female spiders produce more silk than hungry females. Male spiders are more responsive to sex pheromones from well-fed females, as they provide the benefit of having higher fertility, but primarily to avoid the cost of risky mating attempts with a likely hungry cannibal female. at is, male black widow spiders prefer to avoid cannibalism rather than seek for more fertile females. Sex pheromones alone can provide an insight into the recent feeding history of females, possibly reducing costs for males expressing their choice in the field. erefore, female spiders with low pheromone rates are not preferred by male spiders. On this research, the black widow spiders' pheromone rate value is defined in the following equation: where fitness max and fitness min are the worst and the best fitness value in the current generation, respectively, whereas fitness(i) is the current fitness value of the ith search agent. e pheromone vector, in equation (12), contains the normalized fitness in the interval of [0, 1]. For low pheromones rates values equal or less than 0.3, equation (13) is applied in Algorithm 1. Low pheromone levels in a female spider represent a hungry cannibal spider. erefore, if they are present, the said female spiders will not be chosen but will be replaced for another one: where x → i (t) is the search agent (female spider) with low pheromone rate that will be updated. r 1 and r 2 are random integer numbers generated in the interval from 1 to the maximum size of search agents (spiders), with r 1 ≠ r 2 , whereas x → r 1 (t) and x → r 2 (t) are the r 1 , r 2 th search agents selected, x → * (t) is the best search agent found from the previous iteration, and σ is a binary number randomly generated in Algorithm 2, σ ∈ 0, 1 { }.

(3) Pseudocode and Computational Complexity of the BWOA
Algorithm. e pseudocode of the BWOA is explained in Algorithm 3. Important aspects to mention about the algorithm are that it does not require more parameters to run than the size of the population (search agents or female spiders) and the number of iterations. On each iteration, the values of m (linear movement) and β (spiral movement) vary, as described in line 4 of Algorithm 3, where both randomly generated variables are inside the main while loop. In order to update the whole population, the low pheromone criterion (line 10 and 11) helps the algorithm to get a second chance to improve the fitness quality before the next iteration. In terms of the spider's biological behavior, it is used to represent cannibalism in female spiders, or the nonselection of females by male spiders, due to their low pheromone levels. ese strategies and rules provide a fine balance between the intensification (exploitation) and diversification (exploration) over the search space (Algorithm 3).

Experimental Setup
In order to prove the effective elimination of the desired harmonics, the BWOA algorithm is compared against the Whale optimization [26] and the Modified Grey Wolf algorithms [25]; the state-of-the-art algorithms were recently applied in the selective harmonic elimination technique. In all three algorithms, the optimization parameters were run for 200 iterations and a population size of 100.
Additionally, the Black Widow Optimization Algorithm was also implemented for a smaller number of iterations and population sizes (100 and 15 respectively). Generally speaking, for population sizes ≤ 25, algorithms are considered as microalgorithms (μ-algorithms).
ese algorithms have been widely applied due to their ability to give good results in applications that have restrictive hardware requirements [33].
In order to verify the reliability of the calculated optimal angles, a Matlab/Simulink simulation is implemented to generate the staircase output waveform and to perform a Fourier analysis. As illustrated in Figure 5, first, the best found angles are fed to the Fourier analysis and staircase waveform generation module (FASWG) for an off-line    (14) x * � x new (15) end if (16) iteration � iteration + 1 (17) end while (18) Display x * , the best optimal solution (19) end procedure  Figure 5: Simulink implementation to calculate the total harmonic distortion (THD) for the best angles determined by the black widow optimization algorithm. 6 Mathematical Problems in Engineering calculation and then, the total harmonic distortion (THD) and the Fourier spectrum are displayed to verify the correct elimination of the desired low order harmonics.
All computations were carried out in MATLAB R2018a on a standard PC (Linux Kubuntu 18.04 LTS, Intel core i7, 2.50 GHz, 16 GB).

Results and Discussion
As previously described, the black widow optimization algorithm results are compared against the whale optimization (WOA) and modified grey wolf optimization (MGWOA) algorithms. e near-to optimal firing angles at 3 modulation index (0.6, 0.8, 1.0) are typically achieved by multilevel inverters, and their respective fitness and total harmonic distortion values are given in Tables 1-3, respectively. It can be seen that the values obtained from BWOA outperform the WOA and MGWOA results regarding fitness and THD in all cases.
Additionally, the BWOA was run at smaller optimization parameters as a microalgorithm (μ-BWOA) with a population size of 15 and a number of iterations of 100, converging faster with an acceptable solution. In order to determine the reliability of the BWOA and the μ-BWOA algorithms, the near-to optimal angles are fed to the FASWG calculation function. Figures 6 and 7 show the Fourier transform results using the data from Tables 1 and 4, respectively. It can be seen that, for both cases, BWOA and μ-BWOA, the calculated firing angles eliminate the desired low order harmonics previously selected.
us, in terms of a physical implementation of an 11level multilevel inverter, the μ-BWOA can also be used to solve the SHE set of equations even in a low-specification hardware. So far, this is the first report for solving the SHE technique with a microalgorithm.
Following the simulation validation of the near-to optimal calculated angles, Figure 6, also shows the 3ϕ line voltage output waveform for modulation indexes of 1.0, 0.8, and 0.6 with a 100 sV dc voltage. Moreover, it can also be seen as a low overall THD at higher modulation indexes, as depicted in Figures 6(d)-6(f ), respectively. Figure 8 shows  Mathematical Problems in Engineering the simulated 3ϕ line voltage (a), the output current for a pure resistive 10 Ω load (b), and a resistive-inductive 10 Ω-31.8 mH load (c) for a modulation of index of 1.

Conclusions
In this paper, a novel bio-inspired algorithm based on the spiders' different movement strategies for courtship-mating is presented as an alternative method to solve the selective harmonic elimination problem. e black widow optimization algorithm was tested against the state-of-the-art algorithms previously used to solve the SHE technique, demonstrating its ability to get optimal (or near-to optimal) values. e simulation results show that the optimized angles can effectively remove the fifth, seventh, eleventh, and thirteenth harmonic of a three-phase eleven-level MLI.
is paper also considers using the black widow optimization algorithm with low population parameters as a microalgorithm. As far as the authors' knowledge, this condition has never been applied to solve the SHE problem before. Initial simulations show competitive results eliminating the preselected harmonics. is enables the BWOA to be run efficiently in an embedded system with low hardware requirements, as it can get close to optimal switching angle solutions with small population size and number of iterations. Future research will include in-depth analysis of BWOA for microalgorithm purposes, a physical implementation of the MLI, and a study comparing the different objective functions reported in the literature.

Data Availability
No data were used to support the findings of the study.

Conflicts of Interest
e authors declared no potential conflicts of interest with respect to the research, authorship, funding, and/or publication of this article.