Quantcast
Channel: C2000™︎ 微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 12557

关于TMDSHV1PHINVKIT程序问题

$
0
0

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
}

请问这一小段程序具体的作用是什么?if(dwBus_Voltage_Ref >= (Gui_Bus_Volt_Ref + cBus5V))这个条件在什么情况下能成立?

麻烦工作人员给解答一下。谢谢!


Viewing all articles
Browse latest Browse all 12557

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>