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,12 +519,13 @@ the first, for a few cycles, then stop all messages which causes the contactor
if (currentMillis - previousMillis30 >= interval30) {
previousMillis30 = currentMillis;
if (inverterAllowsContactorClosing == 1) {
if (bms_status == ACTIVE) {
send221still = 50;
batteryAllowsContactorClosing = true;
ESP32Can.CANWriteFrame(&TESLA_221_1);
ESP32Can.CANWriteFrame(&TESLA_221_2);
} else { //bms_status == FAULT
} else { //bms_status == FAULT or inverter requested opening contactors
if (send221still > 0) {
batteryAllowsContactorClosing = false;
ESP32Can.CANWriteFrame(&TESLA_221_1);
@ -533,6 +534,7 @@ the first, for a few cycles, then stop all messages which causes the contactor
}
}
}
}
uint16_t convert2unsignedInt16(int16_t signed_value) {
if (signed_value < 0) {
return (65535 + signed_value);

View file

@ -30,6 +30,7 @@ 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
extern bool inverterAllowsContactorClosing; //Bool, 1=true, 0=false
// Definitions for BMS status
#define STANDBY 0
#define INACTIVE 1