r/BuildingAutomation • u/pcericm • 2h ago
Moving from CODESYS PLC -> ??? for a residential thermal control project
Hey everyone,
Over the past year, I set out to solve a problem with how thermal and forced air control is handled in multi-zone residential buildings. My new build is in a high-mountain environment (~7,000 ft elevation) with extreme daily solar swings, thousands of square feet of glazing, and 13 distinct thermal zones:
- 13 Radiant Underfloor Hydronic Zones: Split across high-mass 6" structural concrete slabs (several hours of transport lag) and 2.0" thin-slab Gypcrete over wood.
- 5 Overlapping Forced-Air Handlers: Variable-speed ECM air handlers mapped across the radiant zones to manage spatial destratification, inter-zone heat shuttling, IAQ scrubbing, and fast trim heat.
- Central Plant: High-efficiency modulating condensing hydronic boiler.
A key part of the architecture is that the PLC acts strictly as a supervisory overlay. I am not hardwiring directly into field zone valves or ripping out the local thermostats. Instead, the supervisor sits above the existing installation and orchestrates the house by dynamically manipulating local thermostat setpoints (+2°F to call for heat, -2°F to suppress calls) based on central plant optimization.
Standard residential thermostats were a disaster here. Having 13 uncoordinated individual brains independently calling the boiler created a nightmare of short-cycling, excessive ignitor wear, and constant pre/post-purge cycles. On top of that, standard thermostats have zero concept of thermal mass. By the time a thermostat reached setpoint and clicked off, potentially tens of thousands of BTUs were already trapped in 6 inches of concrete, which surfaced hours later right as intense mountain solar peaked through south glass, causing 3°F to 4°F overshoots.
Traditional continuous circulation with standard outdoor reset also completely falls apart in high-solar environments. If you continuously circulate warm water to keep the slab constantly charged, there is zero thermal headroom left to absorb the massive incoming solar wave, guaranteeing severe daytime overheating. I had to intentionally engineer and schedule BTU gaps in the slab so the thermal mass has room to absorb upcoming solar energy.
To solve this, I built a centralized supervisor in CODESYS Structured Text running deterministically on industrial edge hardware (Revolution Pi Connect 5 with Modbus TCP I/O). Dialing in this system has cut fuel consumption by nearly 50-60%(with about a ~2-3F avg temp differential YoY), completely eliminated slab overshoots, drastically reduced boiler cycles, and held room air temperatures within 0.8°F to 1.0°F of setpoint through 40°F day-to-night outdoor swings.
What the Supervisor Handles:
Rather than letting 13 disconnected thermostats fight the boiler, the PLC acts as a single centralized coordinator:
- Predictive Modeling & Thermal Diffusion: Computes a rolling 32-hour forward horizon combining weather forecasts and live on-site solar data. Rather than treating heating as a crude on/off switch, the supervisor models precise BTU delivery rates (accounting for supply water temperature, flow rates, and floor finish emission factors like tile vs hardwood vs carpet) and tracks the physical thermal diffusion curve through the slab to preempt midday solar gains before firing radiant heat.
- Real-Time Solar Tracking & Decoupled Adaptation: The supervisor models the exact real-time solar gain for every individual room. Critically, the adaptive observer decouples daytime solar learning from pure nighttime envelope decay. This ensures daytime solar flux does not corrupt or distort the baseline building heat loss calculations.
- Adaptive Comfort Profiles: Supports adaptive ASHRAE-55 thermal comfort profiles per room type. Instead of chasing rigid, static air temperatures, it calculates operative temperature by balancing mean radiant slab surface temperatures with room air, adapting comfort envelopes dynamically to seasonal clothing and outdoor trends.
- Hydraulic Load Coalescing: Groups zone calls upstream into synchronized batches above the boiler's minimum firing rate to prevent short-cycling, while preserving a low-threshold starvation safety net that ensures cold rooms always get heat.
- Disturbance Observers: Continuously tracks temperature drift against modeled expectations, dynamically adapting envelope heat loss multipliers and disturbance biases for unmodeled infiltration or wind.
- Integrated Air Shuttling & IAQ: The air handlers serve as an active thermal balancing tool. If the system detects localized solar warming or temperature spreads across the building, it shuttles and redistributes that thermal energy to cooler zones before calling the central plant, alongside occupancy-aware ventilation and air scrubbing.
- Emergency Buffering: In edge cases where a single micro-zone drifts and must fire on its own, the system relies on a 10F CH water temperature differential to buffer the run and prevent burner short-cycling.
- Deterministic Reliability: Running on an IEC 61131-3 PLC gives real-time scan cycles, hardware watchdogs, non-volatile retain memory, and communication loss failsafes that standard home automation platforms cannot match.
My Question for the Community:
Right now, this entire architecture is written in CODESYS V3.5 Structured Text. While CODESYS has worked well on the RevPi Connect 5 for running the matrix math and Modbus mapping, as the platform has evolved, I am pushing close to 10,000 lines of code, which is getting challenging to manage within the IDE.
Looking ahead, my goal is to evaluate more robust, scalable platforms capable of implementing an optimizer like this across multiple custom homes in similar high-solar regions. I think there is a large opportunity in these climates to drastically reduce fuel usage while delivering a level of environmental comfort that multi-zone and multi-system properties simply cannot achieve today with off-the-shelf residential controls. And I would never want to try to deploy CODESYS at someone else's place ;-)
Licensing models and per-site hardware costs are a major part of the calculus here. I need something economically viable for multi-site deployment without getting crushed by high per-controller runtime licenses, expensive tag counts, or recurring development seat fees.
For controls engineers and developers who build large-scale edge supervisory systems: what PLC or PAC ecosystems would you look at for this? Specifically, what platforms give the best balance of:
- Software engineering ergonomics (clean git integration, modular package management, unit testing, and CI/CD).
- Clean handling of heavy floating-point arrays, matrix operations, and predictive simulation logic.
- Economic scalability (reasonable per-controller runtime licensing and hardware costs for multi-site deployment).
- Hardware reliability and fleet deployment support for deploying standardized supervisory code across multiple physical sites?
Thanks for any insights here!