  The increasing penetration of converter-based renewable generation has
resulted in faster frequency dynamics, and low and variable inertia. As a
result, there is a need for frequency control methods that are able to
stabilize a disturbance in the power system at timescales comparable to the
fast converter dynamics. This paper proposes a combined linear and neural
network controller for inverter-based primary frequency control that is stable
at time-varying levels of inertia. We model the time-variance in inertia via a
switched affine hybrid system model. We derive stability certificates for the
proposed controller via a quadratic candidate Lyapunov function. We test the
proposed control on a 12-bus 3-area test network, and compare its performance
with a base case linear controller, optimized linear controller, and
finite-horizon Linear Quadratic Regulator (LQR). Our proposed controller
achieves faster mean settling time and over 50% reduction in average control
cost across $100$ inertia scenarios compared to the optimized linear
controller. Unlike LQR which requires complete knowledge of the inertia
trajectories and system dynamics over the entire control time horizon, our
proposed controller is real-time tractable, and achieves comparable performance
to LQR.
