Learning Path for buiding my own BMS - Page 1
Forum section: electronics / beginners

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 06:58:22 am
content: Hey there!I am from a completely non-technical background. I decided to build my own e-bike and this month has been a lot of learning... I learnt many new things calculating power requirements, mechanical calculations, battery pack sizing, motor controllers, etc.I am now in the stage of selecting a Battery Management System for my build. This area interests me so much that I plan to build one myself from scratch.My BMS should have the following features:-Overcharge Protection-Overdischarge Protection-Overvoltage-Undervoltage-Thermal Runaway-Cell Balancing-Charging (implement a modified CC-CV algorithm based on a research paper)-SOC-SOH- Secondary protector fault detection-Total voltage, voltages of individual cells, minimum and maximum cell voltage-Current in or out of the battery-Maximum charge current as a charge current limit (CCL)-Maximum discharge current as a discharge current limit (DCL)-Energy  delivered since last charge or charge cycle-Internal impedance/resistance of a cell (to determine open circuit voltage)-Charge  delivered or stored-Total energy delivered since first use-Total operating time since first use-Total number of cycles-Average Temperature, Temperature of each cell (switching on air cooling when temperature exceeds a value)-Communicate all data to be nicely visualised on a smartphone using bluetoothI looked up on the internet and understood that a Fuel Gauge can monitor these things. I decided to go with TI BQ78350-R1, with a TI BQ76930 AFE. Is it a right choice? Are there any others that I should look into? Open for suggestions. My battery pack is a 6S3P pack.I think, these require a MCU to work and I haven't decided one yet. Open for suggestions.I looked up on the reference designs but I am not able to understand anything. It is all too much for me RN.Should I use a single cell gauge or a multi-cell gauge? Are there any advantages of one over the other?My questions is how do I start? What all things I should learn before I can design a BMS myself? I have completed All about circuits Vol I book and have now started reading The Art of Electronics.I can put in 6hr/day. How long would it take me to build circuits like that? What learning path should I follow?Thanks a lot!TL;DR: What should be the learning path for a beginner in electronics to be able to design Battery Management System from scratch?

author: ogden
author_rank: Super Contributor
timestamp: July 24, 2019, 07:44:05 am
content: Quote from: redgear on July 24, 2019, 06:58:22 amIf you are beginner who do not understand anything about simple reference designs of battery management IC's, you are guaranteed to fail building complex high current BMS on your own. I am afraid that you shall rethink your plans, split your project into steps of incremental complexity, plan more than one version of your bike, build first prototype using off-the-shelf components. *AFTER* first version of the bike is running, you possibly will understand more about electronics, have better chances of writing sensible specs and planning your build and maybe even succeed building something that does not melt of burst into flames.Before you plan to build moon rocket - train your skills building paper planes first.QuoteFirst rule: plan your builds according to your *current* knowledge. You can't pick project that is two orders of magnitude out of your skill/knowledge set and think that you will be able to succeed. Perhaps you shall start with BMS for pocket flashlight, toy car or something of similar scale.

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 08:02:03 am
content: Thanks! Yep, That's what I am considering RN... Splitting the project into milestones and learning things one by one. I am also not sure if I should just jump in and start doing projects or learn some theory before that.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 08:17:28 am
content: My personal stance:Most li-ion management ICs do very poor job at making the designer's life easy. They have their own faults (or some are outright broken-by-design and dangerous in unobvious ways), so you need to understand them and babysit them.I tend to prefer doing everything from scratch; at least then I know what's going on.I have had to make one product recall (luckily only <5 units) due to a broken-by-design TI BQ li-ion charger IC with an internally faulty overvoltage protection. Inaccurate application note I followed contributed to the problem; this part was actually my fault, but I want to point out even I as an experienced designer fell into the trap of copying parts of the appnote; it happens to a beginner even more easily.As a result, I'm never putting a BQ anything in any li-ion product I design, ever. The trust is completely gone. They tend not to have any safety certificates either, so no bonus for paperwork - you are still fully responsible to the same degree as in a completely home-brew system.An integrated product would make everything easier, but then it would need to be a really proper integrated solution, not some TI-acquired BQ shit IC which fails and requires as much control code as a full-blown BMS control algorithm.My personal learning path has been:* Looked at overly complex redistributive balancing schemes, built prototypes* Teardowns of failed commercial BMS units, recognized the usual issue: too much quiescent current, possibly because being stuck in the wrong state, killing the cells* Designed an overly simplified distributed BMS system. Still a valid design* Tried two TI BQ ICs in another product, trying to "reduce development time" since I had much more to do than just battery management. An utter failure. Removed all TI BQ ICs for production PCBs, redid from scratch.Additional points:QuoteWhat's the difference?QuoteI assume you mean temperature monitoring, and specifically the upper limit.Do not forget to add lower limit for charging. Limit charging currents below 25degC linearly, until you reach zero current at about -5 degC. (Traditionally a step function of no charging below 0 degC, full charging above 0 degC is used. I don't recommend it, as full charging currents at +1 degC can be damaging to the cell lifetime.)You can't stop thermal runaway if it happens, and it's almost never happening due to anything that can be prevented by BMS temperature monitoring. The only such scenario I can think about is totally failing the thermal design of the pack, or completely miscalculating the fuse rating. Don't forget the traditional fuse!So thermal runaways happen due to internal cell failures, physical damage (puncture/deformation), severe overcharge (which you have already covered by voltage monitoring).QuoteRemember you need very little balancing, and not much muscle to do it. I have seen systems designed to shunt currents in excess of 1A, and fail at thermal design with stuck-on balancer. Don't do that. My system balanced at 40mA, and was still fully able to keep a repurposed 300Ah pack with damaged cells with increased self-discharge in balance.QuoteI haven't seen any formal, scientifically valid definition for this. I have a feeling it was a trendy buzzword in battery academic papers a decade ago.QuoteRemember to add cell temperature dependency to this. Charging does less damage at higher temperatures. Somewhere around 30-40 degC is optimum. I have measured greatly decreased cycle lives when cycled in a refrigerator (at +6 degC) at the rated current.QuoteCycle counting can be difficult, as the cycles are of different length, and with different starting points.A cycle between 60%->30%->60% is almost meaningless for the battery life. A cycle of 100%->70%->100% if a lot worse. A cycle of 100%->10%->100% is not that much worse anymore.

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 08:30:53 am
content: Quote from: Siwastaja on July 24, 2019, 08:17:28 amCan you recommend any other alternative? I read good reviews about them and that's why I chose them. Thanks for letting me know.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 08:33:26 am
content: Quote from: redgear on July 24, 2019, 08:30:53 amSadly, no. I haven't had time to try and analyze every one of them. I have needed to get the job done in a responsible way I can stand behind.Some BQ ICs are probably just fine or very good, but I don't know which would apply.(See all the edits I added while you posted for additional comments.)

author: ogden
author_rank: Super Contributor
timestamp: July 24, 2019, 08:35:26 am
content: Quote from: redgear on July 24, 2019, 08:02:03 amLearning electronics is best done by doing both in parallel. Leave BMS project alone and start "learning electronics" project now. My suggestion would be to start with breadboard kits, your next search terms: "breadboard electronics beginners", first hit wasinteresting. If you do not mind to learn programming, then look for Arduino UNO breadboard kit, something like following (there are more):https://www.amazon.com/DSD-TECH-Resistor-Capacitor-transistor/dp/B072FNW29S

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 08:40:15 am
content: Quote from: ogden on July 24, 2019, 08:35:26 amTotally agree with this. It's an iterative process: learn some, try some, learn why it behaves that way, try again...QuoteBut I don't completely agree with this. People are different. For example, I'm not capable of working with a "learning project" approach. I need a real project, and often something far more complex and difficult than anyone would recommend to me. I want it to be something unique, with aspects no one's done before, otherwise I'm not interested and motivated. That way I have learned. The situations have been sometimes stressful when I have combined hobby and work andpromised deliverywith tight schedule on something where I don't have all the details figured out yet. But in the end, I couldn't be more satisfied.But it depends on the person, very much. I understand many if not most are well capable of learning through small toy projects, with small steps.But my view may be biased, because I started so early that I have just probably forgotten about my "toy learning projects". Because I was a kid at the time, it felt like the projects are going to change the world!Try either way. You'll find your own way of learning.

author: mc172
author_rank: Frequent Contributor
timestamp: July 24, 2019, 08:48:56 am
content: Quote from: Siwastaja on July 24, 2019, 08:33:26 amPlease can you tell us which ones were not any good in your experience?

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 08:56:18 am
content: Quote from: Siwastaja on July 24, 2019, 08:17:28 amOops. Alright.Quote from: ogden on July 24, 2019, 08:35:26 amYep, I can program and I have worked with arduino's and Raspberry Pi's. What I don't understand is the electronic circuit part.Quote from: Siwastaja on July 24, 2019, 08:40:15 amI'm kinda like you.. But the thing is, the circuits are really complex and I am having really hard time just jumping over... So I thought I must go back to basics.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 09:01:08 am
content: Quote from: mc172 on July 24, 2019, 08:48:56 amOK:bq24610 charger and power path controller IC:* Overvoltage detection does not turn off the battery disconnect FET, which can be verified by taking a close look at the block diagram: they are missing the obviously needed connection there. Yet they claim there is an overvoltage protection. It's just... doing nothing, just preventing the buck from oscillating, which already works that way through the normal FB mechanism.* Implements a so-called overdischarged cell conditioning cycle, which cannot be disabled, with wrong parameters. Conditioning current cannot be practically adjusted to be small enough or disabled; the pin to control that is shared with the CV stopping current function. A proper IC should deny charging overdischarged cells completely; or possibly implement a proper conditioning cycle as per cell manufacturer specifications. bq24610, instead, runs a self-destruct program, increasing the risk of copper dendrites shorting the cell and causing thermal runaway.* There were some other issues I have already forgot about.* One can argue that a proper BMS should be able to protect against all the abuse bq24610 is going to put through. This is not a valid line of thinking, as the number of safety layers has been reduced to 1.bq76925PWR AFE:* Balancing doesn't have timeout or any other means to prevent it from killing a cell. Combined to a notoriously unreliable I2C communication, the risk that the BMS gets stuck into the cell discharging state during the lifetime * number of units on field is just way too high. This is a showstopper. The rest are just babbling:* Datasheet and appnotes disagree on the connections. You need to guess or do your own reverse engineering to verify proper circuit.* The current shunt amplifiers suck in their analog performance so much that you can't really use them for coulomb counting, which is usually what people want from such BMS analog front-ends. A separate $0.20 INAxxx chip from TI will do over 10x better job, enabling low-value shunts to be used, for easy thermal design and energy savings.* I'm sure there was something else I forgot about already. I ditched this before starting to write code for it!

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 09:11:02 am
content: Quote from: Siwastaja on July 24, 2019, 08:17:28 amCool! Thanks!QuoteSorry, I messed up while foramatting, That was supposed to be in brackets like this:Over Charge Protection(Overvoltage)Over Discharge Protection (Undervoltage)QuoteCool thanks! Yep i'm planning to add cell level fuses to the pack...QuoteThank you for educating, I looked at the BQ's datasheet and it provides only 27mA of balancing current. I did not know if that was enough, my next topic on the forums would have been 'How to select proper balancing currents for battery packs'QuoteJust a percentage factor of the cell again based on the Internal resistance?QuoteNoting down this.I read about this in a research paper, I was considering to add external cooling fans when the temperature was high but did not give a thought about lower temperatures.QuoteCan you explain this a bit more? I read it is preferred to discharge li-ion batteries in the 20-80% range but don't know why.

author: ogden
author_rank: Super Contributor
timestamp: July 24, 2019, 09:32:42 am
content: Quote from: Siwastaja on July 24, 2019, 08:40:15 amYes, exactly - people differ. Your approach of picking tasks are fine - because you shall be considered skilled and knowledgeable, you know how stuff works. For beginner ANY project will be far more complex than his non-existent projects of past. Speaking of complexity - my rare & occasional projects usually are about "blank areas" where no solution exists (yet), but when I was kid - I was building multi-vibrator blinker, not TV set. That blinker still were far more complex than anything I did before. You see what I mean?

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 09:33:41 am
content: Quote from: redgear on July 24, 2019, 09:11:02 amDon't know all the exact mechanisms, but at least charging near full causes:* Expansion of the graphite anode, leading to cracking and reformation of the SEI layer, causing it to become thicker and blocking parts of the anode, increasing the resistance and decreasing capacity.* Plating of the metallic lithium at the anode.Avoiding large charge currents near the top, or even better, avoiding the top altogether, minimizes the effects. If you cycle continuously near the top, you are repeating the "worst" area of operating all the time, with no much benefit (only a slightly higher voltage) compared to cycling at a lower point.Practically all calendar fading similarly happens only near to top, between about 70-100%. Unintuitively, it seems that on some production cells, 80% may not be better at all, and even slightly worse than 100%! Below 70%, the real benefits start to show. Hence, store at 50% or less.At the bottom, a significant amount of extra hysteresis heating happens by an exothermic reaction that cannot be properly modeled as DC resistance (in addition to the higher DCR at the bottom). When charging near zero, it's an endothermic reaction, so the cells cool down quickly, internally (DCR-induced I^2R heating may make this harder to see). If the currents are high, the extra temperature cycling probably isn't good for the cell life, either.Hence we reach the recommendable region of interest between about 70% and 20%, where the cycle life can easily be like 5000-10000 cycles even if the cells are only specified to 500 cycles 100%-0%.

author: redgear
author_rank: Frequent Contributor
timestamp: July 24, 2019, 09:45:37 am
content: Quote from: Siwastaja on July 24, 2019, 09:33:41 amThank You!

author: Siwastaja
author_rank: Super Contributor
timestamp: July 24, 2019, 09:48:07 am
content: Quote from: ogden on July 24, 2019, 09:32:42 amYes, but I have a history of picking projectsbeforeI was skilled and knowledgeable about things needed to complete them, sometimes quite... bravely, using a positive adjective. Or, deceivingly, using a negative one. This, OTOH, has forced me to become skilled and knowledgeable on the subjects. I have been a total n00b too, that's the point, and only maybe 10% of my learning has been through simple toy projects, the rest is through overselling my skills on overly complex projects and, finally, becoming actually skilled.And yes, I have been kicked out of projects at the exact point of time when I was able tofinallysolve the problem, based on the fact that it wasn't solved 6 months earlier when the schedule on Powerpoint said it was supposed to be. Sometimes it's ridiculously close, for example when I was hired to develop a complex automated battery pack factory prototype with direct copper sheet welding, CNC casing, full ground-up BMS design and all the jazz, to produce a large prototype 40kWh pack, promised in 6 months, spent a year designing and building everything, then got firedexactly when I got everything working for the first timeand had already produced 25% of the final output agreed on, in a few days. They saw it producing the desired results, then they decided to ditch all the work and to start over with a new team "because it's taking too long": needless to say, they never got anywhere so the project ultimately failed. It didn't fit into their Excel mindset. But that's when I commercialized everything by myself, hundreds of kWh produced afterwards. I went from a battery-no-one to a battery expert within just a year,because I had a complex projectbeyond imagination whichforcedme to stay interested and learn everything I could absorb, even though you could say that in the "original" sense, the project "failed".

author: ogden
author_rank: Super Contributor
timestamp: July 24, 2019, 10:29:17 am
content: Quote from: Siwastaja on July 24, 2019, 09:48:07 amAgain you mixing it all together - your n00b time with professional. You explain arguments addressed at complete beginner using your time doing very complex projects professionally when you supposedly were skilled way above n00b level. I doubt that you took 40hWh project w/o even knowing how BMS works. If yes, then you are insane. Your failure to meet promised deadline by 6 months is proof that your approach of overselling your skills is seriously flawed. Patience or incompetence of company that allows to stretch 6months into 1year is phenomenal. You shall not be blaming powerpoint, nor said company. It was your failure of overselling your project management skills.

author: rstofer
author_rank: Super Contributor
timestamp: July 24, 2019, 02:55:01 pm
content: Quote from: redgear on July 24, 2019, 08:56:18 amThe thing is, sooner or later you will need to actually understand a datasheet and you may even want to understand how some circuit works. Op amps, capacitors, resistors and inductors are all best understood with numbers. Somehow, you just wind up calculating the time constant (and 3 dB breakpoint) every time you see an RC circuit. Your brain gets wired that way over time!Khan Academy has a EE track besides their renowned math courses. Digilent has a "Real Analog" course. Both of these are heavy into the math. Not necessarily deep math until late in the programs but definitely using numbers. Just a smidge (technical term) of calculus when dealing with energy storage devices (capacitors and inductors) plus algebra for passives.Dave has some great Op Amp videos but, right up front, he uses Kirchoff's Current Law to show how the various amplifiers work. These are trivial examples but KCL is key to understanding op amp feedback circuits.Everything W2AEW has published on YouTube is worth a watch. He does a terrific job with transistor circuits.All of these things are side issues and can be learned as you wander along the path. And remember, Ohm's Law is a LAW. It's not a suggestion like speed limits.

author: redgear
author_rank: Frequent Contributor
timestamp: July 25, 2019, 04:53:31 am
content: Quote from: rstofer on July 24, 2019, 02:55:01 pmThanks a lot for the resources, this was something I was looking for.QuoteSo what do you think is the best to start with? I started reading datasheets of ICs and trying to understand them, but some terms are very technical.Thanks again!

author: mc172
author_rank: Frequent Contributor
timestamp: July 25, 2019, 02:22:51 pm
content: How about this?https://sound-au.com/articles/lithium-charging.htmhttps://sound-au.com/project184.htmBTW, Siwastaja, cheers.

author: Siwastaja
author_rank: Super Contributor
timestamp: July 25, 2019, 03:32:07 pm
content: Quote from: mc172 on July 25, 2019, 02:22:51 pmComplete bullshit, all myths, very few facts. They give a flashy start where they talk about the properties of metallic lithium, this discredits it all at once. There is no Li(0) in lithium ion batteries. The failure mechanisms are completely different. This is such a fundamental misconception that I'm amazed someone still makes it, in such a long analytical article.Then they have the very basic concepts all backwards.Other myths on the page:- lithium content myth- float charge myth- LiPo is different to li-ion myth- battery pack must be a separate module with its own protection electronics myth- "a battery balance system is absolutely essential" myth- "The balance circuits are responsible for ensuring that the voltage across any one cell never exceeds the maximum allowed". NO! NO! NO! NEVER!- wrong instructions for the conditioning cycle, with no safety instructions whatsoever for overdischarged cellsStopped reading half way through.Maybe the biggest issue is the total mixup between monitoring and balancing.Passive resistive dissipative balancer that work at 4.2V cannot guarantee that the pack is in balance, and cannot guarantee that cells are not overcharged; actually it's the opposite, it will increase the risk of dangerous imbalance in corner cases, because now there is a new source of quiescent currents, which may not be properly balanced. They will imbalance the pack during use and storage, yet the balancers are only active for a short time at the end of charge, so have limited time to do their work, sometimes nearly zero. (Think about the user who never fully charges the pack, because they have heard this will increase the battery life (rightfully so)!!)A proper BMSmonitorsand shuts down the charger if any cell hits the limit. Elliot's approach to the problem does not do that, but completely relies on the balancer's capability to keep the pack in balance. Which usually happens, but not always.In reality, cell-level HVC always comesfirst. Then, balancing isan optional extra, which has nothing to do with safety (the HVC cuts the charger, after all), but is installed to keep the pack energy storage from decreasing.A pack with self-contained balancers but no cell-level HVC is more dangerous than a pack with no cell-level electronics at all. The former is not used by the industry; the latter is.In reality, packs up to 6s (but more typically up to 2s) do exist without neither balancing nor cell-level monitoring, at all. Depending on case, this may or may not be acceptable.Following the advice on this page is more dangerous than flying without any BMS whatsoever. This is fairly typical case, in fact.BMS is non-trivial, but everybody knows how "important" it is "to have one". As a result, many have a cargo cult approach to it. This is extremely dangerous.