Sep 2024 – May 2026 · University of Maine
Real-Time Microgrid & Hardware-in-the-Loop
OPAL-RT / RT-LAB · Raspberry Pi + OP8666 DSP · System Identification
A real-time microgrid model integrating photovoltaic, wind, inverter-based and conventional generation, run in closed loop with embedded hardware to study dynamic response and identify inverter dynamics.
- Problem
- Inverter-dominated microgrid dynamics can't be explored safely or repeatably on energized hardware.
- Role
- Graduate Research Assistant: built and validated the real-time model, and interfaced the embedded hardware that closes the loop.
- Tools
- OPAL-RT · RT-LAB · Raspberry Pi · OP8666 DSP · MATLAB/Simulink
- Outcome
- A working HIL platform, plus probing-signal/ARX methods that estimate inverter transfer functions from measured data. Co-author on a published Elsevier paper from this research.
Text description of this diagram
Hardware-in-the-loop schematic. Inside a real-time simulator running OPAL-RT and RT-LAB, photovoltaic, wind, inverter-based and conventional generation share a common bus that feeds a load. Measurement signals flow from the simulator down to embedded hardware (a Raspberry Pi and an OP8666 DSP microcontroller), and control signals flow back up, closing the loop between the real controllers and the simulated microgrid.
Illustrative schematic drawn for this portfolio to show how the simulated plant and the embedded hardware are arranged. It is not a laboratory drawing and shows no measured data.
◆Explore the system
OPAL-RT with RT-LAB runs the microgrid as a real-time plant. PV, wind, inverter-based and conventional generation share a common bus with the loads.
The model was developed to evaluate voltage, frequency and dynamic response under changing generation and loading conditions.
01Context & engineering problem
As part of graduate research at the University of Maine, a real-time microgrid model was built and validated using OPAL-RT and RT-LAB. The model integrated photovoltaic, wind, inverter-based and conventional generation resources on a common electrical bus.
The work connected embedded hardware to the real-time simulator so that controllers ran in closed loop against the simulated grid, allowing dynamic behavior to be studied under changing generation and loading conditions.
Inverter-dominated microgrids behave differently from conventional grids: their dynamics depend heavily on power-electronic controls rather than large rotating machines.
Studying that behavior safely and repeatably requires a real-time environment where controllers interact with an accurate model of the grid before any hardware is exposed to real power.
02My role
- Built and validated the real-time microgrid model in OPAL-RT / RT-LAB.
- Integrated photovoltaic, wind, inverter-based and conventional generation resources into the model.
- Interfaced a Raspberry Pi and an OP8666 DSP microcontroller for closed-loop hardware-in-the-loop operation.
- Developed and evaluated probing-signal and ARX-based identification methods to estimate dynamic transfer functions from inverter input-output measurements.
03System architecture
- Generation sources (PV, wind, inverter-based and conventional) feed a common microgrid bus that also serves the loads.
- The plant runs in real time on OPAL-RT under RT-LAB; measurement signals leave the simulator and control signals return to it, closing the loop.
- A Raspberry Pi and an OP8666 DSP sit in that loop as the embedded controller / interface layer, exchanging input-output signals with the simulated grid.
04Methodology & validation
- The model was developed to evaluate voltage, frequency and dynamic response under changing generation and loading.
- Probing signals were injected at inverter inputs, and the resulting input-output measurements were used to fit ARX (AutoRegressive with eXogenous input) models.
- The identified transfer functions describe how an inverter responds dynamically, which supports analysis and control design.
- Real-time validity is the first gate: the solver has to finish every step within its fixed time step, because an overrun means the simulated plant is no longer keeping pace with the hardware it is driving. Model fidelity was traded against that budget rather than maximized in isolation.
- The model was then exercised across changing generation and loading conditions, with voltage, frequency and dynamic response used as the behaviours to check.
- The identification results were assessed by comparing the response predicted by the fitted ARX model against the measured inverter input-output data, the standard check that an identified transfer function actually reproduces the hardware it was fitted from.
- The wider effort was reviewed externally: it is reported in a peer-reviewed Elsevier paper (see Evidence below). Specific time-step, fit-quality and response-plot figures are not reproduced on this page.
05Evidence
Peer-reviewed publication
K. Pokharel, K. K.C., D. Hummels, and H. Li, "Deep Reinforcement Learning-Based Current Control of Grid-Following Inverters With Digital Real-Time Simulation," Cyber-Physical Energy Systems (Elsevier), Aug. 2026, published open access. Krishna is a co-author. This case study covers the real-time simulation and hardware-in-the-loop work he carried out in the same lab over the same period.
doi.org/10.1016/j.cpes.2026.04.005 (opens in a new tab)Funded research
The published work acknowledges U.S. National Science Foundation award OIA-2316399 (per the publisher's Crossref record).
06Engineering considerations
- Real-time execution imposes a fixed computation budget per time step, so model fidelity is balanced against real-time performance.
- Hardware-in-the-loop keeps real controllers in the loop while avoiding the risk of testing directly on energized equipment.
07Outcomes
- A validated real-time microgrid model with multiple generation types running in closed loop with embedded hardware.
- Probing-signal and ARX-based methods that estimate inverter dynamic transfer functions from measured data.
- The broader effort is reported in a published, peer-reviewed Elsevier paper on real-time-simulation-based inverter control, co-authored and NSF-funded (see Research).
08Tools & skills
Tools & platforms
- OPAL-RT
- RT-LAB
- Raspberry Pi
- OP8666 DSP
- MATLAB
- Simulink
Skills demonstrated
- Real-time simulation
- Hardware-in-the-loop
- System identification
- Power electronics
- Control systems
- Embedded interfacing