提交 211df922 作者: wysheng

完善交流输入电压检测与异常上报

上级 0137a391
...@@ -2225,6 +2225,20 @@ void InformationReporting_22_A(void) ...@@ -2225,6 +2225,20 @@ void InformationReporting_22_A(void)
InformainReport_A.InfRe.InVoltHi = 00; InformainReport_A.InfRe.InVoltHi = 00;
InformainReport_A.InfRe.InVoltlo = 00; InformainReport_A.InfRe.InVoltlo = 00;
extern s8 getDcMoudleVoltChkCnt(void);
if(PillarError.Value.InVolt)
{
if(getDcMoudleVoltChkCnt() >= 5)
{
InformainReport_A.InfRe.InVoltHi = 1;
}
else if(getDcMoudleVoltChkCnt() <= -5)
{
InformainReport_A.InfRe.InVoltlo = 1;
}
}
if ((ChargeStopType == eChgStop_Run_VoltOutHighErr) && (TCUCurChgRecd.TCUChargeEnable == 1)) if ((ChargeStopType == eChgStop_Run_VoltOutHighErr) && (TCUCurChgRecd.TCUChargeEnable == 1))
InformainReport_A.InfRe.DcVolHi = 01; InformainReport_A.InfRe.DcVolHi = 01;
...@@ -2341,7 +2355,19 @@ void InformationReporting_22_B(void) ...@@ -2341,7 +2355,19 @@ void InformationReporting_22_B(void)
InformainReport_B.InfRe.InVoltHi = 00; InformainReport_B.InfRe.InVoltHi = 00;
InformainReport_B.InfRe.InVoltlo = 00; InformainReport_B.InfRe.InVoltlo = 00;
extern s8 getDcMoudleVoltChkCnt(void);
if(PillarError_B.Value.InVolt)
{
if(getDcMoudleVoltChkCnt() >= 5)
{
InformainReport_B.InfRe.InVoltHi = 1;
}
else if(getDcMoudleVoltChkCnt() <= -5)
{
InformainReport_B.InfRe.InVoltlo = 1;
}
}
if ((ChargeStopType_B == eChgStop_Run_VoltOutHighErr) && (TCUCurChgRecd_B.TCUChargeEnable == 1)) if ((ChargeStopType_B == eChgStop_Run_VoltOutHighErr) && (TCUCurChgRecd_B.TCUChargeEnable == 1))
InformainReport_B.InfRe.DcVolHi = 01; InformainReport_B.InfRe.DcVolHi = 01;
else else
......
...@@ -620,3 +620,36 @@ void GetNXRAcVolt(CanRxMsg* RxMsg) ...@@ -620,3 +620,36 @@ void GetNXRAcVolt(CanRxMsg* RxMsg)
} }
} }
static s8 DcModleVoltChkCnt = 0;
void DcModleVoltDetect(u16 Voltage)
{
if(UserParam.VoltHigh < (u16)(Voltage))
{
if(DcModleVoltChkCnt < 5)
DcModleVoltChkCnt++;
else
DcModleVoltChkCnt = 5;
}
else if(UserParam.VoltLow > (u16)(Voltage))
{
if(DcModleVoltChkCnt > -5)
DcModleVoltChkCnt--;
else
DcModleVoltChkCnt = -5;
}
else
{
if(DcModleVoltChkCnt > 0)
DcModleVoltChkCnt--;
else if(DcModleVoltChkCnt < 0)
DcModleVoltChkCnt ++;
else
DcModleVoltChkCnt = 0;
}
}
s8 getDcMoudleVoltChkCnt(void)
{
return DcModleVoltChkCnt;
}
...@@ -744,7 +744,8 @@ void Thd_Mult(void const *parameter) ...@@ -744,7 +744,8 @@ void Thd_Mult(void const *parameter)
PillarError_B.Value.ACMeter = 0; PillarError_B.Value.ACMeter = 0;
} }
/*输入电压异常检测*/ /*输入电压异常检测*/
if((5 == VoltChkCnt) || (-5 == VoltChkCnt)) extern s8 getDcMoudleVoltChkCnt(void);
if((5 == getDcMoudleVoltChkCnt()) || (-5 == getDcMoudleVoltChkCnt()))
{ {
PillarError.Value.InVolt = 1; PillarError.Value.InVolt = 1;
PillarError_B.Value.InVolt = 1; PillarError_B.Value.InVolt = 1;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论