Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Good Chinese BMS review
#61
(09-01-2019, 12:16 PM)3xtr3m3 Wrote: cool thanks
Hi forgot to mention , comandoarecibir is an established variable set to know when we send the command DD A5 04, every 15 secondns send commands 03, 04 and 05 but I only process response of command 04.

This is full on port open function
Code:
port.on("open", function () {
        console.log("open");
     
        port.on("data", function(data1) {
            port.drain(function (error) {});
            var data = Buffer.from(data1);
            var data3 = data.toString('hex');
            var cantidad_datos = data.length;
            console.log("datos recibidos: " + data3);
            var posicion = parseInt(data3.indexOf("dd04"));
            posicion = posicion /2;    
    
            if (comandoarecibir  =="04" && posicion >-1 && cantidad_datos >=35){
                SendDataToInflux("voltajes,pack=1 voltios="+data.readUIntBE(posicion+4, 2)/1000+"\n"+"voltajes,pack=2 voltios="+data.readUIntBE(posicion+6, 2)/1000+"\n"+"voltajes,pack=3 voltios="+data.readUIntBE(posicion+8, 2)/1000+"\n"+"voltajes,pack=4 voltios="+data.readUIntBE(posicion+10, 2)/1000+"\n"+"voltajes,pack=5 voltios="+data.readUIntBE(posicion+12, 2)/1000+"\n"+"voltajes,pack=6 voltios="+data.readUIntBE(posicion+14, 2)/1000+"\n"+"voltajes,pack=7 voltios="+data.readUIntBE(posicion+16, 2)/1000+"\n"+"voltajes,pack=8 voltios="+data.readUIntBE(posicion+18, 2)/1000+"\n"+"voltajes,pack=9 voltios="+data.readUIntBE(posicion+20, 2)/1000+"\n"+"voltajes,pack=10 voltios="+data.readUIntBE(posicion+22, 2)/1000+"\n"+"voltajes,pack=11 voltios="+data.readUIntBE(posicion+24, 2)/1000+"\n"+"voltajes,pack=12 voltios="+data.readUIntBE(posicion+26, 2)/1000+"\n"+"voltajes,pack=13 voltios="+data.readUIntBE(posicion+28, 2)/1000+"\n"+"voltajes,pack=14 voltios="+data.readUIntBE(posicion+30, 2)/1000)
            }
        });
        var buffer = Buffer.from([0xDD, 0xA5, 0x04, 0x00, 0xFF, 0xFC, 0x77]);
        port.write(buffer, function(err, res) {
        if (err) {
            return console.log('Error on write: ', err.message);
        }
        comandoarecibir = "04";
     
        });
     
        setInterval(function () {
            var buffer = Buffer.from([0xDD, 0xA5, 0x03, 0x00, 0xFF, 0xFD, 0x77]);
            comandoarecibir = "03";
            port.write(buffer, function(err, res) {
            if (err) {
                return console.log('Error on write: ', err.message);
            }
            console.log('Mensaje 03');
            });
    
            setTimeout(function() {
                var buffer = Buffer.from([0xDD, 0xA5, 0x04, 0x00, 0xFF, 0xFC, 0x77]);
                comandoarecibir = "04";
                port.write(buffer, function(err, res) {
                    if (err) {
                        return console.log('Error on write: ', err.message);
                    }
                    console.log('Mensaje 04');
                });
            }, 2000);
        
            setTimeout(function() {
                var buffer = Buffer.from([0xDD, 0xA5, 0x05, 0x00, 0xFF, 0xFB, 0x77]);
                comandoarecibir = "05";
                port.write(buffer, function(err, res) {
                    port.drain(function (error) {});
                    if (err) {
                        return console.log('Error on write: ', err.message);
                    }
                    console.log('Mensaje 05');
                });
            }, 4000);
        }, 15000);
    });
Reply
#62
Ooh I like your sample code jesusangel!

I'm not that good so I just used the python json package and just output in json, then use telegraf to import it.

Also another BMS to consider, this one is an active balancer. Unknown serial protocol though. Too bad my current balancer works fine now, but will try in the future. It has what I wanted which was a capability to turn on at a certain differential voltage and to turn on and off the balancer. It looks like a better balancer than mine, with supercaps as the storage. They make a few versions, from 1A to 10A.

1A https://www.aliexpress.com/item/32945565819.html
2A http://s.click.aliexpress.com/e/3a7mTtbK
Reply
#63
(09-01-2019, 12:29 PM)jesusangel Wrote:
(09-01-2019, 12:16 PM)3xtr3m3 Wrote: cool thanks
Hi forgot to mention , comandoarecibir is an established variable set to know when we send the command DD A5 04, every 15 secondns send commands 03, 04 and 05 but I only process response of command 04.

This is full on port open function
Code:
port.on("open", function () {
        console.log("open");
     
        port.on("data", function(data1) {
            port.drain(function (error) {});
            var data = Buffer.from(data1);
            var data3 = data.toString('hex');
            var cantidad_datos = data.length;
            console.log("datos recibidos: " + data3);
            var posicion = parseInt(data3.indexOf("dd04"));
            posicion = posicion /2;    
    
            if (comandoarecibir  =="04" && posicion >-1 && cantidad_datos >=35){
                SendDataToInflux("voltajes,pack=1 voltios="+data.readUIntBE(posicion+4, 2)/1000+"\n"+"voltajes,pack=2 voltios="+data.readUIntBE(posicion+6, 2)/1000+"\n"+"voltajes,pack=3 voltios="+data.readUIntBE(posicion+8, 2)/1000+"\n"+"voltajes,pack=4 voltios="+data.readUIntBE(posicion+10, 2)/1000+"\n"+"voltajes,pack=5 voltios="+data.readUIntBE(posicion+12, 2)/1000+"\n"+"voltajes,pack=6 voltios="+data.readUIntBE(posicion+14, 2)/1000+"\n"+"voltajes,pack=7 voltios="+data.readUIntBE(posicion+16, 2)/1000+"\n"+"voltajes,pack=8 voltios="+data.readUIntBE(posicion+18, 2)/1000+"\n"+"voltajes,pack=9 voltios="+data.readUIntBE(posicion+20, 2)/1000+"\n"+"voltajes,pack=10 voltios="+data.readUIntBE(posicion+22, 2)/1000+"\n"+"voltajes,pack=11 voltios="+data.readUIntBE(posicion+24, 2)/1000+"\n"+"voltajes,pack=12 voltios="+data.readUIntBE(posicion+26, 2)/1000+"\n"+"voltajes,pack=13 voltios="+data.readUIntBE(posicion+28, 2)/1000+"\n"+"voltajes,pack=14 voltios="+data.readUIntBE(posicion+30, 2)/1000)
            }
        });
        var buffer = Buffer.from([0xDD, 0xA5, 0x04, 0x00, 0xFF, 0xFC, 0x77]);
        port.write(buffer, function(err, res) {
        if (err) {
            return console.log('Error on write: ', err.message);
        }
        comandoarecibir = "04";
     
        });
     
        setInterval(function () {
            var buffer = Buffer.from([0xDD, 0xA5, 0x03, 0x00, 0xFF, 0xFD, 0x77]);
            comandoarecibir = "03";
            port.write(buffer, function(err, res) {
            if (err) {
                return console.log('Error on write: ', err.message);
            }
            console.log('Mensaje 03');
            });
    
            setTimeout(function() {
                var buffer = Buffer.from([0xDD, 0xA5, 0x04, 0x00, 0xFF, 0xFC, 0x77]);
                comandoarecibir = "04";
                port.write(buffer, function(err, res) {
                    if (err) {
                        return console.log('Error on write: ', err.message);
                    }
                    console.log('Mensaje 04');
                });
            }, 2000);
        
            setTimeout(function() {
                var buffer = Buffer.from([0xDD, 0xA5, 0x05, 0x00, 0xFF, 0xFB, 0x77]);
                comandoarecibir = "05";
                port.write(buffer, function(err, res) {
                    port.drain(function (error) {});
                    if (err) {
                        return console.log('Error on write: ', err.message);
                    }
                    console.log('Mensaje 05');
                });
            }, 4000);
        }, 15000);
    });

Thanks. do you get connectivity problems time to time? like even though bluetooth is connected no data is returned?
Reply
#64
(09-01-2019, 05:33 PM)3xtr3m3 Wrote: Thanks. do you get connectivity problems time to time? like even though bluetooth is connected no data is returned?

No, very stable with USB that is what I use, only some trash bytes before data thats why I had to determine the beginning of response with

var posicion = parseInt(data3.indexOf("dd04"));
Reply
#65
The raspberry pi3 onboard bluetooth is a bit unreliable and sometimes unstable, especially used in conjunction with WiFi. All my problems got solved when I disabled it and used a USB bluetooth adapter instead.
Modular PowerShelf using 3D printed packs.  40kWh and growing.
https://secondlifestorage.com/t-AJW22-s-...PowerShelf
Reply
#66
in my case, it turns out that sending one command and wait for response may not work. if i keep writing to bms via bluetooth in regular intervals then bms start responding and stable once it start sending data.

ajw22 likes this post
Reply
#67
(09-03-2019, 08:33 AM)3xtr3m3 Wrote: in my case, it turns out that sending one command and wait for response may not work. if i keep writing to bms via bluetooth in regular intervals then bms start responding and stable once it start sending data.

That's the main symptom of the RaspPi3 bluetooth +WiFi problem.  I also tried to work around by simply keep sending the commands, but eventually (days ~ weeks) it crashes.
Someone suggested that they chose to free up an I/O pin by not using the bluetooth interrupt signal, so when there is too much going on (eg. Wifi), the CPU may sometimes not get to service the bluetooth data, which then gets lost/overwritten by the next data packet.


This is my current display.  A bit more messy, but more data to diagnose issues.
Modular PowerShelf using 3D printed packs.  40kWh and growing.
https://secondlifestorage.com/t-AJW22-s-...PowerShelf
Reply
#68
nice information. i'm using a mini-pc running ubuntu, wifi turned off. may be not responding problem is at bms side though

how do you calculate the max difference?
Reply
#69
So, my question regarding these style BMS, when they detect that a cell is in trouble, say a cell in a pack fails, and they protect they do they're safety thing of disconnecting, are they resetteable, kinda like a shunt trip switch is for the batrium setup?.
I'm considering using these with the balance feature disabled, and an external active balancer, similar to this
http://s.click.aliexpress.com/e/t4e39Br6
purely for the reason that it's not a massive outlay straight up, which I have no way of doing, and is modular
Reply
#70
(10-07-2019, 09:55 AM)Terry Wrote: [...BMS...] are they resetteable, [...]

Yes, for all fault cases it disables the charging and/or discharging by blocking the respective MOSFETs.  And it will _automatically_ reset them when an acceptable state has been restored.  No user action required.

See snapshot in the link below.  For example, discharging will be disabled once any cell goes under CellUVP (CellUnderVoltageProtection - value is user programmable) for over 5 seconds (programmable), and then reactivates discharging once that cell voltage has increased to the "Release" voltage of 2800mV (programmable).
https://ae01.alicdn.com/kf/HTB1Kv6XsQOWB...PgpXao.jpg

CellOVP/UVP = Cell over/under voltage protection
PackOVP/UVP = Total battery voltage
ChgOTP/UTP = Charging over/under temperature protection
DsgOTP/UDP = Discharging " " "
ChgOCP/DsgOCP = Charging/Discharging over current protection

There are more options, but those are the most important ones.


(10-07-2019, 09:55 AM)Terry Wrote: I'm considering using these with the balance feature disabled, and an external active balancer, similar to this
http://s.click.aliexpress.com/e/t4e39Br6 

Note that the BMS cannot stop whatever the ActiveBalancer is doing.  Maybe that's a good thing, maybe not.  Let us know when you figure it out.


Edit:
I also thought that 50mA balancing current is way too little for a large pack.  But after almost 1 year of use in a 14s100p battery, it has proven to be enough, as long as it's set to start early (eg. at 3.8V), and there are no super leaky cells.... like would-self-discharge-completely-in-a-few-days leaky.
Modular PowerShelf using 3D printed packs.  40kWh and growing.
https://secondlifestorage.com/t-AJW22-s-...PowerShelf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)