summaryrefslogtreecommitdiff
path: root/battery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'battery.cpp')
-rw-r--r--battery.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/battery.cpp b/battery.cpp
index e0b7c26..d4a8ae7 100644
--- a/battery.cpp
+++ b/battery.cpp
@@ -4,6 +4,7 @@ Battery::Battery() :
activeBattery(batteries[LiionPhosphate]),
systemVoltage(0),
peakPower(0),
+ minimumAllowableSOC(0),
packDischargeRate(0),
packChargeRate(0),
packWeight(0),
@@ -26,6 +27,10 @@ void Battery::setPeakSystemPower(double power)
{
peakPower = power;
}
+void Battery::setMinimumSOC(double SOC)
+{
+ minimumAllowableSOC = SOC;
+}
void Battery::calculate()
{
@@ -43,7 +48,8 @@ int Battery::parallelCells(void)
float Battery::minimumPackVoltage(void)
{
- return seriesCells()*activeBattery.minimumVoltage;
+ float min = seriesCells()*activeBattery.minimumVoltage;
+ return (min) + (maximumPackVoltage()-min)*(minimumAllowableSOC*0.01);
}
float Battery::maximumPackVoltage(void)