Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

How to calculate battery degradation for my Model X

This site may earn commission on affiliate links.
After reading several post on model 3s reporting premature battery degradation I thought I would calculate it for my model X.

My X is three months old and has about 2,500 miles on her. My goal is to get a feel for my current battery degradation and keep an eye on it over time. Based on what I have read on the forum I came up with a 1.01% degradation level.

Here's my logic:
My car's target EPA range at 100% charge is 325 miles. So if I charge my battery to 90% my vehicle's range (on the dashboard's fuel gauge) should read 325 X .90 = 292.5. But instead it reads 290.58 that is a decrease of 1.01%. So that is what I'm calling my 1.01% degradation value.

For the programers out there here is a screen shot of my function to calculate this:

Screen Shot 2019-10-30 at 9.08.49 AM.png


Is this inline with how others calculate degradation? Is it this simple??
 

Attachments

  • Screen Shot 2019-10-30 at 9.08.49 AM.png
    Screen Shot 2019-10-30 at 9.08.49 AM.png
    58.4 KB · Views: 231
You calculate the battery capacities and keep track of them over time. There are two capacities: 1)The charge capacity and 2)The discharge capacity.

To calculate the first get from TeslaFi or another program the amount of charge transferred to the battery during a charge session. Divide that by the percentage change in SoC as reported by the program. Keep in mind that the SoC is displayed to the nearest percent so a reported change of 5% could actually be 4% or 6%. Because of this charge capacity estimates are noisy and ones based on small SoC changes are worse than one based on larger ones. You will want to use trend analysis to see what is happening. Use a program (or algorithm) that allows you to weight the points by the SoC span.

There is also a discharge capacity which is obtained by dividing the kWh used during a drive by the reported SoC change for that drive (as a fraction i.e. 10% is 0.1). Calculate it in the same way.

Neither of these is the true capacity of the battery, of course, both estimates being distorted by power losses in the internal resistance of the battery. These losses depend on the integral of the square of the current. This is constant during charging (Level 2) and so the charge capacity is a more stable estimate than the discharge capacity estimate. Programs like TeslaFi seem to use the charge capacity to monitor degradation probably for this reason. The true capacity of the battery is about half way between the charge and discharge capacities. This assumes that I^2R losses during discharge are about the same as during charge.
 
  • Like
Reactions: VikH
You calculate the battery capacities and keep track of them over time. There are two capacities: 1)The charge capacity and 2)The discharge capacity.

To calculate the first get from TeslaFi or another program the amount of charge transferred to the battery during a charge session. Divide that by the percentage change in SoC as reported by the program. Keep in mind that the SoC is displayed to the nearest percent so a reported change of 5% could actually be 4% or 6%. Because of this charge capacity estimates are noisy and ones based on small SoC changes are worse than one based on larger ones. You will want to use trend analysis to see what is happening. Use a program (or algorithm) that allows you to weight the points by the SoC span.

There is also a discharge capacity which is obtained by dividing the kWh used during a drive by the reported SoC change for that drive (as a fraction i.e. 10% is 0.1). Calculate it in the same way.

Neither of these is the true capacity of the battery, of course, both estimates being distorted by power losses in the internal resistance of the battery. These losses depend on the integral of the square of the current. This is constant during charging (Level 2) and so the charge capacity is a more stable estimate than the discharge capacity estimate. Programs like TeslaFi seem to use the charge capacity to monitor degradation probably for this reason. The true capacity of the battery is about half way between the charge and discharge capacities. This assumes that I^2R losses during discharge are about the same as during charge.
I like this. I already have a program that tracks the amount of power it takes to charge the battery and percentage of charge. In fact I display it on my wall gauge in kWh to charge battery. I haven't made the correlation between the charge kWh and percentage of charge added, would be easy enough to do. Won't this change a great deal based on the ambient temperature during the charge?

On another note I have seen several people get very concerned about changes in the car's range as reported by the dashboard's fuel gauge. Do you have thoughts on that? Is that just an algorithm that gets out of sync with the battery issue??

Thanks for the input!
 
The battery system and its management is very complex. The way lithium ion batteries behave depends on temperature, SoC, rate of charge/discharge, whether the battery is being charged or discharged etc. If you get an app that allows you to look into the CAN bus traffic you will be swamped with data and I'm sure much insight can be gained from studying this data if you know what the various fields represent. Only Tesla knows that but you can sort of deduce what the different fields mean. As there are lots of people deducing you get lots of interpretations. In the video linked in the previous post, for example, he uses phrases like "must mean".

Does temperature play a role in all this? Yes, it certainly does so the question you have to ask yourself is "Does the Tesla BMS adjust for temperature in reporting SoC?" We take some comfort in knowing that battery temperature is regulated to some extent during charging but also, recognizing that SoC is only reported to the nearest whole percent, deduce that SoC estimates aren't intrinsically that good which is a reasonable assumption considering all the things that effect Li ion SoC.

I tend to stay away from rating SoC in terms of miles range. There is a "rated" Wh/mi number for each car and one can come up with estimated range for a given SoC from that but there are also estimated, average and instantaneous Wh/mi numbers which depend on driving habits and conditions. It seems from reading posts here that people get confused by these. You should soon learn what the relationship between SoC and range is from your driving history. In my case it's 3 mi/%. If the dashboard meter shows I have 57% remaining I have 171 miles range unless, of course, it starts to rain or a big headwind pops up.
 
I use TeslaFi - it logs a bunch of data including charging information and provides a battery degradation report. If this seems valuable, feel free to click on the link in my signature for a referral credit that extends you're free trial (or not, that's ok too). The interesting thing about this graph is it helped me identify a likely range reduction related to a firmware update this past September on my X.
Battery-degradation-report-2019-10-30 171208.jpg
 
  • Like
Reactions: rush6410
I wonder how TeslaFi is coming up with their battery degradation report?? Do you think the "Estimated 100% Range" number in the above two graphs is the same number that is reported on the dashboard's fuel gauge? It looks like what they are doing is recording this number every time the car is charged. If this is the case, then that number (the dashboard's fuel gauge value) is key to calculating battery degradation.

@Tdreamer does your car's dashboard's fuel gauge report 288 miles of range at full charge?
@rush6410 does your car's dashboard's fuel gauge report 251 miles of range at full charge?

Thanks.
 
I wonder how TeslaFi is coming up with their battery degradation report?? Do you think the "Estimated 100% Range" number in the above two graphs is the same number that is reported on the dashboard's fuel gauge? It looks like what they are doing is recording this number every time the car is charged. If this is the case, then that number (the dashboard's fuel gauge value) is key to calculating battery degradation.

@Tdreamer does your car's dashboard's fuel gauge report 288 miles of range at full charge?
@rush6410 does your car's dashboard's fuel gauge report 251 miles of range at full charge?

Thanks.
From the author of TeslaFi posted to a TeslaFi product form, they calculate battery degradation as follows:
The battery degradation report is simply a graph of how much Rated/Ideal Range the vehicle is reporting at 100% or extrapolated to 100% full charge.

So the degradation would be 1.7%(5 Miles) if the vehicle reported a 300 mile range in October and a 295 mile range in December at a 100% full charge.
For me personally, I almost never charge to 100%. In fact, the TeslaFi logs show that I've only done so three times since getting the car in Sept '17:

upload_2019-11-1_7-59-44.png
 
Yes, TeslaFi records SoC and kWh at the beginning and end (and during) each charge. When I spoke of calculating capacities in earlier posts I was referring to using data from TeslaFi which you can download in CSV form.

Now TeslaFi isn't perfect. The battery report (examples posted above) has ignored all charges for the last 1000 mi in my car (but the data can be downloaded). Also note that it allows plotting of trend lines but not the most useful one (a mmse fit).

The plot below shows the sort of info that can be gleaned from TeslaFi data

BatteryOct19.jpg

It's a little busy but the open circles in the lower part represent estimated charge capacities determined by dividing added energy for each charge divided by reported % change in SoC. As the chart shows the numbers are all over the map and this is because of the dilution of precision and coarse quantization (1%) of reported SoC. The upper set of open circles are residuals with respect to a liner fit and the vertical bars represent the magnitude of the uncertainty (read off the right hand vertical scale) which, as the plot clearly shows can be as much as 40 kWh. Clearly, in calculating a trend, estimates that bad should not be weighted much relative to estimates with much lower uncertainties. The trend line shown is a mmse fit weighted by the uncertainties. The two lines above and below the trend line represent the 95% confidence bounds for the trend line.

The analysis leading to the plot yields other info. I'll just paste it here:

TeslaFi charge reports as of Wednesday, October 30, 2019; 7894.3 miles: 167 good measurements out of 210.
Capacity estimates:
Trend analysis: Observed trend -0.552 kWh/1000 miles; Pearsons r: -0.1063; Z: -0.1067; SigmaZ: 0.0781
Prob |Z| this big or bigger if no trend: 1.8283
Present Estimated Capacity: 94.704 ± 0.567 kWh ( 95.000 % Confidence)
Average consumption estimate: 332.76 rated miles; Estimated range at 100% capacity charge: 284.60 rated miles
Observed estimates of rated consumption Pearsons r: -0.0734; Z: -0.0736; SigmaZ: 0.0781
Prob |Z| this big or bigger if uncorrelated: 1.6538
Average rated Wh/mi: 332.76; Trend = -0.910 Wh/mi/1000mi; Current rated Wh/mi: 328.63 ± 3.96
Current estimated rated range: 288.18

Note first that the data span covers 210 charges only 167 out of which only 167 were deemed good. Some charge reports show that more energy was put into the battery than consumed from the mains and obviously something isn't kosher there and those reports don't get processed.

Readers familiar with this kind of analysis will be able to interpret this data block while to others it won't mean much and I won't comment further except to note that up to about 6000 miles the Pearson/Fisher analysis indicated no trend whereas the data out to 8000 indicates a clear trend that shows I've lost about 4% of the original capacity of this battery.

All also add that TeslaFi thinks my current range is 290.16 as opposed to the 288.18 estimated above.
 
Last edited:
  • Informative
Reactions: Tdreamer
Yes, TeslaFi records SoC and kWh at the beginning and end (and during) each charge. When I spoke of calculating capacities in earlier posts I was referring to using data from TeslaFi which you can download in CSV form.

Now TeslaFi isn't perfect. The battery report (examples posted above) has ignored all charges for the last 1000 mi in my car (but the data can be downloaded). Also note that it allows plotting of trend lines but not the most useful one (a mmse fit).

The plot below shows the sort of info that can be gleaned from TeslaFi data

View attachment 472008
It's a little busy but the open circles in the lower part represent estimated charge capacities determined by dividing added energy for each charge divided by reported % change in SoC. As the chart shows the numbers are all over the map and this is because of the dilution of precision and coarse quantization (1%) of reported SoC. The upper set of open circles are residuals with respect to a liner fit and the vertical bars represent the magnitude of the uncertainty (read off the right hand vertical scale) which, as the plot clearly shows can be as much as 40 kWh. Clearly, in calculating a trend, estimates that bad should not be weighted much relative to estimates with much lower uncertainties. The trend line shown is a mmse fit weighted by the uncertainties. The two lines above and below the trend line represent the 95% confidence bounds for the trend line.

The analysis leading to the plot yields other info. I'll just paste it here:

TeslaFi charge reports as of Wednesday, October 30, 2019; 7894.3 miles: 167 good measurements out of 210.
Capacity estimates:
Trend analysis: Observed trend -0.552 kWh/1000 miles; Pearsons r: -0.1063; Z: -0.1067; SigmaZ: 0.0781
Prob |Z| this big or bigger if no trend: 1.8283
Present Estimated Capacity: 94.704 ± 0.567 kWh ( 95.000 % Confidence)
Average consumption estimate: 332.76 rated miles; Estimated range at 100% capacity charge: 284.60 rated miles
Observed estimates of rated consumption Pearsons r: -0.0734; Z: -0.0736; SigmaZ: 0.0781
Prob |Z| this big or bigger if uncorrelated: 1.6538
Average rated Wh/mi: 332.76; Trend = -0.910 Wh/mi/1000mi; Current rated Wh/mi: 328.63 ± 3.96
Current estimated rated range: 288.18

Note first that the data span covers 210 charges only 167 out of which only 167 were deemed good. Some charge reports show that more energy was put into the battery than consumed from the mains and obviously something isn't kosher there and those reports don't get processed.

Readers familiar with this kind of analysis will be able to interpret this data block while to others it won't mean much and I won't comment further except to note that up to about 6000 miles the Pearson/Fisher analysis indicated no trend whereas the data out to 8000 indicates a clear trend that shows I've lost about 4% of the original capacity of this battery.

All also add that TeslaFi thinks my current range is 290.16 as opposed to the 288.18 estimated above.

Man this is some awesome stuff!! I would love to see what you would come up with if you got TeslaFi out of the picture and pulled the data directly from your vehicle. In reading through TelsaFi's support forum the do a pretty good job of explaining how they come up with some of their data. One of the items that gave me pause is how they calculate the power used to charge the vehicle. It may explain why you see discrepancies in your analysis. There are several data endpoints available to us through the TeslaAPI. The three I use most during a charge cycle are: charger_actual_current, charger_voltage, and charger_energy_added. I believe they are using the power generated from multiplying charger_actual_current with charger_voltage to determine overall charge power. My problem with that approach is they are getting the voltage and current information by polling the values (I believe on a one minute interval). Both current and voltage will jump around over the one minute between poll cycles and they are missing all that data. I'm guessing the data that is missed is so small most analysis would not notice. The only way to truly record how much power it takes to charge the battery is for the vehicle to record it as it happens and produce a running total. That is what the charger_energy_added end point seems to be. However, that end point only measures the DC power put into the battery. I wonder what you would come up with if you only focused on the value from charger_energy_added??

Anyway thanks a ton for sharing you obviously have given this some real thought!!
 
I would love to get access to the CAN bus data but AFAIK there is no way to do that within IOS though I do occasionally see reference to an IOS version of the Android app.

WRT the charger data: The charger is not 100% efficient so that loss would have to be accounted for. What we really want to know about, in terms of monitoring battery health over time, is the amount of energy delivered to the battery in order to fully charge it. The car clearly monitors battery current and voltage, multiplies them together and accumulates. That's pretty clear. The car also estimates SoC. This is much murkier. Clearly the only measure of battery state is its open circuit voltage at whatever temperature the battery is actually at and there is a hysteresis effect at work here so engineers do stuff like grinding up temperature, coulomb counts and voltage in a Kalman filter (or other similar algorithm) to come up with an estimate of SoC which is recognized ss not being that good. For those not familiar with Kalman filtering it is an algorithm that is frequently described in terms of its ability to "turn pig *sugar* into honey". SoC is further complicated in that it is obviously a measure of where one is between "empty" and "full" but empty and full can be defined somewhat arbitrarily. There will be "buffers" between empty and battery damage and full and battery damage. Tesla is free to change those limits any time it wants to and you will see lots of posts in which people note a dramatic drop or increase in range just after a software update. See No. 7 in this thread.

Flawed though TeslaFi data may be it is, at least, presumably consistent until Tesla redefines Empty and Full and thus suitable for looking at trends.
 
  • Like
Reactions: John Rucker