How to Generate 6 PWM for 3phase inverter

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi...
i`m new in avr and have few information about PWM.
i want to generate 6 pwm waveform for 3phase inverter
like this image:
[possible spam img link removed]
(each PWM:120 degree,and in every 60 degree we have a change!)
please help me how to generate it...which PWM mode i have to use?... which avr model i have to use?(mega 128 with 6 PWM?or another)...and another questions!!
thanks

Last Edited: Wed. Aug 26, 2009 - 08:48 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about the AVR model that is made for this: AT90PWM3, with complementary outputs and dead-time generator?

There are app notes and other information on Atmel's site in the Motor Control area of the AVR section.

Quote:
The PSC can be chained and synchronized to provide a configuration to drive three half bridges. Thanks to this feature it is possible to generate a three phase waveforms for applications such as Asynchronous or BLDC motor drive.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We need more info. What is the frequency? Is the duty fixed or variable? What resolution?

A 3 phase inverter is a pretty ambitious project for a beginner. You might want to try starting with something simpler, and safer, and work your way up to it.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't understand why you would need pulse-width modulation to make the waveforms shown in the image. It would appear that there are six square waves being generated and none of them are having their pulse width being modulated.

To make the waveforms in the image, I would set the timer to the period of one vertical section. Then at each time out, output a logic pattern to six port pins that creates these waveforms. With bit0 as S1 and bit5 as S6, cycle through this pattern every timer overflow:

  5  4  3  2  1  0  port bits
---------------------------------
  1  0  0  0  1  1   0-60
  1  1  0  0  0  1   -120
  1  1  1  0  0  0   -180
  0  1  1  1  0  0   -240
  0  0  1  1  1  0   -300
  0  0  0  1  1  1   -360

There aren't going to be any glitches or tiny spikes if the pin output isn't changing on a given timer interrupt.
Attach the output port pins to transistors or MOSFETs to drive the motor or device.
Is this the only waveform that that the device needs? Or must the waveforms be rounded or sine shaped?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:
I don't understand why you would need pulse-width modulation to make the waveforms shown in the image. It would appear that there are six square waves being generated and none of them are having their pulse width being modulated.

Which is precisely why I asked for more info.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A common 3-phase motor would be driven by 3 sine waves, 120 degrees apart. Conventionally, it would take three sine inverters, driven by 3 PWMs which are generated from a common sine lookup table having three pointers or indices to the table, each 120 degrees apart within the table as they shift through the table.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
There aren't going to be any glitches or tiny spikes if the pin output isn't changing on a given timer interrupt.

Being a three phase inverter, it is about three half bridges. When you drive a half bridge, you need a dead time, because the switches are faster to turn on then turn off. So, using just a port, you will end with 'hard switching'.
Plus, the cpu will be busy with changing the outputs six times the output frequency. If the output frequency is high, then the waves will be distorted.
AT90PWM3 will do the job without cpu involved, except for changing the duty cycle, protections.
George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks for all replies...
out put frequency is 50 hz
i use PWM because i need to use SPWM waveform later...but first i want to generate this waveform(PWM) with this shape(and this phase of generation that illustrate in image)
i know later, i have to calculate dead time
i think i have to use micro with 6 PWM output...and i choose atmega128
indeed ,first, i want to learn how to creat this out put with this phases
thanks...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

i think i have to use micro with 6 PWM output...and i choose atmega128

Sigh--only two of us have recommended the AVR model that is purpose-built for the task, and has reference design(s) on Atmel's Web site.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now that I know you actually need PWM, I too recommend one of the AT90PWM AVR's they are specifically built for this task.

@Lee: was just waiting for more detail. As the provided waveform did not illustrate the need for PWM at all.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

@Lee: was just waiting for more detail. As the provided waveform did not illustrate the need for PWM at all.

True enough, and at 50Hz that would be 300Hz interrupts--no big deal. And it is so slow that a hair of jitter will be caught up and no harm done.

Have we determined whether this is a motor/h-bridge app or a power inverter?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is possible to use 3 PWM and generate the deadband alternate signals in hardware.

It all starts with a mental vision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

KitCarlson wrote:
It is possible to use 3 PWM and generate the deadband alternate signals in hardware.

IR2131 (with current measurement) and FAN7388 (cheaper w/o current) are excellent drivers for 3-phase.

Fairchild has a series cost effective transistor (module) bridges for mains voltage, the "Smart Power Modules".