Magic Sinewave General (Programmable) Research Calculator
(selective harmonic elimination in three-level PWM)
Robert F. Ackermann

Independent Pulse Edge Angles
This is a general calculator for finding single-phase and three-phase Magic Sinewave (three-level PWM) pulse solutions of all classes. It uses Don Lancaster's convention for pulse and harmonic variable names (i.e., p1s, p1e, p2s, ... , and h1, h3, ...). Don Lancaster's documentation and calculators can be found here: And, my contributions can be found here: Once you have established edge angles* and harmonic constraints, click the "Improve" button (above) to attempt to converge on a solution.

these examples can be preloaded: or, clear text to start from scratch

*this calculator does not do initial estimates. When investigating potential new Magic Sinewave classes, initial estimates should be derived from theory.
Dependent or Constant Pulse Edge Angles
Dependent edge angles can be derived from independent angles:

p1e = p6e - 60

or, edge angles can be held constant:

p7e = 90
Harmonic Amplitude Constraints
This calculator uses QR decomposition algorithms that are able to handle overdetermined and underdetermined cases, therefore, it is not necessary for the number of harmonic amplitude constraints to be equal to the number of independent pulse edges. The least squares approximation associated with overdetermined cases may be useful for exploring "filter friendly" solutions. For underdetermined cases, such as with Regular Magic Sinewave solutions, edge displacements will be minimized.

harmonic constraints example:

h1 = 0.53 // fundamental
h3 = 0.0
h5 = 0.0
h7 = 0.0
h9 = 0.0