A Nonlinear Energy-Shaping Control Strategy for On-Grid Inverters

The global imperative for decarbonization has accelerated the energy transition, placing immense pressure on modern power systems to integrate ever-increasing shares of renewable energy. As the critical interface between distributed generation sources and the AC grid, the performance, stability, and control of on grid inverters are paramount. Among various topologies, the modular Cascaded H-Bridge (CHB) multilevel on grid inverter has garnered significant attention for medium-voltage applications due to its superior waveform quality, reduced device stress, and inherent scalability. However, the CHB structure, with its multiple interconnected power cells, constitutes a multivariable, strongly coupled nonlinear system. Conventional linear control strategies, such as PI-based closed-loop control, are designed around locally linearized models near an operating point. When applied to such a nonlinear plant, these strategies often exhibit limitations in dynamic response, parameter sensitivity, and lack guaranteed stability over a wide operating range. Therefore, developing control strategies that explicitly address the nonlinear nature of the on grid inverter is of both theoretical and practical significance.

This article presents a nonlinear control strategy based on the Energy-Shaping (ES) control methodology for a single-phase CHB on grid inverter. ES control, rooted in the Port-Controlled Hamiltonian (PCH) formalism, is a physics-based approach that stabilizes a system by shaping its energy function through the reconfiguration of its intrinsic interconnection and damping structures. We begin by deriving a precise nonlinear model of the CHB on grid inverter in the synchronous rotating (dq) frame, facilitated by instantaneous power observation using a Second-Order Generalized Integrator (SOGI). This model is then cast into the standard PCH form. Subsequently, the ES controller is systematically designed. A significant contribution of this work is a detailed analysis of the controller parameters’ influence on system stability, dynamic performance, and robustness, leading to a general parameter tuning methodology. Finally, the superiority of the proposed ES control over conventional PI control in terms of dynamic response and robustness to grid disturbances is validated through comprehensive simulation and experimental studies on a three-cell CHB on grid inverter prototype.

Mathematical Modeling and PCH Formulation

The topology of a single-phase CHB on grid inverter with N series-connected H-bridge cells is considered. Each cell is fed by an isolated DC source (e.g., a photovoltaic string or a battery module). The AC outputs of the cells are summed and connected to the utility grid through a filter inductor L, whose inherent resistance is denoted by R. The primary control objective is to regulate the instantaneous active power P and reactive power Q injected into the grid.

To facilitate controller design, the single-phase AC quantities are transformed into DC variables in the synchronous reference frame. First, the grid voltage \(u_g\) and current \(i_g\) are processed through a SOGI to generate orthogonal \(\alpha\beta\) components. These are then transformed into the dq frame rotating at the grid angular frequency \(\omega\):

$$ \mathbf{v}_{dq} = \mathbf{T}_{2s/2r} \mathbf{v}_{\alpha\beta}, \quad \text{with} \quad \mathbf{T}_{2s/2r} = \begin{bmatrix} \cos(\omega t) & \sin(\omega t) \\ -\sin(\omega t) & \cos(\omega t) \end{bmatrix} $$

Applying this transformation to the system’s averaged model yields the dq-frame differential equations:

$$ \begin{aligned}
2L\frac{di_{gd}}{dt} &= -2Ri_{gd} + 2\omega L i_{gq} + \sum_{i=1}^{N} m_{id} u_{dc,i} – 2u_{gd} \\
2L\frac{di_{gq}}{dt} &= -2Ri_{gq} – 2\omega L i_{gd} + \sum_{i=1}^{N} m_{iq} u_{dc,i} – 2u_{gq}
\end{aligned} $$

where \(i_{gd}, i_{gq}\) and \(u_{gd}, u_{gq}\) are the dq components of grid current and voltage, \(m_{id}, m_{iq}\) are the dq components of the modulation index for the i-th H-bridge cell, and \(u_{dc,i}\) is its DC input voltage. The instantaneous power is given by \(P = u_{gd}i_{gd} + u_{gq}i_{gq}\) and \(Q = u_{gq}i_{gd} – u_{gd}i_{gq}\).

The core of ES control is the PCH model, which describes the system from an energy perspective. We define the state vector as the magnetic flux in the filter inductors: \(\mathbf{x} = [2L i_{gd}, 2L i_{gq}]^T\). The Hamiltonian function \(H(\mathbf{x})\), representing the total stored magnetic energy, is:

$$ H(\mathbf{x}) = \frac{1}{2} \mathbf{x}^T \mathbf{D}^{-1} \mathbf{x}, \quad \text{with} \quad \mathbf{D} = \text{diag}\{2L, 2L\}. $$

The gradient of \(H(\mathbf{x})\) gives the output (current): \(\partial H / \partial \mathbf{x} = \mathbf{D}^{-1}\mathbf{x} = [i_{gd}, i_{gq}]^T\). The system dynamics can then be expressed in the canonical PCH form:

$$ \dot{\mathbf{x}} = [\mathbf{J}(\mathbf{x}) – \mathbf{R}(\mathbf{x})] \frac{\partial H}{\partial \mathbf{x}} + \mathbf{g}(\mathbf{x})\mathbf{u} $$

where \(\mathbf{J}(\mathbf{x}) = \begin{bmatrix} 0 & 2\omega L \\ -2\omega L & 0 \end{bmatrix}\) is the skew-symmetric interconnection matrix, \(\mathbf{R}(\mathbf{x}) = \begin{bmatrix} 2R & 0 \\ 0 & 2R \end{bmatrix}\) is the positive semi-definite damping (resistive) matrix, \(\mathbf{g}(\mathbf{x}) = \mathbf{I}_{2\times2}\) is the input matrix, and the input vector is \(\mathbf{u} = [\sum m_{id}u_{dc,i} – 2u_{gd}, \sum m_{iq}u_{dc,i} – 2u_{gq}]^T\). This formulation naturally separates the system’s conservative, dissipative, and external energy flow properties.

Energy-Shaping Controller Design

The principle of ES control is to alter the system’s closed-loop energy landscape so that the desired equilibrium point becomes the minimum of a new, shaped energy function \(H_d(\mathbf{x})\). This is achieved by injecting virtual damping and interconnection via feedback, effectively modifying the original \(\mathbf{J}\) and \(\mathbf{R}\) matrices. The target closed-loop dynamics are desired to be of the form:

$$ \dot{\mathbf{x}} = [\mathbf{J}_d(\mathbf{x}) – \mathbf{R}_d(\mathbf{x})] \frac{\partial H_d}{\partial \mathbf{x}} $$

where \(\mathbf{J}_d = \mathbf{J} + \mathbf{J}_a\), \(\mathbf{R}_d = \mathbf{R} + \mathbf{R}_a\), and \(H_d = H + H_a\). The matrices \(\mathbf{J}_a\), \(\mathbf{R}_a\) and the function \(H_a\) represent the control injections. The objective is to find a control law \(\mathbf{u} = \beta(\mathbf{x})\) such that the original system with feedback matches the target dynamics. This leads to the energy-shaping equation:

$$ [\mathbf{J}(\mathbf{x}) – \mathbf{R}(\mathbf{x})] \frac{\partial H}{\partial \mathbf{x}} + \mathbf{g}(\mathbf{x})\beta(\mathbf{x}) = [\mathbf{J}_d(\mathbf{x}) – \mathbf{R}_d(\mathbf{x})] \frac{\partial H_d}{\partial \mathbf{x}} $$

We choose the desired energy function \(H_d(\mathbf{x})\) as a quadratic function minimum at the desired equilibrium \(\mathbf{x}^* = [2L i_{gd}^*, 2L i_{gq}^*]^T\):

$$ H_d(\mathbf{x}) = \frac{1}{2} (\mathbf{x} – \mathbf{x}^*)^T \mathbf{D}^{-1} (\mathbf{x} – \mathbf{x}^*) $$

The desired currents \(i_{gd}^*, i_{gq}^*\) are computed from the power references \(P^*, Q^*\) and the measured grid voltage. We select simple constant injection matrices: \(\mathbf{R}_a = \text{diag}\{R_1, R_1\}\) and \(\mathbf{J}_a = \begin{bmatrix} 0 & J_{12} \\ -J_{12} & 0 \end{bmatrix}\), where \(R_1 > 0\) and \(J_{12}\) are the two key control parameters to be tuned. Solving the energy-shaping equation for the control input \(\mathbf{u}\) and assuming power balancing among identical H-bridge cells (\(m_{id}=m_d^*, m_{iq}=m_q^*\) for all i), we obtain the ES control law:

$$ \begin{aligned}
m_d^* &= \frac{1}{N \bar{u}_{dc}} \left[ 2u_{gd} + 2R i_{gd} – 2\omega L i_{gq} + R_1(i_{gd}^* – i_{gd}) + J_{12}(i_{gq}^* – i_{gq}) \right] \\
m_q^* &= \frac{1}{N \bar{u}_{dc}} \left[ 2u_{gq} + 2R i_{gq} + 2\omega L i_{gd} + R_1(i_{gq}^* – i_{gq}) – J_{12}(i_{gd}^* – i_{gd}) \right]
\end{aligned} $$

where \(\bar{u}_{dc} = (u_{dc,1}+…+u_{dc,N})/N\). These modulation indices are then transformed back to the stationary frame (\(m_{\alpha}^*\)) and used with a Carrier Phase-Shifted PWM (CPS-PWM) scheme to drive the switches of the CHB on grid inverter. The structure inherently includes feedforward of grid voltage and cross-coupling terms, similar to a standard decoupling control, but derived from a rigorous nonlinear passivity perspective.

Control Parameter Analysis and Tuning Methodology

A major challenge in applying ES control is the tuning of its parameters, \(R_1\) and \(J_{12}\). We provide a systematic analysis by studying the closed-loop error dynamics. Defining the error vector \(\mathbf{e} = [i_{gd}^*-i_{gd}, i_{gq}^*-i_{gq}]^T\), the closed-loop system can be expressed as:

$$ \dot{\mathbf{e}} = \mathbf{A}_e \mathbf{e}, \quad \text{where} \quad \mathbf{A}_e = -\begin{bmatrix} \frac{2R+R_1}{2L} & -\omega + \frac{J_{12}}{2L} \\ \omega – \frac{J_{12}}{2L} & \frac{2R+R_1}{2L} \end{bmatrix} $$

The stability of this linear error system is determined by the eigenvalues of \(\mathbf{A}_e\). For asymptotic stability, all eigenvalues must have negative real parts. The characteristic equation is \(\lambda^2 + \frac{2R+R_1}{L}\lambda + \left(\frac{2R+R_1}{2L}\right)^2 + \left(\omega – \frac{J_{12}}{2L}\right)^2 = 0\). Stability requires \(2R + R_1 > 0\), or simply \(R_1 > -2R\). Since \(R>0\), choosing \(R_1 > 0\) guarantees stability.

The dynamic performance can be assessed using a quadratic performance index \(J_e = \int_0^\infty \mathbf{e}^T\mathbf{e} \, dt\). For a stable system, it can be shown that:

$$ J_e = \frac{L}{2R+R_1} (i_{gd}^{*2} + i_{gq}^{*2}) $$

This reveals a crucial insight: a larger \(R_1\) results in a smaller performance index \(J_e\), implying faster error convergence and better dynamic performance. However, \(R_1\) cannot be increased indefinitely. From the control law, a very large \(R_1\) would demand excessively large modulation indices, leading to saturation and potential instability. Therefore, \(R_1\) should be maximized within the practical limits imposed by the available DC voltage.

The influence of the interconnection parameter \(J_{12}\) is on the damping characteristics. The eigenvalues of \(\mathbf{A}_e\) are:

$$ \lambda_{1,2} = -\frac{2R+R_1}{2L} \pm j\left(\omega – \frac{J_{12}}{2L}\right) $$

The imaginary part determines the oscillatory nature of the response. To eliminate undesired oscillations and achieve critically damped dynamics for the fastest non-oscillatory response, we set the imaginary part to zero:

$$ \omega – \frac{J_{12}}{2L} = 0 \quad \Rightarrow \quad J_{12}^{opt} = 2L\omega $$

Substituting this optimal value simplifies the control law and the error dynamics, removing the cross-coupling between d and q error terms in the exponential decay. If \(J_{12}\) deviates from this value, the system response will exhibit oscillations, prolonging the settling time. The analysis is summarized in the table below:

Control Parameter Effect on Stability Effect on Dynamics Recommended Tuning
Damping \(R_1\) Must satisfy \(R_1 > -2R\). Larger \(R_1\) improves speed (reduces \(J_e\)). Limited by control saturation. Set as high as possible without causing voltage saturation.
Interconnection \(J_{12}\) No direct effect on stability condition. Determines imaginary part of eigenvalues. Deviation causes oscillation. Set to optimal value: \(J_{12}^{opt} = 2L\omega\).

Furthermore, the robustness of the ES-controlled on grid inverter against parameter mismatches (e.g., in \(R\) and \(L\)) can be analyzed. Assuming steady-state and unity power factor operation (\(i_{gq}^*=0\)), the steady-state current errors due to mismatches \(\Delta R\) and \(\Delta L\) are approximately:

$$ \delta_I \approx \frac{\Delta R}{2R+R_1}, \quad \Delta\theta \approx \frac{\omega \Delta L}{2R+R_1} $$

This shows that a larger \(R_1\) not only speeds up the response but also mitigates the steady-state errors caused by parameter inaccuracies, enhancing the robustness of the on grid inverter control.

Simulation and Experimental Verification

The proposed ES control strategy and tuning method were validated on a three-cell (N=3) CHB on grid inverter model and prototype. The system parameters are listed below:

Parameter Value
DC Voltage per cell, \(u_{dc,i}\) 40 V
Grid Voltage (RMS), \(U_g\) 100 V
Grid Frequency, \(f\) 50 Hz
Filter Inductance, \(L\) 2 mH
Equivalent Resistance, \(R\) 0.7 Ω
Rated Active Power, \(P^*\) 200 W
Switching/Carrier Frequency 10 kHz

The ES control parameters were tuned according to the proposed method: \(J_{12}^{opt} = 2L\omega = 2 \times 0.002 \times 100\pi \approx 1.257\) and \(R_1\) was chosen as 23 after considering the voltage margin. A standard PI-based dq current control with grid voltage feedforward was implemented for comparison, with its parameters tuned using the technical optimum method.

Steady-State Performance: Under ideal grid conditions, both controllers achieved low current THD (ES: 0.29%, PI: 0.34%) and accurate power tracking. To test robustness, a 2.5% 3rd harmonic was introduced into the grid voltage. The ES-controlled on grid inverter maintained a THD of 0.34% and a peak current error of 0.15%, while the PI controller’s THD increased to 2.14% with a 1.7% peak error, demonstrating the superior disturbance rejection capability of the ES approach.

Dynamic Performance: The response to a step change in active power reference from 100W to 200W is the key test. The results are quantitatively compared in the following table:

Control Strategy Settling Time (ts) Overshoot Error after 10ms
Energy-Shaping (Optimal Tuning) ~5 ms 0% ~0%
Energy-Shaping (\(R_1\) too small) ~10 ms 0% –
Energy-Shaping (\(J_{12}\) non-optimal) ~10 ms ~25% –
PI Control (Technical Optimum) ~15 ms 0% ~12.5%

The ES control with optimally tuned parameters settled in approximately one-quarter of a grid cycle (5 ms), significantly faster than the PI controller (15 ms). When the ES parameters deviated from their optimal values—specifically, a smaller \(R_1\) or a non-optimal \(J_{12}\)—the dynamic performance degraded, exhibiting longer settling times or large oscillations, confirming the importance of the proposed tuning rules. Even with non-optimal tuning, the ES response was comparable to or better than the PI control. The experimental results closely matched the simulations, validating the practical feasibility of the controller.

Conclusion

This work has presented a comprehensive design and analysis of an Energy-Shaping control strategy for Cascaded H-Bridge on grid inverters. The key contributions are threefold. First, a Port-Controlled Hamiltonian model for the single-phase CHB system was established in the synchronous dq frame, providing a natural and physically insightful foundation for nonlinear controller design. Second, a systematic tuning methodology for the ES controller’s two parameters (\(R_1\) and \(J_{12}\)) was developed. It was rigorously shown that the damping parameter \(R_1\) directly governs the speed of the dynamic response and robustness to parameter mismatch, while the interconnection parameter \(J_{12}\) has an optimal value (\(2L\omega\)) that eliminates oscillatory behavior. Third, the superiority of the ES control over conventional linear PI control was conclusively demonstrated. The ES-controlled on grid inverter exhibited significantly faster transient response, reduced sensitivity to grid voltage harmonics, and comparable or better steady-state performance.

Importantly, the ES controller features a simpler structure with fewer tuning parameters than a decoupled PI controller, easing the commissioning process. The control law is computationally efficient and readily implementable on a digital platform. While the control accuracy can be influenced by model parameter errors, the analysis shows that the impact is mitigated by the injected damping \(R_1\). For applications requiring extremely high precision, the integration of an error integral term or fusion with adaptive techniques can be explored. In summary, the Energy-Shaping approach offers a powerful, physics-based alternative for high-performance control of modular multilevel on grid inverters, contributing to the development of more robust and dynamically responsive grid interfaces for renewable energy systems.

Scroll to Top