Understanding DC-AC inverter for pure Sine PWM    - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 11, 2020, 02:09:17 pm
content: 1. Need to design solar inverter dc to ac using pure sine wave PWM. I am reading a bit and this is what understand. I am using MCU with FPU enabled.2. Have to change output freq from 1-400Hz(depending on user input) & output ac voltage from 110Vac-300Vac(depending on user input)3. Currently i am understanding how to change freq:a) Whatever I have read on internet is using swtiching freq 20Khz or higher for pure sine wave since its outside audible range. So i am using 20Khz here. I dont know if its ok or higher need to be selected, what is criteria for it?Since I am using IGBT of 10Amps for application, so cannot go above 20Khz, as they have limitation of their own.With 20Khz , PWM time period = 1/20Khz = 50us.b) Then I read to divide sine wave into equal parts some on intenet used 100, some 200 some 10. What is criteria for it?I am chosen 100 parts since it will divide 360 degree into 3.6 degree each.So an array of 100 values is madearr = Sin(n*Pi/180) where n varies from 0 to 99Is it ok?Then PWM will start with width variation and after every degree time period, corresponding PWM On time be selected, whereas PWM timer period is fixed at 50Hz so that switching freq is 20Khz always.

author: schmitt trigger
author_rank: Super Contributor
timestamp: March 11, 2020, 02:16:51 pm
content: I would use an interval which results in whole degrees.120 steps would result in 3 degree steps, and could be implemented with 7 bits.

author: Zero999
author_rank: Super Contributor
timestamp: March 11, 2020, 03:47:02 pm
content: 1Hz to 400Hz is a huge frequency range. Are you sure it's really needed? 50Hz to 400Hz makes more sense, but is it really necessary to go down to 1Hz?

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 15, 2020, 01:51:40 pm
content: 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 alsoa) 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 = 20ms2. If keep 360 steps fixed, then time_per_step = 20ms/360 = 55.55us/step3. 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 variable1. At 50Hz, steps will be = 20Khz/50Hz i.e 400 steps2. Time period per step = (1/50)*1000000/400 = 50us3. 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?

author: Siwastaja
author_rank: Super Contributor
timestamp: March 15, 2020, 03:28:46 pm
content: I hope you understand what you are asking is worth writing a complete book about; or a task which requires years and years of design experience. I suggest you keep Googling reading material and go through all that, and then ask again if you have some specific detail you don't understand. Allocate at least a week or two for full-time reading. You will find the answers to your questions, but then you'll find a dozen new questions per each answerred.

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 16, 2020, 10:42:11 am
content: By keeping fixed PWM freq 20Khz, i.e 50us time period, and variable steps to divide the sine wave i been able to generate it across MCU pin and connecting simple low pass filter, been able to generate sine wave acroos it for 50,100 & 400Hz, as in pic attached.For example:1. For 50hz, divide 360 degree into 20Khz/50hz = 400 steps2. For 100hz, divide 360 degree into 20Khz/100hz = 200 steps3. For 400hz, divide 360 degree into 20Khz/400hz = 50 stepsAll caculations will be caried with FPU enabled MCU only, cortex M4.I was reading some article on delta for carieer freq. They have default 4Khz and can go to max 15Khz.Now I have some doubts:1. Currenlty i am able to generate sine wave as desired but on MCU only. is it correct way to do that?2. If it is, then next step is to select igbt of 20Khz switching freq. But have doubt that on_time varies from 0 to 50us? Can igbt work when on_time is near zero?For example for 50Hz, PWM period is fixed 50us(20Khz), on time varies from 0 minimum, then next minimum is 0.78566us. SO can igbt turn on at this low time? Datsheet specify only 20Khz switching freq max. But i dint find minimum allowable on_time/off_time?3. For initial for safety, will start with low voltages like 24Vdc and gradually increases to 220Vmax.

author: schmitt trigger
author_rank: Super Contributor
timestamp: March 16, 2020, 04:50:48 pm
content: Quote from: Vindhyachal.takniki on March 16, 2020, 10:42:11 amWould you kindly attach the datasheet for the IGBT?

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 18, 2020, 11:01:53 am
content: Need to drive a 3 phase induction motor.Delta vfd page attached, default carrier is 4Khz only. But why is that so? Wont it create audible noise more?With current setup with MCU I am able to genearte sine PWm from 50-400Hz without issue.But now i need to vary amplitude also of output from 110Vac-300Vac? How to do that? Will that by same formula for sine wae?y= Asin(angle) ?? current setup I have taken A=1in formula.Will varying A will vary amplitude also? I have tried it , it seems to work. But I am not sure if that is ok or not or this is how its done in vfd's??

author: Ground_Loop
author_rank: Frequent Contributor
timestamp: March 18, 2020, 12:42:20 pm
content: I would think that applying an fixed offset to the duty cycle with appropriate filtering would allow for varying the voltage.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 18, 2020, 01:10:40 pm
content: OH, this isn't a "pure sine inverter" - it's a motor controller! Quite a different beast:* Motor controller doesn't need a filter network - the bridge drives the motor directly,* Motor doesn't want or need pure sine. Quite the opposite, methods such as Third Harmonic Injection are sometimes used to improve DC link voltage utilization* Motors are quite insensitive to harmonics, ripple, noise, etc.* You want to implement motor-control specific algorithms (like FOC), which include rotor speed approximation.Everything's quite different from an inverter designed to power general purpose loads.