继续请教,
1 、你的意思是采样正半周,然后通过PID 运算,做正负占空比的调整?
2、 而SIN PWM的调制,比如满幅度是255,128为交流电过零,1为交流电负幅度。
则PID运算结果如果调制度为0.5,则正就变成128+127*0.5=191,过零还是128,负最大幅度就是128-127*0.5=64?
以上我的理解看是不是这样,如我现在SPWM幅值为255,周期点数为128,调制度为1,SPWM中值为128,则产生的正弦信号为:
128,140,152,165,177,189,202,213,225,237,
248,259,269,279,289,299,308,316,325,332,
340,346,352,358,363,368,372,375,378,380,
381,382,383,382,381,380,378,375,372,368,
363,358,352,346,340,332,325,316,308,299,
289,279,269,259,248,237,225,213,202,189,
177,165,152,140,128,115,103,90,78,66,
53,42,30,18,7,-3,-13,-23,-33,-43,
-52,-60,-69,-76,-84,-90,-96,-102,-107,-112,
-116,-119,-122,-124,-125,-126,-127,-126,-125,-124,
-122,-119,-116,-112,-107,-102,-96,-90,-84,-76,
-69,-60,-52,-43,-33,-23,-13,-3,7,18,
30,42,53,66,78,90,103,115
如我现在按以上正弦数据,按定时156US取一次正弦数据(20MS/128),第一次占空比应为128/255,直到128个数据全部取完,一个完整的正弦调整波发送完成,此时候通过AD定时采样正半周数据,通过pID运算,
调制度为0.8,此时,第一次占空比变为128+128*0.8 = 191,第二次占空比变为128+140*0.8 =240,不知道这样对不对? |