code wiki / _hdl_build / nx_batt_intake.nx

nx_batt_intake.nx

buildroot/runtime/_hdl_build/nx_batt_intake.nx

4545 B99 linesdepth 0pulls 0 transitivereach 5 importersview sourcekind librarytopic batt
docsdependenciesstructsconstsfunctions

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

nx_batt_intake.nx nx_batt_facility.nx nx_batt_facility_test.nx nx_batt_intake_test.nx nx_batt_recondition.nx nx_batt_recondition_test.nx

imports: none

imported by: nx_batt_facility.nxnx_batt_facility_test.nxnx_batt_intake_test.nxnx_batt_recondition.nxnx_batt_recondition_test.nx

structs

33struct PackState
46struct IntakeSpec

consts

18const NX_BI_UNSAFE_REJECT: i64 = 0
19const NX_BI_RETIRE_RECYCLE: i64 = 1
20const NX_BI_RECELL: i64 = 2
21const NX_BI_BMS_RESET: i64 = 3
22const NX_BI_RECONDITION: i64 = 4
23const NX_BI_PASS_HEALTHY: i64 = 5
24const NX_BI_BAD_ARG: i64 = 6
25const NX_BI_N: i64 = 7

functions

27func nx_bi_verdict_is_valid(v: i64) -> i64
60func nx_bi_soh_permille(ps: *PackState) -> i64
called by 2: nx_batt_triagemain
68func nx_batt_triage(ps: *PackState, spec: *IntakeSpec) -> i64
called by 3: mainmainmain calls 1: nx_bi_soh_permille