Approximate Algorithm for Determining Pulse Edges of a PWM Inverter Based on Natural Sampling

The paper presents a new algorithm for determination of pulse edges of a modulated wave of a PWM voltage inverter which offers a possibility that natural sampling is realized with an arbitrary accuracy without applying an iterative procedure. The basic idea is to express the angles which determine pulse edges of the modulated signal as polynomials of amplitude modulation index. Geometric interpretation of sampling of the polynomial algorithm is identical with the geometric interpretation of natural algorithm, but the transcendental equation whose solution defines pulse edges of the modulated signal is replaced by a simple procedure of finding values of a polynomial whose coefficients are determined in advance by an exact procedure. This approach gives the possibility of digital implementation of polynomial sampling method using the low-cost microprocessor platforms.


Introduction
Pulse width modulation is an important method of the technique of control of power converters.At the current technological level, three areas within the pulse width modulation possess certain autonomy as regards the accomplished solutions 1 .These are switching strategy of pulse width modulation, concerned with generation of edges of switching pulses 2-10 , range of regulation of amplitude of the fundamental harmonic of inverter output voltage 11-15 , and degree of harmonic distortions of inverter output voltage and current 16-21 .The first PWM techniques are based on the method of the modulating function.
The modulating function contains information regarding the desired waveform, whereas the signal carrier contains information concerning the switching frequency.Pulse edges of a modulated signal are determined by crossings of the modulating function and signal carrier, which makes the basis of all analog implementations of the modulating function methods involving natural sampling.Signal at the output of a pulse width modulator defines the switching function of the inverter branch which controls the on-state of the switch within the branch.Synthesis of the ac voltage at inverter's output, regulation of the amplitude, and frequency are accomplished by the switching actions in inverter branches.
The basic PWM method is related to the mode of determination of pulse edges.Determination of pulse edges based on crossing of the modulating and carrying signals belongs to the group of natural sampling techniques.
The basic shortcoming of the natural sampling technique is tied to the transcendental relation which connects the angles determining pulse edges and modulating function.This aggravated the application of natural sampling technique in digital and microprocessor systems applying PWM methods.
Regular sampling method is the basic solution for digital realization of the modulating function method.The regular sampling method is considerably more flexible since the modulating function is specified at discrete points; thus it is possible to calculate its values in advance and interpret them by means of digital words 5, 6, 22 .The natural sampling method has the advantage over the regular method in so far as the harmonic content linearity, and range of regulation of the amplitude of the fundamental harmonic are concerned.
Middle of the eighties marks the beginning of the application of the space vector modulation as the vector approach to PWM for three-phase inverters.The basic advantages of SVM are related to the following.
i Expanded linear range of modulation without injection of the third harmonics into the sine modulating function 23-25 .ii Lower harmonics content in relation to the regular methods based on the sine modulating function 26 .
iii Lower switching losses are conditioned by only one change of state 24,27 iv Simple digital implementation 28, 29 On the other side in the papers 30, 31 , it is shown that the conventional method of SVM is equivalent to the regular method with modified sine-triangle uniform sampling PWM with triplen harmonic injected.In the papers 32, 33 a detailed analysis of carrier based PWM methods is given and their relation with the space vector approach as well.Using the simple transformations, modulating functions translate from the time domain to the complex domain, where the reference vector rotates with the angular speed equal to angular frequency of time modulating functions.
Finally, in the paper 34 it was demonstrated that the calssical method SVM is identical with the method of modulation sine function injected with triplen harmonics and regular sampling technique.
Taking into account the relevant literature 34-36 , we propose an aproximate algorithm for PWM sampling according to the modulating function method.Unlike some other works, in which the natural sampling method was rejected 2, 3, 15 , we have accepted the elements of this technique but have substituted the transcendental equation by an algebraic expression derived, applying an exact procedure.

Modulating Function Method
General characteristic of this group of methods is that the synthesis of the pulse at the output of the modulator is carried out on the basis of the reference signal and signal carrier.
The reference signal is a periodic function having the frequency equal to the fundamental frequency of the inverter output voltage and amplitude which is proportional to the amplitude of the fundamental harmonic.The modulating function is analytical representation of the reference signal.In general, this is a function of the following general form 37 : Parameter M stands for the modulation amplitude index, and parameter ω for the fundamental frequency of inverter ac voltage Function F M, ωt can be continuous or discontinuous having first-order interruptions in terms of M 38 .However, a great number of modulating functions is of the following simpler form: In classical PWM methods the carrier signal is an ac signal of triangular half-periods, of frequency f c , and amplitude equal to one.The ratio of the carrier signal frequency and the reference signal frequency determines the frequency index of modulation.In cases when this is an integer, this index is pulse number p which is characteristic for the synchronized methods of modulating function.Onother class of these methods is characterized by a continuous variation of the fundamental frequency for a constant frequency of the carrier signal.In this case, owing to nonperiodicity of pulses, appearance of subharmonics is possible having particularly harmful influence on the load at lower fundamental frequencies.
The basic characteristics of the signal at modulator output, irrespective of the method of edge determination, are the binary form and modulated width.They are transferred to the states of switching elements by means of the switching function.
Pulse edges at modulator output are most frequently determined by the natural or regular sampling method on the basis of the reference and carrier signals.
In case of a three-phase inverter modulation function may contain, in addition to the basic component, components of the order 3kth which neutralize across the load.Application of the vector modulating function 23 extends the amplitude range.

Regular Sampling Method
In the regular sampling method the reference signal is discretized, and the pulse edges are determined by comparing the carrier signal with the reference signal modified in this way, which implies a digital realization of the method.Therefore, the regular sampling method has the advantage that microprocessor control is possible compared to the natural sampling method where the pulse edges should be determined by iterative solution of the transcendental equation obtained from the condition for crossing of the reference and carrier triangular signals.Figure 1 presents the synthesis of the output voltage of a half-bridge inverter by applying the modulating function method and regular sampling.The interval of 2π radians corresponding to the period of the modulating function will be divided in p intervals of length Δα 2π /p, as shown in Figure 1.Denote the center of kth interval by α k .At these points modulating function m α k is discretized to a set of p values which are compared with a triangular signal carrier of the frequency equal to the switching frequency of the inverter.The average value of the switching function of the inverter branch is The pulse edges centered at α k are

2.4
Switching function α k ωt of the half-bridge is fully determined if the angles of the pulse edges are known.From 2.4 it can be concluded that for complete determination of the switching function, it is necessary to determine p pulse widths which correspond to the cycle of the switching frequency.Alternative voltage at the output is determined by means of switching function α ωt by the following expression: u A0 U d a ωt − 0.5 .

2.5
The voltage waveform u A0 represents a copy of the periodic sequence of modulator output pulses.This voltage may be expressed using the Fourier series: where

2.7b
If the carrier frequency is considerably higher than the reference signal fundamental frequency ω c > 15ω , the following approximation is possible in the lower range of the harmonic spectrum: By transforming expressions 2.2 and 2.3 using relation 2.8 , we find Expressions 2.9 and 2.10 show that the lower part of the harmonic spectrum of inverter output voltage corresponds to the reference signal frequency spectrum with a scale factor of M/2.From 2.9 and 2.10 one calculates the current distortion factor 12 , which is one of qualitative indexes of a PWM inverter:

2.11
C 1 and C n are amplitudes of the fundamental and nth harmonic of the inverter output voltage.
Regulation amplitude factor is defined in 13 as a ratio of the maximum output voltage of PWM inverter U l−lmax and imput DC voltage U d .

Space Vector Modulation and Relation with Modulating Functions
The basic elements of PWM using the method of modulating function are reference signals which represent mapping of defined phase voltages on three phase loads of inverters and carrier signal which determines switching frequency of inverter's branch.These elements are necessary for the synthesis of the switching function a; b; c of the branch three-phase inverter, and these functions are linearly related to the phase and line AC voltages:

2.13
Differently from this, phase approaches to modulating, the basic elements of SVM are reference voltage vectors and switching state of inverter.Reference voltage vector is given using the transformation of phase voltage A, B, C systems on AC load of inverter into the rotating voltage vector in αβ system using the equation of the transformation 2.14 , the geometrical interpretation of which is shown in Figure 4: 1 e j2π/3 e j4π/3 * u A,B,C 3×1 .

2.14
It is possible to realize eight different switching states of inverter and corresponding space vectors which are given by the formula 2.15 depending on the position of the switching elements in the branches of that inverter: The area Figure 2 which is placed between the vectors u s k i u s k 1 determines kth switching sector of the reference voltages vector.There are six such switching sectors, and each of them is divided into N c of switching segments shadowed part in the Figure 2 .
The essence of PWM using the method of space vector is in approximation of average value of reference rotating vector inside the switching segment T c using two active vectors 2.15 which map the state of the inverter switch.Thus, it follows where T k , T k z are the times which correspond to switch states k and k z.If it is assumed that the reference vector inside the switching sector is invariable, then it follows with T k T k z ≤ T c .Thus, it follows that the time difference between the switching cycles and the time which corresponds to the states k and k z of inverter is complemented with time in which inverter takes the state 0 or the state 7 without changing of average value of the reference vector:

2.18
The way in which the zero states are inserted into the switching segment defines the basic characteristics of the modulation.By the conventional method of space vector the equal parts of both zero states are inside the switching sector.Also, the sequence of successive switching states is formed of contiguous vectors u s k and u s k 1 .
Although the method of space vector may initially seem radically different from the method of modulating function, it is possible to construct a modulating function starting from the SVM method and vice versa.During the construction of the modulating function, it is first necessary to define the locus of the space vector.If the referent space vector is defined by the formula then this trajectory is a circle as shown in Figure 2. Continual vector modulating function which is derived from the classic method of SVM is acquired in the following way.
Inside each sector the switching segment is formed as a symmetrical sequence of switching states formed of consecutive vectors.By applying this principle to the times active consecutive vectors states, the times of active and zero states in kth sector are found:

2.20
The switching segment in kth sector is arranged in accordance with the symmetry requirement and the requirement that the change of switching state is performed by changing only one coordinate.Thus, the time sequence in any segment is formed in the following way: Using the invariance property of time sequence inside the segment T c , we find the average value of switching function of inverter's branch.
On the other hand, the average value of the switching function which is obtained from the process of regular symmetrical sampling on appropriate segment is a ωt 0.5 1 F M, ωt .By balancing of this formula with the obtained average values using SVM method, we find the well-known vector modulating function:

2.22
Using the analog procedure and the possibility of the synthesis of the reference vector by nonconsecutive space vectors, discontinuous modulating functions may be found which are treated and analyzed in 32, 37, 39 .In the overmodulation range it is possible to construct modulating functions till transition in the range of six-step modulating.In the work 40 transition modulating function 2.23 is demonstrated.This modulating function is used in the range of over modulation where the trajectory of the locus space vector is partially an arc of circle and partially a side of the hexago; 23

2.24
Transition modulating function 2.23 has two boundary cases of which the first appears when x → 0, and it represents the vector modulating function 2.22 , and the second case appears when x → π/6 and represents trapezoidal modulating function.

Approximate Sampling Algorithum
In the approximate algorithm, instead of an iterative procedure for finding the angle of a pulse edge, a procedure of direct determination of an approximate solution is applied.The angle of a pulse edge is considered as function of the amplitude index of modulation, with the pulse number as a parameter, which is realistic since the amplitude index of modulation varies continuously whereas the pulse number remains constant within a single range of fequency control and varies discretely from a higher to a lower integer value.In this method the angle of pulse edge is approximated by a polynomial whose highest degree determines a measure of goodness of the obtained solution compared to the natural sampling and does not influence the applicability of the approximation.The polynomial approximations are without restrictions readily applicable to all known modulating functions and triangular carrier signal.

Mathematical Fundation of the Approximate Sampling Method
The reference signal the modulating function is specified by expression 2.2 .The carrier is a periodic ac signal of triangular half-periods.Reference and carrier signal phase positions are synchronized by a common zero.There are two possibilities leading to different values of pulse angles.In the first case, the phase zeros of half-periods of the same sign s 1 are synchronized, whereas in the second the phase zeros of half-periods of different signs s 0 are synchronized.The expression for the ith carrier segment may be written in the form

3.1
The pulse widths are determined by the solutions of the successive series of equations The modulator output signal can be synthesized if, in addition to the zero edge, the p − 1 th successive edge is also known.The remaining edges are determined from the following simple relation: However, the sequences of successive equations 3.2 are, as a rule, transcendental in nature.Instead of using the iterative procedure, which is inconvenient from both PWM signal control and synthesis standpoints, it is possible to apply an approximation procedure to obtain analytical expressions for calculating the pulse width depending on the amplitude index value.The convenience lies in the fact that the inverter output voltage amplitude and frequency regulation are performed through continuous changes in the amplitude index Mand discrete changes in the frequency index p .Thus, the angles of pulse edges are invariant with respect to variations in reference and carrier frequencies at a constant frequency index value p const. .Speaking in mathematical terms, this fact means that the frequency index p is treated as a parameter whose possible changes are discrete from one, higher, integer value to another, lower one.
It follows from relation 3.2 that from which we conclude that there exist unique analytical functions α i Φ M for which the following holds: In the neighborhood of M 0, there exist unique expansions of these functions into power series: A k i, p M k , i 1, 2, . . ., p.

3.6
Coefficients A k i, p are determined from relations The uniqueness of α i Φ M is ensured over the range, 0 ≤ M < R, where R denotes the radius of convergence of series 3.6 .In the important case when F α sin α the approximate value of the radius of convergence is R ≈ 2p/π 0.6672 • • • 41 .
The practical application of the derived expressions is possible through the approximation of series 3.6 to an N-degree polynomial with a remainder term E N i, p, M : In what follows the expression "approximate" will hereupon be replaced by "polynomial".
In practice, determination of pulse edges α i by the approximation polynomials obtained from 3.8 eliminates the iterative numerical procedure.The derived procedure for pulse width calculation, according to expression 3.8 , is a general one as it applies to any modulating function represented by relation 2.2 .For a zero amplitude index value M 0 the modulator output gives a signal whose pulses have identical angular widths.
In most of the modulating functions sine or cosine segments inside the more complex modulating function exist.This is why we will use the example of a sinusoidal modulating function to illustrate the method we propose in this work.
In this case, the series of successive transcendental equations whose solutions give the pulse edge angles is

3.9
The coefficients A k i, p calculated according to general expression 3.7 determine the measure of imbalance in angles α i due to a change in the amplitude index M.In the case of a sinusoidal reference signal, the coefficient of the kth term of the power series is given by the expression

3.10
Relation A k i, p −A k 2p − i, p provides for the symmetry of pulse angles about the halfperiod.In addition, if p is an odd number, then A k i, p −A k p − i, p holds, from which it follows that pulse edge angles are also symmetrical about the quarter-period of the reference signal.
The maximum remainder term E N i, p, M is a very complicated function of the frequency and amplitude index.It represents the measure of the deviation of the method proposed here from the natural method, and it can be investigated efficiently by comparing the values of angles obtained by applying the polynomial approximation and the iterative procedure of solving the transcendental equations 3.9 .
In the case of a sinusoidal reference signal, the first four coefficients of power polynomial obtained using relation 3.10 are

3.11d
The coefficients obtained using 3.7 for any modulating function determine polynomial formulas 3.12a -3.12d for switchning angles:

3.12d
From expressions 3.12a -3.12d it is possible to obtain the approximate solutions of transcendental equations 3.9 .In view of the phase synchronization between the reference and carrier signal, it is sufficient to apply some of the expression p − 1 times to obtain the p − 1 th successive pulse edge angle.The remaining angles are determined by simply using the symmetry property from the natural sampling method, which has been preserved in expressions 3.12a -3.12d .Using the property of the symmetry of angles about the quarterperiod of the reference signal, for an odd frequency index value, it is sufficient to apply the stated expressions and calculate the p − 1 /2 successive pulse edge angle.

Influence of Polynomial Degree to the Level of Approximation of Natural Sampling
The deviations of angles α i , i 1, 2, . . ., 2p obtained using formulae 2.13 , 2.14 , 2.15 , and 2.16 from the values found by applying the iterative procedure to expression 3.9 represent the measure of the remainder term E N i, p, M .The maximum values of absolute remainder terms for p 6, 9, 12, 15 for the amplitude index value varying from zero to one are shown in Table 1.As can be seen, polynomial approximations yield the same accuracy in determining the pulse edge angles as that achieved by applying some of the iterative numerical procedures e.g., the Newton-Raphson or Gauss-Saidel methods .However, unlike the mentioned numerical method, formulae 2.13 , 2.14 , 2.15 , and 2.16 are directly applicable in the form of a microprocessor algorithm.The symmetry properties of the PWM sequence are preserved even for the low values of frequency index p, and this permits the algorithm to be applied to the cases where the regular method shows a tendency toward degrading the harmonic and amplitude performances of inverter output voltage regulation.It can be seen from Table 1 that the maximum of remainder term is inversely proportional to the frequency index and directly proportional to the amplitude index.

Modified Polynomial Approximation by Using Chebyshev Polynomials
To achieve a higher accuracy of pulse edge with polynomial of lower order, we will apply the economization procedure by using Chebyshev polynomials 42 .In this way we obtain the following polynomials:

3.14
The use of polynomial 3.4 provides a level of accuracy whose order of magnitude corresponds to the use of a third-degree polynomial, as shown in Table 2.
When used as a PWM sampling algorithm, the modified polynomial permits computer time savings and yields a maximum error of 0.1297 degrees, which is comparable to the use of a nonmodified third-degree polynomial.The odd values of frequency index p imply the use of algorithm 3.14 .As far as the amplitude characteristic is concerned, the best results for p 9, 21, . . .are achieved with synchronized half-periods of opposite signs s 0 , whereas for p 15, 27, . . . .halfperiods of the same sign s 1 should be synchronized.These results are presented in Figures 3 and 4.
For higher pulse number values, all algorithms converge toward the same values of amplitude and distortion harmonic indicators Figures 3 and 4 .

Implementation of Polynomial Algorithm and Experimental Results
It is known that the basic characteristics of the digital implementation of the natural sampling are the iterative procedure and the work with the data in the floating point numbers format, which is a consequence of the transcendental nature of the expressions by which the angles of impulses edges are determined.Algebraic nature of the formula for the angles 2.13 , 2.14 , 2.15 , 2.16 , 3.13 and 3.14 give the possibility to replace the iterative procedure faster method of direct computing.By transition to the time domain we find the formulas which determine the position of the kth impulse inside the appropriate periods of switching frequency.The software implementation of a polynomial algorithm is achieved by simulation of the process which is shown in Figure 5 with the characteristic times determined by the following formulas which  represents the times of intersection of carrier signal and reference signal, given in the explicit algebraic form of polynome with M as the argument

5.2
In the formula 5.1 we suppose that a  way that the polynomial algorithm becomes a regular algorithm with the characteristic times, given in the following formula: The synthesis of impulses on the modulator output is performed by simulation of the process which is shown in the Figure 6.Detailed microprocessor implementation of regular symmetrical algorithm is given in 43-45 .Modern microcontrollers are equiped with integrated peripheral units designed for the synthesis of the modulated signals which control the state of switching of inverter branch.Intel's microcontroller 8XC196MC/MD is optimized for implementation of PWM using the method of modulation function 46 .It contains the generator of the modulated signal which significantly simplifies the programe implementation of selection algorithm and reduces the need for external hardware devices, enabling the synthesis of three independent complementary sets of modulated signals, with common switching frequency and conservatively determined "dead" time.Digital word WTC which determines the period of switching frequency T c is defined by where f XTAL is the clock frequency on the pin XTAL1 in MHz .
The times of leading impulses edge are determined in the form of digital words which are calculated using

5.5
Similarly, we find the formula for digital words of the trailing edges of impulses, the value of which is set in the appropriate registers WG COMPx when the counter WG COUNT reaches the value 0001 H: k, p M s .

5.6
The values of the coefficient a In this kind of representation all previously calculated coefficients are shown with the accuracy greater than 10 −4 in the range of changes from −1 to 0.999 within which are also all polynomial coefficients.
The coefficients of the leading and trailing edges are placed in the form of pairs of memory tables so that one table corresponds to the leading impulse edges and the other to the trailing impulse edges.The number of tables depends on the polynomial degree and the number of different values of the pulse number.The coefficients which correspond to the different phases are determined from the same table by applying the suitable index addressing of the data from the tables.The basic element which determines the conditions under which a polynomial algorithm can be applied is that the time necessary for realization of the program must be shorter than half of the carrier signal period.Concerning the memory table it is possible to perform certain optimizations using the properties of the symmetry of pulse angles about the half-period.The amplitude modulation index can be obtained also from the memory table which shows the output amplitude dependency on the frequency.In the experiment performed this dependency is linear, and it maps the ratio U/f const.
The experimental model Figure 7 is made for the practical realization of the polynomial algorithm, and it contains three basic units.
a Voltage three-phase inverter,with the implemented first degree polynomial algorithm and the vector modulation function 2.22 .
b Three-phase asynchronous motorZK100L4; i nominal voltage: 380V Δ; ii rated current: 5, 3AΔ/3, 05AΥ; iii power factor : cos ϕ 0, 81; iv rated power: 2, 2 kW; v rated speed: 1410 ob/min .c Electric brakeWBII 2GA1351-1B i rated power: 2 kW; ii rated speed: 1500 ob/min .Experimentally, the possibility of application of the polynomial algorithm as the modification of the regular selection algorithm for the switching frequency of 2,4 kHz is confirmed.For higher switching frequencies, the times needed for online computation of the positions of the impulse edges are critical regarding their asymmetry about the switching segment.The applications of the polynomial algorithm of the first degree for the output frequency of 40 Hz with the pulse number p 60 are achieved.Oscilloscope recordings of the line voltage and current, obtained by the synthesis according to polynomial algorithm with the vector modulation function, are shown in the Figure 8.

Conclusion
The suggested new sampling PWM algorithm by using the method of modulating function offers a possibility that natural sampling can be realized without any iterative procedure.It is shown that the angle of pulse edges can be approximated by a polynomial, the highest

Figure 1 :
Figure 1: Synthesis of the output voltage of a half-bridge inverter by applying the modulating function method and regular sampling.

Figure 2 :
Figure 2: Active voltage space vectors in αβ reference frame.

Figure 3 :Figure 4 :
Figure 3: Maximum amplitudes of the fundamental harmonic of inverter output voltage obtained using the vector modulating function 2.22 and a polynomial sampling method 3.2 , b polynomial sampling method 3.4 for s 0, c polynomial sampling method 3.4 for s 1, and d regular sampling method.

Figure 5 :
Figure 5: Graphical representation of main elements of impulse synthesis using polynomial algorithm.

Figure 6 :
Figure 6: Main elements of impulse synthesis, using regular symmetrical algorithm.

1 s k, p • • • c 1 s
k, p are normalized and are represented as double-complementary quantities in fixed point formats in the following way: KOEF x 2 −15 −b 15 2 15 14 i 0 b i 2 i ; b i ∈ {0, 1}.5.7

Table 1 :
Maximum turncation error values upon a change in M from 0 to 1.

Table 3 :
Comparison of amplitude characteristic values for natural SPWM , regular RSPWM , and derived polynomial algorithmic sampling.

Table 4 :
Comparison of distortion factor values for natural SPWM , regular RSPWM , and derived polynomial algorithmic sampling.
0, where α k is the angle of the kth sample of the modulation function determined in such a k ; k 1, 2, . . ., p; s