Making bms's VESC compatible

A-DamW

1 kW
Joined
Dec 19, 2019
Messages
350
Location
Idaho county Idaho
Ok, so I said to myself; "Self, what the heck, you've been slacking way too much, it's time to actually contribute something of value"

That, and this post kinda gave me a kick in the mental rear.

There are a few native vesc based bms's out there in the wild:
Trampa
ENNOID
Chineese ENNOID rip-off

But holy mother, good luck getting out the door for less than ~$250!

The meat:
This thread is about taking inexpensive, off-the-shelf 'smart' BMS's and getting the battery
data into vesc(controller) so we can do all kinds of fun things with it!
like "Shut that motor down!! cell group 5 is at 2.5 volts!!"

A few months ago I became aware of some reletively new jiabaida (JBD) bms models, specifically the SP17S005:
17s_898d5839-8cf2-44c2-8b80-d073bde0fb39_1024x1024.jpg


these are small form factor, lowish current(~<60A continuous), with built in bluetooth,
and tons of github code for the protocol.
Best of all, they can be had for ~$20 shipped!

UPDATE: github link
GitHub - A-damW/JBD_BMS_BLE_VESC_EXPRESS_BRIDGE: JBD_BMS_BLE_VESC_EXPRESS_BRIDGE: An ESP32 firmware and companion LispBM script to connect multiple JBD BLE BMSs to VESC-EXPRESS via ESPNOW

Also can confirm the model SP14S004, which is a smaller(like tiny) 14s version works as well. Cost about $10 ea.
iu
 
Last edited:
So far, the architecture looks like this:

JBD-BMS<-----bluetooth----->ESP32-BRIDGE<-----esp-now----->VESC-EXPRESS<-----CAN-bus----->VESC-controller(LispBM console)

It looks a little complicated, but I'll be mostly talking about the code on the ESP32 in red above, and lisp.

And a screenshot of lisp(very basic at this point) with a single cell voltage on the far right of the console

JBD-VESC.jpg


More to come...
 
Last edited:
Does this mean that it would work with any bluetooth bms?
Hopefully, I'm starting with a JBD bms because I have several, and the protocol is well documented with code.
My ultimate goal is to port the C/C++ code into a vesc package/native firmware library/lisp/whatever makes sense
so the controller can talk directly to the bms over bluetooth or vesc-express(bluetooth)

Is it necessary to have a vesc express, cant it talk to the vesc directly over bluetooth?
Someday it may be able to work over either one, using BT.
Another option is wired UART, if the vesc firmware has the protocol library compiled in, it should be able to talk to the
bms over any available interface.

For now, I am just taking one step at a time, getting each piece working to prove concept.
This has been a massive learning curve for me(a good one!).
The other purpose of starting this thread, is to take what I have started with, and present it to
many other minds out in the world.
I am working on getting the code cleaned up so I can present it on github.
I don't have a license figured out yet, most likely GPLv3 to be compatible w/VESC,
whatever it is, rest assured it will be open source!

I also have the ESP32 "bridge" with a 0.96" oled screen, that can work standalone over BT, and display
Min/Max cell voltages, and horizontal bar graph of all the cells(13s)

1000000020.jpg
 
Last edited:
Hopefully, I'm starting with a JBD bms because I have several, and the protocol is well documented with code.
My ultimate goal is to port the C/C++ code into a vesc package/native firmware library/lisp/whatever makes sense
so the controller can talk directly to the bms over bluetooth or vesc-express(bluetooth)


Someday it may be able to work over either one, using BT.
Another option is wired UART, if the vesc firmware has the protocol library compiled in, it should be able to talk to the
bms over any available interface.

For now, I am just taking one step at a time, getting each piece working to prove concept.
This has been a massive learning curve for me(a good one!).
The other purpose of starting this thread, is to take what I have started with, and present it to
many other minds out in the world.
I am working on getting the code cleaned up so I can present it on github.
I don't have a license figured out yet, most likely GPLv3 to be compatible w/VESC,
whatever it is, rest assured it will be open source!

I also have the ESP32 "bridge" with a 0.96" oled screen, that can work standalone over BT, and display
Min/Max cell voltages, and horizontal bar graph of all the cells(13s)

View attachment 356811


Great initiative! Integrating affordable BMS systems with VESCs could really broaden accessibility and functionality. For the JBD SP17S005, you can utilize the available GitHub code to bridge the BMS data to VESC. Start by interfacing via Bluetooth to capture cell data and then configure the VESC to respond to these inputs. Completing my dissertation seemed like an impossible task, so I decided to get help from Custom Dissertation Writing Services - Unbeatable Prices in UK The service was everything I needed! The writer was professional, provided excellent research, and guided me through the entire process. The dissertation was well-organized, with strong arguments and thorough research. It was delivered on time, and I was so relieved to have it done. This service is a lifesaver!
Any update?
 
Interesting stuff, following!
 
Any update?
Yes! I have been on some Discord servers talking with several other developers working incidentally on almost exactly the same thing as outlined above.

At this point, I am going to deliver what I currently have working, and try to create something like a goals timeline to give folks a better idea of where we are at and where we are headed.
 
Alright, I had some downtime to work on the code base,
Turns out, implementing simultaneous multiple bluetooth BMS connections and espnow relay was not as hard as I expected.
This is a screenshot of the Android mobile app and two 13s jbd BMS simultaneously connected to an ESP32 over bluetooth, and the ESP32 relaying the cells data wirelessly via ESP now to the VESC express:
Screenshot_20240904-135904.png

And I got the working code in a repository on GitHub (I know, I know, it is the Arduino environment, this was just to get started, eventually I will move to vs code and/or platform IO, or similar)
GitHub - A-damW/JBD_BMS_BLE_VESC_EXPRESS_BRIDGE: JBD_BMS_BLE_VESC_EXPRESS_BRIDGE: An ESP32 firmware and companion LispBM script to connect multiple JBD BLE BMSs to VESC-EXPRESS via ESPNOW
 
Are you just connecting the bms:es in series to charge the battery? Maybe a question for later :)
Please ask all the questions you want!

I am not connecting the bms's in series, they are completely bypassed for charge and discharge.
The only thing connected is the balance wires on the BMS to the individual cells.
The mosfets on the BMS cannot handle the combined series voltage of two or more packs.

I wish JBD would make an ultra tiny, ultra cheap, monitor only BMS with perhaps one or two 200v mosfets to cut battery off for charging, or control a contactor/relay.

Battery discharge and regen is handled by the vesc controller, that is the whole point of this project, to get individual cell data to the motor controller so the motor controller can do the shutdown on LV and HV limits.

For standalone charger use I can think of a couple ways to control the charger;
One way would be to have an ESP32 GPIO pin connected to a relay to shut down your charger if any voltage/temperature conditions are met.
Another way would be to have one of the bms's control a relay via the mosfets, and have the ESP32 command the mosfets off when any voltage condition is encountered
 
Last edited:
Please ask all the questions you want!

I am not connecting the bms's in series, they are completely bypassed for charge and discharge.
The only thing connected is the balance wires on the BMS to the individual cells.
The mosfets on the BMS cannot handle the combined series voltage of two or more packs.

I wish JBD would make an ultra tiny, ultra cheap, monitor only BMS with perhaps one or two 200v mosfets to cut battery off for charging, or control a contactor/relay.

Battery discharge and regen is handled by the vesc controller, that is the whole point of this project, to get individual cell data to the motor controller so the motor controller can do the shutdown on LV and HV limits.

For standalone charger use I can think of a couple ways to control the charger;
One way would be to have an ESP32 GPIO pin connected to a relay to shut down your charger if any voltage/temperature conditions are met.
Another way would be to have one of the bms's control a relay via the mosfets, and have the ESP32 command the mosfets off when any voltage condition is encountered

Sorry for the off topic question but could save me taking apart my bms's.
What voltage are the jbd 10-17s mosfets capable of? I've got 2 spare, one 50a and one 60a off the top of my head.
I've switched to jk for my main 20s battery but have a spare 13s battery I'm going to fit one of the jbd bms's and was considering building a 7s battery to run in series.
 
Sorry for the off topic question but could save me taking apart my bms's.
What voltage are the jbd 10-17s mosfets capable of? I've got 2 spare, one 50a and one 60a off the top of my head.
I've switched to jk for my main 20s battery but have a spare 13s battery I'm going to fit one of the jbd bms's and was considering building a 7s battery to run in series.
Looks like the mosfets are PES016N08R, made by Semione for the SP17S005 model.
Datasheet says 90V. datasheet attached below for posterity.
And source link: http://semi-one.com/Uploads/pdf/pes016n08r-v1.0.pdf

1000000203.jpg
 

Attachments

  • pes016n08r-v1.0.pdf
    2.6 MB · Views: 4
Last edited:
And while I'm at it, the SP17S005 model utilizes the O2 micro OZ3717 digital front end for measuring cell voltage, temps, coulomb counting etc.
Page 38 of the doc:
 

Attachments

  • O2 807&G807C Product Catalog 2023-6-26(final).pdf
    1.1 MB · Views: 1
Looks like the mosfets are PES016N08R, made by Semione for the SP17S005 model.
Datasheet says 90V. datasheet attached below for posterity.
And source link: http://semi-one.com/Uploads/pdf/pes016n08r-v1.0.pdf

View attachment 360373
Thank you I appreciate that, I don't use regen so it might be worth a shot.

Good luck on your project looks like it's coming along well. Theirs some decent budget vesc controller offerings but not bms's so this could be a great alternative.
 
This is awesome, I would love to see if you could get ANT bms's to also work with VESC
 
I have pushed (pulled?) code in github, that softcodes total battery cell count.

So now the esp32-bridge tracks the cell count, and sends via esp-now to the vesc-express in a colon delimited cellnum:voltage format:
1:3.604
2:3.685
3:3.691
4:3.690
5:3.668
6:3.689
7:3.691
8:3.679
9:3.690
etc.,

where it is split and applied to the appropriate values in the vesc-express lisp script.
 
Last edited:
Back
Top