mpp-solar icon indicating copy to clipboard operation
mpp-solar copied to clipboard

JKBMS Charging and discharging with wrong values

Open miguel300477 opened this issue 2 years ago • 7 comments

Hi,

I been monitoring my JKBMS and i noticed for a long while that the charging and discharging current goes to to the oposite number after 32amps.

So if im charging it shows for exemple 20amps but after it passes 32amps it goes negative value. the same is happening with the discharge...

Im using mqtt to export to home assistant.

Anyone has the same issue?

miguel300477 avatar Mar 22 '22 12:03 miguel300477

In the pictures, today so far im only charging the battery, but the data does positive, to negative and so on. I got a peak at about 70amps but the values seem to subtract...and dont understand...

jkbms 1

Charge Graph jkbms 2

Discarge Graph jkbms 3

miguel300477 avatar Mar 22 '22 12:03 miguel300477

Hello, I got similar readings. Not sure what it means. After the Battery is full, the Values are pending +- 10A

image

sebmueller avatar Sep 01 '22 08:09 sebmueller

Do you use BLE (JK02/JK04) or a UART-TTL connection?

syssi avatar Sep 01 '22 08:09 syssi

I use a Bluetooth Connection.

sebmueller avatar Sep 01 '22 09:09 sebmueller

Hi there First of all thanks for sharing that great work. I am using a BLE connection to an JK BMS, I encountered the same issue and found that this sign switching is related to data decoding, When eg. voltage_cellxx/resistance_cellxx all decimals are present and decoded correctly the sign is correct, When from voltage_cellxx/resistance_cellxx some decimal are missing eg. 3.38 instead of 3.885 etc..the sign is wrong, Hope this found will help.

geobitus avatar Dec 24 '23 10:12 geobitus

thanks for your feedback, if you can catch that failure in a debug run it would be helpfull

jblance avatar Dec 29 '23 03:12 jblance

Happy New One for all. That was the worst feedback ever from my side, not enough tested, my bad :-( sorry for misleading, Digging deeper I found that the sign switching is related to '["LittleHex2Short:r /1000", 2 , "Current_Charge" , "A"]' found in /mppsolar/protocols/jjkv11.py and in my case also occur near 32 Amps readings no matter if is charging or discharging, My empirically tested solution to get rid of this behave was to change LittleHex2Short to BigHex2Short and add some math after eg. instead of '/1000 ' use '/5 -x' I can't reproduce all here because I don't want to induce to anyone hiccups or a math hart attack :-) Hope this time the found will help.

capture !UPDATE! Wrong again,, now switching occur @ 51,2 Amps SW NEW UPDATE

  1. In file /usr/local/.../protocols/jkv11.py line 74 replacing "LittleHex2Short:r /1000" to "BigHex2Short:r /5 -153.6" for the charging leading me to the found: when the real current reported by the BMS on the app is 0 the script still report DEC 768 and for that the need to substract153.6 ??? seems that the script is decoding another byte instead of 2 since the 768 will translate to BIN 0011 0000 0000 or somehow is related to little/big endian.

  2. For the discharging current same file line 75 "BigHex2Short:r /5" works fine and shows the correct current in the tested 0~100Amps range

geobitus avatar Jan 02 '24 13:01 geobitus