Peugeot e-208 CATL modules BMS interface  [SOLVED]

Topics concerning OEM and open source BMSes
usus
Posts: 34
Joined: Sun Jul 10, 2022 7:45 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Peugeot e-208 CATL modules BMS interface

Post by usus »

Nice
Thanks.
User avatar
Clanarn
Posts: 53
Joined: Sun Oct 18, 2020 6:42 pm
Location: Göteborg Sweden
Has thanked: 2 times
Been thanked: 1 time

Re: Peugeot e-208 CATL modules BMS interface

Post by Clanarn »

I have a couple of MAX17841 interface boards left if someone is interested. 40eu.
Pm me for schematic.
max.jpg
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

Clanarn wrote: Mon Aug 01, 2022 3:19 pm I have a couple of MAX17841 interface boards left if someone is interested. 40eu.
Pm me for schematic.
Hi, I would be interested in a board. I can't PM you, probably because of a minimum post requirement... I'm new around here.
For me it's early days on a G Wagen EV project in the UK, using an e208 CATL battery pack hence the need for a board.

Perhaps you could PM me?
Thanks, Richard.
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

PM received and replied, thank you.

Will start a thread, but for now - here's the victim of my Eeee Geee ambitions:
Image
User avatar
VWJoe
Posts: 55
Joined: Wed Feb 16, 2022 8:39 am
Has thanked: 7 times
Been thanked: 9 times

Re: Peugeot e-208 CATL modules BMS interface

Post by VWJoe »

After a bit of help with the MAX17841 / MAX 19823B combo. Using the interface board from Clanarn matched to 16 Peugeot-208 modules along with Arduino UNO as the process. All the voltages are reading correctly from Registers 0x20 to 0x25 (first six cells), the problem comes with reading the AUXIN1 and or AUXIN2 for the cell temperatures ( Registers 0x2D and 0x2E) both are reading nonsense output, AUXIN1 very close to 0 and AUXIN2 maxed out (FFFO)

Reading
3 2D 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 10 0 20 0 10 0 20 0 0 E6 10 (AUXIN1)
3 2E F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF F0 FF 0 CE 10 (AUXIN2)

I understand AUXLN2 may not be used and is pulled high, the MEASUREEN Register 0x12 is set to 0x303F, but 0x103F and 0x203F have both been used.
I have tried the delay function in Register 0x19 and switched the THRM voltage to on manually and auto.

Any ideas are very much welcome.
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by EV_Builder »

Are the slave module connections documented somewhere?
Are there configuration options for auxin?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
VWJoe
Posts: 55
Joined: Wed Feb 16, 2022 8:39 am
Has thanked: 7 times
Been thanked: 9 times

Re: Peugeot e-208 CATL modules BMS interface

Post by VWJoe »

EV_Builder wrote: Tue Aug 09, 2022 4:59 am Are the slave module connections documented somewhere?
Are there configuration options for auxin?
I have attached the two documents that refer to the master (MAX17841B) and slaves (MAX17823B). Two readings are available for the temperature of the cells using AUXIN 1 and 2, these are activated by writing to the register, 0x12 if I remember correctly. Reading the output from 0x2D and 0x2E.

The Peugeot modules seems to have three NTC thermistors on their board, so I do not know which are connected. I have purchased a board to have look at, as I'm not sure if these thermistors are not polled in some way.
Attachments
MAX17841B-1844656.pdf
(767.67 KiB) Downloaded 173 times
MAX17823B.pdf
(1.61 MiB) Downloaded 150 times
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

My clanarn MAX17841 board arrived today - thanks!.
Time for some wiring and coding. Wish me luck...
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

Some progress, but now a bit stuck - help appreciated.
Status:
- microcontroller talking to MAX178741B master board. Using code published on here, many thanks to authors (Anton and Chris mentioned in header, apologies if I should also thank others)
- about 0.8v ac can be seen between TxP and TxN, as sent from the master to the first slave in the daisy chain
- connected to (2) slaves via the original BMS loom from the pack
- Pinouts master -> slave found on here (thanks!). All consistent with the physical world (wire colours and continuity test) so I am pretty sure I have the two tx pins from the master connected to the rx of the first slave (and tx from slave to master rx, obviously). Not sure they are the right way round (neg pos), but have tried swapping.
- Have terminated daisy chain after the second module by connecting pins per posts on here

Not working:
I'm getting nothing back from the slaves when the code reaches the DaisyChainInit() stage. We seem to be sending 0x01 to read the rx status register and hoping for a 0x21 return, to indicate that the daisy chain has woken up. This times out and I can't get any further.

I wondered whether the slaves need a separate reset or power supply, but reading the slave data sheet, it looks like you can just send signal via the UART and a charge pump will set the reset pin (so only need UART comm signal to wake up a slave, after which it draws its supply from the main battery)

I'm sure I am missing something obvious.... apologies for dumb question, but suggestions welcomed if you have any. Thanks!
User avatar
VWJoe
Posts: 55
Joined: Wed Feb 16, 2022 8:39 am
Has thanked: 7 times
Been thanked: 9 times

Re: Peugeot e-208 CATL modules BMS interface

Post by VWJoe »

chris01290 wrote: Sun Jun 26, 2022 5:13 pm I cannot take credit for all this code the base code came from the guys who developed the Max interface board.

void storeCellTemperature(uint8_t Data, uint8_t readRegisterData[29])
{

for (int i = 0; i < NumModulesFound; i++)
{
uint16_t beta = 3800;
uint16_t measTemperature = ((readRegisterData[3 + (i * 2)] << 8) + readRegisterData[2 + (i * 2)]);
measTemperature = (measTemperature >> 4);
int8_t temperature = beta / (log((float)measTemperature / (4095 - measTemperature)) + beta / 298.15) - 273;
if(Data==0x2d)
cellBlockTemp[0] = temperature;
else
cellBlockTemp[1] = temperature;

}
}
if any one is interested i can post the whole project?


I thought I would put together a list of things I have found out about the Peugeot e-208 CATL modules.

Firstly a big thank you to Clanarn for designing the master board, bexander for the software and chris01290 for software and general advice.

The e-208 modules use the MAX178xx family of devices. e208 modules using Max17823B and the master to control these is MAX17841B as the master controller.

Clanarn has made a niffy little board using the MAX17841B, please bear in mind that this board only uses the 4 middle pins on the TX/RX end.

ie
TXN pin 1 Not Used
TXN pin 2 Not Used
TXP pin 3 is TXN and goes to pin 1 on Module 1 (RXNL)
TXP pin 4 is TXP and goes to pin 7 on Module 1 (RXPL)
RXN pin 5 is RXN and goes to pin 8 on Module 1 (TXNL)
RXN pin 6 is RXP and goes to pin 3 on module 1 (TXPL)
RXP pin 7 Not Used
RXP pin 8 Not Used

Wiring on the Modules, look at the rear of the connector plugged in the module the right way up. Pin 1 Top Left, Pin 6 Top Right, Pin 7 Bottom Left, Pin 12 Bottom Right

Pin 1 RXNL
Pin 2 blank
Pin 3 TXPL
Pin 4 blank
Pin 5 goes to pin 8 on Module 2
Pin 6 goes to pin 7 on Module 2
Pin 7 RXPL
Pin 8 TXNL
Pin 9 blank
Pin 10 goes to pin 3 on Module 2
Pin 11 blank
Pin 12 goes to pin 1 on Module 2

and so on until the end when Pin 5 loops back to Pin 12 and Pin 6 to Pin 10, the end of the daisy chain.

I believe the original wiring harness twists the wrong pairs!

The Cells are connected to the first six Channels, so voltages are read from the address 0x20 to 0x25.

Now onto the cell temperature sensors. each module has three NTC and are not contacted as the MAX chip manufacturer recommends.

Being three the board uses a combination of two logic gates, which use GPIO 0 and GPIO 1 to switch outputs/inputs

Address 0x11 drives the GPIO,
so 0x7001 selects NTC1 and NTC2 with NTC1 connected to AUXIN1 and NTC2 connected to AUXIN2
and 0x7002 select NTC3 connected to AUXIN2, AUXIN1 is left unconnected and should not be stored.

I have also found that the THRM voltage needs to be switched on to let the circuit settle. I leave it on by using address 0x19 0x0310, the 3 is the THRM on and the 10 is a small delay, may not need it.

The address 0x2D is for NTC1 and leads with the LSB then MSB. Shift the LSB 4 to the right and MSB 4 to the left and add the two together
measTemperature = ((readRegisterData[3 + (i * 2)] << 4) + (readRegisterData[2 + (i * 2)]>>4));
i being the module number.
Address 0x2E for NTC2 and 3
The good news is the read-out is linear.

So for NTC1
temperature = (measTemperature - 1680)/32;
and for NTC2 and NTC 3
temperature = (2450 - measTemperature)/31;

Both in C

I was not allowed to take over control of the freezer for a couple of days, I was told that was a step too far. So freezer packs and hair dryier were used, and the readings were linear I just may be a deg or two out.

By the way, NTC1 is in the middle, NTC 2 and NTC 3 are next to the module terminals.

I have not added the documents for the MAX178xx family as these are already been added to this post along with examples of software.

Hope this helps.

Joe
usus
Posts: 34
Joined: Sun Jul 10, 2022 7:45 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Peugeot e-208 CATL modules BMS interface

Post by usus »

EV_Builder wrote: Mon Aug 01, 2022 12:52 am Ok; I will make a commercial device with this chip then.
Stay tuned.
Any update?
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by EV_Builder »

Yes; PCB's are drawn and will be ordered soon..

I opened up the pre-order in my webshop.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
usus
Posts: 34
Joined: Sun Jul 10, 2022 7:45 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Peugeot e-208 CATL modules BMS interface

Post by usus »

How can I acces your webshop?
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

VWJoe wrote: Mon Aug 22, 2022 7:57 pm I thought I would put together a list of things I have found out about the Peugeot e-208 CATL modules.

Firstly a big thank you to Clanarn for designing the master board, bexander for the software and chris01290 for software and general advice.

The e-208 modules use the MAX178xx family of devices. e208 modules using Max17823B and the master to control these is MAX17841B as the master controller.

Clanarn has made a niffy little board using the MAX17841B, please bear in mind that this board only uses the 4 middle pins on the TX/RX end.

ie
TXN pin 1 Not Used
TXN pin 2 Not Used
TXP pin 3 is TXN and goes to pin 1 on Module 1 (RXNL)
TXP pin 4 is TXP and goes to pin 7 on Module 1 (RXPL)
RXN pin 5 is RXN and goes to pin 8 on Module 1 (TXNL)
RXN pin 6 is RXP and goes to pin 3 on module 1 (TXPL)
RXP pin 7 Not Used
RXP pin 8 Not Used

Wiring on the Modules, look at the rear of the connector plugged in the module the right way up. Pin 1 Top Left, Pin 6 Top Right, Pin 7 Bottom Left, Pin 12 Bottom Right

Pin 1 RXNL
Pin 2 blank
Pin 3 TXPL
Pin 4 blank
Pin 5 goes to pin 8 on Module 2
Pin 6 goes to pin 7 on Module 2
Pin 7 RXPL
Pin 8 TXNL
Pin 9 blank
Pin 10 goes to pin 3 on Module 2
Pin 11 blank
Pin 12 goes to pin 1 on Module 2

and so on until the end when Pin 5 loops back to Pin 12 and Pin 6 to Pin 10, the end of the daisy chain.

I believe the original wiring harness twists the wrong pairs!

The Cells are connected to the first six Channels, so voltages are read from the address 0x20 to 0x25.

Now onto the cell temperature sensors. each module has three NTC and are not contacted as the MAX chip manufacturer recommends.

Being three the board uses a combination of two logic gates, which use GPIO 0 and GPIO 1 to switch outputs/inputs

Address 0x11 drives the GPIO,
so 0x7001 selects NTC1 and NTC2 with NTC1 connected to AUXIN1 and NTC2 connected to AUXIN2
and 0x7002 select NTC3 connected to AUXIN2, AUXIN1 is left unconnected and should not be stored.

I have also found that the THRM voltage needs to be switched on to let the circuit settle. I leave it on by using address 0x19 0x0310, the 3 is the THRM on and the 10 is a small delay, may not need it.

The address 0x2D is for NTC1 and leads with the LSB then MSB. Shift the LSB 4 to the right and MSB 4 to the left and add the two together
measTemperature = ((readRegisterData[3 + (i * 2)] << 4) + (readRegisterData[2 + (i * 2)]>>4));
i being the module number.
Address 0x2E for NTC2 and 3
The good news is the read-out is linear.

So for NTC1
temperature = (measTemperature - 1680)/32;
and for NTC2 and NTC 3
temperature = (2450 - measTemperature)/31;

Both in C

I was not allowed to take over control of the freezer for a couple of days, I was told that was a step too far. So freezer packs and hair dryier were used, and the readings were linear I just may be a deg or two out.

By the way, NTC1 is in the middle, NTC 2 and NTC 3 are next to the module terminals.

I have not added the documents for the MAX178xx family as these are already been added to this post along with examples of software.

Hope this helps.

Joe
Thanks for the useful summary, and additional temperature sensor info, Joe.
I'm still stuck before that point. Microcontroller is definitely talking to the MAX chip OK, but when I go through the init daisy chain sequence of commands I never hear anything back from the slaves. Have checked the comms wiring many times, including the loopback, and also buzzed through the pinouts.
Suggestions welcomed!
Cheers, Richard.
ecertik
Posts: 2
Joined: Sun Aug 28, 2022 9:41 pm

Re: Peugeot e-208 CATL modules BMS interface

Post by ecertik »

hi @inaglasshouse
I am new on this forum, but I have some knowledge about those batteries. If you go throught daisychain init without errors, but cant communicate with slaves, please use as first command after daisychain init " readAllSlaves(0x00, false); and write me what was returned.
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

ecertik wrote: Sun Aug 28, 2022 9:52 pm hi @inaglasshouse
I am new on this forum, but I have some knowledge about those batteries. If you go throught daisychain init without errors, but cant communicate with slaves, please use as first command after daisychain init " readAllSlaves(0x00, false); and write me what was returned.
Thanks!

Sorry, I have not been clear. At the moment I do not get to the end of the daisy chain init sequence.

After this sort of thing (start transmit preambles):

digitalWrite(SPI_MAX_CS_PIN, LOW);
vspi->transfer(0x0E); // Write Configuration 2 register
vspi->transfer(0x30); // Enable Transmit Preambles mode
digitalWrite(SPI_MAX_CS_PIN, HIGH);

There's a while loop:

while (check != 0x21) // If RX_Status = 21h, continue.
...
check = vspi->transfer(0x01); // Read RX_Status register
...

Which (when MAX board is connected up OK) always returns 0x11, which I believe means idle empty.
I am looking for 0x21, which I believe means busy empty, meaning that the slaves appear to have woken up to the preambles.

All help much appreciated!
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

VWJoe wrote: Mon Aug 22, 2022 7:57 pm and so on until the end when Pin 5 loops back to Pin 12 and Pin 6 to Pin 10, the end of the daisy chain.
I think (using the pin numbering system in play in your post), this should read:

"until the end when Pin 1 loops back to Pin 8 and Pin 3 to Pin 7, the end of the daisy chain."

Apologies if I'm wrong.
Anyway having quadruple-checked my wiring, I am now up and running. Thanks to all for the help.
Little test with 2 modules:

Image
usus
Posts: 34
Joined: Sun Jul 10, 2022 7:45 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Peugeot e-208 CATL modules BMS interface

Post by usus »

@inaglasshouse

Can you do a part list? Maybe some picture and diagram with connection?
Yellow box and display look nice.

BR.
User avatar
VWJoe
Posts: 55
Joined: Wed Feb 16, 2022 8:39 am
Has thanked: 7 times
Been thanked: 9 times

Re: Peugeot e-208 CATL modules BMS interface

Post by VWJoe »

inaglasshouse wrote: Mon Aug 29, 2022 3:01 pm I think (using the pin numbering system in play in your post), this should read:

"until the end when Pin 1 loops back to Pin 8 and Pin 3 to Pin 7, the end of the daisy chain."

Apologies if I'm wrong.
Anyway having quadruple-checked my wiring, I am now up and running. Thanks to all for the help.
Little test with 2 modules:

Image
Good to hear you have got things working.
I think I got it right as Pin 1, 7,3,8 come/go back to Module N-1 or Master and 12, 5, 10, 6 go on / come back from Module N+1 or loop back.

By the way, you can set the slaves not to have the loop back and do this internally.
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

VWJoe wrote: Tue Aug 30, 2022 7:05 pm Good to hear you have got things working.
I think I got it right as Pin 1, 7,3,8 come/go back to Module N-1 or Master and 12, 5, 10, 6 go on / come back from Module N+1 or loop back.

By the way, you can set the slaves not to have the loop back and do this internally.
Yes, I saw the internal loopback in the chip docs.

I think I see how we can both be right re the pins. I was simplistically dealing with it, for my test case with (many) missing modules, by putting jumpers into the first empty connector in the chain. You are referring to jumping the last used / connected connector in the chain. Same wires, different pins!
ecertik
Posts: 2
Joined: Sun Aug 28, 2022 9:41 pm

Re: Peugeot e-208 CATL modules BMS interface

Post by ecertik »

inaglasshouse wrote: Mon Aug 29, 2022 3:01 pm
Anyway having quadruple-checked my wiring, I am now up and running. Thanks to all for the help.
Little test with 2 modules:
Congrats, to success, now the funny part can begin :-)
btw, nice visualization of data on display.

I can share some photos of my BMS here for inspiration. its designed onto DINrail mount:
IMG-7725-3.jpeg
IMG-7726-1.jpeg
IMG-7726-1.jpeg (22.46 KiB) Viewed 5110 times
Its from test desk without covers and it include HV contractor.
User avatar
inaglasshouse
Posts: 18
Joined: Tue Aug 02, 2022 4:18 pm
Location: UK
Been thanked: 1 time
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by inaglasshouse »

ecertik wrote: Tue Aug 30, 2022 9:23 pm Congrats, to success, now the funny part can begin :-)
btw, nice visualization of data on display.

I can share some photos of my BMS here for inspiration. its designed onto DINrail mount:

IMG-7725-3.jpeg IMG-7726-1.jpeg

Its from test desk without covers and it include HV contractor.
Nice!
usus
Posts: 34
Joined: Sun Jul 10, 2022 7:45 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Peugeot e-208 CATL modules BMS interface

Post by usus »

ecertik wrote: Tue Aug 30, 2022 9:23 pm Congrats, to success, now the funny part can begin :-)
btw, nice visualization of data on display.

I can share some photos of my BMS here for inspiration. its designed onto DINrail mount:

IMG-7725-3.jpeg IMG-7726-1.jpeg

Its from test desk without covers and it include HV contractor.
Super!
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Peugeot e-208 CATL modules BMS interface

Post by EV_Builder »

Cool work being done here! Keep it up ☺️.
I got PCB comms working so what's left is procedures and testing with a slave. 💪💪☺️.
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
VWJoe
Posts: 55
Joined: Wed Feb 16, 2022 8:39 am
Has thanked: 7 times
Been thanked: 9 times

Re: Peugeot e-208 CATL modules BMS interface

Post by VWJoe »

inaglasshouse wrote: Sun Aug 28, 2022 4:56 pm Thanks for the useful summary, and additional temperature sensor info, Joe.
I'm still stuck before that point. Microcontroller is definitely talking to the MAX chip OK, but when I go through the init daisy chain sequence of commands I never hear anything back from the slaves. Have checked the comms wiring many times, including the loopback, and also buzzed through the pinouts.
Suggestions welcomed!
Cheers, Richard.
inaglasshouse, Richard.

Are you still having problems with comms to the salves?
Post Reply