Repository navigation
Conversation
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 37b8e3c is temporarily available: NUT-tarballs-PR-3716.zip. |
Calibration report — Ragtech New Easy Pro 3200 VA (20NEP4061, CbU/Ti)Unit: Ragtech New Easy Pro 3200 VA, 10 outlets, automatic 115/127/220 V input (127 V mains here), 115 V sine output, part number 20NEP4061 (CbU/Ti), internal 2× 12 V 9 Ah (24 V), USB CDC-ACM Procedure
Discharge (datasheet-seeded model
|
| min | ups.load % | Vbat | fw charge % | driver charge % | temp °C |
|---|---|---|---|---|---|
| 0 | 12.3 | 25.46 | 100.0 | 99.6 | 50 |
| 3 | 11.3 | 25.06 | 86.3 | 85.4 | 55 |
| 6 | 12.3 | 24.92 | 84.3 | 73.9 | 58 |
| 9 | 15.1 | 24.66 | 80.8 | 62.2 | 59 |
| 12 | 10.4 | 24.39 | 75.3 | 50.4 | 62 |
| 15 | 11.3 | 23.99 | 71.0 | 39.0 | 64 |
| 18 | 11.3 | 23.58 | 66.7 | 26.5 | 62 |
| 21 | 10.3 | 23.32 | 61.6 | 12.9 | 62 |
| 24 | 13.2 | 23.18 | 54.5 | 1.2 | 63 |
| 27 | 10.4 | 22.91 | 50.2 | 0.0 | 64 |
| 29.9 | 9.4 | 21.71 | 31.0 | 0.0 | 63 |
- Firmware
LBat 16:48:00 → 1796 s, average 11.4 % on battery (≈365 VA; 9.2 % on mains before the test →obload_factor1.24). The seeded model reached 0 at ~24.2 min (≈20 % pessimistic) → recalibrated toruntimecal = 1796,11.4,5592,5.0(datasheet exponent 1.378 kept). - After
LB: beeping, displayA00, 30 s countdown;battery.voltagefell 21.71 → 19.83 V within ~66 s while the firmware charge byte went 31 → 2.7 %; mains restored at ~16:49:08, just before cutoff. - Output held 114.3–116.0 V / 60.05 Hz throughout; nothing on the load rebooted. Internal temperature peaked at 64–65 °C (fan cycles at ~63 °C).
- Energy check: ≈140 Wh drawn from a 216 Wh nameplate bank at ~12 A (~1.3 C) ≈ 65 %, normal for healthy 9 Ah SLA at a 30-minute rate.
Recharge
| h after mains | Vbat | fw charge % | phase |
|---|---|---|---|
| 0.0 | 23.85 | 4.3 | bulk |
| 1.0 | 25.59 | 41.6 | bulk |
| 2.0 | 26.26 | 55.7 | bulk |
| 4.1 | 27.05 | ~70 | absorption starts |
| 6.3 | 28.54 (peak) | 100.0 | absorption |
| 6.4 | 27.2 → 26.9 | 100.0 | float (~26.8 V) |
- Bulk ≈ 5.9 Ah × 1.1 / 4.1 h ≈ 1.5 A average → a small charger (relevant for external modules: ~2 days to refill a ~90 Ah bank).
- Full at 6.4 h →
chargetime = 15300(full = 1.5 × chargetime). With the old default (28800) the driver still showed 82 % half an hour after the bank was full. Periodic top-ups back to ~28.4 V occur while floating. - A driver restart during the recharge resumed the saved estimate (14.7 %) instead of the firmware's 27.8 %.
Final settings in production
va = 3200
runtimecal = 1796,11.4,5592,5.0
chargetime = 15300
battery_ah = 9
extbatt_ah = 0
obload_factor = 1.24
runtime_low = 300
The Ragtech family-10 firmware reports no runtime, and its battery charge byte is derived from battery voltage alone: it reads 100 % as soon as the charger floats the bank, drops sharply under inverter load and recovers when the load falls. On an Easy Pro 3200 VA it still read about 30 % when the firmware raised low battery, and the firmware cuts the output only about one minute after that (30 s countdown), which is too late for a clean host shutdown. Add an opt-in runtime model, enabled by "runtimecal" (same semantics as in nutdrv_qx), with "chargetime", "battery_ah", "extbatt_ah", "obload_factor" and "runtime_low" options: * battery.runtime from a Peukert-style fit through the two runtimecal points, scaled for external battery modules; * battery.charge becomes the driver's own state-of-charge estimate, integrated from the energy drawn on battery and recovering along chargetime on mains; the firmware value moves to battery.charge.approx; * on mains the prediction scales ups.load by obload_factor, as the inverter draws noticeably more than the mains path (x1.24 measured); * LB is raised on battery once the estimate drops below runtime_low; * the estimate is persisted in the state path so driver restarts (config changes, USB re-enumeration) do not reset it to the inflated voltage-based reading while charging. Without runtimecal the driver behaves as before. Calibrated end-to-end on a New Easy Pro 3200 VA (20NEP4061, internal 2x 12 V 9 Ah): 1796 s to firmware LB at 11.4 % average load, full recharge in 6.4 hours; the procedure and values are documented in the man page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC Signed-off-by: Ygor Lemos <ygbr@mac.com>
Map the OEM "cancelDischarge" action from Ragtech's devices.xml (F_OPCHECKUP=0, i.e. clear bit 2 of register 0x90) to test.battery.stop, so a deep battery test started with test.battery.start.deep can be aborted. Like the other test and shutdown instcmds it is only exposed when allow_shutdown is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC Signed-off-by: Ygor Lemos <ygbr@mac.com>
* data/driver.list.in: add the Ragtech New Easy Pro 3200VA (20NEP4061, CbU/Ti), which reports model id 18 and is identified as an Easy 2200 TI, so it needs va=3200. * docs/man/ragtech.txt: describe that unit under SUPPORTED HARDWARE (model id collision, current scaling cross-checked against the front-panel display and register 0x8D, firmware LB -> A00 alarm -> 30 s countdown -> output cut about 60 s after LB), and replace the short calibration note with the step-by-step discharge and recharge procedure that was executed on it, how each parameter is derived and the measured values. * docs/nut.dict: add CbU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC Signed-off-by: Ygor Lemos <ygbr@mac.com>
The load behind battery.runtime was an exponential average over the last few polls (about 15 s at the default pollinterval). On mains, where the figure is a forecast of an outage starting now, short load spikes on a rack of network gear (a phone charger, a fan, a PC waking up) swung it by several minutes between polls: on the Easy Pro 3200 VA the displayed runtime moved between about 1050 and 1870 s within an afternoon at a steady 9-10 % base load. Make the average time-based (independent of pollinterval) with a time constant of 300 s on mains and 15 s on battery, where the figure has to follow the real discharge. The state of charge integration still uses the instantaneous load. AI disclosure: prepared with Claude Code (Claude Opus 5.5); reviewed, tested on the hardware and submitted by the human author. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC Signed-off-by: Ygor Lemos <ygbr@mac.com>
7c0d60e to
c97e0c4
Compare
|
MAINTAINER NOTE: Cross-linking to #2420 for holistic addressing of this problem area, eventually. |
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
left a comment
There was a problem hiding this comment.
Generally LGTM, a docs update about regular saving of State-of-Charge files (and whether the sysadmin wants it to persist across reboots) would be desirable.
The runtimecal problem area (and potentially the driver option names involved) may later be impacted by #2420.
Address review of the runtime model: * Create the state-of-charge file under a 022 umask, as writepid() does, so it is never group/world-writable (CodeQL "File created without restricting permissions"). * Add a soc_save_interval option (seconds, default 60; 0 disables both saving and resuming the estimate). The file is now written on that interval, on each mains/battery transition and on driver exit, instead of on every poll while on battery. A failing save is logged once. * Document the file in a new STATE OF CHARGE FILE section of the man page: location in the state path, write frequency, storage wear and possible I/O stalls on persistent or flash storage, tmpfs vs persistent state paths and what happens across reboots, so the sysadmin can choose. * Note that the calibration values in the man page were measured on a brand new unit with its factory batteries. * Make the charge-time arithmetic use explicit double conversions. Tested on a Ragtech New Easy Pro 3200VA: file created -rw-r--r--, written every 60 s and on exit, nothing written with soc_save_interval = 0; builds with --enable-warnings=hard --enable-Werror (gcc 15) and auto (clang 21), ragtech.c also clean under clang hard. AI disclosure: prepared with Claude Code (Claude Opus 5.5); reviewed, tested on the hardware and submitted by the human author. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC Signed-off-by: Ygor Lemos <ygbr@mac.com>
|
@jimklimov thanks for the review and for merging master in and fixing the NEWS references. I pushed 51e8f71 (on top of your merge) addressing it: Changes
On #2420: TestingOn the Ragtech New Easy Pro 3200 VA (20NEP4061, Ubuntu 26.04):
Builds:
About the previous CI failures (on d53cbed)As far as I could tell they were not caused by this change:
I couldn't read the farm's build logs directly (login required), so please tell me if something in them points at Calibration data for the unit is in the earlier comment. The discharge and recharge were measured on the brand-new, factory-fresh unit described above. AI disclosure: prepared with Claude Code (Claude Opus 5.5); reviewed, hardware-tested and signed off by me. |
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
✅ Build nut 2.8.5.5914-master completed (commit c05c0e84e4 by @jimklimov)
|
|
✅ Build nut 2.8.5.5914-master completed (commit c05c0e84e4 by @jimklimov) |
The
ragtechdriver (family-10 firmware, PR #3447 / #3504) exposes no runtime, and its battery charge byte is voltage-based: it reads 100 % as soon as the charger floats the bank, drops sharply under inverter load and bounces back when the load falls. On my New Easy Pro 3200 VA (20NEP4061, CbU/Ti — the same line as #3500) the firmware still reported ~31 % when it raisedLB, and then cut the output only ~60–65 s later (30 s countdown after the beeping alarm). With stock settingsupsmontherefore gets about one minute to shut a host down.This PR adds an opt-in runtime model to
ragtech, modelled onnutdrv_qx'sruntimecal, plus a smalltest.battery.stopinstcmd.Commits
drivers/ragtech.c: add optional battery runtime modelruntimecal(same semantics asnutdrv_qx),chargetime,battery_ah,extbatt_ah,obload_factor,runtime_low;battery.runtimefrom a Peukert-style fit through the tworuntimecalpoints, scaled by(battery_ah + extbatt_ah) / battery_ahfor external battery modules;battery.chargebecomes the driver's state-of-charge estimate: integrated from the energy drawn on battery, recovering alongchargetimeon mains (80 % atchargetime, full at 1.5×); the firmware reading is kept in the standardbattery.charge.approx;ups.loadbyobload_factor, because the inverter draws noticeably more than the mains path for the same equipment (×1.24 measured: 9.2 % → 11.4 %);LBis raised on battery when the estimate drops belowruntime_low(default 300 s), also published asbattery.runtime.low;battery.capacityis published too;NEWS.adocentry; three words fornut.dict.drivers/ragtech.c: add test.battery.stop instcmd— maps the OEMcancelDischargeaction (F_OPCHECKUP=0, clear bit 2 of reg0x90) so atest.battery.start.deepcan be aborted; gated byallow_shutdownlike the other test/shutdown commands.docs: document Ragtech New Easy Pro 3200VA and the calibration procedure— adds the unit todata/driver.list.in(reports model id 18 → identified as Easy 2200 TI, needsva=3200), describes it in the man page's SUPPORTED HARDWARE (model-id collision, current scaling cross-checked against the front-panel display and register0x8D, firmwareLB→A00alarm → 30 s countdown → output cut ~60 s afterLB), and documents the step-by-step discharge/recharge procedure that was executed, how each parameter is derived, and the measured values.drivers/ragtech.c: average the runtime load over time, not polls— the load behindbattery.runtimeis now a time-based average (300 s time constant on mains, 15 s on battery, independent ofpollinterval). On mains the runtime is a forecast, and short spikes on a rack of network gear were swinging it between ~1050 and ~1870 s within an afternoon at a steady 9–10 % base load.Without
runtimecalinups.confthe driver behaves exactly as before.Calibration data (New Easy Pro 3200 VA, internal 2× 12 V 9 Ah, firmware 1.0, reports model id 18 so
va = 3200)LBin 1796 s (29 min 56 s) at an average 11.4 % load (≈365 VA). The datasheet-derived model (80 min @ ~110 W / 20 min @ ~300 W) had been ~20 % pessimistic. AfterLBthe battery voltage collapsed from 21.71 V to 19.83 V within ~66 s.chargetime = 15300.ups.loadagreed with the front-panel load display (10–13 %) during the discharge, so the 2200 TI current scaling is adequate for this unit.Testing
-Wall -Wextra -Wformat=2 -Wshadow, no warnings (each commit separately); new doc lines passaspellwithdocs/nut.dict; all added lines in C sources, man page and NEWS are plain ASCII.make distcheck-lightpasses (Ubuntu 26.04,--with-libsystemd) on the final tree.LB, overnight recharge, driver restarts during recharge (estimate resumed from the state file), USB re-enumeration.AI disclosure
This contribution was prepared with Claude Code using the Claude Opus 5.5 model (driver code, docs, calibration analysis). I reviewed the changes, ran the hardware tests and calibration on my unit, and take responsibility for the submission; the DCO sign-offs were added by me. Each commit carries a
Co-Authored-By: Claude Opus 5.5trailer.cc @juslex (driver author) and @LanayAlves (#3500, same Easy Pro 3200 line) — calibration points from other units/battery configurations would be very welcome.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MArYHUmWt81RRXHGNqzznC