# Systems Perspective Description Language — Building Automation & HVAC (SPDL-HVAC) **Specification Document ID:** `SPDL-HVAC-SPEC-2026-v4.2` **Classification:** Open Epistemic Standard / Real-Time Zero-Heap Thermodynamic Automation Substrate **Principal Architect:** Asse van Nix | Systems Perspective Framework & Proof-Driven Architecture Group **Target Environment:** Zig 0.16.0 Freestanding WASM (`wasm32-freestanding`) · Embedded RTOS (Cortex-M4/M7, ESP32) · BACnet/IP Replacement **Applied Standards:** ISO/IEC 14977 EBNF · GBNF Maskable · ANSI/ASHRAE Standard 55 (Thermal Comfort) · ANSI/ASHRAE 62.1 (Indoor Air Quality) · ISO 16484-5 (BACnet Replacement) · ISO 52000-1 (Energy Performance) --- ## 1. Epistemic Architecture: Why BACnet, LonWorks, and KNX Must Be Replaced Building automation systems currently rely on **BACnet (ANSI/ASHRAE 135 / ISO 16484-5)** and **KNX (ISO/IEC 14543-3)**. These protocols exhibit systemic operational vulnerabilities: 1. **Object-Oriented Polling Overhead:** BACnet requires heavy object trees (Analog Input, Binary Output, Multi-State Value) with dozens of verbose properties per physical point. This wastes bandwidth, burns compute on resource-constrained embedded microcontrollers, and exhausts LLM token budgets. 2. **Thermodynamic Blindness & Valve Fighting:** BACnet is purely an I/O multiplexer; it has no concept of enthalpy, air mixture thermodynamics, or thermal zone momentum. Consequently, heating and cooling loops routinely fight each other (simultaneous heating and chilling in dual-duct or VAV terminal units), causing massive energy waste and actuator mechanical fatigue. **SPDL-HVAC** replaces unconstrained object polling with **Thermodynamic Invariant Manifolds**. --- ## 2. Physical Invariants, DAEs & Mathematical Proof Gates ``` SPDL-HVAC THERMAL MANIFOLD ┌─────────────────────────────────────────────────────────────────────────────┐ │ PSYCHROMETRIC MOIST AIR ENTHALPY CONSERVATION │ │ h_mix = (m_dot_oa * h_oa + m_dot_ra * h_ra) / (m_dot_oa + m_dot_ra) │ ├─────────────────────────────────────────────────────────────────────────────┤ │ THERMAL ZONE CONTINUOUS MOMENTUM EQUATION │ │ C_z * (dT_z/dt) = q_internal + q_solar + m_dot_sa * c_p * (T_sa - T_z) │ ├─────────────────────────────────────────────────────────────────────────────┤ │ HYDRONIC CROSS-LIMITING NON-OVERLAP BARRIER (Zero-Energy Waste) │ │ h_cross(u_heat, u_cool) = - (u_heat * u_cool) == 0.0 │ └─────────────────────────────────────────────────────────────────────────────┘ ``` ### 2.1 Thermal Comfort & Air Quality Barrier Functions The thermal state must remain within the PMV/PPD comfort envelope (ASHRAE 55): $$h_{\text{comfort}}(\mathbf{x}) = \Delta T_{\text{allowable}} - |T_{\text{zone}} - T_{\text{setpoint}}| \ge 0$$ Ventilation must bound CO2 levels below indoor air quality thresholds (ASHRAE 62.1): $$h_{\text{iaq}}(\mathbf{x}) = \text{CO2}_{\text{max}} - \text{CO2}_{\text{ppm}}(\mathbf{x}) \ge 0$$ --- ## 3. Formal ISO/IEC 14977 EBNF Grammar ```ebnf HvacManifest = { Line } ; Line = [ Whitespace ] , ( Comment | HvacRecord ) , Newline ; Whitespace = { " " | "\t" | "\r" } ; Newline = "\n" | "\r\n" ; Comment = "#" , { AnyChar - Newline } ; HvacRecord = "(I) @HVAC_INVARIANT" , " " , InvariantFields | "(M) @THERMAL_ZONE" , " " , ZoneFields | "(B) @HYDRONIC_BARRIER" , " " , HydronicBarrierFields | "(B) @IAQ_BARRIER" , " " , IaqBarrierFields | "(M) @AHU_REGULATION" , " " , AhuFields | "(M) @VAV_TERMINAL" , " " , VavFields | "(T) @CLIMATE_OBSERVER" , " " , ObserverFields ; InvariantFields = "id:" , Token , " max_scan_ms:" , Integer , " energy_target_kwh_m2:" , Number , " alloc_policy:ZERO_HEAP" ; ZoneFields = "id:" , Token , " volume_m3:" , Number , " thermal_cap_kj_k:" , Number , " design_occupancy:" , Integer ; HydronicBarrierFields = "id:" , Token , " target_ahu:" , Token , " min_deadband_k:" , Number , " max_valve_overlap_pct:" , Number ; IaqBarrierFields = "id:" , Token , " target_zone:" , Token , " max_co2_ppm:" , Number , " min_outdoor_airflow_l_s:" , Number ; AhuFields = "id:" , Token , " mode:" , AhuMode , " sup_temp_c:" , Number , " static_press_pa:" , Number , " econ_damper_pct:" , Number ; AhuMode = "OCCUPIED" | "UNOCCUPIED_NIGHT_PURGE" | "MORNING_WARMUP" | "DEMAND_RESPONSE" ; VavFields = "id:" , Token , " zone:" , Token , " damper_pct:" , Number , " reheat_pct:" , Number , " air_flow_m3_h:" , Number ; ObserverFields = "id:" , Token , " zone_temp_c:" , Number , " rh_pct:" , Number , " co2_ppm:" , Number , " power_kw:" , Number ; Token = Letter , { Letter | Digit | "_" | "-" } ; Number = [ "-" ] , Digit , { Digit } , [ "." , { Digit } ] ; Integer = [ "-" ] , Digit , { Digit } ; Letter = "A".."Z" | "a".."z" ; Digit = "0".."9" ; AnyChar = ? Any valid Unicode code point ? ; ``` --- ## 4. GBNF Structured Sampling Grammar ```gbnf root ::= HvacRecord "\n" HvacRecord ::= "(I) @HVAC_INVARIANT" " " InvariantFields | "(M) @THERMAL_ZONE" " " ZoneFields | "(B) @HYDRONIC_BARRIER" " " HydronicBarrierFields | "(B) @IAQ_BARRIER" " " IaqBarrierFields | "(M) @AHU_REGULATION" " " AhuFields | "(M) @VAV_TERMINAL" " " VavFields | "(T) @CLIMATE_OBSERVER" " " ObserverFields InvariantFields ::= "id:" [A-Za-z0-9_-]+ " max_scan_ms:" [0-9]+ " energy_target_kwh_m2:" [0-9.]+ " alloc_policy:ZERO_HEAP" ZoneFields ::= "id:" [A-Za-z0-9_-]+ " volume_m3:" [0-9.]+ " thermal_cap_kj_k:" [0-9.]+ " design_occupancy:" [0-9]+ HydronicBarrierFields ::= "id:" [A-Za-z0-9_-]+ " target_ahu:" [A-Za-z0-9_-]+ " min_deadband_k:" [0-9.]+ " max_valve_overlap_pct:" [0-9.]+ IaqBarrierFields ::= "id:" [A-Za-z0-9_-]+ " target_zone:" [A-Za-z0-9_-]+ " max_co2_ppm:" [0-9.]+ " min_outdoor_airflow_l_s:" [0-9.]+ AhuFields ::= "id:" [A-Za-z0-9_-]+ " mode:" ("OCCUPIED"|"UNOCCUPIED_NIGHT_PURGE"|"MORNING_WARMUP"|"DEMAND_RESPONSE") " sup_temp_c:" [0-9.]+ " static_press_pa:" [0-9.]+ " econ_damper_pct:" [0-9.]+ VavFields ::= "id:" [A-Za-z0-9_-]+ " zone:" [A-Za-z0-9_-]+ " damper_pct:" [0-9.]+ " reheat_pct:" [0-9.]+ " air_flow_m3_h:" [0-9.]+ ObserverFields ::= "id:" [A-Za-z0-9_-]+ " zone_temp_c:" [0-9.]+ " rh_pct:" [0-9.]+ " co2_ppm:" [0-9.]+ " power_kw:" [0-9.]+ ``` --- ## 5. Production SPDL-HVAC Manifest Exemplar ```spdl # ============================================================================== # SPDL-HVAC v4.2 MANIFEST: COMMERCIAL HEADQUARTERS CENTRAL AHU & VAV SUITE # Area: 12,000 m2 | Compliance: ASHRAE 55 + ASHRAE 62.1 | Engine: Freestanding WASM # ============================================================================== (I) @HVAC_INVARIANT id:INV-BLDG-CORE max_scan_ms:1000 energy_target_kwh_m2:85.0 alloc_policy:ZERO_HEAP # --- PHYSICAL THERMAL ZONES --- (M) @THERMAL_ZONE id:ZONE_CONF_EAST volume_m3:450.0 thermal_cap_kj_k:1200.0 design_occupancy:35 (M) @THERMAL_ZONE id:ZONE_OPEN_OFFICE volume_m3:2800.0 thermal_cap_kj_k:6500.0 design_occupancy:120 # --- SAFETY & ENERGY CONSERVATION BARRIERS --- (B) @HYDRONIC_BARRIER id:BAR_AHU01_NO_FIGHT target_ahu:AHU_CENTRAL_01 min_deadband_k:1.5 max_valve_overlap_pct:0.0 (B) @IAQ_BARRIER id:BAR_CONF_IAQ target_zone:ZONE_CONF_EAST max_co2_ppm:800.0 min_outdoor_airflow_l_s:280.0 # --- CONTINUOUS AIR HANDLING UNIT (AHU) REGULATION --- (M) @AHU_REGULATION id:AHU_CENTRAL_01 mode:OCCUPIED sup_temp_c:14.2 static_press_pa:320.0 econ_damper_pct:42.5 # --- TERMINAL VAV ACTUATION SLATE --- (M) @VAV_TERMINAL id:VAV_EAST_101 zone:ZONE_CONF_EAST damper_pct:65.0 reheat_pct:0.0 air_flow_m3_h:1120.0 (M) @VAV_TERMINAL id:VAV_MAIN_102 zone:ZONE_OPEN_OFFICE damper_pct:40.0 reheat_pct:0.0 air_flow_m3_h:3400.0 # --- IN-SITU COMFORT & ENERGY TELEMETRY --- (T) @CLIMATE_OBSERVER id:TEL_ZONE_EAST zone_temp_c:21.8 rh_pct:44.2 co2_ppm:640.0 power_kw:14.2 ``` --- ## 6. Standards Compliance Matrix ``` ╔═════════════════════════════════╦══════════════════════╦═════════════════════════════════════════════════════╗ ║ Dimension │ Verification Standard│ Enforced Implementation Evidence ║ ╠═════════════════════════════════╬══════════════════════╬═════════════════════════════════════════════════════╣ ║ Zero-Overlap Energy Barrier │ ISO 52000-1 │ u_heat * u_cool == 0.0 enforced by CBF filter. ║ ║ Indoor Air Quality Safeguard │ ASHRAE 62.1 │ Ventilation airflow guarantees CO2 < 800 ppm. ║ ║ Thermal Comfort Bounding │ ASHRAE 55 │ PMV envelope bounds |T_zone - T_set| <= Delta_T. ║ ║ Embedded Zero-Heap Execution │ Freestanding Silicon │ Strictly bounded O(1) stack; zero malloc runtime. ║ ╚═════════════════════════════════╩══════════════════════╩═════════════════════════════════════════════════════╝ ```