0
$\begingroup$

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;
         }

   };


 }
$\endgroup$
  • 1
    $\begingroup$ Where is the schematic? $\endgroup$ – Greenonline Jul 7 '15 at 0:19
1
$\begingroup$

First thing first: you can't observe your rotor's location at 0 speed, because at 0 speed, you've got no back EMF. You must make your motor ramp to a speed that allows you to observe it electronically. This is done open-loop.

To perform your ramp, you need to generate a voltage slightly above the BEMF at the ramping speed. Slightly above means that you probably don't need 100% duty cycle. Using 100% duty cycle on a stalled motor means that you put one phase (10 mOhms) on the output of your power supply (12V ?), so you basically try to put 1000A in your motor. You'll just make either or both your ESC and/or your motor burn.

Your motor supplier should indicate the characteristics of your motor. Look for one called Kv (in RPM/V). It allows you to know what duty cycle you should use at each step of your ramp.

$\endgroup$
  • $\begingroup$ The motor that Im using is A2212/13T 1000Kv. how can I generate a ramp a little higher than the backemf? Thanks $\endgroup$ – Sahan Atulugama Jul 6 '15 at 13:13
  • $\begingroup$ I'd be very grateful if you could tell me place that i could refer to learn about this method. Thanks for helping $\endgroup$ – Sahan Atulugama Jul 6 '15 at 13:36
  • $\begingroup$ If your first step is 100rpm, your BEMF will be 0.1V. Due to various losses, let's make a 0.2V power supply. if you runs at 12V, 2% duty cycle gives you 0.24V, it's enough. You should be able to detect 0-crossing with 1V BEMF, so ramp to 1000rpm, with 1% duty cycle + 1.5% per 100rpm (1% per 100rpm should be enough). Power efficiency won't be good while ramping, but 1s should be enough, so it's a very little loss at start. I don't have any reference on this topic. $\endgroup$ – Jacen Jul 6 '15 at 13:50
  • $\begingroup$ Jacen, what is the PWM frequency and the switching frequency that I should use? Thanks for the replies. Is this known as arming the bldc motor? $\endgroup$ – Sahan Atulugama Jul 6 '15 at 15:27
  • 1
    $\begingroup$ Unless you've got very high inductance, less than 5kHz will probably decrease the efficiency of your controller. This should work anyway. To go closed loop, just use 0-crossings as trigger for the sector change, instead of the timer you were using in open loop. If you have a specific question about that, open a new topic $\endgroup$ – Jacen Sep 6 '15 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.