10 ms·
How to debug your battery design
A guide to simulating the physics inside a battery to solve the curse of dimensionality when doing battery R&D using open source python tool PyBaMM
- ForOldHack 2y agoExtremely terse. Not much about Debugging my battery, or my specific battery in particular, but batteries in general, and profiling them in a few stochastic qualitative measurements. I.e. Requirements: "pybamm=24.1" https://github.com/pybamm-team/PyBaMM https://github.com/pybamm-team/PyBaMM
- tomtranter 2y agoI'm sorry that you found it terse. I intended this as a brief intro and would encourage people who found it a little bit interesting or relevant to their problems to either read the more extensive examples on PyBaMM. If of interest, Silicon anodes are only one type of material being extensively researched in order to improve batteries. The holy grail is Lithium metal where there is no host material on the anode side at all. This would give the ultimate energy density but has so far largely eluded commercialization.
- moffkalast 2y ago> > experiment = pybamm.Experiment( [ ( "Discharge at C/10 for 10 hours or until 3.3 V", "Rest for 1 hour", "Charge at 1 A until 4.1 V", "Hold at 4.1 V until 50 mA", "Rest for 1 hour", ) ] * 3, ) Wait, does this thing take natural language instructions? Does an LLM parse this to something more stuctured? "Charge at 1C for 1 hour, place under campfire, discharge at 1000 C, cook marshmallows"
- tomtranter 2y agoHahaha. No marshmallow instructions for us yet but some people are using PyBaMM to model thermal runaway. We don't use an LLM but I guess could in order to catch more edge cases. There is an experiment class and a step class. Each step can be called with arguments or passed a string that equates to the same thing but you will get errors if you mistype or leave something out. https://docs.pybamm.org/en/v23.5_a/source/api/experiment/experiment_steps.html https://docs.pybamm.org/en/v23.5_a/source/api/experiment/exp...
- moffkalast 2y agoAh so it's more of a rigorously formatted code that looks like natural language, COBOL style :P Figured it's more likely that, interesting choice for sure.
- tomtranter 2y agoPyBaMM predates ChatGPT. But we're emulating cyclers which are fairly basic tbh. I'm exploring ways of using LLMs to improve the experience. ie Cycle my NMC-Gr 18650 with a CCCV at 1C with an RPT cycle of CCCV and GITT at C/10 every 10 cycles until 80% capacity using model options x,y,z
- ggm 2y agoIs the library parametric such that it works for other electrolyte systems like sodium batteries? How about flow batteries? I would think cracking isn't such an issue for 2 fluids across a membrane. Or even just lead-acid? ie is this 'debug lithium'
- tomtranter 2y agoPyBaMM is technically chemistry agnostic but it's fair to say pretty much all the examples are for Li-ion. Sodium ion should be very possible as it's really the same physics but with different numbers. Flow batteries a bit more challenging because a few important processes would need to be added like the convection. Lead-acid examples are in there. PyBaMM actually started out on lead acid when Valentin was doing his PhD https://sites.google.com/view/valentinsulzer/publications https://sites.google.com/view/valentinsulzer/publications
- VygmraMGVl 2y agoThe "batteries-included" models in PyBaMM would apply to sodium batteries and lead-acid batteries (i.e. either the full Doyle-Fuller-Newman model or the Single Particle simplification). Flow batteries would probably require implementing a new model, which is supported in PyBaMM, since you need to model forced convection on either side of the separator. I know PyBaMM has a relatively modular modeling system, but I'm not sure how they've broken down the models they have implemented.
- tomtranter 2y agoYeah thanks for the extra insight. On the modular modelling system bit, this is something we're not particularly good at telling people or highlighting. You can solve any PDE you want with PyBaMM but a lot of the high level battery models have been built upon several classes of lower level models that make battery specific assumptions. The Oxford University software research group headed by our good friend Martin gave a really nice intro course this year which helps you build a model from scratch which I find always helps with understanding https://train.rse.ox.ac.uk/material/HPCu/libraries https://train.rse.ox.ac.uk/material/HPCu/libraries. We should do more non-battery examples too, there is this one solving transient heat conduction in a rod https://docs.pybamm.org/en/latest/source/examples/notebooks/models/unsteady-heat-equation.html https://docs.pybamm.org/en/latest/source/examples/notebooks/...
- VygmraMGVl 2y agoIt would be interesting to see a blogpost on parameterizing a model in PyBaMM given a commercial cell. I imagine many battery engineers using simulation-based design tread over the same ground for determining parameters from literature, X-rays, etc.
- tomtranter 2y agoYes, parameterisation is incredibly important. The classic recent example from academia that heavily features in PyBaMM is Chen2020 which is a very thorough case study of collecting data. https://iopscience.iop.org/article/10.1149/1945-7111/ab9050 https://iopscience.iop.org/article/10.1149/1945-7111/ab9050 There has also been a subsequent review article on the subject https://iopscience.iop.org/article/10.1088/2516-1083/ac692c/meta https://iopscience.iop.org/article/10.1088/2516-1083/ac692c/.... If you are looking for a more hands on guide then there are also open-source tools for parameterizing models https://github.com/pybop-team/PyBOP https://github.com/pybop-team/PyBOP and https://github.com/paramm-team/pybamm-param https://github.com/paramm-team/pybamm-param
- SOLAR_FIELDS 2y agoFor those interested in energy profiling tools that have applications for developing battery powered hardware products I can highly recommend Nordic Semiconductor’s PPK II. For a reasonable price you get a hardware tool and software kit that can profile your actual energy usage quite well. It has punched well above its weight on providing power profiles against tools an order of magnitude higher in price. If you are designing a hardware product that runs on battery a tool like this is a necessity. I know above sounds like an advertisement but it isn’t. I’m not affiliated with NS at all. It’s just a great tool and I’m happy to recommend it as there are very few cost effective options in this space.
- tomtranter 2y agoGood to know, do you develop battery powered hardware?
- clumsysmurf 2y ago> Nordic Semiconductor’s PPK II This looks great, from their page: "can measure and optionally supply currents all the way from sub-uA and as high as 1A" Do you have recommendations, for a similar device, that can supply more than 1A?
- SOLAR_FIELDS 2y agoSorry, I have only developed low current devices and can only speak to applications around those.
- buescher 2y agoIt depends on what you need. But you should start by looking at Keithley's SourceMeter "source measure units" and competing instruments from Keysight and Rohde & Schwartz. There are even specific instruments in this vein that can emulate battery charge/discharge models out of the box. These are typically called "battery simulators" or "battery emulators". https://www.tek.com/en/products/keithley/dc-power-supplies/2281s-series-battery-simulator-emulator https://www.tek.com/en/products/keithley/dc-power-supplies/2... https://www.keysight.com/us/en/product/E36731A/battery-emulator-and-profiler.html https://www.keysight.com/us/en/product/E36731A/battery-emula...
- tra3 2y agoI’ve been on a journey to learn a bit about battery tech by building my own “solar generator”. Terrible name, but something like a jackery or blue yeti. I acquired 4 lithium iron phosphate cells along with a bms, solar charge controller and various doodads. I had to learn about balancing the cells, wiring, etc. it’s been a bit of a rabbit hole for sure. I ended up building 1.2kwh battery for powering my fridge and lights while camping. For less than half the price of an equivalent off the shelf unit. Of course it has taken an enormous amount of learning, but that’s free. One the more interesting revelations to me, is how much I under appreciated industrial design before. On the first glance a device like a battery pack is a square box with a couple of outlets but I’ve certainly had a difficult time making it look nice. Internal component wiring is also an interesting challenge.
- tomtranter 2y agoThat's cool. I'd love to be able to do that but my hacking skills are somewhat confined to the digital domain. What's going to be really interesting in the next few years is the number of batteries coming out of cars which could be re-purposed for grid storage or back-up domestic power like your set-up here. Typically an ev battery is determined to be at end-of-life when it's reached 80% of original capacity. However, the capacity is also dependent on how fast you try to cycle it and over what range of SoC. The bigger the SoC window and the faster the cycling the more stress put on the battery and the larger the losses. Taking batteries out of cars and putting them in boxes, cycling them slowly and within a smaller SoC window means you can get a lot more life out of them.
- silisili 2y agoThomas Massie, the engineer and arguably overqualified US representative, did just this and made a series of videos about it. I have no idea if this is the original channel, but it has the updates - part 1 linked below. https://m.youtube.com/watch?v=qpPYkqpe-Ms https://m.youtube.com/watch?v=qpPYkqpe-Ms
- tomtranter 2y agoFantastic! I will now enter the rabbit hole
- mysterypie 2y agoI found the article interesting but I don't think "debug" is the right word here. I was thinking the article would be about debugging a software or electronics bug that causes my laptop or car battery to drain too fast. Maybe it should have been titled, "How to model the right battery choice for your application" or "Understanding trade-offs in battery design".
- tomtranter 2y agoThat's a fair point. I guess I used it a bit too freely but I have the habit of introducing programming terms into everyday life. It's trying to understand why something is suboptimal
- tomtranter 2y agoBy the way if I was to edit the title I would put "design" at the end but I can't find how to do this? Not a very regular poster I have to admit
- gnabgib 2y agoHN prefers the original title[0], since this seems to be a submission of your work, you could edit the repo to append " design" to the title, and then email the mods to get the title updated. (You can only edit the submission title in the first 2 hours). [0]: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- tomtranter 2y agoThanks for the advice, I have followed it
- gattilorenz 2y agoSince you’re at it, you misspelled “battery” when explaining the BaMM acronym (“BaMM stands for Batery Mathematical Modelling”)
- ecuaflo 2y agoEveryone is always reinventing blogging platforms and personal blog sites when GitHub was the perfect solution all along.
- tomtranter 2y agoHaha - yes. all you need is a readme and a python package that can generate gifs. We put this in PyBaMM for our BattBot project https://github.com/pybamm-team/BattBot https://github.com/pybamm-team/BattBot which was done by this awesome GSOC student who now works at CERN!
- nyanpasu64 2y agoCan you use energy batteries to recharge power batteries which handle transients, or install them in parallel?
- tomtranter 2y agoYes this should be possible. I think the main constraint would be keeping the cell chemistry the same so that OCP is similar. I've been playing with a pack model of cells with mixed capacity using another open-source tool in our pybamm-team collection https://github.com/pybamm-team/liionpack https://github.com/pybamm-team/liionpack
- kec 2y agoThat’s essentially what adding decoupling capacitance to a circuit does. All of this is going to be limited by the fact that without extra switching logic the entire circuit wants to be the same voltage, once your fast source drains enough, circuit voltage will start dropping and the source will begin sinking current as things balance.
- oulipo 2y agoVery cool! At Gouach (https://get.gouach.com https://get.gouach.com) we're building a battery framework which requires no welding, nor glue, which makes it easy to repair, refill, and tweak batteries safely! We develop our own BMS that we made to be really powerful and extensible (focusing mainly on light electric vehicles, e-bikes, e-scooters, e-mopeds etc) We'd love to see how your platform (or PyBaMM) could help us improve our SoC / SoH estimations, and remaining capacity estimation. Would you have any pointers / tutorials on this?
- tomtranter 2y agoGreat concept. Now I want an e-bike even more. Yeah I'd be happy to chat. My contact details are in the readme.
- deleted 2y ago[deleted]
- SeanLuke 2y ago> This is known as the curse of dimensionality (the more things you have to vary, the exponentially more combinations you have to test) Is this really a valid usage of this term? The only definition I am personally familiar with is from machine learning, and it is something totally different.
- tomsmeding 2y agoSounds like combinatorial explosion to me.
- mkbosmans 2y agoThis looks to me like actual correct usage of the term exponential. Surprisingly correct usage of that term is rare, even in technical writing. Let's say each dimensions added has a finite set of N possible values. Then for k dimensions there are a total N^k possibilities. Combinatorical growth would actually be faster still, scaling like k!.
- mkbosmans 2y agoYes, I think it is valid usage. Why do you think usage of the term _curse of dimensionality_ is different in ML?
- tylermw 2y ago> If you collect 3 different data points changing each thing one at a time (original design, some number higher, some number lower) whilst keeping everything else constant (usually a good scientific approach) that's 320 possible combinations of changes! There is an entire field of statistics (Design of Experiments) where one of the first lessons you learn on day one is how one-factor-at-a-time testing is one of the most inefficient ways you can test something. It’s usually only done out of ignorance to better methods by those with little to no formal statistical training. An experiment designed by someone who is well versed in modern experimental design methods would not take billions of runs to optimize—a sequential design that first screens out factors to those that matter (basic Pareto principle) followed by a response surface design or a GP model surrogate to optimize the response would likely be on the order of hundreds (possibly thousands) of runs. This is basic industrial experimentation—see “Design and Analysis of Experiments” by Douglas C. Montgomery for a nice introductory textbook.
- tomtranter 2y agoYes completely agree. This is one of the things that PyBaMM doesn't do for you out of the box. I could have extended the article in many ways to cover all the optimizations you could do both with the physical battery or the model. Thanks for sharing the text book. I think my point which I should have stated more clearly was that maybe for smaller design spaces this might not be a bad approach but with batteries the space is huge. I co-authored a paper on optimally reaching the Pareto front using the and problem as an example actually. may be interesting reading for anyone else coming to this area. https://www.sciencedirect.com/science/article/abs/pii/S0306261921013490 https://www.sciencedirect.com/science/article/abs/pii/S03062... Happy to share the pdf with anyone who wants to read the whole thing
- tomtranter 2y agoRelated topic there is this example combining PyBaMM and pints for sensitivity analysis. Which should definitely be done first before delving straight into a DOE https://github.com/pints-team/electrochem_pde_model https://github.com/pints-team/electrochem_pde_model
- 2y ago
- tomtranter 2y agoFor anyone interested in the performance requirements for electric flight, alluded to but not explored in the article. This is a great open-access paper about it https://pubs.acs.org/doi/full/10.1021/acsenergylett.8b02195 https://pubs.acs.org/doi/full/10.1021/acsenergylett.8b02195
- buescher 2y agoThanks for posting this. PyBAMM is really slick. I first learned about it from a webinar on the competing Julia package. I have to ask though, how many organizations are really designing their own cells for new products? And how much validation have these packages had? I know it's expensive and time-consuming to get a lot of battery discharge data. My experience may be overly coloring my thinking here - my idea of battery modeling involves a circuit simulator and only those effects that are not going to be drowned by the large tolerances in common batteries. The one area where more detailed physical modeling would be interesting would be in long-term degradation and wear modeling for secondary cells. Is there a tutorial or example along those lines?
- tomtranter 2y agoGood question. I would say anyone developing new materials in a lab would benefit from the kind of physics-based models we have in PyBaMM. Organizations is a pretty broad term but I assume you mean companies in which case probably the number as a fraction of all companies dealing with batteries in some way is quite small, but the value of those companies is disproportionately large - think big car manufacturers and also companies dealing in more extreme environments like aerospace and also for heavy vehicles e.g. Fortescue who are electrifying their mining trucks. All the companies building cells and materials for cells doing cell design will certainly benefit from physical modelling. Validation of the packages is strong - PyBaMM has many peer reviewed citations. Validation of the numbers in the simulations for specific cells is probably weak and that's a real pain point in the industry that ionworks is working to address
- tomtranter 2y agoAlso good point on degradation. Physics based modelling is invaluable for debugging this. PyBaMM does have quite a bit on degradation yes. Here's a good notebook to start with https://docs.pybamm.org/en/stable/source/examples/notebooks/models/coupled-degradation.html https://docs.pybamm.org/en/stable/source/examples/notebooks/...
- bigger_cheese 2y agoI did some lab work at my university synthetizing materials for Li ion battery anodes as part of my honors thesis in Materials Engineering almost 15 years ago now. My side of the project mostly concerned the method we were using to manufacture the materials (I was experimenting with a technique called "Electrostatic Spray Reductive Precipitation"). When it came to analyzing what I had managed to make it mostly involved using SEM (with EDS mapping) and XRD. At the time it never crossed my mind to look into possibility of simulations it would have saved a lot of time as doing the analysis was very time consuming. For the theoretical side I was guided by a postgrad student who used a physics software package to predict the intercalation of Li ions using Density of States calculations, most of what he was doing went way over my head but it involved him running code and then telling me "we should try to make something like this..." so I imagine this sort of package could help out a lot here as well.
- Adams65 2y agothanks for sharing...
- Sharonecast 2y ago硬さ楽しみ
- Adams65 2y ago[dead]