Recent Developments in Magic Sinewaves
Don Lancaster Synergetics, Box 809, Thatcher, AZ 85552 copyright c2010 as GuruGram #107. http://www.tinaja.com firstname.lastname@example.org (928) 428-4073
igitally derived power sinewaves are crucial to solar synchronous pv inverters, industrial motor drives, power quality conditioners, and hybrid vehicles. Major goals of such digital sinewave generation including offering the maximum possible efficiency by using the fewest of simplest possible switching transitions; offering the lowest possible distortion by zeroing out a maximum number of low harmonics; and by using all digital low end micro techniques. Recent and highly unexpected solutions to a new class of math functions have led to magic sinewaves that have the unique property of using the fewest possible energy-robbing switching transitions to precisely zero out the maximum possible low order harmonics. Key advantages of magic sinewaves include...
ANY chosen number of low harmonics can in theory be forced to zero. Or, under real-world quantization, can get reduced to astonishing low (-65db or less) levels. The ABSOLUTE MINIMUM number of efficiency-robbing switching transitions are needed to force the MAXIMUM number of zeroed low harmonics. Switching losses are further reduced by HALF-BRIDGE, rather than full bridge switching. Variations can provide full THREE PHASE COMPATIBILITY while still zeroing a useful number of low harmonics. Implementation is TOTALLY DIGITAL and fully compatible with economical low-end microprocessors. Modest storage needs combine with PRECISE CONTROL of both amplitude and frequency. -- 107 . 1 --
And here are the present magic sinewave limitations...
As with any digital sinewave generation, filtering is required to separate the sharp edge artifacts from the fundamental. Such artifacts are remarkably high in frequency in a typical magic sinewave implementation. The first two UNCONTROLLED harmonics can be quite large but NEVER exceed the fundamental amplitude. Present implementations limit magic sinewaves to power line frequencies, possibly up to 400 Hertz. While a wide frequency range can be accommodated, the response does NOT extend down to dc. Unusual programming techniques are required as each and every microprocessor clock cycle is critical. As many as 44,000 or more microprocessor instructions may be needed per power line cycle. Present implementations best separate the frequency setting from the actual magic sinewave generation.
In some implementations, each pulse edge zeros one odd harmonic, and thus guarantees the minimum switching energy losses for the maximum number of zeroed harmonics. While many hundreds (or even many thousands) of harmonics may be zeroed, an ever increasing number of pulse edges are required to do so. With a corresponding drop in efficiency and program complexity. Evaluation devices currently under development zero out all harmonics up to the 92nd.
Magic Sinewave Appearance
Here is what a typical seven pulse per quadrant magic sinewave might look like...
This can be viewed as a highly specialized form of PWM pulse width modulation. One that has far fewer transitions than normal for significantly higher switching
-- 107 . 2 --
efficiency. And one that uses half bridge rather than full bridge switching for a further 2X efficiency gain. Another way to view a magic sinewave is as a "distortionless" upward modulated zero width carrier. With proper choices of pulse widths and positions, distortion free modulation zeros out any chosen number of low frequency harmonics. Many more earlier details on Magic Sinewaves have appeared here, here, here, and here. With special treatment of the three phase Magic Sinewaves here. And ultra-fast interactive calculators here And evaluation chip info here. Plus menu coverage here, and a development proposal here. In this GuruGram, we'll review some new and ongoing developments. Along with some upgrades and a few expansions on earlier work.
Types of Magic Sinewaves
At present, five classes of magic sinewaves have been studied in depth. Four of these represent single phase solutions, while the fifth is a special "delta friendly" variant meeting the exacting needs of three phase power systems. The four single phase entries are variations on a theme. Decided by whether the pulses are full or half spaced on zero and 90 degrees in the first quadrant. The usual "best" choice can be called a Best Efficiency ( or BEF ) Magic Sinewave. It is based on having its first quadrant pulse full spaced on zero and half spaced on 90 degrees...
Best Efficiency (BEF) Magic Sinewave
45 degrees 4N harmonics are zeroed. Full Step is at 0.0 degrees. Half step is at 90.0 degrees. NOT Three phase compatible. Needs 2n x 2n linear equation. Complementary to NZB version. Two data values stored per pulse. Known solutions of n= 1,2,3,4,5,... 2.000 harmonic to pulse edge ratio.
-- 107 . 3 --
The first quadrant shown here will get mirrored and then flipped to form a full magic sinewave cycle. This guarantees quarter wave symmetry which in turn guarantees no even harmonics and no cosine term odd harmonics. The BEF variant will zero out the first 4n harmonics given n pulses per quadrant. At first glance, the BEF Magic Sinewave seems to offer two more low harmonics rejected than might be reasonably expected. The explanation is that you can think of a very narrow virtual pulse being present at zero degrees. One that, when combined with its opposite polarity neighbor in the previous quadrant, will precisely intergrate to zero. This buys you another half pulse worth of harmonic rejection. Thus, a BEF 8 pulse per quadrant magic sinewave is really 8-1/2 pulses per quadrant. Instead of rejecting harmonics through the 30th, all harmonics through the 32th are zeroed out.
It can be useful to think of each pulse edge doing a specific task. Although all
pulse edges have to work in concert for a given result. For instance, an eight pulse BEF magic sinewave has sixteen edges per quadrant. One of these can be thought of as setting the fundamental, and the remaining fifteen edges zeroing out our low harmonics 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, and 31.
Bridged Best Efficiency (BBE) Magic Sinewave
45 degrees 4n-2 zeroible harmonics. Full Step is at 0.0 degrees. NOT Three phase compatible. 90.0 degree brridged crossing. Complementary to REG version. Two data values stored per pulse. Known solutions of n= 1,2,3,4,5,... Needs 2n-1 x 2n-1 linear equation. 2.000 harmonic to pulse edge ratio.
Intuitively, a sinewave synthesis without any "holes" in its peaks should somehow end up "better" than one without. But it turns out that the BEF and BBE variants simply take turns over how many low harmonics they zero out. At ninety degrees, the bridged pulse does not end, but continues on into the next quadrant. Thus, there is one less edge to deal with per quadrant. And, as a result, two less low harmonics to get zeroed out.
-- 107 . 4 --
Regular (REG) Magic Sinewave
45 degrees 4n-2 zeroable harmonics. Half Step is at 0.0 degrees. Half Step is at 90.0 Degrees. NOT Three phase compatible. Complementary to BBE version. Two data values stored per pulse. Known solutions of n= 1,2,3,4,5,... Needs 2n-1 x 2n-1 linear equation. 1.875 harmonic to pulse edge ratio.
The REG Magic Sinewave has half steps at both 0 and 90 degrees. At first glance, it would not seem too useful in that the BEF Magic Sinewave zeros out two more low frequency harmonics "free" for the same number of pulses per quadrant. But REG has the interesting property that its equations are redundant, giving you, say, fifteen equations in sixteen unknowns. You get around this dilemma by holding one pulse edge fixed during a solution. Curiously, this uncalculated pulse edge can be tuned over a surprisingly wide range of several degrees. Which tells us that, at least in some cases, the zero amplitude carrier pulses do not have to be uniformly spaced. For instance, in the n=8 case, you might hold P1S constant at 5.341 degrees. This leaves you with fifteen calculable pulse edges. One edge ( working in concert ) sets the fundamental, and the rest zero out low harmonics 3 thru 29. Another curious property that may or may not prove extremely useful: The first few uncontrolled harmonics are opposite in sign to a comparable BBE magic sinewave! IF some scheme can be found to combine the two, performance can be stunningly improved. Sadly, early experiments towards this end have introduced more problems than they solve. One possible use for tuning is to adjust REG and BBE to exactly cancel each other's early uncontrolled harmonics. To date, only tuning of P1S has been explored; it is not clear what holding different edges constant will do. Nor how wide the range of possible magic sinewave pulse positions might result. To date, only the REG magic sinewave seems to have this tunability feature.
-- 107 . 5 --
Non-Zero Bridged (NZB) Magic Sinewave
45 degrees 4n-4 zeroable harmonics. Half Step is at 0.0 degrees. 90.0 degree bridged crossing. NOT Three phase compatible. Complementary to BEF version. Two data values stored per pulse. Known solutions of n= 1,2,3,4,5,... Needs 2n-1 x 2n-1 linear equations. 1.750 harmonic to pulse edge ratio.
The NZB Magic sinewave has a half step at zero and bridges 90 degrees. It zeros out four less low harmonics than BEF. And is thus the worse performing of the four single phase variants. It is untunable, but does provide low uncontrolled harmonics opposite in sign to BEF.
Delta Friendly (DLF) Magic Sinewave
45 degrees 3n + 1 zeroable harmonics. Fully Three phase compatible. Positioning follows wrap map. ONE data value stored per pulse! Known solutions of n=3,7,11,15,... Needs nxn special linear equations. 1.571 harmonic to pulse edge ratio.
-- 107 . 6 --
Three phase systems are often used because their power flow is constant, they can use smaller wire diameters, their motors usually self start, and there is often less noise and vibration. If Magic Sinewaves are used they must not demand any load rewiring and must be done with only three high level drivers. This places some extreme limitations on what three phase magic sinewaves can look like and how they are to behave. Some of the concepts are rather obtuse, but they have been addressed in detail here. A three phase compatible Magic Sinewave can be said to be Delta Friendly. Half of the delta friendly pulse edges seem to be needed to force a strict rule of no triad harmonics. As a result, known delta friendly solutions can only zero out 3N+1 harmonics rather than 4N. So, they end up "less efficient" than the single phase variants. Ferinstance, a seven pulse per quadrant Delta Friendly Magic Sinewave might have fourteen edges. Seven of these have to be locked to track seven others if the zero triad harmonics are to be guaranteed. Of the seven edges left, one ( acting in concert ) can set the fundamental, while the remaining six can zero out harmonics 5, 7, 11, 13, 17, and 19. Our even harmonics have been gotten rid of by quarter wave symmetry, and our triad harmonics of 3, 9, 15, and 21 have been taken care of by our edge locking. Thus, the first uncontrolled harmonic will be the 23rd. At present, delta friendly solutions are only known for n = 3, 7, 11, 15, ... While others seem possible, attempts to date to find them have been discouraging. There is, however, a major advantage to delta friendly Magic Sinewaves: They only need one data value stored per first quadrant pulse. Compared to two data values for the single phase variants. Delta solutions can be used in single phase systems if the reduced efficiency is acceptable. The key to understanding and using delta friendly solutions is known as the wrap
map. As gets detailed here.
Magic Sinewave Calculators
-- 107 . 7 --
The BEF equations needed for a seven pulse per quadrant waveform are fairly easily written...
cos ( 1*p1s ) - cos ( 1*p1e ) + ... + cos ( 1*p7s ) - cos ( 1*p7e ) = ampl * pi/4 cos ( 3*p1s ) - cos ( 3*p1e ) + ... + cos ( 3*p7s ) - cos ( 3*p7e ) = 0 cos ( 5*p1s ) - cos ( 5*p1e ) + ... + cos ( 5*p7s ) - cos ( 5*p7e ) = 0 cos ( 7*p1s ) - cos ( 7*p1e ) + ... + cos ( 7*p7s ) - cos ( 7*p7e ) = 0 cos ( 9*p1s ) - cos ( 9*p1e ) + ... + cos ( 9*p7s ) - cos ( 9*p7e ) = 0 cos (11*p1s) - cos (11*p1e) + ... + cos (11*p7s) - cos (11*p7e) = 0 cos (13*p1s) - cos (13*p1e) + ... + cos (13*p7s) - cos (13*p7e) = 0 cos (15*p1s) - cos (15*p1e) + ... + cos (15*p7s) - cos (15*p7e) = 0 cos (17*p1s) - cos (17*p1e) + ... + cos (17*p7s) - cos (17*p7e) = 0 cos (19*p1s) - cos (19*p1e) + ... + cos (19*p7s) - cos (19*p7e) = 0 cos (21*p1s) - cos (21*p1e) + ... + cos (21*p7s) - cos (21*p7e) = 0 cos (23*p1s) - cos (23*p1e) + ... + cos (23*p7s) - cos (23*p7e) = 0 cos (25*p1s) - cos (25*p1e) + ... + cos (25*p7s) - cos (25*p7e) = 0 cos (27*p1s) - cos (27*p1e) + ... + cos (27*p7s) - cos (27*p7e) = 0
These equations may seem daunting, but they really are just requesting a desired fundamental combined with forced zeroing of the first 28 harmonics. Equations of this complexity are unlikely to have a direct solution. Nor any reasonable power series expansion. Instead, a technique called Newton's Method can be used. In which a good guess is first made. The guess can be iteratively improved by use of a sneaky trig identity. Helped along by an equation solving process called Gauss-Jordan Reduction. Here is the sneaky trig identity...
cos( a + x ) = cos ( a ) cos ( x ) - sin ( a ) sin ( x )
Which for very small values of x simplifies to...
cos( a + x ) approximates cos( a ) - x sin( a ) if a >> x
Since you already know "a", this reduces everything to a simple set of trig free nxn linear equations. That rapidly converge. Typically five trips are needed for better than twelve decimal place accuracy. Equations for other types of magic sinewaves are only slightly more complex. The REG version is redundant and has one more variable than equations. A useful workaround is to hold one pulse edge constant. The Delta Friendly variant can have its locked equations combined into single "virtual" trig vectors. These will typically lag or lead the independent edges by thirty degrees.
-- 107 . 8 --
The math is maddeningly obscure, but is further commented in the calculators themselves. Extensions, explorations, more specialized calculators, and other results are available on a custom consulting basis.
Most any digital sinewave synthesis scheme that has sharp edges will need some sort of filtering to separate the switching artifacts from the fundamental. With Magic Sinewaves, these artifacts are quite high in frequency and never exceed the fundamental in strength. In the case of motor apps, the motor inductance and the load inertia both can contribute significantly to the needed filtering. But filtering remains a crucial consideration in most any Magic Sinewave ap. Especially those that must operate over a wide frequency range. The question remains whether any further prefiltered reduction is possible. Two approaches used elsewhere are spectrum spreading in which signal changes can reduce the strength of any particular harmonic range; and cancellation in which two different signals can at least partially offset each other's effects. Per our calculator, an 8 pulse per quadrant REG Magic sinewave zeros out its first thirty harmonics. After tuning, the amplitude 0.53 harmonic 31 will come in at 0.778. Harmonic 33 arrives at -0.578. And H35 at -0.179. The next significant harmonic is clear up at h61, weighing in at -0.179. Curiously, an 8 pulse per quadrant BBE Magic sinewave also will zero out its first thirty harmonics. But gives a H31 of -0.778, an h33 of +0.578, and a H35 and +0.179. Opposites in sign!. Although H61 stays the same at -0.179.
IF some method can be found to combine REG and BBE magic sinewaves, the low uncontrolled harmonics could cancel out! Which would dramatically ease most
filtering needs. Such a staggering improvement immediately seems to be in the "too good to be true" class. And, indeed, every recent attempt at cancellation has introduced more problems than it solved. In particular, any violation of quarter wave symmetry can introduce cosine terms, and any cycle alteration creates subharmonics. No results to date have ended up very encouraging. But the quest remains. And whole worlds of unexpected Magic Sinewaves possibly remain to be explored.
Early physical Magic Sinewave devices were based on 8-bit low end devices, particularly those from Microchip Technology. A typical implementation looked something like this...
-- 107 . 9 --
10 MHz per 60 Hz input clock ref Delta "A" complement step down ~ OR ~ 0-100 amp bit 0 step up ~ OR ~ 0-100 amp bit 1 slew down ~ OR ~ 0-100 amp bit 2 slew up ~ OR ~ 0-100 amp bit 3 high ~ OR ~ 0-100 amp bit 4 high ~ OR ~ 0-100 amp bit 5 high ~ OR ~ 0-100 amp bit 6
18 17 16 15
14 13 12 11 10
Delta "B" complement Delta "C" complement Delta "A" true output Delta "B" true output Delta "C" true output Zero degrees sync
IN1 IN0 XIN IN6 +5V DA DB DC NC
IN2 IN3 IN4 IN5 GND DA DB DC SYNC
1 2 3 4 5 6 7 8 9
This delta friendly eval chip has been set up in a dual use mode. Binary input amplitudes of 0 thru 100 directly output their normalized respective amplitudes. Higher binary input codes allow step up, step down, slew up, and slew down operation. More details on this chip appear here. The most crucial rule of hardware design here is ...
Magic Sinewave timing must be exceptionally precise and perfectly equalized for useful low harmonic rejection!
It turns out that 12-bit or better accuracy is required in each pulse position and width. This gets tricky in an 8-bit microprocessor, but can be handled by use of factoring tricks. Such as calculating most of a time delay and using table lookup for any residue. But these lead to code "pinch points", a need for pipelining, and other complexities that increase design hassles. Many of these concepts are addressed here. Pricing of 16-bit and even 32-bit microcontrollers have recently dropped dramatically, These have the potential to greatly simplify magic sinewave chip design. In that they can end up as nothing but "delay-output" loops that easily provide one-step delay sequences. These are currently under evaluation for future Magic Sinewave hardware products.
For Additional Assistance
Training seminars and custom consulting are available on these concepts. As, per this development proposal, transfer of unique intellectual property rights for this major alternate energy opportunity remain available. Visit the many Magic Sinewave files at http://www.tinaja.com/magsn01.asp. Or else email email@example.com. Or the summary links here. Or call (928) 428-4073.
-- 107 . 10 --