diy solar

diy solar

Chargery BMS communications.

This is my problem "Windows 98/2000/XP/Vista/7/8/10" EFF windows lol when is the world going to learn other OS's are much better for this sort of thing.
Thee is source code for this on GitHub too. There are APK's and also for other OS platform like NIX but I'll leave the digging to you, not hard to find. If google fails, try DuckDuckgo.
 
Great read! I needed a Modbus serial solution, to took the following approach:

[Chargery]-[RS232toTTL converter]-[Arduino MEGA]-[RS232toTTL converter ]-[cellular RTU]

The MEGA was a good fit for this since it has several UARTs onboard (no need for the added complexity of SoftwareSerial library). The MEGA parses the byte stream and stores the data in an integer array. The RTU polls the integer array every 5 seconds then texts me if anything is amiss, otherwise it sends a daily report via email.
 
Mario,
Thanks for the screenshots! Impressive job!
Are you open to sharing a little context on how you chose 0 seconds for your cut-off delay time? Is there a scenario where if you set this for a few seconds you'd have some risk of catastrophe?

I realize our systems are different, mine is 12V, 280Ah in an RV. I had thought a bit of delay, say up to 15 seconds may allow for some motor in-rush or other high-draw startup.
Also, what is the max delta V that you've experienced? I have very few cycles and under high load (150A) I saw 35mV or 40mV. So I moved my max to 75mV, but maybe 100mV is better. I don't want the battery to disconnect unnecessarily.

Thank you,

Doug
 
I would definitely set it at 100 or even above. I set mine at 300 to me it is more important to not go above or below certain voltages and if the cells are off balance in the middle. I would like to know that but no need to shut things down because of it.
 
Mario,
Thanks for the screenshots! Impressive job!
Are you open to sharing a little context on how you chose 0 seconds for your cut-off delay time? Is there a scenario where if you set this for a few seconds you'd have some risk of catastrophe?

I realize our systems are different, mine is 12V, 280Ah in an RV. I had thought a bit of delay, say up to 15 seconds may allow for some motor in-rush or other high-draw startup.
Also, what is the max delta V that you've experienced? I have very few cycles and under high load (150A) I saw 35mV or 40mV. So I moved my max to 75mV, but maybe 100mV is better. I don't want the battery to disconnect unnecessarily.

Thank you,

Doug
Hi Doug.

The default for the cutoff time is 10 sec. For my scenario I set it for safety to 0 seconds, I have a 1000Ah 52V lithium iron battery on my solar system for my house and can turn catastrophic if things go wrong. I do have circuit breaker protection also, but rather play it safe.

Generally my delta voltage is around 10 to 20mV if I can fully charge the battery each day. I have found that if I have 2 or 3 consecutive cloudy days where I could not fully charge the battery, that I can see up to about 40 to 50mV delta on the top end when it is fully charged again. So my 100mV is just a bit of a margin so the battery stay connected while the BMS take care of the balancing.
 
Mario and Craig,
Thanks for the feedback. I do have a large AGM battery as backup if the LFP were to trigger a fault, but I don't want false positives. I'll think more about the delay and voltage differential. Mostly, I need to get more cycles on my system with some manual monitoring. But hard to do on lockdown at home!
Cheers,

Doug
 
Nice job Craig! I've been also working on BMS communication. I'm curious, have you done a data stream? I'm using an Arduino to read the stream. Here's what I get from Putty:

24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 56 16 C F6 C FD C FE C F9 0 0 0 0 0 48 0 1E 5F 93
68 3A 3A 33 D A
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 56 16 C F6 C FD C FE C FA 0 0 0 0 0 49 0 1E 5F 95
24 24 57 F D 98 2 0 0 0 97 0 98 5F E3
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
68 3A 3A 33 D A
24 24 56 16 C F6 C FD C FE C FA 0 0 0 0 0 49 0 1E 5F 95
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 57 F D 98 2 0 0 0 97 0 97 5F E2
24 24 56 16 C F6 C FC C FE C FA 0 0 0 0 0 46 0 1E 5F 91
24 24 57 F D 98 2 0 0 0 97 0 98 5F E3
68 3A 3A 33 D A

The 68 3A 3A 33 D A is an odd ball. There's no documentation about this data packet. Have you seen it?
 
I'm using an Arduino to read the stream.
Cal, welcome to the forum! I’m using an Arduino Mega to parse the Chargery data into a Modbus array, and have seen the same undocumented data stream. It may be for when the BMS is connected to a Chargery charger, like this. “Remote control charge current” feature is what got my attention.
 
If the Chargery BMS is used in conjunction with a Chargery power supply ..... it will control the charge current from the power supply .... So, maybe it is related to this.
 
Cal, welcome to the forum! I’m using an Arduino Mega to parse the Chargery data into a Modbus array, and have seen the same undocumented data stream. It may be for when the BMS is connected to a Chargery charger, like this. “Remote control charge current” feature is what got my attention.

Thanks for the welcome! I'm also using Mega to data log. You are probably correct that the unknown packet is connected to the remote charger. I've found the data stream is somewhat unstable. I get some bad data. Need to use the check sum to verify. Have you noticed the same?

Here's a plot charging the 180AH battery with 19A. Vbat and Cur scale is on the right, cell voltage on the left. Time is in minutes. BMS turns off charging at 3.48V, and back on again at 3.35V. Charger set to 14V.
180AHFullCharge.jpg
 
I've found the data stream is somewhat unstable. I get some bad data. Need to use the check sum to verify. Have you noticed the same?
I have not had too much of a problem with the data stream.

What are you using to interface with your chargery?

I haven't seen any stability issues either. I calculate the checksum as data is received, then compare to the received check sum prior to parsing datastream into the array. The Mega is only 6" away from the Chargery, with a 232/TTL converter inbetween. How are you converting the 232 voltages to TTL?
 
I haven't seen any stability issues either. I calculate the checksum as data is received, then compare to the received check sum prior to parsing datastream into the array. The Mega is only 6" away from the Chargery, with a 232/TTL converter inbetween. How are you converting the 232 voltages to TTL?

Here's my circuit that converts a +/- 5V signal to 5V. The signal requires just one inversion since the Chargery signal is already inverted.

I found that I needed to implement check sum out of necessity. What happens when you eliminate check sum validity test? What type of TTL converter do you use?
P1000110R.jpg
 
I haven't seen any stability issues either. I calculate the checksum as data is received, then compare to the received check sum prior to parsing datastream into the array. The Mega is only 6" away from the Chargery, with a 232/TTL converter inbetween. How are you converting the 232 voltages to TTL?
I use the USRIOT device that broadcasts the raw data to a websocket. I would rather just read the raw data but have not gotten to try a stand alone converter yet.
 
s-l1600.jpg


Here's what I'm using, about a buck a piece on the 'bay.

Here's a snippet of the data stream with debug turned on:

Code:
 Rx:24 Rx[0]:24            Begin
 CheckSum:24
 Rx:24 Rx[1]:24 CheckSum:48
 Rx:57 Rx[2]:57 CheckSum:9F
 Rx:F Rx[3]:F CheckSum:AE
 Rx:10 Rx[4]:10 CheckSum:BE
 Rx:68 Rx[5]:68 CheckSum:26
 Rx:0 Rx[6]:0 CheckSum:26
 Rx:0 Rx[7]:0 CheckSum:26
 Rx:35 Rx[8]:35 CheckSum:5B
 Rx:0 Rx[9]:0 CheckSum:5B
 Rx:D0 Rx[10]:D0 CheckSum:2B
 Rx:0 Rx[11]:0 CheckSum:2B
 Rx:D0 Rx[12]:D0 CheckSum:FB
 Rx:0 Rx[13]:0 CheckSum:FB
 Rx:FB Rx[14]:FB           End of string, Good CheckSum! command 57
 HB[51]:10
16-bit: 16
 HB[52]:68
 HB[53]:0
16-bit: 26624
 HB[54]:0
 HB[55]:35
16-bit: 53
 HB[56]:0
 HB[57]:D0
16-bit: 208
 HB[58]:0
 HB[59]:D0
16-bit: 208
 HB[60]:0
 HB[61]:FB
16-bit: 251
 HR[21]:4200
 HR[22]:0
 HR[23]:53
 HR[24]:208
 HR[25]:208
 HR[26]:0
 CheckSum:0
 Rx:24 Rx[0]:24            Begin
 CheckSum:24
 Rx:24 Rx[1]:24 CheckSum:48
 Rx:56 Rx[2]:56 CheckSum:9E
 Rx:26 Rx[3]:26 CheckSum:C4
 Rx:C Rx[4]:C CheckSum:D0
 Rx:B6 Rx[5]:B6 CheckSum:86
 Rx:C Rx[6]:C CheckSum:92
 Rx:BD Rx[7]:BD CheckSum:4F
 Rx:C Rx[8]:C CheckSum:5B
 Rx:BD Rx[9]:BD CheckSum:18
 Rx:C Rx[10]:C CheckSum:24
 Rx:BC Rx[11]:BC CheckSum:E0
 Rx:C Rx[12]:C CheckSum:EC
 Rx:B5 Rx[13]:B5 CheckSum:A1
 Rx:C Rx[14]:C CheckSum:AD
 Rx:BC Rx[15]:BC CheckSum:69
 Rx:C Rx[16]:C CheckSum:75
 Rx:C0 Rx[17]:C0 CheckSum:35
 Rx:C Rx[18]:C CheckSum:41
 Rx:C4 Rx[19]:C4 CheckSum:5
 Rx:C Rx[20]:C CheckSum:11
 Rx:C0 Rx[21]:C0 CheckSum:D1
 Rx:C Rx[22]:C CheckSum:DD
 Rx:E8 Rx[23]:E8 CheckSum:C5
 Rx:C Rx[24]:C CheckSum:D1
 Rx:D0 Rx[25]:D0 CheckSum:A1
 Rx:C Rx[26]:C CheckSum:AD
 Rx:ED Rx[27]:ED CheckSum:9A
 Rx:C Rx[28]:C CheckSum:A6
 Rx:CA Rx[29]:CA CheckSum:70
 Rx:C Rx[30]:C CheckSum:7C
 Rx:C5 Rx[31]:C5 CheckSum:41
 Rx:C Rx[32]:C CheckSum:4D
 Rx:D3 Rx[33]:D3 CheckSum:20
 Rx:C Rx[34]:C CheckSum:2C
 Rx:C3 Rx[35]:C3 CheckSum:EF
 Rx:0 Rx[36]:0 CheckSum:EF
 Rx:EF Rx[37]:EF           End of string, Good CheckSum! command 56
 HB[1]:C
 HB[2]:B6
16-bit: 3254
 HB[3]:C
 HB[4]:BD
16-bit: 3261
 HB[5]:C
 HB[6]:BD
16-bit: 3261
 HB[7]:C
 HB[8]:BC
16-bit: 3260
 HB[9]:C
 HB[10]:B5
16-bit: 3253
 HB[11]:C
 HB[12]:BC
16-bit: 3260
 HB[13]:C
 HB[14]:C0
16-bit: 3264
 HB[15]:C
 HB[16]:C4
16-bit: 3268
 HB[17]:C
 HB[18]:C0
16-bit: 3264
 HB[19]:C
 HB[20]:E8
16-bit: 3304
 HB[21]:C
 HB[22]:D0
16-bit: 3280
 HB[23]:C
 HB[24]:ED
16-bit: 3309
 HB[25]:C
 HB[26]:CA
16-bit: 3274
 HB[27]:C
 HB[28]:C5
16-bit: 3269
 HB[29]:C
 HB[30]:D3
16-bit: 3283
 HB[31]:C
 HB[32]:C3
16-bit: 3267
 HB[33]:0
 HB[34]:EF
16-bit: 239
 HR[1]:3254
 HR[2]:3261
 HR[3]:3261
 HR[4]:3260
 HR[5]:3253
 HR[6]:3260
 HR[7]:3264
 HR[8]:3268
 HR[9]:3264
 HR[10]:3304
 HR[11]:3280
 HR[12]:3309
 HR[13]:3274
 HR[14]:3269
 HR[15]:3283
 HR[16]:3267
 HR[17]:0
 CheckSum:0
 
Thanks, I ordered a couple of those RS232 devices from China. See them maybe in June?

I've also looked at the Chargery RS232 signal with a Saleae logic analyzer. That data shows framing errors. I don't recall if I connected the analyzer directly to Chargery or to the circuit I just posted. I just noticed my circuit should have a capacitor to stabilize the 5V supply during switching.

Code:
Time [s]     Analyzer Name     Decoded Protocol Result
-2.68125E-05    Async Serial    0x24
6.00625E-05    Async Serial    0x24
0.000146875    Async Serial    0x57
0.000233625    Async Serial    0x0E
0.000320438    Async Serial    0x0D
0.000407188    Async Serial    0xAC
0.000494063    Async Serial    0x01
0.000580875    Async Serial    0x00
0.000667688    Async Serial    0x0F
0.000754438    Async Serial    0x00
0.00084125    Async Serial    0x9F
0.000893375    Async Serial    0xFC
0.000928    Async Serial    0x00
0.001014875    Async Serial    0xAD
0.001101625    Async Serial    0xC2
0.501639    Async Serial    0x0B
0.501639    Async Serial    0x24
0.501725875    Async Serial    0x24
0.501812625    Async Serial    0x57
0.501899438    Async Serial    0x0E
0.50198625    Async Serial    0x0D
0.502073063    Async Serial    0xAC
0.502159813    Async Serial    0x01
0.502246625    Async Serial    0x00
0.502333438    Async Serial    0x0C
0.50242025    Async Serial    0x00
0.502507063    Async Serial    0x9F
0.502559125    Async Serial    0xFD
0.502593875    Async Serial    0x00
0.502680688    Async Serial    0xAE
0.5027675    Async Serial    0xC0
0.755696563    Async Serial    0x8B (framing error)
0.755696563    Async Serial    0x24
0.755783438    Async Serial    0x24
0.755870188    Async Serial    0x56
0.755957    Async Serial    0x16
0.756043813    Async Serial    0x0D
0.756130563    Async Serial    0x37
0.756217375    Async Serial    0x0D
0.756304188    Async Serial    0x1C
0.756391    Async Serial    0x0D
0.756477813    Async Serial    0x1F
0.756564625    Async Serial    0x0D
0.756651375    Async Serial    0x08 (framing error)
0.756651375    Async Serial    0x26
0.756738188    Async Serial    0x00
0.756825063    Async Serial    0x00
0.756911813    Async Serial    0x00
0.756998563    Async Serial    0x00
0.757085375    Async Serial    0x00
0.757172188    Async Serial    0x1D
0.757259    Async Serial    0x00
0.757345813    Async Serial    0x03
0.757432625    Async Serial    0x64
0.757519438    Async Serial    0x04
1.00330475    Async Serial    0x4B
1.004224938    Async Serial    0xFD
1.504979313    Async Serial    0x0B
1.5058995    Async Serial    0xFE
1.620372438    Async Serial    0xF9
1.888405063    Async Serial    0x2B (framing error)
1.889359875    Async Serial    0x08 (framing error)
2.006653938    Async Serial    0x4B
2.007574063    Async Serial    0xFC
2.508319938    Async Serial    0x0B
2.509240063    Async Serial    0xFC
3.009985875    Async Serial    0x0B
3.010906    Async Serial    0xFD
3.025011125    Async Serial    0xAB (framing error)
3.025965938    Async Serial    0x08 (framing error)
3.511651813    Async Serial    0x0B
3.512571938    Async Serial    0xFF
3.627053625    Async Serial    0xF9
4.013326438    Async Serial    0x0B
4.014246563    Async Serial    0xFF
4.15383975    Async Serial    0x8B (framing error)
4.154794563    Async Serial    0x08 (framing error)
4.514992375    Async Serial    0x4B
4.5159125    Async Serial    0xFC
5.016666938    Async Serial    0x4B
5.017587063    Async Serial    0xFC
5.286539688    Async Serial    0x8B (framing error)
5.287494563    Async Serial    0x08 (framing error)
5.518332875    Async Serial    0x4B
5.519253    Async Serial    0xFE
5.633726    Async Serial    0xF9
6.01999875    Async Serial    0x0B
6.020918875    Async Serial    0xFC
6.41924825    Async Serial    0xAB (framing error)
6.420203063    Async Serial    0x08 (framing error)
6.521673313    Async Serial    0x0B
6.522593438    Async Serial    0xFF
7.023339188    Async Serial    0x4B
7.024259375    Async Serial    0xFD
1.888405063    Async Serial    0x2B (framing error)
1.888405063    Async Serial    0x24
1.888491938    Async Serial    0x24
1.888578688    Async Serial    0x56
1.8886655    Async Serial    0x16
1.888752313    Async Serial    0x0D
1.888839063    Async Serial    0x37
1.888925875    Async Serial    0x0D
1.889012688    Async Serial    0x1B
1.889099563    Async Serial    0x0D
1.889186313    Async Serial    0x21
1.889273125    Async Serial    0x0D
1.889359875    Async Serial    0x08 (framing error)
1.889359875    Async Serial    0x26
1.889446688    Async Serial    0x00
1.8895335    Async Serial    0x00
1.88962025    Async Serial    0x00
1.889707125    Async Serial    0x00
1.889793938    Async Serial    0x00
1.88988075    Async Serial    0x1D
1.8899675    Async Serial    0x00
1.890054313    Async Serial    0x03
1.890141125    Async Serial    0x64
1.890227938    Async Serial    0x05
2.006653938    Async Serial    0x4B
2.006653938    Async Serial    0x24
2.006740813    Async Serial    0x24
2.006827625    Async Serial    0x57
2.006914438    Async Serial    0x0E
2.007001188    Async Serial    0x0D
2.007088    Async Serial    0xAC
2.007174813    Async Serial    0x01
2.007261625    Async Serial    0x00
2.007348438    Async Serial    0x0F
2.007435188    Async Serial    0x00
2.007522    Async Serial    0x9F
2.007574063    Async Serial    0xFC
2.007608813    Async Serial    0x00
2.007695625    Async Serial    0xAD
2.007782375    Async Serial    0xC2
2.508319938    Async Serial    0x0B
2.508319938    Async Serial    0x24
2.50840675    Async Serial    0x24
2.508493625    Async Serial    0x57
2.508580375    Async Serial    0x0E
2.508667188    Async Serial    0x0D
2.508753938    Async Serial    0xAC
2.50884075    Async Serial    0x01
2.508927563    Async Serial    0x00
2.509014375    Async Serial    0x11
2.509101188    Async Serial    0x00
2.509187938    Async Serial    0x9E
2.509240063    Async Serial    0xFC
2.50927475    Async Serial    0x00
2.509361563    Async Serial    0xAD
2.509448375    Async Serial    0xC3
3.009985875    Async Serial    0x0B
3.009985875    Async Serial    0x24
3.010072688    Async Serial    0x24
3.0101595    Async Serial    0x57
3.010246313    Async Serial    0x0E
3.010333125    Async Serial    0x0D
3.010419875    Async Serial    0xAC
3.010506688    Async Serial    0x01
3.0105935    Async Serial    0x00
3.010680313    Async Serial    0x0C
3.010767125    Async Serial    0x00
3.010853938    Async Serial    0x9F
3.010906    Async Serial    0xFD
3.01094075    Async Serial    0x00
3.0110275    Async Serial    0xAE
3.011114375    Async Serial    0xC0
3.025011125    Async Serial    0xAB (framing error)
3.025011125    Async Serial    0x24
3.025098    Async Serial    0x24
3.02518475    Async Serial    0x56
3.025271563    Async Serial    0x16
3.025358375    Async Serial    0x0D
3.025445125    Async Serial    0x37
3.025531938    Async Serial    0x0D
3.02561875    Async Serial    0x1B
3.025705563    Async Serial    0x0D
3.025792375    Async Serial    0x1E
3.025879188    Async Serial    0x0D
3.025965938    Async Serial    0x08 (framing error)
3.025965938    Async Serial    0x27
3.02605275    Async Serial    0x00
3.026139625    Async Serial    0x00
3.026226313    Async Serial    0x00
3.026313188    Async Serial    0x00
3.0264    Async Serial    0x00
3.026486813    Async Serial    0x1D
3.026573563    Async Serial    0x00
3.026660375    Async Serial    0x03
3.026747188    Async Serial    0x64
3.026833938    Async Serial    0x03
3.511651813    Async Serial    0x0B
3.511651813    Async Serial    0x24
3.511738688    Async Serial    0x24
3.511825438    Async Serial    0x57
3.51191225    Async Serial    0x0E
3.511999063    Async Serial    0x0D
3.512085813    Async Serial    0xAC
3.512172688    Async Serial    0x01
3.512259438    Async Serial    0x00
3.51234625    Async Serial    0x11
3.512433063    Async Serial    0x00
3.512519938    Async Serial    0x9F
3.512571938    Async Serial    0xFF
3.512606625    Async Serial    0x00
3.5126935    Async Serial    0xAE
3.51278025    Async Serial    0xC5
3.627053625    Async Serial    0xF9
3.627053625    Async Serial    0x68
3.6271405    Async Serial    0x3A
3.62722725    Async Serial    0x3A
3.627314063    Async Serial    0x33
3.627400875    Async Serial    0x0D
3.627487688    Async Serial    0x0A
4.013326438    Async Serial    0x0B
4.013326438    Async Serial    0x24
4.013413313    Async Serial    0x24
4.013500063    Async Serial    0x57
4.013586875    Async Serial    0x0E
4.013673688    Async Serial    0x0D
4.013760438    Async Serial    0xAC
4.01384725    Async Serial    0x01
4.013934063    Async Serial    0x00
4.014020875    Async Serial    0x11
4.014107688    Async Serial    0x00
4.0141945    Async Serial    0x9F
4.014246563    Async Serial    0xFF
4.014281313    Async Serial    0x00
4.014368063    Async Serial    0xAE
4.014454938    Async Serial    0xC5
4.15383975    Async Serial    0x8B (framing error)
4.15383975    Async Serial    0x24
4.153926625    Async Serial    0x24
4.154013438    Async Serial    0x56
4.154100188    Async Serial    0x16
4.154187    Async Serial    0x0D
4.154273813    Async Serial    0x39
4.154360625    Async Serial    0x0D
4.154447438    Async Serial    0x1C
4.15453425    Async Serial    0x0D
4.154621    Async Serial    0x1E
4.154707813    Async Serial    0x0D
4.154794563    Async Serial    0x08 (framing error)
4.154794563    Async Serial    0x27
4.154881438    Async Serial    0x00
4.15496825    Async Serial    0x00
4.155055    Async Serial    0x00
4.155141813    Async Serial    0x00
4.155228625    Async Serial    0x00
4.155315438    Async Serial    0x1D
4.155402188    Async Serial    0x00
4.155489    Async Serial    0x03
4.155575813    Async Serial    0x64
4.155662625    Async Serial    0x06
4.514992375    Async Serial    0x4B
 
An interesting test would be to monitor the signal both upstream and downstream of your inverter ckt using multiple channels on the Saleae. I'm guessing maybe the missing cap is contributing to the framing errors?
 
A word of warning on the cheap 232/TTL converters: Tx/Rx labels are swapped! I had to wire Tx to Tx and Rx to Rx on the Mega to get it to work. Tracing out the pins on the MAX232 chip confirmed the mislabeling. DB9 is wired correctly.
 
I get same framing errors when connecting the Saleae directly to Com 3 cable (without my circuit attached). This appears to be a BMS RS232 stability issue. I have a 100A and 300A BMS. Both have this issue.

I think my transistor circuit is good. I'll add a capacitor though.
 
Interesting. I'll try the same experiment this weekend to see if the framing errors are an "undocumented feature" and the Mega is masking them, or if it's specific to your unit. What is the cable distance between the BMS, your inverter ckt, and the Mega?
 
A photo is easier. Cable lengths are relatively short. I haven't gotten around to soldering the transistor to the Mega proto board. The proto board (sitting on top of Mega) has a real time clock and SD micro card reader. A 10 nF capacitor is now installed on the transistor board.

P1000111R.jpg
 

diy solar

diy solar
Back
Top