Single-phase pwm rectifier control method and controller

By introducing a neural network controller with embedded physical evolution laws into a single-phase PWM rectifier, the problems of slow dynamic response and poor parameter robustness are solved, achieving fast dynamic response and strong ripple suppression, thus improving control performance and robustness.

CN122639631APending Publication Date: 2026-08-25WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610625233.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-08
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing single-phase PWM rectifier control suffers from slow dynamic response and poor parameter robustness, making it difficult to simultaneously achieve fast dynamic response and double power frequency ripple suppression. Traditional control strategies also suffer from phase lag and parameter sensitivity issues.

Method used

A neural network with embedded physical evolution laws is used as the voltage outer loop controller. Through end-to-end offline training, a differentiable physical evolution model and a composite loss function are used to achieve intelligent suppression of double power frequency ripple in DC bus voltage, replacing the traditional proportional-integral and notch filter scheme.

Benefits of technology

The cutoff frequency of the voltage loop has been increased, resulting in faster voltage recovery and smaller voltage sag. It also features strong parameter robustness and high steady-state accuracy, low computational complexity, and ease of engineering implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122639631A_ABST
    Figure CN122639631A_ABST
Patent Text Reader

Abstract

The application relates to a single-phase PWM rectifier control method and a controller, an LCL type PWM rectifier, which comprises taking a DC bus voltage error and error integration as inputs of a neural network controller and outputting an AC side current amplitude instruction; synthesizing an AC side reference current according to the AC side current amplitude instruction and phase information of a grid voltage connected to the single-phase PWM rectifier; performing current inner loop control processing to obtain a modulation signal; driving power switch devices of the single-phase PWM rectifier to turn on and turn off; weight parameters of the neural network controller are determined through end-to-end offline training in advance and remain fixed during execution of the control method; the end-to-end offline training is based on a differentiable physical evolution model, and the differentiable physical evolution model explicitly contains a double-frequency ripple component caused by AC side instantaneous power pulsation; the method can effectively suppress the double-frequency ripple, realize extremely fast dynamic response and strong parameter robustness and nonlinear control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of converter technology, specifically to a single-phase PWM rectifier control method and controller. Background Technology

[0002] Single-phase PWM rectifiers, as efficient AC / DC converters, are widely used in electric vehicle charging stations, photovoltaic inverters, uninterruptible power supplies (UPS), and other fields. The core task of their control system is to maintain a stable DC bus voltage and ensure that the grid-side current is a unity power factor sine wave. Because the instantaneous power of single-phase AC fluctuates at twice the power frequency, a ripple at twice the power frequency is unavoidable in the DC bus voltage.

[0003] Currently, the mainstream single-phase PWM rectifier voltage loop control in the industry typically employs a linear control architecture combining a proportional-integral (PI) controller and a notch filter. The notch filter is used to filter out the double-frequency ripple in the voltage sampling signal, preventing this ripple from entering the current loop and causing grid-side current distortion; the PI controller is used to regulate the DC voltage to track the setpoint without steady-state error. However, this traditional approach has the following main drawbacks: First, slow dynamic response. The introduction of the notch filter significantly introduces phase lag, limiting the voltage loop cutoff frequency, resulting in large voltage drops and long recovery times during load changes. Second, parameter sensitivity. PI parameters are usually designed for specific operating conditions, and cannot provide optimal performance when the grid voltage fluctuates or the load changes over a wide range. Third, design trade-offs are difficult. Filtering ripple requires low bandwidth, while fast response requires high bandwidth; it is difficult to achieve both simultaneously.

[0004] To improve dynamic performance and disturbance rejection capability, advanced control strategies such as model predictive control, feedforward predictive control, and linear active disturbance rejection control have been introduced in existing technologies. However, none of these strategies can simultaneously achieve fast dynamic response, high steady-state accuracy, and strong robustness. Although some studies have attempted to combine multiple current control strategies, they mostly employ static weighting or hard switching methods, which are prone to control conflicts. Furthermore, the voltage outer loop and current inner loop lack a collaborative optimization mechanism, leaving room for further improvement in overall performance.

[0005] Therefore, there is an urgent need for a nonlinear control method that can overcome the bandwidth limitations of linear systems, effectively suppress double-frequency ripple, and achieve extremely fast dynamic response and strong parameter robustness. Summary of the Invention

[0006] This application provides a single-phase PWM rectifier control method and controller. It utilizes a neural network with embedded physical evolution laws as the voltage outer loop controller. By introducing smoothness constraints during the training phase, it achieves intelligent suppression of twice the power frequency ripple in the DC bus voltage, thereby replacing the traditional proportional-integral plus notch filter scheme. This solves the technical problems of mutual constraint between dynamic response and ripple suppression and poor parameter robustness in the existing single-phase PWM rectifier control.

[0007] First, a control method for a single-phase PWM rectifier is proposed. This control method is applied to an LCL-type PWM rectifier and includes the following steps: S1: The DC bus voltage error is calculated based on the sampled value and preset value of the DC bus voltage of the PWM rectifier, and the DC bus voltage error is accumulated over the control cycle to obtain the error integral; S2: The DC bus voltage error and the error integral are used as inputs to the neural network controller, which outputs an AC side current amplitude command via forward inference. The weight parameters of the neural network controller are predetermined through end-to-end offline training and remain fixed during the execution of the control method. The end-to-end offline training is based on a differentiable physical evolution model, which explicitly includes a double power frequency ripple component caused by instantaneous power fluctuations on the AC side. The end-to-end offline training aims to make the AC side current amplitude command output by the neural network controller immune to the double power frequency ripple component. S3: Based on the AC side current amplitude command and the phase information of the grid voltage connected to the single-phase PWM rectifier, obtain the AC side reference current; S4: The actual AC side current and the AC side reference current of the single-phase PWM rectifier are processed by the deadbeat controller to obtain the modulation signal, thereby generating the PWM signal to control the power switch to turn on and off; The end-to-end offline training aims to minimize the composite loss function. The composite loss function includes at least a voltage tracking error term and a control quantity smoothing penalty term. The control quantity smoothing penalty term is used to penalize the change in the AC side current amplitude command output by the neural network controller during adjacent control cycles.

[0008] Furthermore, the voltage tracking error term is: The control quantity smoothing penalty term is: The composite loss function is: in, For voltage tracking error term, To control the smoothing penalty term, For composite loss function, This is the DC bus reference voltage. The AC side current amplitude command output by the neural network controller in the kth control cycle. The current amplitude command is output by the neural network. This is the AC side current amplitude command for the (k-1)th control cycle. for discrete sampled values, This is the current DC bus voltage. This represents the total number of control cycles in the time series simulation. These are the smoothing weighting coefficients.

[0009] Furthermore, the construction process of the differentiable physical evolution model includes: Calculate instantaneous input power: ; Calculate the power absorbed by the capacitor: ; Calculate the power consumption of the load: ; By simultaneously considering the instantaneous input power, the power absorbed by the capacitor, and the power consumed by the load, we obtain the transient power balance equation in the continuous time domain: ; The transient power balance equation in the continuous-time domain is discretized to obtain a differentiable physical evolution model; the differentiable physical evolution model is as follows: ; in, The instantaneous active power input on the AC side. DC bus capacitor C Absorbed power The power consumed by the DC load. ω represents the peak value of the grid voltage, and ω represents the angular frequency of the grid voltage. The current amplitude command is output by the neural network. This is the current capacitor current. For DC bus capacitors, The rate of change of the DC bus voltage. This is the current DC bus voltage. The current load resistance, The time step of the control cycle is k, where k is the control cycle number. For discrete time steps, Let be the DC bus voltage in the k-th control cycle. The AC side current amplitude command output by the neural network controller in the kth control cycle. The DC bus voltage for the next control cycle is output by the differentiable physical evolution model.

[0010] Furthermore, the DC bus voltage error is divided by a preset voltage normalization reference to obtain the normalized DC bus voltage error; the error integral is first subjected to a preset limiting range and then divided by a preset integral normalization reference to obtain the normalized error integral.

[0011] Furthermore, the neural network controller is a multilayer perceptron neural network, which sequentially includes an input layer, at least two hidden layers, and an output layer; The input layer includes two neurons, which respectively receive the normalized DC bus voltage error and the normalized error integral; The activation function of the hidden layer is the hyperbolic tangent function; The output layer includes a neuron. The output of the output layer is mapped to a preset standard range by the Sigmoid function and then multiplied by a preset maximum current limit value to obtain the AC side current amplitude command.

[0012] Furthermore, the end-to-end offline training generates simulation samples in each training batch through domain randomization, which includes: Environmental parameters are uniformly and randomly sampled within a preset randomization range. These environmental parameters include one or more of the following: load resistance, peak grid voltage, initial DC bus voltage, and initial grid voltage phase.

[0013] Meanwhile, a single-phase PWM rectifier controller is proposed to implement the above-mentioned single-phase PWM rectifier control method, including a voltage outer loop module, a reference current generation module, a current inner loop module and a pulse width modulation module connected in sequence. The voltage outer loop module includes a neural network controller. The first input terminal of the voltage outer loop module is used to input the error of the DC bus voltage of the single-phase PWM rectifier. The second input terminal of the voltage outer loop module is used to input the error integral of the DC bus voltage. The output terminal of the voltage outer loop module is used to output the AC side current amplitude command. The first input terminal of the reference current generation module is connected to the output terminal of the voltage outer loop module to receive the AC side current amplitude command. The second input terminal of the reference current generation module is used to connect to the grid voltage connected to the single-phase PWM rectifier. The output terminal of the reference current generation module is used to output the AC side reference current synthesized according to the phase information of the AC side current amplitude command and the grid voltage. The reference input terminal of the current inner loop module is connected to the output terminal of the reference current generation module. The feedback input terminal of the current inner loop module is used to receive the sampling signal of the actual current on the AC side of the single-phase PWM rectifier. The output terminal of the current inner loop module is used to output the modulation signal obtained by processing the difference between the AC side reference current and the AC side actual current. The input terminal of the pulse width modulation module is connected to the output terminal of the current inner loop module, and the output terminal of the pulse width modulation module is used to output the PWM signal that drives the power switching device of the single-phase PWM rectifier to turn on and off. Furthermore, the inner current loop module includes a current error subtraction unit and a deadbeat controller; The first input terminal of the current error subtraction unit serves as the reference input terminal of the current inner loop module, the second input terminal of the current error subtraction unit serves as the feedback input terminal of the current inner loop module, and the output terminal of the current error subtraction unit is used to output the difference between the AC side reference current and the AC side actual current. The input terminal of the deadbeat controller is connected to the output terminal of the current error subtraction unit, and the output terminal of the deadbeat controller serves as the output terminal of the current inner loop module. Furthermore, the reference current generation module includes a phase-locked loop and a multiplier; The input terminal of the phase-locked loop serves as the second input terminal of the reference current generation module, and the output terminal of the phase-locked loop is used to output a sinusoidal phase signal that is in phase and frequency with the grid voltage. The first input terminal of the multiplier serves as the first input terminal of the reference current generation module, the second input terminal of the multiplier is connected to the output terminal of the phase-locked loop, and the output terminal of the multiplier serves as the output terminal of the reference current generation module.

[0014] Furthermore, the neural network controller, after end-to-end offline training, exhibits a high-gain response to the DC component error in the DC bus voltage and a suppression response to the double power frequency ripple component in the DC bus voltage. Based on the AC side current amplitude command output by the neural network controller that is immune to the double power frequency ripple component, the AC side reference current synthesized by the reference current generation module is a sinusoidal signal that does not contain the double power frequency ripple component. The modulation signal generated by the current inner loop module accordingly drives the single-phase PWM rectifier to operate at grid-side unity power factor through the pulse width modulation module.

[0015] The embodiments of this application have the following beneficial effects: 1. The control method for a single-phase PWM rectifier according to the present invention includes the following core steps: taking the DC bus voltage error and the error integral as inputs to a neural network controller, and outputting an AC side current amplitude command through forward inference of the neural network controller; the weight parameters of the neural network controller are predetermined through end-to-end offline training and remain fixed during the execution of the control method; the end-to-end offline training is based on a differentiable physical evolution model, in which the differentiable physical evolution model explicitly includes a double power frequency ripple component caused by instantaneous power fluctuations on the AC side; the end-to-end offline training aims to make the AC side current amplitude command output by the neural network controller immune to the double power frequency ripple component; the end-to-end offline training aims to minimize the composite loss function; the composite loss function includes at least a voltage tracking error term and a control quantity smoothing penalty term, the control quantity smoothing penalty term is used to penalize the change in the AC side current amplitude command output by the neural network controller during adjacent control cycles, and specific mathematical expressions for the voltage tracking error term, the control quantity smoothing penalty term, and the composite loss function are given. As can be seen, the inner current loop, acting as a fast loop, takes the current amplitude command output from the outer voltage loop, the grid voltage phase signal, and the actual sampled value of the AC side current as input. The current error is processed by the deadbeat controller, and finally a PWM drive signal is generated to control the on and off of the rectifier bridge power switching devices. Its core function is to quickly track the current command, achieve unity power factor operation, and simultaneously limit the AC side current in real time, effectively suppressing the influence of grid fluctuations and load disturbances, and avoiding overcurrent damage to power devices.

[0016] 2. This invention utilizes the nonlinear fitting capability of neural networks to eliminate the notch filter or low-pass filter that causes phase lag in traditional solutions while retaining the ripple suppression capability. This significantly improves the cutoff frequency of the voltage loop and achieves faster voltage recovery and smaller voltage drop than traditional proportional-integral control under transient conditions such as load changes. 3. By adding a smoothness constraint to the training loss function, the neural network can learn to ignore the inherent double power frequency ripple in the physical model. This is equivalent to implementing a virtual filter with zero phase hysteresis inside the controller, and outputting smooth current commands without adding additional filter hardware or software modules. 4. During the training phase, a wide range of randomization is introduced for parameters such as load, grid voltage, and initial value. The trained controller has a strong generalization ability and can maintain stable control performance even under conditions of capacitor aging, grid fluctuations, or unknown load. It does not require parameter retuning and has strong parameter robustness. 5. By using the integral of the error as an explicit input feature of the neural network and combining it with backpropagation training of the physical model over long time, the controller is guaranteed to completely eliminate the static error of the DC bus voltage in steady state, thus having high steady-state accuracy. 6. The controller after training only performs simple matrix multiplication and addition operations, with extremely low computational load. It can be directly deployed in low-cost digital signal processors or embedded microcontroller units without the need for expensive computing hardware support, making it easy to implement in engineering. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the structure of a single-phase PWM rectifier controller provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a single-phase LCL type PWM rectifier provided in one embodiment of this application; Figure 3 This is a schematic flowchart of a control method for a single-phase PWM rectifier provided in an embodiment of this application; Figure 4 This is a diagram of a multilayer perceptron neural network structure provided in an embodiment of this application; Figure 5 This is a waveform diagram of the steady-state network-side current under the neural network outer loop control provided in an embodiment of this application; Figure 6 This is a THD diagram of the steady-state network-side current provided in an embodiment of the neural network outer loop control of this application; Figure 7 This is a comparison diagram of the dynamic response of the outer loop control structure provided in one embodiment of this application; Figure 8 This is a comparison chart of steady-state grid-side current THD analysis provided in an embodiment of this application. Detailed Implementation

[0019] like Figure 1 As shown, this application provides a single-phase PWM rectifier controller, including a voltage outer loop module, a reference current generation module, a current inner loop module, and a pulse width modulation module connected in sequence. The voltage outer loop module includes a neural network controller. The first input terminal of the voltage outer loop module is used to input the error of the DC bus voltage of the single-phase PWM rectifier. The second input terminal of the voltage outer loop module is used to input the error integral of the DC bus voltage. The output terminal of the voltage outer loop module is used to output the AC side current amplitude command. The first input terminal of the reference current generation module is connected to the output terminal of the voltage outer loop module to receive the AC side current amplitude command. The second input terminal of the reference current generation module is used to connect to the grid voltage connected to the single-phase PWM rectifier. The output terminal of the reference current generation module is used to output the AC side reference current synthesized according to the phase information of the AC side current amplitude command and the grid voltage. The reference input terminal of the current inner loop module is connected to the output terminal of the reference current generation module. The feedback input terminal of the current inner loop module is used to receive the sampling signal of the actual current on the AC side of the single-phase PWM rectifier. The output terminal of the current inner loop module is used to output the modulation signal obtained by processing the difference between the AC side reference current and the AC side actual current. The input terminal of the pulse width modulation module is connected to the output terminal of the current inner loop module, and the output terminal of the pulse width modulation module is used to output the PWM signal that drives the power switching device of the single-phase PWM rectifier to turn on and off. The weight parameters of the neural network controller are predetermined through end-to-end offline training and remain fixed during the operation of the controller. The end-to-end offline training is based on a differentiable physical evolution model, which explicitly includes a double power frequency ripple component caused by instantaneous power fluctuations on the AC side. The training objective of the end-to-end offline training is to make the AC side current amplitude command output by the neural network controller immune to the double power frequency ripple component.

[0020] In applications, such as Figure 2 As shown, the single-phase LCL PWM rectifier applicable to this invention has a main circuit structure consisting of a grid-side inductor, an intermediate filter capacitor, and a converter-side inductor forming a typical third-order LCL filter network. This is followed by an H-bridge inverter unit composed of four fully controlled switching devices, and then connected to the DC bus capacitor C and the load resistor R. The typical value of the DC bus capacitor C is 880μF.

[0021] Let the grid-side inductance be The grid-side current is The filter capacitor is The voltage at its connection point with the inductor is The inductance on the converter side is The converter-side current is The dynamic differential equations on the AC side are described as follows: (in, AC grid voltage, (This refers to the midpoint voltage of the AC side bridge arm of the rectifier).

[0022] Combined with the original DC side equations Together, these constitute the complete nonlinear mathematical model of the LCL-type PWM rectifier. The neural network proposed in this invention mainly performs outer loop control of the DC side dynamic voltage, thereby providing accurate reference commands for the inner loop.

[0023] In one embodiment, the current inner loop module includes a current error subtraction unit and a deadbeat controller; The first input terminal of the current error subtraction unit serves as the reference input terminal of the current inner loop module, the second input terminal of the current error subtraction unit serves as the feedback input terminal of the current inner loop module, and the output terminal of the current error subtraction unit is used to output the difference between the AC side reference current and the AC side actual current. The input terminal of the deadbeat controller is connected to the output terminal of the current error subtraction unit, and the output terminal of the deadbeat controller serves as the output terminal of the current inner loop module. In one embodiment, the reference current generation module includes a phase-locked loop and a multiplier; The input terminal of the phase-locked loop serves as the second input terminal of the reference current generation module, and the output terminal of the phase-locked loop is used to output a sinusoidal phase signal that is in phase and frequency with the grid voltage. The first input terminal of the multiplier serves as the first input terminal of the reference current generation module, the second input terminal of the multiplier is connected to the output terminal of the phase-locked loop, and the output terminal of the multiplier serves as the output terminal of the reference current generation module.

[0024] In one embodiment, the neural network controller, after end-to-end offline training, exhibits a high-gain response to the DC component error in the DC bus voltage and a suppression response to the double power frequency ripple component in the DC bus voltage. Based on the AC side current amplitude command output by the neural network controller that is immune to the double power frequency ripple component, the AC side reference current synthesized by the reference current generation module is a sinusoidal signal that does not contain the double power frequency ripple component. The modulation signal generated by the current inner loop module accordingly drives the single-phase PWM rectifier to operate at grid-side unity power factor through the pulse width modulation module.

[0025] The control method provided in this invention can be applied to AC / DC conversion systems centered on single-phase PWM rectifiers, such as electric vehicle charging piles, photovoltaic grid-connected inverters, uninterruptible power supplies, rail transit auxiliary converters, and energy storage conversion devices. It is particularly suitable for the outer loop control of the DC bus voltage of single-phase LCL-type PWM rectifiers. Specifically, it can be executed by a digital signal processor or embedded microcontroller unit within the controller when running a computer program with corresponding functions. This invention does not impose any limitations on the main circuit topology or application scenarios of the single-phase PWM rectifier.

[0026] like Figure 3 As shown in the embodiment of this application, a control method for a single-phase PWM rectifier includes the following steps S101 to S105: Step S101: Sample the DC bus voltage of the single-phase PWM rectifier, calculate the DC bus voltage error based on the sampled value and the preset DC bus reference voltage, and accumulate the DC bus voltage error over the control cycle to obtain the error integral.

[0027] In one embodiment, to facilitate neural network learning and avoid gradient explosion or slow training due to excessively large input amplitudes, the DC bus voltage error and error integral are normalized. The DC bus voltage error is divided by a preset voltage normalization benchmark to obtain the normalized DC bus voltage error; a typical value for the voltage normalization benchmark is 50V. The error integral is first limited by a preset amplitude limit and then divided by a preset integral normalization benchmark to obtain the normalized error integral; a typical amplitude limit range is [-10, 10]. The integral normalization benchmark can be set according to actual engineering needs. The normalized input ensures that the neural network always operates within the sensitive region of the activation function, accelerating training convergence and improving inference accuracy.

[0028] Step S102: The DC bus voltage error and the error integral are used as inputs to the neural network controller, and the AC side current amplitude command is output through forward inference by the neural network controller.

[0029] In the application, the neural network controller is a lightweight multilayer perceptron neural network. In one embodiment, the neural network controller is a multilayer perceptron neural network, which sequentially includes an input layer, at least two hidden layers, and an output layer; the input layer includes two neurons, which respectively receive the normalized DC bus voltage error and the normalized error integral; the activation function of the hidden layer is a hyperbolic tangent function; the output layer includes one neuron, and the output of the output layer is mapped to a preset standard range by a sigmoid function and then multiplied by a preset maximum current limit value to obtain the AC side current amplitude command.

[0030] Step S103: Based on the AC side current amplitude command and the phase information of the grid voltage connected to the single-phase PWM rectifier, the AC side reference current is synthesized.

[0031] Step S104: Sample the actual AC current of the single-phase PWM rectifier, and perform current inner loop control processing based on the difference between the sampled signals of the AC reference current and the AC actual current to obtain the modulation signal.

[0032] Step S105: Generate a PWM signal based on the modulation signal, and use the PWM signal to drive the power switching device of the single-phase PWM rectifier to turn on and off; The weight parameters of the neural network controller are predetermined through end-to-end offline training and remain fixed during the execution of the control method. The end-to-end offline training is based on a differentiable physical evolution model, which explicitly includes a double power frequency ripple component caused by instantaneous power fluctuations on the AC side. The training objective of the end-to-end offline training is to make the AC side current amplitude command output by the neural network controller immune to the double power frequency ripple component.

[0033] In application, this method adopts a classic voltage and current dual closed-loop nested control structure, the structure of which is as follows: Figure 3 As shown in the diagram, this structure achieves high-precision DC bus voltage regulation and rapid AC current tracking through layered control, balancing system control accuracy, dynamic response characteristics, and operational safety. The outer voltage loop, acting as a slow loop, takes the deviation between the DC bus voltage reference value and the actual sampled value as input. After processing by a neural network controller, it outputs an AC current amplitude command. Its core function is to eliminate DC voltage steady-state errors and adjust the current demand in real time according to load power changes, providing a stable control target for the system. The inner current loop, acting as a fast loop, takes the current amplitude command output from the outer voltage loop, the grid voltage phase signal, and the actual sampled AC current value as input. A deadbeat controller processes the current error and ultimately generates a PWM drive signal to control the switching of the rectifier bridge power switching devices. Its core function is to rapidly track the current command, achieve unity power factor operation, and simultaneously limit the AC current in real time, effectively suppressing the effects of grid fluctuations and load disturbances, and preventing overcurrent damage to power devices. This dual-loop architecture transforms the complex voltage control problem into a high-dynamic-performance current tracking problem, significantly improving the control robustness and engineering reliability of single-phase rectifiers under parameter fluctuation and ripple interference conditions.

[0034] The outer loop of the controller employs a simple yet powerful multilayer perceptron neural network as the voltage controller. The multilayer perceptron neural network is simple in structure and requires minimal computation, meeting the requirements of 20kHz real-time control. The neural network calculations within each control cycle can be completed in microseconds, without affecting the controller's real-time performance. It possesses strong nonlinear expression capabilities, enabling it to fit complex control laws and effectively handle nonlinear problems caused by second-harmonic ripple interference and parameter fluctuations, overcoming the limitations of linear control in traditional PI controllers. Furthermore, it is easy to train and deploy, utilizing deep learning via Python's PyTorch library. After training, the neural network parameters can be exported and embedded into the control program of a DSP or FPGA.

[0035] The neural network voltage controller receives the error and integral term between the current DC bus voltage and the reference voltage. Through the nonlinear mapping of the neural network, it outputs a reasonable AC side current amplitude command, achieving high-precision and smooth control of the DC bus voltage. Simultaneously, an output constraint mechanism ensures that the current command does not exceed the safety limit, protecting power devices. The following details the neural network topology, input / output processing, activation function selection, and initialization method. Each design detail is tailored to control requirements and engineering practice, ensuring the rationality and feasibility of the neural network.

[0036] In one specific embodiment, the neural network designed in this invention adopts a 4-layer structure, the specific structure of which is as follows: Figure 4 As shown, the structure is "Input Layer → Hidden Layer 1 → Hidden Layer 2 → Output Layer", with a topology of 2→32→32→1. That is, the input layer contains 2 neurons, each of the two hidden layers contains 32 neurons, and the output layer contains 1 neuron. This topology was determined to be the optimal structure through multiple experiments: if the number of hidden layer neurons is too small (e.g., 16), the nonlinear expressive power of the neural network is insufficient, making it unable to effectively fit complex control laws, resulting in low control accuracy of the trained controller; if the number of hidden layer neurons is too large (e.g., 64), it increases the computational load, affecting real-time control performance, and is prone to overfitting, leading to a decrease in the robustness of the controller. The two-hidden-layer structure can balance expressive power and computational efficiency, avoiding the underfitting problem that may occur with a single hidden layer.

[0037] The outer loop controller employs a lightweight multilayer perceptron neural network. The input layer contains two nodes, and the network receives two state variables as input: the normalized voltage error and the normalized error integral. The normalized voltage error... ,in For the target voltage, For sampling voltage, A normalized reference (e.g., 50V). Normalized error integral. , This is the error normalization standard. The integral term is introduced to ensure that the system can still achieve steady-state zero steady-state error even with model mismatch. The voltage error received by the first neuron... Defined as ,in The reference voltage for the DC bus is 100V. This represents the current DC bus voltage. To facilitate neural network learning and avoid gradient explosion or slow training caused by excessively large input amplitudes, the voltage error needs to be normalized. The normalization formula is as follows: That is, divide by 50V.

[0038] The reason for choosing 50V as the normalization coefficient is that, under the parameter settings of this invention, the typical error range of the DC bus voltage is ±20V (such as the maximum error when the load changes suddenly). After dividing by 50V, the normalized error range is mapped to the interval [-0.4, 0.4]. This interval is in the sensitive region of the neural network activation function, which can accelerate the training convergence speed of the neural network and improve the training accuracy.

[0039] The error integral term received by the second neuron Defined as That is, voltage error The cumulative value in each control cycle, multiplied by the time step. (50μs) ensures that the physical meaning of the integral term is the time accumulation of the error. The core function of the error integral term is to eliminate steady-state error, thereby achieving zero steady-state error control. When there is a small steady-state error in the DC bus voltage, the error integral term will continuously accumulate, driving the neural network to output a larger current command until the steady-state error is eliminated. In order to adapt to the microprocessor's underlying INT8 fixed-point arithmetic and prevent data overflow, the controller normalizes and scales the input state variables. Specifically, for the error integral term, it is normalized by dividing it by a preset integral saturation limit and mapping it to a standard range for the multilayer perceptron to perform high-frequency online inference. To avoid the integral saturation problem (the error integral term being too large will cause the controller output to run out of control), the error integral term will be limited in the actual calculation process. The limiting range is set to [-10, 10]. This range is determined through experiments, which can both ensure the effectiveness of the integral action and avoid integral saturation.

[0040] The hidden layers consist of two layers, each with 32 neurons. This two-layer structure enhances the nonlinear expressive power of the neural network, enabling it to fit more complex control laws and effectively handle second-harmonic ripple interference and parameter fluctuations. The activation function for both hidden layers is the hyperbolic tangent function (Tanh), whose expression is: Its output range is between (-1, 1), and it has the following advantages: First, the output range is fixed, which can effectively suppress gradient explosion and improve the stability of training; second, it has good gradient characteristics, and the gradient is large when the input is in the range of [-1, 1], which can speed up the training convergence speed; third, it has odd function characteristics, good symmetry, and is suitable for nonlinear mapping of control problems.

[0041] Compared to other activation functions (such as ReLU), the Tanh function is more suitable for the control scenario of this invention. The ReLU function has a gradient of 0 when the input is negative, which easily leads to the vanishing gradient problem, causing neural network training to stagnate. The Tanh function, however, has a non-zero gradient across the entire input range, effectively avoiding the vanishing gradient problem. Furthermore, its fixed output range facilitates subsequent output processing. In actual training, the output of the hidden layer serves as the input to the next layer. After two nonlinear mappings, the input error signal can be converted into an intermediate variable that meets the control requirements, providing a reliable input to the output layer.

[0042] The output layer has one node, which is constrained by the Sigmoid function. Within the specified range, the output current command amplitude is determined. To ensure the practical engineering feasibility of the current command amplitude, the current command amplitude output by the model's output layer needs to be constrained to ensure it does not exceed a preset maximum current amplitude (denoted as...). The value of this value is 15A. To achieve this constraint, the original output signal of the model's output layer is first normalized using the Sigmoid activation function, compressing it to a standardized range of (0,1). Subsequently, the standardized output signal is multiplied by the maximum current limit of 15A to obtain the current command amplitude. Its value range is ∈(0,15)A, which satisfies the physical constraints of the actual circuit on the current amplitude.

[0043] The expression for the Sigmoid function is: Its output range is between (0,1), which can compress the original output of the neural network into a fixed range, facilitating subsequent amplitude scaling. This output constraint mechanism is one of the key designs of this invention, ensuring that the controller will never issue current commands exceeding the hardware's capacity, effectively protecting the IGBT power devices in the rectifier bridge, preventing device damage due to overcurrent, and ensuring the safe and stable operation of the system. Simultaneously, the Sigmoid function's output is smooth, avoiding severe jitter in the control signal, reducing switching losses of the power devices, and extending device lifespan.

[0044] Traditional "data-driven" training methods involve first collecting input and output data from a PI controller and then performing imitation training. This invention differs from traditional "data-driven" training by innovatively constructing a differentiable digital twin model with second-harmonic ripple. This achieves ripple suppression capability and ensures the training of the neural network controller. In traditional simulations of single-phase LCL PWM rectifiers, an average model is often used to simplify calculations and improve simulation speed. This model ignores the second-harmonic ripple in the instantaneous power of the single-phase rectifier, leading to significant deviations between simulation results and actual engineering scenarios. Controllers trained using the average model will misrespond to the second-harmonic ripple on the DC bus voltage in practical applications, resulting in control signal jitter and excessive voltage fluctuations, failing to meet the actual control requirements of engineering projects.

[0045] To address the aforementioned issues, this invention constructs a discretized, precise physical simulation model incorporating instantaneous power calculation. This model accurately simulates the operation of a single-phase LCL-type PWM rectifier, precisely reflecting the 100Hz second harmonic ripple superimposed on the DC bus voltage. This allows the subsequent neural network training process to be conducted in a highly realistic engineering environment, ensuring that the trained neural network controller possesses strong ripple suppression capabilities and engineering practicality. Based on the working principle of a single-phase rectifier, this physical simulation model adheres to circuit theory and the law of conservation of energy, employs a discretized calculation method, and maintains consistency with the controller's real-time control cycle (50μs). It can output the DC bus voltage for each control cycle in real time, providing accurate feedback signals for neural network training.

[0046] In one embodiment, the process of constructing the differentiable physical evolution model includes: Calculate instantaneous input power: ; Calculate the power absorbed by the capacitor: ; Calculate the power consumption of the load: ; By simultaneously considering the instantaneous input power, the power absorbed by the capacitor, and the power consumed by the load, we obtain the transient power balance equation in the continuous time domain: ; Discretizing the transient power balance equations in the continuous-time domain yields a differentiable physical evolution model: ; in, The instantaneous active power input on the AC side. DC bus capacitor C Absorbed power The power consumed by the DC load. ω represents the peak value of the grid voltage, and ω represents the angular frequency of the grid voltage. The current amplitude command is output by the neural network. This is the current capacitor current. For DC bus capacitors, The rate of change of the DC bus voltage. This is the current DC bus voltage. The current load resistance, The time step of the control cycle is k, where k is the control cycle number. For discrete time steps, Let be the DC bus voltage in the k-th control cycle. The AC side current amplitude command output by the neural network controller in the kth control cycle. The DC bus voltage for the next control cycle is output by the differentiable physical evolution model.

[0047] In application, the differentiable physical evolution model adopts a discretized step-size calculation method. Each control cycle (50μs) receives a set of input parameters, calculates and outputs the DC bus voltage for the next control cycle, realizing real-time updating of the DC bus voltage. Its input and output parameters correspond to the physical quantities in the actual engineering scenario, and are specifically defined as follows: Input parameter: Absolute time of the current moment (Unit: seconds), used to calculate the second harmonic component in the instantaneous value of the grid voltage and instantaneous power; current DC bus voltage. (Unit: V), serving as the feedback input to the model, reflects the current operating state of the system; peak grid voltage. (Unit: V), i.e., the previously set 70.71V, used to calculate instantaneous power; load resistance (Unit: Ω), reflecting the current load operating condition, can be randomly perturbed according to training requirements; the current amplitude command output by the neural network. (Unit: A) serves as the control input for the model, used to control the amplitude of the AC side current, thereby adjusting the DC bus voltage.

[0048] Output parameter: DC bus voltage for the next control cycle (Unit: V) As the core output of the model, it is used to feed back to the neural network as the input for the next control cycle, forming a closed-loop training, and is also used for subsequent performance verification and analysis.

[0049] The model's input and output parameters all use the values ​​of actual physical quantities, eliminating the need for additional coordinate transformations. This simplifies the model's calculation process and ensures consistency between the model and the actual engineering system, making it easier to deploy the trained controller onto the actual hardware platform.

[0050] The core of this physical simulation model is to simulate the impact of second-harmonic ripple on the DC bus voltage by accurately calculating instantaneous power. Its calculation steps strictly adhere to circuit theory and the law of conservation of energy. In some embodiments, the construction process of the differentiable physical evolution model is as follows: a. Calculating Instantaneous Input Power: The instantaneous active power of a single-phase rectifier includes a constant component and a second harmonic AC component. This second harmonic AC component is the root cause of the 100Hz ripple in the DC bus voltage. Traditional average models ignore this second harmonic AC component, resulting in insufficient simulation accuracy. This model, however, accurately calculates the instantaneous active power and fully preserves the second harmonic component, ensuring the accuracy of the simulation.

[0051] Based on the working principle of a single-phase rectifier, the expression for instantaneous active power can be derived through trigonometric identities. Assume the instantaneous value of the grid voltage is... The instantaneous value of the AC side current is If the current and voltage are in phase, achieving unity power factor control, then the instantaneous active power is: The model retains This ensures that the training environment realistically reflects the existence of second harmonic ripple. Among other things, The device precisely characterizes the 100Hz power ripple, which is transmitted to the DC side through the rectifier bridge, causing a corresponding double-frequency ripple in the DC bus voltage. This represents the peak voltage of the power grid. The current amplitude command output by the neural network and the product of these two parameters determine the amplitude of the instantaneous active power, which in turn affects the magnitude of the ripple amplitude. Using this formula, the instantaneous input power for each control cycle can be accurately calculated, fully simulating the impact of second harmonic ripple.

[0052] b. Calculate the power absorbed by the capacitor: The core function of the DC bus capacitor is to store and release energy, stabilizing the DC bus voltage. Its voltage change follows the capacitor's volt-ampere characteristic. According to this characteristic, the capacitor current is equal to the product of the capacitor's capacitance and the rate of change of its voltage, i.e. ,in For capacitor current, For DC bus capacitors, This represents the rate of change of the DC bus voltage. On the DC side, the power absorbed by the capacitor is equal to the product of the output power and the capacitor current, i.e. c. Calculate load power consumption: Load power consumption is a core parameter reflecting the electrical energy consumed by the load. According to Ohm's law, load power consumption is equal to the ratio of the square of the current DC bus voltage to the load resistance. The calculation formula is: .in, For load current, This is the current DC bus voltage. This represents the current load resistance. It should be noted that the load current is calculated using instantaneous values; the value will be adjusted each control cycle based on the current load resistance. and Recalculate to ensure the real-time nature and accuracy of the results.

[0053] Ignoring switching losses, the instantaneous active power input on the AC side Equal to DC bus capacitance C Absorbed power Power consumed by DC load The sum. Combining the instantaneous input power, the power absorbed by the capacitor, and the power consumed by the load, we obtain the following equation: After combining the equations, a nonlinear differential equation is obtained, thus establishing the transient power balance equation in the continuous time domain. Further results were obtained: Since this model uses discretization calculations, the time step for each control cycle is... Therefore, the forward Euler method is used to discretize and integrate the rate of change of capacitor voltage, transforming the differential equation into a difference equation, which facilitates computer simulation calculation.

[0054] Use By performing a difference approximation, the continuous-time transformation is replaced by discrete-time steps. Continuous state quantity and Replace discrete sample values and ,in To control the cycle time step.

[0055] The discretized equation is: Further results were obtained: This model enables the output of the neural network. The state at the next moment A direct, differentiable mathematical relationship was established. Through this calculation step, the DC bus voltage can be updated in real time, accurately simulating the impact of second harmonic ripple on the voltage. The voltage change in each control cycle includes the ripple component, making the simulation model highly consistent with the actual engineering system.

[0056] In some embodiments, to ensure the accuracy of the physical simulation model, this embodiment compares and verifies the model with an accurate simulation model in Simulink: under the same parameter settings (grid voltage 50V, DC bus reference voltage 100V, load resistance 50Ω, switching frequency 20kHz), simulations are performed using both the present model and the Simulink model, and the waveforms of the DC bus voltage are recorded. The comparison results show that the DC bus voltage waveforms output by the two models are basically consistent, with the amplitude error of the second harmonic ripple being less than 0.5V and the phase error less than 5°, and the simulation accuracy meets engineering requirements. Furthermore, the simulation speed of this model is much higher than that of the Simulink model, which can meet the needs of large-scale neural network training (each training round only requires tens of milliseconds), balancing simulation accuracy and training efficiency.

[0057] This physical simulation model can accurately simulate the 100Hz ripple superimposed on the DC bus voltage within each 50-microsecond control cycle, providing a highly realistic engineering environment for subsequent neural network training. This ensures that the trained neural network controller can effectively resist second-harmonic ripple interference and has good control performance.

[0058] In some embodiments, this application employs an end-to-end backpropagation time (BPTT) algorithm for offline network training. To improve robustness, domain randomization is introduced in each training batch. This involves randomly initializing environmental parameters: during training, the load resistance (e.g., ...) is randomly changed. Ohms), grid voltage ( Fluctuations and initial phase. This forces the neural network to learn a general control law, rather than overfitting to a single operating condition, thus making the trained network extremely robust to parameter changes.

[0059] This application adopts an offline training and online inference approach. The neural network weights are fixed after offline training and no online updates are performed during deployment, thus eliminating the need for derivation of the online adaptive update law based on Lyapunov. The system's stability is guaranteed by two aspects: First, during the offline training phase, all training samples are generated dynamically in real time in a tensor computation graph from a differentiable discrete physical evolution environment. In each iteration, a new initial state is generated by resampling according to the set physical boundaries (covering the full operating envelope, including load resistance [20Ω, 100Ω], grid voltage ±15% fluctuation, initial bus voltage [50V, 120V], and arbitrary initial phase), and the complete dynamic trajectory is extrapolated forward, thereby forming the training dataset boundary covering all operating conditions. Second, before deployment, experimental verification covering all operating conditions can be performed on the dSPACE hardware-in-the-loop (HIL) semi-physical simulation platform to confirm from engineering experience that the controller satisfies bounded input bounded output (BIBO) stability under all expected operating conditions. The above two guarantee mechanisms work together to fully guarantee the reliable operation of this control scheme in an engineering sense. In one embodiment, the end-to-end offline training aims to minimize a composite loss function. This composite loss function includes at least a voltage tracking error term and a control smoothing penalty term. The control smoothing penalty term penalizes the variation in the AC-side current amplitude command output by the neural network controller during adjacent control cycles. It consists of two parts: voltage tracking error term ( ) and control quantity smoothing penalty term ( The voltage tracking error term is used to ensure that the voltage quickly approaches the given value. The voltage tracking error term is as follows: The control quantity smoothing penalty term is: The composite loss function is: in, For voltage tracking error term, To control the smoothing penalty term, For composite loss function, This is the DC bus reference voltage. The AC side current amplitude command output by the neural network controller in the kth control cycle. The current amplitude command is output by the neural network. This is the AC side current amplitude command for the (k-1)th control cycle. for discrete sampled values, This is the current DC bus voltage. This represents the total number of control cycles in the time series simulation. These are the smoothing weighting coefficients.

[0060] This embodiment optimizes the loss function, enabling the neural network to adaptively converge to an optimal equilibrium state. This achieves both rapid response and effective elimination of DC voltage errors, while ensuring the stability of the output current command, preventing fluctuations caused by 100Hz voltage ripple. This optimization mechanism mathematically achieves the core function of a notch filter, and compared to traditional notch filter structures, it does not introduce additional phase lag, effectively avoiding the adverse effects of phase lag on the dynamic response performance of the control system. Specifically, the first term of the loss function ensures the tracking accuracy of the DC voltage by constraining the DC voltage error, ensuring accurate tracking of the DC voltage command. The second term is a smoothing penalty term, whose core function is to quantify and penalize the high-frequency jitter of the control output signal, thereby constraining the fluctuation amplitude of the control output. Based on the constraint of this smoothing penalty term, the neural network can autonomously learn to suppress the response to 100Hz voltage ripple, thus outputting a highly smooth current command without adding additional notch filter hardware or software modules, effectively improving the steady-state control accuracy and anti-interference capability of the control system.

[0061] The training method in this application is the core of its ability to achieve strong generalization and ripple suppression. Traditional neural network training methods typically use fixed system parameters and simulation environments. Although the trained controller has good control performance under fixed operating conditions, it has poor robustness. When parameters such as load and power grid fluctuate, the control performance will drop significantly, making it unable to adapt to complex operating conditions in actual engineering.

[0062] To address the aforementioned issues, a robustness-enhancing training loop was designed. Through multi-dimensional and wide-ranging environmental randomization, the neural network is forced to learn a universal, physically-based control strategy instead of mitigating losses by memorizing specific scenarios. This improves the controller's robustness and generalization ability. Simultaneously, a composite loss function was designed to balance voltage tracking accuracy, control signal smoothness, and steady-state accuracy, ensuring that the trained controller not only stably controls the voltage but also avoids control signal jitter, meeting practical engineering requirements.

[0063] The following details the training hyperparameter settings, training loop steps, and key techniques used in the training process to ensure repeatability and operability: In some embodiments, training hyperparameters are the core parameters controlling the neural network training process, and their settings directly affect the training effect and convergence speed. All hyperparameters in this embodiment were determined through multiple comparative experiments, balancing training efficiency and training effect. The specific settings are as follows: Training Epochs: 100 epochs. The number of training epochs is based on the convergence characteristics of neural networks: experiments have shown that the loss function converges to a stable value around 100 epochs. Setting 100 training epochs ensures sufficient convergence of the loss function while avoiding overfitting caused by overtraining. Each training epoch includes a complete process of environment randomization, time series simulation, loss calculation, and weight update. 100 epochs of training can fully cover various complex working conditions, ensuring that the neural network learns a universal control strategy.

[0064] Simulation duration per round: 0.15 seconds, corresponding to 3000 time steps (Calculation process: 0.15s / 50μs=0.15 / 50×10). -6 =3000 steps). The simulation duration for each round is set based on the power grid cycle and the system's dynamic response characteristics: the power grid frequency is 50Hz, one power grid cycle is 0.02 seconds, and 0.15 seconds covers 7.5 power grid cycles, which can fully reflect the system's dynamic response process and the impact of second harmonic ripple; 3000 time steps can provide enough training samples to ensure that the neural network can learn the control laws at different times and avoid insufficient training due to insufficient samples.

[0065] Optimizer: Adam optimizer, with an initial learning rate set to 1e-3. The Adam optimizer is one of the most commonly used optimizers in neural network training. It combines the advantages of momentum gradient descent and adaptive learning rate, offering advantages such as fast convergence, good robustness, and less susceptibility to local optima, making it suitable for the neural network training scenario of this invention. The initial learning rate of 1e-3 is set based on the following: an excessively high learning rate will cause the loss function to oscillate and fail to converge, while an excessively low learning rate will lead to slow training convergence. An initial learning rate of 1e-3 can accelerate the convergence speed while ensuring training stability. During training, a learning rate decay strategy can be adopted according to the convergence of the loss function. When the loss function does not decrease significantly for 50 consecutive rounds, the learning rate is halved to further improve training accuracy.

[0066] Smoothing penalty coefficient: λ = 5.0. This coefficient adjusts the weight of the smoothness penalty loss in the total loss. Its setting is based on the balance between control signal smoothness and voltage tracking accuracy: a coefficient that is too large will over-penalize changes in the control signal, resulting in an overly smooth control signal and a decrease in dynamic response speed; a coefficient that is too small will not effectively suppress control signal jitter, leading to increased power device losses. Through experimental comparison, a smoothing penalty coefficient of 5.0 can effectively suppress control signal jitter while ensuring dynamic response speed, balancing control performance and device lifespan.

[0067] Terminal error penalty weight: 10.0. This weight is used to adjust the weight of the terminal error penalty loss in the total loss. Its purpose is to ensure that the voltage error at the end of the simulation (steady state) is small enough to achieve zero steady-state error control. A weight of 10.0 can significantly penalize the voltage error at steady state, forcing the neural network to pay attention to steady-state accuracy during training. This ensures that the trained controller can accurately control the DC bus voltage near the reference voltage at steady state, meeting the control requirements of practical engineering.

[0068] In addition, the following auxiliary parameters were set during training: the batch size was set to 32, meaning that 32 randomly generated environment samples were processed simultaneously in each training round to improve training efficiency; the gradient clipping threshold was set to 1.0 to prevent gradient explosion; and the total loss, tracking error loss, smoothness penalty loss, and terminal error penalty loss for each round were recorded during training to facilitate subsequent analysis of training effects and adjustment of hyperparameters.

[0069] In one embodiment, the robustness-enhancing training loop mainly comprises four core steps: environment randomization, time-series forward simulation, composite loss function calculation, backpropagation, and weight update. These four steps are executed 100 times until the loss function converges to a stable value, as detailed below: a. Environment randomization. In one embodiment, the end-to-end offline training generates simulation samples in each training batch through domain randomization, wherein the domain randomization includes: Environmental parameters are uniformly and randomly sampled within a preset randomization range. These environmental parameters include one or more of the following: load resistance, peak grid voltage, initial DC bus voltage, and initial grid voltage phase.

[0070] This application embodiment uses a multi-dimensional, wide-range randomization strategy to force the neural network to learn a universal, physical law-based control strategy instead of reducing loss by memorizing the input-output relationship of a specific scenario, thereby improving the robustness and generalization ability of the controller.

[0071] The parameters of the random disturbance include load resistance, peak grid voltage, initial DC bus voltage, and initial time phase. The random range and implementation method of each parameter are as follows: load resistor :exist Uniform random sampling is performed within the specified range. This range is set based on actual load fluctuation scenarios in engineering practice, covering extreme cases from heavy load to light load. The corresponding load power is This is 2.5 times the rated power (200W), which is considered a heavy-duty operating condition; The corresponding load power is This is 0.5 times the rated power, which falls under light load conditions; This is the rated load resistance. By randomly sampling within this range, it is possible to ensure that the neural network learns control strategies under different load conditions, thereby improving the load adaptability of the controller.

[0072] Peak grid voltage Based on the nominal value of 70.71V, a fluctuation of ±15% is applied, that is, at... Random sampling was conducted within the specified range. This fluctuation range conforms to the permissible voltage fluctuation range of my country's power frequency grid. The regulations stipulate that the range of power grid voltage fluctuations is... It can simulate the fluctuations of actual grid voltage, ensuring that the controller can maintain good control performance when the grid voltage fluctuates.

[0073] Initial value of DC bus voltage v: Uniform random sampling is performed within the range. This range covers various initial states that may occur when the system starts up: 50V is the peak voltage of the mains voltage, and 120V is 1.2 times the reference voltage. It can simulate the initial voltage state under scenarios such as system cold start and fault recovery, ensuring that the controller can start normally under any initial voltage and quickly adjust the DC bus voltage to the reference voltage.

[0074] Initial time phase t: that is, within one power grid cycle ( Random sampling within a range of seconds. Randomization of the initial time phase ensures that the controller can operate normally under any phase angle of the mains voltage, avoiding the controller's failure to start or the degradation of control performance under a specific phase due to a fixed initial phase, thus improving the controller's versatility.

[0075] The specific implementation method of environmental randomization is to generate 32 sets of independent random parameters for each batch of 32 samples through uniform random sampling, so as to ensure the diversity of the samples.

[0076] b. Time Series Forward Simulation: For each randomly generated environmental sample, simulation is performed step-by-step within a 0.15-second timeframe to mimic the real-time operation of the rectifier. Input and output data are recorded at each time step to provide a basis for subsequent loss calculation. This process strictly follows the closed-loop logic of "feedback acquisition → input calculation → neural network inference → model update," which is completely consistent with the real-time control process of the actual controller. The specific steps are as follows: Initialization: Initialize relevant parameters for each environmental sample, including the current DC bus voltage. Error integral term A time step counter t, and an array used to record data for each time step.

[0077] Time step loop (3000 steps in total): For each time step t (from 0 to 2999) a. Acquire current feedback: Obtain the current DC bus voltage from the physical simulation model. (t), this voltage is the output result of the previous time step, reflecting the current operating state of the system.

[0078] b. Calculate the input signal: Calculate the voltage error ,in The value is 100V; calculate the error integral term. ,in , For 50 μs; and Normalization is performed to obtain the input vector of the neural network. At the same time, for the error integral term Perform amplitude limiting to ensure its range is within Between these points, avoid integral saturation.

[0079] c. Neural Network Inference: The normalized input vector... The input is fed into the neural network, undergoes two Tanh nonlinear mappings in the hidden layer, and a Sigmoid mapping and amplitude scaling in the output layer to obtain the current amplitude command for the current time step. ,make sure .

[0080] d. Model Update and Feedback: Call the physical simulation model and input the absolute time of the current moment. ( (Initial time phase randomly generated), current DC bus voltage Peak grid voltage Load resistance and current amplitude command Calculate the DC bus voltage for the next time step. .

[0081] e. Data Recording: Record the current time step. , , , The data is recorded in the corresponding historical array for subsequent loss calculation and training effect analysis.

[0082] In the application, the simulation ends after 3000 time-step cycles, yielding complete time-series data of the environmental sample within 0.15 seconds, including 3001 DC bus voltage values. arrive ) and 3000 current command values ​​( arrive ).

[0083] The neural network output at each time step of the time-series forward simulation directly affects the physical model output at the next time step, closely mirroring the real-time control process in actual engineering. This ensures that the trained controller can adapt to the demands of real-time control. Furthermore, the 3000-time-step simulation provides ample training data, ensuring the neural network can fully learn from various scenarios.

[0084] In one embodiment, the performance of the physical information neural network outer loop control is also verified. Specifically, the grid-side AC current waveform of the single-phase rectifier under the neural network outer loop control is obtained through simulation, such as... Figure 5 As shown in the figure, the waveform quality is good, clearly exhibiting standard 50Hz sinusoidal characteristics. Furthermore, within the observation period of 0.40s to 0.45s, the current amplitude is stable, the phase is continuous, and there are no distortions, spikes, or low-frequency jitter. This clearly demonstrates that when the neural network voltage outer loop and current inner loop designed in this invention work together, they can accurately control the grid-side current tracking command, achieving sinusoidal current output under steady-state conditions of the rectifier.

[0085] The total harmonic distortion (THD) of the grid-side current was analyzed under steady-state conditions, and the results are as follows: Figure 6 As shown in the figure, the fundamental (50Hz) current amplitude is 5.844A, and the overall total harmonic distortion (THD) is only 1.06%. From the harmonic order distribution, except for the fundamental, the content of each harmonic is at an extremely low level, with the third harmonic being the dominant component, and the proportion of other higher harmonics being negligible. This result quantitatively verifies the superiority of the control strategy of this invention, indicating that the proposed scheme can effectively suppress current harmonics, ensuring that the grid-side current quality meets the operational requirements of high-precision power electronic devices, and fully demonstrating the engineering value of neural network controllers in improving system control accuracy and power quality.

[0086] Figure 7 The figures show a comparison of the dynamic responses of three outer-loop control structures, where (a) is the DC voltage response of the outer-loop PI controller, (b) is the DC voltage response of the outer-loop PI controller with a notch filter inserted, and (c) is the DC voltage response of the outer-loop neural network. These figures characterize the dynamic response of the outer-loop control structure under different conditions. When the system load experiences a step change, the DC bus voltage varies under three strategies: traditional PI control, PI-coupled notch filter control, and the neural network control of this invention. A comparison of dynamic response characteristics. Traditional PI control strategy (corresponding to curve a in the figure): When the proportional gain is set to a small value, its response speed is slow, reaching 1.2 seconds in the figure, making it unsuitable for practical engineering scenarios. To achieve a faster response speed, the proportional gain needs to be manually tuned, usually set to a larger value. Although the DC bus voltage can recover quickly after a load change, the current amplitude command output by this control strategy... There is a significant ripple component at twice the power frequency (100Hz). It should be noted that... Figure 7 The baseline parameters of traditional PI control are optimal values ​​manually tuned for a specific steady-state condition. An inherent drawback of traditional PI control is that once the system experiences a disturbance (such as a sudden load change), the originally optimal parameters for steady-state tuning no longer match the new operating point, leading to a severe degradation in dynamic response (i.e.,...). Figure 7 (The recovery time is as long as 1.2 seconds). To achieve a fast response under sudden changes in operating conditions, another set of high-gain parameters needs to be manually tuned, but such parameter switching for different operating conditions is difficult to achieve in real time in actual operation. This method has learned the nonlinear mapping relationship of a single-phase PWM rectifier under the full operating envelope through massive data covering all operating conditions during the offline training phase. During online inference, it can instantly output the globally optimal control command under all operating conditions without any manual parameter tuning, fundamentally avoiding the engineering defects of traditional PI tuning according to operating conditions.

[0087] Regarding the neural network outer loop control strategy proposed in this invention (corresponding to curve c in the figure): this control strategy fully leverages its technical advantages based on physical information training. During steady-state operation of the system, its output current amplitude command... The waveform is smooth, suppressing 100Hz ripple components and achieving steady-state harmonic suppression effects comparable to PI-coupled notch filter control strategies. When a sudden load change occurs in the system, the nonlinear network structure used in this invention, without introducing any physical filter-induced phase lag, results in an extremely high equivalent bandwidth for the voltage loop, enabling it to rapidly recover to a steady state within 200 milliseconds. Current amplitude commands... It exhibits regular step response characteristics.

[0088] Figure 8 This is a comparison chart of steady-state grid-side current THD analysis. The chart shows the grid-side current under rated steady-state conditions for three control strategies. The Fast Fourier Transform (FFT) analysis results, combined with the figure, further illustrate that the traditional PI control strategy, due to its failure to suppress the second-order ripple, causes a 100Hz ripple component to enter the inner current loop. This ripple component, superimposed on the 50Hz grid phase-locked reference, generates a significant third harmonic (150Hz) distortion in the grid-side current, with a total harmonic distortion (THD) reaching [value missing]. This approach cannot meet the harmonic control requirements of steady-state power supply. However, when a notch filter is inserted into the traditional PI control strategy, the ripple component at twice the power frequency (100Hz) is reduced to a significantly lower total harmonic distortion (THD) after adopting this control scheme. .

[0089] The physical information-based neural network control method proposed in this invention, by introducing a smoothing penalty term during the model training phase, enables the neural network to autonomously shield itself from 100Hz disturbance inputs in the model. Figure 6 It can be seen that, under the control strategy of this invention, the grid-side current waveform has good sinusoidal characteristics, and its total harmonic distortion (THD) is reduced to... This fully meets the steady-state high-quality power requirements of traditional PI series notch filter architecture. The results demonstrate that the neural network used in this invention eliminates the need for explicit filter hardware or complex digital filtering algorithms. Through intelligent evolution, it internalizes ripple suppression, effectively improving the integration of the control system while reducing system hardware costs and algorithm complexity, thus possessing significant engineering application value.

[0090] In summary, waveform comparison confirms that the neural network control strategy proposed in this invention can effectively decouple the strong coupling between "ripple suppression" and "dynamic response bandwidth," achieving optimal performance in both transient response speed and steady-state waveform quality, significantly outperforming traditional PI control and PI-coupled notch filter control strategies.

[0091] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A control method for a single-phase PWM rectifier, characterized in that, This control method is applied to an LCL-type PWM rectifier and includes the following steps: S1: The DC bus voltage error is calculated based on the sampled value and preset value of the DC bus voltage of the PWM rectifier, and the DC bus voltage error is accumulated over the control cycle to obtain the error integral; S2: The DC bus voltage error and the error integral are used as inputs to the neural network controller, which outputs an AC side current amplitude command via forward inference. The weight parameters of the neural network controller are predetermined through end-to-end offline training and remain fixed during the execution of the control method. The end-to-end offline training is based on a differentiable physical evolution model, which explicitly includes a double power frequency ripple component caused by instantaneous power fluctuations on the AC side. The end-to-end offline training aims to make the AC side current amplitude command output by the neural network controller immune to the double power frequency ripple component. S3: Based on the AC side current amplitude command and the phase information of the grid voltage connected to the single-phase PWM rectifier, obtain the AC side reference current; S4: The actual AC side current and the AC side reference current of the single-phase PWM rectifier are processed by the deadbeat controller to obtain the modulation signal, thereby generating the PWM signal to control the power switch to turn on and off; The end-to-end offline training aims to minimize the composite loss function. The composite loss function includes at least a voltage tracking error term and a control quantity smoothing penalty term. The control quantity smoothing penalty term is used to penalize the change in the AC side current amplitude command output by the neural network controller during adjacent control cycles.

2. The control method according to claim 1, characterized in that, The voltage tracking error term is: The control quantity smoothing penalty term is: The composite loss function is: in, For voltage tracking error term, To control the smoothing penalty term, For composite loss function, This is the DC bus reference voltage. The AC side current amplitude command output by the neural network controller in the kth control cycle. The current amplitude command is output by the neural network. This is the AC side current amplitude command for the (k-1)th control cycle. for discrete sampled values, This is the current DC bus voltage. This represents the total number of control cycles in the time series simulation. These are the smoothing weighting coefficients.

3. The control method according to claim 2, characterized in that, The construction process of the differentiable physical evolution model includes: Calculate instantaneous input power: ; Calculate the power absorbed by the capacitor: ; Calculate the power consumption of the load: ; By simultaneously considering the instantaneous input power, the power absorbed by the capacitor, and the power consumed by the load, we obtain the transient power balance equation in the continuous-time domain: ; The transient power balance equation in the continuous-time domain is discretized to obtain a differentiable physical evolution model; the differentiable physical evolution model is as follows: ; in, The instantaneous active power input on the AC side. DC bus capacitor C Absorbed power The power consumed by the DC load. ω represents the peak value of the grid voltage, and ω represents the angular frequency of the grid voltage. The current amplitude command is output by the neural network. This is the current capacitor current. For DC bus capacitors, The rate of change of the DC bus voltage. This is the current DC bus voltage. The current load resistance, The time step of the control cycle is k, where k is the control cycle number. For discrete time steps, Let be the DC bus voltage in the k-th control cycle. The AC side current amplitude command output by the neural network controller in the kth control cycle. The DC bus voltage for the next control cycle is output by the differentiable physical evolution model.

4. The control method according to claim 2, characterized in that, The DC bus voltage error is divided by a preset voltage normalization reference to obtain the normalized DC bus voltage error; the error integral is first subjected to a preset limiting range and then divided by a preset integral normalization reference to obtain the normalized error integral.

5. The control method according to claim 1, characterized in that, The neural network controller is a multilayer perceptron neural network, which sequentially includes an input layer, at least two hidden layers, and an output layer. The input layer includes two neurons, which respectively receive the normalized DC bus voltage error and the normalized error integral; The activation function of the hidden layer is the hyperbolic tangent function; The output layer includes a neuron. The output of the output layer is mapped to a preset standard range by the Sigmoid function and then multiplied by a preset maximum current limit value to obtain the AC side current amplitude command.

6. The control method according to claim 5, characterized in that, The end-to-end offline training generates simulation samples in each training batch through domain randomization, wherein the domain randomization includes: Environmental parameters are uniformly and randomly sampled within a preset randomization range. These environmental parameters include one or more of the following: load resistance, peak grid voltage, initial DC bus voltage, and initial grid voltage phase.

7. A single-phase PWM rectifier controller, used to implement the single-phase PWM rectifier control method according to any one of claims 1-6, characterized in that, It includes a voltage outer loop module, a reference current generation module, a current inner loop module, and a pulse width modulation module that are cascaded together in sequence. The voltage outer loop module includes a neural network controller. The first input terminal of the voltage outer loop module is used to input the error of the DC bus voltage of the single-phase PWM rectifier. The second input terminal of the voltage outer loop module is used to input the error integral of the DC bus voltage. The output terminal of the voltage outer loop module is used to output the AC side current amplitude command. The first input terminal of the reference current generation module is connected to the output terminal of the voltage outer loop module to receive the AC side current amplitude command. The second input terminal of the reference current generation module is used to connect to the grid voltage connected to the single-phase PWM rectifier. The output terminal of the reference current generation module is used to output the AC side reference current synthesized according to the phase information of the AC side current amplitude command and the grid voltage. The reference input terminal of the current inner loop module is connected to the output terminal of the reference current generation module. The feedback input terminal of the current inner loop module is used to receive the sampling signal of the actual current on the AC side of the single-phase PWM rectifier. The output terminal of the current inner loop module is used to output the modulation signal obtained by processing the difference between the AC side reference current and the AC side actual current. The input terminal of the pulse width modulation module is connected to the output terminal of the current inner loop module, and the output terminal of the pulse width modulation module is used to output the PWM signal that drives the power switching device of the single-phase PWM rectifier to turn on and off.

8. The controller according to claim 7, characterized in that, The current inner loop module includes a current error subtraction unit and a deadbeat controller; The first input terminal of the current error subtraction unit serves as the reference input terminal of the current inner loop module, the second input terminal of the current error subtraction unit serves as the feedback input terminal of the current inner loop module, and the output terminal of the current error subtraction unit is used to output the difference between the AC side reference current and the AC side actual current. The input terminal of the deadbeat controller is connected to the output terminal of the current error subtraction unit, and the output terminal of the deadbeat controller serves as the output terminal of the current inner loop module.

9. The controller according to claim 7, characterized in that, The reference current generation module includes a phase-locked loop and a multiplier; The input terminal of the phase-locked loop serves as the second input terminal of the reference current generation module, and the output terminal of the phase-locked loop is used to output a sinusoidal phase signal that is in phase and frequency with the grid voltage. The first input terminal of the multiplier serves as the first input terminal of the reference current generation module, the second input terminal of the multiplier is connected to the output terminal of the phase-locked loop, and the output terminal of the multiplier serves as the output terminal of the reference current generation module.

10. The controller according to claim 7, characterized in that, The neural network controller, after end-to-end offline training, exhibits a high-gain response to the DC component error in the DC bus voltage and a suppression response to the double power frequency ripple component in the DC bus voltage. Based on the AC side current amplitude command output by the neural network controller, which is immune to the double power frequency ripple component, the AC side reference current synthesized by the reference current generation module is a sinusoidal signal without the double power frequency ripple component. The modulation signal generated by the current inner loop module accordingly drives the single-phase PWM rectifier to operate at grid-side unity power factor through the pulse width modulation module.