BLDC motor driver PWM problem

Thread Starter

Osama_Ramadan17

Joined Jan 17, 2018
6
We are trying to drive a BLDC motor using hall sensors the motor is (48V , 500W , hub motor)
we have designed a 3 phase driving circuit with IR2112 gate driver and IRF540N Mosfets , a schematic for one phase of the driver is provided in the attachments.
We control the signal using Arduino Mega and after testing the motor we had the following:

1. Motor starts normally at 12 volts and speed increase as we increase the voltage.
2. high side mosfets burns when we use and kind of PWM control.
3. all driver mosfets burn when we use 48V 12Ah battery to supply the motor

The following is the code we use to drive the mosfets as when we use high at the gates the motor runs normally we thing that the code is correct,,
But we do not know why the mosfets are burn when using PWM

Code:
#include <PWM.h>
#define AH 2
#define AL 3
#define BH 4
#define BL 5
#define CH 6
#define CL 7
#define C 21
#define B 20
#define A 19
#define throtle A0
int v=180;
int n = 1 ;
int Hall1=19;
int Hall2=20;
int Hall3=21;
void setup() {
SetPinFrequency(2,20000);
SetPinFrequency(4,20000);
SetPinFrequency(6,20000);
  pinMode(AH,OUTPUT);
  pinMode(AL,OUTPUT);
  pinMode(BH,OUTPUT);
  pinMode(BL,OUTPUT);
  pinMode(CH,OUTPUT);
  pinMode(CL,OUTPUT);
  digitalWrite(AL , HIGH ) ;
  digitalWrite(BL , HIGH ) ;
  digitalWrite(CL , HIGH ) ;
  delay(1000);
  digitalWrite(AL , LOW ) ;
  digitalWrite(BL , LOW ) ;
  digitalWrite(CL , LOW ) ;
  delay(100);
  attachInterrupt(digitalPinToInterrupt(Hall1),Sequence,CHANGE); 
  attachInterrupt(digitalPinToInterrupt(Hall2),Sequence,CHANGE);
  attachInterrupt(digitalPinToInterrupt(Hall3),Sequence,CHANGE);
 
}

void Sequence()
{
//2nd direction
  if (digitalRead(C)==1 &&digitalRead(B)==1 &&digitalRead(A)==1){
  digitalWrite(AL,0);
  digitalWrite(AH,0);
  digitalWrite(BH,0);
  digitalWrite(BL,0);
  digitalWrite(CH,0);
  digitalWrite(CL,0);
  }
 
if (digitalRead(C)==0 &&digitalRead(B)==1 &&digitalRead(A)==0){
  digitalWrite(AL,1);
  digitalWrite(CH,0);
  digitalWrite(AH,0);
  digitalWrite(BL,0);
  digitalWrite(CL,0);
  analogWrite(BH,v);
  //digitalWrite(BH,1);
  }
if (digitalRead(C)==0 &&digitalRead(B)==1 &&digitalRead(A)==1){
  digitalWrite(AL,0);
  digitalWrite(CL,1);
  digitalWrite(BL,0);
  digitalWrite(AH,0);
  digitalWrite(CH,0);
  analogWrite(BH,v);
  //digitalWrite(BH,1);
  }
if (digitalRead(C)==0 &&digitalRead(B)==0 &&digitalRead(A)==1){
  digitalWrite(CL,1);
  digitalWrite(BH,0);
  analogWrite(AH,v);
  //digitalWrite(AH,1);
  digitalWrite(AL,0);
  digitalWrite(BL,0);
  digitalWrite(CH,0);
  }
if(digitalRead(C)==1 &&digitalRead(B)==0 &&digitalRead(A)==1){
   digitalWrite(CL,0);
   digitalWrite(BL,1);
  digitalWrite(AL,0);
  digitalWrite(BH,0);
  digitalWrite(CH,0);
  analogWrite(AH,v);
  //digitalWrite(AH,1);
  }
if (digitalRead(C)==1 &&digitalRead(B)==0 &&digitalRead(A)==0){
   digitalWrite(BL,1);
  digitalWrite(AH,0);
  analogWrite(CH,v);
  //digitalWrite(CH,1);
  digitalWrite(AL,0);
  digitalWrite(BH,0);
  digitalWrite(CL,0);
 
  }
if (digitalRead(C)==1 &&digitalRead(B)==1 &&digitalRead(A)==0){
  digitalWrite(BL,0);
  digitalWrite(AL,1);
  digitalWrite(AH,0);
  digitalWrite(BH,0);
  digitalWrite(CL,0);
  analogWrite(CH,v);
  //digitalWrite(CH,1);
  }
if (digitalRead(C)==0 &&digitalRead(B)==0 &&digitalRead(A)==0){
  digitalWrite(CH,0);
  digitalWrite(AH,0);
  digitalWrite(AL,0);
  digitalWrite(BH,0);
  digitalWrite(BL,0);
  digitalWrite(CL,0);
  }
for(int i=0 ; i<15;i++){digitalWrite(0,0);}
}

 
 

void loop(){
}
 

Attachments

dendad

Joined Feb 20, 2016
4,635
For a start, replace the 1N4004 diodes with UF4004. They are faster. The 1N4004 are a bit slower. That could be the reason, not generating enough gate drive for the top FETs.
Is C2 at 22uF a bit high? Was that a recommended value?
In your setup, you are not setting the "H" outputs to a defined level for a start. It is generally a good idea to do that, even if they are changed soon after. Try adding ...
digitalWrite(AH , LOW ) ;
digitalWrite(BH , LOW ) ;
digitalWrite(CH , LOW ) ;
at line 26.
 
Top