Peugeot E-208/Corsa E CATL BMS CAN decoding

Discussion about components from Ampera/Bolt and the PSA group which owns Opel these days
Yevhen
Posts: 8
Joined: Wed Oct 16, 2024 4:48 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by Yevhen »

case 0x125:
battery_voltage = (rx_frame.data.u8[3] << 8) | rx_frame.data.u8[4];
battery_current = (rx_frame.data.u8[5] - 0x58) << 8 | rx_frame.data.u8[2];
break;

datalayer.battery.status.voltage_dV = ((float)battery_voltage / 128) * 10;

datalayer.battery.status.current_dA = ((float)battery_current / 256) * 10;

This is a code snippit from the battery emulator software that I added to.

This is just my guess but it seems to work ok, still very granular readings not much precision i wonder if the BMS needs to be activated via canbus to work in a normal mode.
LRBen
Posts: 567
Joined: Thu Jul 04, 2019 6:35 pm
Location: Somerset, UK
Has thanked: 75 times
Been thanked: 217 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by LRBen »

Yevhen wrote: Thu Dec 12, 2024 9:38 am case 0x125:
battery_voltage = (rx_frame.data.u8[3] << 8) | rx_frame.data.u8[4];
battery_current = (rx_frame.data.u8[5] - 0x58) << 8 | rx_frame.data.u8[2];
break;

datalayer.battery.status.voltage_dV = ((float)battery_voltage / 128) * 10;

datalayer.battery.status.current_dA = ((float)battery_current / 256) * 10;

This is a code snippit from the battery emulator software that I added to.

This is just my guess but it seems to work ok, still very granular readings not much precision i wonder if the BMS needs to be activated via canbus to work in a normal mode.
Thanks for that. I've made some updates to my zombie module to show battery voltage as well. I had to make some slight changes to the calculations to get the battery voltage showing correctly.
I still need to play with current a little bit. Not quite there yet, I'm testing this by playing back logs to my Zombieverter and checking spot values.

Code: Select all

case 0x125:
  SoCValue = data[0] * 0.4;
  Param::SetFloat(Param::SOC,SoCValue);
  
  batteryvoltage = (data[3] << 8) | data[4];
  udcvoltage = (batteryvoltage / 128);
  
  current = (data[5] << 8) | data[2];
  batterycurrent = (current/256) / 10;
  if (Param::GetInt(Param::ShuntType) == 0)//Only populate if no shunt is used
   {
  Param::SetFloat(Param::idc,batterycurrent);
  Param::SetFloat(Param::udc2, udcvoltage);
   }
I've also been working on the ground fault circuit that is inside the battery box. It connects directly to the BMS box so I'm hoping any faults will show up in the canbus. I''m just a bit stuck on simulating a HV voltage leak to check canbus reponses.
Yevhen
Posts: 8
Joined: Wed Oct 16, 2024 4:48 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by Yevhen »

I also find that SOC can be read out in reg 0x358 0 byte.
case 0x358:
battery_soc = rx_frame.data.u8[0];

0-100 in decimals. No need for scaling.
But I found out that SOC is "frozen" will not move even if the battery is cycled up and down, which confirms my suspicion that some kind of activation of the BMS is needed via CAN bus.
martii
Posts: 19
Joined: Fri Mar 22, 2019 10:07 am
Has thanked: 4 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by martii »

Yevhen wrote: Fri Dec 13, 2024 3:36 pm I also find that SOC can be read out in reg 0x358 0 byte.
case 0x358:
battery_soc = rx_frame.data.u8[0];

0-100 in decimals. No need for scaling.
But I found out that SOC is "frozen" will not move even if the battery is cycled up and down, which confirms my suspicion that some kind of activation of the BMS is needed via CAN bus.
Is this battery from heavily crashed car? Sometimes BMS is locked if few airbags are deployed during accident :(
Yevhen
Posts: 8
Joined: Wed Oct 16, 2024 4:48 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by Yevhen »

martii wrote: Mon Dec 16, 2024 2:05 pm Is this battery from heavily crashed car? Sometimes BMS is locked if few airbags are deployed during accident :(
Yes this one was.
RJSC
Posts: 3
Joined: Wed Feb 05, 2025 3:11 pm
Has thanked: 3 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by RJSC »

Any progress with open source code?
stuart1977
Posts: 4
Joined: Mon Nov 04, 2024 8:58 pm

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by stuart1977 »

anyone worked out how to instruct the bms to balance ?
RJSC
Posts: 3
Joined: Wed Feb 05, 2025 3:11 pm
Has thanked: 3 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by RJSC »

Anyone has news about decoding the current?
with:

Code: Select all

case 0x125:
battery_current = ((((rx_frame.data.u8[5] - 0x58) << 8) | rx_frame.data.u8[2]) / 256) * -10;
What should be 3.8A is showing as 1A
peterdiffey
Posts: 19
Joined: Sun Aug 20, 2023 8:30 pm
Location: South Cumbria, UK
Has thanked: 6 times
Been thanked: 5 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by peterdiffey »

Hi Folks, apologies for hijacking this thread.

I have a MG 40Kwh pack, which uses CATL modules, so it is probable that the modules use the same sort of BMS. I cannot find much in the way of info on the battery pack controller, it has LOTS of pins, and a big SOC on board, so I am shying away from trying to use that controller.

My plan is to connect direct to the string of pairs of modules using an ESP32 via a MAX17841B.

My question is this - is there any info on the protocol used on this interface, I figure that I need to send a READ message to the first of the string of modules, and this causes a domino effect where each passes it's data to the next in the string and eventually at the other end of the string, out pops a series of datasets, one for each module.

As far as I can see by looking at the module PCBs, balancing is done on a per module pair basis, and differences in the pairs of modules is reported but not fixed during normal operation.

I read somewhere on a MG owner thread that cell balancing only occurs at full battery charge, so, does the battery pack controller kick this off, or does it automatically start balancing at a certain module pair voltage.

Any help on understanding how this works on the peugeot modules appreciated.

Pete
Pete
User avatar
tom91
Posts: 2360
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 204 times
Been thanked: 556 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by tom91 »

peterdiffey wrote: Thu May 22, 2025 12:04 pm Hi Folks, apologies for hijacking this thread.
Yes, this is frowned upon and completely off topic. why are you posting here, this is CAN so external of the pack.

search.php?keywords=MAX17823B

viewtopic.php?t=2181&hilit=MAX17823B
viewtopic.php?p=20335#p20335
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
peterdiffey
Posts: 19
Joined: Sun Aug 20, 2023 8:30 pm
Location: South Cumbria, UK
Has thanked: 6 times
Been thanked: 5 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by peterdiffey »

I was rather hoping that someone would be able to point me in the correct direction - so thanks

Pete
Pete
User avatar
tom91
Posts: 2360
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 204 times
Been thanked: 556 times

Re: Peugeot E-208/Corsa E CATL BMS CAN decoding

Post by tom91 »

peterdiffey wrote: Thu May 22, 2025 12:30 pm I was rather hoping that someone would be able to point me in the correct direction
Please use the search function, you had the key words in your post.
Creator of SimpBMS
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
Post Reply