mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 10:49:42 +02:00
Add Solax-Tesla waiting for contactor close
This commit is contained in:
parent
2d6026e94d
commit
dcd525cfc3
2 changed files with 13 additions and 10 deletions
|
@ -519,16 +519,18 @@ the first, for a few cycles, then stop all messages which causes the contactor
|
||||||
if (currentMillis - previousMillis30 >= interval30) {
|
if (currentMillis - previousMillis30 >= interval30) {
|
||||||
previousMillis30 = currentMillis;
|
previousMillis30 = currentMillis;
|
||||||
|
|
||||||
if (bms_status == ACTIVE) {
|
if (inverterAllowsContactorClosing == 1) {
|
||||||
send221still = 50;
|
if (bms_status == ACTIVE) {
|
||||||
batteryAllowsContactorClosing = true;
|
send221still = 50;
|
||||||
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
batteryAllowsContactorClosing = true;
|
||||||
ESP32Can.CANWriteFrame(&TESLA_221_2);
|
|
||||||
} else { //bms_status == FAULT
|
|
||||||
if (send221still > 0) {
|
|
||||||
batteryAllowsContactorClosing = false;
|
|
||||||
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
||||||
send221still--;
|
ESP32Can.CANWriteFrame(&TESLA_221_2);
|
||||||
|
} else { //bms_status == FAULT or inverter requested opening contactors
|
||||||
|
if (send221still > 0) {
|
||||||
|
batteryAllowsContactorClosing = false;
|
||||||
|
ESP32Can.CANWriteFrame(&TESLA_221_1);
|
||||||
|
send221still--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
|
||||||
extern uint16_t cell_max_voltage; //mV, 0-4350
|
extern uint16_t cell_max_voltage; //mV, 0-4350
|
||||||
extern uint16_t cell_min_voltage; //mV, 0-4350
|
extern uint16_t cell_min_voltage; //mV, 0-4350
|
||||||
extern uint8_t LEDcolor; //Enum, 0-10
|
extern uint8_t LEDcolor; //Enum, 0-10
|
||||||
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
|
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
|
||||||
|
extern bool inverterAllowsContactorClosing; //Bool, 1=true, 0=false
|
||||||
// Definitions for BMS status
|
// Definitions for BMS status
|
||||||
#define STANDBY 0
|
#define STANDBY 0
|
||||||
#define INACTIVE 1
|
#define INACTIVE 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue