Grid-forming inverters · islanded microgrids
Making nonlinear inverter dynamics linear enough to control.
I'm an electrical engineer in Kathmandu, completing an MSc in power electronics and drive engineering. My thesis lifts the dynamics of droop-controlled grid-forming inverters into a Koopman observable space, where a linear predictor is accurate enough to drive a constrained MPC. Away from the simulation, I rebuild hydropower governors and write the PLC code that runs them.
Tighten the ramp and watch the PI baseline overshoot.
| Secondary | Nadir | Settling | Overshoot |
|---|---|---|---|
| Koopman MPC | — | — | — |
| Droop + PI | — | — | — |
Research
Four threads, one testbed
Everything below runs against the same islanded AC microgrid model, so the methods can actually be compared rather than just described.
-
Thesis core
Koopman–EDMDc model predictive control
A mode-aware lifting pipeline for droop-controlled grid-forming inverters: sine and cosine embeddings of the power angle in grid-tied mode, angle observables dropped when islanded. Feeding a velocity-form MPC with a Hildreth QP gives offset-free tracking under input and rate constraints.- Plant
- Islanded four-bus AC microgrid, droop-controlled grid-forming inverters
- Identification
- Extended DMD with control, mode-dependent observable dictionary
- Controller
- Velocity-form MPC, Hildreth QP, offset-free via integrator augmentation
- Constraints
- Secondary set-point magnitude and ramp rate
The dictionary has to change with the operating mode. Grid-tied, the power angle carries real information and the sine/cosine pair earns its place. Islanded, there is no stiff reference to hold an angle against — keeping those observables leaves the regression badly conditioned rather than merely redundant, so they get dropped.
Lifted, on the graph of sin δ State space Grid-tied, where the sine embedding earns its place. The part that took the longest was not the lift. It was discovering that the identified model and the Simulink plant disagreed about actuation authority: the plant moves frequency by roughly 12.45 mHz per kW of secondary set-point, the identified model predicts about 12.97. A four percent gain error is small enough to look like noise and large enough to leave a standing offset, which is what the velocity form plus an integrating disturbance state is there to absorb.
The plot at the top of this page is a reduced version of the same argument, small enough to run in a browser.
-
Baseline
Multi-agent RL for secondary control
A MADDPG implementation of distributed secondary control, replacing a centralised DDPG critic with centralised training and decentralised execution. The interesting case isn't nominal performance — it's what happens when the communication link between agents drops.- Algorithm
- MADDPG — per-inverter actor, critic sees the joint observation during training only
- Environment
- Gymnasium wrapper over the same islanded testbed
- Reward
- Frequency and voltage regulation with an effort penalty
- Role
- Learning-based baseline for the Koopman MPC comparison
A single centralised critic is the easy version of this problem and not the one a real microgrid has. Centralised training with decentralised execution keeps the deployment story honest: at run time each inverter acts on what it can actually measure locally.
The comparison worth making is the degraded one. Nominal performance between a tuned MPC and a converged policy is close enough to be an argument about tuning effort. Drop the communication link between agents and the two approaches fail in genuinely different ways — the MPC degrades toward its constraint set, the learned policy degrades toward whatever it saw in training.
-
Comparison track
Physics-informed neural control
Two strands: a PINC-style distributed secondary voltage controller for a low-voltage inverter microgrid, and a physics-informed predictor driving MPC on a DC–DC buck converter feeding a constant power load.- Strand one
- PINC distributed secondary voltage control, low-voltage inverter microgrid
- Strand two
- PINN predictor inside an MPC loop, buck converter with constant power load
- Physics
- Averaged continuous-conduction-mode model as the residual term
- Training
- DAgger-style aggregation against a supervising controller
A constant power load is the interesting part of the buck problem: its incremental resistance is negative, so the small-signal system is destabilising exactly where a naive linear predictor is most confident. Putting the averaged model in as a physics residual is what stops the network from learning a comfortable, wrong linearisation.
Two findings from the MPC loop worth recording. Asking the controller to track two outputs at once collapsed the bus rather than trading the two off — the single-output formulation is the one that holds. And the achievable step excursion is set by the LC filter, not by the controller, which is a useful thing to establish before blaming a predictor for tracking error it was never able to remove.
-
Side build
CircuitLab, a browser circuit simulator
Modified nodal analysis with companion models, running entirely client-side, with a phosphor-style oscilloscope readout. Verified against buck, boost, RC, RLC, and half-wave rectifier circuits.- Formulation
- Modified nodal analysis, companion models for reactive elements
- Nonlinearity
- Newton iteration per time step for diodes and switches
- Runtime
- Entirely client-side — no solver on a server anywhere
- Verified against
- Buck, boost, RC, RLC, half-wave rectifier
Companion models turn each capacitor and inductor into a conductance in parallel with a current source that carries the previous step's state, so every time step reduces to the same linear solve. The switching elements are where it stops being tidy: a hard diode model makes the Newton loop chatter near the conduction boundary.
The verification set is deliberately boring. Circuits with closed-form or well-known answers are the only ones that tell you the integrator is right, and a rectifier is the cheapest test that exercises the nonlinear path at all.
Practice
The same problems, on real plant
Control theory that never leaves a simulation is hard to trust. Most of what I know about governors, droop and commissioning came from machines that were already broken when I arrived.
-
2024 – present
Electro-mechanical consultant — National Hydro Power Co. Ltd.Rebuilt and commissioned the damaged 4WT1000-4.0XT governor of the 2.5 MW Indrawati III unit, and redesigned its frequency and gate control program in TIA Portal. The unit is back in service and still running.
-
2023
Electrical engineering intern — NEA Engineering Company Ltd.Desk study and simulation of a 40 MW solar PV project, around 85 GWh a year, plus substation design and transmission line survey work for the Kathmandu Valley network.
-
2023
Trainer — Nepal Hydropower AcademyA two-day course on PLC, SCADA and HMI fundamentals.
Writing
Notes from the middle of the work
Contact
Get in touch
Happy to talk about Koopman methods, inverter control, governor commissioning, or anything microgrid adjacent — including the parts that didn't work.