AccA icon indicating copy to clipboard operation
AccA copied to clipboard

Allow ANY capacity value, while still ensuring RESUME is always lower than PAUSE

Open VR-25 opened this issue 2 years ago • 9 comments

I implemented a new acc feature that lets one use millivolts as opposed to capacity/level thresholds. The new algorithm kicks in only when the given value is >= 3000 (mV).

This is useful especially for devices that don't provide reliable capacity measurements (I've got one). It's also another alternative to voltage limit - which works only on very few/special devices.

One can have some capacity thresholds be in millivolts and others in %, simultaneously. This means, acc 4200 20 works just as well as acc 80 75. By the way, all capacity thresholds, including shutdown_capacity can be in millivolts.

VR-25 avatar Aug 11 '21 09:08 VR-25

In what version are these new ACC functions? This is necessary to switch graphic interface. How to send a new command in the terminal? You recorded in the FAQ? ))

nialone avatar Aug 11 '21 14:08 nialone

In what version are these new ACC functions?

v2021.7.28 (202107280) and newer

This is necessary to switch graphic interface. How to send a new command in the terminal? You recorded in the FAQ? ))

All the information is in README.md. Read NOTES/TIPS FOR FRONT-END DEVELOPERS, Terminal Commands and DEFAULT CONFIGURATION.

VR-25 avatar Aug 11 '21 17:08 VR-25

If resume is set to 80 and pause is set to 3200, it is invalid, right? So we need to make them in the same units, right?

The two-unit format is a bit complicated, both for our program and for the user. Can this solution be optimized any further? Does the conversion formula capacity=(voltage-3000)/(4200-3000) apply to all devices? If so, we can use voltage internally and then show capacity to the user. If it doesn't apply to all devices, then we should probably make a database. Automatic internal conversion for such few devices, and show capacity to the user.

CrazyBoyFeng avatar Sep 05 '21 19:09 CrazyBoyFeng

If resume is set to 80 and pause is set to 3200, it is invalid, right? So we need to make them in the same units, right?

No. It works.

Quoting myself... One can have some capacity thresholds be in millivolts and others in %, simultaneously. This means, acc 4200 20 works just as well as acc 80 75. By the way, all capacity thresholds, including shutdown_capacity can be in millivolts.

The two-unit format is a bit complicated, both for our program and for the user. Can this solution be optimized any further? Does the conversion formula capacity=(voltage-3000)/(4200-3000) apply to all devices? If so, we can use voltage internally and then show capacity to the user. If it doesn't apply to all devices, then we should probably make a database. Automatic internal conversion for such few devices, and show capacity to the user.

The logic applied depends on the value given. Any capacity value above 3000 is considered millivolt as opposed to %. Conversions are not the goal and are not reliable to begin with. Voltage varies with temperature and battery age - meaning, there's no linear relationship between battery level and voltage.

Here's a practical example: One of my devices has a broken charging driver/hardware. It does not report the correct capacity (%). To better control charging, acc uses voltage instead of % thresholds.

VR-25 avatar Sep 05 '21 19:09 VR-25

When resume is set to 80 and pause is set to 3200, the pause voltage converted to capacity is 17. I say it's invalid to emphasize that it doesn't meet the resume<pause. In this example, to ensure that resume<pause, we need either convert or keep the units same.

CrazyBoyFeng avatar Sep 05 '21 19:09 CrazyBoyFeng

I totally missed your point. My bad! Indeed that's an issue. However, I would assume that somebody who intends to use % and voltage simultaneously would be knowledgeable enough to realize that 3200 is too low.

VR-25 avatar Sep 05 '21 19:09 VR-25

I just learned that the formula I was using was incorrect. The power-voltage is not a linear relationship. And there is no universal formula for devices. So to avoid abnormal usage, we need to make sure the units are same. Or we don't open this feature to normal users and restrict it to advanced users. For example, provide a tougle for advanced features. In advanced mode, no restrictions are on the user input. Otherwise resume=3200 and pause=80 may be incorrectly considered invalid. They are valid, but do not meet the resume<pause in the simple way.

CrazyBoyFeng avatar Sep 05 '21 20:09 CrazyBoyFeng

An advanced user mode is a great idea. Any values out of the [-1-101]% range should fire a warning notification.

VR-25 avatar Sep 05 '21 21:09 VR-25

Personally, I do not understand the battery and must confuse the value. It is best to limit 2 modes: only percent OR millivolts. Ideas? Where are you going to use your advanced mode? It is not comfortable.

nialone avatar Sep 06 '21 19:09 nialone