Kia Niro BMS

StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Hi bexander!
Thank you very much for the fast answer :)
My Oscilloscope has a bandwidth of 50 MHz.
The measurement above on the secondary was already done without reference to GND of the MAX 17841B. I will attach a new measurement :) I connected the probe to sec2_3 and the "gnd" of the probe to sec2_1. Hope that is correct. I don`t have special differential probes :S
Sec2_1 to Sec2_3.jpg
Sec2_1 to Sec2_3.jpg (55.56 KiB) Viewed 14753 times
The same measurement taken between sec1_1 and sec1_3 is also attached.
Sec1_1 to Sec1_3.jpg
Sec1_1 to Sec1_3.jpg (48.94 KiB) Viewed 14753 times
Error Code from serial Monitor:
Error.txt
(1.85 KiB) Downloaded 581 times
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Yes, that is the measurement I suggested. A word of caution though. While doing this "differential" measurement, make sure not to connect another probe to gnd or other reference. That might short the oscilliscope or other parts of the circuit. Use only one probe.

Looks like I was wrong, this is a HW issue to my understanding. The signal is sent out on sec2_x but no response is received on sec1_x.
Check communication wiring for continuity, check that all plugs are connected. Is it possible to measure incomming/outgoing com on every slave to try and locate where the com is lost?
StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Yes, only one probe was used :)

With one Module connected it looked like that:

Module 1 in:
Slave1 - Rosa Orange.jpg
Slave1 - Rosa Orange.jpg (54.6 KiB) Viewed 14708 times
Module 1 Out:
Slave 1 - Gelb Weiß.jpg
Slave 1 - Gelb Weiß.jpg (52.48 KiB) Viewed 14708 times
After loop:
Module 1 in:
Slave 1 - Grün Braun.jpg
Slave 1 - Grün Braun.jpg (52.77 KiB) Viewed 14708 times
After that there was nothing measurable.

So no input into the transformer to the Master.

Tried measuring with two modules now, but have to give up for today and calm down :D I have to put in needles because the plugs are so small. I will upload the new measurements tomorrow.
Thanks already for your help!
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Communication
Communication
When testing with different number of slaves connected, are you moving the loopback so it is placed on the final slave in the chain?
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

After reading your post again.
So there is no output from the slave module on TXLP/TXLN but input on RXUP/RXUN, correct? If so, test with another slave board.
StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Yes, on my first try month ago, i forgot it. After putting the loopback to the system, it worked with two modules.
But after some weeks i tried it again and it failed.
I played a little bit with the code. Maybe i wrote some data to the master, that is now stopping it from working correct? Could that be possible?

Edit: I already tried two different slaves. I will put a third one on the module to try that.
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Please post a picture or wiring diagram or similar on your setup.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Could there be short circuit on the receiving end of the transformer or similar? Measure resistance between TXLP and TXLN.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

StephanL wrote: Mon Jun 10, 2024 3:53 pm I played a little bit with the code. Maybe i wrote some data to the master, that is now stopping it from working correct? Could that be possible?
I don't think so? It should lose all it's settings when powered down, hence everything has to be set at start-up. Have you tried reverting to the code that worked the first time with two slave modules?
StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Hi!
The transformers should be ok..i measured 0,5 ohm on every transformer.

I got a small breaktrough. It started communicating with one slave. Serial Monitor messages in the attachment.
Error2.txt
(3.36 KiB) Downloaded 572 times
Master receiving - SEC1.1_Sec1.3.jpg
Master receiving - SEC1.1_Sec1.3.jpg (53.43 KiB) Viewed 14579 times
2.Master receiving - SEC1.1_Sec1.3.jpg
2.Master receiving - SEC1.1_Sec1.3.jpg (51 KiB) Viewed 14579 times
Now is the question: Why isn`t it working with the other ones?
On some Modules i removed the BMS Board. It is clipped on the BatteryModule.
I checked continuity between the Pins of the Battery Module and the PCB. Everything fine.
Maybe it has to be waked up after removing from the Batterievoltage? I will look at the data sheet.

Thank you already very very much for your support. Would never have come so far without your help!

EDIT: Forgot the circuit:
IMG_20240611_152425.jpg
IMG_20240611_152435.jpg
IMG_20240611_152416.jpg
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Update: I soldered a wire to the SHDNL Pin of the BMS. Afer putting the PCB back in the battery and starting the program and a small delay the voltage rises from 0V to 9V. So the MAX17823B has turned on, as it seems.
I will dismantle the complete battery from the car in the next days and check, if the battery modules are communicating correctly with 14 BMS in series.
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Yes, you need to have the slave connected to a battery otherwise it has no power and will not respond.
I'm a bit busy at the moment but will try to help more when I have more time on my hand.
StephanL
Posts: 7
Joined: Sun Jun 09, 2024 3:55 pm
Location: Kassel, Germany
Has thanked: 1 time

Re: Kia Niro BMS

Post by StephanL »

Hi!
No problem. Its still not working so i have to use Plan B now..Will connect Mitsubishi Outlander CMUs to the battery for monitoring.

First: I know the slaves have to be connected to the battery :) I meant, that i disconnected the BMS PCBs and connected them afterwards again.

Yesterday i tried again and had some odd behaviour: I connected everything and it was not communicating. After connecting the oscilloscope with the probes to the transformer, the communication changed. I just dont know where the problem is :S

Before connecting the oscilloscope:
WhatsApp Image 2024-06-14 at 08.53.48(2).jpeg
After connecting the osci:
WhatsApp Image 2024-06-14 at 08.53.48(1).jpeg
How i connected the osci:
IMG_20240613_215001.jpg
Furthermore it was just working with one cable between the transformer-board and the slave. With the other cable i could not repeat the result.
Maybe it has something to to with the capacitance of the connected cables or someting else. thats way over my knowlege :D

I will try to get it to work in the future, but now i use the outlanders cmus because next week the car has its technical inspection.
VW T2 Bus 1978 with Citroen C-Zero Motor, original battery and Opel Corsa E additional battery.
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Looking at your setup, you are using experimental board wire and they are a soure of error due to bad contact. Double check all wiring with multimeter or better solder the wires and/or use proper connectors.

In Error2.txt communication is somewhat working but maybe disturbance on the bus as it can't clear the receive buffer successfully?
hengst
Posts: 1
Joined: Sat Jun 15, 2024 6:23 pm

Re: Kia Niro BMS

Post by hengst »

Hi People, not to Hijack the thread but i dont know where to put it else.

I recorded CAN messages from niro HEV BMS and searching for more info. maybe you have already decoding information.

i think i found Voltage, SOC, and 2 temperatures by disconnecting sensors but looking for confirmations.

there seems to be 7 lines every time.

22385 670 8 9E 7 34 8 A8 6D 4 0
22386 51E 8 0 0 0 0 C 0 0 0
22387 588 8 45 9 0 0 0 6D 0 0
22388 5AD 8 B9 B9 0 0 14 14 0 C
22389 5AE 8 15 0 6D 13 C 0 0 0
22390 5AF 8 0 0 0 0 0 0 0 0
22401 5F1 8 A8 16 45 9 0 0 0 0
Dreetje

Re: Kia Niro BMS

Post by Dreetje »

Hello. I am new on this forum. I bought a Niro bat-pack and like to communicate (CAN) with the original BMS. So far I could not make a connection. Has anyone succeeded in that? I have connected 12 volt to the BMS but can't see if the board is active.
The BMS is: 37513-G5220.
Dreetje

Re: Kia Niro BMS

Post by Dreetje »

hengst wrote: Sat Jun 15, 2024 6:31 pm Hi People, not to Hijack the thread but i dont know where to put it else.

I recorded CAN messages from niro HEV BMS and searching for more info. maybe you have already decoding information.

i think i found Voltage, SOC, and 2 temperatures by disconnecting sensors but looking for confirmations.

there seems to be 7 lines every time.

22385 670 8 9E 7 34 8 A8 6D 4 0
22386 51E 8 0 0 0 0 C 0 0 0
22387 588 8 45 9 0 0 0 6D 0 0
22388 5AD 8 B9 B9 0 0 14 14 0 C
22389 5AE 8 15 0 6D 13 C 0 0 0
22390 5AF 8 0 0 0 0 0 0 0 0
22401 5F1 8 A8 16 45 9 0 0 0 0
Can you share how to connect to the BMS? I was not able to establish a connection yet.
wanek
Posts: 4
Joined: Thu Sep 12, 2024 8:41 pm
Has thanked: 1 time

Re: Kia Niro BMS

Post by wanek »

Hello!

I also try to use the Kia Niro (2022~2023) 4s modules, but I can not figure out what type of connector is used on the side of the modules... Can anyone help?

It is a 2x6 pin connector, the pitch is less than 2.54mm.







Image

Image

Image

Thank you!
opelmanta
Posts: 11
Joined: Sun May 23, 2021 3:00 pm
Been thanked: 5 times

Re: Kia Niro BMS

Post by opelmanta »

Newer NIro Module conector is from JST part numbers

BMS PCB Housing
SM12B-CPTK-1A-TB

Connector
12CPT-B-2A

Terminals
SCPT-A021GF-0.5
wanek
Posts: 4
Joined: Thu Sep 12, 2024 8:41 pm
Has thanked: 1 time

Re: Kia Niro BMS

Post by wanek »

Thank you!
evdc
Posts: 12
Joined: Fri Nov 24, 2023 6:00 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Kia Niro BMS

Post by evdc »

I'm try to use @manny code for my peugeot 208-e battery(2p6s)(18 modules) (I've attached the code) and recently started researching how the balance works and I've been testing the balancing logic with the MAX17823B chips recently and found a problem with the balancing. Because in my battery the most discharged cell is the 4th cell in the 8th module and the most charged cell is the 4th cell in the 11th module. And I decided to try the balancing of the cells and let the battery charge at 8Amps and I saw that by sending a command to turn on the balance of the 11th module the 4th cell, it turns on the balance of the same cell but in all modules until it reaches the 11th module. And with multiple attempts to turn off the balance on the 8th module it didn't work. I suspect that there is a problem with addressing the modules because if I send a balance command on the last module for certain cells, regardless of what commands I have addressed for the modules before it, they all accept the command of the last module. If you have any idea what could be causing the problem, please let me know.

Balance on !!!

0 3956 1 3964 2 3961 3 3878 4 3954 5 3957
Module: 7
All Cells to Balance (before filter): 0b000000110000
Cell to Balance Filtered: 0b000000100000
5 Voltage Diff Min-Max: 120

0 3958 1 3951 2 3950 3 3998 4 3956 5 3963
Module: 10
All Cells to Balance (before filter): 0b000000111111
Cell to Balance Filtered: 0b000000101010
1 3 5 Voltage Diff Min-Max: 120

High Cell: 3998V Module: 10 Cell: 3 Low Cell: 3863V Module: 7 Cell: 3


Balance off!!

0 3952 1 3960 2 3957 3 3874 4 3949 5 3953
Module: 7
All Cells to Balance (before filter): 0b000000110000
Cell to Balance Filtered: 0b000000010000
4 Voltage Diff Min-Max: 116

0 3955 1 3947 2 3947 3 3990 4 3952 5 3959
Module: 10
All Cells to Balance (before filter): 0b000000111111
Cell to Balance Filtered: 0b000000010101
0 2 4 Voltage Diff Min-Max: 116

High Cell: 4013V Module: 10 Cell: 3 Low Cell: 3892V Module: 7 Cell: 3

Best regards
Attachments
BMS2_7_4.zip
(10.72 KiB) Downloaded 520 times
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

Please post the serial print-out that you get with the attached code.
You only have 3 modules connected, correct?
evdc
Posts: 12
Joined: Fri Nov 24, 2023 6:00 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Kia Niro BMS

Post by evdc »

Hello @bexander , I finally tried to balance the battery today with the attached code and it also has log files from the series motoring in which it can be seen that when the balance is turned on, it discharges even the most discharged cell, which should not be the case. (I use 18 modules)

Best regards
bexander wrote: Wed Oct 23, 2024 4:36 pm Please post the serial print-out that you get with the attached code.
You only have 3 modules connected, correct?
Attachments
BMScode & monitor LOGS.zip
(23.88 KiB) Downloaded 507 times
evdc
Posts: 12
Joined: Fri Nov 24, 2023 6:00 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Kia Niro BMS

Post by evdc »

I think DEVCFG1 should fix this, unless it's already fixed: ADDRUNLOCK Disables write-protection of device address DA[4:0]. Cleared only by HELLOALL
command (write-protected)
image.png
User avatar
bexander
Posts: 866
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 71 times
Been thanked: 97 times

Re: Kia Niro BMS

Post by bexander »

evdc wrote: Thu Oct 24, 2024 7:25 am Hello @bexander , I finally tried to balance the battery today with the attached code and it also has log files from the series motoring in which it can be seen that when the balance is turned on, it discharges even the most discharged cell, which should not be the case. (I use 18 modules)

Best regards
To me it does what it is supposed to do. I think you are missreading your serial print-out.
Below is a snipped from the serial print-out.

Code: Select all

High Cell: 3987V Module: 10 Cell: 3  Low Cell: 3866V Module: 7 Cell: 3
Total Voltage: 426177
High Cell Temp C: 14  Low Cell Temp C: 12  High Die Temp C: 20
Low Temperature Restriction
Power Control: 97
Regen Control: 94
Status: 1000   Charger LED Status: 10
0 3949 1 3953 2 3948 3 3950 4 3950 5 3952 
Module: 0
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3951 1 3954 2 3947 3 3943 4 3943 5 3954 
Module: 1
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3946 1 3954 2 3949 3 3954 4 3949 5 3952 
Module: 2
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3947 1 3907 2 3949 3 3945 4 3941 5 3947 
Module: 3
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3944 1 3953 2 3952 3 3951 4 3943 5 3947 
Module: 4
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3944 1 3952 2 3948 3 3953 4 3951 5 3950 
Module: 5
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3941 1 3944 2 3943 3 3952 4 3941 5 3940 
Module: 6
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3946 1 3953 2 3950 3 3865 4 3943 5 3947 
Module: 7
All Cells to Balance
110111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3947 1 3944 2 3940 3 3947 4 3947 5 3951 
Module: 8
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3943 1 3954 2 3946 3 3954 4 3946 5 3944 
Module: 9
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3947 1 3940 2 3940 3 3987 4 3946 5 3949 
Module: 10
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3950 1 3952 2 3944 3 3951 4 3946 5 3954 
Module: 11
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3942 1 3946 2 3939 3 3946 4 3935 5 3946 
Module: 12
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3946 1 3946 2 3937 3 3949 4 3946 5 3948 
Module: 13
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3942 1 3955 2 3941 3 3951 4 3947 5 3949 
Module: 14
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3947 1 3944 2 3940 3 3944 4 3946 5 3947 
Module: 15
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3940 1 3950 2 3940 3 3953 4 3945 5 3942 
Module: 16
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
0 3945 1 3951 2 3941 3 3943 4 3935 5 3945 
Module: 17
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
First line shows the lowest cell to be cell nr 3 in module 7 and is 3866V, should be mV...
Looking in BMSv0_35.ino at this line

Code: Select all

const int16_t voltageAllowance = 10; // Define the accuracy the balancing algorithm can balance it to, in mV
Every cell with a voltage above (3866 + 10) will need to be drained down to this level.

Now a snippet for module 7 from the above snippet.

Code: Select all

0 3946 1 3953 2 3950 3 3865 4 3943 5 3947 
Module: 7
All Cells to Balance
110111
Cell to Balance Filtered :10101
0 2 4  Voltage Diff Min-Max: 122
Here you can see that cell number 3 is 3865mV .
Also, cells to balance "110111".
Now as this is a print-out from Balance_cells.ino from the line below, it is printed "backwards". Cell 0 is the one most to the right. This means that the 0 is for cell number 3, which is the lowest cell in the battery.

Code: Select all

Serial.println(cellToBalance, BIN);


My solution to print the cells to balance in the correct order is as follows.

Code: Select all

for(int i=0; i < MAX_CELLS_PER_MODULE; i++)
{
  Serial.print((uint8_t)((cellToBalance >> i) & 0x01));
}
Serial.println();
Side note: It is quite a tall order to ask from the BMS to balance a pack with on cell very low compared to the other cells. I would try to manually charge just that low cell (cell3 module7) with a bench supply to get it up to the same level as the other cells.
The BMS will do it but it will probably take days to get the pack fully balanced as it is now.
Post Reply