Kia Niro BMS

User avatar
manny
Posts: 33
Joined: Sun Jan 23, 2022 4:15 pm
Location: Netherlands
Has thanked: 2 times
Been thanked: 20 times

Re: Kia Niro BMS

Post by manny »

haven't looked at that bit. The attiny is not on the board jet.

but the compareVoltage should not be higher than the batteryVoltage maybe eaquel. Maybe add a percentage.

the 300V can be calculated from minimum cell voltage and number of cells.

yes there is contactor control on the pcb. I added a extra channel. so pre charge main positive and main negative.

changing the code for one channel current sensor is easy.

using the voltage measurement from the inverter is a neat idea.
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

manny wrote: Sun Nov 05, 2023 12:04 pm Got it working with my modules (3 at the moment).
Not sure that i got all the hard coded bits.
The split in cell layout in the original code is hard to code for, so I removed it

Code: Select all

void storeCellVoltage(uint8_t dataRegister, uint8_t readRegisterData[29]) 
and

Code: Select all

void storeCellTemperature(uint8_t readRegisterData[29])
They are limited to input of 29 bytes. Should be changed to "message length" I guess?
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Kia Niro BMS

Post by bigmotherwhale »

Did you also implement PWM for economiser control of your contactors? you mind sharing your code for this?

it may be easy for you, programming is not something I find easy.

I have tried modifying the code to use an extra pin for the contactor and analogwrite with a delay going from value 255 then 50, have removed the low current sensor part of the code as best i could see, will have to tweak the scaling when I work out what the sensor range actually is.
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Kia Niro BMS

Post by bigmotherwhale »

The lack of a datasheet for the contactors is problematic. Doing some testing has left me wondering whether the contactors need PWM after all, it seems the hold off setting needs to be a lot higher than i have seen with other contactors.

The contactors are driven from a BTS723GW on the existing PCB, I have seen very little in the datasheet or elsewhere on this being used for PWM. Could anyone tell me if this is likely to be used like this?

This is my current code with the added extra contactor which just enables after powerup, and PWM control at 10khz using timer 1 on pins 9 and 10.

It seems that there is no hard high and low cut off in the existing code?
Attachments
BMS2_7_3_BMW_pwm_contactor.ino
(46.24 KiB) Downloaded 51 times
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

bigmotherwhale wrote: Tue Nov 07, 2023 10:58 pm It seems that there is no hard high and low cut off in the existing code?
That is correct, it only triggers warnings. Hard cut offs has to be done by the driver.
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Kia Niro BMS

Post by bigmotherwhale »

Im trying to get the thermistor value into the existing cellblock temp in the code but i don't know where to call for it,
I got it to read and serial print data in the loop so i know its working but I want to make use of the high and low cell functions to put in some hardware protections for high and low temperature, could you have a look at this code? Thanks
Attachments
BMS2_7_3_BMW_pwm_contactor.ino
(47.77 KiB) Downloaded 56 times
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

I guess you could put the call to the "storeCellTemperature()" inside the 250ms function in the main loop, i.e after the "measureCellData();" call.
If you only have two thermistors you could use the MIN and MAX arduino functions.
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Kia Niro BMS

Post by bigmotherwhale »

That worked well, the thermistor value is populated in the place that it should, but with extra 0 readings that i need to remove.
Im having trouble with the contactors, your code originally read the precharge pin directly but as i am now using pwmWrite thats not possible so i changed that to checkvoltage.
Im also just using analogue read to determine inverter voltage at the moment and something isnt right, i had to remove the newdata part and now i get spammed with the analogue reading and then get "contactor error message"
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

Serch for "contactor error" in the code and try to figure out why this is triggered. Then work backwards from there.
Using analog read to determine inverter voltage? Are you measuring inverter voltage directly, without any kind of isolation interface?
bigmotherwhale
Posts: 107
Joined: Tue Sep 22, 2020 6:48 pm
Has thanked: 15 times
Been thanked: 22 times

Re: Kia Niro BMS

Post by bigmotherwhale »

Im currently using a resistor divider on the 5v line to emulate a voltage, the inverter has an ACPL-C87AT DC Voltage Isolation
Sensor onboard and i can use that or a can bus value it transmits from it.
AndrewM314
Posts: 2
Joined: Wed Nov 15, 2023 11:17 am
Has thanked: 1 time

Re: Kia Niro BMS

Post by AndrewM314 »

Hi,
I have been following this subject with interest for a while now as I am using Kia Niro/Hyundai Ioniq PHEV batteries for a solar energy storeage system(personal use), I have just built the BMS master following the drawings kindly shared by bexander(very much apreciated thanks).
unfortunately I don't appear to be receiving a reply back from the battery slaves.
firstly, do these Mobis slaves need powering by an external supply.
secondly, could someone please tell me if my transmission signal is ok or not.
i have attached screenshots of the transmission signal before and after the isolation transformer(CH1 is TXpositive, CH2 is TXnegative)
Attachments
TxPreIsolator.png
TxPostIsolator.png
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

No external power neede other than the battery cells.
Are you using the OEM wires and all modules connected? How does your RX lines look in the scope?
AndrewM314
Posts: 2
Joined: Wed Nov 15, 2023 11:17 am
Has thanked: 1 time

Re: Kia Niro BMS

Post by AndrewM314 »

bexander wrote: Thu Nov 16, 2023 12:13 pm No external power neede other than the battery cells.
Are you using the OEM wires and all modules connected? How does your RX lines look in the scope?

Thanks for the reply, I found the main problem, I had the transmit from the master to transmit on the slave "Doh", I've corrected it and am now getting a signal on the RX lines.
marucha79
Posts: 18
Joined: Wed Jul 20, 2022 6:28 am
Been thanked: 1 time

Re: Kia Niro BMS

Post by marucha79 »

Do you know if 24,7Ah is total or netto capacity of this cells?
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

I'm using 24,8Ah as the total capacity.
marucha79
Posts: 18
Joined: Wed Jul 20, 2022 6:28 am
Been thanked: 1 time

Re: Kia Niro BMS

Post by marucha79 »

Could you tell about useable capacity when low limit is 3,2V per cell? In a fact I can test it by my charger, but when discharging relatively low current it won't be reliable. I think of buying battery for another project, but by budget about 1000 euros Outlander battery 12kWh seems to be better choice - more capacity and more configurable.
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

I only go down to 3,5V/cell and at that voltage I get approx 80% or 19,8Ah with summer conditions (~20degC in the battery).
Levin
Posts: 1
Joined: Mon Oct 16, 2023 9:45 am

Re: Kia Niro BMS

Post by Levin »

Hi, Is there any way to test the small BMS-slave units with MAX17845 chips from a KIA/Hyundai 64kWh battery to check if they are working? I did have a look at your code "BMS2_7_3_EDITED_3_2.ino" @bexander but it contains a lot of code and functions as I understand. I have a battery with broken electronics but I hope some of the slave units is still working and I dont want to test them with a working BMU, I want to test them one by one with the cells connected, is it possible with some arduino board or oscilloscope?
Regards
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

Levin wrote: Sat Jan 27, 2024 12:26 pm Hi, Is there any way to test the small BMS-slave units with MAX17845 chips from a KIA/Hyundai 64kWh battery to check if they are working? I did have a look at your code "BMS2_7_3_EDITED_3_2.ino" @bexander but it contains a lot of code and functions as I understand. I have a battery with broken electronics but I hope some of the slave units is still working and I dont want to test them with a working BMU, I want to test them one by one with the cells connected, is it possible with some arduino board or oscilloscope?
Regards
These slave modules can be made to work in the same manner. The code need to be modified for the number of slave modules and at what positions the cells are connected.

Note, the slaves contain 2 pcs of MAX17845 an can therefore handle 24 cells each.
I think the information on what needs to be changed can be found in this thread with some detective work.
maarek2
Posts: 10
Joined: Wed Sep 06, 2023 7:06 am
Has thanked: 1 time
Been thanked: 1 time

Re: Kia Niro BMS

Post by maarek2 »

Dear Bexander
I have some problems with balancing (with your original code).
After Balancing ON cell current coming from cell to BMS (+70mA / 20second / good condition) but after this current coming from BMS to cell (-70mA 20second). These both directions are in the loop.
Could you please check if you have same condition in your BMS.
In my opinion only current coming from cell to BMS is OK for ballance.
Thank you
Marek
Attachments
BMS_after_restart_arduino.JPG
BMS_ON_0-20s.JPG
BMS_ON_20-40s.JPG
Fluke_BMS.jpg
BMS_Log.jpg
User avatar
bexander
Posts: 835
Joined: Tue Jun 16, 2020 6:00 pm
Location: Gothenburg, Sweden
Has thanked: 63 times
Been thanked: 89 times

Re: Kia Niro BMS

Post by bexander »

maarek2 wrote: Tue Feb 20, 2024 9:20 am After Balancing ON cell current coming from cell to BMS (+70mA / 20second / good condition) but after this current coming from BMS to cell (-70mA 20second). These both directions are in the loop.
This is normal and expected behavior.
The slave chip (MAX17823) can not handle balancing adjecent cells simultaneously so in the code I do all odd cells first for a period and then switches to all even cells for a period.

Example using only cell 1 and 2.
During first period all odd cells (cell 1) is discharged and the current is flowing according to green line and arrows. During second period all even cells (cell 2) is discharged and the current is flowing according to blue line and arrows. This results in the behavoir you are observing, that the measured current changes direction (sign) periodically when two adjecent cells are balanced.
Balance current during different periods
Balance current during different periods
maarek2
Posts: 10
Joined: Wed Sep 06, 2023 7:06 am
Has thanked: 1 time
Been thanked: 1 time

Re: Kia Niro BMS

Post by maarek2 »

Dear Bexander
Thank you very much for explanation. I found this part odd/even in * Balancing of cells * part.
Time depends on balanceCellCounterTurnAround.
Thank you again.
Marek
Post Reply