DIY 6S to 12S BMS with CAN - DieBieMS

@Okami the estimate cost is 100 euro each when you make 6.

Small update:

We made 6 BMS’s for evaluation, we plan to mount them on our skateboards and electric scooters:

I have no plans on commercially selling these BMS’s now or in the future. I just like sharing everything such that maybe someone else can benefit from it. Maybe in the future if my redesign of the VESC 6.0 is going to work I might join a webshop and start producing esk8 electronics, but so far the financial risk is to high for this :pensive:.

12 Likes

Setup a liscensing deal with a manufacturer on here. Something simple, you get X% of profits with contingency you are not liable and have no responsibility to provide upgrades, fixes, or otherwise do further work. If you wish to allow others on here to enjoy your work that’s an easy win, win. If not still good stuff here

3 Likes

Are you planning to open source it atleast so maybe a few of us can build our own? I would be interested in DIYing a couple or myself and my gf.

1 Like

It’s open source:

From the OP: Tracked in github (still in a very early stage):

5 Likes

How’s version .4? Is it good it enough to make a board or two or does it need more testing?

1 Like

Hi, how can I build a pcs?

Hi, How can I try to build source code? I’ve founded it on https://github.com/DieBieEngineering/DieBieMS-Firmware

Can I build it with Eclipse and GCC or “System Workbench for STM32” suite ?

This really looks like the perfect BMS system. Is anyone going to order a bulk of these assembled? If so im up for it and I don’t mind a early beta software if I can contribute with the code myself also.

An idea I have that isn’t mentioned yet (as I can see) is to have an option to use storage mode that limits the charge. I’m not thinking about a discharge circuit but more like a software feature. It can be a feature you activate when you know you are going to leave the board for a while and then you can ride it to discharge it (warning will be sent at XX%) and then when it’s charging again it will stop at storage voltage. I do this manually with my Tesla now and keep charge state between 50-80% to keep the battery good shape longer. When doing long trips I charge to 100% right before departure so it never sits at 100% over a long period.

Another feature if a braking resistor was added is the possibility to have better brakes at high SOC and limit overvoltage to the battery by letting it go into heat. Would also make it possible with auto storage mode. It will take up a lot of space tho with heat sink, therminals, components and whatnot so prolly not worth it since space is often a problem.

I asked him about adding a braking resistor and I think he said it was not worth the extra space to add it but it would be easier to implement into the ESC rather than the BMS.

I read through this thread and could not find an answer on whatever the balancing is only done when the charge limit is reached.

One of the only downsides to partial charging is that many inexpensive battery management system (BMS) circuits will only do active bleed balancing of the cells when they are at or near the full charge voltage of 4.2 V/cell.

This means that with partial charge profiles that don’t reach that voltage, the BMS circuit will never be able to re-balance cells if they are drifting apart. This issue it can be easily remedied by occasionally (like once every month or two) leaving the pack connected to a 100% charge cycle overnight. I just would rather not have to do that if I can help it!

Over time you may have less available capacity from the pack as certain cells will hit the low voltage cutoff on discharge well before others.

Would your DieBie BMS do charge balancing immediately? Good quality programmable BMS circuits will usually attempt to balance the cells whenever they see more than a certain voltage spread between the highest and lowest cell in the group, and in that case there is no problem with partial charges.

1 Like

I want to participate in this beta if it happens. This is something that is desperately needed.

It is happening as we speak:

If you are quick I think there’s still time to get in on the action :slight_smile:

Just looking at the source code. There’s a cellBalanceStart config parameter, and it looks like no balancing is performed till a cells voltage exceeds this. Cells are sorted so that the highest voltage cells are discharged first, it also seems to limit the number of cells discharging at any one time (another config param). I’m sure there’s a good reason why you don’t want to be discharging too many cells at once?

Not quite sure what setting the cellBalanceStart to a low value would do. Slow the charging process, flames?

From a software point of view it seems it would be very easy to do something like this. The function that does this already has an array of the cell voltages, you’d just need to change an if statement.

1 Like

When the charger is connected balancing starts when a cell voltage exceeds “defaultConfig.cellBalanceStart” and when the mismatch is more than “defaultConfig.cellBalanceDifferenceThreshold” . On all my electrical transportation vehicles where I use my BMS the balancing part takes about 20 minutes (the display indicates balancing during that period), once the displays indicates charged all cells are balanced.

So yeah, I start balancing quite early ( in my opinion >3,8V cell is early ) and once stated “charged” all my devices have a full cell voltage matched pack (<5mv mismatch). When you leave the system connected to the charger even when it states charged the bms will balance even further.

You could start balancing even earlier (for example always when charger is connected), this will backfire you since you will be discharging cells that would eventually ended up to being matched (but are brought to imbalance by your attempt to balance), so there is a sweet spot (that isn’t at the end and isn’t at the beginning). The whole problem we attempt to solve with balancing is (when you started witch a matched pack & in my opinion) -> compensate for the temperature mismatched you had during charging and discharging + the imperfections you have in your cells (that converts either charge/discharge currents to heat). As long as the imperfections are minimal balancing will be easy since the mismatch created by the temperature imbalance are minimal. The imperfections (caused by defects in the cell) are a bitch, they will need a big effort (balancing time) to compensate since their impact can be huge (cause a big energy imbalance).

The worst parallel cell combination determines the total Ah of your pack, it is thus key to have all imperfections matched (this its the case with new cells or cells that all had the same abuse :stuck_out_tongue: ), (same energy capacities), (every cell should have the same state of health). A BMS will not fix a crappy battery pack, a BMS will do its best to protect a pack against the environment to prevent it to become crappy by abuse from its user :smiling_imp:. The BMS will tell to user the lowest cell voltage is under a limit, you should no push your board you lazy basterd! Even when you don’t like to push.

TLDR; The main goal of a BMS: make a battery pack save enough (protect it against a user) to be used as a energy storage media (prevent). Every other benefit is just a bonus :grin:.

defaultConfig.noOfCells 																=	4;														// 4 Cells in series
defaultConfig.batteryCapacity														=	80.00f;												// 80Ah battery
defaultConfig.cellHardUnderVoltage											= 2.40f;												// Worst case X.XXV as lowest cell voltage
defaultConfig.cellHardOverVoltage												= 4.45f;												// Worst case X.XXV as highest cell voltage
defaultConfig.cellSoftUnderVoltage											= 2.70f;												// Normal lowest cell voltage 2.7V
defaultConfig.cellSoftOverVoltage												= 4.10f;												// Normal highest cell voltage 4.10V
defaultConfig.cellBalanceDifferenceThreshold						=	0.005f;												// Start balancing @ 5mV difference, stop if below
defaultConfig.cellBalanceStart													= 3.80f;												// Start balancing above 3.8V
defaultConfig.cellBalanceUpdateInterval									= 4*1000;												// Keep calculated resistors enabled for this amount of time in miliseconds
defaultConfig.maxSimultaneousDischargingCells						= 5;														// Allow a maximum of 5 cells simultinous discharging trough bleeding resistors
defaultConfig.timoutDischargeRetry											= 4*1000;												// Wait for X seconds before retrying to enable load.
defaultConfig.hysteresisDischarge 											= 0.02f;												// Lowest cell should rise 20mV before output is re enabled
defaultConfig.timoutChargeRetry													= 30*1000;											// Wait for 30 seconds before retrying to enable charger
defaultConfig.hysteresisCharge													= 0.01f;												// Highest cell should lower 10mV before charger is re enabled
defaultConfig.timoutChargeCompleted											= 30*60*1000;										// Wait for 30 minutes before setting charge state to charged
defaultConfig.timoutChargingCompletedMinimalMismatch 		= 6*1000;												// If cell mismatch is under threshold and (charging is not allowed) wait this delay time to set "charged" state
defaultConfig.maxMismatchThreshold											= 0.020f;												// If mismatch is under this threshold for timoutChargingCompletedMinimalMismatch determin fully charged
defaultConfig.chargerEnabledThreshold										= 0.2f;													// If charge current > 0.2A stay in charging mode and dont power off
defaultConfig.timoutChargerDisconnected									= 2000;													// Wait for 2 seconds to respond to charger disconnect
defaultConfig.minimalPrechargePercentage								= 0.80f;												// output should be at a minimal of 80% of input voltage
defaultConfig.timoutPreCharge														= 300;													// Precharge error timout, allow 300ms pre-charge time before declaring load error
defaultConfig.maxAllowedCurrent													= 120.0f;												// Allow max 120A trough BMS
defaultConfig.displayTimoutBatteryDead									= 5000;													// Show battery dead symbol 5 seconds before going to powerdown in cell voltage error state
defaultConfig.displayTimoutBatteryError									= 2000;													// Show error symbol for 2 seconds before going to powerdown in general error state
defaultConfig.displayTimoutSplashScreen									=	1000;													// Display / INIT splash screen time
defaultConfig.maxUnderAndOverVoltageErrorCount 					= 5;														// Max count of hard cell voltage errors
defaultConfig.notUsedCurrentThreshold										= 0.5f;													// If abs(packcurrent) < 500mA consider pack as not used
defaultConfig.notUsedTimout															= 30*60*1000;										// If pack is not used for longer than 30 minutes disable bms
defaultConfig.stateOfChargeStoreInterval								= 60*1000;											// Interval in ms to store state of charge information
2 Likes

Hahaha, yeaaaaaaaaah there is xD, I found out the hard way; balance resistors convert energy to heat, in the worst case (4.2^2)/15=~1.2W of heat times 11 cells = 13.2W of heat. This is an awfully lot if enclosed in a small space, the area is just to small. In my early stage of software development discovered that some sort of throttling is desired.

I made this max amount of active balance resistors configurable to allow for different environments (temperatures) and other values of resistors. Maybe in to future it could become a self learning parameter since there is a temperature sensor inside the LTC, but hey self learning is scary, the current solution works and there are more important / fun things to engineer.

You might think: well, if your board gets to hot with to much resistors enabled why don’t you use a larger resistor? Will this will increase in either size or cost.

The other reason; only a small amount of cells will be out of balance (for all of my 12S packs always the same 4 cell are mismatched, but you want them to discharge / match fast, hence the desire for the lower resistance). You will always be bypassing / discharging the same limited amount. Only in limited circumstances you need to discharge more, for example when you just connected a new pack, then it will only take more time.

Again a place/case where there is no perfect situation / solution, I however tried to approach the best case.

4 Likes

Starting the balance at 3.8 volts would be fine cos I just wanted to stop charging at 4.1 volt for battery longevity.

Your post was an interesting read.

Ok, I found some time again to put a few extra features to onto the BMS.

  • The bootloader button was useless, I read the documentation wrong with the first iteration and wrongly assumed that my chosen uController had a hardware bootloader on UART2, it doesn’t so the boot button could go (I will port the VESC bootloader to the BMS).
  • I removed the holes that could have been used to mound the OLED display. I discovered that it was useless since I never used it since the display if any will go into the cover / enclosure.

  • I added a NTC close to the switching transistors to protect them from overheating when the hi-amp power draw is to long.
  • And for me the long awaited optional feature: A sub-ghz RF tranceiver :smiley: :smiley: :smiley: (I want to design a remote in the future).

This one in 915 MHz: https://www.anaren.com/air/products/868mhz-solutions

4 Likes

Will these revisions be updated for @fedestanco 's group buy?

Yes. Jtag contacted me in advance telling me to wait few more days for getting the new production files.

3 Likes

Yes that’s the plan!

But without the transceiver, that part is costly and is still in the development stage, even for me. Once it’s useful you can add/solder it on later.

I hope to finish the BOM and design rule check today.

4 Likes