DIY 6S to 12S BMS with CAN - DieBieMS

Heh, it’s a bit of a rabbit hole… Just started looking at the other parts that need to be wired up; power button and the oled display.

I should be able to figure out the oled display, I have 4 labeled pins on the oled PCB (GND, VCC, SCL, SDA) and the schematic for the BMS. I don’t know which pin is number 1, but one end is 3v and the other ground so that should let me figure out which is SDA/SCL.

Power button gets a bit more complicated; showing off my lack of electronics background. Even if I knew which pin was what I still have little idea how it should be wired. eg; when the button is pressed is the circuit completed from the “PushButton” pin to ground pin or 3v pin. Similarly the smart LED; except that gets a little more complicated as polarity matters.

lil help would be much appreciated. :grimacing:

Anyway, it’s Saturday night here and a few beers means it’s time to put the soldering iron away.

Presumably the anti spark facility of the board allows for the balance wires first the the mail battery +/- otherwise you would not be able to have a battery quick disconnect @JTAG

Printing at the minute so please wait for my results, also I was planning on making the top much fancier Edit: removed thing, the scaling is still wrong :frowning:

Update: I’m mid-print on another and looking good so releasing again https://www.thingiverse.com/thing:2748550

Came out ok, could mate be scaled back another mm in length/width

Panel mounts need very small file work to get to fit

Update: Problem with one of the panel mounts interfering with the switch port, need to move panel mount 3mm, will update soon. Also the ‘gasket’ interfact between top and bottom shells is not a perfect watertight fit, going to recut that…for the moment removed the bottom shell design.

On the plus side with a plain top the enclosure will be 30mm tall :wink:

To anyone printing or thinking of please know this is a living doc but is not perfect by any means open to any guru improving it and doing a spinoff on thingiverse

2 Likes

I’ll try and take a picture of my wiring tonight. You can connect the battery in any order as far as I know, first balance then terminals and vice versa.

1 Like

Spent the last 2hrs watching my battery pack being balanced by this BMS :joy:

Ok, so I did manage to do something productive in that time…

The above figure should be pretty straight forward, but use at own risk. Please let me know if you see anything wrong with it.

I wired up the power button first, and wasn’t sure how it should behave. In my playing around I may have held it down a little long and reset its settings. I then left it on charge for a little while. After wiring up the OLED display it was showing that my battery was flat, whereas the multimeter was saying otherwise. Checked out the settings in the VESC tool, and found it was setup for LiIon (and not LiFePO4). High cell was only charged to 3.61v, so no damage done. After you wire it up I’d definitely suggest either confirming settings via VESC tool, or watch with a multimeter before leaving alone for a while.

Took all of 2min to reconfigure the BMS in the VESC Tool (needs to be v0.82), and now it’s been chipping away at the cell imbalance for the last couple hours. It’s really kind of cool. The watt meter I have on my charger shows the BMS switching between discharging the high cells, then bulk charging the pack. At the same you can check out how the balancing is going in the VESC tool on a cell-by-cell basis.

@JTAG and @fedestanco thanks again for all the effort you’ve put into this, it shows :raised_hands:

5 Likes

Thanks for the diagram! I was like 100% sure to have uploaded your custom firmware to your bms. If you found the wrong firmware maybe now somebody else has your Lifepo4 firmware on his bms :frowning: . What values (max cell voltage…) did the vesc tool show before you changed them?

Yeah, good point. This is what it was set to before.

---   BMS Configuration   ---
NoOfCells                  : 12
batteryCapacity            : 10.00Ah
cellHardUnderVoltage       : 1.800V
cellHardOverVoltage        : 3.950V
cellSoftUnderVoltage       : 2.100V
cellSoftOverVoltage        : 3.700V
cellBalanceStart           : 3.800V
cellBalanceDiffThreshold   : 0.010V
CAN ID                     : 10
--- End BMS Configuration ---

So there are two wires attached to pack negative thanks for heads up @fedestanco

This values aren’t even appropriate for liions… Maybe the custom firmware was defective by itself. I will try to double check the 12s-lifepo firmware again and see whats written on it.

Been looking at communication with the DieBieMS via a command line app over the last few days. Started off as something really hack’ish, and now it’s a little cleaner and better documented so figure it may be of use to others. Could do with some more error checking, unit tests, etc.

It’s a command line app written in Python that will run DieBieMS terminal commands. No need for the VESC Tool, although it’s possibly still the preferred option for those who like a GUI.

Install and usage details can be found over on the repo. Hopefully once up and running it should be easy enough to use.

To list available serial ports run: python dbmscmdterminal.py -l

To run a DieBieMS command run something like (will print DieBieMS command help), you will need to replace <MY_SERIAL_PORT> with a serial port found by the above command: python dbmscmdterminal.py -sp <MY_SERIAL_PORT> -c help

You’ll need quotation marks around space separated commands. For example; python dbmscmdterminal.py -sp <MY_SERIAL_PORT> -c "config_set_cells 12"

There’s a record mode that runs continuously polling the BMS and writing out cell voltages, percent charge (and all other available params) to a set of CSV files. python dbmscmdterminal.py -sp <MY_SERIAL_PORT> -r

The only thing it won’t do is upload a new firmware (yet), but on the upside you don’t need to track down a special version of the VESC Tool to setup your DieBieMS.

@jtag please don’t feel you need to maintain any level of backwards compatibility for this. I’ve invested very little time in it so far so if it gets broken, and is never used, then I really don’t mind. However, I am interested in what your thoughts are going forward. Is the client side/desktop stuff something that you’d like to focus on, and should we hold off on investing more time and doing anything ‘prettier’?

4 Likes

Hi there,

I’ve also been starting to make the “perfect BMS” and looking at your design raised me with some questions:

  1. Why didn’t you use this IC? bq76pl455a

it can balance AND monitor up to 16 cells

  1. why did you go south the standard JSP XH connector? most battaries use that already.

  2. I see you use the DF13 connectors which are realy great worked with them alot as a drone engineer I think you should be following the pichawk hardware format when pinning them.

  3. is the charge port isolated when no voltage applied at the input? If there is voltage at all times the physical port may short sins it’s usually exposed and live so consider addind an isolation along with some reverse polarity protection.

Thanks for paying attention keep me updated if you want to work together on this project.

Also I don’t know what about you guys but I’ve found the 3P GX-16 to be the ideal connector for charging sins it’s small and can carry just enough current for everything and it also have that locking nut feature which it great!

I already featured it in my swap able battery pack(Yes I know it’s 4P instead of 3P was too lazy to model the 3P one):

2 Likes

1, Bacause: “Monitors and Balances 6-to-16 Cells per Device” and I want to go lower (although the title says 6 to 12S I can do 4S(havent tested lower yet) to 12S). But having a system that can do up to 14S is on my desires list, TI has quite a broad choice but nothing 4 to 14S as far as I know.

2, because they suck balls(mechanically), are to wide for 12S + sensors, existing batteries rarely go to >6S in a single pack, they don’t have temp sensors and most dedicated skateboard builders will build their own packs.

3, They are Molex Picoblade / wurth WR-WTB 1.5mm. What do you mean with that I should follow their wiring / hardware format? Does a FC have the same type of interfaces that I do?

4, Read the schematic or the thread to find out :grimacing:.

No thanks.

GX-16 is what old people use on CB radios :roll_eyes: also mechanically crap, modern people go for mini XLR, XLR, neutrix power con, BINDER, PoPD rosenberger or regular DC jacks, one might even go for the modern industrial M12.

1 Like
  1. 4S is a whole other category can’t imagine people even go under 10S with their built sins it’s just not efficient in terms of current handling in relation to power.

2)You could fit it there easily along the width on the PCB just look around most batteries use that connector. just make a separate connector that will go in parallel to the balance one (Should use some 2.54mm spaced one) sins most people don’t have a temp sens installed on their pack yet if they might even want it.

  1. NVM thought that was a DF13

  2. to save some time from learning about the more that million ic’s available it’d be nice to get a summery on the system overall features.

Right XLR might be suitable but it’s used alot in the music industry unlike GX16 which I could hardly find any product use for expect some soldering iron handles that use the 5P ones.

Feel free to change anything you like and implement it any way you want. I don’t see any of your motivations as a reason for me to change anything, but it’s opensource so you are free to do so :innocent:.

1 Like

Just offering a few suggestions and asking a few questions to expand my knowledge that’s all.

You see Mike I am always open to consider any suggestion regarding the production, IF it’s reported in a polite and constructive format. “why don’t you go for X brand for the diodes? they are just as good and cheaper” -this is constructive.

“I am not going to pay this much for this stuff, how about half price?”- this is, you know…,retarded

2 Likes

anyone thinking of printing an enclosure head over to @lock’s design posted in his build thread, better design and should fit together properly unlike my abomination

Are we reading two different posts? All of his posts appear very polite and friendly to me.

Maybe its just because of the language barrier (english is not my first language) but this comment [quote=“Mike_Lemon, post:386, topic:20947”] 90 euro?! How did it get so expensive?

I’d be comfortable to pay 50Euro for one piece and 40 for bulk, [/quote] felt a bit arrogant. I may be wrong though, for this reason I answered in detail to his question.