Skip to content

Commit

Permalink
Remove HVIL bypass. Add contactor stop
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Sep 15, 2023
1 parent f22e0fa commit bcde54c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
20 changes: 0 additions & 20 deletions Software/TESLA-MODEL-3-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ void update_values_tesla_model_3_battery()
max_target_discharge_power = max_discharge_current;

max_target_charge_power = max_charge_current;

#ifdef HVIL_OMITTED
//When HVIL is not available, battery will send 0W charge allowed. Luckily SOC% is still available, so we use this to estimate charge limits
if(SOC > 9900){ // 99%
max_target_charge_power = 0;
}
else{
max_target_charge_power = 10000;
}

if(SOC < 500){ // 5%
max_target_discharge_power = 0;
}
else{
max_target_discharge_power = 10000;
}
#endif

stat_batt_power = (volts * amps); //TODO, check if scaling is OK

Expand Down Expand Up @@ -135,9 +118,6 @@ void update_values_tesla_model_3_battery()
{
Serial.println("Please wait for Pyro Connection check to finish, HV cables successfully seated!");
}
#ifdef HVIL_OMITTED
Serial.println("!!! High voltage interlock check skipped. Proceed with caution, limits estimated with no cell monitoring!!!");
#endif

Serial.print("Contactor: ");
Serial.print(contactorText[contactor]); //Display what state the contactor is in
Expand Down
6 changes: 1 addition & 5 deletions Software/TESLA-MODEL-3-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
#include "ESP32CAN.h"
#include "USER_SETTINGS.h"

/* User definable settings for the Tesla Model 3 battery */
//#define HVIL_OMITTED //Uncomment this line to allow battery to function without HVIL condition fulfilled. NOTE: Some values not available in this mode, see wiki
// NOTE: Omitting this has consequences, battery cannot request a stop incase a cell over/undercharges!!! So try to fix HVIL as soon as possible

#define ABSOLUTE_MAX_VOLTAGE 4030 // 403.0V,if battery voltage goes over this, charging is not possible (goes into forced discharge)
#define ABSOLUTE_MIN_VOLTAGE 2450 // 245.0V if battery voltage goes under this, discharging further is disabled

// These parameters need to be mapped for the Gen24
// These parameters need to be mapped for the Inverter
extern uint16_t SOC;
extern uint16_t StateOfHealth;
extern uint16_t battery_voltage;
Expand Down

0 comments on commit bcde54c

Please sign in to comment.