Closed leofalp closed 5 years ago
This is the bytes read from serial: `15 133 0 0 8 232 11 158 0 1 36 227 0 0 0 0 0 0 32 77 3 10 2 11 114 11 131 251 41
15 123 255 147 8 232 11 158 0 1 36 227 0 0 0 0 0 0 32 77 3 10 2 11 114 11 131 249 161 `
both line are response to che request of basic infos. The fisrt without a load: current in 0 beause the third and fourth byte are 0. The second line is with a load: third byte goes to 255 and second to 147 regardless of the load. This is very strange because all the other value are perfect... Someone have some ideas?
I'm afraid, I wont be near my BMS for a month or so, as I'm away at the moment. I havent used the current part of the basic info, so if it isnt the correct register, I wouldn't have noticed. To get the registers I refered to https://drive.google.com/file/d/0B3UXptx89r4NZ3VLTHlVS1ZGTTQ/view It would make sense these two values would change, in your examples, if the ony change is, load/no load.
I'm fairly certain this section of code is correct.......... // CURRENT highbyte = (inInts[2]); // bytes 2 and 3 lowbyte = (inInts[3]); uint16_t PackCurrent = two_ints_into16(highbyte, lowbyte); float PackCurrentf = PackCurrent / 100.0f; // convert to float and leave at 2 dec places Serial.print(" Current = "); Serial.print(PackCurrentf); ..................... There are a few errors in the refered to documentation, so maybe play with the bytes 2 and 3.... maybe set byte 2 as 0, zero, since a 255(FF) seems high. highbyte = 0;
When I get back, I will check my readings on the current registers, see if they are same as yours.
You were right, Current miss reading, used unsigned, needs to be signed, current going in(+), or current going out(-) Hope this sorts it, I have not been able with my set up, to check the going in (charge) current, but the going out (discharge current) is working for me now. Let me know if you are able to check this for your set up.
I can confirm now the issue was "float PackCurrentf", so value is positive or negative, depending on power going in or coming out from batteries, via BMS.
I'm trying to red the current value from a "smart BMS" with arduino but using your code the current value is alwais above 655 (mA ?). This is not correct (i'M testing current with other external instruments). If i read the value through the PC with the "official" program the current value is correct. Maybe we're reading the wrong register?