3 phase inverter with dead time

Hello, I've been starting on small projects on Arduino but finally decided do something a little more serious... I'd like to generate the signals to drive a 3 phase motors, that means 3 phases of 2 complementary PWM signals, with deadtime. By deadtime I mean the high side and low side of a phase need to be both 0 for some time (maybe 1-5µs) and then be complementary (eg high side is 0, low side is 1). this is complicated by a couple of things: 1/ I'd like variable frequency PWM (from 1 kHz to 40kHz) 2/ I need to add sine modulation (not to hard with a simple table) 3/ I'd like to use this also for BLDC motors, where one phase at any time is completely off. This excludes hardware solutions for generating the 2 complementary signals from a single PWM...

This seems pretty hard to do in Arduino, any ideas? I think this could open up so many interesting projects for Arduino!!!!

Thanks, Andrea

What voltage and stall current does each winding require? Can you explain why you need your "dead time" requirement?

You will need 3 H-bridges. Each one will need a PWM signal and a direction signal from the Arduino. 40KHz is rather high for a PWM frequency, to achieve that speed I think you will need a MOSFET H-bridge with good drivers and schottky barrier flyback diodes. Why do you want to go so high?

You can change the pwm frequencies on Arduino outputs, although you can only get submultiples of the base frequency. See http://www.arduino.cc/playground/Code/PwmFrequency.

I already a bunch of hardware: 3 phase inverters with gate drivers, so all that I need from the Arduino are the 6 control signals. At a later date I can take a current feedback signal (hall sensor) and maybe a speed sensor, and close the loop in the Arduino. However I need time for one switch in the same 1/2 bridge to turn OFF before turning ON the other one, somewhere in the range of 1-2µs. There are actually some IC that cna do this taking as input a single PWM signal, however then I would not be able to use BLDC modulation that requires one leg to be entirely off... Some micros have the possibility to do this in HW on the capcom units of the PWM generators, do the arduino boards have this capability? By any chance, do you know if Atmel offers some pin to pin compatible micros in the same family that have additional peripherals, like a more advanced PWM generator module? that could also be an easy way for me to do this...

Appreciate your help!

By any chance, do you know if Atmel offers some pin to pin compatible micros in the same family that have additional peripherals, like a more advanced PWM generator module?

Sort of. I believe the ATtiny85 family (timer 1) has the features you need (dead-time, high-speed) and I think the ATtiny861 family was made specifically for three-phase motor control. Neither are "pin compatible" with the ATmega328 family.

[quote author=Coding Badly link=topic=74000.msg557540#msg557540 date=1317531247]

By any chance, do you know if Atmel offers some pin to pin compatible micros in the same family that have additional peripherals, like a more advanced PWM generator module?

Sort of. I believe the ATtiny85 family (timer 1) has the features you need (dead-time, high-speed) and I think the ATtiny861 family was made specifically for three-phase motor control. Neither are "pin compatible" with the ATmega328 family.

[/quote]

And I seem to recall Atmel published several application notes about driving 3 phase BLDC motors.

so do you guys think if I do a new layout for this micro I could use the same software development environment as for the Arduino Uno?

agorger1:
so do you guys think if I do a new layout for this micro

New layout? Do you mean a PCB?

I could use the same software development environment as for the Arduino Uno?

For the ATtiny85, you can use the same software development environment (I was earlier today). You will need one additional bit of hardware: an ISP (In-system Serial Programmer). Your Uno (any Arduino compatible board) can be configured to act as an ISP.

As far as I know, no one has created a “core” for the 861 processor. If you decide to use the 861 processor and you are willing to share what you create, as I have time, I am willing to add 861 support to the Tiny Core.

After rereading your posts, the 85 processor is not the right choice. It is an eight pin processor with a maximum of three PWM outputs. The 861 processor is definitely the place to start your research. And spend some time with Google; it took me, literally, ten seconds to find this…

http://www.atmel.com/dyn/resources/prod_documents/doc8012.pdf

I believe the ATmega48 is pin compatible with the processor in your Uno.

Hi, thanks for the info. I;ve been trying to navigate the Atmel website but it's to understand which micro has the functions I need without reading the datasheets one by one. The appnote you pointed out unfortunately only works for BLDS motors as it uses a single PWM generator, and the other timer for block commutation of the phases. In a sinusoidal modulation all 3 phases have different duty cycles... The ATtiny861 seems a perfect match; I wish there was a micro pin to pin compatible with the arduino with that PWM peripheral: it has a so many nice features... I also wrote to Atmel support so let's see if I get an answer...

Thanks!

agorger1: Hi, thanks for the info. I;ve been trying to navigate the Atmel website but it's [difficult] to understand which micro has the functions I need without reading the datasheets one by one.

I agree. Their parameter search covers the very basics (SRAM size, Flash size, number of timers) but is useless for the interesting parameters (like dead-time).

The appnote you pointed out unfortunately only works for BLDS motors as it uses a single PWM generator, and the other timer for block commutation of the phases. In a sinusoidal modulation all 3 phases have different duty cycles...

Try this one... http://atmel.com/dyn/resources/prod_documents/doc2596.pdf

The ATtiny861 seems a perfect match; I wish there was a micro pin to pin compatible with the arduino with that PWM peripheral: it has a so many nice features...

As far as I can tell, the ATmega line is, for the most part, general purpose. For your application, that means a hybrid solution; some hardware and some software.

The ATtiny line seems to be specialized. For your application, that means you will likely find a processor that provides very nice hardware support (like the 861).

Unfortunately, that means you will have tough choice to make. On the one hand you can use a pin compatible processor but the solution will be more complicated. On the other hand you can have a simple elegant solution but the processor will be "odd".

I also wrote to Atmel support so let's see if I get an answer...

Excellent. Please let us know what happens.

Atmel support were pretty good, but still no elegant solution. They suggested the AT90PWM family, which is still part of the 8bit AVR micros, but I couldn't find one pin to pin compatible... In the other hand I also asked about the SAM3U for upcoming Arduino Due: it seems I might be more lucky there as those do seem to have these additional features. I need to dig into that a little more but it could be my way out. Anyone knows when the "beta" boards will be available?

There are 3-phase MOSFET driver chips that can do some of the work like configurable dead-time and a master disable signal (as well as driving the MOSFETs), I’ve looked at the HIP4086 (3-phase version of the well-known HIP4081 controller) but not used it yet (4081 I have used). This kind of approach allows to only need 3 PWM signals and 3 enable signals, which also simplifies things.

There are AT90PWM that are designed just for pwm control and so on, so search about then in the atmel site.

that's a good find: the HIP4086 seems very promising. I'll give it a try...

Thanks again!