mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Add contactorclosing allowed for Tesla
This commit is contained in:
parent
1b297afa91
commit
2d6026e94d
2 changed files with 19 additions and 17 deletions
|
@ -521,10 +521,12 @@ the first, for a few cycles, then stop all messages which causes the contactor
|
|||
|
||||
if (bms_status == ACTIVE) {
|
||||
send221still = 50;
|
||||
batteryAllowsContactorClosing = true;
|
||||
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
||||
ESP32Can.CANWriteFrame(&TESLA_221_2);
|
||||
} else { //bms_status == FAULT
|
||||
if (send221still > 0) {
|
||||
batteryAllowsContactorClosing = false;
|
||||
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
||||
send221still--;
|
||||
}
|
||||
|
|
|
@ -13,23 +13,23 @@
|
|||
60000 // 60000W we need to cap this value to max 60kW, most inverters overflow otherwise
|
||||
|
||||
// These parameters need to be mapped for the Inverter
|
||||
extern uint16_t SOC;
|
||||
extern uint16_t StateOfHealth;
|
||||
extern uint16_t battery_voltage;
|
||||
extern uint16_t battery_current;
|
||||
extern uint16_t capacity_Wh;
|
||||
extern uint16_t remaining_capacity_Wh;
|
||||
extern uint16_t max_target_discharge_power;
|
||||
extern uint16_t max_target_charge_power;
|
||||
extern uint16_t bms_status;
|
||||
extern uint16_t bms_char_dis_status;
|
||||
extern uint16_t stat_batt_power;
|
||||
extern uint16_t temperature_min;
|
||||
extern uint16_t temperature_max;
|
||||
extern uint16_t CANerror;
|
||||
extern uint16_t cell_max_voltage;
|
||||
extern uint16_t cell_min_voltage;
|
||||
extern uint8_t LEDcolor;
|
||||
extern uint16_t SOC; //SOC%, 0-100.00 (0-10000)
|
||||
extern uint16_t StateOfHealth; //SOH%, 0-100.00 (0-10000)
|
||||
extern uint16_t battery_voltage; //V+1, 0-500.0 (0-5000)
|
||||
extern uint16_t battery_current; //A+1, Goes thru convert2unsignedint16 function (5.0A = 50, -5.0A = 65485)
|
||||
extern uint16_t capacity_Wh; //Wh, 0-60000
|
||||
extern uint16_t remaining_capacity_Wh; //Wh, 0-60000
|
||||
extern uint16_t max_target_discharge_power; //W, 0-60000
|
||||
extern uint16_t max_target_charge_power; //W, 0-60000
|
||||
extern uint16_t bms_status; //Enum, 0-5
|
||||
extern uint16_t bms_char_dis_status; //Enum, 0-2
|
||||
extern uint16_t stat_batt_power; //W, Goes thru convert2unsignedint16 function (5W = 5, -5W = 65530)
|
||||
extern uint16_t temperature_min; //C+1, Goes thru convert2unsignedint16 function (15.0C = 150, -15.0C = 65385)
|
||||
extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 function (15.0C = 150, -15.0C = 65385)
|
||||
extern uint16_t cell_max_voltage; //mV, 0-4350
|
||||
extern uint16_t cell_min_voltage; //mV, 0-4350
|
||||
extern uint8_t LEDcolor; //Enum, 0-10
|
||||
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
|
||||
// Definitions for BMS status
|
||||
#define STANDBY 0
|
||||
#define INACTIVE 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue