Skip to content

Commit

Permalink
Fixed Autobalancer
Browse files Browse the repository at this point in the history
  • Loading branch information
shining-man committed May 3, 2024
1 parent 5a1a1e9 commit 60ec2dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "params_dt.h"
#include "bscTime.h"

#define BSC_SW_VERSION "V0.5.16"
#define BSC_SW_VERSION "V0.5.17"

static const char COMPILE_DATE_TIME[] = "";

Expand Down
2 changes: 1 addition & 1 deletion include/webpages.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const char htmlPageRoot[] PROGMEM = "<!DOCTYPE HTML>"
"</head>"
"<body>"
"<div class='topnav'>"
"<span class='hl'>Battery Safety Controller&nbsp;&nbsp;&nbsp;V0.5.16</span>"
"<span class='hl'>Battery Safety Controller&nbsp;&nbsp;&nbsp;V0.5.17</span>"
"</div>"
"<div class='content'>"
"<div class='cards'>"
Expand Down
12 changes: 6 additions & 6 deletions src/inverter/ChargeVoltageCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ namespace nsChargeVoltageCtrl
uint16_t u16_lMaxCellDiffVoltage = BmsDataUtils::getMaxCellDifferenceFromBms(inverterData.u8_bmsDatasource, inverterData.u16_bmsDatasourceAdd);
if(u16_lMaxCellDiffVoltage>u16_lDeltaCellVoltage)
{
u16_lDynamicChargeVoltage-=1; //1=100mV
if(u16_lDynamicChargeVoltage<0)u16_lDynamicChargeVoltage=0;
if (u16_lDynamicChargeVoltage > 0) u16_lDynamicChargeVoltage -= 1; //1=100mV
return u16_lDynamicChargeVoltage;
}
else if(u16_lMaxCellDiffVoltage<u16_lDeltaCellVoltage)
{
u16_lDynamicChargeVoltage+=1; //1=100mV
if(u16_lDynamicChargeVoltage>u16_lChargeVoltage)u16_lDynamicChargeVoltage=u16_lChargeVoltage;
if(u16_lDynamicChargeVoltage < u16_lChargeVoltage) u16_lDynamicChargeVoltage += 1; //1=100mV
return u16_lDynamicChargeVoltage;
}
}
Expand Down Expand Up @@ -156,7 +154,8 @@ namespace nsChargeVoltageCtrl
// Überprüfen ob Chargevoltage erreicht
if(inverterData.autobalanceVoltageErreichtTime == 0)
{
if(inverterData.batteryVoltage >= (u16_lChargeVoltage - u16_lChargeVoltage/100))
// Der Wert u16_lChargeVoltage muss x10 genommen werden, damit er dem Wert batteryVoltage entspricht
if(inverterData.batteryVoltage >= ((u16_lChargeVoltage - u16_lChargeVoltage/100)*10))
{
inverterData.autobalanceVoltageErreichtTime = millis();
if(inverterData.autobalanceVoltageErreichtTime == 0) inverterData.autobalanceVoltageErreichtTime++;
Expand Down Expand Up @@ -188,7 +187,8 @@ namespace nsChargeVoltageCtrl
}
else
{
if(inverterData.batteryVoltage >= (u16_lChargeVoltage - u16_lChargeVoltage/100))
// Der Wert u16_lChargeVoltage muss x10 genommen werden, damit er dem Wert batteryVoltage entspricht
if(inverterData.batteryVoltage >= ((u16_lChargeVoltage - u16_lChargeVoltage/100)*10))
{
inverterData.autobalanceVoltageErreichtTime = millis();
if(inverterData.autobalanceVoltageErreichtTime == 0) inverterData.autobalanceVoltageErreichtTime++;
Expand Down
2 changes: 1 addition & 1 deletion src/inverter/InverterBattery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ namespace nsInverterBattery
}
else
{
return (int16_t)(getBmsTempature(inverterData.u8_bmsDatasource,0)*10); //Im Fehlerfall immer Sensor 0 des BMS nehmen
return (int16_t)(getBmsTempature(inverterData.u8_bmsDatasource,0)); //Im Fehlerfall immer Sensor 0 des BMS nehmen
}
}
else if(u8_lBmsTempQuelle==2)
Expand Down

0 comments on commit 60ec2dc

Please sign in to comment.