Battery: Volvo XC40 Polestar 2 - dalathegreat/Battery-Emulator GitHub Wiki

[!CAUTION] Working with high voltage is dangerous. Always follow local laws and regulations regarding high voltage work. If you are unsure about the rules in your country, consult a licensed electrician for more information.

Volvo XC40, C40 / Polestar 2 (SPA platform) battery wiki

[!CAUTION] Battery can lock itself permanently if started without DC-DC converter on HV side! You have been warned, please read the Wiki carefully!

[!CAUTION] Offgrid: BMS can take damage if 12V battery runs low. One user reported bricked BMS when lead acid battery went to 7V overnight offgrid. Beware!

Measurements

148x176cm and about 500kg

Battery specifications / Serial numbers

The following SPA platform batteries are supported, checkbox on those confirmed by users to work

  • Volvo XC40 2021-present
    • 64 kWh (usable), 69 kWh (gross) ✅
    • 75 kWh (usable), 78 kWh (gross) ✅
    • 79 kWh (usable), 82 kWh (gross) Extended range ✅
  • Polestar 2 2020-present
    • 64 kWh (usable), 69 kWh (gross) Standard range ✅
    • 75 kWh (usable), 78 kWh (gross) Long range ✅
    • 79 kWh (usable), 82 kWh (gross) Long range ✅

bild

Software configuration

For this battery type, use the option called "Volvo / Polestar 69/78kWh SPA battery" under the "Battery Protocol" setting

Buying tips

Make sure the contactor assembly (Left picture, silver box) is included with the battery. Some places remove it and sell it separately. Without this you wont get contactors,current sensor, precharge, fuses etc., rendering the battery unusable.

image

[!NOTE] It is OK to buy a battery from an airbag crashed vehicle. It is possible to clear that fault code via the "More Battery Info" page

[!CAUTION] If you want to use Battery-Emulator to read info, check cells, on a standalone battery before buying, comment out any sending of 0x140 messages in the VOLVO-SPA-BATTERY.cpp file. Otherwise it will try to close contactors, and without the DC/DC converter it will permanently lock the contactors as welded. See further down for more info on DC/DC requirement

Wiring diagram, low voltage

Connect HVIL2_EXT_IN and HVIL2_EXT_OUT together with a cable. (this will close the HVIL loop in BECM.) Dont forget the driveline connector. When using the 4wd it's only for on the connector to the rear axle. If you have a different type it can be multiple connectors. For the wiring diagram see https://www.loopybunny.co.uk/schematics/MY24_Schematic.pdf

The BECM has no built in 120ohm resistor. (BECM = Battery Energy Control Module) Make sure the terminating resistors are correct. CAN networks should have two 120 Ohm resistors in each end of the network. With everything OFF, you can measure resistance between CAN-H and CAN-L. The result should be 60 Ohm. You can connect a 120ohm resistor between pin 44 and 45 to terminate the bus in the BECM end.

Attached below are pictures of the BMS pinout. Connect the pins to the LilyGo and 12V supply like this:

  • Pin 42 to LilyGo CAN - H
  • Pin 43 to LilyGo CAN - L
  • Pin 44 - 120ohm termination resistor - Pin 45
  • Pin 24 & 33 to +12V
  • Pin 47 This wire needs to be connected to the battery casing for isolation measurement
  • Pin 48 12v GND (47 and 48 are internally connected)

bild bild

To use the CAN contactors on Volvo XC40 and Polestar2, you need to connect the GND from the battery connector (PIN47) to the battery case. This GND is used for insulation monitoring. Without it, the battery will not be able to check the insulation integrity and will not engage contactors.

Wiring diagram, High voltage :zap:

Here are the ports that you can use on the battery to get voltage out: image

Positive LH, Negative RH

image

Test wires attached:

image

[!CAUTION] Battery can lock itself permanently if started without DC-DC converter on HV side!

In order to start the battery you need to have capacitance and current draw ready on HV lines. This can be achieved by connecting a DC-DC converter (which you can purchase from the link below) to the high-voltage output from the front motor. If you skip this step and try to start the battery directly, an irreversible fault code will trigger (Contactor welded). After this fault code is set, you won't be able to engage the contactors via the CAN bus anymore.

Connect the DC/DC converter to the high voltage output lines shown above. Pay attention to the polarity to avoid damaging the DC/DC converter

The DC/DC converter can also be used to charge a 12V lead acid battery, or left totally unused. The purpose of it is to mainly just enable contactors safely without triggering any fault codes.

DC/DC connected:

image

Part numbers

Incase your battery is missing some wires/disconnect switches, here are the OEM part numbers and purchase links. Do note that it might be cheaper to source from your local scrapyard!

Product Purchase Link
Service disconnect switch 32324494 Volvoshop
Low voltage 48pin connector Aliexpress
Low voltage 48pin connector with cable (take black one) Aliexpress
DC-DC converter Aliexpress

Handy tips :bulb:

Contactor closing with Deye 30kW, 50kW ,Solis S6-series and Fronius Gen 24.

There is a known issue with Deye inverters, that when starting it up with a Volvo battery that requires DC/DC power present, there is a risk that the Deye will cause an isolation issue that prevents contactor closing.

To solve this, Power off inverter by switching off the grid and PV. After the inverter has shut down, you can power on the battery. After it powers on, and the invertor starts, than power one the grid and PV connection. So basically the battery needs to be the thing that starts the Deye, Solis and Fronius first.

You will also need a robust 12V power supply, as contactors (models from 2024 onward) draw approximately 30–40W.

Opening the contactor assembly

Use a heat gun to warm up the glued seal between the cover and the bay. Use a lever to open the cover then.

image

No CAN comm issue

When 12V power is applied to the battery and the LilyGo board, there is occasionally an issue where the CAN bus and the transceiver in the BMS control unit do not "wake up," making communication impossible. So far, I’ve found only one solution to this problem — adding an external MCP2515 module and configuring it for communication with the BMS. In this setup, everything works smoothly and without any issues, ensuring reliable data transmission over the CAN bus.

Another thing to test if issue with comm is to leave pin 24 (+12V) disconnected during the first startup of BECM.

image

Reading DTCs

  1. To read the DTCs you have to open another browser tab with the CAN-logger view.
  2. Enter filter 1588, press OK. Then press "Stop & Back to main page" (the filter setting will persist), reopen CAN logger and it should be cleared and the filter is active.
  3. Press "More battery info" in the other tab and press read DTC.
  4. Refresh the CAN-log and you should have the readout there. (BE performs a bunch of diag requests once a minute that also will end up in the log with that filter, but that is normal)

DTCs are presented with 4 bytes, last byte of each code is status. (Permanent, Intermittent)

Codes might be divided between consecutive CAN frames, but just add them together like marked in the image below.

DTCs_2

DTC explanation

  • 058D00 - Battery Monitor Module Voltage Monitoring Performance
  • 0A9500 - High Voltage Fuse
  • 0AA668 - Battery Voltage System Isolation Fault
  • 0AAB68 - Battery Voltage Isolation Sensor Circuit Intermittent
  • 0AA400 - EV Battery Negative Contactor Circuit Stuck Closed
    • Only way to clear this code is to reprogram BECM module or replace it with a new BECM
  • 0AA600 - Battery Voltage System Isolation Fault
  • 0AA09A - EV Battery Positive Contactor Circuit. Component Failures. Component or system operating conditions
  • 0AA100 - EV Battery Positive Contactor Circuit Stuck Closed
    • Only way to clear this code is to reprogram BECM module or replace it with a new BECM
  • 0AA200 - EV Battery Positive Contactor Circuit Stuck Open
  • 0AA500 - EV Battery Negative Contactor Circuit Stuck Open
  • 0AA600 - EV Battery Voltage System Isolation Fault
  • 0AA800 - EV Battery Voltage Isolation Sensor Circuit Range/Performance
  • 0B3B00 - EV Battery Voltage Sense "A" Circuit
  • 0B5900 - Actuator Supply Voltage A Circuit Low
  • 0B5900 - EV Battery Voltage Sense "G" Circuit
  • 0B5E00 - EV Battery Voltage Sense "H" Circuit
  • 0B6300 - EV Battery Voltage Sense "I" Circuit
  • 0D079A - Battery Charging System Positive Contactor Circuit
  • 0D1500 - Battery Charging System High Voltage Interlock Circuit Open
  • 0DE621 - EV Battery Pack Cell Voltage Low. General Signal Failures. Signal too low
  • 0DE722 - EV Battery Pack Cell Voltage High. General Signal Failures. Signal too high
  • 0E2F00 - High Voltage Fuse "B"
  • 1A3016 - EV Battery Module 1 Cell Voltage Sensor. General Electrical Failures. Circuit voltage below threshold
  • 1A3049 - EV Battery Module 1 Cell Voltage Sensor. System Internal Failures. Internal electronic failure
  • 1A3216 - EV Battery Module 3 Cell Voltage Sensor. General Electrical Failures. Circuit voltage below threshold
  • 1A3249 - EV Battery Module 3 Cell Voltage Sensor. System Internal Failures. Internal electronic failure
  • 1A3217 - Battery Module 3 Cell Voltage Sensor. General Electrical Failures. Circuit voltage above threshold
  • 1A7216 - EV Battery Module 19 Temperature Sensor. General Electrical Failures. Circuit voltage below threshold
  • 1C2000 - Pack Cell Degraded Module 1
  • 1C2200 - Pack Cell Degraded Module 3
  • A01600 - Power Sustain Relay (PSR)
  • C10000 - Lost Communication With Engine Control Module (ECM)
  • C29A00 - Lost Communication with EV Battery Pack Sensor Module

Unlocking a permanently locked BMS

If the BMS is permanently locked, replacing the BMS is the easiest solution.

There is a chance that reflashing the BMS can help, but the success rate is low. Some .hex files available on Discord

Miniwiggler v3 dap attached to BMS board via PCI-e from old motherboard to avoid soldering

Flashing tips;

  • External 5V to VREF and GND is required
  • If it is toggling "Device has no ID register", thhe supplied current might be too low. You must apply external 5v with around 1A
  • If you cannot make connection with memtool, it could be that access is blocked via code, see picture below. password is unknown until now, if blocked like picture then BECM board needs to be swapped