jayanthyk192
New Member
hi,
i'm building a 3phase brushless motor controller using P89V51RD2.i'm new to this field.i wrote a code myself.
#include<reg51.h>
#define port P0
int main(void)
{
int n=1000,i;
while(1)
{
port=0x90;
for(i=0;i<=n;i++);
if(n>10)
n--;
port=0x24;
for(i=0;i<=n;i++);
if(n>10)
n--;
port=0x48;
for(i=0;i<=n;i++);
if(n>10)
n--;
}
}
the program works,but not completely.first the motor starts,gains speed,then stops,only to make a squealing sound.what might be the problem?please help.
info:i'm not using back emf sensing.
thank you.
i'm building a 3phase brushless motor controller using P89V51RD2.i'm new to this field.i wrote a code myself.
#include<reg51.h>
#define port P0
int main(void)
{
int n=1000,i;
while(1)
{
port=0x90;
for(i=0;i<=n;i++);
if(n>10)
n--;
port=0x24;
for(i=0;i<=n;i++);
if(n>10)
n--;
port=0x48;
for(i=0;i<=n;i++);
if(n>10)
n--;
}
}
the program works,but not completely.first the motor starts,gains speed,then stops,only to make a squealing sound.what might be the problem?please help.
info:i'm not using back emf sensing.
thank you.