Skip to content

Commit

Permalink
Add freezing temperature overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Nov 26, 2023
1 parent aba846d commit 3d79b09
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Software/src/inverter/BYD-MODBUS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

void update_modbus_registers_byd() {
//Updata for ModbusRTU Server for BYD
verify_temperature_modbus();
handle_update_data_modbusp201_byd();
handle_update_data_modbusp301_byd();
}
Expand Down Expand Up @@ -106,3 +107,20 @@ void handle_update_data_modbusp301_byd() {
static uint16_t i = 300;
memcpy(&mbPV[i], battery_data, sizeof(battery_data));
}

void verify_temperature_modbus() {
// This section checks if the battery temperature is negative, and incase it falls between -9.0 and -20.0C degrees
// The Fronius Gen24 (and other Fronius inverters also affected), will stop charge/discharge if the battery gets colder than -10°C.
// This is due to the original battery pack (BYD HVM), is a lithium iron phosphate battery, that cannot be charged in cold weather.
// When using EV packs with NCM/LMO/NCA chemsitry, this is not a problem, since these chemistries are OK for outdoor cold use.
if (temperature_min > 32768) { // Signed value on negative side
if (temperature_min < 65445 && temperature_min > 65335) { // Between -9.0 and -20.0C degrees
temperature_min = 65445; //Cap value to -9.0C
}
}
if (temperature_max > 32768) { // Signed value on negative side
if (temperature_max < 65445 && temperature_max > 65335) { // Between -9.0 and -20.0C degrees
temperature_max = 65445; //Cap value to -9.0C
}
}
}
1 change: 1 addition & 0 deletions Software/src/inverter/BYD-MODBUS.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern uint16_t max_voltage;
extern uint16_t min_voltage;

void handle_static_data_modbus_byd();
void verify_temperature_modbus();
void handle_update_data_modbusp201_byd();
void handle_update_data_modbusp301_byd();
void update_modbus_registers_byd();
Expand Down

0 comments on commit 3d79b09

Please sign in to comment.