A Hybrid LSTM–PPO–RBC Edge Controller for Building HVAC: Sim-to-Real Validation on a Raspberry Pi 4
Siow Wan Soon, Subarmaniam Kannan, Sumendra YogarayanDeep reinforcement learning (DRL) controllers for heating, ventilation and air conditioning (HVAC) are rarely deployed on real edge hardware or evaluated across climates, and published DRL-HVAC studies seldom report a physical deployment. The contribution here is integration rather than a new algorithm: we build an end-to-end Sim-to-Real deployment of a recurrent proximal policy optimisation (PPO) agent, whose policy network contains a long short-term memory (LSTM) core and is supervised by a rule-based safety shield via the Simplex architecture on a Raspberry Pi 4 and ESP32 edge stack. The recurrent policy is trained once on a Kuala Lumpur EnergyPlus/Sinergym profile of the five-zone VAV archetype and then evaluated without retraining on five further climate profiles (New York, Tokyo, Egypt, Iceland and Saudi Arabia), reaching a comfort-zone compliance rate (CZCR) of 100.00% on New York and Kuala Lumpur, 99.50% on Tokyo, 99.65% on Iceland, 97.24% on Saudi Arabia and 93.50% on Egypt (single-run training). A ten-seed re-run on the training climate confirms 100.00% CZCR and 0 violations in every seed, with energy varying by a 2.3% coefficient of variation (mean 29,332.68 ± 673.30 kWh). The cross-climate transfer figures above remain single-run. A matched-climate PPO baseline, retrained directly on Kuala Lumpur rather than zero-shot transferred from New York, also reaches 100.00% CZCR at 13.2% less energy than the hybrid, showing that the hybrid’s energy premium on this climate is larger, not smaller, once the training climate confound in the original baseline comparison is removed. A two-sided safety shield (23.2–25.8 ∘C triggers) is shown, against an archived upper-bound-only configuration, to reduce overcool violations from 4124 (88.20% CZCR) to zero on the same climate. On a physical benchtop hardware-in-the-loop (HIL) testbed, three repeated 30 min trials, selected post hoc as the cleanest window from each of three evening sessions (the same three sessions’ full-length CZCR values are 98.02%, 97.22%, and 91.50%), record a 100.00% CZCR within the selected windows and a predicted mean vote (PMV) of 0.043 ± 0.023, and the system self-heals from a 12 min 42 s router outage with a +0.06 ∘C thermal drift. On-device inference takes 112.9 ms on the Raspberry Pi 4 (n=1392 logged invocations, with 95th/99th-percentile latency of 116.3 ms/120.4 ms), roughly four orders of magnitude below the 15 min control step. A separate set of three trials, bracketed by the testbed’s own “30 min Test” start/end log events rather than selected after the fact, records a lower but more representative 86.42–92.59% CZCR (aggregate 90.12%). These are benchtop feasibility results from a single disclosed training run and a short physical trial. They represent a step toward narrowing, rather than a closed, Sim-to-Real and edge deployment gap in practical DRL-HVAC.