Master CAN module for Hankzor balancers
-
- Posts: 3267
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 80 times
- Been thanked: 234 times
- Contact:
Re: Master CAN module for Hankzor balancers
It seems i did the modules injustice. Its sensory part is very precise IF you calibrate it beforehand. It seems to look to AD differences between cells and takes complete scale with respect to that. Whrn you use a good multimeter ti measure module voltage you insert that in the application and it will then follow that value.
But regarding longevitl i would say it ran for over a year with balancers allways on. Then mosfets failed and consecutively resistor fuses. Now mosfets failed on 24S wired models not 16S. Those are still running strong.
This leads me to believe it shouldnt be used as 24S. Maybe rather 20S. Transistor gap is too small for 90V and mosfets are 100V rated. We need more margin...
But regarding longevitl i would say it ran for over a year with balancers allways on. Then mosfets failed and consecutively resistor fuses. Now mosfets failed on 24S wired models not 16S. Those are still running strong.
This leads me to believe it shouldnt be used as 24S. Maybe rather 20S. Transistor gap is too small for 90V and mosfets are 100V rated. We need more margin...
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
Ah okay, quite a shame to have to run it under capacity. It does say its rated at 100V which of course literally will be the max voltage of a package and not the design itself.
Did you publish your decoding and control publicly?
Did you publish your decoding and control publicly?
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
Sorry answered my own question.
A bit bulky code, will look into making a bit more "dynamic" as in not fixed and fully configurable.
https://github.com/arber333/ESP32-VCU/b ... 32BMSa.ino
A bit bulky code, will look into making a bit more "dynamic" as in not fixed and fully configurable.
https://github.com/arber333/ESP32-VCU/b ... 32BMSa.ino
-
- Posts: 3267
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 80 times
- Been thanked: 234 times
- Contact:
Re: Master CAN module for Hankzor balancers
Yes i am no coder... i changed it multiple times. I want to use flags as i need the code selectively turn on.tom91 wrote: ↑Fri Jan 20, 2023 6:30 pm Sorry answered my own question.
A bit bulky code, will look into making a bit more "dynamic" as in not fixed and fully configurable.
https://github.com/arber333/ESP32-VCU/b ... 32BMSa.ino
For my first objective i tried to turn balancers on and off as i drive or charge.
For second objective i want to get all cell values and store them in an array. There i can compare them and choose the highest and lowest cell and its position.
For third objective i will take temp values and make some alarms from all data.
For rest of steps i would like to put filtered data to Wifi or Bluetooth.
Would you need one sample board for testing?
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
I will first get it working on my SimpBMS Teensy 3.2 probably starting with VW code base.
Then I will look at working out how to best share this with others, dont want to go rewriting your whole code as I do not know the "I/O functions".
Then I will look at working out how to best share this with others, dont want to go rewriting your whole code as I do not know the "I/O functions".
-
- Posts: 3267
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 80 times
- Been thanked: 234 times
- Contact:
Re: Master CAN module for Hankzor balancers
Ah ok BMS is just sensing ENABLE and PP signals and possibly 12V level on AD rest are outputs for interfacing with the car.
When you test your code and it works please report back on how it works as i may copy your hard work.
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
First draft created. https://github.com/Tom-evnut/SimpBMS-JK
It reads the info and can command balancing.
Balancing is done here, they need to be set once so using a simple integer to do this.
BMS section handles the sending of the can message, it first checks which modules are known to exist.
Requesting info, currently is just a shotgun approach not cyclic like you probally want to implement it.
The variable settings.NumModules is a setting to assign amount of modules that should be requested.
The decoding happens as follows. It merely looks for a message in the right range and passes it on.
Again a simple pass along to the right section using the message id as the module id.
Here is how I decode the message, it puts all the variables into the right places to allow it to function in the SimpBMS code frame work.
It reads the info and can command balancing.
Balancing is done here, they need to be set once so using a simple integer to do this.
Code: Select all
if (balancecells == 1)
{
if (SetBal == 2 || SetBal == 0)
{
bms.balanceCells(1, 0); //1 is debug
SetBal = 1;
}
}
else
{
if (SetBal == 1 || SetBal == 0)
{
bms.balanceCells(0, 0); //1 is debug
SetBal = 2;
}
}
Code: Select all
void BMSModuleManager::balanceCells(bool balance, int debug)
{
for (int y = 1; y < MAX_MODULE_ADDR; y++)
{
if (modules[y].isExisting() == 1)
{
OUTmsg.id = y;
OUTmsg.len = 2;
OUTmsg.ext = 0;
OUTmsg.buf[0] = 0xF6;
OUTmsg.buf[1] = balance;
Can0.write(OUTmsg);
delay(1);
}
}
}
The variable settings.NumModules is a setting to assign amount of modules that should be requested.
Code: Select all
void sendcommand()
{
for (int I = 1; I < (settings.NumModules + 1); I++)
{
msg.id = I;
msg.len = 1;
msg.buf[0] = 0xFF;
Can0.write(msg);
delay(1);
}
}
Code: Select all
if (inMsg.id < 0x00F)//Can Messages from modules
{
if (candebug == 1)
{
bms.decodecan(inMsg, 1); //Can Messages from modules
}
else
{
bms.decodecan(inMsg, 0); //Can Messages from modules
}
}
Code: Select all
void BMSModuleManager::decodecan(CAN_message_t &msg, int debug)
{
int CMU, Id = 0;
CMU = msg.id;
if (debug == 1)
{
Serial.println();
Serial.print(CMU);
Serial.print(" | ");
}
modules[CMU].setExists(true);
modules[CMU].setReset(true);
modules[CMU].decodecan(msg);
}
Code: Select all
void BMSModule::decodecan(CAN_message_t &msg)
{
uint8_t Id = 0;
Id = msg.buf[0];
switch (Id)
{
case 1:
temperatures[0] = msg.buf[2] + msg.buf[1] * 256;
break;
case 2:
balstat = msg.buf[3];
break;
case 4:
cellVolt[msg.buf[1]] = (msg.buf[3] + msg.buf[2] * 256) * 0.001;
cellVolt[msg.buf[1] + 1] = (msg.buf[5] + msg.buf[4] * 256) * 0.001;
cellVolt[msg.buf[1] + 2] = (msg.buf[7] + msg.buf[6] * 256) * 0.001;
break;
default:
break;
}
}
-
- Posts: 3267
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 80 times
- Been thanked: 234 times
- Contact:
Re: Master CAN module for Hankzor balancers
I think in the past i promised the DIP switch address table:
Re: Master CAN module for Hankzor balancers
Hi Tom!tom91 wrote: ↑Sat Jan 21, 2023 2:14 pm First draft created. https://github.com/Tom-evnut/SimpBMS-JK
It reads the info and can command balancing.
Balancing is done here, they need to be set once so using a simple integer to do this.BMS section handles the sending of the can message, it first checks which modules are known to exist.Code: Select all
if (balancecells == 1) { if (SetBal == 2 || SetBal == 0) { bms.balanceCells(1, 0); //1 is debug SetBal = 1; } } else { if (SetBal == 1 || SetBal == 0) { bms.balanceCells(0, 0); //1 is debug SetBal = 2; } }
Requesting info, currently is just a shotgun approach not cyclic like you probally want to implement it.Code: Select all
void BMSModuleManager::balanceCells(bool balance, int debug) { for (int y = 1; y < MAX_MODULE_ADDR; y++) { if (modules[y].isExisting() == 1) { OUTmsg.id = y; OUTmsg.len = 2; OUTmsg.ext = 0; OUTmsg.buf[0] = 0xF6; OUTmsg.buf[1] = balance; Can0.write(OUTmsg); delay(1); } } }
The variable settings.NumModules is a setting to assign amount of modules that should be requested.
The decoding happens as follows. It merely looks for a message in the right range and passes it on.Code: Select all
void sendcommand() { for (int I = 1; I < (settings.NumModules + 1); I++) { msg.id = I; msg.len = 1; msg.buf[0] = 0xFF; Can0.write(msg); delay(1); } }
Again a simple pass along to the right section using the message id as the module id.Code: Select all
if (inMsg.id < 0x00F)//Can Messages from modules { if (candebug == 1) { bms.decodecan(inMsg, 1); //Can Messages from modules } else { bms.decodecan(inMsg, 0); //Can Messages from modules } }
Here is how I decode the message, it puts all the variables into the right places to allow it to function in the SimpBMS code frame work.Code: Select all
void BMSModuleManager::decodecan(CAN_message_t &msg, int debug) { int CMU, Id = 0; CMU = msg.id; if (debug == 1) { Serial.println(); Serial.print(CMU); Serial.print(" | "); } modules[CMU].setExists(true); modules[CMU].setReset(true); modules[CMU].decodecan(msg); }
Code: Select all
void BMSModule::decodecan(CAN_message_t &msg) { uint8_t Id = 0; Id = msg.buf[0]; switch (Id) { case 1: temperatures[0] = msg.buf[2] + msg.buf[1] * 256; break; case 2: balstat = msg.buf[3]; break; case 4: cellVolt[msg.buf[1]] = (msg.buf[3] + msg.buf[2] * 256) * 0.001; cellVolt[msg.buf[1] + 1] = (msg.buf[5] + msg.buf[4] * 256) * 0.001; cellVolt[msg.buf[1] + 2] = (msg.buf[7] + msg.buf[6] * 256) * 0.001; break; default: break; } }
What’s the status on the Jkbms/balancer integration to simpbms? Do you have it up and running?
Thanks
Rikard
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
Ok, so loading the evsbms with SimpJK.ino.TEENSY32.hex would do it?
When using more than 24s I guess that the jk-balancers needs to be connected like this in order for all cells to be balanced evenly?
-
- Posts: 1326
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 106 times
- Been thanked: 226 times
Re: Master CAN module for Hankzor balancers
NO that is for the SimpBMS as it says and the previous posts mention. If you need it to work on EVS-BMS hardware that can be looked at too, do you have an EVS-BMS?
Re: Master CAN module for Hankzor balancers
Ok, I haven’t decided on the bms to use yet, still looking though options.
Thanks