Hi to all,
Is-it possible to do phase shift modulation with the PWM of the 56f8xxx serie?
Basically, phase shift modulation is two identical square waves with duty cycle of 50% and a variable phase shift. This feature is available on some TI DSP with there ePWM. I know I can do it using the output of timers and some special IGBT drivers to do dead time insertion. But, I would prefer to use two complementary pair PWM channels.
Thanks
Bruno
char shif_percent=0;dword val1, val2;...if(shift_percent>50) shift_percent= 50;else if(shift_percent<-50) shift_percent= -50;val1 = (dword)getReg(PWMA_PWMCM) * (50-shift_percent)/100;val2 = (dword)getReg(PWMA_PWMCM) - val1;PWMA_PWMVAL0 = val1;PWMA_PWMVAL1 = val2;PWMA_PWMVAL2 = val2;PWMA_PWMVAL3 = val1;PWMC1_Load();
OHH, very good. Thank you very much. It helps a lot.
I didn't need the "negative" angles (0-100%), so I did that:
int shift_percent=50;
dword val1, val2;
if(shift_percent>100)
shift_percent= 100;
else if(shift_percent<0)
shift_percent= 0;
val1 = (dword)getReg(PWM_PWMCM) * (100-shift_percent)/200;
val2 = (dword)getReg(PWM_PWMCM) - val1;
PWM_PWMVAL1 = val1;
PWM_PWMVAL2= val2;
PWM_PWMVAL3 = val2;
PWM_PWMVAL4 = val1;
PWM__Load();
Hello,
First of all thank you for share your code, i'm having the same task to do, and i used your code , and the specifications in PWMMC bean.
But now, when i run the program, i don´t see any changes in my pwm phases. Did you put your code inside of main function?
Regards,
Rui