evdc wrote: ↑Thu Oct 24, 2024 7:25 am
Hello @bexander , I finally tried to balance the battery today with the attached code and it also has log files from the series motoring in which it can be seen that when the balance is turned on, it discharges even the most discharged cell, which should not be the case. (I use 18 modules)
Best regards
To me it does what it is supposed to do. I think you are missreading your serial print-out.
Below is a snipped from the serial print-out.
Code: Select all
High Cell: 3987V Module: 10 Cell: 3 Low Cell: 3866V Module: 7 Cell: 3
Total Voltage: 426177
High Cell Temp C: 14 Low Cell Temp C: 12 High Die Temp C: 20
Low Temperature Restriction
Power Control: 97
Regen Control: 94
Status: 1000 Charger LED Status: 10
0 3949 1 3953 2 3948 3 3950 4 3950 5 3952
Module: 0
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3951 1 3954 2 3947 3 3943 4 3943 5 3954
Module: 1
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3946 1 3954 2 3949 3 3954 4 3949 5 3952
Module: 2
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3947 1 3907 2 3949 3 3945 4 3941 5 3947
Module: 3
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3944 1 3953 2 3952 3 3951 4 3943 5 3947
Module: 4
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3944 1 3952 2 3948 3 3953 4 3951 5 3950
Module: 5
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3941 1 3944 2 3943 3 3952 4 3941 5 3940
Module: 6
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3946 1 3953 2 3950 3 3865 4 3943 5 3947
Module: 7
All Cells to Balance
110111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3947 1 3944 2 3940 3 3947 4 3947 5 3951
Module: 8
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3943 1 3954 2 3946 3 3954 4 3946 5 3944
Module: 9
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3947 1 3940 2 3940 3 3987 4 3946 5 3949
Module: 10
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3950 1 3952 2 3944 3 3951 4 3946 5 3954
Module: 11
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3942 1 3946 2 3939 3 3946 4 3935 5 3946
Module: 12
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3946 1 3946 2 3937 3 3949 4 3946 5 3948
Module: 13
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3942 1 3955 2 3941 3 3951 4 3947 5 3949
Module: 14
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3947 1 3944 2 3940 3 3944 4 3946 5 3947
Module: 15
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3940 1 3950 2 3940 3 3953 4 3945 5 3942
Module: 16
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
0 3945 1 3951 2 3941 3 3943 4 3935 5 3945
Module: 17
All Cells to Balance
111111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
First line shows the lowest cell to be cell nr 3 in module 7 and is 3866V, should be mV...
Looking in BMSv0_35.ino at this line
Code: Select all
const int16_t voltageAllowance = 10; // Define the accuracy the balancing algorithm can balance it to, in mV
Every cell with a voltage above (3866 + 10) will need to be drained down to this level.
Now a snippet for module 7 from the above snippet.
Code: Select all
0 3946 1 3953 2 3950 3 3865 4 3943 5 3947
Module: 7
All Cells to Balance
110111
Cell to Balance Filtered :10101
0 2 4 Voltage Diff Min-Max: 122
Here you can see that cell number 3 is 3865mV .
Also, cells to balance "110111".
Now as this is a print-out from Balance_cells.ino from the line below, it is printed "backwards". Cell 0 is the one most to the right. This means that the 0 is for cell number 3, which is the lowest cell in the battery.
Code: Select all
Serial.println(cellToBalance, BIN);
My solution to print the cells to balance in the correct order is as follows.
Code: Select all
for(int i=0; i < MAX_CELLS_PER_MODULE; i++)
{
Serial.print((uint8_t)((cellToBalance >> i) & 0x01));
}
Serial.println();
Side note: It is quite a tall order to ask from the BMS to balance a pack with on cell very low compared to the other cells. I would try to manually charge just that low cell (cell3 module7) with a bench supply to get it up to the same level as the other cells.
The BMS will do it but it will probably take days to get the pack fully balanced as it is now.