From b474462ac64613297fb8712db2483f9c0f62e92f 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, 25 Sep 2025 15:19:00 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=87=E6=A0=B7=E7=94=B5=E9=98=BB=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=EF=BC=8C=E6=B1=87=E6=BA=90=E7=BD=91=E5=85=B3=E9=80=82?=
=?UTF-8?q?=E9=85=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
APP/businessLogic/Src/bl_chargControl.c | 16 +--
APP/businessLogic/Src/bl_usart.c | 2 +-
APP/functionalModule/Src/capture.c | 9 +-
EWARM/chargeController.ewd | 150 ++++++++++++------------
EWARM/stm32g431xx_flash.icf | 2 +-
5 files changed, 91 insertions(+), 88 deletions(-)
diff --git a/APP/businessLogic/Src/bl_chargControl.c b/APP/businessLogic/Src/bl_chargControl.c
index 6c5cfdb..7878450 100644
--- a/APP/businessLogic/Src/bl_chargControl.c
+++ b/APP/businessLogic/Src/bl_chargControl.c
@@ -394,7 +394,7 @@ void mppt_readJust(void)
/* 延时一段时间才判断 */
static uint16_t flag = 0;
flag++;
- if (flag < 200) {
+ if (flag < 250) {
// float pv1Volt = getSolarInCircuitVoltage();
// float error = pv1Volt - SolarInCircuitV;
// float stepPwm = kp * error + ki * pv1Volt;
@@ -432,7 +432,7 @@ void mppt_readJust(void)
static uint8_t currMinFlag1 = 0;
// if (getChargCurrent() < 0.8f) {
- if (totalChargeCurr < 100) {
+ if (totalChargeCurr < 200) {
// hysteresisValue1 = getChargCurrent() * 1.7f;
// hysteresisValue2 = getChargCurrent() * 12;
currMinFlag++;
@@ -446,20 +446,20 @@ void mppt_readJust(void)
}
// else if (getChargCurrent() < 3 && currMinFlag1) {
- else if (totalChargeCurr < 150 && currMinFlag1) {
+ else if (totalChargeCurr < 250 && currMinFlag1) {
// currMinFlag1 = 0;
currMinFlag = 0;
return;
}
// else if (getChargCurrent() < 5) {
- else if (totalChargeCurr < 250) {
+ else if (totalChargeCurr < 300) {
currMinFlag1 = 0;
currMinFlag = 0;
// hysteresisValue1 = getChargCurrent() * 1.1f;
// hysteresisValue2 = getChargCurrent() * 10;
- hysteresisValue1 = totalChargeCurr / 35.0f;
- hysteresisValue2 = totalChargeCurr / 3.5f;
+ hysteresisValue1 = totalChargeCurr / 25.0f;
+ hysteresisValue2 = totalChargeCurr / 2.5f;
}
// else if (getChargCurrent() < 13) {
@@ -468,8 +468,8 @@ void mppt_readJust(void)
currMinFlag = 0;
// hysteresisValue1 = getChargCurrent() * 1.1f;
// hysteresisValue2 = getChargCurrent() * 10;
- hysteresisValue1 = totalChargeCurr / 45.0f;
- hysteresisValue2 = totalChargeCurr / 4.5f;
+ hysteresisValue1 = totalChargeCurr / 35.0f;
+ hysteresisValue2 = totalChargeCurr / 3.5f;
}
// else if (getChargCurrent() < 20) {
diff --git a/APP/businessLogic/Src/bl_usart.c b/APP/businessLogic/Src/bl_usart.c
index d009776..8abf193 100644
--- a/APP/businessLogic/Src/bl_usart.c
+++ b/APP/businessLogic/Src/bl_usart.c
@@ -21,7 +21,7 @@
#define HY_communicationIDStartAddr (HY_hardWordIDStartAddr + HY_hardWordIDSize)
#define HY_communicationIDSize 4
static uint8_t HY_hardWordID[HY_hardWordIDSize] = {0x48, 0x59, 0x30, 0x30, 0x30, 0x31};
-static uint8_t HY_communicationID[HY_communicationIDSize] = {0x00, 0x00, 0x00, 0x01};
+static uint8_t HY_communicationID[HY_communicationIDSize] = {0x00, 0x00, 0x00, 0x02};
static uint8_t HY_startFlag = 0x68;
static uint8_t HY_endFlag = 0x16;
diff --git a/APP/functionalModule/Src/capture.c b/APP/functionalModule/Src/capture.c
index 878f40d..bf6549d 100644
--- a/APP/functionalModule/Src/capture.c
+++ b/APP/functionalModule/Src/capture.c
@@ -188,11 +188,14 @@ void proportionalInt(int mode)
if (mode) {
/* 光伏充电输出电流比例,放大倍数*电阻 */
// P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.01 + 1 / 0.002)))) * Proportion;
- P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.001 + 1 / 0.002)))) * Proportion;
+ // P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.001 + 1 / 0.002)))) * Proportion;
+ P_CHG_CURR = (1.0 / (50 * (1 / (1 / 0.002 + 1 / 0.002)))) * Proportion;
/* 充电控制盒输出电压比例,分压系数 */
- P_PV_VOLT_OUT = ((56.0 + 10.0) / 10.0) * Proportion;
+ // P_PV_VOLT_OUT = ((56.0 + 10.0) / 10.0) * Proportion;
+ P_PV_VOLT_OUT = ((47.0 + 4.7) / 4.7) * Proportion;
/* 放电电流采集电流倍数 */
- P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 + 1 / 0.001)))) * Proportion;
+ // P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 + 1 / 0.001)))) * Proportion;
+ P_DSG_CURR = (1.0 / (50 * (1 / (1 / 0.002 + 1 / 0.002)))) * Proportion;
/* 光伏板输出电压比例 */
P_PV1_VOLT_IN = ((47.0 + 4.7) / 4.7) * Proportion;
/* 系统电源电压比例 */
diff --git a/EWARM/chargeController.ewd b/EWARM/chargeController.ewd
index 7965952..c6ca389 100644
--- a/EWARM/chargeController.ewd
+++ b/EWARM/chargeController.ewd
@@ -36,7 +36,7 @@
@@ -294,7 +294,7 @@
@@ -1905,7 +1905,7 @@