I need help programming an Arduino to send inputs to a 3 phase Mosfet Driver

I have just finished my motor controller rough draft circuit on a breadboard. I am using a HIP4086A three phase mosfet driver, Arduino Uno for the PWM inputs to the HIP4086, 6 N-channel Mosfets, along with diodes, zener diodes, resistors, capacitors, 12v voltage regulator. I'm not going to attach my schematic unless its asked for because I have to update some things on it.

My first question is whether my RDEL, UVLO, RFSH, and DIS connections are setup properly for coding with arduino? My current setup is: RDEL connected to 12v with a 2.2k resistor ( sets the timing current that defines the dead time between drivers ) UVLO is connected to ground with 1k resistor ( undervoltage set point ) RFSH is not connected to anything ( refresh pulse is typically 1.5µs ) DIS is connected to ground with 1k resistor ( outputs are controlled by the other inputs )

My second question is I have AHI and ALI connected, BHI and BLI connected, CHI and CLI connected So now there is only 3 PWM input signals from the Arduino, Do I need to ground RDEL in order for this to work?

What Inputs should I be sending to the HIP4086 when the HIP4086 is In PWM mode?

We can't discuss your question until you post your schematic. You can draw it by hand on a piece of printer paper and take a photo of it and post that.

(You didn't tell us WHAT or HOW you connected to those six INPUTS.

Do I need to ground RDEL in order for this to work?

You question prompts me to ask if you have even read the datasheet for the HIP4086. Do you have any idea what SHOOT-THROUGH IS ?

When controlling individual inputs, the programmable dead time is optional but shoot-thru protection must then be incorporated in the timing of the input signals. If the PWM mode is chosen, then the internal programmable dead time must be used. Shoot-Thru Protection Dead time, to prevent shoot-thru, is implemented by delaying the turn-on of the high-side and low-side drivers. The delay timers are enabled if the voltage on the RDEL pin is greater than 100mV. The voltage on RDEL will be greater than 100mV for any value of programming resistor in the specified range. If the voltage on RDEL is less than 100mV, the delay timers are disabled and no shoot-thru protection is provided by the internal logic of the HIP4086/A. When the dead time is to be disabled, RDEL should be shorted to VSS.

Are you crazy ? Why in the world would you DISABLE Shoot Trough Protection ? That's an invitation to DISASTER ! The fact that you entertained that thought for more than a uS indicates you need to stop and think about what you are doing because your current course of action is on a par with a bull in a china-shop. If you don't know what 'shoot-through' is, then for pete's sake ASK.

7 RDEL Delay Time Set point. Connect a resistor from this pin to VDD to set timing current that defines the dead time between drivers - see Figure 17. All drivers turn-off with minimal delay, RDEL resistor prevents shoot-through by delaying the turn-on of all drivers. When RDEL is tied to VSS, both upper and lowers can be commanded on simultaneously. While not necessary in most applications, a decoupling capacitor of 0.1µF or smaller may be connected between RDEL and VSS.

Set a conservative (long) dead time with RDEL, test initially with a current-limited supply
at low voltage (the MOSFET bridge itself can operate at any voltage, above, at or below 12V)

Set up the various pins as suggested in the datasheet. The datasheet has the knowledge,
we will only read it ourselves to answer questions!

You might like to look at the code I developed to drive timers1 and 2 in lock-step to generate
3-phase PWM:

// For the UNO!

#define PERIOD 250   // 250 cycles = 15.625us for each half of waveform, 32kHz
#define HALF 125     // half the period is the default PWM threshold - gives square wave.
#define MAXAMP 31
  
void setup_timers ()
{
  TCCR1A = 0xF2 ;  // phase correct (mode 1010, ICR1 controls period)
  TCCR1B = 0x11 ;  // prescale by 4
  TIMSK1 = 0x01 ;  // overflow interrupt
  TCCR2A = 0x31 ;  // phase correct (mode 101, OCR2A controls period)
  TCCR2B = 0x09 ;
  
  ICR1  = PERIOD ;    // 31.25us cycle time, 32kHz PWM but 64kHz drive pulses (differential)
  OCR2A = PERIOD ;
  
  OCR1A = HALF-100 ;    // example U drive
  OCR1B = HALF ;
  OCR2B = HALF+100 ;    // example W drive
  
  GTCCR = 0x83 ; // clear and halt prescalers
  TCNT1 = 0xFFFF ;  // synchronize counters
  TCNT2 = 0 ;
  GTCCR = 0x00 ; // allow prescalers to fly
}

void setup ()
{
  setup_cosines () ;
  setup_timers () ;

  pinMode (9, OUTPUT) ; // OC1A pin = U drive
  pinMode (10, OUTPUT) ; // OC1B pin = V drive
  pinMode (3, OUTPUT) ; // OC2B pin = W drive
}

volatile byte u = HALF ;
volatile byte v = HALF ;
volatile byte w = HALF ;


ISR (TIMER1_OVF_vect)   // overflow triggers at BOTTOM, update all the compare regs, which are sampled at TOP
{                       // 50us later, then take effect about 75us later on average.
  //TCNT2 = 0 ;
  OCR1A = u ;
  OCR1B = v ;
  OCR2B = w ;
}

#define  DEG_360  0x200
#define  DEG_120  0x0AB

char cosine_tab [DEG_360+1] ;  // fails to work if less than 0x202.

void setup_cosines ()
{
  for (int i = 0 ; i < 0x202 ; i++)
  {
    float a = i * 6.283185 / 0x200 ;
    if (i <= DEG_360)
      cosine_tab [i] = round (127.0 * cos (a)) ;
  }
}

unsigned int phase = 0 ;
int freq  = 1 ;
int amplitude = MAXAMP ; // +/-201 maximum

unsigned long prev = 0L ;

int my_cosine (int ph)
{
  ph &= DEG_360-1 ;
  int res = cosine_tab [ph] ;
  res *= amplitude ;
  return (res + 0x0F) >> 5 ;
}

#define fstep_del 500

void loop ()
{
  phase += freq ;
  int newu = my_cosine (phase) ;
  int newv = my_cosine (phase - DEG_120) ;
  int neww = - newu - newv ;
  newu += HALF ;
  newv += HALF ;
  neww += HALF ;
  //noInterrupts () ;
  u = newu ;
  v = newv ;
  w = neww ;
  //interrupts () ;
  delayMicroseconds (1000) ;
  
  if (millis () - prev > fstep_del)
  {
    prev += fstep_del ;
    freq = - freq ;
    freq = 1 - freq ;
    if (freq > 20)
      freq = 0 ;
   // freq = 8 ;
  }
  
}

That’s the version for the ATmega328, you can stick pins 9, 10, 3 on an oscilloscope
to see the waveforms - it generates sinusoidal rather than trapezoidal signals.

That's the version for the ATmega328, you can stick pins 9, 10, 3 on an oscilloscope to see the waveforms - it generates sinusoidal rather than trapezoidal signals.

Any chance you could take a photo of the scope screen ?

Well when I have access to a 4-channel scope I will.

Thanks for the Code and replies,
I posted my Schematic in the Attachments

Right now I did not connect the mosfets to the breadboard because I’m testing the inputs that ill be sending to the gates of the n-channel mosfets. Im also using an arduino uno for now but when I get it to work I will then use a Atmega328 chip.
I will be testing it with a 4Mhz True RMS Multimeter that can measure Frequency/Duty Cycle/PWM, Voltage, Current, Capacitance, Resistance, Logic, and can be plugged in to a computer to graph out each of those measurements.

Motor controller.bmp (3.6 MB)

Hi, please check your AHS, BHS and CHS connections and compare it with the typical circuits in the spec sheet.

www.intersil.com/content/dam/Intersil/documents/hip4/hip4086-a.pdf

Yours does in places look like it, but your circuit all three output circuits should be identical.

I would suggest you copy the typical and then change what you want, their layout is so much cleaner and easier to read.

Tom......... :)

Capacitance, Resistance, Logic, and can be plugged in to a computer to graph out each of those measurements.

I presume you mean by you. Using what application ?

I have a question for Mark T, I noticed that only defined Pins 9,10, and 3 in the code you provided. I assume that these are meant for the HIGH FETs. What about the LOW FETs? i.e how would inverse the pin outputs for the low side? Is that already embedded in the code?

Thank you, Learner

You might like to look at the code I developed to drive timers1 and 2 in lock-step to generate
3-phase PWM:

I noticed that only defined Pins 9,10, and 3 in the code you provided. I assume that these are meant for the HIGH FETs. What about the LOW FETs? i.e how would inverse the pin outputs for the low side? Is that already embedded in the code?

I think you are confusing the INPUT signals for a 3-phase inverter with the OUTPUT signals that actually drive the devices.
The HIP4086 takes 3 INPUT signals and generates 6 output signals.

Look at the schematic on page 1 of the datasheet. The question you are asking pertains to the OUTPUT signals of that chip.
The comment Mark made was pertaining to the INPUT signals.

APPLES & ORANGES

hip4086-a.pdf (470 KB)

Thanks for the response Tom George I will take your advice.

I presume you mean by you. Using what application ?

The application is meter view designed for true rms multimeters.

LearningStudent: I have a question for Mark T, I noticed that only defined Pins 9,10, and 3 in the code you provided. I assume that these are meant for the HIGH FETs. What about the LOW FETs? i.e how would inverse the pin outputs for the low side? Is that already embedded in the code?

Thank you, Learner

Using two timers limits you to 4 PWM outputs in total - with 3 outputs you either stick them through 74HS14 inverters for the other signal or use a driver like the HIP4086 that will handle commoning high and low signals (one is inverted).

Note the code is for sinusoidal drive, not trapezoidal.

I noticed that only defined Pins 9,10, and 3 in the code you provided. I assume that these are meant for the HIGH FETs. What about the LOW FETs? i.e how would inverse the pin outputs for the low side? Is that already embedded in the code?

I think you are confusing the INPUT signals for a 3-phase inverter with the OUTPUT signals that actually drive the devices. The HIP4086 takes 3 INPUT signals and generates 6 output signals.

Look at the schematic on page 1 of the datasheet. The question you are asking pertains to the OUTPUT signals of that chip. [u]The comment Mark made was pertaining to the INPUT signals. (see below)[/u]

"You might like to look at the code I developed to drive timers1 and 2 in lock-step to generate 3-phase PWM: " (meaning the 3-phase PWM INPUT signals for the HIP4086. If he was talking about the OUTPUT signals there would be 6 signals not 3)

APPLES & ORANGES

So, as stated by Mark, if you are NOT going to use the HIP4086 then YOU have to generate the COMPLIMENT Complement signals.

complEment, not complIment!

complEment, not complIment!

My bad. What was I thinking ? XD