Preprint
Concept Paper

This version is not peer-reviewed.

PEAR-EMS: APhysics-Embedded Adaptive Reinforcement Learning Framework for Resilient Renewable—Electric Vehicle Microgrids and Its Real-Time Experimental Setup Proposal

Submitted:

16 October 2026

Posted:

19 October 2026

You are already at the latest version

Abstract
Renewable–electric vehicle (EV) microgrids must coordinate intermittent generation, stationary storage, uncertain demand, and flexible but service-constrained EV charging or battery swapping. These challenges are amplified in weak grid and off-grid settings, where data may be scarce, grid interruptions frequent, and operational decisions must respect battery, converter, reserve, and service constraints. This paper proposes PEAR-EMS, a Physics-Embedded Adaptive Reinforce ment Learning framework for energy management in resilient renewable–EV microgrids, together with a real-time experimental setup for future validation. PEAR-EMS combines a physics based microgrid model, state- and context-aware reinforcement learning, an adaptive constraint-handling mechanism, and a model-predictive safety filter. The physical model embeds energy balance, storage dynamics, conversion limits, renewable avail ability, grid outages, and EV energy-service requirements into the agent’s observations, action projection, and reward/constraint structure. The adaptive layer adjusts policy exploration and operating margins in response to forecast uncertainty, battery state, and detected distribution shift. A proposed controller in-the-loop / hardware-in-the-loop testbed comprises a real time digital simulation or real-time simulator, a programmable controller or industrial computer, PV and battery emulation, bidirectional EV/charger emulation, grid-interface and protection emulation, measurement and communication interfaces, and a supervisory logging platform. The manuscript defines the mathematical formulation, controller architecture, experimental scenarios, comparison baselines, evaluation metrics, and repro ducibility protocol. It does not claim experimental results: the proposed architecture and test plan require implementation and empirical validation before performance or safety claims can be confirmed. The intended contribution is a transparent route from physics-informed learning to real-time evaluation for renewable EV microgrids in data-constrained environments.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

Microgrids that combine photovoltaic (PV) generation, stationary battery energy storage, and electric-vehicle charging or battery-swapping services can improve local use of renewable energy and provide flexible electricity services. Their operation is nevertheless difficult because renewable output and demand vary over time, EV arrivals and requested energy are uncertain, storage has finite energy and power capability, and grid availability may be intermittent. An energy management system (EMS) must balance operating cost and emissions against service quality, equipment limits, and resilience.
Rule-based controllers and mathematical optimisation provide interpretable operating policies, but their performance can degrade when forecasts are inaccurate or operating conditions change. Model predictive control (MPC) can incorporate constraints and forecasts, although its effectiveness depends on model fidelity, forecast quality, and computational resources. Reinforcement learning (RL) offers a data-driven means of adapting dispatch policies to uncertain and sequential operating conditions. However, unconstrained RL can propose unsafe actions during training or deployment, and learned policies may generalise poorly when the system moves beyond its training distribution. A practical EMS therefore needs to combine the adaptability of RL with explicit physical constraints, supervisory safety mechanisms, and an experimental route to verification.
This paper proposes PEAR-EMS, a Physics-Embedded Adaptive Reinforcement Learning framework for resilient renewable–EV microgrids. The framework is designed around four principles: (i) the physical dynamics are represented explicitly rather than treated as an opaque environment; (ii) the learning policy is conditioned on operating context and uncertainty; (iii) a constraint supervisor checks or projects candidate actions before execution; and (iv) performance is evaluated using reproducible simulation and real-time controller-in-the-loop or hardware-in-the-loop (HIL) tests.
The paper is a methodology and experimental-protocol proposal. It does not report completed real-time experiments or measured performance. The proposed contributions are:
  • A physics-embedded RL formulation for joint PV, stationary storage, grid, and EV-service management.
  • An adaptive decision architecture that couples uncertainty-aware policy updates with a model-based safety filter.
  • A real-time experimental setup proposal, including interfaces, test scenarios, baselines, metrics, and a reproducibility protocol.
  • A validation plan that separates nominal performance, constraint satisfaction, resilience under disturbances, and computational feasibility.

3. System Description

3.1. Microgrid Architecture

The target system consists of a PV plant, stationary battery energy storage system (BESS), bidirectional or unidirectional power-conversion interfaces, an EV charging or battery-swapping load, a local demand, and an optional utility-grid or dispatchable backup interface. A diesel generator may be included in a case study where it represents the local system, but it is not required by the core framework. The EMS operates at discrete time steps of duration Δ t .
Let the controllable power vector be
u t = P t b P t g P t ev P t curt ⊤ ,
where positive P t b denotes battery discharge, positive P t g denotes grid import, positive P t ev denotes EV charging demand served, and P t curt is curtailed PV power. Sign conventions must be fixed consistently in implementation. If vehicle-to-grid operation is enabled, the EV power variable is signed and EV discharge is permitted only where vehicle availability, owner consent, and battery constraints are represented.

3.2. Power Balance

A simplified AC- or DC-equivalent active-power balance is
P t pv − P t curt + P t g + P t b = P t load + P t ev + P t loss + ϵ t bal ,
where P t pv is available PV power, P t load is non-EV demand, P t loss captures conversion and network losses, and ϵ t bal is a residual used for model validation rather than a free control variable. In a detailed network model, voltage, reactive power, branch-current, and converter constraints must also be enforced.

3.3. Stationary Battery Dynamics

Let E t b denote stored energy. With separate charge and discharge powers P t ch , P t dis ≥ 0 ,
E t + 1 b = E t b + η ch P t ch Δ t − P t dis Δ t η dis ,
subject to
E min b ≤ E t b ≤ E max b ,
0 ≤ P t ch ≤ P max ch , 0 ≤ P t dis ≤ P max dis .
A binary or complementarity condition is needed if simultaneous charging and discharging must be prohibited. Degradation may be represented by throughput cost or a more detailed cycle-aging model when battery data are available.

3.4. EV Service Model

For charging, let E i , t ev be the energy delivered to vehicle or battery i. A service request includes an arrival time, requested energy, departure deadline, and maximum charging power. A simple aggregate model is
E t + 1 ev = E t ev + η ev P t ev Δ t , 0 ≤ P t ev ≤ P max , t ev .
For each request i, the energy target should be met by its deadline where physically feasible:
E i , d i del ≥ E i req − s i , s i ≥ 0 ,
where d i is the departure time and s i is unmet service energy. For battery swapping, the state can instead track charged, depleted, reserved, and unavailable packs, including charger capacity and minimum ready-stock requirements. The aggregate model is appropriate for initial tests; pack-level tests should be used before deployment in a swapping station.

3.5. Grid Availability

Let z t ∈ { 0 , 1 } denote grid availability. Grid exchange is constrained by
− P max exp z t ≤ P t g ≤ P max imp z t .
If export is not permitted, set P max exp = 0 . Outage transitions can be generated from empirical outage records or clearly specified stochastic processes; sensitivity analysis should cover outage duration and frequency.

4. PEAR-EMS Framework

4.1. Architecture

PEAR-EMS has five functional blocks:
1.
Physics and state estimator: combines measurements and model equations to estimate battery energy, renewable availability, load, EV queue/service state, grid status, and equipment limits.
2.
Context and uncertainty encoder: provides forecasts or prediction intervals for PV, demand, EV arrivals, and grid availability, together with forecast-error or distribution-shift indicators.
3.
Adaptive RL policy: proposes a candidate dispatch action using the estimated state and context.
4.
Physics-based safety filter: checks the candidate action against one-step and short-horizon constraints, then projects it to a feasible action where possible.
5.
Supervisory logger: records requested and applied actions, constraint margins, intervention reasons, timing, forecasts, and state-estimation residuals.
The safety filter is not assumed to guarantee safety under arbitrary model error, unmeasured faults, or actuator failures; this qualification is consistent with the model-dependent nature of shielding and runtime safety assurance [10,14,15]. Any safety statement must be qualified by the accuracy of the model, the validity of uncertainty bounds, and the coverage of the tested operating envelope.

4.2. Markov Decision Process

The control problem is represented as a constrained Markov decision process (CMDP). The observation is
o t = E t b , P ^ t : t + H pv , P ^ t : t + H load , q t ev , z t , m t , σ t ,
where q t ev summarises EV queue or swap-stock state, m t represents equipment and network measurements, and σ t represents forecast uncertainty or calibrated interval widths. The action a t contains requested battery, grid, and EV-service setpoints. The transition is determined by the physical plant, disturbances, and measurement system.
The reward may combine operating cost, emissions, renewable curtailment, battery degradation, and EV service shortfall:
r t = − ( c t g P t g Δ t + c deg | P t b | Δ t + c curt P t curt Δ t + c unserved P t unserved Δ t + c ev s t ) .
The coefficients are scenario parameters and must be reported with units and sensitivity analysis. Hard safety limits should not be represented only as reward penalties.

4.3. Constrained Objective

The policy π θ maximises expected discounted reward while respecting expected or probabilistic operating constraints:
max θ J R ( π θ ) = E π θ ∑ t = 0 T γ t r t
subject to J C j ( π θ ) ≤ d j , j = 1 , … , m ,
where C j can represent grid-import peaks, service shortfall, battery throughput, or other aggregate constraints. Instantaneous physical limits are additionally enforced by the safety filter.

4.4. Adaptive Learning

A practical initial implementation can use Soft Actor-Critic (SAC) for continuous dispatch, with a Lagrangian constraint mechanism or a constrained actor–critic variant [3,4]. The adaptive component should be defined operationally, not merely named: (i) estimate forecast error and distribution shift; (ii) adjust uncertainty-dependent reserve margins and exploration during training; (iii) update constraint multipliers from observed violations; and (iv) reduce policy authority or switch to a verified fallback controller when confidence or communications are inadequate.
For constraint j, a projected dual update is
λ j , k + 1 = λ j , k + α λ J ^ C j , k − d j + ,
where k indexes policy updates, α λ is a learning rate, and [ x ] + = max ( 0 , x ) . The exact adaptation law, update frequency, and stability implications must be documented and tested. Adaptation should be bounded to avoid abrupt control changes.

4.5. Model-Predictive Safety Filter

Let u ˜ t be the action proposed by the RL policy. The filter solves a short-horizon feasibility problem:
u t : t + H − 1 * = arg min u t : t + H − 1 ∑ τ = t t + H − 1 ∥ u τ − u ˜ τ ∥ W 2 + ρ ∥ s τ ∥ 1
subject to power balance and device dynamic, battery, converter, EV and grid limits, reserve and network limits where modelled, uncertainty margins and terminal constraints.
Only the first action is applied; the problem is solved again at the next control step. Slack variables s τ should be reserved for explicitly designated soft constraints. Hard equipment-protection constraints must not be relaxed by generic slack penalties. If no feasible action exists, the controller should enter a documented fallback mode and raise an alarm. Chance constraints, if used, should specify the random variables, confidence level, calibration method, and validation procedure.

4.6. Fallback and Operational Hierarchy

The proposed deployment hierarchy is: protection and interlocks; safety filter; RL dispatch request; and a deterministic fallback EMS. Protection functions remain independent of the RL policy. Loss of communications, stale measurements, solver timeout, state-estimator failure, or infeasible optimisation should trigger a pre-defined fallback. The fallback may use conservative rule-based dispatch, load prioritisation, or safe disconnection according to the site design. Exact thresholds must be determined from equipment ratings and hazard analysis rather than assumed generically.

5. Proposed Real-Time Experimental Setup

5.1. Purpose and Testbed Boundary

The testbed is intended to assess real-time execution, interface behaviour, constraint handling, and resilience under reproducible disturbances. It is not a substitute for field validation or certification. This boundary follows established HIL practice, in which the simulated plant is interfaced with the actual controller and its communication pathway is included where practicable [16,17]. A staged programme is recommended: offline model validation, software-in-the-loop (SIL), controller-in-the-loop (CIL), HIL, and finally a limited field pilot subject to site approvals and protection review.

5.2. Hardware and Software Elements

Table 2 lists a modular setup. The final equipment should be selected according to laboratory availability, voltage/power levels, and whether power hardware or only signal-level emulation is used.

5.3. Real-time Signal Flow

At each sampling instant, the measurement layer provides plant state and status to the estimator. The estimator updates the physical state and forecast context; the RL agent generates a candidate action; the safety filter solves the constrained projection; and the command layer checks validity before sending setpoints to the plant. Applied setpoints, rejected actions, solver status, and timing are logged. All data streams should use a common time base. The control period Δ t c and plant integration step Δ t p must be declared, with Δ t p sufficiently smaller than the fastest dynamics represented by the model. These values should be chosen after a timing and numerical-stability study rather than fixed without reference to the testbed.

5.4. Safety and Commissioning

Commissioning should proceed in stages:
1.
Verify each component model and sign convention independently.
2.
Check energy conservation and unit consistency using deterministic test vectors.
3.
Run the baseline EMS without RL and confirm expected limit handling.
4.
Run the RL policy in shadow mode, with its actions logged but not applied.
5.
Enable the safety filter with conservative limits and test infeasible-action handling.
6.
Introduce one disturbance at a time, then test combinations.
7.
Perform fault-injection tests only under an approved laboratory safety procedure.
No live power interface should be connected until electrical protection, isolation, grounding, emergency-stop behaviour, and laboratory risk assessment have been approved by qualified personnel.

6. Experimental Design

6.1. Case Studies

The following scenarios are proposed to test transfer across operational contexts:
  • Case A: weak-grid community microgrid. PV, stationary BESS, critical and non-critical demand, and scheduled EV charging.
  • Case B: battery-swapping station. PV and grid supply, battery charging racks, stochastic motorbike battery arrivals, minimum ready-stock requirement, and service deadlines.
  • Case C: outage-prone institutional microgrid. PV, BESS, anchor loads such as water pumping or health services, and EV charging as a flexible load.
At least one scenario should use a model calibrated with measured or manufacturer-provided component data. If real operating data are unavailable, synthetic profiles may be used for initial verification but must be labelled as synthetic and must not be presented as field evidence.

6.2. Disturbance and Stress Tests

Each case should include nominal operation and controlled stress tests:
1.
PV ramps and forecast bias.
2.
Load surges and EV arrival bursts.
3.
Grid outages, uncertain restoration time, and voltage/frequency disturbances where modelled.
4.
Reduced battery capacity, altered efficiency, or conservative state-of-charge estimation.
5.
Communication latency, packet loss, stale measurements, and solver timeout.
6.
Distribution shift: train on one season or demand pattern and test on a held-out profile.
7.
Combined disturbances to test whether individual protections remain effective.
Disturbance magnitudes and probabilities must be based on available site data, component ratings, standards, or an explicitly stated sensitivity range.

6.3. Baselines and Ablations

PEAR-EMS should be compared with:
  • Rule-based EMS with documented priority logic.
  • Deterministic MPC using the same physical model and forecast inputs where applicable.
  • RL without the safety filter.
  • RL with a fixed, non-adaptive safety margin.
  • PEAR-EMS without physics embedding or without uncertainty adaptation (ablation tests).
Baselines should use comparable information, identical plant models, the same scenario seeds, and the same hardware limits. Hyperparameter tuning budgets should be disclosed to reduce unfair comparisons.

6.4. Evaluation Metrics

Table 3 defines the minimum evaluation set. Results should be reported across multiple independent seeds and disturbance profiles, with confidence intervals or bootstrap intervals where suitable.

6.5. Proposed Test Matrix and Experimental Sequence

To make the validation reproducible, each controller should be evaluated on the same plant model, scenario files, initial states, and random seeds. A recommended matrix is shown in Table 4; exact disturbance levels should be selected from measured data, equipment ratings, or a documented sensitivity analysis rather than copied as universal values.
The recommended sequence is: (1) unit-test component models and verify energy balance; (2) validate state transitions against analytical calculations or independent reference simulations; (3) run offline training and select hyperparameters using training/validation profiles only; (4) freeze the policy and evaluate on held-out scenarios; (5) conduct software-in-the-loop tests; (6) run the controller in shadow mode against a real-time plant; (7) enable action correction and fallback logic in controller-in-the-loop tests; and (8) progress to HIL only after electrical, interface, and laboratory risk reviews. If a real-time simulator or power interface is unavailable, SIL/CIL results should be reported honestly and HIL should remain a proposed next stage, not a completed experiment.
For a minimum viable testbed, the plant can initially be simulated in MATLAB/Simulink or another validated real-time-capable environment, while the EMS executes on a separate industrial PC or embedded computer. A real-time digital simulator (e.g., an available RTDS- or OPAL-RT-class platform) is preferred for HIL, but is not a prerequisite for the first software-validation stage. Begin with signal-level or controller-in-the-loop testing; add power amplifiers, PV/battery emulators, or a bidirectional EVSE only if the research question requires physical power-interface dynamics and the laboratory can support the associated protection requirements. The controller-to-plant interface, sampling period, communication protocol, numerical integration step, and timeout policy must be specified for the actual selected platform before experiments begin.

6.6. Statistical and Reproducibility Protocol

For each configuration, use multiple random seeds and a held-out set of days or profiles. Report mean, standard deviation, and 95% confidence intervals for continuous metrics, along with event counts and denominators for constraint violations. Use paired comparisons on matched scenarios where possible. Pre-register the primary metric and comparison before examining the final test set. Publish the controller configuration, model parameters that can be shared, scenario-generation code, software versions, random seeds, and anonymised logs where permitted. Clearly distinguish synthetic data, public data, manufacturer specifications, and measurements collected in the laboratory.

7. Research Questions and Hypotheses

The study is organised around four testable research questions:
RQ1:
Does physics embedding improve physical consistency and reduce constraint violations relative to an otherwise comparable RL policy?
RQ2:
Does adaptive uncertainty handling improve performance under forecast error and distribution shift relative to fixed-margin control?
RQ3:
Does the safety filter reduce the severity or frequency of unsafe candidate actions without causing unacceptable loss of service or excessive intervention?
RQ4:
Can the complete controller meet the real-time deadline on the selected controller hardware under nominal and stress-test conditions?
The corresponding hypotheses are that physics embedding improves feasibility; adaptive margins improve robustness under shift; safety filtering reduces applied-action violations; and the controller meets its declared execution deadline within the tested operating envelope. These are hypotheses to be tested, not findings established by this manuscript.

8. Discussion

PEAR-EMS is intended to make the transition from learned dispatch to laboratory evaluation explicit. Physics embedding can reduce the burden on the policy to rediscover basic conservation and device constraints, while a safety filter can prevent a subset of infeasible commands from reaching the plant. The approach nevertheless has important limits. A safety filter is only as reliable as its model, state estimates, uncertainty bounds, and solver behaviour. A feasible set may be empty during severe disturbances, so a fallback and load-prioritisation policy are essential. Adaptation can itself introduce instability if it changes margins or policy parameters too rapidly; bounded updates and independent protection are therefore required.
The proposed real-time testbed also introduces practical issues that offline simulation cannot capture, including timestamp alignment, communication delays, actuator saturation, controller overload, and measurement noise. Evaluation should report these effects rather than only energy-cost outcomes. In addition, local deployment requires the EMS to reflect the actual tariff structure, outage characteristics, EV usage patterns, and operational priorities. For example, a battery-swapping station may prioritise a minimum stock of charged batteries, whereas a clinic microgrid may prioritise critical loads. These priorities should be explicit in the model and should not be inferred from a generic reward.
Finally, transferability to Sub-Saharan African microgrids should be demonstrated using transparent assumptions and, where possible, locally grounded data. A framework designed for data-scarce contexts should quantify how its performance changes when data volume, forecast quality, or component-model fidelity is reduced. Any claims about equity, emissions, or resilience should be linked to operational definitions and measured indicators.

9. Conclusion

This paper has proposed PEAR-EMS, a physics-embedded adaptive RL framework for energy management in renewable–EV microgrids, and a staged real-time experimental setup. The proposed design combines explicit physical dynamics, uncertainty-aware context, adaptive constrained learning, a model-predictive safety filter, a deterministic fallback, and detailed operational logging. A test protocol has been specified across weak-grid, battery-swapping, and institutional microgrid scenarios, with rule-based, MPC, and RL baselines. The framework’s value remains to be established empirically. The next step is to implement the model and controller, conduct SIL/CIL/HIL validation and to report quantitative comparisons and real-time execution statistics.

References

  1. Sutton, R. S.; Barto, A. G. Reinforcement Learning: An Introduction, 2nd ed.; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
  2. Lillicrap, T. P.; et al. Continuous control with deep reinforcement learning. Proc. International Conference on Learning Representations (ICLR), 2016. [Google Scholar]
  3. Haarnoja, T.; Zhou, A.; Abbeel, P.; Levine, S. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. Proc. International Conference on Machine Learning (ICML), 2018; pp. 1861–1870. [Google Scholar]
  4. Achiam, J.; Held, D.; Tamar, A.; Abbeel, P. Constrained policy optimization. Proc. International Conference on Machine Learning (ICML), 2017; pp. 22–31. [Google Scholar]
  5. García, J.; Fernández, F. A comprehensive survey on safe reinforcement learning. J. Mach. Learn. Res. 2015, vol. 16(no. 1), 1437–1480. [Google Scholar]
  6. Hewing, L.; Wabersich, K. P.; Menner, M.; Zeilinger, M. N. Learning-based model predictive control: Toward safe learning in control. Annu. Rev. Control Robot. Auton. Syst. 2020, vol. 3, 269–296. [Google Scholar] [CrossRef]
  7. Levine, S.; Kumar, A.; Tucker, G.; Fu, J. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv 2020, arXiv:2005.01643. [Google Scholar]
  8. Dinata, N. F. P.; Ramli, M. A. M.; Jambak, M. I.; Sidik, M. A. B.; Alqahtani, M. M. Designing an optimal microgrid control system using deep reinforcement learning: A systematic review. Eng. Sci. Technol. An. Int. J. 2024, vol. 51, Art.(no. 101651). [Google Scholar] [CrossRef]
  9. Wazirali, R.; Yaghoubi, E.; Abujazar, M. S. S.; Ahmad, R.; Vakili, A. H. State-of-the-art review on energy and load forecasting in microgrids using artificial neural networks, machine learning, and deep learning techniques. Electr. Power Syst. Res. 2023, vol. 225, Art.(no. 109792). [Google Scholar] [CrossRef]
  10. Wang, Y.; Qiu, D.; Sun, M.; Strbac, G.; Gao, Z. Secure energy management of multi-energy microgrid: A physical-informed safe reinforcement learning approach. Appl. Energy 2023, vol. 335, Art.(no. 120759). [Google Scholar] [CrossRef]
  11. Pan, W.; Yu, X.; Guo, Z.; Qian, T.; Li, Y. Online EVs vehicle-to-grid scheduling coordinated with multi-energy microgrids: A deep reinforcement learning-based approach. Energies 2024, vol. 17(no. 11), Art. no. 2491. [Google Scholar] [CrossRef]
  12. Xie, H.; Song, G.; Shi, Z.; Zhang, J.; Lin, Z.; Yu, Q.; Fu, H.; Song, X.; Zhang, H. Reinforcement learning for vehicle-to-grid: A review. Adv. Appl. Energy vol. 17, Art.(no. 100214), 2025. [CrossRef]
  13. Gu, S.; Yang, L.; Du, Y.; Chen, G.; Walter, F.; Wang, J.; Knoll, A. A review of safe reinforcement learning: Methods, theories, and applications. IEEE Trans. Pattern Anal. Mach. Intell. 2024, vol. 46(no. 12), 11216–11235. [Google Scholar] [CrossRef]
  14. Alshiekh, M.; Bloem, R.; Ehlers, R.; Könighofer, B.; Niekum, S.; Topcu, U. Safe reinforcement learning via shielding. Proc. AAAI Conference on Artificial Intelligence, 2018; pp. 2669–2678. [Google Scholar] [CrossRef]
  15. Könighofer, B.; Bloem, R.; Jansen, N.; Junges, S.; Pranger, S. Shields for safe reinforcement learning. Commun. ACM 2025, vol. 68(no. 11), 80–90. [Google Scholar] [CrossRef]
  16. Casolino, G. M.; Russo, M.; Varilone, P.; Pescosolido, D. Hardware-in-the-loop validation of energy management systems for microgrids: A short overview and a case study. Energies 2018, vol. 11(no. 11), Art. no. 2978. [Google Scholar] [CrossRef]
  17. AhmadiAhangar, A.; et al. A review on real-time simulation and analysis methods of microgrids. Int. Trans. Electr. Energy Syst. 2019. [Google Scholar] [CrossRef]
  18. Charadi, S.; Chakir, H. E.; Akarne, Y.; Annoukoubi, M.; Redouane, A.; El Hasnaoui, A. Experimental validation of a hybrid AC/DC microgrid energy management system using Processor-in-the-Loop testing for green energy applications. Frankl. Open vol. 13, Art.(no. 100453), 2025. [CrossRef]
Table 2. Proposed PEAR-EMS experimental setup.
Table 2. Proposed PEAR-EMS experimental setup.
Subsystem Minimum proposed implementation Purpose / data logged
Real-time plant Real-time simulator or real-time digital simulation platform running PV, load, converter, battery, grid, and EV models Plant states, model step overruns, power balance residuals
Controller host Industrial PC or embedded controller running PEAR-EMS; fixed-rate control loop Execution time, CPU/memory use, missed deadlines, policy output
PV subsystem PV array model with irradiance and temperature profiles; optional PV emulator Available and curtailed PV power, forecast error
Stationary storage Battery model or battery emulator with SOC, current, voltage, and power limits SOC tracking, power response, limit interventions
EV subsystem EVSE/charger emulator or battery-swap queue model; optional bidirectional charger Delivered energy, deadline misses, queue and stock state
Grid interface Grid-tied or islanded model with programmable outages and import/export limits Outage response, grid power, restoration transients
Measurement and I/O Analogue/digital I/O, fieldbus or Ethernet interface, time synchronisation Sensor delay, packet loss, timestamp integrity
Protection layer Independent limits, interlocks, emergency stop, overcurrent/overvoltage protection as applicable Trips, alarms, protection events
Logging and analysis Time-series logger, experiment configuration, version control, post-processing scripts Reproducibility, metric calculation, audit trail
Table 3. Proposed evaluation metrics.
Table 3. Proposed evaluation metrics.
Metric Definition / reporting
Operating cost Energy purchase and declared operating costs per day or per served kWh
Operational emissions kg CO2e per day and per served kWh, using declared grid/generator emission factors and a consistent accounting boundary
Renewable utilisation PV energy used divided by available PV energy
Unserved energy Total unmet critical and non-critical demand, separately
EV service Fraction of requests meeting energy/departure targets; mean and tail waiting time
Battery stress Throughput, SOC excursions, equivalent full cycles if model supports it
Constraint violations Count, duration, and magnitude by constraint; distinguish hard and soft limits
Shield activity Intervention rate and mean action correction norm
Resilience Recovery time and unmet energy during and after defined outages
Electrical quality Voltage/frequency deviation, time outside declared bands, and recovery after disturbances where the plant model resolves these variables
Real-time performance Median, 95th/99th percentile execution time; deadline-miss rate
Robustness Performance degradation under forecast error and distribution shift
Table 4. Proposed experimental matrix.
Table 4. Proposed experimental matrix.
Test group Controlled variation Primary outcomes
Nominal Typical PV, load, EV arrivals and grid availability Cost, emissions, renewable use, service completion
Forecast error Bias, ramp error, and widening uncertainty intervals Robustness, reserve use, unmet load
EV stress Arrival bursts, short dwell time, high departure SOC target Queue/waiting time, energy delivered, deadline misses
Grid disturbance Import cap, planned/unplanned outage, restoration event Critical-load supply, recovery time, peak import
Storage stress Reduced usable capacity, efficiency drift, SOC-estimation error SOC limits, throughput, feasibility interventions
Communication Latency, packet loss, stale measurements, time skew Missed deadlines, fallback activation, stability of dispatch
Distribution shift Held-out season, altered EV mix, changed PV/load profile Performance degradation versus in-distribution test
Ablation Remove adaptation, physics features, or safety filter one at a time Marginal value and failure modes of each component
Real-time execution Repeat representative and worst-case computational scenarios on target controller Median and tail execution time, deadline misses
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.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.