mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 19:42:08 +02:00
Add cellamount LFP autodetect
This commit is contained in:
parent
4bcd7c91a2
commit
77345ec41f
1 changed files with 5 additions and 1 deletions
|
@ -244,7 +244,7 @@ void update_values_battery() { //This function maps all the values fetched via
|
|||
|
||||
cell_deviation_mV = (cell_max_v - cell_min_v);
|
||||
|
||||
//Determine which chemistry battery pack is using (crude method, TODO: replace with real CAN data later)
|
||||
//Determine which chemistry battery pack is using (crude method, TODO: replace with real CAN identifier later)
|
||||
if (soc_vi > 900) { //When SOC% is over 90.0%, we can use max cell voltage to estimate what chemistry is used
|
||||
if (cell_max_v < 3450) {
|
||||
LFP_Chemistry = true;
|
||||
|
@ -253,6 +253,10 @@ void update_values_battery() { //This function maps all the values fetched via
|
|||
LFP_Chemistry = false;
|
||||
}
|
||||
}
|
||||
// An even better way is to check how many cells are in the pack. NCM/A batteries have 96s, LFP has 102-106s
|
||||
if (nof_cellvoltages > 101) {
|
||||
LFP_Chemistry = true;
|
||||
}
|
||||
|
||||
//Check if SOC% is plausible
|
||||
if (battery_voltage >
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue