On Tue, 7 Mar 2000, Nikolai Golovchenko wrote: > Hi Scott, > > I never heard of "magic sinewaves" before, so I can be wrong. Anyway, > if I understand correctly, there are two goals in generating the pulse > sequence: > 1) Minimize switching > 2) Attenuate higher harmonics > > I can't understand why you choose PWM to achieve this! > > Okay, PWM has small number of transitions - two per PWM period. Recall though that if you're generating a sinewave using PWM that there are many PWM cycles for one period of the sinewave. In fact, the more the better. The reason is because it becomes easier for an analog filter to remove the PWM carrier frequency while passing the sinewave. Now in some applications you want to minimize the number of transitions because the switching losses are a significant factor. If you were to limit yourself to say only two transitions per cycle, i.e. a square wave, to generate or synthesize a sinewave then an analog filter would have a whole lot of work to do. If you made the duty cycle 50% then the even harmonics are suppressed and your analog filter would need to attenuate the odds. But the third harmonic is so close to the fundamental that it's difficult to effectively filter it without detrimentally affecting the fundamental. So the next step may be to say, well, I'm going to try two pulses per sine wave cycle. If you study this case, you'll discover that it's possible to suppress either the 2nd or the 3rd but not both (at least that's my observation). So then you say, well, how about three pulses? It turns out that this can be done: http://www.dattalo.com/ms1.gif. But the 4th and 5th harmonics are fairly significant - almost as big as the fundamental. Now to suppress the 4th and the 5th and so on harmonics requires more and more pulses. > Now harmonics. They appear as a result of PWM conversion and can be > thought of as quantization error. To reduce the quantization effect > the PWM resolution (and therefore frequency) must be increased. > > The problem is: If you want to reduce errors(or harmonics), you have > to increase PWM frequency. On the other hand, increased PWM frequency > increases the number of transitions per unit of time. So these two > goals conflict with each other, don't they? > > I can see another approach. A scheme to minimize quantization errors, > also known as "Scenix PWM". > -------------- > 0..1 ----- | 1 +--- | > -----|+ |---o--| | |--o------------- > --|+ | | | 0 ----+ | | > | ----- | | 1 | | > | | -------------- | > | | Quantizer | > | | | > | ------- ----------- > | | | > | -------- > | | + - | > | | | > | ------- -------- > | | -1 | | > -----| Z |------- > ------- > > Switching is determined by sampling frequency. Choose what you need or > can afford. In any case, the system is trying to eliminate > quantization error at every sample (unlike PWM), which leads to a > higher attenuation of harmonics at the same clock frequency. The > benefit is that you don't have to worry about pulse position, it's > done automatically. The noise is minimal at fundamental harmonic > frequency and increases with frequency. Probably there is a better > feedback variant (noise shaping filter) but this is the simplest and > the only one I know . But it is interesting to look at from this perspective (as opposed to looking at an algorithm). Scott