Next Article in Journal
XRL-LLM: Explainable Reinforcement Learning Framework for Voltage Control
Previous Article in Journal
From Innovation to Acceptance: Social Determinants Shaping Hydrogen Technology Development—Evidence from Poland
Previous Article in Special Issue
Optimization of Virtual Inertia Control for DC Microgrid Based on Model Predictive Control
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Online Self-Tuning Control of Flyback Inverters Using Recurrent Neural Networks for Thermally Induced Performance Degradation Compensation

College of Electrical Engineering, Zhejiang University, Hangzhou 310027, China
*
Author to whom correspondence should be addressed.
Energies 2026, 19(7), 1788; https://doi.org/10.3390/en19071788
Submission received: 30 January 2026 / Revised: 27 March 2026 / Accepted: 30 March 2026 / Published: 6 April 2026
(This article belongs to the Special Issue Power Electronics for Renewable Energy Systems and Energy Conversion)

Abstract

Quasi-resonant (QR) flyback inverters suffer from significant performance degradation under varying thermal conditions. This is because the thermal drift of passive components’ parameters deviates the switching instants from their optimal valley points, leading to increased switching losses and higher grid current distortion. To address this challenge, we propose an online self-tuning control strategy based on a Recurrent Neural Network (RNN) designed for embedded implementation. The RNN model continuously observes a sequence of non-intrusive operational data, including input voltage, input current, and grid current, and directly predicts the optimal time-delay compensation for the valley-switching logic. This end-to-end approach eliminates the need for online parameter identification, complex physical model calculations, or dedicated thermal sensors. The proposed framework was validated through comprehensive MATLAB/Simulink simulations. The results demonstrate that when operating across a wide temperature range (e.g., from 25 °C to 85 °C), the self-tuning control scheme enhances conversion efficiency by over 3.0% and reduces the grid’s current Total Harmonic Distortion (THD) from 5.8% to below 2.0%, thereby significantly improving the inverter’s lifetime performance and reliability.

1. Introduction

The flyback inverter stands as a cornerstone topology in modern power electronics, prized for its intrinsic electrical isolation, simple circuit structure, and cost-effectiveness [1,2]. Its versatility has enabled its widespread application in diverse fields, ranging from grid-connected photovoltaic (PV) systems [3,4,5] and electric vehicle (EV) auxiliary power supplies [6] to battery management systems (BMSs) for cell equalization [7,8] and high-density consumer electronics [9]. To meet ever-increasing demands for power and modularity, advanced structures such as interleaved [10] and input-series-output-parallel (ISOP) configurations [11] have been developed, further cementing this inverter’s importance.
In the pursuit of higher performance, contemporary designs have shifted towards soft-switching techniques like quasi-resonant (QR) control [12] and active-clamp flyback (ACF) [13,14]. These methods significantly reduce switching losses by achieving zero-voltage or zero-current switching (ZVS/ZCS) [15,16], enabling higher-frequency operation and greater power density. They are often complemented by sophisticated digital control strategies, including adaptive frequency control [17] and multi-mode Primary-Side Regulation (PSR) [18,19], to optimize performance over wide operating ranges. However, the success of these high-performance techniques is critically dependent on an accurate understanding of the inverter’s circuit parameters, as the timing for optimal switching depends directly on them [20].
Parameter dependency exposes a critical vulnerability in practical applications: heat-induced performance degradation. The operational temperature of a power inverter fluctuates significantly with load conditions, ambient temperature, and device aging, causing substantial drift in key component parameters. Crucially, as demonstrated in [21], the permeability of the ferrite core in the flyback transformer degrades as temperatures rise, directly altering the magnetizing inductance. Similarly, the parameters of semiconductor devices, such as MOSFET on-state resistance ( R DS ( on ) ) and parasitic capacitance, are strongly temperature-dependent [22]. This cumulative parameter drift inevitably pushes the controller away from its pre-calibrated optimal operating point, leading to a loss of soft-switching capacity, a sharp decline in efficiency, and compromised system reliability [23].
Several approaches have been proposed to address this parameter uncertainty, yet they have inherent limitations. Online monitoring techniques, for instance, can estimate parameters for specific components like output capacitors [24], but they fail to provide a holistic, system-level compensation for the combined effect of multiple drifting parameters. Another popular approach, PSR [18,25,26], is designed to regulate the output without direct feedback, but its accuracy is fundamentally tied to the presumed constancy of the transformer’s magnetizing inductance. This parameter, however, is unstable with temperature [21], inherently limiting the regulation accuracy of conventional PSR methods over a wide thermal range. Even advanced adaptive control strategies often rely on complex models or assumptions that may not hold true under significant thermal stress [23]. This vulnerability is particularly acute because the thermal drift of key components, such as capacitors, is significant [27], which degrades control accuracy and increases Total Harmonic Distortion (THD). High THD, in turn, distorts grid voltage, interfering with phase-locked loops (PLLs) and impairing accurate grid tracking, which can destabilize current control loops and lead to system oscillations or failures [28].
Several advanced control schemes have been proposed to address these challenges. For instance, a quasi-resonant (QR) controller that adaptively reduces the switching frequency to minimize losses under varying loads was proposed in [12]. While effective for achieving zero-voltage switching (ZVS), its ability to compensate for multi-parameter thermal drifts remains limited. Similarly, high efficiency can be achieved through a dynamic frequency selector and constant-current startup technique, though this method’s robustness to wide-range thermal variations is not its primary focus [29]. Another approach involves adaptive frequency control for primary-side-regulated (PSR) converters; this simplifies sensing, but its accuracy is constrained by the assumption of constant magnetizing inductance [30].
To overcome these limitations, we propose an online self-tuning control strategy using a Recurrent Neural Network (RNN) to compensate for heat-induced performance degradation. The RNN functions as an observer, learning the complex, non-linear mapping between easily measurable electrical signals (e.g., primary-side voltage and current) and the underlying, temperature-dependent state of the system. Without requiring any thermal sensors or complex parameter extraction circuits, it predicts the deviation from optimal performance and dynamically adjusts the controller’s setpoints in real time to maintain optimal switching conditions. This work contributes a self-tuning framework with which to actively compensate for performance degradation caused by temperature-induced parameter drift. The proposed scheme is realized through a non-intrusive online implementation that enhances efficiency and reliability without additional hardware costs. The effectiveness and robustness of the proposed method are validated through detailed MATLAB/Simulink (version R2022b) simulations across a wide range of operating temperatures.
The remainder of this paper is organized as follows. Section 2 details the heat-induced performance degradation mechanism. Section 3 presents the proposed RNN-based online self-tuning control architecture. Section 4 discusses the simulation setup and results, and Section 5 concludes the paper.

2. System Modeling and Analysis of Heat-Induced Performance Degradation

2.1. Operational Principle of QR Flyback Inverter

The QR flyback inverter, whose topology is illustrated in Figure 1, represents an attractive solution to achieving high efficiency in an isolated power supply, primarily due to its implementation of valley switching [12]. Unlike hard-switched inverters, the aim of the QR technique to turn on the main power MOSFET ( Q M ) when its drain-source voltage ( V d s ) is at a local minimum, thereby significantly reducing turn-on switching losses.
It is critical to note that this system operates as a quasi-single-stage topology, not a conventional two-stage inverter. In this configuration, the front-end flyback inverter carries out high-frequency current shaping to form a rectified sinusoidal envelope, while the back-end H-bridge acts only as a low-frequency unfolder designed to set the grid current polarity. Consequently, the quality and THD of the final grid current are directly determined by the control accuracy of the flyback stage.
The control system, enclosed within the dashed purple line in Figure 1, is composed of several interconnected functional blocks that work in concert:
  • MPPT (Maximum Power Point Tracking): This block continuously measures the PV array’s voltage ( v p v ) and current ( i p v ) to determine the optimal operating point for maximum power extraction. It generates a reference current amplitude, I m p p t , which sets the target for the sinusoidal current’s injection into the grid.
  • PLL (Phase-Locked Loop): The PLL block monitors grid voltage ( v a c ) to accurately track its phase angle ( θ ) and frequency. This ensures that the inverter’s output current remains synchronized and in phase with the grid voltage, achieving a near-unity power factor.
  • Proposed RNN-Based Adaptive Controller: This is the core innovation of the system, responsible for achieving high efficiency via adaptive ZVS. It consists of two sub-modules:
    RNN Block: Acting as the intelligent core, the pre-trained Recurrent Neural Network (RNN) takes real-time system state variables (e.g., I p v , V p v , and I a c ) and the MPPT reference ( I m p p t ) as inputs. It predicts the optimal delay time, Δ t d e l a y , required to achieve ZVS for the upcoming switching cycle under the current operating conditions.
    QR Calculation Block: This block receives the predicted Δ t d e l a y from the RNN and the grid phase angle θ from the PLL. It calculates the necessary primary switch-on time ( t o n ) to regulate the power flow and shape the sinusoidal output current. It also determines the total switching period ( t s ) by incorporating the adaptive delay, thus implementing quasi-resonant (QR) control.
  • Timing Logic PWM Gen: This block receives the calculated timing parameters ( t o n and t s ) and generates the final high-frequency gate drive signals ( Q S , M ) for the primary MOSFETs of the interleaved flyback converter stage.
  • Unfolding Stage Driver: This block controls the low-frequency H-bridge inverter ( Q 1 Q 4 ). Based on the grid phase angle θ from the PLL, it switches the H-bridge at the grid’s zero-crossing points, thereby “unfolding” the rectified, pulsating DC power from the flyback stage into a clean sinusoidal AC current for grid injection.
This opportunity for soft switching arises during the inverter’s resonant phase. After the main switch Q M is turned off and the energy stored in the magnetizing inductance ( L p ) has been fully transferred to the secondary side, the secondary diode D M ceases conducting. At this instant, a resonant tank formed by L p and the total capacitance at the drain node ( C r ) begins to oscillate. This capacitance, C r , is a lumped parameter comprising the MOSFET’s intrinsic output capacitance ( C o s s ), the transformer’s inter-winding capacitance, and other stray capacitances.
The key operational waveforms for a single switching cycle are detailed in Figure 2. The cycle begins at t 0 when Q M is turned on, allowing the primary current ( i p m ) to ramp up linearly and store energy in L p . At t 1 , Q M is turned off, and this stored energy is transferred to the secondary side until t 2 . Following the complete energy transfer at t 2 , the L p - C r tank starts its resonant oscillation, causing the V d s to wind down and create the distinct valleys characteristic of QR operation. Optimal efficiency is achieved by turning Q M back on precisely at one of these voltage valleys, a technique known as ZVS or valley switching.
This high-efficiency operation hinges on the precise timing of the turn-on signal, which must align perfectly with the V d s valley. This timing is determined by the resonant period, T r e s , given by
T r e s = 2 π L p C r
Any temperature-induced drift in L p or C r directly disrupts the critical timing defined in Equation (1), leading to a loss of ZVS, increased switching losses, and the performance degradation that this paper aims to address.

2.2. Analysis of Key Component Parameter Drift with Temperature

The precise timing of ZVS operation, governed by the resonant period T res , is critically dependent on the stability of the magnetizing inductance L p and the resonant capacitance C r . In practical applications, both components are susceptible to thermal variations, leading to a cumulative and performance-degrading timing mismatch.
The inductance L p is directly determined by the magnetic permeability μ of the transformer’s ferrite core. It is well known that the permeability of ferrite materials exhibits a strong, non-linear dependency on temperature. As temperature rises, μ ( T ) varies, which directly alters L p ( T ) according to the fundamental equation:
L p ( T ) = N 2 μ ( T ) A c l c
where N is the number of turns, A c is the core’s cross-sectional area, and l c is the magnetic path length. This introduces a primary source of error to the resonant timing.
The total resonant capacitance, C r , is the sum of the external capacitor ( C ext ) and the MOSFET’s parasitic output capacitance ( C oss ). While C oss inherently increases with temperature, the external capacitor, C ext , often becomes a dominant source of drift in mass-produced, cost-sensitive designs. To manage costs, commercial-grade Class II ceramic capacitors (e.g., with an X7R dielectric) are commonly employed.
The data sheet for these components reveals why they contribute significantly to thermal drift. Instead of providing a typical performance curve, manufacturers provide a guaranteed performance envelope. Table 1 summarizes the key thermal specifications for a standard commercial-grade X7R capacitor, extracted from its official data sheet [27].
The critical specification in this table is the guaranteed capacitance drift. A variation of up to ± 15 % over the operating temperature range is a substantial deviation for a timing-critical component. This inherent characteristic of the cost-effective X7R dielectric becomes a primary driver of the overall drift in C r .
In summary, the resonant period T res is subjected to a complex thermal drift resulting from the combined effects of variations in L p , C oss , and, most critically, C ext . This reality renders static, pre-programmed control timing ineffective and necessitates an online, adaptive control strategy.

2.3. Impact of Parameter Drift on Inverter Performance

To quantitatively understand how these component-level variations translate into system-level performance degradation, this section analyzes their cascading impact on two critical metrics: conversion efficiency and grid current quality.
First, the cornerstone of the inverter’s high efficiency—QR switching at the voltage valley—is compromised. As parameters drift, the pre-calculated turn-on delay no longer aligns with the actual resonant timing. This timing mismatch leads to hard switching events, which significantly increase MOSFET switching losses and, consequently, reduce overall conversion efficiency.
Second, the quality of the injected grid current deteriorates. The digital controller calculates the MOSFET on-time ( t o n ) for each switching cycle based on a precise model that uses nominal values for the primary inductance ( L p ) and resonant capacitance ( C r ). When these parameters drift, the calculated t o n becomes systemically erroneous. This error causes the injected current to deviate from its ideal sinusoidal reference, directly increasing the THD and compromising power quality.
Crucially, these two issues are not independent; rather, they are coupled in a detrimental positive feedback loop. The increased switching losses generate additional heat, which further exacerbates the initial parameter drift. This self-reinforcing cycle, where efficiency loss fuels further performance degradation, fundamentally highlights the inadequacy of any static, set-and-forget control strategy. Therefore, to break this feedback loop and ensure high performance across all operating conditions, an online, adaptive control framework is essential.

3. RNN-Based Online Self-Tuning Control Strategy

To address the performance degradation challenges detailed in Section 2—namely, the drop in efficiency and increased grid current distortion caused by heat-induced parameter drift—this section proposes a online self-tuning control strategy. This method leverages an RNN within a dual-timescale control framework. This section will first elaborate on the overall architecture and design rationale of this framework. Then, it will provide a detailed description of the RNN model’s specific design, including its inputs, outputs, and internal structure. Finally, the training methodology and implementation considerations for the controller will be presented.

3.1. Proposed Dual-Timescale Control Framework

Traditional control methods, such as fixed-parameter controllers or static Look-Up Tables (LUTs), are inherently incapable of compensating for the dynamic, temperature-dependent parameter drift analyzed previously. These methods operate on the premise of a time-invariant system, a premise that is invalidated by thermal effects during practical operation.
To overcome this limitation, a dual-timescale control architecture is proposed, as illustrated in Figure 3. This framework decouples the control problem into two distinct aspects.
  • Fast-Timescale Control: This domain is managed by a standard high-speed digital controller. On a cycle-by-cycle basis, it carries out the primary control plan to ensure there are rapid responses to input voltage and load variations. Specifically, it calculates the required MOSFET on-time ( t on ) using a model-based approach. The total switching period ( t s ) for a QR-controlled flyback inverter is composed of three intervals:
    t s = t on + t off + t r
    where t on is the MOSFET on-time, t off is the secondary diode conduction time, and t r is the resonant time. In a flyback inverter operating in Discontinuous Conduction Mode (DCM) or Quasi-Resonant (QR) mode, the on-time t on is calculated to regulate the average input current to follow a sinusoidal reference. A common control law for t on is derived from the inductor volt-second balance and power balance principles:
    t o n = 1 + n V i n V a c ( θ ) + 1 + n V i n V a c ( θ ) 2 + 2 V i n t r i r e f d c L p V i n i r e f d c
    where i r e f d c is the amplitude of the desired sinusoidal input current, and V a c ( θ ) is the instantaneous grid voltage. The accuracy of this calculation is fundamentally contingent on the accuracy of the resonant time parameter t r used by the controller.
  • Slow-Timescale Compensation: This domain is governed by the proposed RNN-based compensation module. Rather than reacting to instantaneous changes, the RNN observes the system’s electrical behavior over a longer timescale, using a sampled input sequence X t = [ V in , I in , I MPPT , I ac ] . By processing this time-series data, the RNN learns the complex, implicit correlation between the system’s operating state and the underlying parameter drift. It functions as an intelligent observer, inferring the necessary timing correction without direct temperature measurement. The RNN’s output is a correction term, Δ t delay , which is updated at a rate much slower than the switching frequency.
The final control action is a synthesis of the two time scales. The Δ t delay generated by the slow-timescale RNN is fed to the fast-timescale timing logic unit. This correction value is added to the nominal resonant time ( t r ), thereby adjusting the ZVS waiting time in real time. This online self-tuning mechanism enables the controller to proactively counteract the effects of thermal drift, maintaining optimal switching and high-performance operation across a wide range of operating temperatures.

3.2. RNN Model Design and Implementation

To achieve accurate online prediction of the delay time Δ t delay , this section elaborates on the design of the proposed RNN model, the methodology for generating training data, and the training process.

3.2.1. Input Feature and Output Definition

As rationalized in Section 2, the input feature vector for the RNN at each slow-timescale sampling instant t is defined as follows:
X t = [ V in , I in , I mppt , I ac ]
The vector comprises four key variables. V in (input voltage) and I in (input current) collectively represent the inverter’s input power and operating point. I mppt serves as a core command from the Maximum Power Point Tracking (MPPT) algorithm in photovoltaic applications, directly determining the desired power extraction point. Finally, I ac (RMS grid current) provides a comprehensive measure of the actual output load level. These four features collectively depict the macroscopic operating state of the inverter at any given moment. Critically, they are all variables that are either inherent to or easily calculated by the digital controller during normal operation, requiring no additional hardware sensors. This ensures the proposed scheme is inexpensive and highly practical
The model’s target output is a single scalar value:
y t = Δ t delay
where Δ t delay is the additional delay time required to compensate for the resonant period variation caused by the thermal drift of L p and C r . This value is directly used to adjust the post-turn-off waiting time of the PWM controller, ensuring the MOSFET turns on at the voltage valley in the next cycle.

3.2.2. Input Feature Correlation Analysis

To prove that the selected input feature vector, X t , contains sufficient information to predict the optimal delay compensation, Δ t delay , optimal , a correlation analysis was performed. A comprehensive dataset comprising tens of thousands of data points was constructed by conducting a large-scale parameter sweep (temperatures from 25 °C to 85 °C, loads from 20% to 100%) on the simulation platform. Subsequently, the Pearson Correlation Coefficient (PCC) between each input feature and the target output was calculated, with the results visualized in the heatmap shown in Figure 4.
The analysis reveals that no single input feature exhibits a strong linear relationship with Δ t delay , optimal (all PCC absolute values are below 0.7), which explains why traditional compensation methods based on a single variable (e.g., temperature or load alone) are bound to fail. However, these features collectively form an information-rich vector. For instance, the variation in I ac indirectly reflects the degradation in THD, while the change in I in is related to fluctuations in system efficiency, both of which are caused by an inaccurate t r . Therefore, although the relationships are highly non-linear and coupled, this set of easily accessible electrical quantities physically contains the fingerprint of the system’s performance state. This provides a solid data-driven foundation on whose basis the RNN model can learn the inherent complex dynamics and accurately infer Δ t delay , optimal .

3.2.3. Network Architecture and Hyperparameter Selection

To effectively extract the deep features related to heat-induced drift from the input time-series data, a multi-layer network architecture was designed, as illustrated in Figure 5. The core of this architecture is a Gated Recurrent Unit (GRU) layer, which is particularly adept at handling long-term dependencies in sequential data.
The GRU cell selectively remembers and forgets historical information through its internal update gate ( z t ) and reset gate ( r t ). At each time step t, its state update follows these core mathematical principles:
Update Gate : z t = σ ( W z X t + U z h t 1 + b z )
Reset Gate : r t = σ ( W r X t + U r h t 1 + b r )
Candidate State : h ˜ t = tanh ( W h X t + U h ( r t h t 1 ) + b h )
Final State : h t = ( 1 z t ) h t 1 + z t h ˜ t
where X t is the input feature vector at the current time step, and h t 1 is the hidden state from the previous time step. W and U are learnable weight matrices, and b represents bias vectors. σ and tanh are the Sigmoid and hyperbolic tangent activation functions, respectively, and ⊙ denotes the element-wise product.
The entire data-processing pipeline within the network unfolds as follows:
  • Input Layer: The network accepts an input sequence with a shape corresponding to ( L , 4 ), where sequence length L = 16 , and the feature dimension is 4 (i.e., X t = [ V in , I in , I MPPT , I ac ] ).
  • GRU Hidden Layer: This sequence is fed into a GRU layer containing 32 neurons. This layer acts as a temporal feature encoder, with its primary function being to compress and encode the dynamic information contained in the input sequence into its final hidden state vector.
  • Dense Layer: The final hidden state from the GRU layer is then passed to a fully connected (Dense) layer with 16 neurons. This layer, using the ReLU activation function, performs further non-linear transformations and high-level feature extraction.
  • Output Layer: Finally, a single-neuron output layer with a linear activation function maps the extracted high-level features to a scalar value, which is the predicted delay compensation time, Δ t delay .
To ensure effective and stable model training, the key hyperparameters were configured as summarized in Table 2.

3.2.4. Generating Training Data via Simulation

To facilitate the analysis and verify the proposed control strategies, a comprehensive simulation model was developed in MATLAB/Simulink. The model, depicted in Figure 6, integrates the complete power stage of the quasi-single-stage inverter with the core control blocks, including MPPT, QR control, and the TLC algorithm.
This principle is visually detailed in Figure 7 and Figure 8. The waveforms illustrate the precise timing relationship required to achieve ZVS. The optimal delay time, Δ t delay _ optimal , which serves as the ground-truth label for RNN training, is the measured interval from the ZCD signal detection to the first valley of the drain-source voltage ( V d s ), at which point the MOSFET is turned on to minimize switching losses.
To train the proposed RNN model, it is imperative to construct a large-scale, high-fidelity dataset that accurately reflects the relationship between the inverter’s electrical behavior and the optimal delay compensation. To this end, a comprehensive closed-loop simulation platform was developed in the MATLAB/Simulink environment. The data generation process was structured as follows:
  • Ground-Truth-Label Acquisition: For each specific operating point (i.e., a combination of T, V in , and I MPPT ), a unique “optimal delay time,” Δ t delay _ optimal , that achieves perfect ZVS exists. To acquire this ground-truth label, an “ideal observer” strategy was employed in the simulation. At each operating point, the system precisely measured the actual time from the generation of the ZCD signal to the moment the V ds waveform reached its first valley. This measured time was then recorded as the target output that the model needed to learn.
  • Parameter Sweep Protocol: To ensure the comprehensiveness and diversity of the dataset, a parameter sweep protocol covering the entire operating range of the inverter was designed. A vast number of operating condition samples were systematically generated by iterating through the following key variables in a combinatorial manner:
    Operating Temperature (T): The temperature is increased from 25 °C to 100 °C in discrete steps of 5 °C to simulate the entire process from cold start to thermal stability.
    Input Voltage ( V in ): The voltage is ramped up across the nominal input range of 30 V to 50 V to cover different photovoltaic cell output voltages.
    Load Level ( I MPPT ): The load level is increased from 20% to 100% of the nominal output power to simulate varying solar irradiance levels.
  • Data Recording and Dataset Summary: During this sweep, for each generated operating point, the simulation was run until it reached a steady state. Subsequently, the system recorded the input feature sequence X t = [ V in , I in , I MPPT , I ac ] over a length of 16 sampling points, along with its corresponding ground-truth label Δ t delay _ optimal . Through this automated process, a dataset containing over 10,000 unique (input sequence–output label) data pairs was ultimately generated, providing a solid foundation for subsequent model training.
To enhance the robustness of the RNN model against potential discrepancies between simulation and real hardware, we incorporate several strategies during and after training. First, we fine-tune the pre-trained RNN with limited real-world data collected from prototypes, employing transfer-learning techniques to adapt the model to hardware-specific variabilities (as further validated in Section 4.1). Second, during the training process, we integrate robustness-enhancing methods, such as adding synthetic noise to the input data to simulate hardware imperfections like sensor inaccuracies and electromagnetic interference. These approaches ensure the model is generalized beyond the simulation environment.

3.2.5. Model Training and Offline Validation

After obtaining the simulation dataset, we proceeded to the model-training and validation phase. The entire dataset was randomly partitioned into three subsets: 70% for training (the training set), 15% for validation (the validation set), and 15% for testing (the test set).
The training set was used to iteratively update the network’s weights and biases via the backpropagation algorithm. The validation set played a critical monitoring role by evaluating the model’s generalization ability after each epoch, enabling the use of an early-stopping strategy to prevent overfitting.
The training process is visualized in Figure 9, which plots the Mean Squared Error (MSE) for both the training and validation sets against the number of epochs. As depicted, both loss curves decrease rapidly and converge to a very low level. Crucially, the validation loss closely tracks the training loss without diverging, which strongly indicates that the model did not overfit and possesses good generalization capability.
Upon completion of training, the model’s final predictive performance was rigorously evaluated on the unseen test set. To visually and quantitatively assess its precision, we plotted the model’s predicted values ( Δ t delay _ pred ) against the ground-truth values ( Δ t delay _ optimal ), as shown in Figure 10.
The data points in Figure 10 are tightly clustered around the y = x diagonal, indicating a strong linear correlation and high predictive accuracy. Quantitative analysis confirms this visual assessment, with the model achieving a coefficient of determination (R2) of 0.998 and a Root Mean Square Error (RMSE) of less than 2 ns. This offline performance provides substantial evidence that the trained GRU model has successfully learned the complex, non-linear mapping from external electrical quantities to the internal optimal delay compensation.

4. Case Study

To rigorously evaluate the proposed control strategy, a comprehensive closed-loop simulation platform was established in the MATLAB/Simulink environment. The platform was used to meticulously model a 500 W two-phase interleaved quasi-resonant flyback inverter. The key modules of the platform include the following:
  • PV Array Model: It simulates the output characteristics of a photovoltaic panel under varying irradiance ( I r ) and temperature (T).
  • Power Stage: It implements the main circuit topology, featuring the interleaved flyback inverters and the secondary-side full-bridge unfolding circuit for grid interface. Crucially, it incorporates a custom block that dynamically adjusts the magnetizing inductance ( L p ) and resonant capacitance ( C r ) based on an external temperature signal, thus simulating the thermal drift phenomena detailed in Section 2.2.
  • MPPT Controller: This is an MPPT algorithm block that generates the reference current amplitude ( I MPPT ) to maximize power extraction.
  • QR Controller: This is a digital controller block that executes the quasi-resonant control logic, including the calculation of t on based on Equation (4) and the generation of interleaved PWM drive signals ( d 1 , d 2 ).

4.1. Validation of the Fidelity of the Simulation Platform

To establish a high degree of confidence in the simulation platform, we rigorously validated its fidelity against a 500 W laboratory hardware prototype. The experimental platform, shown in Figure 11, includes a PV simulator (ITECH IT-N2121; ITECH Electronic Co., Ltd., Nanjing, China) and a power grid simulator (Ikon-Tech PRE2006S; Xi’an Ikon-Tech Power Co., Ltd., Xi’an, China). High-precision measurements were conducted using a power meter (ZLG PA333H; ZLG Electronics, Guangzhou, China) and an oscilloscope (RIGOL DHO924; RIGOL Technologies, Suzhou, China). The key parameters of the simulation model were meticulously configured to mirror those of the physical prototype.
Instead of a single-point comparison, the validation was conducted across a spectrum of representative operating conditions, including variations in load power and ambient temperature. Key performance indicators—specifically, conversion efficiency ( η ), grid current THD, and RMS grid current—were measured from both the simulation and the hardware. The key specifications of the experimental prototype and the associated measurement equipment are detailed in Table 3.
The comparative results are summarized in Table 4. Across all the scenarios tested, the simulated data demonstrates excellent agreement with the hardware measurements. The relative error for efficiency remains below 0.5%, while the errors for THD and I grid are consistently under 6%. This strong correlation confirms that the simulation model accurately captures not only the fundamental operations but also the subtle performance variations of the real-world system. This high-fidelity validation provides a solid and reliable foundation for a subsequent comparative analysis of different control strategies conducted purely within the simulation environment.

4.2. Performance Comparison and Analysis

To quantitatively evaluate the performance of the proposed RNN-based online compensation strategy under dynamic thermal stress, a key simulation experiment was designed. In this experiment, the inverter initially operates under nominal conditions at an ambient temperature of 25 °C. At t = 0.5 s, a thermal step is applied, rapidly increasing the operating temperature of key components to 85 °C. This simulates the heating process that occurs during practical operation. The dynamic responses of the following three control strategies were compared:
  • No Compensation (NC): The controller applies no delay compensation—i.e., Δ t delay = 0 .
  • Fixed-Parameter Compensation (FPC): The controller uses a fixed delay compensation value that is optimally tuned at 25 °C. This represents the conventional offline calibration method.
  • Proposed RNN-Based Compensation (RNN): The controller employs our proposed online self-tuning strategy, where Δ t delay is generated in real time by the pre-trained GRU model.
Two key performance indicators were monitored: system efficiency ( η ) and the THD of the grid current.

4.2.1. Efficiency Comparison and Analysis

Figure 12 illustrates the dynamic efficiency curves of the three control strategies under the thermal step event.
For t < 0.5 s, the system operates at 25 °C. In this region, both the FPC and the proposed RNN strategies exhibit optimal performance, with the efficiency stabilizing at approximately 93.6%. In contrast, the NC strategy achieves an efficiency of only 92.1%.
Once t = 0.5 s, the temperature rises to 85 °C. The efficiency of the NC strategy deteriorates further to about 90.1%. For the FPC strategy, its previously optimal fixed compensation value for 25 °C is no longer suitable, leading to a sharp drop in efficiency to 90.5%, a performance degradation of 3.1%. In stark contrast, the proposed RNN controller rapidly adjusts the delay compensation Δ t delay , successfully tracking the new ZVS valley. Consequently, its efficiency stabilizes at around 93.5% after a minor transient dip, remaining almost unaffected by the thermal variation. This provides strong evidence of the proposed method’s excellent robustness in maintaining high system efficiency.

4.2.2. Grid Current Quality Comparison and Analysis

In addition to efficiency, the quality of the grid-injected current, measured by its THD, is another critical dimension for evaluating inverter performance. Figure 13 compares the THD of the grid current for the three control strategies during the same thermal step.
At the nominal temperature of 25 °C (for t < 0.5 s), both the FPC and the proposed RNN strategies achieve precise ZVS operation. Consequently, their THD values remain at an excellent, low level of approximately 1.8%. In contrast, the NC strategy exhibits a THD of 3.5%.
After the temperature step-up at t = 0.5 s, the THD of the NC strategy further degrades to 5.5%. For the FPC strategy, its fixed compensation value becomes entirely invalid at this high temperature, causing severe hard-switching and current waveform distortion. Its THD value skyrockets to 5.8%, a degradation of 4.0 percentage points, far exceeding grid-tie limits. In stark contrast, after detecting the change in operating conditions, the proposed RNN strategy almost instantaneously adjusts the delay compensation. As a result, its THD quickly recovers and stabilizes at around 1.9% after a brief transient period (≈50 ms). This result clearly demonstrates that only the RNN strategy can consistently maintain excellent grid current quality over a wide temperature range.
To demonstrate the proposed RNN-based control strategy’s effectiveness in mitigating waveform distortion, a comparative test was conducted under identical operating conditions.
Figure 14 presents the steady-state grid current waveform when the system operates with fixed, pre-calibrated parameters. Due to component drift under thermal stress, the waveform exhibits noticeable distortion, and the measured Total Harmonic Distortion (THD) is 5.8%.
In contrast, Figure 15 shows the result after activating the proposed RNN-based self-tuning control strategy. The controller effectively compensates for the real-time deviations, restoring a clean sinusoidal shape. As a result, the THD significantly decreased to 3.3%, which fully complies with grid-tie standards such as IEEE 1547 [31]. This comparison provides direct evidence that the control of the flyback stage is paramount for achieving high power quality in this topology.

5. Conclusions

We have proposed and validated an online self-tuning control strategy based on a Recurrent Neural Network (RNN) to counteract the prevalent heat-induced performance degradation in flyback inverters.
The core contribution of this study lies in its introduction of a controller capable of inferring the optimal switching delay compensation in real time using only standard electrical measurements (such as input/output voltages and currents) without the need for additional temperature sensors or complex physical models. Our simulation results demonstrate the strategy’s superiority: under a typical thermal transient, a conventional fixed-parameter approach saw its efficiency drop by over 2.8% and its THD rise by over 4.0%. In contrast, the proposed RNN strategy maintained an efficiency above 93.6% and a THD below 3.0%, effectively nullifying the impact of parameter drift.

Author Contributions

Conceptualization, X.P. and G.G.; methodology, X.P. and Q.J.; software, X.P.; validation, X.P.; formal analysis, X.P.; investigation, X.P.; resources, X.P.; data curation, X.P.; writing—original draft preparation, X.P., G.G. and Q.J.; writing—review and editing, X.P., C.C. and Z.B.; visualization, X.P.; supervision, X.P.; project administration, X.P. and Z.B.; funding acquisition, X.P., C.C. and Z.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. The data are not publicly available as they form part of an ongoing study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sarani, S.; Abootorabi Zarchi, H.; Delavaripour, H. Ripple-free input current flyback converter using a simple passive circuit. IEEE Trans. Ind. Electron. 2022, 69, 2557–2564. [Google Scholar] [CrossRef]
  2. Ferdowsi, M.; Emadi, A.; Telefus, M. Pulse regulation control technique for flyback converter. IEEE Trans. Power Electron. 2005, 20, 798–805. [Google Scholar] [CrossRef]
  3. Ali, A.I.M.; Ali, A.; Shaaban, M.F. Discontinuous modulation technique for isolated three-phase grid connected flyback inverter with selective harmonic compensation for PV and fuel cell systems. IEEE J. Emerg. Sel. Top. Power Electron. 2025, 13, 2849–2863. [Google Scholar] [CrossRef]
  4. Kasa, N.; Iida, T.; Chen, L. Flyback inverter controlled by sensor-less current MPPT for photovoltaic power system. IEEE Trans. Ind. Electron. 2005, 52, 1145–1152. [Google Scholar] [CrossRef]
  5. Tamyurek, B.; Kirimer, B. An interleaved high-power flyback inverter for photovoltaic applications. IEEE Trans. Power Electron. 2015, 30, 3228–3241. [Google Scholar] [CrossRef]
  6. Vračar, D.Đ.; Pejovič, P.V. Active-clamp flyback converter as auxiliary power-supply of an 800 V inductive-charging system for electric vehicles. IEEE Access 2022, 10, 38254–38271. [Google Scholar] [CrossRef]
  7. Milas, N.T.; Tatakis, E.C. Fast battery cell voltage equalizer based on the bidirectional flyback converter. IEEE Trans. Transp. Electrif. 2023, 9, 4922–4940. [Google Scholar] [CrossRef]
  8. Cao, Y.; Li, K.; Lu, M. Balancing method based on flyback converter for series-connected cells. IEEE Access 2021, 9, 52393–52403. [Google Scholar] [CrossRef]
  9. Chen, C.J.; Cheng, C.H.; Wu, P.S. Unified small-signal model and compensator design of flyback converter with peak-current control at variable frequency for USB power delivery. IEEE Trans. Power Electron. 2019, 34, 783–793. [Google Scholar] [CrossRef]
  10. Hsieh, Y.C.; Chen, M.R.; Cheng, H.L. An interleaved flyback converter featured with zero-voltage transition. IEEE Trans. Power Electron. 2011, 26, 79–84. [Google Scholar] [CrossRef]
  11. Pagliosa, M.A.; Lazzarin, T.B.; Barbi, I. Modular two-switch flyback converter and analysis of voltage-balancing mechanism for input-series and output-series connection. IEEE Trans. Power Electron. 2019, 34, 8317–8328. [Google Scholar] [CrossRef]
  12. Park, J.; Moon, Y.J.; Jeong, M.G.; Kang, J.G.; Kim, S.H.; Gong, J.C.; Yoo, C. Quasi-resonant (QR) controller with adaptive switching frequency reduction scheme for flyback converter. IEEE Trans. Ind. Electron. 2016, 63, 3571–3581. [Google Scholar] [CrossRef]
  13. Tang, C.Y.; Lin, W.Z.; Tan, Y.C. An active clamp flyback converter with high precision primary-side regulation strategy. IEEE Trans. Power Electron. 2022, 37, 10281–10289. [Google Scholar] [CrossRef]
  14. Tran, T.N.T.; Xu, H.Y.; Wang, J.M. Development of active-clamp flyback converter for improving light-load efficiency. IEEE J. Emerg. Sel. Top. Power Electron. 2024, 12, 2456–2469. [Google Scholar] [CrossRef]
  15. Wang, C.M. A novel ZCS-PWM flyback converter with a simple ZCS-PWM commutation cell. IEEE Trans. Ind. Electron. 2008, 55, 749–757. [Google Scholar] [CrossRef]
  16. Chung, H.S.H.; Hui, S.Y.R.; Wang, W.H. A zero-current-switching PWM flyback converter with a simple auxiliary switch. IEEE Trans. Power Electron. 1999, 14, 329–342. [Google Scholar] [CrossRef]
  17. Cheng, C.H.; Chen, C.J.; Wang, S.S. An adaptive variable-frequency control with constant crossover frequency achieving fast transient response for wide-operation-range flyback converter. IEEE Trans. Power Electron. 2019, 34, 5537–5547. [Google Scholar] [CrossRef]
  18. Liang, T.J.; Chen, K.H.; Chen, J.F. Primary side control for flyback converter operating in DCM and CCM. IEEE Trans. Power Electron. 2018, 33, 3604–3612. [Google Scholar] [CrossRef]
  19. Dong, H.; Xie, X.; Zhang, L. A new primary PWM control strategy for CCM synchronous rectification flyback converter. IEEE Trans. Power Electron. 2020, 35, 4457–4461. [Google Scholar] [CrossRef]
  20. Kang, S.H.; Maksimović, D.; Cohen, I. Efficiency optimization in digitally controlled flyback DC–DC converters over wide ranges of operating conditions. IEEE Trans. Power Electron. 2012, 27, 3734–3748. [Google Scholar] [CrossRef]
  21. Hu, J.; Wen, B.; Burgos, R. Design of a wide-input-voltage PCB-embedded transformer based active-clamp flyback converter considering permeability degradation. IEEE Trans. Power Electron. 2021, 36, 10355–10365. [Google Scholar] [CrossRef]
  22. Budihardjo, I.; Lauritzen, P.O. The lumped-charge power MOSFET model, including parameter extraction. IEEE Trans. Power Electron. 1995, 10, 379–387. [Google Scholar] [CrossRef]
  23. Garcia Rodriguez, L.A.; Chiacchiarini, H.G.; Carballo Rojas, D. Adaptive boundary control using natural switching surfaces for flyback converters operating in the boundary conduction mode with parameter uncertainties. IEEE Trans. Power Electron. 2019, 34, 8118–8137. [Google Scholar] [CrossRef]
  24. Yao, K.; Li, H.; Li, L. A noninvasive online monitoring method of output capacitor’s C and ESR for DCM flyback converter. IEEE Trans. Power Electron. 2019, 34, 5748–5763. [Google Scholar] [CrossRef]
  25. Xu, S.; Kou, X.; Wang, C. New digital control method for improving dynamic response of synchronous rectified PSR flyback converter with CCM and DCM modes. IEEE Trans. Power Electron. 2020, 35, 12347–12358. [Google Scholar] [CrossRef]
  26. Sun, D.; Wei, X.; Wang, C. An improved dynamic control method for constant current controlled PSR flyback converter. IEEE Trans. Ind. Electron. 2024, 71, 14033–14043. [Google Scholar] [CrossRef]
  27. KEMET Electronics Corporation. Ceramic, SMD, MLCC, Class II, X7R, 16 VDC, 0.1 uF, 10%, 0603. C0603C104K4RACTU Datasheet. 2024. Available online: https://content.kemet.com/datasheets/KEM_C1002_X7R_SMD.pdf (accessed on 15 November 2025).
  28. Wang, X.; Blaabjerg, F.; Wu, W. Modeling and Analysis of Harmonic Stability in an AC Power-Electronics-Based Power System. IEEE Trans. Power Electron. 2014, 29, 6421–6432. [Google Scholar] [CrossRef]
  29. Kang, Y.C.; Chiu, C.C.; Lin, M.; Yeh, C.P.; Lin, J.M.; Chen, K.H. Quasi resonant control with a dynamic frequency selector and constant current startup technique for 92% peak efficiency and 85% light-load efficiency flyback converter. IEEE Trans. Power Electron. 2014, 29, 4959–4969. [Google Scholar] [CrossRef]
  30. Han, X.; Chang, C.; He, L. Quasi-resonant flyback PSR converter with adaptive frequency control. J. Power Electron. 2020, 20, 341–349. [Google Scholar] [CrossRef]
  31. IEEE Std 1547-2018; IEEE Standard for Interconnection and Interoperability of Distributed Energy Resources with Associated Electric Power Systems Interfaces. IEEE: New York, NY, USA, 2018.
Figure 1. Schematic of the two-phase interleaved flyback inverter.
Figure 1. Schematic of the two-phase interleaved flyback inverter.
Energies 19 01788 g001
Figure 2. Key operational waveforms during one switching cycle in QR mode, illustrating the energy storage phase ( t 0 t 1 ), the energy transfer phase ( t 1 t 2 ), and the resonant phase (after t 2 ).
Figure 2. Key operational waveforms during one switching cycle in QR mode, illustrating the energy storage phase ( t 0 t 1 ), the energy transfer phase ( t 1 t 2 ), and the resonant phase (after t 2 ).
Energies 19 01788 g002
Figure 3. Architecture of the proposed RNN-based online self-tuning control system.
Figure 3. Architecture of the proposed RNN-based online self-tuning control system.
Energies 19 01788 g003
Figure 4. Heatmap of the Pearson correlation coefficients between the selected input features ( V in , I in , I MPPT , and I ac ) and the target output ( Δ t delay , optimal ).
Figure 4. Heatmap of the Pearson correlation coefficients between the selected input features ( V in , I in , I MPPT , and I ac ) and the target output ( Δ t delay , optimal ).
Energies 19 01788 g004
Figure 5. Schematic of the proposed GRU-based neural network architecture.
Figure 5. Schematic of the proposed GRU-based neural network architecture.
Energies 19 01788 g005
Figure 6. The complete MATLAB/Simulink model of the proposed quasi-single-stage PV inverter, including power stage and control blocks.
Figure 6. The complete MATLAB/Simulink model of the proposed quasi-single-stage PV inverter, including power stage and control blocks.
Energies 19 01788 g006
Figure 7. Key switching waveforms of the quasi-resonant flyback converter over several cycles. This illustrates the overall principle of achieving zero-voltage switching (ZVS) by turning on the MOSFET during the valley of the drain-source voltage ( V d s ).
Figure 7. Key switching waveforms of the quasi-resonant flyback converter over several cycles. This illustrates the overall principle of achieving zero-voltage switching (ZVS) by turning on the MOSFET during the valley of the drain-source voltage ( V d s ).
Energies 19 01788 g007
Figure 8. Zoomed-in view detailing the ZVS turn-on event. The optimal delay time ( Δ t delay _ optimal ), which serves as the ground-truth label for the RNN, is explicitly shown as the interval between the zero-current detection (ZCD) signal and the first valley of the V d s waveform.
Figure 8. Zoomed-in view detailing the ZVS turn-on event. The optimal delay time ( Δ t delay _ optimal ), which serves as the ground-truth label for the RNN, is explicitly shown as the interval between the zero-current detection (ZCD) signal and the first valley of the V d s waveform.
Energies 19 01788 g008
Figure 9. Training and validation loss (MSE) curves of the GRU model.
Figure 9. Training and validation loss (MSE) curves of the GRU model.
Energies 19 01788 g009
Figure 10. Correlation plot of predicted vs. actual compensation values on the test dataset.
Figure 10. Correlation plot of predicted vs. actual compensation values on the test dataset.
Energies 19 01788 g010
Figure 11. Photograph of the laboratory hardware prototype and experimental test platform.
Figure 11. Photograph of the laboratory hardware prototype and experimental test platform.
Energies 19 01788 g011
Figure 12. Dynamic efficiency curves of the three control strategies during the thermal step event.
Figure 12. Dynamic efficiency curves of the three control strategies during the thermal step event.
Energies 19 01788 g012
Figure 13. Grid current THD of the three control strategies during the same thermal step.
Figure 13. Grid current THD of the three control strategies during the same thermal step.
Energies 19 01788 g013
Figure 14. Experimental grid current waveform without the proposed self-tuning control scheme.
Figure 14. Experimental grid current waveform without the proposed self-tuning control scheme.
Energies 19 01788 g014
Figure 15. Experimental grid current waveform with the proposed RNN-based self-tuning control activated.
Figure 15. Experimental grid current waveform with the proposed RNN-based self-tuning control activated.
Energies 19 01788 g015
Table 1. Key thermal specifications of a commercial-grade X7R ceramic capacitor [27].
Table 1. Key thermal specifications of a commercial-grade X7R ceramic capacitor [27].
ParameterSpecification
Dielectric TypeX7R
EIA ClassificationClass II
Operating Temperature Range−55 °C to +125 °C
Guaranteed Capacitance Drift ± 15 % (over operating range)
Table 2. Key hyperparameters for model training.
Table 2. Key hyperparameters for model training.
HyperparameterValue
OptimizerAdam
Learning Rate0.001
Loss FunctionMean Squared Error (MSE)
Batch Size64
Epochs100
Table 3. Key specifications of the experimental setup.
Table 3. Key specifications of the experimental setup.
ParameterValue/Model/Specification
Prototype Parameters
TopologyQuasi-Single-Stage Interleaved Flyback
Input Voltage ( V p v )25 V–55 V
Grid Voltage/Frequency230 V/50 Hz
Rated Power ( P r a t e d )500 W
Switching Frequency ( f s w )100 kHz–300 kHz
Nominal Primary Inductance ( L p , n o m )3.0 μH
MOSFETHGN119N15S
Digital Signal ProcessorTI TMS320F280025
Measurement Equipment
Power AnalyzerDEWETRON TRIONET3 (±0.1%)
OscilloscopeTektronix TDS 2000 (±2%)
Voltage/Current ProbesTektronix P5200A (±1%)
Table 4. Validation of the simulation model against hardware prototype.
Table 4. Validation of the simulation model against hardware prototype.
Operating ConditionMetricSimulationHardwareRel. Error
Efficiency ( η )95.85%95.61%0.25%
Full Load (500 W, 25 °C)THD2.70%2.85%5.26%
I grid (A)2.272.260.44%
Efficiency ( η )94.40%94.15%0.27%
Half Load (250 W, 25 °C)THD3.40%3.55%4.23%
I grid (A)1.141.121.79%
Efficiency ( η )95.20%94.95%0.26%
Full Load (500 W, 85 °C)THD2.95%3.10%4.84%
I grid (A)2.272.260.44%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Pan, X.; Geng, G.; Jiang, Q.; Chen, C.; Bai, Z. Online Self-Tuning Control of Flyback Inverters Using Recurrent Neural Networks for Thermally Induced Performance Degradation Compensation. Energies 2026, 19, 1788. https://doi.org/10.3390/en19071788

AMA Style

Pan X, Geng G, Jiang Q, Chen C, Bai Z. Online Self-Tuning Control of Flyback Inverters Using Recurrent Neural Networks for Thermally Induced Performance Degradation Compensation. Energies. 2026; 19(7):1788. https://doi.org/10.3390/en19071788

Chicago/Turabian Style

Pan, Xun, Guangchao Geng, Quanyuan Jiang, Cuiqin Chen, and Zhihong Bai. 2026. "Online Self-Tuning Control of Flyback Inverters Using Recurrent Neural Networks for Thermally Induced Performance Degradation Compensation" Energies 19, no. 7: 1788. https://doi.org/10.3390/en19071788

APA Style

Pan, X., Geng, G., Jiang, Q., Chen, C., & Bai, Z. (2026). Online Self-Tuning Control of Flyback Inverters Using Recurrent Neural Networks for Thermally Induced Performance Degradation Compensation. Energies, 19(7), 1788. https://doi.org/10.3390/en19071788

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop