Skip to content

Commit

Permalink
Make LFP_Chemistry global
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Nov 28, 2023
1 parent 3d79b09 commit ced6963
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Software/Software.ino
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ uint16_t bms_status = ACTIVE; // ACTIVE - [0..5]<>[STANDBY,INACTIVE,DARKSTA
uint16_t stat_batt_power = 0; // Power going in/out of battery
uint16_t cell_max_voltage = 3700; // Stores the highest cell voltage value in the system
uint16_t cell_min_voltage = 3700; // Stores the minimum cell voltage value in the system
bool LFP_Chemistry = false;

// LED parameters
Adafruit_NeoPixel pixels(1, WS2812_PIN, NEO_GRB + NEO_KHZ800);
Expand Down
1 change: 0 additions & 1 deletion Software/src/battery/TESLA-MODEL-3-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ static uint8_t packContactorSetState = 0;
static uint8_t packCtrsClosingAllowed = 0;
static uint8_t pyroTestInProgress = 0;
static uint8_t send221still = 10;
static bool LFP_Chemistry = false;
//Fault codes
static uint8_t WatchdogReset = 0; //Warns if the processor has experienced a reset due to watchdog reset.
static uint8_t PowerLossReset = 0; //Warns if the processor has experienced a reset due to power loss.
Expand Down
1 change: 1 addition & 0 deletions Software/src/battery/TESLA-MODEL-3-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern uint16_t CANerror;
extern uint16_t cell_max_voltage;
extern uint16_t cell_min_voltage;
extern uint8_t LEDcolor;
extern bool LFP_Chemistry;
// Definitions for BMS status
#define STANDBY 0
#define INACTIVE 1
Expand Down
3 changes: 3 additions & 0 deletions Software/src/inverter/BYD-MODBUS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ void handle_update_data_modbusp301_byd() {
}

void verify_temperature_modbus() {
if (LFP_Chemistry) {
return; // Skip the following section
}
// 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.
Expand Down
1 change: 1 addition & 0 deletions Software/src/inverter/BYD-MODBUS.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern uint16_t capacity_Wh_startup;
extern uint16_t max_power;
extern uint16_t max_voltage;
extern uint16_t min_voltage;
extern bool LFP_Chemistry;

void handle_static_data_modbus_byd();
void verify_temperature_modbus();
Expand Down

0 comments on commit ced6963

Please sign in to comment.