Accurate Thd Formulas for Multilevel Inverters with Milp Optimization

This study aims to derive simple formulas for calculating the accurate Total Harmonic Distortion (THD) of Multilevel Inverter (MLIs), that considers all low and high order harmonics, for single phase and three phase MLIs., since the THD is a main criterion when judging the performance of a MLI. In addition, a formula for the percentage route mean square value of high order harmonics %V HOrms is derived. These formulas could be applied for all types of MLIs that use different switching techniques for harmonics elimination or reduction, so long as the switching angles of the phase voltage are known and it is specially suitable to be applied with the Mixed Integer Linear Programming (MILP) optimization model, which is constructed for determining the switching angles of the MLI that minimize the absolute values of any undesired harmonics. This study aims also to show that this MILP model can produce solutions that have low values of the accurate THD, by giving the detailed solutions of two cases taken from the references.


INTRODUCTION
The Multilevel Inverter (MLI) has recently replaced the conventional inverter, due to its multilevel output voltage that can approach more closely a sine wave shape (Sing et al., 2012).MLIs are covering now many practical applications, such as for the control of ac electric drives (Dixon et al., 2010;Ge et al., 2010;Khoucha et al., 2011), for photovoltaic systems (Cecati et al., 2010;Rahim et al., 2011), for high power ac gird (Gultekin et al., 2012) and more recently for renewable energy and smart grid integration (Wanjekeche et al., 2011;Zhong and Hornik, 2012).Many types of MLIs have been developed (Malinowoki, 2010), which emerge mainly from three main types: diode clamped MLIs, flying capacitors MLIs and cascaded MLIs. Figure 1 shows, two examples of MLIs, a flying capacitor MLI and a general single phase cascaded MLI with unequal dc sources.
Figure 2 shows the waveforms of the output voltage produced by the flying capacitor MLI of Fig. 1a and by a seven level single phase cascaded MLI.The output voltage waveform of a MLI generally approaches a sine waveform, but still consists of many undesired harmonics.
A fundamental issue for a CMLI is to find the switching angles (times) of the inverter H-bridges semiconductor power switches that produce the required fundamental voltage and at the same time eliminate or reduce the values of undesired specific low order dominant harmonics.Many methods are given in the literature for obtaining the switching angles of CMLIs.These are mainly: • Using sinusoidal pulse width modulation (Carnielutti et al., 2012;Leon Seyezhai and Mathur, 2010; Sujanarko • Using a selective harmonic elimination technique, where the zero equations of the undesired harmonics with the equation of the desired amplitude of the maim harmonic as functions of the switching angles are solved directly or by applying genetic algorithms ( Ahmadi El-Hamrawy et al., 2010;Filho Kavousi et al., 2012;Napoles et al., 201 • Using the method of minimizing the total harmonic distortion (Kumar et al., 2009;et al., 2012) In addition, the author has introduced an optimization method based on applying a Mixed Integer Linear Programming (MILP) optimization determine the switching angles that minimize the values of any undesired harmonics (El-Bakry, 2009 In all these methods, low order harmonics are mainly considered and high order harmonics are not taken into consideration However, it may to consider eliminating or reducing low order harmonics.It is important to know the amount of all the harmonics of the MLI, since high order harmonics lead to additional losses and may cause disturbances and need additional filtering.Using sinusoidal pulse width modulation ., 2012; Leon et al., 2011;Seyezhai and Mathur, 2010;Sujanarko et al., 2010) Using a selective harmonic elimination technique, where the zero equations of the undesired equation of the desired amplitude of the maim harmonic as functions of the switching angles are solved directly or by applying genetic algorithms ( Ahmadi et al., 2010;., 2010;Filho et al., 2013; ., 2013) Using the method of minimizing the total harmonic ., 2009; Yousefpoor In addition, the author has introduced an ed on applying a Mixed Integer ng (MILP) optimization model to angles that minimize the values Bakry, 2009Bakry, , 2010)).In all these methods, low order harmonics are mainly considered and high order harmonics are not taken into consideration However, it may be not enough to consider eliminating or reducing low order harmonics.It is important to know the amount of all the harmonics of the MLI, since high order harmonics lead to additional losses and may cause disturbances and Actually, the IEEE standard for voltage distortion limits in power systems IEEE (1993) put limits on the exact THD of power systems., which assures the importance of knowing the exact THD of MLIs., which considers both low order and high order harmonics produced .
In this study, simple formulas are derived for calculating the exact THD, which are simpler than that given by Farokhnia et al. (2011) and for c route mean square (rms) value of high order harmonics.V HOrms .Two cases are considered, single phase MLI and three phases MLI.The derivation of these formulas depends on the same idea used by the author when applying a MILP model for determining the switching angles of the MLI.This idea depends on dividing the time interval of the output voltage into small equal subintervals such that a certain voltage level is associated with each subinterval.The derived formulas of the exact THD could be applied directly to the solution of the MILP model.Two cases taken from the references are analyzed and show low values of the obtained exact THD.

DERIVING A FORMULA FOR CALCULATING THE EXACT THD OF A SINGLE PHASE MLI
The general output voltage wave single phase MLI has a quarter wave symmetry, as that shown in Fig. 2. The pattern of this function is generated by on and off switching of the inverter H bridges semiconductor power switches and is completely determined by defining the sw pattern over the interval 0≤wt≤π/2.The basic approach depends on dividing this interval into N equal small subintervals, starting at the angles 0, τ, 2 τ, ., (I till (N-1) τ., where, τ = π/2N, Fig. 3.
It is assumed that a single voltage associated with each subinterval.The positive values X I , I = 1, 2, .., N are defined over each subinterval, to represent the instantaneous output voltage level value F (wt) of the inverter, so that F (wt) is defined over the interval 0≤wt≤π/2 by: ( ) ( ) Actually, the IEEE standard for voltage distortion Standard 519-1992 (1993) put limits on the exact THD of power systems., mportance of knowing the exact THD of MLIs., which considers both low order and In this study, simple formulas are derived for calculating the exact THD, which are simpler than that .( 2011) and for calculating the route mean square (rms) value of high order harmonics.
. Two cases are considered, single phase MLI and three phases MLI.The derivation of these formulas depends on the same idea used by the author when mining the switching angles of the MLI.This idea depends on dividing the time interval of the output voltage into small equal subintervals such that a certain voltage level is associated with each subinterval.The derived formulas e applied directly to the solution of the MILP model.Two cases taken from the references are analyzed and show low values of the

DERIVING A FORMULA FOR CALCULATING THE EXACT THD OF A SINGLE PHASE MLI
The general output voltage wave form F (wt) of a phase MLI has a quarter wave symmetry, as that shown in Fig. 2. The pattern of this function is generated by on and off switching of the inverter Hbridges semiconductor power switches and is completely determined by defining the switching π/2.The basic approach depends on dividing this interval into N equal small ngles 0, τ, 2 τ, ., (I-1) τ, .. 1) τ., where, τ = π/2N, Fig. (1) The THD is usually calculated till a specific harmonic of order 2k+1 using the expression: (2) The exact THD must include all the harmonics as given by: (3) The values of the amplitudes of the main harmonic V 1 and the subsequent harmonics V 2k+1 could be replaced by their route mean square (rms) values, getting: (4) The rms value of the output voltage V rms is given by: The expression for the exact THD is thus: The value of V rms is obtained from the waveform shape of the output voltage, referring to Fig. 3 and is given by: Due to the quarter wave symmetry of F (wt), the value of V rms could be obtained from the first quarter half cycle: (8) The expression for the exact THD is thus given by: (9) If the values of the exact THD and of the THD till the harmonic 0f order 2k+1 THD 2k+1 are determined, then the rms value of high order harmonics V HOrms for the harmonic of order 2k+3 till ∞ relative to V 1rms is obtained as follows: And then: (10)

DERIVING A FORMULA FOR THE EXACT THD OF THE LINE VOLTAGE OF A THREE PHASE MLI
It is required to determine the exact THD of the line voltage of a three phase MLI, given the switching pattern of the phase voltage.Referring to the time orientation of phase voltages given in Fig. 4, let the instantaneous value of phase 1 be F (wt), as defined by Fig. 3.The instantaneous value of a line voltage between phases 1 and 2 F L (wt) is given by: (wt) F(wt) F(wt 2 / 3)............( 11) From Eq. ( 1), the amplitude of the line voltage harmonic of order 2m+1 is deduced to be: The odd triplen harmonics, i.e., that correspond to 2m+1 = 3, 9, 15,.., ∞ are self cancelled and this distinguish the value of the THD of the line voltage from that of the phase voltage.
For calculating the THD of the line voltage and referring to time axis of Fig. 4, F (wt) has a quarter wave symmetry, but F (wt -2π/3) and hence F L (wt) ( )

:
The Fourier series expansion of F wt is an odd sines series given by −  10) To calculate the value of V rms for F L (wt) using Eq. ( 12), the instantaneous time values of F L (wt) in terms of X I must be considered over a half wave interval .
In the following derivation it will be assumed that the number of subintervals N is an integer multiple of 3, such that N/3 is an integer number.
The instantaneous values of phase 1 voltage over the first quarter cycle are given by F (wt) = X I , for I = 1, 2,…, N.
The instantaneous values of phase 2 voltage F (wt-2π/3) over the first quarter cycle are given by Y I , where the values of Y I from I = 1 to I = N/3 equal the negative values of X I from 1+2 N/3 to N, respectively.The values of Y I from N/3+1 to N equal the negative values of X I from N to N/3, respectively, i.e.: (13) Dividing the time interval over the second quarter, that correspond to an angular value from π/2 to π, into N equal subintervals, as the first quarter interval, the following values are deduced: The instantaneous values of phase1 voltage over the second quarter cycle are F (wt) = XX I , where: The instantaneous values of the line voltage F L (wt) over the first half cycle are thus given by Z I where: 1, 2, ..., 1, ...., 2 ..( 16) The value of V rms of the line voltage is given by: (17) The expression of the exact THD of the line voltage is thus given by: The value of V HOrms of the high order harmonics for the line voltage is still given by Eq. ( 10), with the THD substituted from Eq. ( 18).

OBTAINING THE VALUES OF X I USING A MILP OPTIMIZATION MODEL
The obtained expressions for the exact THD require a previous knowledge of the values of the voltage levels X I over equal subintervals of the quarter cycle of the main voltage.These values could be obtained when applying any of the methods that determine the switching angles of the MLI under certain elimination or reduction conditions on the low order harmonics.If the obtained switching angles have decimal fractions, then applying the deduced expressions for the THD may require dividing the ( 2 / 3 ) ( 4 / 3 ) .. forI 1, 2, ...., / 3 .. forI (N / 3) 1, .., ..( 13) quarter cycle into very large number of subintervals and the calculations on the computer may take long time and thus an approximation may be an adequate solution.However, the author has introduced an optimization model using Mixed Integer Linear Programming (MILP) that determines directly the values of X I that minimize any undesired harmonics and satisfy the required constraints (El-Bakry, 2009, 2010).Actually, this model has many advantages over other harmonic reduction methods (El-Bakry, 2013).
In this model the Fourier series coefficient V 2m+1 of F (wt) in Eq. ( 1) as function of X I is deduced as: The amplitude of the main harmonic corresponds to V 1 , i.e., by substituting m = 0 in Eq. ( 19).This equation shows that V 2m+1 for any value of m is a linear function of X I , I = 1, 2, …, N.
The MILP model determines the values of X I that minimize the values of the undesired harmonics according to the optimization relations: In the main harmonic constraint (20), V' 1 is the required amplitude of the main harmonic.∆ is a small incremental value, ∆<<V' 1 , arbitrary chosen and included in the main harmonic constrain to ensure obtaining an optimum solution, since an equality constraint may give a high value of ε or even an unfeasible solution., due to the trigonometric nature of the constraints.The value of ∆ is taken a very small fraction of V' 1 , so that the obtained value of V 1 does not differ practically from the required value of V'1.
In constraint (21) V 2m+1 is given by Eq. ( 19), for V 1 and the undesired harmonics and α 2m+1 is a weighting factor for the undesired harmonics, to enable reduction of the absolute values of the harmonics with different upper bounds according to their order.Constraint ( 22) is the integer constraint on X I .
Additional constraints on X I may be added according to the nature of the problem.Some examples of these additional constraints are: If the MLI has uniform steps output voltage, with possible voltage levels 0, E, 2E, ..., LV E, where LV is the number of positive levels, the values of X I normalized w.r.The value of p IJ will take the values 0, 1 or 2 according to whether E J is subtracted, not considered, or added in the expression of X I , respectively.
If the MLI is a cascaded MLI with a staircase output voltage waveform, similar to that in Fig. 2b, where LV is the number of positive levels, then X I must satisfy (El-Bakry, 2010): Once all the parameters of this MILP model are given, an optimum solution could be obtained that gives the values of X I and ε using any of the well known operations research software packages, e.g., "LINGO" software (LINDO Systems Inc., 2004).
In the next section two cases taken from the references are solved in details to show the advantages of this model.

CASE 1: A THREE PHASE CASCADED MLI WITH EQUAL DC SOURCES
Bin Nasr et al. (2010) considered eliminating the 5 th , 7 th , 11 th and 13 th harmonic in an 11-level three phase cascaded MLI with equal dc sources.The following switching angles are obtained for the subsequent five positive levels in the first quarter cycle of the staircase output voltage waveform, similar to that of Fig. 2b: The reference reported a total harmonic distortion given by 8.33%.

Calculating the exact THD:
To apply Eq. ( 18) for calculating the exact THD of the line voltage, the quarter cycle is divided into N = 180 subintervals, such that each subinterval occupies 90/180 = 0.5°.The five switching angles are approximated, such that each subinterval takes single voltage level, to be: The software used in this study calculates the following values: • The amplitude of the phase voltage main harmonic V 1 • The exact THD of the line voltage • The percentage value of the rrms value of high order harmonics from the 95 th harmonic %V HO relative to the rms main harmonic • The value of THD 91 of the line voltage calculated till the 91 st harmonic, using Eq. ( 2) for the nontriplen odd harmonics from the 5 th till the 91 st harmonic • The maximum percentage absolute amplitude among all the non-triplen low order harmonics till the 91 st harmonic %V hm relative to the main harmonic amplitude The obtained results are: V 1 = 5.29 (normalizes w.r.t., the inverter dc voltage) %THD = 6.3% %V HO = 2.87% %THD 91 = 5.6% %V hm = 2.46% In addition, the recorded percentage values of the 5 th , 7 th , 11 th and 13 th harmonics relative to the main harmonic are -1.42,0.71, 1.69 and 0.65%, respectively.These low values replace the zero values assumed by the harmonic elimination method, due to the approximation made in the switching angles.• Adding constraints ( 22), ( 23) and ( 25), with the number of levels LV = 5 Figure 5 shows the obtained values of the amplitude of the line voltage V L and the values of %THD, %V HO , %THD 91 and %V hm , as defined before, for different values of m, minimizing all the harmonics, from the 7 th till the 29 th when minimizing the harmonics equally.Figure 6 shows the same values when minimizing these harmonics with increasing weight.
It is clear from Fig. 5 and 6 that the values of % THD and % THD91 are close to each other.The lowest THD is obtained by minimizing the low order harmonics with increasing weight till the 13 th harmonic.This solution has the values: V L = 9.06, normalized w.r.t., the input dc voltage: %THD = 5.44% %V HO = 2.14% %THD 91 = 5.0% %V hm = 2.61% For this solution, Fig. 7 shows the obtained values of XI over the first quarter cycle.The voltage levels take the values 1, 2, 3, 4 and 5 corrosponding to the switching angles Θ 1 = 4.5°, Θ 2 = 14°, Θ 3 = 29°, Θ 4 = 40° and Θ 5 = 60°, respectively.Figure 8 shows the obtained values of the low order harmonics till the 91 st harmonic and a 5% of the main harmonic.V dc1 = 3, V dc2 = 2.5, V dc3 = 2, V dc4 = 1.5, V dc5 = 1 and all values are normalized w.r.t., a referenced voltage E.
Calculating the exact THD: Applying Eq. ( 18) to calculate the exact THD of the line voltage corresponding to the above switching angles, it is enough to take the number of subintervals N = 18, such that each subinterval has a width of 5°.
For given switching angles, the following values are obtained for the quantities defined before: V 1 = 10.257(normalized w.r.t., the reference dc voltage) %THD = 7.9193% %V HO = 2.4261% %THD 91 = 7.5385% %V hm = 4.7322% The calculated THD agrees with Farokhnia et al. (2011).24) in the MILP model will introduce many redundant levels, i.e., levels with the same value obtained by different values of the dc sources and will cause the software program to go into large number of loops without improving the solution and this increases greatly the solution time.To avoid this, constraints (24) are replaced by the constraints, for I = 1, 2, N: If Q I takes the value 0, then X I can take one of the integer values 0, 1, .., 10.While if Q I takes the value 1, the X I can take one of the values 0, 5, 1.5, …, 8.5.There will be no redundant levels.
In addition to this constraint, the main constraints (20), ( 21), ( 22) and ( 25) are included into the MILP model.The model is solved to minimize the harmonics of order 5, 7, 11,… till 31 equally.Table 1 gives the obtained values of V L , %THD, %V HO , %THD 91 and %V hm as defined before, when taking the number of subintervals N = 18, 36, 45 and constraint (20) to be 9.75≤V 1 ≤10.75.
Increasing the number of subintervals N may lead to solutions with lower THD.However, the obtained values corresponding to N = 45 are very satisfactory, since they satisfy IEEE standard 519-1992 (1993) for voltage distortion limits in power systems,, which puts upper limits of 2.5 and 1.5% for %THD and %V hmax respectively, where %V hmax is the maximum percentage absolute amplitude among all the harmonics from the 5 th till ∞, for output voltages between 69 and 161 kv.
Figure 11 shows the obtained values of the low order harmonics till the 91 st harmonic and a 2% of the main harmonic.

CONCLUSION
This study has derived simple expressions for calculating the exact THD of MLIs, which are much simpler than that derived by Farokhnia et al. (2011).
The derivation of these formulas depends on dividing the quarter cycle of the time interval of the output voltage into a large number of equal subintervals and associating with each subinterval a certain single voltage level value.These formulas could be applied for MLIs that applies any harmonic elimination or reduction technique, so long as the switching angles of the phase voltage are known and it is specially suitable when applying a Mixed Integer Linear Programming (MILP) model for determining the switching angles that minimize the values of any undesired harmonics, since it takes the values of X I directly from the model solution.
Two examples taken from the references are analyzed.In the first example the exact switching angles are approximated to the nearest half angle to enable dividing the quarter cycle of the time interval of the output voltage into N = 180 subintervals, each with a single voltage level.However, this approximation has affected slightly the values of the output harmonics and their corresponding THD.This shows that the derived formulas could be applied even with switching angles that have decimal fractions.The obtained exact THD by solving the MILP model is less that given in the reference.
In the second example a cascaded MLI with unequal dc sources is considered.A MILP model is applied to solve this problem, that enables switching on one or more of the dc sources positively or negatively during the positive quarter cycle of the output voltage while keeping positive voltage levels.By this way the number of positive levels increases greatly and as a result the exact THD is reduced.
A solution of the model gives an exact % THD = 2.08%, compared to an exact THD = 7,919% given in the reference.The solution obtained satisfies the IEEE standard 519-1992 for voltage distortion limits in power systems, which puts upper limits of 2.5 and 1.5% for %THD and %V hmax , respectively for output voltages between 69 and 161 kv.
Fig. 1: Examples of MLIs (a) The line voltage of the flying capacitor MLI of Fig. 1a level cascaded MLI of MLIs

•
Solution using the MILP model: The MILP model is applied for the 11-level three phase cascaded MLI given by Bin Nasr et al. (2010), using the following assumptions: Taking the number of subintervals N = 180 • Taking constraint (20) to be 5.2≤V 1 ≤5.6 • Constraint (21) is considered in two cases: o Minimizing low order harmonics equally from the 5 th harmonic till the harmonic order 2m+1, for different values of 2m+1 from 7 till 29 i.e., taking α 2m+1 = 1 for these values of 2m+1: o Minimizing low order harmonics with increasing weight, i.e., taking α 2m+1 = 2m+1, for different values of m from 7 till 29

Farokhnia
et al. (2011) calculated the exact THD of the line voltage of an 11-level three phase cascaded MLII with the following values of the dc sources per phase:

Table 1 :
Solutions with different values of N