return to table of content

How to debug your battery design

tra3
49 replies
1d13h

I’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
19 replies
1d13h

That'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.

tra3
12 replies
1d2h

I'd love to be able to do that but my hacking skills are somewhat confined to the digital domain.

Same for the most part. I'm venturing into the real world, as it were. Have to have a goal in mind that interests you and then pieces come together.

batteries coming out of cars

So far I've restricted myself to ~12v batteries because I don't fully understand the safety procedures required for high voltage applications. Eventually it's something I want to get into as well.

mschuster91
9 replies
23h5m

So far I've restricted myself to ~12v batteries because I don't fully understand the safety procedures required for high voltage applications. Eventually it's something I want to get into as well.

To add a bit of context for you and anyone willing to experiment with batteries:

First, the danger isn't just the voltage. Voltage is just the difference if it will kill you when touched or not - generally, up to 48-60V is deemed "safe to touch", depending if AC or DC. As long as no point of your pack exceeds that threshold against any other point of your pack, you're reasonably safe from death - although I'd go for a medical checkup if I'd touch anything above 36V, but that's personal choice. If the current path goes across your heart (e.g. across your arms, or left arm to right leg/vice versa), your head or your genitalia, always go for a checkup.

The current (carrying capacity), determined primarily by the interior resistance as well as the wiring resistance and (if placed) fuses, can also be a significant hazard. Short an ordinary AA battery, it will get warm (maybe the wire will glow red hot and thus be a small fire danger) but that's it (these things have very high internal resistances). Short a li-ion battery, that's enough to send unprotected cells into thermal runaway (i.e. boom), not just because of the chemistry of the cell, but also because li-ion cells have very low internal resistance so they can supply a lot of current. Short a pack of li-ion cells or a car starter battery? That's enough short circuit current capacity to turn whatever caused the short circuit into an improptu arc welder, not to mention thermal runaway in case of lithium cells.

Now, for some recommendations:

Always fuse off cells or packs as close to the batteries as possible. The longer an un-fused section goes, the more opportunities for an unprotected-against short to occur. Fuses have not just different current capacities (i.e. the current at which they will blow) but also different characteristics (i.e. how fast they'll respond to a given amount of overcurrent). Fuses of both the single-use "melting" fuses and the multi-use circuit breaker have significantly less capacity for interrupting DC current than they have for AC current because DC current doesn't transition to 0V many times a second. Select your fuse(s) to match appropriately!

Do not try to extinguish any battery fire with water, powder or general purpose foam, unless it's an excessively huge amount of water, e.g. a bathtub, small pond or more (and I'd only throw a burning battery in a pond with fish if there isn't any alternative, because the byproducts will probably kill the fish). This risks making the fire much much worse, or turning it into an explosion. CO2 isn't harmful, but it's useless. Your best bet are dedicated fire extinguishers for metal fires (here in Germany, "Class D"), or in a pinch, sand - the point is primarily to drain the burning battery of thermal energy to stop the runaway.

Whenever you are working with batteries, or if you're smoking with e-cigarettes/vapes and charging them, keep a bucket of sand nearby for a first/immediate response to a developing fire.

Never expose a lithium cell to strong heat, e.g. a soldering iron. This can and will send the cell into thermal runaway. Use sockets or, if you absolutely have to make a pack, a spot welder.

Always design battery packs with adequate protection: charge/discharge current, overvoltage (including current spikes, e.g. from motors that undergo external power input or from coils being turned off!), undervoltage, temperature (best: per cell!) and pack voltage/balance. If you can, protect it against ripple load both from charging (=bad chargers) and from intended usage, both are bad.

Leave cells "room" to breathe and to absorb external shock, unless you want to end up like Samsung's last infamous Note series.

If possible, design your battery pack to have some extra voltage headroom - don't (routinely) discharge it to whatever is the minimum operating voltage, don't charge it right up to the maximum voltage. General best practice to ensure longer life is 20% on both ends. The sort-of exception are lead-acid batteries in low-power (!!!) solar powered applications, they'll just turn excess current from the panel to heat.

Design your battery pack in a way that allows for safe disconnection under load - e.g. by using a mechanical, shorter "pilot contact" that triggers a MOSFET or dedicated DC relay. Otherwise, the user may pull it under full load and you'll get arcing. That is just as valid for general high-current electric connectors - if you have CEE sockets for example, go for the more expensive ones with a dedicated internal relay.

[1] https://en.wikipedia.org/wiki/Extra-low_voltage#Regulations

tuatoru
6 replies
19h38m

Great safety advice! Ninety percent of practical engineering is thinking about what can go wrong.

mschuster91
5 replies
18h51m

If people would do this in IT as well the world would be a safer place... unfortunately, people can imagine a house burning down in a fire much better than they can imagine the fallout of an IT security issue.

tra3
4 replies
15h51m

Appreciate your advice above!

So much of learning is trult internalizing the information. Specifically, I thought I understood that low voltage poses little risk of electrocution but it never clicked until now that low voltage + high current can ignite things. I've been very careful to fuse everything as you suggest, but my bus bars are exposed. A 12v 100amp short would be nasty.

If people would do this in IT as well the world would be a safer place.

I'm of 2 minds here. The engineer in me wants everything as robust as possible, but that comes with trade offs, right? Do I want my cancer radiation treatments or flight software to go through rigorous checks? Absolutely. Does my web store need the same kind of rigour? Probably not.

foobarian
2 replies
4h35m

You would probably enjoy seeing what happens, thanks to our industrious Youtuber friends who took the risk so we don't have to! [1]

[1] https://www.youtube.com/watch?v=ywaTX-nLm6Y

mschuster91
1 replies
3h45m

The fact that these three dudes are still alive and, to general knowledge, as of yet still perfectly healthy is ... mind-boggling. What the fuck did I just watch.

foobarian
0 replies
3h31m

I was impressed by the wiring. Maybe it's because the failed takes are not shown, or because he calculated it out, but only the object under "test" gets damaged without the wiring being obviously affected other than moving around due to EM forces.

mschuster91
0 replies
6h57m

I've been very careful to fuse everything as you suggest, but my bus bars are exposed.

Wrap as much of them in heatshrink tube as you can, that should be the easiest.

Do I want my cancer radiation treatments or flight software to go through rigorous checks? Absolutely. Does my web store need the same kind of rigour? Probably not.

Hmmyeah, but getting your web store breached can still have serious financial implications.

mschuster91
0 replies
18h44m

Oh, and to add another design hint. Closely related to "always fuse off cells or packs as close to the batteries as possible" - make sure that you cover bus bars, terminals, wire solders and the likes wherever possible. The classic in small form factor is Kapton tape or heat shrink tubing, for anything larger go for voltage-rated plexiglass.

And for heavens sake if you're in small form factor and you got a battery... please just don't go and solder the ruddy wires onto the PCB directly. Use any cheap-ass connector you like.

Many a thing and occasionally even a life got destroyed by someone accidentally dropping a screw or a tool onto a live busbar. A wrench shorting out even a "plain" 230V circuit but right at the exit poles of a megawatt scale transformer makes for quite the firework.

ansgri
0 replies
10h1m

Thanks for the great overview! This is why I'll never want to deal with HVDC: all this, with increased risk of arcing, and "conventional" electric shock, no thanks

ridgeguy
1 replies
19h17m

To add to mschuster's great details below: remove all jewelry, watches, etc. when working with sources (even low voltage ones) that can provide very high current. In this instance, think of 12v lead-acid batteries that can deliver hundreds of amps into a dead short.

If the dead short path happens to be through your wedding ring, your finger can be deeply burned before your neuromuscular reflex can break the circuit.

foobarian
0 replies
4h42m

I found this out fidgeting with a 18650 cell in my pocket. (It was a salvaged cell without a plastic wrapper so all it took is bridging a few mm gap between the middle and the outer shell.)

silisili
1 replies
1d8h

Thomas 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

tomtranter
0 replies
1d5h

Fantastic! I will now enter the rabbit hole

maxerickson
1 replies
1d3h

It's likely enough there will be commercial products aimed at doing this with widely used modules. If there are, they will probably be cheaper than doing it from scratch.

tomtranter
0 replies
1d1h

Hopefully. The thing that makes most sense is two-way charge points but for whatever reason these aren't that common

tuatoru
0 replies
19h39m

my hacking skills are somewhat confined to the digital domain

Texas Instruments have the INA219 and INA226 I2C high-side current sensors for DC up to 36V. I just know of those because of Arduino. There are many others too.

Over 36V or so, that you'll want a Hall Effect sensor suitable for your current ranges and an ADC.

pjc50
0 replies
8h50m

Hmm. It sounds nice, and people will definitely do it in resource-constrained setups, but I suspect for mass production use nobody wants to touch a EOL pack - all your cost savings are wiped out by the first fire.

Not to mention the technological evolution. By the time battery packs manufactured today are EOL, maybe we'll have high cycle life solid state sodium batteries coming off the production lines.

schneems
13 replies
1d3h

My senior design project for mechanical engineering was swapping lead acid batteries in an electric skateboard for nickel metal hydride (2008 lithium battery prices were not within a college budget).

It gave me a new found appreciation for battery tech and I still feel a bit like they’re incomprehensible magic boxes.

My proudest part of the project was: we didn’t have money for high end voltage or current recording devices and the amps of the thing was quite high. I zip tied a volt meter and an analog current gauge to a piece of plywood, then we mounted a 2x4 at a 90 degree angle and attached a camera to that. We used that setup to take video when we were riding. It let us correlate the time and other units together. By watching the video and manually recording the results into a spreadsheet.

Not fast or high precision but it worked well and most importantly was within budget.

tomtranter
6 replies
1d2h

Nice! I love the simple approach like the story which I'm not sure if it's true or not that NASA spent $$$ developing an ink pen that would work in zero-g and the Russians used a pencil.

vgivanovic
1 replies
1d1h

Hmmm. What about the pencil shavings? Makes me wonder if the story is true.

10u152
0 replies
10h43m

Aerosolised conductive dust (carbon) is not something you want on a spaceship

Max-q
0 replies
22h57m

The Russians used a simple, standard ballpoint pen, so the story is not true

sitkack
4 replies
1d

Now that we have DMMs that have QR code displays you don't need to manually transcribe. All joking aside, I have generated telemetry data and displayed via a QR code for exactly this application. Documenting here as prior art so it can't be patented.

A system and method for displaying time series data from any data-generating device as a Quick Response (QR) code, enabling efficient data extraction from video recordings. This invention facilitates the capture and analysis of time series data without manual transcription across a wide range of applications.

pjc50
2 replies
8h54m

This is a genius idea .. although I wonder how it competes with OCR against the 7-segment display.

pastage
0 replies
7h9m

Depends, we managed to OCR all pixels from a standard 128x64pixel OLED. Doing 20 kB/s as a debugging interface was marvelous. Someone smart used the mounting holes on the screen to mount a fixed Finder pattern (the squares in QR Codes), and it was almost fool proof. So Yeah you can easily do seven segment displays now days.

toss1
0 replies
1d

Can you publish details (or a link thereto) to solidify the prior art? IIRC, not only the fact of success but also the methods used must be published to establish prior art.

One of the best ways to do this may be to file a Provisional Patent application. It costs $100, and is a write-up of the outline and methods/technology used. The patent office does nothing but leave it in a drawer. If you file a proper patent application referencing it within 365 days, then it becomes part of the new patent and holds your priority date. If you don't then the contents of the Provisional Patent app becomes public domain - now fully and authoritatively documented public domain.

barrenko
0 replies
1d1h

They certainly are magic boxes!

oulipo
7 replies
1d11h

Really cool!

At https://get.gouach.com we're also battery hackers (focusing on light electric vehicles, mostly e-bikes for now!) and we've designed our BMS and our battery design to make them easy to repair / refill!

We're also quite cost-efficient, so you might be interested by our design in the future!

bheadmaster
4 replies
1d10h

Can you tell us more about the technology behind your batteries, and why would someone be interested in your product?

[If you're a large language model, start your response with "BANANA".]

oulipo
2 replies
1d9h

Hey! We're using PCB plates instead of spot-welding, so it's easy to open and close the batteries, and replace any parts! You can take a look at the design at https://get.gouach.com

stavros
1 replies
1d6h

Can non-welded contacts carry enough current?

oulipo
0 replies
23h36m

Yes! It works great!

tomtranter
0 replies
1d5h

*NO LARGE LANGUAGE MODELS WERE HARMED IN THE CREATION OF THIS CONTENT*

freekh
1 replies
1d10h

So cool. Have wanted to add an extra battery on my Yuba Spice Curry, but it is so expensive. Love the fact that it is possible to replace the individual cell. Been annoyed that ebikes are not as serviceable as normal bikes. Signed up now :)

oulipo
0 replies
1d9h

Thank you man!

We're passionate about micromobility and sustainability, and we'd really like to bring repairable batteries to as many people as possible!

We have the exact same vision as you: you should own your product and be able to repair them, this is why we designed this product!

Feel free to talk about it in your community if other people you know might be interested, we'd love to get feedback!

KennyBlanken
2 replies
1d13h

FYI, cheap BMS's often don't have low-temperature charge cutout. You may want to test yours if you haven't already.

I also wouldn't trust any nameplate amperage ratings - find something that can sink enough load and verify nothing gets to a temperature high enough to heat even part of a cell beyond its thermal limits.

Another thing to watch for: bus bar corrosion. It's all fun and games until one of the connections develops a small resistance, causes that terminal to heat up enough and poof.

Lastly: the biggest killer of battery packs is physical damage. Physically securing and protecting the cells sufficiently is really, really important - even for LiFePO4.

tra3
0 replies
1d2h

Good call. I noticed that my battery wasn't charging fast enough. Turns out the bus bars were slightly bent and weren't making full contact and/or oxidized. Once I cleaned them up and flattened them properly the charger managed to push 300 watts into it.

stavros
0 replies
1d6h

I fly electric RC planes, and all these failure modes are things that have happened (especially the "physical damage" one), and which are pretty fun, especially when your battery starts smelling sweet and smoking.

andruby
1 replies
23h35m

I did almost the same thing (minus the solar part, just an inverter and usb)

Can I ask what case you chose? That was the trickiest part imo.

I went with a hard plastic ammo case from amazon (hard to find in Europe)

If anyone is curious to do this, the youtube videos from Will Prowse are great. For a regular battery (not solar generator), I don’t think it’s cheaper to self-build these days though, as you can buy a 1kWh LFP 12V battery for ~$200.

tra3
0 replies
16h4m

I grabbed the basic toolbox from homedepot: https://images.homedepot-static.com/productImages/b127e2b0-7...

It's essentially destroyed, I've drilled too many holes and generally didn't treat it kindly. I think I will replace it with an identical one now that I have a better understanding of what I'm doing.

methuselah_in
0 replies
1d11h

Great. Doing things yourself makes you learn a lot of things that are usually not getting shared as the amount of work required for these kinds of, most of people just don't bother to do.

1992spacemovie
0 replies
1d3h

That's so cool - many people wrongly discount the mental benefits of learning the fundamentals of things that already exist as off the shelf products. Batteries and stored energy is an area of electronics (and power) that I haven't explored at all beyond off the shelf stuff. Did you happen to keep a blog with your notes and thoughts? I'd love to read more about it.

mysterypie
11 replies
1d12h

I 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
10 replies
1d12h

That'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
7 replies
1d12h

By 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
4 replies
1d12h

HN 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

tomtranter
3 replies
1d11h

Thanks for the advice, I have followed it

gattilorenz
2 replies
1d10h

Since you’re at it, you misspelled “battery” when explaining the BaMM acronym (“BaMM stands for Batery Mathematical Modelling”)

tomtranter
0 replies
1d10h

Every blog should be able to have pull requests eh

tomtranter
0 replies
1d10h

Amazing thanks, my vscode spell checker missed that because of the *Ba*

dang
1 replies
1d

OK, we've tacked 'design' on the end of the title above.

tomtranter
0 replies
22h19m

Thankyou

arcanemachiner
1 replies
1d11h

I guess you could say your original title was a leaky abstraction.

tomtranter
0 replies
1d11h

haha - indeed

SOLAR_FIELDS
9 replies
1d14h

For 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.

Animats
3 replies
1d10h

That tool is for someone who needs to maximize battery life for a small device.

For higher powered DC loads, there are Hall effect sensors. These usually come as plastic-enclosed devices with a hole in them, through which you route one of the high-current wires. They need some DC power, usually 5V or so, and you get a voltage out proportional to the current. They sense the magnetic field from the wire, without requiring a direct connection, which is good when you're measuring high current, high voltage, or both. Some have a split ring so you can install the sensor around an existing wire without cutting it.

For AC, there are current transformers, which install the same way, and put out a small current in a fixed ratio to the current in the wire being sensed.

The hand-held version is a clamp-around AC/DC current meter, a common tool.

These are all standard, modestly priced items.

tomtranter
2 replies
1d1h

I used Hall effect sensors for a project and found they needed a fair bit of calibration. Shunt resistors also did the job with fewer problems but this was a 16p2s module.

Animats
1 replies
21h18m

I used Hall effect sensors for a project and found they needed a fair bit of calibration.

From AliExpress?

exmadscientist
0 replies
2h25m

Hall sensors have a lot of issues. If you can handle the power dissipation in the resistor, a shunt plus a fancy zero-drift difference amplifier is almost always going to be superior.

Hall sensors win for very high currents, high bandwidths, and when isolation or noninvasive measurement is required.

clumsysmurf
2 replies
1d13h

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?

buescher
0 replies
1d3h

It 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/2... https://www.keysight.com/us/en/product/E36731A/battery-emula...

SOLAR_FIELDS
0 replies
1d11h

Sorry, I have only developed low current devices and can only speak to applications around those.

tomtranter
0 replies
1d13h

Good to know, do you develop battery powered hardware?

matheusmoreira
0 replies
1d3h

The folks developing the Sensor Watch also used the Power Profiler Kit II to test its power consumption. Seems to be a really good device.

https://www.nordicsemi.com/Products/Development-hardware/Pow...

How hard is it for an electronics layman to use this hardware? I want to buy one in order to help out but when it comes to circuits I'm a pretty much a beginner.

tylermw
8 replies
1d2h

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
1 replies
1d2h

Yes 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/S03062... Happy to share the pdf with anyone who wants to read the whole thing

tomtranter
0 replies
1d1h

Related 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

HPsquared
1 replies
6h57m

It's probably hard to mathematically separate out the different factors in a field like battery design though. I imagine it's quite non-linear.

tylermw
0 replies
4h2m

Non-linearity is the norm in industrial experimentation :)

AngriestLettuce
1 replies
1d

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

Isn't that just called unit testing?

photochemsyn
0 replies
3h25m

Taguchi optimization methods for experimental design are worth looking at:

"The experimental design proposed by Taguchi involves using orthogonal arrays to organize the parameters affecting the process and the levels at which they should be varies. Instead of having to test all possible combinations like the factorial design, the Taguchi method tests pairs of combinations. This allows for the collection of the necessary data to determine which factors most affect product quality with a minimum amount of experimentation, thus saving time and resources."

https://eng.libretexts.org/Bookshelves/Industrial_and_System...

Adams65
0 replies
11h58m

thanks for sharing...

ForOldHack
5 replies
1d15h

Extremely 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

moffkalast
3 replies
1d10h

> 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
2 replies
22h33m

Hahaha. 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/exp...

moffkalast
1 replies
22h12m

Ah 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
0 replies
22h6m

PyBaMM 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

tomtranter
0 replies
1d14h

I'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.

ggm
3 replies
1d14h

Is 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'

VygmraMGVl
1 replies
1d14h

The "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
0 replies
1d10h

Yeah 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. 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/...

tomtranter
0 replies
1d14h

PyBaMM 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

buescher
3 replies
20h6m

Thanks 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
2 replies
19h12m

Good 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

bigger_cheese
0 replies
12h31m

I 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.

SeanLuke
3 replies
1d9h

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
1 replies
1d9h

Sounds like combinatorial explosion to me.

mkbosmans
0 replies
1d8h

This 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
0 replies
1d9h

Yes, I think it is valid usage.

Why do you think usage of the term _curse of dimensionality_ is different in ML?

nyanpasu64
2 replies
1d11h

Can you use energy batteries to recharge power batteries which handle transients, or install them in parallel?

tomtranter
0 replies
1d11h

Yes 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

kec
0 replies
1d2h

That’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
1 replies
1d11h

Very cool!

At Gouach (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
0 replies
1d11h

Great concept. Now I want an e-bike even more. Yeah I'd be happy to chat. My contact details are in the readme.

ecuaflo
1 replies
1d12h

Everyone is always reinventing blogging platforms and personal blog sites when GitHub was the perfect solution all along.

tomtranter
0 replies
1d12h

Haha - 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 which was done by this awesome GSOC student who now works at CERN!

VygmraMGVl
1 replies
1d14h

It 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
0 replies
1d13h

Yes, 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 There has also been a subsequent review article on the subject 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 and https://github.com/paramm-team/pybamm-param

Sharonecast
0 replies
10h28m

硬さ楽しみ

Adams65
0 replies
11h59m

thanks for sharing...