3 phase brushless motor controller

jkfromme:
Hi,
I'm trying to make a three phase motor controller. I have managed to use the timers (3,4,5) on the Mega board to provide 3 different PWM signals and their inverse at various duty cycles and frequencies using the pwm function from the timer library (arduino.cc/timer1) found online. The only problem is I am not able to get these three signals (one for each timer) to be out of phase with one another, and the delay function will not work for this, I have a feeling that the delay function (which uses timer0) does not interrupt other timer outputs, so my analog output signals from the other timers just keep coming. I am not very fluent with embedded programing so if somebody could write the code to cause the analogWrite function to create signals out of phase with eachother that would be amazing! Any help would be appreciated though, I am pretty tight for time and would greatly appreciate any insight.

Trying to make a three phase controller is quite a generic statement!, firstly what modulation strategy will you use i.e what kind of drive are you trying to make there is quite a few ranging from difficult to crazy!

Arduinos are not really suited to high level tasks such as motor control not least because of their computational limitations, motor drives really need a DSP chip

Getting a PWM output is one thing but making PWM modulate a sine wave is quite another and being tight for time just makes it all even harder as it will take a considerable effort, the programming is tough enough but building the hardware is also quite a challenge as motor drives use all kinds of different topics all merged into one

I wouldn't try and make six outputs with three being complementary as you need dead time between complementary outputs so go for a HVIC gate drive chip which has built in dead time so you only need three signals to drive 6 IGBT/MOSFET and dead time takes care of itself

an IR21834 is a good driver chip, when I built an Arduino motor drive the lack of resources meant I had to use three arduinos and sync them together and even then I had to do a lot to speed things up like Maclaurin series to approximate inverse sine etc

Even after lots of heartache the output wasnt that good, basically building a motor drive isnt something that can be done fast unless you know exactly what you are doing and even then its always quite hard!