Merge pull request #1548 from dalathegreat/improvement/volvo-low-12V

Volvo SPA: Add low 12V voltage safety
This commit is contained in:
Daniel Öster 2025-09-22 10:34:22 +03:00 committed by GitHub
commit 0aaab6d4b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View file

@ -86,6 +86,13 @@ void VolvoSpaBattery::
datalayer.battery.info.total_capacity_Wh = 69511;
}
}
//Check safeties
if (datalayer_extended.VolvoPolestar.BECMsupplyVoltage < 10700) { //10.7V,
//If 12V voltage goes under this, latch battery OFF to prevent contactors from swinging between on/off
set_event(EVENT_12V_LOW, (datalayer_extended.VolvoPolestar.BECMsupplyVoltage / 100));
set_event(EVENT_BATTERY_CHG_DISCHG_STOP_REQ, 0);
}
}
void VolvoSpaBattery::handle_incoming_can_frame(CAN_frame rx_frame) {

View file

@ -12,7 +12,7 @@ class VolvoSpaHtmlRenderer : public BatteryHtmlRenderer {
content += "</h4><h4>BECM reported number of DTCs: " + String(datalayer_extended.VolvoPolestar.DTCcount) + "</h4>";
content += "<h4>BECM reported SOC: " + String(datalayer_extended.VolvoPolestar.soc_bms / 10.0) + " %</h4>";
content += "<h4>Calculated SOC: " + String(datalayer_extended.VolvoPolestar.soc_calc / 10.0) + " %</h4>";
content += "<h4>Rescaled SOC: " + String(datalayer_extended.VolvoPolestar.soc_rescaled / 10.0) + " %</h4>";
content += "<h4>Rescaled SOC: " + String(datalayer_extended.VolvoPolestar.soc_rescaled / 100.0) + " %</h4>";
content += "<h4>BECM reported SOH: " + String(datalayer_extended.VolvoPolestar.soh_bms / 100.0) + " %</h4>";
content += "<h4>BECM supply voltage: " + String(datalayer_extended.VolvoPolestar.BECMsupplyVoltage) + " mV</h4>";

View file

@ -766,7 +766,7 @@ struct DATALAYER_INFO_VOLVO_POLESTAR {
uint16_t soc_calc = 0;
uint16_t soc_rescaled = 0;
uint16_t soh_bms = 0;
uint16_t BECMsupplyVoltage = 0;
uint16_t BECMsupplyVoltage = 12000;
uint16_t BECMBatteryVoltage = 0;
int16_t BECMBatteryCurrent = 0;