How does the BMS and BMB work? That is a complicated answer. This Thread on TMC has a bunch of great information from the early days - check out those dates! Over 10 years ago!! Read through it because it is better than my simplification below...
A battery pack in series is charged (and discharges) as a group but think of them as fighting for a slice of the same electrical pie. If one brick is able to collect energy more rapidly, it will be at a slightly higher voltage when it is done. If one brick doesn't hold quite as much energy, it will tend to discharge lower when the battery is near the bottom of the SOC (State of Charge). If this wasn't corrected somehow, the voltage imbalances would grow over time until you got dangerously high bricks near 100% SOC and dangerously low bricks near 0% SOC. The BMB can monitor these voltages at different SOC, and the BMS can compare the data from the 16 BMBs and 96 bricks to tell them how they need to balance. How does the balancing happen?
The BMBs do not have the capability to 'actively' balance - they can't provide extra energy to the 'low' bricks. Instead, the BMB has a series of resistors that can bleed energy from a 'high' brick. These 'Bleed Resistors' generate heat to pull small amounts of energy out of the high bricks to try to balance to the low bricks. The process by which they decide to do this is one of the better kept secrets in the community and it seems that Tesla has updated the process a few times over the years. This is certainly one of the 'minor fixes and improvements' that we all agree to with each software update. Of course, we have zero visibility into what these minor fixes and improvements are doing to the car... but I digress...
Each brick in each module is sharing the same charging current but inside the bricks, the 74 cells in parallel are working together. There is no way to balance an individual cell when it is tied down to 73 (hopefully) identical cells in a brick. They are all tied together in parallel so they share their voltage like a 12V car battery does when it is jump starting another car. If you imagine one of those cells getting removed or cut out, you would have 1/74th less capacity in brick. When a load is put on (i.e. driving), this diminished brick will drop its voltage faster. When it is charged with the same voltage as the other bricks, it will fill up faster because there is 1/74th less 'room' to store energy. It is easy to see why clipping out a 'bad' cell will quickly cause the bleed resistors to work overtime to keep things in balance. Diminished capacity is one of the primary triggers for the u029 error and when it is real (not a BMB fault), it is a real problem for the module and pack. Despite being made popular by some online celebrities, nobody working on these thinks simply 'clipping out' a bad cell is a good long term solution.
As we have discussed in other sections, you should never jump to the conclusion that a module has gone 'bad' without investigating the BMB first. As described here, a failing BMB tells as many lies as it can before it dies completely. I always suspect the BMB is at fault but sometimes a cell does actually go bad. When a cell inside a module shorts out and starts pulling energy from its 73 neighbors to generate heat (resistive), the module will not keep functioning in the car. The BMS will see that brick continually dropping voltages. If it happens quickly, it will be the 018 error. If the diminished capacity is measured slowly over time, it will be the 029 error. When this happens, why shouldn't you just replace a module with one from a donor pack?
Think about this in terms of any rechargeable device/battery you have ever owned. When it is new, it works great. It has a high capacity and runs for a long time. As it ages, the battery starts to wear out. The device might not be as strong as it was when it was new and it might not run for as long as it did before it needs to be recharged but it still works. There are lots of technical and 'chemical' reasons for this that don't really matter for this explanation - just think about the practical user experience of the capacity diminishing over time.
The battery packs in our cars aren't any different than the rechargeable battery in a drill or vacuum or flashlight; they are just larger with more controls. When a pack leaves the factory, 7,104 individual cells are all the same age. They were formed in the same batch and are as perfectly matched to each other as 7,104 of anything can be. As the car ages, it charges and discharges and all of those cells have the same experience - they all age together. As they age, their capacity declines just like the drill battery you imagined in the previous paragraph but they are all in the same condition so they generally stay balanced with each other.
How will you find a module of 444 individual cells that is a match for the remaining 15 modules in your existing pack? To do that, you first need to chart the capacity curves of your existing modules. To do this, put them under a controlled load under controlled conditions and record how they discharge. Charge them back up under controlled conditions and record how they charge. This is the baseline you are trying to match. How many donor modules do you have? If you have a donor pack, you don't have a dozen or more different donor modules, you have a dozen or more modules that have the same characteristics. No DIYer and very, very few independent shops have an inventory large enough to consistently find a match to YOUR existing modules. Even if they have the large inventory, do they understand the concepts? What variables did they use in their 'controlled testing' described above? There is no standard for that in our community so two shops doing their best (one selling used modules and one trying to source one two swap in) will get different values during independent tests of the same module.
If you do swap a module, the BMS will quickly see that it is charging and discharging at a different rate than its neighbors. If you get lucky and get one that is close, it might take longer. If you are one of the many who doesn't understand this concept and thinks setting the modules to the same voltage means you 'balanced' the modules, you will have BMS_u029 within a few months. In short, swapping modules doesn't work consistently. You are much better off putting a completely different pack into your car and selling what is left of your existing pack to DIY Powerwall builders.
I copied this post into my notepad over a year ago. It was from a user named Brandon Sheffield on Tesla battery management system (BMS) calibration from 07-Apr-2023. I corrected some small typos and added some formatting to help the reader but everything else below is what he posted. This website is mostly focused on batteries that are acutely malfunctioning and this information pertains more to working batteries that are a little out of balance/calibration. Still, I thought it was interesting for this 'Into the Weeds' section!
If Brandon would like to contact me and clarify his credentials or suggest any changes, please do. In the meantime, here is his long and detailed post:
Owners often comment about the indicated battery range not being what it was, that charging stops short of 100% even when set to 100% or that they have heard about rebalancing the batteries. This is all controlled by the battery management system (BMS) and is typically caused by one of two issues:
the BMS has been unable to maintain its calibration and its accuracy has drifted, or
the battery itself has become out of balance as the individual cell voltages can drift.
It's still relatively unusual to actually have a faulty battery, and the guide we set out below will give you some techniques to restore some of the lost indicated range.
It is, however, worth noting that the range displayed on the screen is unlikely to ever show the rated range given by Tesla when charged to 100%. There are a couple of reasons for this, temperature will not be optimal and there will be some small loses in capacity through natural and reasonable degradation. The value should however be reasonably close and generally no more than 5-10%.
For countries where the car is rated using the WLTP standards, it is also worth noting that the car displays the range using the EPA standard which can differ more significantly. This is one of the most common queries from new owners where their factory fresh car does not show the range the spec sheet shows, however this is entirely normal and correct. Don't forget, the battery stores energy, not miles, and the mileage figure is based on a conversion factor applied by the car i.e. the car assumes it can do 4 miles per kWh. The petrol equivalent would be to show how many gallons of petrol are in a car using the US definition of a gallon and not the imperial gallon resulting in a different number, in practice the car holds the same amount of energy/petrol.
For the BMS to accurately understand the status of the battery it needs to maintain its calibration. To do so, it needs a variety of stable readings across range of states of charge (SOC). To get a stable reading, the battery needs to be left for several hours without being used or charging, ideally without sentry mode running. If a car is typically recharged straight after a journey then the car will not provide a stable reading until the charging has finished. Consequently the car will have few, if any, readings at lower states of charge. As the BMS extrapolates through these readings it has, if there are few low down in the SOC, it will start to be cautious and assume a dropping capacity. If readings are however available at lower states of charge, the BMS will be able to know where both zero and 100% are more accurately. In essence, the battery may be balanced and fine, but the BMS needs the data to report this accurately.
Cell balancing is essentially trying to get all the individual battery cells to the same level of charge. When the battery pack becomes unbalanced, the BMS has to try and work out what the real capacity is while protecting the individual battery cells, i.e. keeping them all within their working range. The fix for each of these problems is slightly different, and both may be needed if you feel your car has lost some of its expected range.
The Tesla Battery Management System (BMS) is responsible for looking after the battery. As well as managing charging it also works out the available amount of energy stored in the battery and in turn the number of miles that energy can drive the car for. It does this by using an algorithm that adapts over time, constantly updating itself based on data points it collects from stable battery readings. In order for it to maintain an accurate calibration it needs accurate measurements taken at a variety of states of charge. While this sounds easy, it is harder than you may imagine if the car is always being either driven or being charged.
As said, the BMS needs a number of stable readings at different states of charge. To get a stable reading, the car needs to be left in it's sleep state for several hours. The following steps are fairly simple and are not required to be done that often to help the BMS achieve a good level of calibration.
Leave the car overnight and/or in the day occasionally without sentry mode enabled allowing the car to deep sleep for several hours.
Do not charge the car every night. Leaving the car at different states of charge, across a broad range, helps provide a spread of readings. Even once a month, at a SoC below 50% can help.
Turning off 3rd party apps that keep the car awake, and don't query the car with the Tesla app unless necessary while doing either of the above.
The goal is to build up a number of occasions where the car totally asleep for 4-6 hours and across a variety of charge levels.
Over time the car should recalibrate itself using these reading and should correct any under reading of the available range plus you are giving the battery time to sort itself out and the various battery groups to stabilize between themselves.
While the battery cells will sort themselves out up to a point if the car is simply left, there can still be some residual imbalance in the cells. To address this, the battery benefits from a 100% charge.
Plug the car in to charge, preferably on a AC charging point although you can also do this on a rapid charger but it may block it for others for some time.
Set the charge limit to 100% and leave the car to charge.
When the car reaches what appears to be 100% it may well say it has finished charging but it is drawing current. Leave the car charging until it indicates no energy is being added to the battery. This can take some time (an hour or so) after the car appears to have reached 100%. The charge rate may drop to under 10A which is fine. Let the car do what it needs to do.
Eventually the battery will stop stop taking on current. Be mindful if you have the heating on, the car will still be taking current, but not for the purposes of charging the battery.
If the car won't allow 100% to be set, this may be a calibration issue and address that aspect first.
The most obvious way is if the range at 100% has significantly reduced from previous values. This is one advantage of shows miles/km rather than %, because % is always a fraction of what the battery could hold, even if that amount has reduced. You can also use our battery capacity checkers which will allow you to calculate the battery capacity. You can either manually calculate the battery capacity which works for most cars, but you will need to know what the normal value would be for your battery, or you can automatically calculate the battery capacity via the API if you are happy to provide your Tesla token. We will also benchmark your car against many other cars.
Firstly, don't panic. If there is a genuine fault with your battery the car will typically be giving you a warning message. That said, you probably still want to recover that lost capacity and make it usable. So before contacting Tesla, we suggest you follow a few simple steps to see if this is either a calibration or balancing issue:
Let the car run down to a low state of charge, below 20% is good.
Leave the car for several hours at this state of charge, over night if possible.
Charge the car to 100% and leave the car until it says it is not adding any more power to the battery. The car may have said it has finished charging before this, ignore the "finished charging" message and use the energy/voltage/miles readout to see if the car is charging.
You may see the range increase as you do this. This is normal.
Repeat the process a few times if necessary. You should see after each cycle the range increase.
If you suspect calibration rather than cell balancing to be the issue, e.g. the car has not been left below 50% for some time, then you can focus on BMS calibration going forward.
We have seen up to 6% of the lost range being recovered this way. If you are still worried after doing both these things, then contact Tesla.
Within the car there is a hidden service menu. One of the options here to perform a battery health test. This is not a quick exercise as it uses up all the battery energy and then recharges the battery to 100%, it effectively looks to resolve some of the issues we mention above, getting stable readings across a broad spectrum of states of charge, and ensuring the cells are balanced.
We've elected to not cover this in detail as entering the hidden service menu can cause problems with the car if you do not know what you are doing, and the actions take a long time to complete. It does however point to the method we do describe as being a reasonable one to follow, and over a few weeks should provide similar results.