[Nut-upsdev] Question about "HB" flag and a "battery.charge.high" name

Greg Troxel gdt at lexort.com
Wed Dec 18 13:53:39 GMT 2024


Jim Klimov via Nut-upsdev <nut-upsdev at alioth-lists.debian.net> writes:

>   Likewise, https://en.wikipedia.org/wiki/Float_voltage and
> https://en.wikipedia.org/wiki/Trickle_charging articles stress that "A
> battery under continuous float voltage charging is said to be float-charging
> <https://en.wikipedia.org/wiki/Trickle_charging#cite_note-Inc.1989-3>",
> which is a wee bit different from what I saw in discussions about devices
> that "normally only charge up to a 100% level and then let their battery
> seep away until it hits a threshold (90-95%) so it is boosted back to 100%
> again".

>   Also, for monitoring generally, there is a case of devices (especially
> lithium-based batteries, as I hear) that are intentionally charged to some
> 90-95% and avoid going to 100% due to whatever FUD or true dangers or
> wear-out. Windows power manager has settings/modes for that on laptops.

I see these as subtly different.  Float is a concept about
constant-voltage charge when the current has become small.  That is how
lead acid batteries are charged, basically constant current as long as
the charger is limited by current (due to capacity, or avoiding hitting
the battery super hard), then constant voltage, often at a higher level
until current drops, and then the float voltage, sort of 2.3 V/cell,
temp adjusted, and a little lower for longevity.  By a little lower I
mean 13.5V or 13.2V, for a 6-cell battery at 25C, which would nomimally
be floated at 13.8V. 

Trickle is about a small constant current, intended to be below the
threshold of damage.  Which can amount to the same thing, but it implies
a current-based charger.  Example is "just put 50 mA into the battery
regardless of voltage".

Overall I would call these two together "maintenance charging",
indicating that the battery is in a state where it is being charged very
little, but is expected to maintain nearly full status, and it is
expected that this state can and will continue indefinitely.

I would reserve DISCHRG for when the battery is supplying power to the
UPS.

If a device charges to x% where is x is > 90ish, and then lets the
battery sit without being charged or discharged, then I'd call is
RESTING when the battery is in that just sitting there state.  This is
not CHARGING and not DISCHRG.
If it switches to charge for a while I'd call that maintenance charging.

Or, perhaps we can steal from android and call it NOTCHARGING.

>   So... I think there is a common ground of possibly different concepts
> here, and we somehow want to handle it, and it needs a name. So far the
> term used in code and variables ended up being "hover", as in e.g.
> `onlinedischarge_log_throttle_hovercharge` setting added to `usbhid-ups`.

I really dislike "hover charge".  I don't think it's an accepted term,
and it doesn't lead, for me, to intuition.  Plus, it feels like it more
implies the strategy of charge to 95%, rest, repeat, rather than a
particular state.

This is as I understand it the normal way to deal with lithium ion.
Batteries are charged until mostly full, for some definition of full,
and then they sit being not charged and not discharged.   Normally,
people do not feel that they need to name this behavior.

>   Is there a better (industry-standard) name that does reflect such
> behaviors, notably - those that we see with NUT as "DISCHRG that we should
> not worry about (until some point)"?

Really one wants to know the battery voltage and the current going in or
out. DISCHRG implies current going out.  The charge/rest/charge strategy
is about small amounts in, nothing for a while, small amounts in.

>   Is "float" or "trickle" it? It's never too late to deprecate one alias in
> favor of another, if need be...

MAINT, when battery is mostly full and being charged at a very low rate.
Very low might be < 0.01C/h.

So all in all I think we can reduce to 5 states.  My 4th one is what I
think you call hover, but I think NOTCHARGINGFULL gives the right idea
to someone who hasn't read the discussion and doesn't know the code.


* CHARGING

Current is flowing into the battery and either the battery is not
fullish or current is significant

* DISCHARGING

There is significant current out of the battery, such as powering UPS
control electronics and perhaps the load.

* MAINTCHARGING

The battery is basically full and is actively being kept full, but the
amount of current going in is small, usually < 0.01C/h.  Examples are
constant voltage float charging of lead acid, and trickle
constant-current charge at a low rate.  This state typically appears
with lead-acid-based batteries, but should be used whenever the
described behavior occurs regardless of battery chemistry.

* NOTCHARGINGFULL

The battery is basically full and the system has decided to cease
charging.  There is essentially no current in or out.  The precise
definition of mostly full is up to the device, but the point is that the
device thinks the battery is adequately charged and that it is better to
decline to charge at the moment, as a strategy to meet the dual goals of
capacity for an outage and battery life.  This state typically appears
with lithium-based batteries, but should be used whenever the described
behavior occurs regardless of battery chemistry.

* NOTCHARGINGFAULT

The battery is not more or less full and there is essentially no current
in or out.  Somehow, the battery is not being charged, but arguably it
should be.



More information about the Nut-upsdev mailing list