From 269c655dc5fc871c481595d6d771048d6e3340eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Thu, 18 Sep 2025 10:48:56 +0300 Subject: [PATCH] Add low 12V voltage safety to Volvo --- Software/src/battery/VOLVO-SPA-BATTERY.cpp | 7 +++++++ Software/src/datalayer/datalayer_extended.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Software/src/battery/VOLVO-SPA-BATTERY.cpp b/Software/src/battery/VOLVO-SPA-BATTERY.cpp index fdb06df1..0ed7a29c 100644 --- a/Software/src/battery/VOLVO-SPA-BATTERY.cpp +++ b/Software/src/battery/VOLVO-SPA-BATTERY.cpp @@ -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) { diff --git a/Software/src/datalayer/datalayer_extended.h b/Software/src/datalayer/datalayer_extended.h index b982e10f..1677ef3b 100644 --- a/Software/src/datalayer/datalayer_extended.h +++ b/Software/src/datalayer/datalayer_extended.h @@ -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;