# BLDC Power Inverter Problem.. Need Help..

#### Sufi Rider

Joined Apr 8, 2016
6
Hello Friends,
I am new to the forum and new to electronics.
Soo, practically a noob here, please forgive me for the shabby diagram and poor knowledge.

But i am trying to run a BLDC motor using an Arduino based control.

Bellow is the schematic of the power inverter I am using.
M using IRF4905 P channel Mosfet.

Once I connect the power supply, I am getting continuity between source and drain with all the connections removed. Need urgent help.
Connecting the power supply just blew away all my High Side Mosfets. dont know what to do. its the second time its happening. need urgent help.

#### Attachments

• 89.4 KB Views: 8

#### wayneh

Joined Sep 9, 2010
16,568
Once I connect the power supply, I am getting continuity between source and drain with all the connections removed.
Can you please explain more what you mean by that? Do you mean the gate connections are left floating or are they tied to the upper rail with the 10k resistors?

It would be nice if you labeled the zeners with their voltages.

The IRF540s are huge overkill for switching the high-side MOSFETs. I'm not sure you need them at all?

Another obvious solution could be to check and double check the pinouts of your MOSFETs. It's really easy to confuse the pins and install them backwards. Then current flows through the body diodes whether the gate is on or not.

#### Sufi Rider

Joined Apr 8, 2016
6
Nope, The gates are tied to upper rail by 10k resistor. the zener diodes are 10v, forgot to mention. had the IRF540s extra, to used them for switching the IRF4905.
What i mean is, once I connect the power to the circuit, the higher side mosfets get damaged. I desoldered the mosfets and checked between Drain and Source. its really freaking my out. Might try using high side FET driver may be.

#### Alec_t

Joined Sep 17, 2013
11,818
Just guessing, but on connecting the supply are the Arduino I/O pins set as inputs by default? If so, despite pull-up or pull-down resistors on the FET gates there may be some interference causing uncontrolled turn-on of the FETs. That could result in damaging shoot-through.

#### Sufi Rider

Joined Apr 8, 2016
6
T
Just guessing, but on connecting the supply are the Arduino I/O pins set as inputs by default? If so, despite pull-up or pull-down resistors on the FET gates there may be some interference causing uncontrolled turn-on of the FETs. That could result in damaging shoot-through.
Thanks, but I am using either 1k or 10k resistors on all the 9 mosfets, 6 as pull down, and on upper high side mosfets as pullup resistors.

How does the shoot-through happens though? Is it reversible? I think thats what is happening in mine. But only high side IRF4905s are getting damaged. And are always allowing current then onwards irrespective of the gate state.
Tried disconnecting the arduino, in case I havent programmed it correctly, still doesnt work. Removed the gate input, left them pulled up (as P channel) and are still allowing current through.

#### Sufi Rider

Joined Apr 8, 2016
6
Just guessing, but on connecting the supply are the Arduino I/O pins set as inputs by default? If so, despite pull-up or pull-down resistors on the FET gates there may be some interference causing uncontrolled turn-on of the FETs. That could result in damaging shoot-through.
Sorry, misunderstood your point, Nope, I have set the pins to Output.

#### Sufi Rider

Joined Apr 8, 2016
6
Ok.. One more thing, after reading about shoot through, i think the problem might be because i didn't have delay in my Arduino code.
Can that be the case?

#### Sufi Rider

Joined Apr 8, 2016
6
Again Blew all the new IRF540s

Was using this circuit-
http://4.bp.blogspot.com/-0oqvn95WCf8/UPvndlg4kfI/AAAAAAAAAZw/pz0uShYp3qw/s1600/IR2110+-+2.png

Dont know whats wrong.
Bellow is the arduino code used.

C:
int HallState1; //Variables for the three hall sensors (3,2,1)
int HallState2;
int HallState3;
int HallVal = 1; //binary value of all 3 hall sensors

int mSpeed = 0; //speed level of the motor
int bSpeed = 0; //braking level
int throttle = 0; //this variable is used with analog in to measure the position of the throttle potentiometer
void setup() {
pinMode(2,INPUT);    // Hall 1
pinMode(4,INPUT);    // Hall 2
pinMode(7,INPUT);    // Hall 3

pinMode(3,OUTPUT);   // IN 1
pinMode(5,OUTPUT);   // IN 2
pinMode(6,OUTPUT);   // IN 3
pinMode(9,OUTPUT);   // EN 1
pinMode(10,OUTPUT);  // EN 2
pinMode(11,OUTPUT);  //  EN 3  // put your setup code here, to run once:

}

void loop() {
throttle = analogRead(0); //value of the throttle potentiometer
mSpeed = map(throttle, 512, 1023, 0, 255); //motoring is mapped to the top half of potentiometer
bSpeed = map(throttle, 0, 511, 255, 0);    // regenerative braking on bottom half of pot
//mSpeed = 100; //used for debugging

HallState1 = digitalRead(2);  // read input value from Hall 1
HallState2  = digitalRead(4);  // read input value from Hall 2
HallState3  = digitalRead(7);  // read input value from Hall 3 // put your main code here, to run repeatedly:

if (throttle > 511){
if (HallState1 == 1 && HallState2 == 0 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,mSpeed);
analogWrite(11,0);
analogWrite(3,255);
analogWrite(5,0);
analogWrite(6,0);
}
else if (HallState1 == 1 && HallState2 == 0 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,mSpeed);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,255);
}
else if (HallState1 == 0 && HallState2 == 0 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,mSpeed);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,255);
}
else if (HallState1 == 0 && HallState2 == 1 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,mSpeed);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,255);
analogWrite(6,0);
}
else if (HallState1 == 0 && HallState2 == 1 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,mSpeed);
analogWrite(3,0);
analogWrite(5,255);
analogWrite(6,0);
}
else if (HallState1 == 1 && HallState2 == 1 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,mSpeed);
analogWrite(3,255);
analogWrite(5,0);
analogWrite(6,0);
}
}
else {
if (HallState1 == 1 && HallState2 == 0 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,bSpeed);
analogWrite(5,0);
analogWrite(6,0);
}
else if (HallState1 == 1 && HallState2 == 0 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,bSpeed);
}
else if (HallState1 == 0 && HallState2 == 0 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,bSpeed);
}
else if (HallState1 == 0 && HallState2 == 1 && HallState3 == 1) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,bSpeed);
analogWrite(6,0);
}
else if (HallState1 == 0 && HallState2 == 1 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,bSpeed);
analogWrite(6,0);
}
else if (HallState1 == 1 && HallState2 == 1 && HallState3 == 0) {
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,0);
analogWrite(5,0);
analogWrite(6,0);

analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
analogWrite(3,bSpeed);
analogWrite(5,0);
analogWrite(6,0);
}
}
}
Moderators note: Please use code tags for pieces of code

Last edited by a moderator:

#### wayneh

Joined Sep 9, 2010
16,568
Again Blew all the new IRF540s
I thought you were blowing only the high side MOSFETs? Is this something new?

Maybe a photo is in order, to get another set of eyes on it. A pinout mistake is still possible.