This is great!
Those 4 bms readouts all in one look awesome.
I've been wanting to do the same for my 2x chargery and 2x JK BMS banks, all into one pi zero. Glad to see it can be done and thanks for doing the trial and error with the usb hubs!
Crashing scripts can be fixed easy enough thankfully.
Currently running into some SD card data corruption issues. Cleaned out my whole grafana history sadly.
Thanks, let me know if you want the scripts and Grafana json file and I'll try to figure out a simple way to pass them along.
SD cards are not usually made with the highest quality NAND flash memory and lack the error correction circuitry included in SSDs. Like
@shadowsteve , I'm booting off an SSD with no SD card. I'm also using a Pi 400, similar hardware to a Pi 4. I'm not sure if a Pi Zero will run 4 Python serial port capture scripts concurrently. A Pi Zero 2 might be a good option which I'd like to try if I could only get one...
The Chargery BMS cell voltage measurements bounce around a good bit so I tried the Grafana averaging function to smooth it out. The code looks like this:
avg_over_time(BMS_A{mode="CellNum1"}[2m])
Using this function to average the cell delta voltage creates a small error in the result since it won't average the calculated delta voltage. The minimum and maximum cell voltages must be found from the averaged cell voltage and then subtracted like this:
1000 * (max(avg_over_time(BMS_A{mode=~"Cell.*"}[2m])) - min(avg_over_time(BMS_A{mode=~"Cell.*"}[2m])))
This tends to smooth the peaks in the cell voltage so the min/max may be a little lower than the actual peak values. It may make more sense to just accept that this measurement will be noisy. Here's an example comparing the results with and without averaging:
The noise on the cell voltages increases dramatically when the Chargery BMS enables passive balancing. The cell voltages also diverge quite a bit. The pack is charging at about 25A so it seems the 2A passive balancing should not move things around that much. It's set to balance at 3.37V/cell here:
After it switches from charge to discharge the cell voltages converge again like in the first plot in this reply. It should be accurate enough for cell protection but it makes me wonder what is really going on.