Skip to Content
EnergiesEnergies
  • Feature Paper
  • Article
  • Open Access

8 April 2026

26 Pages

Overvoltage Elimination via Distributed Backstepping-Controlled Converters in Near-Zero-Energy Buildings Under Excess Solar Power to Improve Distribution Network Reliability

,
,
and
1
Departamento de Engenharia Eletrotécnica, Faculdade de Ciências Exatas e da Engenharia, University of Madeira, Campus Universitário da Penteada, 9020-105 Funchal, Portugal
2
Instituto de Engenharia de Sistemas e Computadores: Investigação e Desenvolvimento em Lisboa, INESC-ID, Rua Alves Redol, 1000-029 Lisboa, Portugal
3
Instituto Superior de Engenharia de Lisboa, Polytechnic Institute of Lisbon, Rua Conselheiro Emídio Navarro, 1959-007 Lisboa, Portugal
4
Departamento de Engenharia Eletrotécnica e de Computadores, Instituto Superior Técnico, University of Lisbon, Av. Rovisco Pais, 1049-001 Lisboa, Portugal

Abstract

This work uses battery-coupled power electronic converter systems and distributed backstepping controllers to improve the reliability of electrical distribution networks. The motivation is to prevent blackouts such as the 28 April 2025 outage in Spain, Portugal, and the south of France. It is now accepted that a rapid rise in solar power injections caused AC overvoltage above grid code limits, triggering photovoltaic (PV) park disconnections as overvoltage self-protection. This case study considers near-Zero-Energy Buildings (nZEBs) connected to the Madeira Island isolated microgrid, where PV power installation is increasing excessively. The main university facility will be upgraded as an nZEB, using roughly 3000 m2 of unshaded rooftops plus coverable parking areas to install PV panels. Optimizing the profits/energy cost ratio, a PV power system of around 560 kW can be planned, and the Battery Storage System (BSS) energy capacity can be estimated. The BSS is connected to the university nZEB via backstepping-controlled multilevel converters to manage PV and BSS, enabling the building to contribute to voltage and frequency regulation. Distributed multilevel converters inject renewable energy into the medium-voltage network, regulating active and reactive power to prevent overvoltages shutting down the PV inverters. This removes sustained overvoltage and maximizes PV penetration while augmenting AC grid reliability and resilience. When there is excess solar power and reactive power is insufficient to reduce voltage, controllers slightly curtail PV active power to eliminate overvoltage, maintaining operation with minimal revenue loss while preventing long interruptions, thereby improving grid reliability and power quality.

1. Introduction

Wide-area electrical energy interruptions lasting several hours, known as blackouts, are disruptive occurrences leading to major negative impacts on the economy, society and citizens’ lives [1]. The 28 April 2025 blackout in the Iberian Peninsula (Spain, Portugal), with the southwest of France experiencing interruptions of limited duration, was the most serious incident to occur in the European electrical power system in over 20 years [1]. The European Network of Transmission System Operators (ENTSO-E) report recognizes the need to include recommendations aimed at improving the reliability and resilience of the power system across Europe [1].
The ENTSO-E Factual Report “Grid Incident in Spain and Portugal on 28 April 2025” [1,2] states that at the start of the incident (12:32:00, CET Europe), the voltage in the Iberian 400 kV transmission system was below 420 kV and, therefore, within the limits established by the applicable standards. However, the report further states that after 12:32:57, disconnection events occurred due to overvoltage protection activation on the 220 kV side of a 400/220 kV transformer interlinking photovoltaic (PV), wind and thermo-solar generation facilities to the 400 kV transmission grid, whose voltage was 417.9 kV [1,2]. Further, at 12:33:16.460, an overvoltage of 435.4 kV led to several disconnections at the 400 kV level. These facts show that overvoltage happened at the 220 kV level and at the 400 kV level. Between 12:33:18 and 12:33:21, the voltage in the south of the Iberian Peninsula sharply increased despite the generation units dedicated to voltage control consuming reactive power to lower the voltage. ENTSO-E data on public net electricity generation in Spain in week 18 of 2025 show that the rapidly rising injection of solar power coupled to a midday load decrease might be the cause of the overvoltage that triggered the blackout (Figure 1) [2]. The rapidly rising solar power could not be compensated by the Spanish inductive and capacitive Static Synchronous Compensators (STATCOMs), nor by the synchronous generation (hydro and thermal) or pumping hydropower generators, as the needed setpoints are communicated by the Transmission System Operators (TSOs) to existing control plants. For voltage control, setpoints for generation or absorption of reactive power (generators, reactors, capacitors) and line manual connection or disconnection are based on the decisions of the operator, either based on experience or based on a static power flow simulation performed just before.
Figure 1. Rapid rise of solar generation and load decrease leading to the 28 April 2025 blackout [2].
The overvoltage triggered a cascade of PV generation losses. Consequently, the frequency of the Spanish and Portuguese power systems decreased. The power systems of Spain and Portugal lost synchronism with the rest of the European grid.
The ENTSO-E report recommends a review of national regulations (e.g., voltage regulation and voltage operational limits) of Distribution System Operator (DSO) protocols on voltage control, as, currently, voltage control mainly considers the operation of tap-changing transformers, their impacts, and the performance of generators regarding voltage regulation. The final report recommendation states that every generator should perform voltage regulation [3]. Therefore, new PV and wind generators with installed capacities exceeding 1 MW should be required to provide voltage/reactive power control, receiving real-time setpoints from Portugal Rede Elétrica Nacional (REN) and DSO operator E-Redes Supervisory Control and Data Acquisition (SCADA), as they have closed-loop voltage regulation on the high-voltage side for voltage control or reactive power control. However, renewable generation operators may be confused about the service, as it is usually not rewarded. Operators carrying out dynamic voltage control should receive compensation (pay as bid) for derating their active power. Portugal mainland grid reliability following the 28 April 2025 blackout was enforced, increasing natural gas power generation and hydropower production while decreasing energy imports from Spain. Overall, the penetration of solar power has been curtailed, while usage of problematic and costly fossil fuels has increased.
The Madeira Island microgrid (MGrid), in addition to nearly 200 MW of thermal generator sets (GenSets), includes 63 MW of wind power (160 GWh/year), hydropower capacity of 83 MW (66 GWh/year), pumped hydropower (28 MW, 160 MWh), PV power plants, and thousands of decentralized solar microgenerators (total power 27 MW, 33 GWh/year, with plans to expand to 90 MW, expected to exceed 110 GWh). It also comprises battery storage units (15 MW, 16 MWh). The increasing adoption of electric vehicles (EVs), together with the need to decarbonize the energy sector, has driven the deployment of distributed energy sources, namely solar and wind power [4,5,6]. The total installed PV power in the MGrid is approaching the peak power demand during solar hours. The goal in the future is to meet 50% of Madeira Island energy needs using PV, benefiting from installed reversible hydropower plants.
Although the MGrid is capable of addressing local power issues [7,8,9], thereby ensuring standard power supply, occasional short blackouts still occur, for which distributed PV generation may be a contributing factor.
Zero-Energy Buildings (ZEBs), also known as Net-Zero-Energy Buildings (NZEBs), represent a transformative approach to sustainable architecture and energy efficiency [9,10]. ZEBs are designed to generate as much energy as they consume annually through efficient building design and systems, including high-performance insulation, energy-efficient windows, and advanced Heating, Ventilation, and Air Conditioning (HVAC) systems [11]. Once energy consumption is minimized, renewable energy sources, such as PV panels or Hydrogen fuel cells, may be installed to achieve a near-zero-energy footprint. ZEBs play a critical role in reducing factors linked to climate change while promoting energy independence, aligning with global sustainability objectives such as the United Nations’ Sustainable Development Goals [11].
Despite the high initial costs, technological limitations and a shortage of skilled personnel, ZEBs are gaining global traction due to their environmental, economic, and social benefits. They help reduce carbon emissions, lower energy costs, and enhance energy security. However, upgrading existing buildings to ZEB requirements is more challenging and expensive than constructing new ones [12]. Due to this limitation, the existing University of Madeira main Building (UBuil) can accommodate PV installation of up to 640 kW peak on approximately 3000 m2 of readily available unshaded rooftops and covered existing parking areas. Assuming a 640 kW PV system may not fully meet the UBuild annual electricity demand, a near-zero-energy building (nZEB) approach may be considered, offering the advantage of a lower-investment alternative to the full ZEB concept [13]. Further improvements toward a ZEB can be explored, such as converting part of the internal electrical distribution network from AC to DC, potentially reducing electrical demand by nearly 6% [14].
The UBuil peak power consumption is slightly below 490 kW. Excess solar energy generated during peak solar hours must be stored for later use. A Lithium-ion (Li-ion) or Lithium–Iron–Phosphate (LiFePO4) battery storage system (BSS) should be considered to increase PV self-consumption, aiming to minimize the energy drawn from the MGrid distribution network [15]. Despite current challenges, in the near future, distributed energy storage in EVs could also supply electricity to buildings (Vehicle-to-Building—V2B) [16,17,18].
In addition to demand-side management of noncritical loads, the UBuil BSS management systems (BMSs) must ensure that UBuil maintains standards-compliant medium voltage (MV) levels at its point of common coupling (PCC) with the MV MGrid. Additionally, the BMS could contribute to MGrid frequency regulation [19,20] while maintaining BSS adequate levels of state of charge (SOC), contributing to energy cost minimization.
To interconnect the UBuil BSS with the MV level of the MGrid, power electronic converters are required, primarily multilevel converters, such as Neutral Point Clamped (NPC) switching multilevel converters [21]. The BSS, connected to the MV MGrid via NPC converters, can operate as AC virtual generators, performing frequency and voltage regulation, functions typically handled by GenSets. To regulate the frequency and voltage, the BESS virtual generator must be able to inject specific amounts of active and reactive power into the AC grid.
Regarding the ENTSO-E recommendations on voltage control, this study presents separated dynamics backstepping controllers to show that decentralized voltage regulation, performed in a distributed manner, without communication, at every renewable energy injection point, is an effective technique to prevent rapid overvoltage events that could disconnect PV parks and potentially cause blackouts.
Following the Introduction, Section 2 determines the PV peak power to be installed along with the battery storage capacity, based on nZEB requirements, available renewable energy sources, roof area, and storage technologies.
Section 3 details the backstepping controllers designed to minimize the electrical energy drawn from the MGrid, while providing local voltage regulation and frequency regulation assistance. The direct relationship between the backstepping controller and the converter nonlinear dynamics enables the identification of the control laws and the key quantities to be measured or estimated. Backstepping employs Lyapunov stability theory and a recursive approach, working from the system output toward the input, to create successive virtual control actions that ultimately determine the actual control input [22,23,24,25]. Based on the day-ahead forecasts of PV and building load profiles, the backstepping battery energy controller compares the battery energy with an estimated reference to determine the battery charging/discharging active-power average setpoint. Backstepping frequency regulation is also implemented to adjust the instantaneous NPC power, according to the MGrid squared frequency deviation. Local voltage backstepping regulation is included by measuring the UBuil PCC grid voltage, with the UBuil operating as an nZEB (nZEUbuil), and acting on the reactive/active power components. Applicable grid codes are also presented and implemented.
Section 4 presents and discusses the results obtained in the nZEUbuil case study. Simulations confirm battery energy reference tracking, demonstrating the storage of PV energy surplus and supply to the load when PV generation is unavailable. Frequency tests evaluate grid frequency regulation and the effects of coordinated distributed control of multiple buildings in mitigating frequency disturbances. Voltage tests assess PCC voltage regulation and compliance with relevant standards. Grid code tests verify the prescribed linear active/reactive power adjustments in response to deviations from nominal voltage. A comparison to artificial intelligence methods is also performed. Section 5 presents the main conclusions.

2. UBuil Constraints, PV and Battery Capacity for nZEB Operation

This section determines the PV peak power to be installed at UBuil and the battery capacity to achieve ZEB operation, as near as possible. To bring the building operation closer to a ZEB, PV generation and battery storage are considered the most favorable technologies, as the use of reversible hydropower and Hydrogen, although possible, would be prohibitive due to costs, distance, and applicable grid codes.
The UBuil location (32.659, −16.925) on Madeira Island has an average PV energy potential of 1346 kWh/year per kW of installed peak power (Table 1), based on data from the Photovoltaic Geographical Information System (PVGIS) and Surface Solar Radiation Data Set Heliosat (SARAH3).
Table 1. PVGIS-SARAH3 data for kWp fixed-angle crystalline silicon PV panels installed at UBuil (https://re.jrc.ec.europa.eu/pvg_tools/en/, accessed 25 March 2026).
January and December provide the lowest energy per kW peak (75 kWh and 70 kWh, respectively; Figure 2), while July and August approximately double these values (155 kWh and 150 kWh, respectively).
Figure 2. PVGIS-SARAH3 monthly energy output and yearly average (1346/12) produced per kWp.
The UBuil is equipped with an 800 kVA transformer. During class days, the load reaches a peak power of 489 kW, while nighttime demand can drop to 37 kW. The typical daily energy consumption on class days is 3.9 MWh. On Saturdays, the peak power reaches approximately 175 kW, with an energy consumption of about 1.9 MWh. On Sundays, the peak power is around 48 kW, with an energy consumption of approximately 1.1 MWh. The annual energy consumption of UBuil is slightly above 1 GWh.
To reduce to near zero the UBuil grid energy consumption, a PV system with a peak power of 800 kW would need to be installed, generating approximately 1.08 GWh/year, valued at 120 kEUR. However, there is insufficient unshaded roof area to accommodate such PV power, and the battery capacity required to store the excess energy generated during summer days would be approximately 5.5 MWh.
The 5.5 MWh battery would be excessively expensive, require substantial space and the project would have a payback period (PP) of 24 years, rendering the investment unprofitable even if 85% of the battery costs were subsidized. Given that the cost per kW of PV power is lower than the cost per kWh of battery energy, it is reasonable to consider installing additional PV capacity while reducing battery capacity. The objective is to meet the class-day energy demand (3.9 MWh/day) during months with the lowest PV availability—January, November, December when the available PV energy is minimal, at approximately 75 kWh/month/kW of installed peak PV power. The required peak PV power would exceed 1540 kW, which is not compatible with the available roof area, or the apparent power of the existing MV transformer. Moreover, assuming a battery capacity of 1.16 MWh, representing only 10% of the capacity required to store all excess PV energy, the payback period would be 8.2 years. Under this scenario, the annual energy costs of the UBuil operating as an nZEB would be reduced to approximately 20% of the costs without renewable generation. However, the battery lifetime [22] is estimated at only 10 years, rendering this solution impractical.
Considering the merit factor P r o f i 20 − P P / E C o s t n R Y , analogous to the net present value and expressed relative to the annual energy costs without renewables ECostnRY, over a 20-year period, to be defined as follows:
P r o f i 20 − P P E C o s t n R Y = 20   ( E C o s t n R Y   −   E C o s t n Z E B Y ) − I n v e s t E C o s t n R Y = ( 20   −   Y P P ) ( E C o s t n R Y   −   E C o s t n Z E B Y ) E C o s t n R Y
where P r o f i 20 − P P denotes the cumulative profit over 20 years, with annual profit defined as the difference between the annual energy costs without renewables ECostnRY and the nZEB annual energy costs E C o s t n Z E B Y . The investment is represented by I n v e s t , and Y P P denotes the payback period ( Y P P = I n v e s t / E C o s t n R Y − E C o s t n Z E B Y ).
This merit factor reaches a maximum within a relatively flat region between 550 kW and 580 kW of PV power (Figure 3). To reduce investment in PV, battery and installation, while using only the readily available, unshaded roof areas, a near optimum solution is to install approximately 560 kW of PV peak power (generating 724 MWh/year). This configuration requires a 2.9 MWh Lithium battery, connected to the UBuil network via three-phase 750 kW multilevel NPC converters. Assuming a forecast based on typical solar years, this system exhibits a payback period of 8.1 years when accounting for the costs of the battery, converters and PV installation. The annual energy costs of the nZEUbuil would be 53% of those without renewable generation, when only PV is used; the cost is further reduced to 31% when both PVs and battery storage are implemented. The battery lifetime is estimated to be slightly over 20 years. When only PVs are used, the cumulative profit over 20 years corresponds to 7.45-times the annual cost of non-renewable energy. When both PV and battery storage are implemented, the profit-to-cost ratio increases to 8.12. Despite these favorable economics, the motivation for implementing a BSS should extend beyond economic returns to include the provision of value-added services to the MGrid, such as local voltage regulation, therefore enhancing resilience and helping to prevent blackouts. Accordingly, for the nZEUbuil, it is planned to install 560 kW of PV peak power and a 2.9 MWh Lithium battery, connected to the UBuil network through three-phase 750 kW parallel multilevel NPC converters.
Figure 3. Merit factor P r o f i 20 − P P / E C o s t n R Y , as a function of installed PV power.

3. Backstepping Control Design for the nZEUbuil Power System

This section presents the design of a backstepping control system for the planned nZEUbuil. Multilevel NPC parallel connected converters, coupled with Lithium battery storage, are controlled to ensure that the stored energy tracks a reference value while maintaining the nZEUbuil voltage at the PCC within the grid code limits, even under extreme operating conditions. The battery-coupled NPC converters also manage the PV system electrical output to prioritize supplying the nZEUbuil loads with renewable energy, store excess PV energy in the battery for later use or feed it into the MV MGrid. Additionally, when sufficient energy is available or stored and voltages remain within grid code limits, the parallel NPC converters can assist in the frequency regulation of the MGrid. Furthermore, the battery coupled to the NPCs can function as an uninterruptible power supply (UPS) in the event of a grid failure, maintaining power until more GenSets are deployed.
The MGrid 60 kV voltage-level transmission grid is transformer-connected to the 6.6 kV MV distribution level, which in turn feeds the nZEUbuil transformer stepping down from 6.6 kV to the low voltage (LV) level 0.4 kV/0.23 kV. The nZEUbuil LV grid supplies the building loads and interfaces with the PV inverters as well as the NPC converters coupled to the battery bank. The NPC converters control system includes the energy management controller, the control of NPC converters active and reactive power for PCC voltage and frequency control, and the procedures necessary to enforce the grid code compliance.
Figure 4 presents the equivalent single-line diagram from the transmission grid transformer to the distribution network. The inductance LLMV and resistance RLMV represent a simplified model of the MV (6.6 kV) short distribution line to the PCC at the nZEUbuil entrance. Within the facility, the MV to LV substation transformer (6.6/0.4 kV), is modeled by the short-circuit LLLV inductance and resistance RLLV. The nZEUbuil loads, PV system with its solar inverters and battery-coupled NPC converters are also represented (Figure 4).
Figure 4. Simplified main electrical diagram of nZEUbuil.
The nZEUbuil energy management system employs backstepping controllers, hereafter designed to reduce the electrical energy drawn from the MGrid, while providing local voltage regulation and support for frequency regulation. The backstepping algorithm incorporates a 24 h ahead forecast of solar generation and building load profiles to determine the reference average battery power, PEBatV, for charging or discharging the battery to maximize the utilization of PV energy. The controller compares the measured battery energy with its reference value to set the battery charging/discharging active-power control action, maintaining the battery SOC preferably within the 20–80% range to extend battery lifetime. As the MGrid is an isolated microgrid, a backstepping-based frequency regulator is also presented. It modulates the reference average battery power, PEBatV, using the instantaneous power, PωBatV, to rapidly increase or decrease the battery charging/discharging rate as a function of the MGrid frequency deviation, thereby contributing to frequency regulation.
For local voltage regulation, the proposed backstepping voltage control measures the nZEUbuil grid voltage at the PCC and regulates the reactive power component, QV2BatV, of the NPC converter connected to the battery bank to help regulate the grid voltage.
Additionally, as the nZEUbuil includes PV generation, the applicable grid code requirements for voltage regulation must be implemented. These codes specify that when the voltage at the building PCC approaches upper or lower limits, the reactive power—QGCBatRef—must be absorbed or injected accordingly. When the voltage reaches the limits specified by the grid codes, active power injection from the nZEB UBuil must be adjusted by controlling the NPC converter output active power, PGCBatRef. If the battery is fully charged and the PCC voltage exceeds the permissible range, the active power generated by the PV system, PGCPVRef, must be curtailed.

3.1. Battery State-of-Charge Backstepping Controller

The backstepping controller for the battery state of charge is designed to control the time t-dependent battery energy, EBat(t), so that it tracks the reference battery energy, EBatRef(t) value, to be defined hereafter. Considering that the dynamic behavior of EBat(t) depends on the battery power, PBat(t), imposed by the NPC converter, it is written as follows:
d E B a t t d t = P B a t t  
The battery state-of-charge backstepping controller must define, as a virtual control quantity [23], the reference power PBatRef(t) to be applied by the multilevel NPC converter, ensuring that EBat(t) tracks the EBatRef(t) value. By defining the tracking error eEBat(t) in (3), the controller computes PEBatV(t), such that eEBat(t) converges to zero.
e E B a t t = E B a t R e f t − E B a t t
To compute the virtual control power PEBatV(t), consider a positive-definite, unbounded and continuously differentiable Lyapunov function [24], LEBat(t), defined in terms of the tracking error eEBat(t) as follows:
L E B a t t = e E B a t 2 t 2
Applying Lyapunov´s second method of stability [25], the LEBat(t) time derivative must be negative:
d L E B a t t d t < 0
For control purposes, this inequality can be conveniently replaced by one equality, assuming a negative definite quantity, such as −kEBat e2EBat(t), where the degree of freedom kEBat must be positive-definite (kEBat > 0). Accordingly, from the previous equations, it follows that
d L E B a t t d t = e E B a t t d e E B a t t d t = − k E B a t e E B a t 2 t
Enforcing the stability condition in (6) ensures that the tracking error eEBat(t) tends asymptotically to zero, meaning e E B a t t ≠ 0 ,   ∀   t ≠ ∞ . Consequently, the system dynamics can be represented by a first-order homogeneous differential equation with time constant 1/kEBat:
d e E B a t t d t = − k E B a t e E B a t t
By substituting the expression from (3) and (2) into (7)—a stability condition that holds when PBat(t) in (2) is equal to its virtual value PEBatV(t) (PBat(t) → PEBatV(t)) to satisfy (7)—the virtual control power PEBatV(t) can be obtained:
P E B a t V t = k E B a t e E B a t t + d E B a t R e f t d t
This represents a virtual control quantity, which can be applied by the BSS NPC converter only in the next switching period, due to the computation time of the NPC converter controller. As a result, the actual control quantity is applied in the subsequent pulse-width modulation period, introducing a small time delay Td [26]. The recursive backstep procedure yields an equation similar to (8) but with additional terms to mitigate the effect of the time delay, as detailed in [26]. The extra terms are proportional to Td; since the delay Td (on the order of tens of µs) is much smaller than the time constant 1/kEBat, the effect on the actual control input can be neglected. This backstepping design effectively separates the fast dynamics of the NPC converter and other fast-acting regulators, such as the local frequency regulator contribution, from the much slower dynamics of the battery charging or discharging process.
The reference battery energy EBatRef(t) in (8) is estimated as follows.

3.1.1. Reference Battery Energy Value, EBatRef(t), Defined as the Battery Power Time Integral

The battery energy estimator computes the reference state of charge, EBatRef(t), by integrating the reference battery power, PBatRef(t), from t = t1 to obtain EBatRef(t) at a given time t = t1 + T, where T is typically one day. The initial reference energy EBatRef(t1) in the battery is assumed to be known from previous estimates. Based on forecast profiles of the daily load and PV generation, the estimation uses a step-ahead forecast over T of the nZEUbuil load PBuilForcast(t), the PV production forecast PPVForcast(t), and the average microgrid exchange power PMGrid(t) (to be defined hereafter). The battery reference power PBatRef(t) is defined as the difference between the power entering the nZEUbuil and the load demand.
P B a t R e f t = P P V F o r c a s t t + P M G r i d t − P B u i l F o r c a s t t
Consequently, from (9), EBatRef(t) can be expressed as follows:
E B a t R e f t = ∫ t 1 t 1 + T P B a t R e f t   d t + E B a t R e f t 1                                           =   ∫ t 1 t 1 + T P P V F o r c a s t t + P M G r i d t − P B u i l F o r c a s t t   d t + E B a t R e f t 1
The value of EBatRef(t) is continuously updated, as the prediction is performed using a receding horizon. Accordingly, the prediction at time t is carried out from t1 = t + Δt up to T, at time t1 is updated from t2 = t1 + Δt up to T + Δt and so on, where Δt is the computation time step. Energy is stored in the battery when renewable generation exceeds the nZEUbuil consumption; conversely, the battery stored energy is supplied to the nZEUbuil or to the MGrid when PV generation is insufficient. The power exchanged with the MGrid is positive during periods of low PV generation and high nZEUbuil demand, or negative when the PV power exceeds the nZEUbuil consumption.

3.1.2. Average Microgrid Exchange Power PMGrid(t) Estimation

Considering the forecast PV energy generation EPV(t), over the next period T (usually one day ahead), the forecast nZEUbuil energy demand EBuil(t) obtained from the daily load profiles, and the variation in the battery stored energy ∆ EBat(t), all evaluated over the same period T, the MGrid power algorithm provides an approximate estimate of the microgrid energy, over the T period, EMGrid(t), required for the nZEUbuil operation, as given in (11).
E M G r i d t = E B u i l t − E P V t + ∆ E B a t t
The corresponding average power PMGrid(t) to be drawn from the MGrid over the next period T can be estimated over the same interval (T) considering that the energy is the integral of the power, yielding (12).
P M G r i d t = E B u i l t − E P V t + ∆ E B a t t T
The estimator of the MGrid average power computes the energy generated by the PV panels based on the solar irradiance forecasts at the nZEUbuil, while the energy consumption is obtained from the forecast UBuil load profile. Under steady-state operation, the variation in the battery energy over one day is generally sought to be zero to reduce energy costs.

3.2. Virtual Inertia Backstepping Controller Contributing to Frequency Regulation

The MGrid supplies a peak power of approximately 150 MW. The increasing integration of distributed PV energy sources within the MGrid is expected to reach 90 MW in the near future. Therefore, higher-power PV generators must incorporate algorithms to contribute to distributed frequency regulation, the most common being the curtailment of the injected PV power.
Spinning reserve, traditionally provided by centralized thermal power plants, is relatively reduced as the share of PV generation increases. To support the maintenance of adequate spinning reserve, the nZEUbuil must contribute to primary frequency regulation by operating as a virtual inertia source, thereby contributing to grid frequency regulation and providing distributed spinning reserve.
To contribute to frequency regulation through primary regulation, the nZEUbuil BSS NPC converter is controlled to operate as a virtual generator, whose dynamic equation is given by (13) [27].
d ω 2 t d t = − 2 D J ω 2 t + 2 J P P V t − P B u i l t − P B a t t
where J is the virtual inertia constant of the converter, D is its dynamic friction (damping) coefficient, ω(t) is the angular frequency of the MGrid, PPV(t) is the PV power, PBuil(t) is the nZEUbuil absorbed power, and PBat(t) is the battery power.
The backstepping frequency controller for the isolated microgrid adjusts the battery power, PBat(t), either positive or negative, so that the grid angular frequency ω(t) follows the reference frequency, ωRef (for a 50 Hz grid, ωRef = 2π50 rad/s). Considering the squared angular-frequency first-order linear dynamics in (13), the error between the squared ωRef and squared ω(t) is defined by (14).
e ω 2 t = ω R e f 2 t − ω 2 t
As in Section 3.1. “Battery state-of-charge backstepping controller“ a positive-definite Lyapunov function, Lω2(t), can be defined as L ω 2 t = e ω 2 2 t / 2 . Assuming k ω 2   > 0 and e ω 2 ≠ 0 , ∀   t ≠ ∞ , the resulting stability equation describes dynamics that tend asymptotically to zero with time constant 1/kω2:
d e ω 2 t d t = − k ω 2 e ω 2 t
Substituting the variables of (14) and (13) into (15), the battery virtual power, PωBatV(t), needed to support frequency regulation in the isolated microgrid is obtained in (16).
P ω B a t V t = − J k ω 2 2 e ω 2 t − D ω 2 t − J 2 d ω R e f 2 t d t − P B u i l t + P P V t
This battery power term can respond relatively fast to MGrid frequency deviations, in contrast to the relatively slower battery energy management term in (8). Distributed frequency regulation is implemented via droop control, to scale the battery power term (16) to each nZEB. The droop control contribution is then combined with the energy management term from (8).

3.3. Backstepping Regulator Contributing to Voltage Regulation

Distribution networks are traditionally designed for one-way power flow from transmission to medium and low voltage levels, with substations set slightly above nominal voltage to compensate for line and cable drops. The high penetration of distributed renewable generation complicates voltage regulation, as reverse power flow can increase voltages at high-impedance nodes, thereby imposing curtailment on renewable generation.
This section presents a distributed voltage controller for the nZEUbuil. It combines a voltage estimator, which sets the PCC reference voltage, with a controller that regulates the BSS-coupled NPC converter reactive power to support distributed voltage regulation.

3.3.1. Backstepping Estimation of Electrical Grid Reference Voltage

Distribution voltage at each PCC varies, as it depends on the magnitude and direction of active and reactive power flows. In this distributed scheme, the voltage-regulated nZEUbuil estimates its own PCC voltage reference to help steer feeder voltages toward nominal values.
Let VMGrid(t) denote the MGrid RMS AC voltage at the nZEUbuil PCC while VBuil(t) is the building RMS voltage. The quantity ∆VBuil(t) represents the RMS voltage difference between the MGrid and the nZEUbuil.
∆ V B u i l t = V M G r i d t − V B u i l t
To reduce steady-state errors while maintaining separated dynamics, a virtual variable, θ V V B u i l t , can be defined as the integral of the voltage difference between the grid voltage and the nZEUbuil voltage, as shown in (18).
θ V V B u i l t = ∫ ∆ V B u i l t d t
By taking the time derivative of (18) and substituting (17), the dynamics of the virtual variable θ VVBuil(t) is received in (19).
d   θ V V B u i l t d t = V M G r i d t − V B u i l t
Let θ V V B u i l R e f t denote the reference value of the virtual variable θ VVBuil(t). This virtual variable tracking deviation e θ V V B u i l t is defined as follows:
e θ V V B u i l t = θ V V B u i l R e f t − θ V V B u i l t
By computing the time derivative of (20) and substituting (19), the dynamics in (21) is obtained for the virtual variable tracking deviation e θ V V B u i l t .
d e θ V V B u i l t d t = d θ V V B u i l R e f t d t − V M G r i d t + V B u i l t
To guarantee the stability of the θ V V B u i l t dynamics, a positive-definite Lyapunov function, LθVVBuil(t), can be defined as L θ V V B u i l t = e θ V V B u i l 2 t / 2 . Assuming K θ V V B u i l   > 0, e θ V V B u i l ≠ 0 , ∀   t ≠ ∞ , and using (21), the resulting stability equation for the time derivative of the error e θ V V B u i l t   exhibits first-order dynamics that asymptotically converges to zero with time constant 1/ K θ V V B u i l :
d e θ V V B u i l t d t = − K θ V V B u i l   e ∆ V V B u i l t ⇒ d   θ V V B u i l R e f t d t − V M G r i d t + V B u i l t = − K θ V V B u i l   e θ V V B u i l t
From (22), the voltage virtual value, VBuilV(t), for the nZEUbuil voltage VBuil(t) can be obtained.
V B u i l V t = − K θ V V B u i l   e θ V V B u i l t + V M G r i d t − d   θ V V B u i l R e f t d t
Let VN denote the nominal RMS MGrid voltage at the PCC and define the reference voltage drop between the microgrid and the nZEUbuil, ∆VBuilRef(t), as given in (24):
∆ V B u i l R e f t = − V N − V M G r i d t
Similarly to (18), the reference value θ V V B u i l R e f t for the virtual variable θ VVBuil(t) is defined as follows:
θ V V B u i l R e f t = − ∫ V N − V M G r i d t d t
Substituting (25) into (23), and applying (17), (18), and (20), while simplifying, yields the nZEUbuil RMS reference voltage, VBuilV(t), as a function of the nominal voltage VN, as seen in (26).
V B u i l V t = K θ V V B u i l ∫ V N − V B u i l t d t + V N
This estimated virtual value VBuilV(t) serves as the setpoint for the battery-coupled NPC converter and is applied in the next switching period, as noted previously. The dynamics of this setpoint defines the nZEUbuil PCC voltage reference by regulating the reactive power through the NPC converter.

3.3.2. Backstepping Contribution for nZEUbuil PCC Voltage Regulation

The nZEUbuil RMS-voltage backstepping controller regulates the reactive power, QBat(t), of the battery-coupled NPC converter to steer VBuil(t) toward VBuilV(t). To linearize this control system, the dynamics of V2Buil(t) with respect to microgrid active and reactive power, load, and PV generation is considered, as shown in (27).
d V B u i l 2 t d t = 2   ω ( t )   V B u i l 2 t + 2 3 C − P B a t t − P B u i l t + P M G r i d t + P P V t                     +   2 3 C − Q B a t t − Q B u i l t + Q M G r i d t + Q P V t
In (27), ω(t) is the MGrid angular frequency, and C is the LC filter capacitance of the battery-coupled NPC converter. The active power balance equates the sum of the battery power PBat(t) and the nZEUbuil power, PBuil(t), to the sum of the MGrid active power PMGrid(t), plus the PV power, PPV(t). Consequently, the squared RMS voltage of the nZEUbuil primarily depends on the reactive powers, as shown in (28).
d V B u i l 2 t d t ≈ 2   ω ( t )   V B u i l 2 t + 2 3 C − Q B a t t − Q B u i l t + Q M G r i d t + Q P V t
The nZEUbuil squared-RMS-voltage backstepping controller regulates the reactive power, QBat(t), of the battery-coupled NPC converter to steer VBuil(t) toward the estimator-based reference VBuilV(t) in (26).
Define the tracking error e V B u i l 2 t between the nZEUbuil squared voltage reference V B u i l V 2 t and the squared nZEUbuil voltage V B u i l 2 t in (29) and assume the positive-definite Lyapunov function LV2Buil(t) defined as L V B u i l 2 t = e V B u i l 2 2 t / 2 .
e V B u i l 2 t = V B u i l V 2 t − V B u i l 2 t
To guarantee stability, the time derivative of LV2Buil(t), denoted L V B u i l 2 ˙ t , should be L V B u i l 2 ˙ t = − k V B u i l 2 e V B u i l 2 t   , with k V B u i l 2 > 0 . Substituting the quantities of (29) and (28) into the stability condition, the battery reactive-power reference QV2BatV(t), which contributes to the regulation of the nZEUbuil voltage VBuil(t), is received in (30).
Q V 2 B a t V t = − 3 C k V B u i l 2 2 e V B u i l 2 t + 3 C ω ( t ) V b u i l 2 t − 3 C 2 d V B u i l V 2 t d t − Q B u i l t           +   Q M G r i d t + Q P V t
By controlling the battery-coupled NPC converter reactive power (typically up to 30% of rated power), the nZEUbuil contributes to the PCC voltage regulation, meaning the algorithms can be used in distributed microgrid voltage regulation, keeping renewable generators connected.
If the reactive power is insufficient, the nZEUbuil must apply grid code requirements to coordinate active and reactive power injection/consumption using the battery-coupled NPC and the PV system, as discussed next.

3.4. Grid Codes and nZEUbuil PCC Voltage Regulation

Voltage regulation in distribution grids with renewables is more challenging because generation is dispersed, power flows can reverse, and PV output presents high variability. To keep customer voltages within ±10% of nominal value, VN, the isolated grid codes require self-consumption producers to control both active and reactive power through their converters.
If the PCC voltage is too high, producers should absorb reactive power to contribute to voltage reduction. If the reactive power tops the 30% limit for the reduction, the active power should be curtailed. Conversely, if the PCC voltage is too low, producers must inject reactive power to contribute to voltage rise.
The nZEUbuil should comply with grid codes by using the battery-coupled NPC converter and the PV system to support distributed voltage regulation in the MGrid.
According to grid codes, the battery-coupled NPC converter starts injecting reactive power when the MGrid voltage drops 5% below the nominal value, ramping up to 30% when the MGrid voltage reaches 8% below the nominal value. Conversely, the battery-coupled NPC converter begins absorbing reactive power when the MGrid voltage rises 5% above the nominal value, increasing absorption up to 30% when the MGrid voltage reaches 8% above the nominal. This reactive-power control action, described in (31), contributes to the nZEUbuil PCC voltage regulation.
Q G C B a t R e f t = − 0.3 Q N B a t V B u i l t < 0.92 V N 10 Q N B a t V N V B u i l t − 0.95 V N 0.92 V N < V B u i l t < 0.95 V N 0 0.95 V N < V B u i l t < 1.05 V N 10 Q N B a t V N V B u i l t − 1.05 V N 1.05 V N < V B u i l t < 1.08 V N 0.3 Q N B a t V B u i l t > 1.08 V N
To support voltage regulation, the grid code in (31) modifies the battery-coupled NPC converter reactive-power reference QGCBatRef(t) only when VBuil(t) deviates by more than ±5% from the nominal value and limits it to 30% of the nominal reactive power, QNBat, of the converter.
If reactive power alone is insufficient to regulate the PCC voltage, injected MGrid active power should be curtailed when the PCC voltage exceeds 8% above the nominal value. Additionally, PV active power should be disconnected at 10% above the nominal value, unless the battery is not fully charged. In the nZEUbuil, the battery-coupled NPC should support undervoltage by injecting active power when the PCC voltage falls 8% below the nominal value, ramping up to the NPC rated active power at −10%, as in (32).
P G C B a t R e f t = − P N B a t V B u i l t < 0.90 V N 50 P N B a t V N V B u i l t − 0.92 V N 0.90 V N < V B u i l t < 0.92 V N 0 0.92 V N < V B u i l t < 1.08 V N 50 P N B a t V N V B u i l t − 1.08 V N 1.08 V N < V B u i l t < 1.10 V N                 P N B a t                                                                   V B u i l t > 1.10 V N
For severe voltage deviations, when the PCC voltage exceeds 8% above the nominal value, the nZEUbuil supports voltage regulation by adjusting the battery NPC converter active-power reference PGCBatRef(t). To further assist PCC voltage regulation, the battery-coupled NPC can inject active power up to the maximum battery/converter power PNBat, to boost the PCC voltage, or absorb power by charging the battery up to PNBat to reduce the PCC voltage.
The nZEUbuil photovoltaic generation system also contributes to microgrid voltage regulation. When the grid voltage exceeds +8% of the nominal value, the nZEUbuil PV system supports voltage regulation by linearly curtailing the PV power, stopping generation at +10% above nominal, as specified in (33).
P G C P V R e f t = P P V R e f t V B u i l t < 1.08 V N 50 P P V R e f t V N 1.10 V N − V B u i l t 1.08 V N < V B u i l t < 1.10 V N 0 V B u i l t > 1.10 V N
The nZEUbuil PV system generates PPVRef(t) as a function of the solar irradiance while VBuil(t) remains below 1.08 VN. When the voltage exceeds 8% above VN, the PV power is linearly curtailed and stopped entirely at VBuil(t) > 1.1 VN. Applying this grid code to nZEUbuil, and to virtually all renewable sources, enables distributed voltage regulation while preserving power quality. For 5–8% deviations, voltage is regulated via reactive power only, avoiding active power curtailment. Active-power control is used only for deviations exceeding 8%.

3.5. nZEUbuil Global Diagram of Backstepping Controllers for Battery State of Charge, Frequency, Voltage Regulation and Grid Codes

Figure 5 illustrates the overall backstepping control system of the nZEUbuil. The control system comprises four main control blocks: (i) backstepping-based battery energy management to diminish the nZEUbuil net consumption toward zero; (ii) distributed backstepping-based frequency regulation for the MGrid; (iii) backstepping-based voltage regulation for the nZEUbuil; and (iv) the grid code enforcement blocks to mitigate large grid voltage variations by regulating the nZEUbuil reactive and active power.
Figure 5. Overall backstepping control diagram for the nZEUbuil.
The energy management backstepping controller uses one-day-ahead forecasts of load and generation to compute the average microgrid power PMGrid(t) using (12). Based on the energy balance, the battery energy reference EBatRef(t) is then estimated as in (10). This balance implies that the battery is charged during periods of PV surplus or low demand or discharged during periods of high demand or insufficient PV generation. Additionally, on sunny days with low load demand, the battery is discharged before sunrise to supply the load and export energy, thereby creating headroom for recharging from the anticipated PV surplus.
The backstepping controller determines the battery-coupled NPC power reference PEBatV(t) using (8), ensuring that the battery energy tracks EBatRef(t) in (10). This enables near-zero net consumption when PV is sufficient and, on sunny days, allows excess energy to be exported to the MGrid.
The backstepping frequency controller supports frequency regulation by setting the battery power reference PωBatV(t) using (16). In microgrids with high renewable penetration, spinning reserve should be distributed across multiple energy sources rather than centralized in large plants. Battery storage enables rapid bidirectional active power response, maximizing renewable use with minimal PV power curtailment.
The backstepping PCC voltage controller is essential for integrating a ZEB into a microgrid. The battery-coupled NPC converter enables local energy management, reduces feeder power exchange, and helps maintain voltage within grid code limits.
In microgrids with high penetration of distributed renewables and variable, demanding loads such as EVs, conditions can shift from high generation and low demand (leading to overvoltage) to low or zero generation (e.g., due to shading or nighttime conditions) combined with high demand (resulting in undervoltage).
In the proposed backstepping voltage control scheme, a voltage estimator computes the building PCC voltage virtual value VBuilV(t), as in (26), based on deviations from the nominal value. The backstepping controller then determines the battery reactive-power reference QV2BatV(t), as in (30), to drive the terminal voltage toward the virtual value. This approach will support distributed voltage regulation, limit voltage deviations, and reduce the need for renewable curtailment that would otherwise be required to prevent overvoltage.
The strict application of MGrid grid codes to the nZEUbuil helps maintain the PCC voltage within ±10%, particularly in extreme conditions. The algorithm monitors the PCC voltage: for deviations of 5–8%, the battery NPC converter injects QGCBatRef(t) as in (31), supplying up to 30% of its rated reactive power. If QGCBatRef(t) is insufficient, then for deviations of 8–10%, the algorithm also adjusts the battery active power via PGCBatRef(t), as in (32), to either raise or to lower the PCC voltage. Additionally, the active power of the PV system can also be curtailed using PGCPVRef(t), as defined in (33), to mitigate overvoltage.

4. Case Study Results and Discussion

This section presents simulations evaluating the proposed nZEUbuil backstepping controllers. The input and feedback signals for the backstepping controllers are sampled every 48 ms period (roughly 20 samples per second). Measured data are assumed to have less than 1% error (with noise filtering), while forecast data may exhibit up to 10% random variation.
Internal data representation uses the default double precision (IEEE 754) of Matlab R2018a. The primary source of tracking deviations arises from the day-ahead forecast uncertainties. Each quantity plotted hereafter contains 96,000 data points, corresponding to a sampling rate of 7.2 points per second.
Multi-day simulations verify battery energy tracking for energy management, ensuring PV energy is stored and later used to supply the load during periods without solar generation. Frequency regulation tests evaluate primary frequency support and the contribution of multi-building distributed frequency regulation. Voltage regulation tests assess PCC terminal voltage regulation and the benefit of multi-building distributed regulation in preventing PV-driven overvoltage. Grid code tests validate linear active/reactive power adjustments versus voltage deviation from nominal.

4.1. Performance of the Battery State-of-Charge Backstepping Controller

Battery state-of-charge performance is evaluated with an 8-day period (Sunday–Sunday) simulation of the nZEUbuil. Figure 6 shows the PV power PPV(t), building load PBuil(t), the estimated MGrid power PMGrid(t), the MGrid measured power PMGridMeas(t), and the battery charging power PEBatV(t).
Figure 6. Evolution over 8 days of the PV power PPV produced in the building, the power consumed in the building PBuil, the microgrid power PMGrid, the MGrid measured power PMGridMeas, and the battery power PEBatV.
On Sunday and Monday, PV generation exceeds demand, so the nZEUbuil exports power to the MGrid (about 150 kW on average on the first Sunday) and charges the battery during sunny hours, then supplies the load demand when there is no sun. Between 48 and 96 h (Tuesday–Wednesday), PV generation is insufficient and the nZEUbuil imports from the MGrid. From 96 to 120 h (Thursday), there is PV surplus again, while from 120 to 144 h (Friday), generation roughly matches demand. From 144 to 168 h (Saturday), PV generation is at its lowest; despite reduced load, the nZEUbuil still requires a small average energy import from MGrid. On the final Sunday, demand is far below PV, so the nZEUbuil exports energy to the MGrid.
The results illustrate the instantaneous power balance of the building: the combined power drawn from the MGrid, PMGridMeas(t), and the power generated by the PV panels, PPV(t), equals the sum of the power consumed within the building, PBuil(t), plus the power to charge the batteries, PEBatV(t). The measured MGrid power, PMGridMeas(t), is close to the estimated value PMGrid(t) and continuously varies to maintain the power balance.
Figure 7 shows the battery state of charge SOCBat(t) and its reference SOCBatRef(t). The simulations indicate that the backstepping controller successfully tracks the battery energy reference; over the 8-day simulation, the SOCBat(t) follows SOCBatRef(t).
Figure 7. nZEUbuil battery state of charge (SOC) and its reference with PV generation.
Before sunrise on the first Sunday, the battery discharges to supply the load and export energy, creating headroom to recharge from PV surplus; SOC swings the most, from approximately 15% to 70%. On Monday (24–48 h), the pattern is similar but with a smaller swing (~33%) because PV generation and load are more matched. On Tuesday–Wednesday (48–96 h), PV generation is below demand, so the battery charges from the MGrid early to keep the MGrid power roughly constant and then discharges during peak hours. On the remaining days, the battery discharges before sunrise to create headroom for midday PV surplus charging.
On days when PV generation matches or exceeds demand, the battery discharges early to create headroom and then recharges during high-irradiance periods when PV output exceeds the building load.
The results show that the backstepping SOC controller, using one-day-ahead forecasts, stores PV energy during high-generation periods for later use. On PV surplus days, the nZEUbuil exports power to MGrid; on low-irradiance days, the control system determines to import power from the MGrid. In isolated microgrids, ZEB buildings will reduce centralized generation and feeder loading, smoothing power flows and preventing line/cable overloads during both high-demand/low-generation and high-generation/low-demand periods.

4.2. Virtual Inertia Backstepping Controller Results Contributing to Frequency Regulation

To assess the backstepping frequency regulation using distributed primary active power, the response of the nZEUbuil controller is analyzed to deviations in grid angular frequency ω (ω = 2πf) from the reference, ωRef (ωRef = 2πfRef), with fRef = 50 Hz.
Figure 8 plots fRef and the MGrid frequency, f, over 5 s. At 18 s, f decreases dynamically by 0.6% relative to fRef. The backstepping controller contributes to frequency regulation by reducing battery charging power PωBatV(t), by approximately 1% of building nominal power, yielding the trace fBuil (Figure 8). This reduction has a negligible impact on the frequency deviation.
Figure 8. Distributed backstepping controller contribution to MGrid frequency regulation.
However, when multiple nZEBs equipped with the same backstepping controllers are deployed in a distributed manner—representing only 10% of the MGrid power—it is possible to reduce the frequency deviation to 0.4% (trace fTBuil, Figure 8), and the frequency asymptotically returns to the 50 Hz reference value.
Large-scale renewable generation distributed across buildings reduces reliance on large power plants that traditionally provide frequency regulation. The above results show that frequency can also be regulated using the distributed backstepping controllers, enabling further growth of distributed renewables, provided they are equipped with frequency regulation capabilities to support microgrid frequency, especially in isolated microgrids with low spinning reserve.

4.3. PCC Voltage Backstepping Controller Results Contributing to Voltage Regulation

The PCC voltage of the university nZEUbuil can vary significantly throughout the day, as it depends on the medium-voltage distribution grid voltage, power flow direction, and the levels of active and reactive power. Distribution voltage regulation is essential to keep deviations within ±10%. Overvoltage can occur, particularly in nZEBs located far from the substation, during periods of high renewable (typically PV) generation and low load. Conversely, undervoltage can be more severe at remote nZEBs when load is high and renewable generation is absent. To assess the backstepping voltage controller, its behavior is analyzed under these two worst-case voltage conditions.
Figure 9 shows the nZEUbuil voltage on the second day of the tests (Monday). Without backstepping control (curve PBuilW(t)), at about 15:00 (24 + 15 h), the terminal voltage exceeds the +10% threshold of nominal value due to high levels of distributed PV generation. After 22:00 (24 + 22 h), the voltage drops below −10% as a result of heavy demand, mainly from EV charging.
Figure 9. nZEUbuil voltage regulation results using only the reactive power.
With the backstepping controller, the 15:00 overvoltage is reduced by 2.6%, keeping it within ±10%, and the 22:00 undervoltage is increased by 3.3%, also bringing it within ±10%. This regulation is achieved by controlling the reactive power of the battery-coupled NPC converter, QV2BatV(t), which is limited to 30% of the nominal power by grid codes.
The backstepping voltage estimator continuously estimates the reference voltage VBuilV(t), decreasing it when the PCC voltage exceeds the nominal value and increasing it when the PCC voltage falls below nominal.
When backstepping voltage controllers are applied to several nZEBs (totaling 10% of the MGrid power) to achieve distributed voltage regulation, Figure 9 shows that the nZEUbuil terminal voltage decreases by about 5% at 15:00 and increases by nearly 9% at 22:00. This highlights the usefulness of backstepping voltage regulation in distributed renewable generation to prevent severe overvoltage and undervoltage events that, at large scale, can lead to blackouts, particularly in isolated microgrids.

4.4. Test of Grid Codes in Voltage Regulation

The isolated microgrid voltage grid code is designed to achieve distributed voltage regulation using the reactive power of PV converters of distributed renewable generation systems. This grid code defines two modes based on voltage deviation: for 5–8% deviations, voltage is regulated using reactive power (up to 30% of the rated power). If reactive power is insufficient, a second mode regulates voltage using active power, up to the nominal value, when deviations are between 8% and 10% of nominal grid voltage.
Figure 10 shows one-day results (from hour 24 to hour 48) of applying the grid code to the nZEUbuil. Without the grid code regulation directives, the MGrid voltage, VBuilW(t), exhibits over- and undervoltage exceeding ±10% of the nominal voltage VN. When grid code regulation is applied, the nZEUbuil voltage VBuil(t) follows VBuilW(t), maintaining deviations within ±5%.
Figure 10. nZEUbuil PCC voltage under grid-code-based voltage regulation using reactive and active power.
Around hour 35, the voltage exceeds +5%, so the battery-coupled NPC converter absorbs reactive power via QGCBatRef(t). From hour 37, when voltage reaches +8%, the battery also absorbs active power PGCPVRef(t) (charging), and the PV plant curtails output PGCPVRef(t) relative to the non-curtailed level PGCPVRefW(t). Overall, the grid code reduces RMS voltage by 3.3%, keeping it below the +10% limit.
When undervoltage exceeds 5% (after hour 44), the battery-coupled NPC converter injects reactive power to raise the PCC voltage. By hour 46, it also exports active power. Together, these actions raise voltage by about 3.9%, maintaining deviations within the ±10% limit.
The application of grid codes kept the nZEUbuil PCC voltage well regulated, maintaining it within the allowed ±10% deviation and preventing potential overvoltage or undervoltage. Reactive power provides effective voltage support, while active-power control may require PV curtailment, reducing generation. Battery storage mitigates this drawback by absorbing surplus energy and exporting active power when needed to boost MGrid voltage.

4.5. nZEUbuil Backstepping-Based Concurrent Energy Management and Frequency/Voltage Regulation Results

This section presents results from the full framework of backstepping-based battery SOC control, simultaneously achieving nZEB operation, MGrid frequency regulation and distributed PCC voltage control, all while enforcing grid codes.
The energy management, frequency, and grid code controllers (for voltage deviations above 8%) each individually provide an active-power reference for the battery-coupled NPC to regulate their respective outputs. Given their separate dynamics, these values are summed to obtain the total NPC active power, PBatRef(t) (Figure 5).
Reactive-power commands from the PCC voltage controller and the grid code (for 5–8% voltage deviations) are added to form the total reference QBatRef(t), Figure 5. In the concurrent test results shown in Figure 11, despite variable PV generation, SOCBat(t) tracks SOCBatRef(t), as it does in Figure 7. This indicates minimal coupling between voltage/frequency regulation and battery SOC management.
Figure 11. nZEUbuil battery SOCBat tracks SOCBatRef, under concurrent frequency and voltage regulation.
Figure 12a plots the MGrid frequency, and Figure 12b shows the nZEUbuil PCC voltage. Frequency, f, stays close to fRef, with deviations under 0.3%, confirming that a single nZEUbuil has a limited impact on improving frequency regulation and that concurrent energy/voltage control does not disturb the frequency regulation. The terminal voltage, VBuil, remains near the 230 V nominal, VN, with very small variations (1%).
Figure 12. MGrid frequency and nZEUbuil PCC voltage, with simultaneous regulation of nZEUbuil energy, frequency, and voltage: (a) microgrid frequency; (b) nZEUbuil voltage.
The nZEUbuil concurrent tests show that the backstepping SOC controller tracks its reference, looking one day ahead and keeping battery headroom to store PV surplus and discharge later; the MGrid energy import/export simply complies with the nZEUbuil energy balance. Adding backstepping-based frequency and voltage support introduces minimal coupling with SOC management, proving the validity of the separate dynamics assumption. A single nZEUbuil has limited frequency regulation impact, but several buildings acting together can provide meaningful frequency regulation while maintaining their battery SOC control. As feeder voltages vary with active and reactive powers at each PCC, battery-coupled NPC converters, steered by backstepping voltage control and grid code logic, can adjust reactive and active powers to mitigate over/undervoltage in a distributed way and reduce the risk of serious MGrid disturbances or blackouts.

4.6. Comparison with State-of-the-Art Artificial Intelligence Approaches

The proposed backstepping approach is compared to state-of-the-art artificial intelligence (AI) approaches [28]. The graph-adaptive multi-agent reinforcement learning (GAMARL) method in [28] uses only reactive power for voltage regulation. This AI method employs an exponential voltage deviation penalty function, EG. Therefore, GAMARL-EG strongly reduces the voltage violation count (NVC) to only 128 in 20 days, an improvement of over 80% regarding previously published similar AI methods [28]. GAMARL-EG outperforms previous artificial intelligence methods while minimizing line losses.
The proposed backstepping method is based on physics models and nonlinear control concepts to regulate battery SOC, line and voltage frequency, using both reactive and active power and energy storage. As these three degrees of freedom are used, a comparison of the proposed backstepping controllers to GAMARL-EG (one degree of freedom) is not straightforward. Using distributed backstepping-controlled nZEBs totaling 10% of the MGrid installed power, no voltage violations were registered (NVC = 0). For this test, simulations were made for 21 days. The days were selected during the maximum available solar power in the summer (7 days), in spring with maximum sun irradiance and still lower temperatures (7 days), and in winter (7 days with almost no sun). Without distributed voltage regulation, 1282 voltage violations were registered, with a maximum voltage deviation of 13.4%. Using the distributed backstepping control method (NVC = 0), the average voltage deviation was 1.2% (like GAMARL-EG), while the maximum voltage deviation was 9.5%, higher than GAMARL-EG at 5.8% but just under the 10% allowed in MV. Enforcing grid codes also enhanced the distributed backstepping control results further. However, the proposed backstepping controllers cannot minimize the line losses, as they only compensate voltage locally, not needing communications, and relying on distributed voltage and frequency compensation to ensure voltage and frequency compliance, as opposed to the communications-enabled global method GAMARL-EG.

5. Conclusions

This study uses battery-coupled NPC converters to improve the reliability of isolated electrical distribution grids, with significant penetration of renewable energy. Within the nZEB concept, the study proposed a cumulative profit over 20 years to annual non-renewable energy cost ratio, to determine a near-optimal value of PV power to be installed in the nZEUbuil. The battery capacity, needed to store the daily maximum available solar energy, was obtained using the daily PV energy forecast for a typical solar year. Then, this work proposed distributed backstepping controllers, which measure only local quantities (without communications) to reduce the electrical energy drawn from the MGrid and provide local voltage and frequency regulation. Applicable grid codes are also presented and implemented.
Case study simulations show that the battery SOC is well maintained between 15% and 70% despite strong PV generation and nZEB load variations, extending the battery lifetime beyond 20 years. The impact of the proposed distributed backstepping controllers on improving the reliability and resilience of isolated distribution grids can be quantified by a 30% reduction in frequency regulation disturbances, when using multiple backstepping distributed controlled nZEBs totaling 10% of the MGrid installed power.
Using the same distributed nZEBs power, the MGrid reliability is also improved, providing a 5% reduction to a 9% increase in voltage levels to maintain them within the applicable standards. This is a considerable achievement compared to grid codes applying only reactive power, which can adjust voltage levels by only ±3.5%. Comparing distributed backstepping control to AI-based methods reveals that the backstepping local controllers use more degrees of freedom (reactive power, active power and stored energy) to control energy storage, regulate frequency and voltage, while showing no voltage violations over 21 days considering worst-case scenarios. Additionally, distributed backstepping contributes to frequency regulation and battery SOC control. The state-of-the-art AI global methods use only one degree of freedom and can minimize line losses but still present dozens of voltage violations as they use just the reactive power for voltage regulation and are not designed for concurrent frequency regulation. Therefore, backstepping controllers, for the battery-coupled NPC converters in nZEBs, enable effective battery energy management and enhance microgrid frequency and voltage regulations, further increasing the reliability of isolated electrical grids.

Author Contributions

Conceptualization, J.D.B., L.R., A.M. and J.F.S.; methodology, J.D.B., L.R., A.M. and J.F.S.; software, J.D.B., L.R., A.M. and J.F.S.; validation, J.D.B., L.R., A.M. and J.F.S.; formal analysis, J.D.B., L.R., A.M. and J.F.S.; investigation, J.D.B., L.R. and J.F.S.; resources, J.F.S.; data curation, J.D.B., L.R., A.M. and J.F.S.; writing—original draft preparation, J.D.B., L.R. and J.F.S.; writing—review and editing, J.D.B., L.R., A.M. and J.F.S.; visualization, J.D.B., L.R. and J.F.S.; supervision, J.F.S.; project administration, J.F.S.; funding acquisition, J.F.S. All authors have read and agreed to the published version of the manuscript.

Funding

Work supported by national funds through Fundação para a Ciência e a Tecnologia, I.P. (FCT) under projects UID/50021/2025 (DOI: https://doi.org/10.54499/UID/50021/2025) and UID/PRR/50021/2025 (DOI: https://doi.org/10.54499/UID/PRR/50021/2025).

Data Availability Statement

The data presented in this study are available on request from the corresponding author due to the university and company privacy and legal reasons.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Grid Incident in Spain and Portugal on 28 April 2025, ICS Investigation Expert Panel Factual Report. 3 October 2025. Available online: https://eepublicdownloads.blob.core.windows.net/public-cdn-container/clean-documents/Publications/2025/iberian-blackout/entso-e_incident_report_ES-PT_April_2025_06.pdf (accessed on 10 December 2025).
  2. ENTSO-E, Public Net Electricity Generation in Spain in Week 18 2025. Available online: https://energy-charts.info/charts/power/chart.htm?l=en&c=ES&interval=week&year=2025&week=18&source=public (accessed on 5 January 2026).
  3. Grid Incident in Spain and Portugal on 28 April 2025, ICS Investigation Expert Panel, Final Report. 20 March 2026. Available online: https://eepublicdownloads.blob.core.windows.net/public-cdn-container/clean-documents/Publications/2025/iberian-blackout/Final%20Report%20on%20the%20Grid%20Incident%20in%20Spain%20and%20Portugal%20on%2028%20April%202025.pdf (accessed on 25 March 2026).
  4. Gregoratti, D.; Matamoros, J. Distributed Energy Trading: The Multiple-Microgrid Case. IEEE Trans. Ind. Electron. 2015, 64, 2551–2559. [Google Scholar] [CrossRef] [Scilit]
  5. Xiao, J.; Wang, P.; Setyawan, L. Implementation of Multiple-Slack-Terminal DC Microgrids for Smooth Transitions Between Grid-Tied and Islanded States. IEEE Trans. Smart Grid 2016, 7, 273–281. [Google Scholar] [CrossRef] [Scilit]
  6. Parhizi, S.; Lotfi, H.; Khodaei, A.; Bahramirad, S. State of the Art in Research on Microgrids: A Review. IEEE Access 2015, 3, 890–925. [Google Scholar] [CrossRef] [Scilit]
  7. Guerrero, J.M.; Chandorkar, M.; Lee, T.-L.; Loh, P.C. Advanced Control Architectures for Intelligent Microgrids—Part I: Decentralized and Hierarchical Control. IEEE Trans. Ind. Electron. 2012, 60, 1254–1262. [Google Scholar] [CrossRef] [Scilit]
  8. Al Sumarmad, K.A.; Sulaiman, N.; Wahab, N.I.A.; Hizam, H. Energy Management and Voltage Control in Microgrids Using Artificial Neural Networks, PID, and Fuzzy Logic Controllers. Energies 2022, 15, 303. [Google Scholar] [CrossRef] [Scilit]
  9. Lou, H.; Hsieh, S. Towards Zero: A Review on Strategies in Achieving Net-Zero-Energy and Net-Zero-Carbon Buildings. Sustainability 2024, 16, 4735. [Google Scholar] [CrossRef] [Scilit]
  10. Wang, Y.; Hu, B.; Meng, X.; Xiao, R. A Comprehensive Review on Technologies for Achieving Zero-Energy Buildings. Sustainability 2024, 16, 10941. [Google Scholar] [CrossRef] [Scilit]
  11. Directive (EU) 2024/1275 of the European Parliament and of the Council of 24 April 2024 on the Energy Performance of Buildings. Available online: https://eur-lex.europa.eu/eli/dir/2024/1275/oj (accessed on 12 December 2025).
  12. D’Agostino, D.; Zangheri, P.; Castellazzi, L. Towards Nearly Zero Energy Buildings in Europe: A Focus on Retrofit in Non-Residential Buildings. Energies 2017, 10, 117. [Google Scholar] [CrossRef] [Scilit]
  13. Kong, J.; Dong, Y.; Poshnath, A.; Rismanchi, B.; Yap, P. Application of Building Integrated Photovoltaic (BIPV) in Net-Zero Energy Buildings (NZEBs). Energies 2023, 16, 6401. [Google Scholar] [CrossRef] [Scilit]
  14. Jiang, K.; Li, H.; Ye, X.; Lei, Y.; Lao, K.; Zhang, S.; Hu, X. Energy Efficiency Evaluation and Revenue Distribution of DC Power Distribution Systems in Nearly Zero Energy Buildings. Energies 2022, 15, 5726. [Google Scholar] [CrossRef] [Scilit]
  15. Georgiou, G.; Nikolaidis, P.; Kalogirou, S.; Christodoulides, P. A Hybrid Optimization Approach for Autonomy Enhancement of Nearly-Zero-Energy Buildings Based on Battery Performance and Artificial Neural Networks. Energies 2020, 13, 3680. [Google Scholar] [CrossRef] [Scilit]
  16. Shams Ashkezari, L.; Succetti, M.; Jabœuf, R.; Tosco, P.; Brenna, M. Are Commercial EV Chargers Ready to Aid with Household Power Consumption? Electronics 2023, 12, 2065. [Google Scholar] [CrossRef] [Scilit]
  17. Porto Santo Island Energy Comes from Electric Cars. Available online: https://www.upsbatterycenter.com/blog/porto-santo-island-energy-electric-cars/ (accessed on 14 June 2023).
  18. Hu, K.-W.; Liaw, C.-M. Incorporated Operation Control of DC Microgrid and Electric Vehicle. IEEE Trans. Ind. Electron. 2016, 63, 202–215. [Google Scholar] [CrossRef] [Scilit]
  19. Guerrero, J.M.; Loh, P.C.; Lee, T.-L.; Chandorkar, M. Advanced Control Architectures for Intelligent Microgrids—Part II: Power Quality, Energy Storage, and AC/DC Microgrids. IEEE Trans. Ind. Electron. 2013, 60, 1263–1270. [Google Scholar] [CrossRef] [Scilit]
  20. Zhao, Z.; Yang, P.; Guerrero, J.M.; Xu, Z.; Green, T.C. Multiple-Time-Scales Hierarchical Frequency Stability Control Strategy of Medium-Voltage Isolated Microgrid. IEEE Trans. Power Electron. 2016, 31, 5974–5991. [Google Scholar] [CrossRef] [Scilit]
  21. Carrasco, J.M.; Franquelo, L.G.; Bialasiewicz, J.T.; Galvan, E.; Portillo Guisado, R.; Prats, M.A.M.; Leon, J.I.; Moreno-Alfonso, N. Power-Electronic Systems for the Grid Integration of Renewable Energy Sources: A Survey. IEEE Trans. Ind. Electron. 2006, 53, 1002–1016. [Google Scholar] [CrossRef] [Scilit]
  22. Choi, S.S.; Lim, H.S. Factors that affect cycle-life and possible degradation mechanisms of a Li-ion cell based on LiCoO2. J. Power Sources 2002, 111, 130–136. [Google Scholar] [CrossRef] [Scilit]
  23. Mazenc, F.; Bliman, P.-A. Backstepping design for time-delay nonlinear systems. IEEE Trans. Autom. Control 2006, 51, 149–154. [Google Scholar] [CrossRef] [Scilit]
  24. Kanellakopoulos, I.; Kokotovic, P.; Morse, A. Systematic Design of Adaptive Controllers for Feedback Linearizable Systems. IEEE Trans. Autom. Control 1991, 36, 1241–1253. [Google Scholar] [CrossRef] [Scilit]
  25. Khalil, H.K. Nonlinear Systems, 3rd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2002. [Google Scholar]
  26. Monteiro, J.; Pires, V.F.; Cordeiro, A.; Silva, J.F.; Pinto, S. Dual Three-Phase Four-Leg Multilevel Inverter with Backstepping Prediction for Unbalanced Low-Voltage Grids. IEEE Trans. Ind. Appl. 2025, 61, 6535–6546. [Google Scholar] [CrossRef] [Scilit]
  27. Barros, J.D.; Silva, J.F.A.; Rocha, L. Virtual Generator to Replace Backup Diesel GenSets Using Backstepping Controlled NPC Multilevel Converter in Islanded Microgrids with Renewable Energy Sources. Electronics 2024, 13, 4511. [Google Scholar] [CrossRef] [Scilit]
  28. Luo, F.; Wang, S.; Lv, Y.; Mu, R.; Fo, J.; Zhang, T.; Xu, J.; Wang, C. Domain knowledge-enhanced graph reinforcement learning method for Volt/Var control in distribution networks. Appl. Energy 2025, 398, 126409. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.