void sSoftStartMode(void)
{
static int16 wTemp = 0;
if(FSuperFlag.BIT.FwFault == 1)
{
mALL_PWM_OFF(); mFREE_RUN_OFF();
mOPRLY_OFF(); wSysMode = cFaultMode;
return;
}
if(FSuperFlag.BIT.FwTurnOff == 1) //
{
FSuperFlag.BIT.FwTurnOff = 0;
mALL_PWM_OFF(); mFREE_RUN_OFF();
mOPRLY_OFF(); //输出侧继电器关闭(不接通回路)
wSysMode = cStandByMode;
wTurnOffByButton = 1;
FSuperFlag.BIT.FwWarning = 1;
wTemp = 0;
return;
}
if(FSuperFlag.BIT.FwOpRlyStatus == 0)//继电器状态未接通回路
{
wTemp = 0;
mOPRLY_ON(); //Output relay switch to the main circuit side 输出继电器开关接通至主电路
dwBus_Voltage_Ref = Gui_Bus_Volt_Ref;
}
else //The relay is on the main circuit side 继电器状态为接通主回路
{
wTemp++;
if(wTemp < 2) //40ms, waiting for the relay 等待继电器
{
return;
}
if(FSuperFlag.BIT.FwPwmStatus == 0)
{
//dwBus_Voltage_Ref = dwBus_Voltage_Fbk;
mFREE_RUN_ON();//GPOUT
DINT;
DPL_Zero_Buff();
EINT;
mALL_PWM_ON(); //Turn on the PWMs //wTemp = 0;
return; }
if((dwBus_Voltage_Fbk <= (Gui_Bus_Volt_Ref + cBus10V)) &&
(dwBus_Voltage_Fbk > (Gui_Bus_Volt_Ref – cBus10V))) //dwBus_Voltage_Fbk
{
wSysMode = cNormalInvMode;
dwBus_Voltage_Ref = Gui_Bus_Volt_Ref;
wTemp = 0;
return;
}
if(dwBus_Voltage_Ref >= (Gui_Bus_Volt_Ref + cBus5V))
{
dwBus_Voltage_Ref -= cBus1V; //Increase the BUS by 1V per 20ms
}
#if(Protect_Enable == 1) // #define Protect_Enable 1
if(wTemp >= 1000) // >10s
{
//wTemp = 500; //For test
mALL_PWM_OFF(); mFREE_RUN_OFF();
asm(" nop");
asm(" nop");
asm(" nop");
asm(" nop");
mOPRLY_OFF(); wSysMode = cFaultMode;
Gui_wFaultCode = cSoftStartFail;
FSuperFlag.BIT.FwFault = 1;
wSysMode = cStandByMode;
wTemp = 0;
return;
} #endif }
}
以上是例程中工作在软启动的子程序。其中33行语句dwBus_Voltage_Ref = Gui_Bus_Volt_Ref;其中Gui_Bus_Volt_Ref在程序中的初始值cBus380V。
第62行的程序:
if(dwBus_Voltage_Ref >= (Gui_Bus_Volt_Ref + cBus5V))
{
dwBus_Voltage_Ref -= cBus1V; //Increase the BUS by 1V per 20ms
}
请问这一小段程序具体的作用是什么?dwBus_Voltage_Ref 与Gui_Bus_Volt_Ref 在什么情况下出现偏差?
第二个问题如下:
在程序中判断故障的内容中如过电流检测如下:
if(sOverRangeChk(Gui_wInvCurrRms,Gui_wInvCurr_High_Limit,&Gui_wInvCurrChkCnt,6) == 1)
{
FSuperFlag.BIT.FwFault = 1;
Gui_wFaultCode = cInvCurrOver;
FSuperFlag.BIT.FwTurnOnConditionOk = 0;
wSysStatusCheckCnt = 0;
if((FSuperFlag.BIT.FwAutoStartOnEn == 1) && (wSysMode == cNormalInvMode))
{
FSuperFlag.BIT.FwAutoStart = 1;
}
return;
}
其中
if((FSuperFlag.BIT.FwAutoStartOnEn == 1) && (wSysMode == cNormalInvMode))
{
FSuperFlag.BIT.FwAutoStart = 1;
}
程序意思是说当FSuperFlag.BIT.FwAutoStart = 1;时在故障状态时可以自动返回待机状态。但是条件中(FSuperFlag.BIT.FwAutoStartOnEn == 1) && (wSysMode == cNormalInvMode)在程序中是无法同时实现的吧。不知道这个条件如何同时成立。因为在进入cNormalInvMode之前FwAutoStartOnEn必然被清0了。麻烦工作人员给解答一下吧。谢谢!