Add Solax-Tesla waiting for contactor close

This commit is contained in:
Daniel 2023-11-28 10:48:18 +02:00
parent 2d6026e94d
commit dcd525cfc3
2 changed files with 13 additions and 10 deletions

View file

@ -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--;
}
} }
} }
} }

View file

@ -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