In recent years, with the gradual depletion of traditional fossil fuel resources such as coal, renewable energy sources like wind and solar power have become prominent research topics. The grid-tied inverter serves as the core equipment for feeding these new energy sources into the power grid. However, during operation, thermal and electrical stresses often create harsh working conditions, affecting system stability and directly impacting the quality of grid-connected power. In severe cases, this can lead to inverter shutdown. To address these issues, it is essential to obtain an online system model of the grid-tied inverter during operation and design controllers based on the actual system model to further enhance the stability of the grid-connected system. This article introduces Software Frequency Response Analysis (SFRA) technology to acquire the frequency characteristics of operating grid-tied inverters, enabling analysis of the impact of thermal and electrical stresses on stability margins. Taking an LCL three-phase grid-tied inverter as the research object, a small-signal sweep injection is applied at the DC reference point, and the inverter output under this injection is detected. Discrete Fourier Transform is performed on both the injected signal and system output, and the data is sent to an upper computer to plot the system frequency characteristic curves, thereby modeling the grid-tied inverter.
SFRA, developed by Texas Instruments, is software designed specifically for frequency response analysis of digital power systems. By leveraging SFRA, one can obtain open-loop frequency response, closed-loop frequency response, gain margin, phase margin, and other parameters without relying on external frequency response analyzers. This significantly reduces the time and cost of frequency response analysis while improving system reliability. The principle of SFRA involves injecting a low-noise sinusoidal small signal into the DC operating point of an open-loop device or closed-loop system without altering steady-state operation, and analyzing the frequency response at different points in the loop. It is crucial that the controlled object exhibits linearity at the injection point, and the small-signal disturbance only causes minimal changes in the output, thus not affecting system steady-state or pushing the system into nonlinear regions.
For open-loop testing, consider a system composed of a controlled object \(G(s)\) and a compensator or controller \(C(s)\). Since the compensator is implemented in the digital domain, it is denoted as \(C(z)\). The compensator’s performance greatly influences system stability, with key goals being to ensure the output follows the input accurately and to enable rapid stabilization via feedback regulation under external disturbances. The control variable \(u\) and feedback value \(y\) can be expressed as:
$$ y = \frac{G}{1 + GH} r $$
$$ u = \frac{y}{G} = \frac{C}{1 + CG} r $$
During library function calls, the control variable \(u\) and feedback value \(y\) undergo Discrete Fourier Transform to express the response at a specific frequency:
$$ X_k = \sum_{n=0}^{N-1} x_n e^{-j 2\pi k n / N} = \sum_{n=0}^{N-1} x_n \left( \cos(2\pi k n / N) – j \sin(2\pi k n / N) \right) $$
$$ \Rightarrow X_{f_{\text{meas}}} = \sum_{n=0}^{N-1} x_n e^{-j 2\pi (F_s / 2 \times F_{\text{meas}}) / N} $$
where \(N\) represents the number of response frequency points in the service interrupt subroutine.
If the controlled object model is unknown, SFRA can be used in open-loop operation to identify the model. By selecting a DC operating reference point and injecting a small signal at that point, the controlled object \(G(s)\) can be identified. The frequency response is calculated by measuring the system output feedback value \(y\):
$$ y = G \cdot i \Rightarrow G = \frac{y}{i} $$
Since the feedback value \(y\) is obtained via ADC sampling, noise is introduced during conversion. Thus, the measured feedback value includes noise output \(y_{\text{adc\_noise}}\):
$$ G_{\text{meas}} = \frac{G i + y_{\text{adc\_noise}}}{i} = G + \frac{y_{\text{adc\_noise}}}{i} $$
where \(G_{\text{meas}}\) is the actual measured frequency response function. The amplitude of the small signal should exceed the noise level to prevent noise from affecting the identification process. Increasing the sinusoidal small signal amplitude can further reduce noise and improve identification accuracy.
The SFRA library files primarily consist of five parts: header files and software library for single-precision floating-point computation; C2000 Software Frequency Response Analyzer (SFRA) library; SFRA upper computer interface for displaying frequency response results; scripts for importing SFRA data into Matlab; and instantiated software test platform projects for rapid evaluation of the SFRA library. In practice, two main functions are invoked: the sweep signal generation function SFRA_INJECT() and the object identification function SFRA_COLLECT(). SFRA_INJECT() injects a small sinusoidal signal on top of the DC reference to generate the control variable \(u\), which is then provided to the PWM driver. SFRA_COLLECT() analyzes the response data from the small sinusoidal signal input and computes the system transfer function.

The embedded software on C2000 comprises three components: the main loop program, interrupt service subroutine, and a .h file defining structures and result storage arrays for controlled object identification. The main program initializes the system clock, peripherals, and SFRA upon startup, then enters the main loop responsible for communicating with the upper computer, receiving instructions, and transmitting collected frequency response data for display and analysis. The interrupt service subroutine handles control parameter modifications and executes functions to achieve frequency response analysis.
To facilitate research, modeling of the grid-tied inverter is first conducted. Assuming ideal switching devices and balanced three-phase operation, the grid-tied inverter employs a T-type three-level topology with upper and lower bridge switches as silicon carbide MOSFETs and midpoint bridge switches as IGBTs, all operating at a switching frequency of 50 kHz. The LCL filter parameters include inverter-side inductance \(L_1\), grid-side inductance \(L_2\), filter capacitance \(C_f\), and series resistance \(R_d\), ignoring inductor resistance and capacitor parasitic resistance. Based on Kirchhoff’s voltage and current laws, the mathematical model of the three-phase LCL grid-tied inverter in the abc coordinate system is:
$$ \begin{cases} L_1 \frac{di_{1abc}}{dt} = v_{tabc} – v_{cabc} \\ C_f \frac{dv_{cabc}}{dt} = i_{1abc} – i_{2abc} \\ L_2 \frac{di_{2abc}}{dt} = v_{cabc} – v_{gabc} \end{cases} $$
where three-phase vectors \(i_{1abc}\), \(i_{2abc}\), \(v_{cabc}\), \(v_{tabc}\), \(v_{gabc}\) can be replaced by complex vectors in the stationary coordinate system: \(\phi_{\alpha\beta} = \phi_\alpha + j\phi_\beta\). After Clarke transformation, the equations become:
$$ \begin{cases} L_1 \frac{di_{1\alpha\beta}}{dt} = v_{t\alpha\beta} – v_{c\alpha\beta} \\ C_f \frac{dv_{c\alpha\beta}}{dt} = i_{1\alpha\beta} – i_{2\alpha\beta} \\ L_2 \frac{di_{2\alpha\beta}}{dt} = v_{c\alpha\beta} – v_{g\alpha\beta} \end{cases} $$
Applying Laplace transform to these equations yields the transfer function between input voltage and output current:
$$ G(s) = \frac{i_2(s)}{u_i(s)} = \frac{K(1 + C R_d s)}{L_1 L_2 C s^3 + (L_1 + L_2) R_d C s^2 + (L_1 + L_2) s} $$
where the front-end current sensor and power switches are equivalent to a proportional link with coefficient \(K\). This transfer function indicates a high-order system.
Applying SFRA technology for system frequency response analysis involves calling the sweep signal generation function SFRA_INJECT() to produce a sinusoidal small signal. This signal is injected into the controller after Park transformation to adjust system parameters, then passed through Clark transformation to the PWM_DRV() driver function, which outputs the drive signal for the grid-tied inverter. The grid signal, after passing through the LCL filter, feeds voltage, current, and phase information back to the DSP controller. The ADC_READ() function reads this data, which is then acquired by the object identification function SFRA_COLLECT(). Since no external devices are used, analog-to-digital conversion stages are minimized, reducing noise and ensuring response accuracy.
Experimental validation was conducted on a platform with a switching frequency of 50 kHz and LCL parameters: \(L_1 = 1 \text{ mH}\), \(C = 20 \mu\text{F}\), \(L_2 = 0.2 \text{ mH}\), \(R = 1.5 \Omega\), and equivalent proportional coefficient \(K = 650\) for the front-end power switches. After power-on, the dedicated SFRA upper computer software SFRA_GUI was launched. Given that small-signal injection is performed in software, the maximum measurable frequency is limited by half the injection switching frequency per the Nyquist sampling theorem, yielding a maximum of 25 kHz. The start frequency was set to 10 Hz with a step size of 250 Hz. Communication port and baud rate (9600 bit/s) were configured in SETUP, and upon successful connection, the GUI parsed current SFRA settings from the controller code, including sweep start frequency, sweep array length, and calculated maximum measurable frequency based on step size.
Upon initiating the sweep, the GUI automatically updates a .csv file, storing open-loop magnitude, phase, and other parameters for approximately 100 test points. Data fitting on these points yields the system frequency response characteristic curves. As analyzed, increasing the sinusoidal small-signal injection amplitude effectively suppresses noise. The table below summarizes the system output frequency response data from experiments.
| Frequency (Hz) | Magnitude (dB) | Phase (Deg) |
|---|---|---|
| 1020.5184 | 41.68952 | -93.6651 |
| 1274.5241 | 40.61258 | -95.9243 |
| 1540.8369 | 40.25623 | -100.4571 |
| 1823.6728 | 40.12314 | -108.3331 |
| 2100.9402 | 41.11542 | -123.0753 |
| 2341.7580 | 41.42315 | -143.0498 |
| 2510.8802 | 40.82314 | -161.0337 |
| 2790.4459 | 38.82453 | -188.0131 |
| 3042.8429 | 34.81245 | -197.9994 |
| 3306.7457 | 31.62147 | -212.4887 |
| 3560.6469 | 28.91235 | -216.8968 |
Using this data, fitting was performed, and Matlab was employed to plot the theoretical magnitude-frequency and phase-frequency characteristic curves of the system model. The magnitude-frequency and phase-frequency characteristic curves are shown below, derived from the fitted data and theoretical analysis.
The magnitude-frequency characteristic curve can be represented by the transfer function magnitude in dB:
$$ |G(j\omega)|_{\text{dB}} = 20 \log_{10} \left| \frac{K(1 + j\omega C R_d)}{j\omega L_1 L_2 C (j\omega)^3 + (L_1 + L_2) R_d C (j\omega)^2 + (L_1 + L_2) j\omega} \right| $$
Similarly, the phase-frequency characteristic curve is given by:
$$ \angle G(j\omega) = \arg\left( \frac{K(1 + j\omega C R_d)}{j\omega L_1 L_2 C (j\omega)^3 + (L_1 + L_2) R_d C (j\omega)^2 + (L_1 + L_2) j\omega} \right) $$
Comparison reveals that curves from theoretical derivation and actual measurement fitting are largely consistent, but discrepancies exist due to differences in the equivalent proportional coefficient \(K\) of the inverter bridge and injection amplitude parameters relative to the theoretical model. This underscores the importance of real-time frequency characterization for accurate controller design in grid-tied inverters.
The application of SFRA technology in grid-tied inverters offers significant advantages. By enabling online frequency response analysis without additional hardware, it reduces costs and enhances system reliability. For instance, in designing controllers for grid-tied inverters, knowing the exact frequency characteristics allows for precise tuning of compensators to achieve desired stability margins. Moreover, monitoring changes in frequency response over time can help diagnose degradation due to thermal or electrical stresses, facilitating predictive maintenance. The table below compares key aspects of traditional frequency response analysis methods versus SFRA for grid-tied inverters.
| Aspect | Traditional Methods | SFRA-Based Method |
|---|---|---|
| Hardware Requirement | External analyzers (e.g., network analyzers) | No additional hardware; uses existing DSP |
| Cost | High due to specialized equipment | Low, as it is software-implemented |
| Setup Complexity | Complex wiring and calibration | Simplified, integrated into control software |
| Real-Time Capability | Limited, often offline | High, enables online monitoring |
| Noise Immunity | Subject to external noise | Enhanced via adjustable injection amplitude |
| Application Flexibility | Fixed to specific test points | Adaptable to various operating points |
Furthermore, the mathematical modeling of grid-tied inverters can be extended to include nonlinearities and time-varying parameters. For example, the effect of switching harmonics on the frequency response can be incorporated by modifying the transfer function to account for modulation effects. A more generalized model for a grid-tied inverter with LCL filter in the dq synchronous rotating frame is given by:
$$ G_{dq}(s) = \frac{i_{2d}(s)}{u_{d}(s)} = \frac{K e^{-sT_d} (1 + C R_d s)}{L_1 L_2 C s^3 + (L_1 + L_2) R_d C s^2 + (L_1 + L_2) s + \omega_g^2 L_1 L_2 C} $$
where \(T_d\) represents computational and PWM delays, and \(\omega_g\) is the grid angular frequency. This model highlights the impact of grid synchronization on frequency response, which is critical for stability analysis in grid-tied inverters.
In practice, implementing SFRA on a DSP involves careful consideration of sampling rates and resolution. The ADC sampling frequency \(F_s\) must satisfy the Nyquist criterion relative to the highest frequency of interest. For a grid-tied inverter with a switching frequency of 50 kHz, a typical ADC sampling rate might be 100 kHz to capture harmonics adequately. The number of samples per frequency point \(N\) affects frequency resolution; a larger \(N\) improves resolution but increases computation time. The relationship between frequency resolution \(\Delta f\), sampling frequency \(F_s\), and \(N\) is:
$$ \Delta f = \frac{F_s}{N} $$
Thus, for \(F_s = 100 \text{ kHz}\) and \(N = 4096\), \(\Delta f \approx 24.41 \text{ Hz}\), which is sufficient for characterizing a grid-tied inverter in the frequency range of interest (e.g., 10 Hz to 25 kHz).
The injection signal design is also crucial. A sinusoidal sweep signal \(i(t)\) with exponentially spaced frequencies is commonly used to cover a broad range efficiently. The signal can be expressed as:
$$ i(t) = A \sin(2\pi f_k t) \quad \text{for} \quad t \in [t_k, t_k + T_k] $$
where \(A\) is the amplitude (e.g., 1% of DC reference), \(f_k\) is the k-th frequency point, and \(T_k\) is the duration for that frequency, typically set to an integer multiple of the period to minimize spectral leakage. The choice of amplitude balances signal-to-noise ratio and linearity; too high an amplitude may drive the grid-tied inverter into nonlinearity, while too low increases noise sensitivity.
Experimental results demonstrate that SFRA effectively captures the frequency response of grid-tied inverters. For the tested LCL-type grid-tied inverter, the measured magnitude response showed a peak around 2.1 kHz due to resonance, with a magnitude of approximately 41 dB, and phase dropping rapidly beyond this point. This resonance frequency \(f_r\) can be estimated from the LCL parameters:
$$ f_r = \frac{1}{2\pi} \sqrt{\frac{L_1 + L_2}{L_1 L_2 C}} $$
Substituting the values \(L_1 = 1 \text{ mH}\), \(L_2 = 0.2 \text{ mH}\), \(C = 20 \mu\text{F}\) gives \(f_r \approx 2.05 \text{ kHz}\), aligning with experimental observations. This resonance must be damped appropriately in controller design to ensure stability of the grid-tied inverter.
To further illustrate the utility of SFRA, consider its application in adaptive control of grid-tied inverters. As thermal and electrical stresses alter component parameters (e.g., inductance due to temperature changes), the frequency response shifts. SFRA can periodically update the model, enabling adaptive tuning of controller parameters. For instance, the proportional-integral (PI) gains in a current controller can be adjusted based on the updated crossover frequency and phase margin from SFRA measurements. The open-loop transfer function \(L(s)\) of a grid-tied inverter with PI controller is:
$$ L(s) = C(s) G(s) = K_p \left(1 + \frac{K_i}{s}\right) \frac{K(1 + C R_d s)}{L_1 L_2 C s^3 + (L_1 + L_2) R_d C s^2 + (L_1 + L_2) s} $$
Using SFRA to measure \(L(s)\) allows direct computation of gain margin \(GM\) and phase margin \(PM\), ensuring they remain within safe limits (e.g., \(GM > 6 \text{ dB}\), \(PM > 45^\circ\)) for the grid-tied inverter under varying conditions.
In conclusion, addressing the challenge of online frequency characterization for grid-tied inverters, this article innovatively introduces SFRA technology, proposing a method for real-time analysis of frequency domain characteristics. Through experimental validation on a three-phase grid-tied inverter platform with LCL filter, results confirm that this method achieves real-time online frequency characterization of LCL-type grid-tied inverters. It holds significant engineering value for analyzing the impact of thermal and electrical stresses on stability margins and for controller design in grid-tied inverters. Additionally, being software-implemented, it incurs no extra hardware costs, making it a practical solution for enhancing the reliability and performance of grid-tied inverters in renewable energy systems.
