|
来自EEWORLD合作qq群:49900581 群主:wangkj
void SetPhase (unsigned char direction,unsigned char BLDCstatus,unsigned int power)
{
if(direction==BLDC_CLOCKWISE) //正转
{
switch(BLDCstatus)
{
case 1: SetGate(1,2,power);break;
case 2: SetGate(3,2,power);break;
case 3: SetGate(3,4,power);break;
case 4: SetGate(5,4,power);break;
case 5: SetGate(5,6,power);break;
case 6: SetGate(1,6,power);break;
default:SetGate(0,0,power);break;
}
}
else if(direction==BLDC_ANTI_CLOCKWISE)//反转
{
switch(BLDCstatus)
{
case 1: SetGate(5,4,power);break;
case 2: SetGate(5,6,power);break;
case 3: SetGate(1,6,power);break;
case 4: SetGate(1,2,power);break;
case 5: SetGate(3,2,power);break;
case 6: SetGate(3,4,power);break;
default:SetGate(0,0,power);break;
}
}
else { }
}
可以正转。。反转时动都不动一下。
|
|