Re: [RFC PATCH v3 3/9] power: supply: Support DT originated temperature-capacity tables

From: Vaittinen, Matti
Date: Thu Nov 18 2021 - 01:11:17 EST


Hi Linus,

On 11/18/21 04:10, Linus Walleij wrote:
> On Tue, Nov 16, 2021 at 1:26 PM Matti Vaittinen
> <matti.vaittinen@xxxxxxxxxxxxxxxxx> wrote:
>
>> Support obtaining the "capacity degradation by temperature" - tables
>> from device-tree to batinfo.
>>
>> Signed-off-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>
>
> Same questions as on the binding patch.
>
> If we already support different degradation by temperature tables,
> why do we need a second mechanism for the same thing?

Thanks for bringing this up. As I said, I didn't notice that we could
indeed use the CAP-OCV tables for different temperatures to bring in
this information :) I see certain benefit from the possibility of not
requiring to measure the OCV at different temperatures - but it may not
be meaningful. As I replied to your patch 1/9 review - I need to (try
to) do some more research...

> I'd just calculate a few tables per temperature and be done with
> it.
>
> At least documentation needs to be updated to reflect that the two methods
> are exclusive and you can only use one of them.
>
> + * Usually temperature impacts on battery capacity. For systems where it is
> + * sufficient to describe capacity change as a series of temperature ranges
> + * where the change is linear (Eg delta cap = temperature_change * constant +
> + * offset) can be described by this structure.
>
> But what chemistry has this property? This seems to not be coming from
> the real physical world. I would perhaps accept differential equations
> but *linear* battery characteristics?

linear *on a given small temperature range*. I think this is improvement
to situation where we don't do temperature compensation at all. And, by
shortening the temperature area where CAP change is linear, we can
approach any non linear behaviour, right? With the current support of
100 values, you can divide the temperature range to 100 pieces with
linear CAP degradation impact - I think you get reasonably good
estimates there even if your device was expected to be operational at
temperatures where min...max is 100C. (that would allow us to divide the
range to 1C slots and assume linear degradation at each 1C range. Or
didvide this unevenly so that the temperature areas where change is more
constant we could have bigger slots, and at the areas where change is
faster we could have smaller slots. I don't see linear interpolation as
such a big problem there?

> If the intent is only for emulation of something that doesn't exist in
> reality I doubt how useful it is, all battery technologies I have seen
> have been nonlinear and hence we have the tables.
>
> If you want to simulate a linear discharge, then just write a few tables
> with linear dissipation progression, it's easier I think.

"linear dissipation progression" - that should be my next favourite
sentence to sound professional ;) I need to first google what it is in
Finnish though XD

Best Regards
Matti

--
The Linux Kernel guy at ROHM Semiconductors

Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~ this year is the year of a signature writers block ~~