diff --git a/APP/businessLogic/Inc/parameter.h b/APP/businessLogic/Inc/parameter.h index 3331e6a..dc34d0b 100644 --- a/APP/businessLogic/Inc/parameter.h +++ b/APP/businessLogic/Inc/parameter.h @@ -47,6 +47,7 @@ typedef struct _config_parameter{ float softStartVolt; /* 软启动阈值电压 */ float MPPTConstantVoltage; /* MPPT恒定输出电压 */ float MPPTReduceConstantVoltage; /* MPPT降功率运行时控制输入电压稳定值 */ + float underVoltageProtection; /* 电池欠压保护电压 */ /* SL */ uint16_t Access_Node_Type; /* 接入节点类型 */ diff --git a/APP/businessLogic/Src/SOE.c b/APP/businessLogic/Src/SOE.c index ce5292b..aafb09e 100644 --- a/APP/businessLogic/Src/SOE.c +++ b/APP/businessLogic/Src/SOE.c @@ -150,6 +150,10 @@ void insertEventsOrderRecord(eventsOrderRecordMode mode) soeInfo.insertData->temp = getSolarInCircuitVoltage(); } + else if (mode == underVoltageProtection) { + soeInfo.insertData->temp = getBatteryVoltage(); + } + else { soeInfo.count++; return; diff --git a/APP/businessLogic/Src/inFlash.c b/APP/businessLogic/Src/inFlash.c index 6ba79fe..585292d 100644 --- a/APP/businessLogic/Src/inFlash.c +++ b/APP/businessLogic/Src/inFlash.c @@ -281,6 +281,7 @@ void config_info_start(void) g_cfgParameter.softStartVolt = 18.5f; g_cfgParameter.MPPTConstantVoltage = 17.0f; g_cfgParameter.MPPTReduceConstantVoltage = 20.0f; + g_cfgParameter.underVoltageProtection = 12.0f; /* 读取的回路阻抗无效则回路阻抗设置为0 */ float fTemp; diff --git a/APP/businessLogic/Src/task.c b/APP/businessLogic/Src/task.c index ce7083b..349994a 100644 --- a/APP/businessLogic/Src/task.c +++ b/APP/businessLogic/Src/task.c @@ -362,7 +362,27 @@ void Task_refreshJudgeData(void) num = 0; setSOC(); } - + + /* 欠压保护 */ + /* 连续两次电池电压过低,则关闭输出 */ + static uint8_t numLow = 0; + static uint8_t volageLowFlag = 0; + if (getBatteryState() && getBatteryVoltage() < g_cfgParameter.underVoltageProtection) { + numLow++; + } + else { + numLow = 0; + } + if (numLow == 2) { + setPowerOutput(FALSE); + insertEventsOrderRecord(underVoltageProtection); + volageLowFlag = 1; + } + /* 电压过低后,再次恢复正常电压,则打开输出接口 */ + if (volageLowFlag && getBatteryState() && getBatteryVoltage() > g_cfgParameter.underVoltageProtection + 0.5f) { + setPowerOutput(TRUE); + volageLowFlag = 0; + } } diff --git a/tools/chargControlTypes.h b/tools/chargControlTypes.h index 80cc428..a44e6da 100644 --- a/tools/chargControlTypes.h +++ b/tools/chargControlTypes.h @@ -69,6 +69,7 @@ typedef enum { InputProtection, //软件防反输入保护 startEvent, //启动 abnormalControl, //异常控制 + underVoltageProtection, //电池的欠压保护 }eventsOrderRecordMode;