As the penetration of renewable energy sources such as photovoltaic power continues to increase, solar inverters are now extensively integrated into the utility grid. However, unlike synchronous generators (SGs), conventional solar inverters are typically current-source-based and rely on phase-locked loops to synchronize with the grid. These so-called grid-following inverters cannot actively support the grid during weak grid conditions or fault events. To address this challenge, we propose a grid-forming control strategy for solar inverters that emulates the behavior of SGs. By mimicking the rotor mechanical equation and stator electrical equation of an SG, the solar inverter can provide inertial support, primary frequency regulation, and voltage regulation, thereby enhancing grid stability. This article presents the complete control architecture, including active-frequency control, reactive-voltage control, and voltage-current dual-loop control. We validate the strategy through MATLAB simulations and RT-LAB hardware-in-loop (HIL) experiments. The results demonstrate that the grid-forming solar inverter can smoothly ride through voltage disturbances, adjust active and reactive power according to grid needs, and maintain connection without tripping.
1. Introduction
Modern power systems face increasing challenges due to the massive deployment of solar inverters. The inertia of the system decreases, making it more vulnerable to frequency and voltage fluctuations. Grid-following solar inverters, controlled by PQ or droop methods, cannot provide active grid support. In contrast, grid-forming solar inverters operate as voltage sources and can autonomously regulate frequency and voltage. By implementing virtual synchronous generator (VSG) algorithms, we enable the solar inverter to behave like a conventional SG. This article details our work on designing and testing such a control system for a solar inverter.
2. Synchronous Generator Emulation Principle
The control design is based on the mathematical model of a synchronous generator. Figure 1 shows the equivalent circuit of an SG connected to the grid, where \(R\) and \(X\) represent the equivalent resistance and reactance, \(I\) is the stator current, and \(U_g\) is the grid voltage. The electromotive force \(E\) of the SG leads the grid voltage by a power angle \(\phi\). In a \(dq\)-rotating reference frame, the relationship between voltage and current can be expressed as:
$$ \begin{pmatrix} E_d \\ E_q \end{pmatrix} = \begin{pmatrix} E\cos\phi \\ E\sin\phi \end{pmatrix} $$
$$ \begin{pmatrix} I_d \\ I_q \end{pmatrix} = Y \left[ \begin{pmatrix} E_d \\ E_q \end{pmatrix} – \begin{pmatrix} U_{gd} \\ U_{gq} \end{pmatrix} \right] $$
where \(Y\) is the equivalent admittance matrix of the SG. For our grid-forming solar inverter, we replicate this relation to define the virtual internal voltage.
3. Grid-Forming Control Architecture of the Solar Inverter
The proposed control system for the solar inverter consists of three cascaded loops: active-frequency control loop, reactive-voltage control loop, and voltage-current dual-loop control. The overall structure is depicted conceptually in the following paragraph. The active-frequency loop outputs the phase angle \(\theta\), while the reactive-voltage loop outputs the voltage amplitude \(E\). These are combined to generate the internal three-phase reference voltage, which is then sent to the voltage-current controller that produces the modulation signals for the solar inverter’s power stage.
3.1 Active-Frequency Control Loop
This loop emulates the swing equation of a synchronous generator:
$$ J \frac{d\omega}{dt} = T_m – T_e – D_p(\omega – \omega_n) $$
$$ \frac{d\theta}{dt} = \omega $$
Here, \(J\) is the virtual inertia, \(D_p\) is the damping coefficient, \(\omega\) is the virtual rotor angular frequency, \(\omega_n\) is the nominal frequency, \(T_m\) and \(T_e\) are the mechanical and electromagnetic torques, respectively. The virtual mechanical power \(P_m\) is obtained via a frequency-droop characteristic:
$$ P_m = P_{\text{ref}} + K(\omega_n – \omega) $$
where \(K\) is the droop coefficient and \(P_{\text{ref}}\) is the active power reference. Figure 2 illustrates the control block diagram of this loop. The active power error drives the virtual inertia and damping to regulate the frequency. By tuning \(J\) and \(D_p\), the solar inverter can provide inertia support similar to an SG.
3.2 Reactive-Voltage Control Loop
The reactive-voltage loop mimics the excitation system of an SG. The differential equation governing the voltage amplitude is:
$$ Q_{\text{ref}} – Q + K_1 (U_{\text{ref}} – U) = K_2 \frac{dE}{dt} $$
where \(Q_{\text{ref}}\) and \(Q\) are the reactive power reference and actual output, \(U_{\text{ref}}\) and \(U\) are the reference and measured RMS voltage, \(K_1\) is the voltage-droop coefficient, and \(K_2\) is the voltage regulation gain. This equation ensures that the virtual internal voltage \(E\) is adjusted to maintain voltage magnitude and control reactive power flow. Table 1 summarizes the key parameters used in the reactive-voltage control loop.
| Parameter | Symbol | Value (example) |
|---|---|---|
| Voltage droop coefficient | \(K_1\) | 5000 VAr/V |
| Voltage regulation gain | \(K_2\) | 0.02 s |
| Nominal voltage (RMS) | \(U_{\text{ref}}\) | 800 V |
3.3 Voltage-Current Dual-Loop Control
To achieve fast and accurate tracking, we employ inner voltage and current loops in the \(dq\) reference frame. The three-phase reference voltages \(e_a, e_b, e_c\) are synthesized from the amplitude \(E\) and angle \(\theta\):
$$ e_a = \sqrt{2} E \sin\theta $$
$$ e_b = \sqrt{2} E \sin(\theta – 120^\circ) $$
$$ e_c = \sqrt{2} E \sin(\theta + 120^\circ) $$
The voltage loop controls the capacitor voltages using PI regulators:
$$ I_d^* = \left( K_{P1} + \frac{K_{I1}}{s} \right)(E_d^* – U_d) $$
$$ I_q^* = \left( K_{P1} + \frac{K_{I1}}{s} \right)(E_q^* – U_q) $$
The current loop generates the modulation signals with decoupling terms:
$$ E_d = \left( K_{P2} + \frac{K_{I2}}{s} \right)(I_d^* – I_d) – \omega L I_q + U_d $$
$$ E_q = \left( K_{P2} + \frac{K_{I2}}{s} \right)(I_q^* – I_q) + \omega L I_d + U_q $$
Table 2 provides the PI parameters used in the voltage and current loops for the solar inverter.
| Controller | Proportional gain | Integral gain |
|---|---|---|
| Voltage loop (d-axis) | \(K_{P1}\)=0.5 | \(K_{I1}\)=20 |
| Voltage loop (q-axis) | \(K_{P1}\)=0.5 | \(K_{I1}\)=20 |
| Current loop (d-axis) | \(K_{P2}\)=2.0 | \(K_{I2}\)=100 |
| Current loop (q-axis) | \(K_{P2}\)=2.0 | \(K_{I2}\)=100 |
4. Simulation Validation
We built a simulation model of the solar inverter in MATLAB/Simulink, consisting of a DC source, three-level NPC inverter, LCL filter, and an ideal AC grid. The system parameters are: DC bus voltage 1080 V, AC line voltage 800 V, inverter-side inductance \(L_1\)=135 µH, filter capacitor \(C\)=42 µF, grid-side inductance \(L_2\)=20 µH. The grid-forming control algorithm was implemented in discrete time. We performed two key tests: grid voltage tracking and primary frequency regulation.
4.1 Grid Voltage Tracking
We applied voltage dips: first a 50% dip from 0.9 s to 1.4 s, then an 80% dip from 2 to 3 s. The solar inverter’s output voltage closely followed the grid voltage during both events, demonstrating accurate voltage tracking capability. Figure 3 shows the grid voltage and the inverter’s output voltage waveforms (not shown here due to reference limitations). The solar inverter maintained synchronization throughout.
4.2 Primary Frequency Regulation
We kept the solar inverter at nominal power (10 kW, 0 VAr) and reduced the grid frequency from 50 Hz to 49 Hz at t=2 s, then restored it at t=3 s. As shown in Figure 4, the inverter increased its active power output from 10 kW to 400 kW during the frequency drop (simulating a large inertia in the model), and returned to 10 kW after recovery. This demonstrates that the grid-forming solar inverter can participate in primary frequency regulation by adjusting active power.
4.3 Power Tracking Tests
We also verified that the solar inverter can track active and reactive power references independently. When the active power reference stepped from 10 kW to 20 kW at 3 s and back, the output power followed accurately, while reactive power remained unchanged. Similarly, a step in reactive power reference from 0 to 10 kVAR was tracked without affecting active power. Table 3 summarizes the simulation results.
| Test | Reference | Actual steady-state | Settling time |
|---|---|---|---|
| Active step (10→20 kW) | 20 kW | 19.95 kW | 0.6 s |
| Reactive step (0→10 kVAR) | 10 kVAR | 9.98 kVAR | 0.5 s |
5. Hardware-in-Loop (HIL) Experiments
To validate the control strategy on actual controller hardware, we set up a HIL platform using RT-LAB 5707 simulator and a real solar inverter control cabinet (originally designed for a 225 kW three-level NPC inverter). The HIL model included a DC source, Boost converter, DC-link capacitor, inverter, LCL filter, and grid emulator. The C-code implementation of the grid-forming algorithm was downloaded to the controller. We conducted three experiments: active power scheduling, MPPT current tracking, and fault ride-through.
5.1 Active Power Scheduling
The solar inverter was commanded to reduce its active power from 225 kW to 50 kW and then back to 225 kW. Figure 5 (conceptual) shows the response; the actual power followed the reference with a settling time of about 1 s, after which the tracking was accurate. The slight oscillation during the transient can be mitigated by tuning the PI parameters further.
5.2 MPPT Current Tracking
We operated the solar inverter in constant-voltage mode (rather than MPPT search) to observe the current loop behavior. The current reference was stepped between 2 A and 9 A. The actual current tracked the reference, but exhibited overshoot and ringing. This indicates that the integral gain may be reduced for a better trade-off. The response is shown conceptually in Figure 6.
5.3 Low-Voltage Ride-Through (LVRT) and High-Voltage Ride-Through (HVRT)
The LVRT test simulated a voltage dip to 0.2 p.u. (160 V) for 0.65 s. The solar inverter remained connected and delivered a capacitive reactive current that followed the command. The HVRT test raised the voltage to 1.3 p.u. (1040 V) for 0.5 s; the inverter injected inductive reactive current without tripping. Figure 7 illustrates the behavior. Table 4 summarizes the ride-through performance.
| Test | Voltage level | Duration | Reactive current tracking | Inverter status |
|---|---|---|---|---|
| LVRT | 0.2 p.u. | 0.65 s | Good (capacitive) | No tripping |
| HVRT | 1.3 p.u. | 0.5 s | Good (inductive) | No tripping |

6. Conclusion
In this work, we have developed and tested a grid-forming control strategy for solar inverters. By emulating the swing equation and excitation control of synchronous generators, the solar inverter can actively regulate frequency and voltage, provide inertial support, and ride through grid faults. Simulation results verified the voltage tracking, primary frequency regulation, and power decoupling capabilities. HIL experiments confirmed that the algorithm runs correctly on actual controller hardware, achieving smooth active power scheduling and fault ride-through with reactive current injection. The proposed grid-forming solar inverter offers a promising solution for future weak-grid scenarios. Future work will focus on optimizing PI gains to suppress oscillations and extending the control to multi-inverter parallel operation.
