sriblue7
Member level 1
Hi all!!!
I am trying to generate SPWM signal for the inverter using Atmega8.
The following are the parameters i have fixed.
PWM carrier frequency=31.25k(8M/(1*256)---->No prescalar and fast PWM.
Aim is to get 50Hz sine output.
I have used two different sine wave tables for simulation
1)I have used 255 variables for half period of sine.So the output frequency would be 31.25K/510=62Hz(approx.).here is the prog(pwm1) and simulated result(sim1 and sim2).
View attachment pwm1.txt
2)I have used 255 variables for one full period of sine.So the output frequency will be 31.25k/255=123Hz.To get 50 hz i have to send each value of the sine table thrice.here is the prog(pwm2) and simulated result(sim3)
View attachment pwm2.txt
1)are my calculations and programs correct?
2)Which one is correct 1 or 2?
3)Though i have used the common sine table in net for 2,i am not getting a clean desired sine wave?
4)do i need any other output from microcontroller to drive H-bridge apart from the two out of phase signals at OC1A and OC1B?
5)how can i get a frequency between 50-60hz,as for any prescalars i am getting a frequency only out of this range.
I am trying to generate SPWM signal for the inverter using Atmega8.
The following are the parameters i have fixed.
PWM carrier frequency=31.25k(8M/(1*256)---->No prescalar and fast PWM.
Aim is to get 50Hz sine output.
I have used two different sine wave tables for simulation
1)I have used 255 variables for half period of sine.So the output frequency would be 31.25K/510=62Hz(approx.).here is the prog(pwm1) and simulated result(sim1 and sim2).
View attachment pwm1.txt
2)I have used 255 variables for one full period of sine.So the output frequency will be 31.25k/255=123Hz.To get 50 hz i have to send each value of the sine table thrice.here is the prog(pwm2) and simulated result(sim3)
View attachment pwm2.txt
1)are my calculations and programs correct?
2)Which one is correct 1 or 2?
3)Though i have used the common sine table in net for 2,i am not getting a clean desired sine wave?
4)do i need any other output from microcontroller to drive H-bridge apart from the two out of phase signals at OC1A and OC1B?
5)how can i get a frequency between 50-60hz,as for any prescalars i am getting a frequency only out of this range.