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
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
-
136.8 KB Views: 30