Kia Niro BMS
- manny
- Posts: 33
- Joined: Sun Jan 23, 2022 4:15 pm
- Location: Netherlands
- Has thanked: 2 times
- Been thanked: 23 times
Re: Kia Niro BMS
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.
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.
- 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
Code: Select all
void storeCellVoltage(uint8_t dataRegister, uint8_t readRegisterData[29])
Code: Select all
void storeCellTemperature(uint8_t readRegisterData[29])
-
- Posts: 109
- Joined: Tue Sep 22, 2020 6:48 pm
- Has thanked: 15 times
- Been thanked: 22 times
Re: Kia Niro BMS
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.
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.
-
- Posts: 109
- Joined: Tue Sep 22, 2020 6:48 pm
- Has thanked: 15 times
- Been thanked: 22 times
Re: Kia Niro BMS
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?
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 56 times
- 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
That is correct, it only triggers warnings. Hard cut offs has to be done by the driver.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?
-
- Posts: 109
- Joined: Tue Sep 22, 2020 6:48 pm
- Has thanked: 15 times
- Been thanked: 22 times
Re: Kia Niro BMS
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
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 57 times
- 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
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.
If you only have two thermistors you could use the MIN and MAX arduino functions.
-
- Posts: 109
- Joined: Tue Sep 22, 2020 6:48 pm
- Has thanked: 15 times
- Been thanked: 22 times
Re: Kia Niro BMS
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"
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"
- 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
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?
Using analog read to determine inverter voltage? Are you measuring inverter voltage directly, without any kind of isolation interface?
-
- Posts: 109
- Joined: Tue Sep 22, 2020 6:48 pm
- Has thanked: 15 times
- Been thanked: 22 times
Re: Kia Niro BMS
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.
Sensor onboard and i can use that or a can bus value it transmits from it.
-
- Posts: 2
- Joined: Wed Nov 15, 2023 11:17 am
- Has thanked: 1 time
Re: Kia Niro BMS
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)
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)
- 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
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?
Are you using the OEM wires and all modules connected? How does your RX lines look in the scope?
-
- Posts: 2
- Joined: Wed Nov 15, 2023 11:17 am
- Has thanked: 1 time
Re: Kia Niro BMS
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.
Re: Kia Niro BMS
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.
- 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
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).
Re: Kia Niro BMS
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
Regards
- 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
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.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
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.
Re: Kia Niro BMS
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
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
- 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
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.