diy solar

diy solar

JK-BMS-CAN with new Cut-Off Charging Logic (open-source)

Stupid me using the wrong pinout. But IMHO this should be included in the documentation @MrPablo ;) .
Like I said, feel free to submit a pull request.
I don't think we can preemptively document pinouts for hardware that we're not using internally and that isn't tested by us.
It'll become a burdensome task rather quickly.
 
The way I see it,
it takes at most one trial and error swap to get the BMS-UART pins correct.
Whether the wires are physically swapped at the BMS side, or the s/w definition side. Anyone of the two, but never both at once.

The same goes for trial and error swap to get the UART-CAN pins.
Wires swap possibility is at the ESP to CAN transceiver UART side or again the s/w definition side. Anyone of the two, never both at once.

Regarding the inverter CANH/L side, there is only one physical wire swap possibility at the inverter side.
 
Last edited:
Like I said, feel free to submit a pull request.
I don't think we can preemptively document pinouts for hardware that we're not using internally and that isn't tested by us.
It'll become a burdensome task rather quickly.
Again, it's a valid point :).

But like I said, I didn't know where to buy the recommended adapter and didn't want to wait 1 month or so ...
Plus I cannot figure out how it would connect to the Atom S3 Lite in the first place.

Do you have some schematic / photos for that ?
 
The way I see it,
it takes at most one trial and error swap to get the BMS-UART pins correct.
Whether the wires are physically swapped at the BMS side, or the s/w definition side. Anyone of the two, but never both at once.

The same goes for trial and error swap to get the UART-CAN pins.
Wires swap possibility is at the ESP to CAN transceiver UART side or again the s/w definition side. Anyone of the two, never both at once.

Regarding the inverter CANH/L side, there is only one physical swap possibility at the inverter side.
Regarding the inverter CANH/L side, there is only one physical swap possibility at the ESP32 side :) . You cannot tinker with the inverter PCB (or at least I wouldn't recommend doing so).
 
Again, it's a valid point :).

But like I said, I didn't know where to buy the recommended adapter and didn't want to wait 1 month or so ...
Plus I cannot figure out how it would connect to the Atom S3 Lite in the first place.

Do you have some schematic / photos for that ?
It's quite a nice unit, the Atom has sockets on the underneath that mate up with the pins on the adaptor. It essentially just plugs in.
1711362810913.png
I've just spotted that it's now marked as EOL on the M5stack site - not great news.
 
Something is very wrong.
I have 2 entities in MQTT and I disabled what I believe was the old one (which had some activity, but is the wrong/old ESP32 board, NOT the ESP32s3):
View attachment 204532

Item number 2 is disabled.

View attachment 204533

Now only 9 cell are being reported.

What is going on ?

Do I really need 2 MQTT devices for the same physical device ?

EDIT 1: Might be something temporary after i disabled item number 2. Re-enabled and Re-disabled item number 2. Now all 16 cells are back in frontend. Weird ...
Once you changed the details for the MQTT of the build firmware, you need o clean MQTT, in some cases you also need to remove the device under MQTT add-on and/or the last step (may not need but can be last resource) is to restart MQTT server.
Regarding your Can bus problem. Please check to see the impedance of the entire wire! See the test case for the TJA1050. Can refer to this as well, page 21: https://www.nxp.com/docs/en/application-note/AN00020.pdf
1711363122780.png
 
Last edited:
It's quite a nice unit, the Atom has sockets on the underneath that mate up with the pins on the adaptor. It essentially just plugs in.
View attachment 204543
Alright ... But the A103 SKU for that I cannot find anywhere. Maybe in stock by Mouser in 1 month ...

The closest in look is this one, but likely ESP32 + CAN module "in one unit" (everything included)

Then you have the orange terminal block connector on the upper side of your picture ?

EDIT: Aliexpress to the rescue maybe

Thanks for the link to the store @chaosnature
 
Once you changed the details for the MQTT of the build firmware, you need o clean MQTT, in some cases you also need to remove the device under MQTT add-on and/or the last step (may not need but can be last resource) is to restart MQTT server.
Regarding your Can bus problem. Please check to see the impedance of the entire wire! See the test case for the TJA1050. Can refer to this as well, page 21: https://www.nxp.com/docs/en/application-note/AN00020.pdf
View attachment 204547
It is working correctly now. WITHOUT termination resistor even ...
 
It is working correctly now. WITHOUT termination resistor even ...
Often when the run is short and there are no more than 2 nodes on the CANbus then you can get away without a termination resistor at both ends.
The spec calls for it though, and it will likely reduce errors.
If / when there's a multiBMS solution over CANbus, it will become more critical.
 
There is a bit of a difference between requested / actual current though.
Keep in mind that I am ONLY controlling batter 02. Battery 01 will just get whatever the inverter deliver minus what is taken by battery 02.

120A requested , 140A delivered ... Uhm ...

1711363593954.png

And looking at the Charge control spreadsheet it should go up to 144 A which is much closer to the delivered value.
 
Often when the run is short and there are no more than 2 nodes on the CANbus then you can get away without a termination resistor at both ends.
The spec calls for it though, and it will likely reduce errors.
If / when there's a multiBMS solution over CANbus, it will become more critical.
So should I just put it back ?
 
There is a bit of a difference between requested / actual current though.
Keep in mind that I am ONLY controlling batter 02. Battery 01 will just get whatever the inverter deliver minus what is taken by battery 02.

120A requested , 140A delivered ... Uhm ...

View attachment 204549

And looking at the Charge control spreadsheet it should go up to 144 A which is much closer to the delivered value.
Interesting, that suggests that either the inverter is not respecting the CCL, or there's a calibration issue on your BMSs, but that would be a hell of a difference...

As for the resistor, it's up to you.
 
Interesting, that suggests that either the inverter is not respecting the CCL, or there's a calibration issue on your BMSs, but that would be a hell of a difference...

As for the resistor, it's up to you.
What do you mean "Interesting" :ROFLMAO:?

With 800 W / m2 measured by my weather station (it has never been that high !) for sure it can produce 20 kW or even more :ROFLMAO:

So somewhat it is respecting ...

EDIT 1:
Let me try to increase the current limit on the inverter and see if that wasn't the limiting factor

EDIT 2:
Re-added resistor :ROFLMAO:
1711364276646.png

EDIT 3: I'm not fully sure how it works with 3 inverters in parallel, maybe the given battery current reference is delayed when communicated to the slave inverters? Plus possibly 3x measurement errors on 3 inverter ?

EDIT4: and of course now that i'd like to test Clouds came back and sitting at around 150 W/m2.
 
Last edited:
I tuned the max charging current to 45A using the slider (i.e. 45A for both batteries) for a quick test.

Current dropped accordingly so it IS working. Not ultra precise, but good enough
1711365101097.png

EDIT: I also probably made the current control WAY too aggressive. But since OTA didn't work last time, I am not so sure about reflashing ...
 
I tuned the max charging current to 45A using the slider (i.e. 45A for both batteries) for a quick test.

Current dropped accordingly so it IS working. Not ultra precise, but good enough
View attachment 204553

EDIT: I also probably made the current control WAY too aggressive. But since OTA didn't work last time, I am not so sure about reflashing ...
in my case, the inverter mesures current is quiet inaccurate (+/-10-15A) + JK current mesurements are crap too (20A short sometimes)...only one point of truth is the victron shunt. So adding quiet a good amount of security buffer is recommended :)
 
in my case, the inverter mesures current is quiet inaccurate (+/-10-15A) + JK current mesurements are crap too (20A short sometimes)...only one point of truth is the victron shunt. So adding quiet a good amount of security buffer is recommended :)
That's also what I'm observing.

Yeah also the discharge current/power of the JK BMS during the night made me believe I had like 400W no-load losses.

For the new Batteries I'm planning to add a Victron Smartshunt (and an extra NEEY Smart Balancer 4A).

But for the existing batteries. Retrofit won't be easy without re-transplanting them into new individual wooden boxes (NOT 2 batteries in one enclosure ... that is a maintenance nightmare !) ...
1711366507449.png
 
From the JK faq's on the latest BMS

voltage inaccuracy

Measure the actual total voltage of the battery pack with a multimeter, and fill in the actual total voltage into the "Voltage Calibration" in the parameter setting page.




The current is not allowed

1, BMS B- and P- are two 7AWG wires, both need to be connected in parallel, otherwise it will lead to current error.

2、Use a clamp meter to measure the actual current of the battery pack, fill in the actual current into the parameter setting page "current calibration" inside; the larger the actual current, the higher the calibration accuracy.


So always assume your JK BMS is reading volts and amps incorrectly and recalibrate.
 
From the JK faq's on the latest BMS

voltage inaccuracy

Measure the actual total voltage of the battery pack with a multimeter, and fill in the actual total voltage into the "Voltage Calibration" in the parameter setting page.




The current is not allowed

1, BMS B- and P- are two 7AWG wires, both need to be connected in parallel, otherwise it will lead to current error.

2、Use a clamp meter to measure the actual current of the battery pack, fill in the actual current into the parameter setting page "current calibration" inside; the larger the actual current, the higher the calibration accuracy.


So always assume your JK BMS is reading volts and amps incorrectly and recalibrate.
I calibrated the voltage (at NO LOAD !), not the current though.
 
Further on in the note it says the higher the current flow you recalibrate at the more accurate it will be.

That also assumes your meters are accurate.
 
Back
Top