From d95bb1c141512d0ce6e964163031a550a24defd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B7=E5=BA=8A=E5=B0=B1=E7=8A=AF=E5=9B=B0?= <11730503+psx123456@user.noreply.gitee.com> Date: Thu, 20 Feb 2025 18:02:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=B5=E6=B1=A0=E6=AC=A0?= =?UTF-8?q?=E5=8E=8B=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/businessLogic/Inc/parameter.h | 1 + APP/businessLogic/Src/SOE.c | 4 ++++ APP/businessLogic/Src/inFlash.c | 1 + APP/businessLogic/Src/task.c | 22 +++++++++++++++++++++- tools/chargControlTypes.h | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) 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;