-
-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenUPS v1.9 firmware reports wrong battery current #516
Comments
having a method where the HID report descriptor can be replaced may be the only real solution.
Agreed. Let us know if you have thoughts on a general way to do this. Some other notes on the topic are linked to this issue:
#169
|
Some UPSes contain HID report descriptors that fail to correctly describe the contents of reports. For example, the OpenUPS descriptor fails to set the units, logical maximum and logical minimum before the corresponding `main item' as required by the HID specification. This commit allows an override HID report descriptor to be given to usbhid-ups which replaces the one produced by the UPS, allowing the report descriptors to be properly parsed. With an appropriately fixed report descriptor, OpenUPS reports correct battery current (+ve for charging, -ve for discharging.) (see #516 -- @clepple)
Monitoring the input and output currents reported through upsc for an OpenUPS device suggests that it is an energy creation device - the power out is greater than the power into the system once the battery is fully charged. Analysis and measurement reveals several issues: 1. "UPS.PowerStatus.Output.Current" is scaled for NUTs "output.current" value, which should be the output current from the UPS. However, the value reported for "UPS.PowerStatus.Output.Current" is not the output from the UPS terminals to the load, but is the current into the LTC3780 buck-boost converter on the output. The evidence for this is that with a known constant load, the current reported is dependent on whether we are using battery voltage or input voltage, and varies as one would expect if it were reporting the current supplied to the LTC3780. 2. "UPS.PowerStatus.Input.Current" is scaled for NUTs "input.current" value, which should be the input current to the UPS. The value reported for "UPS.PowerStatus.Input.Current" follows and matches the current supplied to the battery while charging is taking place, whether bulk charging or floating. In order to fix these issues, the general principle of switch mode power conversion is employed: Power out = Power in * Efficiency (where Efficiency is between 0..1) The fix for "output.current" involves knowing whether the UPS was powered from the battery or the input voltage (which is the voltage fed to the LTC3780), calculating the power into the LTC3780 converter, and using the above equation to refer it to the output. Fixing "input.current" requires a similar process, except in reverse. We calculate the power being supplied into the battery, and refer that back to the input terminals, remembering to sum the current draw from the LTC3780. (see #516 -- @clepple)
Inaction on this is a real pity. I have 4 openups units. Hardware is great. I have learned to ignore the input and output reported currents which are wrong. Mini Box does not seem to care. |
I suppose nobody with the units contributed an updated driver?
That said, recent improvements in master branch included facilities that
can help:
1) Detection of mismatched LogMin/LogMax (#1024 etc IIRC)
2) Report descriptor fixups for known-broken cases - you may want to extend
that for the driver.
…On Thu, Jul 21, 2022, 01:43 davidwkerr ***@***.***> wrote:
Inaction on this is a real pity. I have 4 openups units. Hardware is
great. I have learned to ignore the input and output reported currents
which are wrong. Mini Box does not seem to care.
—
Reply to this email directly, view it on GitHub
<#516 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFCGQRWHCB3DVTPHM6TVVCFLBANCNFSM4EN5GXYA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
FWIW, some work was done about general tech for hot-patching the presumed-broken HID Report Descriptors, most recently touched in PR #2718 - someone with the device and a bit of programming courage can check the |
OpenUPS v1.9 firmware appears to report positive values for the battery current whether the battery is charging or discharging. The USB poewr HID specifications say that the current is supposed to be positive when charging and negative while discharging.
In my case, I have 12V output, ,12V input, and a 12V 7Ah battery connected.
Investigating this issue (and other issues) with nut-2.7.2 with OpenUPS, it appears that the HID Report Descriptor is non-conformant with the HID specification in many respects:
These issues can be fixed by arranging for nut to accept a replacement HID Report Descriptor with fixes in place, and this allows me to get sensible UPS.PowerStatus.Current values.
Other firmware issues:
Note that UPS.PowerStatus.Output.Voltage and UPS.PowerStatus.Output.Current appear to have correct Units/UnitExp, with a logical min/max of 0/65535, so this is not the issue reported in another bug report on this device.
I am attempting to talk to Mini-Box.Com about this, but they have yet to reply to my emails earlier this week covering some of this. However, if they remain unresponsive, having a method where the HID report descriptor can be replaced may be the only real solution.
I'm including this here so that people in the NUT project are aware of the issues with this hardware.
The text was updated successfully, but these errors were encountered: