Thanks for responses.
I have one doubt whether to go with fixed PWM period or fixed steps/360 degree.
I was reading this:
http://www.ocfreaks.com/sine-wave-generator-using-pwm-lpc2148-microcontroller-tutorial/Here it is mentioned : "For each division we have a single PWM cycle." So for number of steps we divide full cycle we will have fixed PWM period.
1. Suppose for ease of understanding using 50-400Hz variable.
2. I have uploaded excel file with two options:
https://drive.google.com/open?id=1a_WLaLzs7RiUBYA6N0_hSOvFjJV2TrD3Also attached pdf of same excel also
a) fixed steps 360 & keep swtiching freq variable (i.e 1 step per degree)
b) fixed switching freq(20Khz) & keep steps variable (20Khz as this is max freq for most igbt)
I prefer 4 igbt in H bridge configuration.
A) Fixed steps & keep PWM period(swtiching freq) variable:
1. At 50hz, time period = 1/50hz = 20ms
2. If keep 360 steps fixed, then time_per_step = 20ms/360 = 55.55us/step
3. 55.55us means swtiching freq will be 18khz around.
4. But if intial freq is 400Hz, then switching freq by this calculaltions will be 144Khz, which is very high .
B) Fixed switching freq i.,e 20Khz i.w PWM period = 50us & keep steps variable
1. At 50Hz, steps will be = 20Khz/50Hz i.e 400 steps
2. Time period per step = (1/50)*1000000/400 = 50us
3. So for 50hz, need to divide into 400 steps. For 400 steps, each step sine value is calculated as in excel.
4. Now for each step, 50us PWM period is fixed, so on_time varies. As in excel it changes from 0.78us to 50us(o tp 90 degree) & cycle continues.
I am not sure if igbt can work with such low on_times?
Normally igbt have max switching freq of 20Khz mentioned, so I assume this means 25us on time and 25us off time max?
Are my calculations correct.
I have been able to generate sine wave by measuring directly at PWM output of MCU & connecting low pass filter of cut off 800hz around. Level shifted for negative cycle.
I am not sure which way is correct? Can anyone tell?
Is my understanding correct or other way to do it?