Coordinated Optimal Control of Household Air Conditioning and Battery Energy Storage

Household air conditioning is one of the largest and most temporally concentrated loads in the residential sector. In China, building-operation carbon emissions reached about 2.2 billion t, of which electricity-related emissions were 1.15 billion t; HVAC operation accounted for about 0.99 billion t, more than 45% of building-operation emissions. The load is seasonal and weather-driven, so it can stress the distribution network during heat waves and cold snaps. Since 2021, major Chinese provinces have introduced time-of-use (TOU) tariffs to move consumption away from high-load periods. For a household, the technical problem is not simply to switch the air conditioner off at peak price. The useful control lever is to shift energy in time using two storage mechanisms: the thermal inertia of the building and a battery energy storage system (BESS).

The control problem is constrained by comfort, equipment life, and battery degradation. A room can be pre-cooled or pre-heated before a high-price period, but the indoor temperature must remain within a comfort band. A battery can charge at low price and discharge at high price, but frequent charge–discharge cycling accelerates degradation. Air-conditioner compressors also suffer from rapid start–stop cycling. A practical controller therefore has to coordinate the air conditioner and the battery while limiting switching, rather than treating either device as an independent on–off load.

Why Air Conditioning and Storage Must Be Controlled Together

Air conditioning is a flexible load because the building stores sensible heat. In a residential building, the thermal storage capacity is smaller than in a commercial building, but it is still enough to shift part of the cooling or heating demand by tens of minutes. The air conditioner can therefore pre-cool before the peak tariff and reduce operation during the peak. The limitation is that the room temperature must not violate the comfort range, and the compressor should not be cycled rapidly.

Battery energy storage adds a second, faster storage layer. Instead of exporting or curtailing energy, the battery can absorb grid electricity at low tariff and supply the air conditioner at high tariff. Many residential and small commercial sites already have backup batteries, uninterruptible power supplies, or batteries coupled with rooftop photovoltaic systems. These units often have low utilization. Coordinated scheduling can increase their utilization without changing the hardware. The controller must decide when to charge, when to discharge, and when to let the air conditioner use grid electricity directly.

Fixed-speed and variable-frequency air conditioners behave differently in such a schedule. A fixed-speed unit operates at essentially constant electrical power when on, so the control variable is the on–off state. A variable-frequency unit can adjust compressor speed and therefore electrical power continuously within its operating range. The variable-frequency case has finer control, but it also requires a power model that relates compressor frequency to electrical input.

Receding-Horizon Optimization Model

The scheduling layer is formulated as a mixed-integer optimization over a horizon of \(W\) steps and embedded in a receding-horizon model predictive control (MPC) loop. At each control step, the controller minimizes the sum of electricity cost, battery operation and maintenance cost, battery degradation cost, and penalty terms for constraint slack. The objective is

$$ \min \sum_{k=0}^{W-1} \left[ U_k^{TOU} G_k + U^{Opx}(P_k^C+P_k^D) + U_k^{Deg}(P_k^C+P_k^D) + \rho(S_{k+1}^t+S_{k+1}^e) \right] $$

where \(U_k^{TOU}\) is the TOU price, \(G_k\) is the household grid purchase power, \(P_k^C\) and \(P_k^D\) are the battery charge and discharge powers, \(U^{Opx}\) is the battery operation and maintenance cost coefficient, \(U_k^{Deg}\) is the degradation cost coefficient, and \(S_{k+1}^t\) and \(S_{k+1}^e\) are slack variables for temperature and battery energy. The grid purchase is

$$ G_k = \max\left\{P_k(S_k^h+S_k^c)+P_k^C-P_k^D,0\right\} $$

where \(P_k\) is the air-conditioner electrical power, and \(S_k^h\) and \(S_k^c\) are binary heating and cooling states. The max operator prevents the model from assuming export to the grid. The battery degradation term is based on life-cycle cost \(R_N\), cycle life \(L_N\), and the usable energy window \(E_{max}-E_{min}\). It converts battery throughput into an economic cost, so the optimizer does not cycle the battery unless the tariff saving justifies the wear.

Thermal dynamics. The room is represented by a single-zone resistance–capacitance model. The discrete-time temperature update is

$$ T^r_{k+1}=\left(1-\frac{\Delta t}{RC}\right)T^r_k+\frac{\Delta t}{RC}T^{out}_k+\frac{\Delta t}{C}\frac{(S_k^h-S_k^c)P_k}{COP} $$

where \(T^r_k\) is the indoor temperature, \(T^{out}_k\) is the outdoor temperature, \(R\) is thermal resistance, \(C\) is thermal capacitance, \(\Delta t\) is the sampling interval, and \(COP\) is the coefficient of performance. For a fixed-speed unit, \(P_k\) is constant when the unit is on. For a variable-frequency unit,

$$ P_k=k_1 f_k+L_1 $$

where \(f_k\) is compressor frequency and \(k_1,L_1\) are gain coefficients. The comfort requirement is enforced as a soft constraint:

$$ T_{min}-S_k^t \le T^r_k \le T_{max}+S_k^t,\qquad S_k^t\ge0 $$

The slack variable \(S_k^t\) is heavily penalized, so the controller maintains the comfort band under normal conditions while avoiding infeasibility under severe disturbances.

Switching limits. Minimum dwell-time constraints prevent rapid cycling of the compressor and the battery converter. For a binary state \(S_k\) with minimum dwell time \(M\), the elementwise constraint

$$ S_{[k-M+1,k]} \ge S_{k-M}-S_{k-M-1} $$

forces the state to remain on for at least \(M\) steps after a switch-on. Analogous upper-bound constraints enforce the minimum off time. The same logic is applied separately to heating, cooling, battery charging, and battery discharging.

Battery dynamics. The stored energy follows

$$ E_{k+1}=E_k+\eta_C P_k^C\Delta t-\frac{P_k^D\Delta t}{\eta_D} $$

with state of charge \(SOC_k=E_k/E_{max}\). The operating constraints are

$$ 0\le P_k^C\le S_k^C P_{max},\qquad 0\le P_k^D\le S_k^D P_{max},\qquad S_k^C+S_k^D\le1 $$

$$ SOC_{min}-S_k^e \le SOC_k \le SOC_{max}+S_k^e,\qquad S_k^e\ge0 $$

where \(S_k^C\) and \(S_k^D\) are binary charge and discharge states, and \(S_k^e\) is an energy slack variable. The complementarity constraint prevents simultaneous charging and discharging. At each MPC step, the measured room temperature and battery energy initialize the model:

$$ T^r_0=T_t^m,\qquad E_0=E_t^m $$

Only the first control move is applied to the physical devices; the horizon then shifts forward and the optimization is repeated. This feedback structure compensates for forecast error and model mismatch.

Laboratory IoT Implementation

The laboratory system is organized around an Internet of Things (IoT) communication layer that combines Modbus-RTU and TCP/IP. The energy management platform, battery storage system, air conditioner, and temperature sensors are distributed nodes. The battery management system (BMS) reports state of charge and inverter status. Indoor temperature sensors report room conditions. A weather service supplies an outdoor temperature forecast. The platform solves the MPC problem and sends commands to the air conditioner and the battery converter.

Battery energy storage unit for household load shifting
A battery energy storage unit used to shift household air-conditioning demand from peak to off-peak periods.

The air conditioner is a KFR-72GW fixed-speed unit with rated cooling input of 2.35 kW and rated heating input of 2.95 kW. A smart electricity meter monitors its actual power. The measured power was close to the rated value, so the fixed-speed unit was represented as a constant-power load in the optimization tests. Program control is provided by an RS-KTC-N01 remote controller. The controller learns the infrared commands of the air-conditioner remote and converts Modbus-RTU commands into infrared signals, which allows the platform to set operating modes and on–off states remotely.

Two indoor temperature sensors are placed at different positions, and their readings are averaged. The sensors include an RS-WS-ETH-6 temperature–humidity sensor and an SHT35 module connected to a Raspberry Pi through I2C. The battery storage cabinet uses a GoodWe low-voltage solution with LX U5.4-L modules and a GW5048D-ES converter. Each module is rated at 2.3 kW/5.4 kWh. Although the cabinet can hold four modules, the laboratory test used one module; the optimization model used a 5.3 kWh rated energy and a 2.3 kW power limit.

The outdoor forecast is obtained from a commercial weather API. The platform requests a 24 h forecast each control cycle and interpolates the hourly data to the 5 min control step. The energy management platform is implemented in Python and integrates a graphical user interface, multithreading, TCP/IP communication, and power-system simulation. It displays device states and sensor data in real time, logs operating data, and hosts the optimization and control logic.

Parameter Identification and Test Conditions

The RC parameters were fitted by least squares using measured room temperature, outdoor temperature, and air-conditioner operating states. The fitting data covered 25–31 July and produced 2,016 data pairs. The identified values were \(R=0.0034\ \mathrm{^\circ C\,W^{-1}}\) and \(C=3.5456\times10^6\ \mathrm{J\,^\circ C^{-1}}\). On a separate day, the model gave a mean squared error of 0.0824 and a temperature prediction error within \(\pm0.14\ \mathrm{^\circ C}\).

The tariff case follows Hubei Province’s residential high-consumption tariff for 2020–2022, with a base price of CNY 0.86/kWh. The optimization tests used a constant \(COP\) of 1. The summer simulation used a cooling comfort band of 24–28 °C. The winter field test used a heating comfort band of 20–24 °C. The battery state of charge was constrained to 20–80%, starting from 70%. The mixed-integer program was solved with YALMIP and CPLEX on a standard desktop computer. Table 1 lists the main test parameters.

Parameter Value used in the tests
Control interval 5 min
MPC prediction horizon 90 min
Battery rated energy / power 5.3 kWh / 2.3 kW
Battery SOC range / initial SOC 20–80% / 70%
Charge and discharge efficiency 90% each
Minimum battery charge/discharge time 30 min
Battery cycle life / life-cycle cost 3,500 cycles / CNY 10,000
Base electricity price CNY 0.86/kWh
Comfort band, cooling / heating 24–28 °C / 20–24 °C
COP in the optimization tests 1

Simulation and Field Results

In the summer simulation, the coordinated fixed-speed air-conditioner and battery case showed clear pre-cooling and pre-charging before the high-price period. At the peak tariff, grid purchase was 0.9 kWh, or 59.1% of the independent air-conditioner case. At the valley tariff, grid purchase rose to 129.2% of the independent case, which is the expected arbitrage behavior: the system buys more low-price electricity to reduce high-price consumption. The coordinated case also reduced air-conditioner starts by 5.9% relative to independent operation. The daily electricity saving was about CNY 2.8. Against a battery cost of CNY 10,000, the simple payback was about 9.8 years, before replacement and tariff changes.

The variable-frequency case used smoother power adjustment. At the peak tariff, grid purchase was 1.36 kWh, or 93.1% of the independent fixed-speed case. The daily battery degradation cost fell to CNY 0.68, and air-conditioner starts were 17.09% lower than in the fixed-speed MPC case. In the simulation comparison, total electricity cost fell to 83.94% of the independent air-conditioner case. Under a sudden outdoor-temperature change, the controller still used pre-cooling before the high-price period and kept the room within the comfort band. Table 2 summarizes the main comparison metrics.

Case Peak-price grid purchase Relative to independent fixed-speed air conditioning Air-conditioner start reduction Battery degradation cost
Fixed-speed air conditioner + battery storage 0.9 kWh 59.1% 5.9% Not reported separately
Variable-frequency air conditioner + battery storage 1.36 kWh 93.1% 17.09% versus fixed-speed MPC CNY 0.68/day

The winter field test used a March day in the laboratory environment. The outdoor temperature varied over the day, while the indoor temperature remained within the 20–24 °C comfort band. Before the high-price period, the air conditioner pre-heated the room; during the high-price period, its operating frequency dropped. The battery charged during low-price periods and discharged during high-price periods. The measured electricity cost was 13% lower than independent air-conditioner operation. The switching constraints were respected in the physical system, so the compressor did not cycle rapidly even though the controller was responding to price and temperature signals.

The field data also exposed differences from simulation. The physical room experienced disturbances that the single-zone RC model did not fully capture, so the indoor temperature fluctuated more and the air conditioner started more often than in the simulation. Despite this, the field test preserved the main intended behavior: pre-conditioning before peak price, battery arbitrage, and comfort maintenance. The battery state of charge and power traces showed the same low-price charging and high-price discharging pattern as the simulation.

Engineering Implications and Limits

The implementation shows that coordinated air-conditioner and battery control can be built from commercially available IoT components, a low-voltage battery cabinet, a programmable infrared controller, and a weather API. The MPC layer does not require a custom battery or a custom air conditioner; it requires state measurements, a power model, a thermal model, and a communication path to the devices. This is important for retrofitting existing residential systems, where the battery may already exist for backup or photovoltaic self-consumption.

The economics are more sensitive than the control logic. A simple payback of about 9.8 years for a CNY 10,000 battery is long for many households, and the result depends on battery price, cycle life, tariff spread, and the amount of energy shifted. The variable-frequency case reduced battery degradation cost and compressor starts, but its peak-price grid purchase was higher than the fixed-speed coordinated case in the reported comparison. The choice between fixed-speed and variable-frequency equipment therefore affects both comfort and the optimal battery schedule.

The model has several boundaries. It uses a single-zone RC representation, a constant COP in the optimization tests, and one laboratory battery module. The field evidence comes from a laboratory environment and a winter heating case, while the summer cooling results are simulation-based. Rooftop photovoltaic generation, demand charges, and multi-zone residential layouts are outside the present model. These limitations do not change the main conclusion: with switching constraints and battery degradation in the objective, air-conditioner pre-conditioning and battery energy storage can be coordinated to reduce household electricity cost while maintaining comfort and limiting equipment wear.

Scroll to Top