At 07:59 AM 3/4/00 +1100, PaulB wrote: Scott wrote: >> As you alluded and Dan experienced, the phase accumulator pwm >> algorithms have the highest frequency fundamentals when the DC >> component is 50% of full scale. As you approach the extremes of 0% and >> 100%, the fundamental frequencies decrease. So the extremes are harder >> to filter. > > I am exactly aware of that, but there is only one solution for the >value 1 (or 255). Just a fact of life. I think there is usually a >value in stochastic improvement (i.e., having something work better >*most* of the time as long as the worst case is acceptable). > The possible problem with a s.w. (scenix) algorithm, as opposed to PIC's h.w. implementation of PWM, is that, once you pick a period in the h.w. type, you know exactly what you have (and you can select your filters accordingly), but with the s.w. solutions, the periods *may* go all over the place (ala scenix), so you may be fooling yourself as to what you think you have. You really have to fully analyze the algorithm, before you can pick your LP filter. And you're right, there is only one solution for value 1, but with the PIC PWM h.w., the "fundamental" freq is always the same regardless of duty = 1 or 128, whereas with the scenix sol'n, the fundamental freq varied by 128 for those same duties. It may not ultimately matter *except* that, once again, you need to know the exact behavior so you can choose the LP filters correctly. Worst case, your LP filter could be off by 128x. If I had simply used the scenix algorithm without looking at the extremes, and dumbly assuming it's fundamental freq was directly related to the VP interrupt rate, I would have been in real trouble. [and sometimes I do do dumb things in the heat of wanting to take off for capuccino in the afternoon]. Looking at it on the scope saved my butt. - Dan Michaels Oricom Technologies http://www.sni.net/~oricom ==========================