BJX 302A BLDC驱动器——5BLDC三段启动定位及加速
1.预定位 两条曲线,第一条占空比累加曲线,第二条定位时间累加。
1 void Counterpoint(void) 2 { 3 PointDlyCurAddCycle++; 4 if(PointDlyCurAddCycle>=3) 5 { 6 PointDlyCurAddCycle = 0; 7 PointCurVlue++; 8 } 9 if(PointCurVlue >= 75) 10 { 11 PointCurVlue = 75; 12 PointDlyCnt++; 13 } 14 if(PointDlyCnt >= 20) 15 { 16 PointDlyCnt = 20; 17 MotorState = 2; //切换到加速模式 18 } 19 PwmDuty(PointCurVlue,PointCurVlue,PointCurVlue); 20 SixStep(1); 21 }
2.加速阶段 每个阶段6圈,共12阶段加速,周期越来越短。每圈对应6相,上阶段相位持续时间比下阶段每相位多一个时间周期,加速就是减少相位的持续时间,加大相位的电流。
1 void Accelerate(void) 2 { 3 AccelerateCycle++; 4 if(AccelerateCycle >= AccelerateCycleValue) 5 { 6 AccelerateCycle = 0; 7 AccelerateStep++; 8 if(AccelerateStep >= 7) 9 { 10 AccelerateStep = 1; 11 } 12 if(AccelerateStep == 1) 13 { 14 AccelerateCnt++; 15 } 16 17 if(AccelerateCnt >= 6) 18 { 19 AccelerateCnt = 0; 20 AccelerateCycleValue--; 21 if(AccelerateCycleValue <= 8) 22 { 23 MotorState = 3; 24 } 25 } 26 27 PwmDuty(PointCurVlue,PointCurVlue,PointCurVlue); 28 SixStep(AccelerateStep); 29 } 30 }
下篇主要讲闭环运行,主要有两个细节,一个过零点检测,一个是延时换相。

浙公网安备 33010602011771号