Update fuel gauge config v3 #5550
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR brings quite significant improvements to the fuel gauge estimator.
1) Updated battery model
The battery model (battery_model.h) was adjusted to distinguish between temperatures for charging and discharging. When creating the OCV curves during battery identification, we link each curve with a specific temperature so the fuel gauge can look up and interpolate between them.
Previously, we extracted a single temperature for both charging and discharging curves from a given chamber test as the mean value of all NTC measurements, but this was not very accurate. In general, the battery temperature is higher by ~2-3°C when charging in the same ambient temperature because of self-heating from the charging current. Using different temperature lookup tables for charging and discharging scenarios should compensate for that offset.
2) More accurate identification data
The updated JYH battery model battery_data_jyhpfl333838.h is composed of updated battery characterization data from the tool introduced in #5536 and a more precise battery dataset captured with an automated tool on 5 parallel fresh battery samples across a wider temperature range of 5-40°C.
3) Fuel gauge parameters update
The PR also updates the Fuel Gauge R and Q parameters. The previous version showed great results in simulation, but we observed quite different behavior on the physical device. This was very likely due to different sampling rates – while on the device we sample data and update the fuel gauge estimation every 100ms, in the simulator we used data sampled every 1.3s. In such cases, we need to scale the Q parameter properly.