code wiki / _hdl_build / nx_batt_intake.nx
nx_batt_intake.nx
buildroot/runtime/_hdl_build/nx_batt_intake.nx
about
nx_batt_intake.nx -- R1 PACK INTAKE & TRIAGE: the diagnose->verdict brain of the Li-ion reclamation business.
Given a pack's measured state + a DATA-DRIVEN IntakeSpec (#11 -- thresholds are svc-config, never magic numbers),
returns ONE sealed verdict:
UNSAFE-REJECT : swollen/damaged, out of temp range, or a cell below the unsafe floor (over-discharged ->
copper-shunt/dendrite risk). The NEVER-IGNITE priority: SAFETY IS SCREENED FIRST, before any
economic decision -- a pack that could ignite is refused, never charged. (Spine = nx_battery_safety.)
RETIRE-RECYCLE : too degraded (SoH below the retire line) or too many bad cells to be worth saving -> safe recycle.
RE-CELL : a few bad cells in an otherwise good pack -> replace cells + rebalance (the EGO-grade rebuild).
BMS-RESET : cells healthy + balanced but the pack reads dead at the terminals = BMS lockout -> just wake it
(the "dead battery that's actually fine" -- the cheapest, highest-margin recovery).
RECONDITION : cells healthy but imbalanced -> balance charge.
PASS-HEALTHY : healthy, balanced, capacity OK.
HONEST: "EGO-grade top capacity" = rebuild-to-spec (RE-CELL / rebalance / BMS-reset), NOT un-aging a worn cell
(capacity fade is largely irreversible). SoH = capacity retention per-mille, computed with the SAME formula as the
nx_consumable kernel (the gate proves they match = real reuse). Pure compute: no syscalls, no float, read-only
(never-brick #26). license_tier: ORIGINAL
dependencies 0 imports · 5 importers
imports: none
imported by: nx_batt_facility.nxnx_batt_facility_test.nxnx_batt_intake_test.nxnx_batt_recondition.nxnx_batt_recondition_test.nx
structs
| 33 | struct PackState |
| 46 | struct IntakeSpec |
consts
| 18 | const NX_BI_UNSAFE_REJECT: i64 = 0 |
| 19 | const NX_BI_RETIRE_RECYCLE: i64 = 1 |
| 20 | const NX_BI_RECELL: i64 = 2 |
| 21 | const NX_BI_BMS_RESET: i64 = 3 |
| 22 | const NX_BI_RECONDITION: i64 = 4 |
| 23 | const NX_BI_PASS_HEALTHY: i64 = 5 |
| 24 | const NX_BI_BAD_ARG: i64 = 6 |
| 25 | const NX_BI_N: i64 = 7 |
functions
| 27 | func nx_bi_verdict_is_valid(v: i64) -> i64 |
| 60 | func nx_bi_soh_permille(ps: *PackState) -> i64 |
| 68 | func nx_batt_triage(ps: *PackState, spec: *IntakeSpec) -> i64 |