Thread Rating:
  • 4 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AJW22's modular 3d printed 60kWh PowerShelf
#71
BMS Python Code implementation update:

AJW22!  It is going well.  I am not complete in implementation, but it is taking awhile so I figured I owed you an update.

I am now testing your code on my 3 china BMS's.  I collected from one for awhile playing with the Influxdb/Grafana component.

There seems to be some instability in the Bluetooth (I don't quite know where it is coming from {rpi, linux, bluetooth comms, influxdb...}).

How do you run your python code?  from IDE, from command line, daemon...

Do you have a restart script to monitor the main code?

I am not asking for code, just wondering.  I have been looking for a script restart after failure solution.
hbpowerwall and ajw22 like this post
Bob - has trouble wiring a 3-way switch Blush
Reply
#72
Thanks for the update! Would like a copy when you have a clean and stable program.

I've initially had stability issues with the Bluetooth communication, hence all the extra restarts/delay/retry code. I've traced the problem (99% sure) to the RaspberryPi3 onboard bluetooth hardware or driver. There are some theories floating around about BT+Wifi shared I/O pin causing problems, but I've bypassed the problem by using an external USB-Bluetooth dongle (onboard BT disabled) and that's pretty stable. Still requires a hard reset every couple of months - not sure what's causing that.

My code right now runs from the console, manual start. Planning to one day rewrite it as a daemon with automatic re-start.
I've added a near real-time output to /dev/shm/bms.txt , for reading by other scripts that can't wait 5 mins for the new data.
One of which now controls a well pump (via a Wifi SmartPlug) to fill my pond, and it's working beautifully!
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#73
No problem with sharing code.

I am having some stability issues also (using the builit-in bluetooth) A good many 'Retries to connect'. It may be a signal strength issue with the BLE transceivers. I am adjusting them to see if this is the issue.

After I solve the stability issues (external dongle, perhaps), I will see about how to proceed. On my windows Desktop I had created a service from a python script to record wi-fi signals from a Brultech electric panel monitor. It was quite stable.

Bob
Bob - has trouble wiring a 3-way switch Blush
Reply
#74
(03-23-2020, 08:51 PM)BobinTN Wrote: After I solve the stability issues (external dongle, perhaps), I will see about how to proceed.  On my windows Desktop I had created a service from a python script to record wi-fi signals from a Brultech electric panel monitor.  It was quite stable.


Any progress?
I just added battery#6 to my system, and found out that my USB/Bluetooth dongle can only connect to 5 devices simultaneously.  After search the net for some time, I stumbled across this:

Quote:It is a hardware limitation of the CSR dongle. I did a similar test using bluetoothctl not long ago: Using a CSR dongle, only 5 bluetooth LE devices could connect. With a Broadcom dongle (BCM20702) I could establish 14 concurrent connections. Then I ran out of bluetooth LE devices....



Trying to get hold of a Broadcom dongle now to see if that really helps.  Otherwise will need to rewrite code to split connections over 2 dongles Undecided
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#75
Hello AJW22!

Interesting on the limit of Bluetooth connections on the Dongle.  I hope to get to that ceiling.

Progress is good.  Stability of the program has improved much since I moved my PI closer to the Battery.  I also bought wire extenders to the bluetooth modules to move them farther from the actual batterys.  Thinking that there could be some interference from electromagnetic fields and whatever other disruptive magic that could be flying around the batteries (I aint all that scientific).
The program stops every couple of days,  the error usually have to do with writing to the InfluxDB.  I have not tried to troubleshoot it as of yet.  I have modified the  program some, but mostly to add other stats to write to the InfluxDB (like a new field for the total charge taking place (Adding the current_charge to the current_discharge).  From what I can see, the Time-Series databases are geared toward collecting information and doing stats from the info, not so much to continue processing the data deriving other fields of info.
I have also been working on the Grafana (graphing) end of it.  I am currently working on how to send alerts to my email and SMS when/if my batteries are going to SH$$.
Bob - has trouble wiring a 3-way switch Blush
Reply
#76
Hope things are going well BobinTN.

All Broadcom chipset BT dongles are out of stock, so I got another CSR (aka Cambridge Silicon Radio) dongle with the same max 5 devices limit.
Change to my code turned out to be deceptively simple.... tested all of 10 minutes, so beware.

line ~120:
self.bt_dev = btle.Peripheral(self.adr, btle.ADDR_TYPE_PUBLIC, 0 ) # 3rd parameter selects BT adapter #0 to connect through
=>
self.bt_dev = btle.Peripheral(self.adr, btle.ADDR_TYPE_PUBLIC, self.id % 2 ) # even BMSid connects through BTa#0, odd through BTa#1

I have the onboard BT adapter disabled, so adapters #0 and #1 are the two CSR USB-BT dongles.
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#77
Ok... I think I see what you are doing there on those packs, but can you confirm, you just lay 2 bus bars on each side, and stretch a cat5 strand across 2 cells, solder it to the cells and solder it to the bus bar? A close up picture of a terminated bus bar would be nice.
Reply
#78
(05-20-2020, 08:48 AM)totalimpact Wrote: Ok... I think I see what you are doing there on those packs, but can you confirm, you just lay 2 bus bars on each side, and stretch a cat5 strand across 2 cells, solder it to the cells  and solder it to the bus bar? A close up picture of a terminated bus bar would be nice.

My bus bars are partly stripped 5.5mm^2 (ca. AWG10) cables.  I was too lazy to twist my own.  Besides, solder stick to these coarse stranded cables much better than to solid core wires.  I guide them through the 2 holes in my plastic cell brackets, and then tighten up with 3 zip ties - no way for them to slip out or put tension on the fuse wires.

My "fuse wire": I dissect an AWG22 stranded tin coated copper wire, which yields 17x individual strands of AWG34 (or slightly thinner). I think it broke at somewhere between 5A~7A.
Same wire on both pos and neg sides.
Solid core cat5 wire (AWG24~26) would melt at about 20A~30A and thus not be a good fit in this case.  Not sure about the stranded ones.

I've mentioned this many times before, but just to stress is once more:  For numerous reasons, this design is not suitable for high current usage.  My max is about 25A.



Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#79
That is really nice, really efficient for management and safer fuse setup than nickel strips....

Wondering is there a need to fuse both pos/neg sides of the cell obviously the fuse wire is easier to maintain than spot welds, but I wonder if it would be possible to put a metal plate covering one side of the module as the negative bus bar. I would dimple the plate where it touches the cells, or maybe solder a tiny spring to the plate where each cell is. A few bolts thru the pack to keep it tight. Just trying to think of ways to further ease future cell maintenance.
Reply
#80
(05-20-2020, 07:19 PM)totalimpact Wrote: Wondering is there a need to fuse both pos/neg sides of the cell...

From a safety perspective, no, just the positive side will do.  I too thought many times of using a much thicker wire on the neg side to improve efficiency.  I may try that for the next pack.  But there are several advantages to my current design, too:
* Higher resistance of the longer&thinner fuses means that I can put in replacement cells that have +/- 0.5V charge difference.  The fuses limit the current flow to a safe level.
* Need to stock only one type of cable
Also, I forgot the numbers, but the theoretical gains at the low current levels in use in my system did not seem that significant.


(05-20-2020, 07:19 PM)totalimpact Wrote: ...put a metal plate covering one side of the module as the negative bus bar. 

When replacing cells, I have to remove both fuses and _push_ the cell out.  That would no longer be possible with one side covered.
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)