# Brushless DC motor - Electronic Speed Control - Quadcopter

I'm a student who is doing electrical and electronics engineering. I'm currently doing my final project which is a quadcopter. One of my objectives in that is to make a Electronic Speed Controller (ESC) for the brushless motors that are being used.

I made a design for the ESC using proteus and I made the PCB also. I have attached the schematic. I used PIC16F628A for the ESC and wrote a small code in mikroC for the ESC to work when powered up. Unfortunately it didn't work properly. I tried sensorless control of brushless motors without getting any feedback.

Can I know how much of current that I should provide for the motor? According to some articles that I read the brushless DC (BLDC) motor requires around 10A at the startup for around 20 ms. I have posted the code also. I used two codes to run the motor. One with PWM and other without PWM (100% duty cycle).

I am a rookie to the subject of BLDC motor controlling. I am very grateful if anybody can help me to clear out the doubts and figure out the mistakes in my design to make it work properly.

Below given is the code that I tried. Please help me to figure out the right way to program the chip.

    const delay = 7000;

void main() {
TRISB = 0x00;
PORTB = 0x00;

while(1)
{
PORTB = 0x24;
delay_us(delay);

PORTB = 0x36;
delay_us(delay);

PORTB = 0x12;
delay_us(delay);

PORTB = 0x1B;
delay_us(delay);

PORTB = 0x09;
delay_us(delay);

PORTB = 0x2D;
delay_us(delay);
}

}


When I uploaded the above given code and when I set the delay to around 3000 μs, the motor spun but at each time one of the MOSFETs got heated up until I cannot touch it anymore. Here is the video of this scenario.

This is the other code (PWM);

const delay1 = 2000;
const delay2 = 1000;
int count = 0;
int cnt;
int arr[6] = {0x24, 0x36, 0x12, 0x1B, 0x09, 0x2D};
int i = 0;
int x =  0x32;

void init(void)
{
TRISB = 0x00;
PORTB = 0x00;
//OPTION_REG = 0x87;
//INTCON = 0xA0;
CCP1CON = 0;
CMCON = 0x07;
}

void main() {
init();
while(1){

for (cnt = 0; cnt < 10; cnt++)
{
PORTB = arr[i];
delay_us(2);
PORTB = 0x07;
delay_us(2);

}

i++;

if (i == 6)
{
i =0;
}

};

}

• Where is the schematic? – Greenonline Jul 7 '15 at 0:19