Skip to content

Commit

Permalink
fixed max dis-/charge current limits readings
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-republic committed Dec 27, 2024
1 parent bd4722a commit ec3ca9b
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void getBatteryTypeInfo(final DalyMessage msg, final BMS bms) {

battery.type = msg.data.get();

LOG.debug("battery type={}=" + battery.type);
LOG.debug("battery type={}", battery.type);
}


Expand All @@ -118,20 +118,20 @@ private void getRatedCapacityAndCellVoltage(final DalyMessage msg, final BMS bms
battery.ratedCellmV = msg.data.getInt(); // in mV
battery.ratedCapacitymAh = msg.data.getInt(); // in mAh

LOG.debug("ratedCellmV={}, ratedCapacitymAh=" + battery.ratedCellmV, battery.ratedCapacitymAh);
LOG.debug("ratedCellmV={}, ratedCapacitymAh={}", battery.ratedCellmV, battery.ratedCapacitymAh);
}


private void getPackDischargeChargeLimits(final DalyMessage msg, final BMS bms) {
final BatteryPack battery = bms.getBatteryPack(BATTERY_ID);

battery.maxPackDischargeCurrent = 30000 - msg.data.getShort(); // 30000 offset
battery.maxPackDischargeCurrent = msg.data.getShort() - 30000; // 30000 offset
// skip the next 2 bytes because only reading level 1
msg.data.getShort();

battery.maxPackChargeCurrent = 30000 - msg.data.getShort(); // 30000 offset
battery.maxPackChargeCurrent = msg.data.getShort() - 30000; // 30000 offset

LOG.debug("maxPackChargeCurrent={}, maxPackDischargeCurrent=" + battery.maxPackChargeCurrent, battery.maxPackDischargeCurrent);
LOG.debug("maxPackChargeCurrent={}, maxPackDischargeCurrent={}", battery.maxPackChargeCurrent, battery.maxPackDischargeCurrent);
}


Expand Down Expand Up @@ -185,7 +185,7 @@ private void getMinMaxCellVoltage(final DalyMessage msg, final BMS bms) throws I
+ "\tMax Voltage: Cell {}({}mV)\n"
+ "\tMin Voltage: Cell {}({}mV)\n"
+ "\tDifference: {}mV",
bms.getBmsId() + 1, battery.maxCellVNum, battery.maxCellmV, battery.minCellVNum, battery.minCellmV, battery.cellDiffmV);
bms.getBmsId(), battery.maxCellVNum, battery.maxCellmV, battery.minCellVNum, battery.minCellmV, battery.cellDiffmV);
}
}

Expand All @@ -205,7 +205,7 @@ private void getPackTemp(final DalyMessage msg, final BMS bms) throws IOExceptio
+ "\tMax: {}C\n"
+ "\tMin: {}C\n"
+ "\tAvg: {}C",
bms.getBmsId() + 1, battery.tempMax / 10f, battery.tempMin / 10f, battery.tempAverage / 10f);
bms.getBmsId(), battery.tempMax / 10f, battery.tempMin / 10f, battery.tempAverage / 10f);
}
}

Expand Down

0 comments on commit ec3ca9b

Please sign in to comment.