QPR control-based power grid simulator shg pwm generation method

By using the SHGPWM generation method of the power grid simulator based on QPR control, and by solving the nonlinear equation system using the Newton-Ant Colony NR-ACA algorithm and combining it with the QPR closed-loop control system, the real-time and accurate generation of the fundamental frequency and harmonic content of the output voltage of the power grid simulator is realized. This solves the problems of insufficient accuracy and frequency adaptability in the existing technology and meets the simulation requirements of complex working conditions.

CN122394046APending Publication Date: 2026-07-14STATE GRID ZHEJIANG ELECTRIC POWER CO LTD SHAOXING POWER SUPPLY CO

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID ZHEJIANG ELECTRIC POWER CO LTD SHAOXING POWER SUPPLY CO
Filing Date
2026-02-28
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In the existing technology, the power grid simulator suffers from insufficient accuracy in solving the nonlinear equation system and the difficulty of traditional control strategies in achieving high-precision generation of the fundamental and harmonic content of the output voltage, resulting in the inability to achieve online high-precision generation.

Method used

A grid simulator SHGPWM generation method based on QPR control is adopted. By constructing a set of SHGPWM nonlinear equations, the Newton-Ant Colony NR-ACA algorithm is used for offline solution to obtain a high-precision initial switching angle, which is stored in a lookup table. Combined with a quasi-proportional resonant QPR closed-loop control system, the frequency components of the output voltage error signal are extracted in real time. The high-precision initial switching angle calculated offline is superimposed with the online generated disturbance, realizing the organic combination of feedforward fast response and feedback zero steady-state error tracking.

Benefits of technology

It achieves real-time and accurate generation of the fundamental and harmonic content of the output voltage of the power grid simulator, taking into account the fast dynamic response and zero steady-state error tracking performance of the control system. It can maintain steady-state and dynamic response performance under the conditions of dynamic adjustment of harmonic amplitude and fluctuation of fundamental frequency, and meet the simulation requirements of complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122394046A_ABST
    Figure CN122394046A_ABST
Patent Text Reader

Abstract

This invention discloses a method for generating SHGPWM for a power grid simulator based on QPR control, belonging to the field of power grid simulator control technology. Addressing the technical problem of existing technologies failing to achieve high-precision online generation of the fundamental and harmonic content of the output voltage, this invention constructs a nonlinear equation set for SHGPWM and uses the Newton-Ant Colony NR-ACA algorithm for offline solution to obtain the initial switching angle, storing it in a lookup table, thus fundamentally guaranteeing the upper limit of steady-state accuracy. Based on this, a closed-loop control system based on quasi-proportional resonance (QPR) is constructed. Utilizing the high gain and wide bandwidth characteristics of the QPR controller at the resonant frequency, each frequency component in the error signal is extracted in real time and converted into switching angle disturbance by an integral controller. This effectively compensates for the attenuation of the specified harmonic by the LC filter and suppresses the influence of frequency fluctuations. This achieves an organic combination of fast feedforward response and zero steady-state error tracking, thereby achieving real-time and accurate generation of the fundamental and harmonic content of the power grid simulator output voltage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power grid simulator control technology, and more specifically, to a method for generating SHGPWM for a power grid simulator based on QPR control. Background Technology

[0002] With the widespread application of new energy grid-connected power generation and power electronic equipment, the problem of grid harmonic pollution has become increasingly prominent. To test the adaptability of grid-connected equipment under complex grid conditions, grid simulators capable of reproducing grid voltage distortion, frequency fluctuations, and other fault conditions have become a research hotspot. Cascaded H-bridge multilevel inverters, due to their modular structure and good output voltage waveform quality, are widely used in grid simulators. However, to achieve precise control of the fundamental and harmonic content in the output voltage, the key lies in solving the nonlinear equations describing the relationship between the switching angle and the harmonic amplitude. In existing technologies, while intelligent algorithms such as ant colony optimization do not rely on initial values, they suffer from strong search randomness and low solution accuracy, making it difficult to meet the requirements of high-precision harmonic control. Meanwhile, traditional proportional-integral (PI) control cannot achieve zero steady-state error tracking of sinusoidal AC quantities, and while proportional-resonant (PR) control has high gain at the resonant frequency, its narrow bandwidth and sensitivity to grid frequency fluctuations easily lead to a decrease in control performance. While a simple feedforward lookup table control strategy can achieve fast dynamic response, it cannot compensate for the attenuation of a specified harmonic by the LC filter, making it difficult to achieve real-time and accurate tracking of the harmonic content of the output voltage. Overcoming this dual bottleneck of algorithm accuracy and control performance, and achieving online high-precision generation of the fundamental frequency and harmonic content of the power grid simulator's output voltage, has become an urgent technical problem to be solved.

[0003] The information disclosed in the background section is only intended to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this invention is to address the technical problem that insufficient accuracy in solving nonlinear equations and the difficulty of traditional control strategies in simultaneously considering frequency adaptability and harmonic attenuation compensation, resulting in the inability to achieve high-precision online generation of the fundamental and harmonic content of the output voltage. This application proposes a power grid simulator SHGPWM generation method based on QPR control. First, by constructing a set of SHGPWM nonlinear equations describing the relationship between output voltage and switching angle, and using the Newton-Ant Colony NR-ACA algorithm for offline solution, a high-precision initial switching angle is obtained and stored in a lookup table, fundamentally guaranteeing the theoretical upper limit of steady-state accuracy. Based on this, a method based on... The closed-loop control system of the quasi-proportional resonant QPR utilizes the high gain and wide bandwidth characteristics of the QPR controller at the resonant frequency to extract each frequency component in the output voltage error signal in real time. This component is then converted into a switching angle disturbance by an integral controller, effectively compensating for the attenuation of the specified harmonic by the LC filter and suppressing the influence of frequency fluctuations. Finally, the high-precision initial switching angle calculated offline is superimposed with the online generated disturbance to obtain the actual switching angle to generate the drive pulse. This achieves an organic combination of fast feedforward response and zero steady-state error tracking, thereby achieving real-time and accurate generation of the fundamental frequency and harmonic content of the output voltage of the power grid simulator.

[0005] To achieve the above technical objectives, one technical solution provided in this embodiment of the invention is: a method for generating SHGPWM in a power grid simulator based on QPR control, comprising the following steps: Based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter, a set of SHGPWM nonlinear equations describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit is established. The SHGPWM nonlinear equations are solved using the Newton-Ant Colony NR-ACA algorithm to obtain the initial switching angle corresponding to the desired harmonic content, and the initial switching angle is stored in a lookup table (LUT). The given fundamental and harmonic voltage amplitudes are used as inputs to the closed-loop control system, and the output voltage of the cascaded H-bridge inverter detected in real time is used as feedback to the closed-loop control system. The QPR controller extracts each frequency component in the error signal, and the frequency components are converted into switching angle disturbances by the integral controller. The actual switching angle is obtained by superimposing the switching angle disturbance with the initial switching angle read from the lookup table (LUT); the drive pulse of the cascaded H-bridge inverter is generated based on the actual switching angle; and the fundamental and harmonic content of the output voltage is controlled in a closed loop based on the drive pulse to realize the online generation of SHGPWM.

[0006] Preferably, the step of establishing the SHGPWM nonlinear equation set describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter is as follows: Set the symmetry conditions for the output voltage waveform of the cascaded H-bridge inverter, including half-wave symmetry and 1 / 4-cycle symmetry; The Fourier series expression of the output voltage is obtained by performing Fourier series expansion on the output voltage waveform that satisfies the symmetry condition. Based on the Fourier series expression, the functional relationship between the amplitude of the nth harmonic voltage and the switching angle of each H-bridge unit is derived. Based on the expected output fundamental and harmonic voltage amplitudes, and using the aforementioned functional relationship as a basis, a set of SHGPWM nonlinear equations concerning the switching angle is established.

[0007] Preferably, the number of cascaded H-bridges is 3, and the SHGPWM nonlinear equation set is as follows: ; in, The modulation ratio of the fundamental frequency. The modulation ratio of the 5th harmonic. The modulation ratio of the 7th harmonic. , , The switching angles of the three H-bridge units.

[0008] Preferably, the steps for solving the SHGPWM nonlinear equations using the Newton-Ant Colony NR-ACA algorithm are as follows: A1. Rearrange the SHGPWM nonlinear equations to construct an error function set, denoted as... And construct the fitness function y based on the error function set; A2. Initialize the ant colony algorithm parameters, use the switching angle combination as the path solution for the ants, and use the fitness function y as the optimization target to perform a global search, and obtain the switching angle combination that makes the fitness function value optimal as the initial solution of Newton's iteration. A3. Substitute the initial solution into the Newton-Raphson iteration method as the initial value for iteration, linearize the SHGPWM nonlinear equation system, and solve the linear equation system to obtain the switching angle correction. A4. Continuously update the switching angle and determine whether the correction amount meets the preset accuracy requirements; if it does, stop the iteration and output the current switching angle as the initial switching angle; if it does not meet the requirements, return to step A3 for the next iteration.

[0009] Preferably, the step of constructing the fitness function y based on the error function set is as follows: The corresponding intermediate function is obtained by squaring each error function in the error function group. ; Summing all intermediate functions, adding 1, and then taking the negative reciprocal, we construct the fitness function, denoted as . N represents the number of cascaded H-bridges.

[0010] Preferably, the steps of using the given fundamental and harmonic voltage amplitudes as inputs to the closed-loop control system, using the real-time detected output voltage of the cascaded H-bridge inverter as feedback, extracting each frequency component from the error signal through the QPR controller, and converting each frequency component into a switching angle disturbance through the integral controller are as follows: The given voltage signal is generated by multiplying the given fundamental voltage amplitude and the voltage amplitude of each harmonic by the corresponding unit sine signal and then superimposing them. The error signal is obtained by comparing the real-time detected output voltage of the cascaded H-bridge inverter with the given voltage signal. The error signal is input to the parallel fundamental QPR controller and each designated harmonic QPR controller, and each frequency component in the error signal is extracted to output the corresponding fundamental voltage adjustment amount and harmonic voltage adjustment amount. The fundamental voltage adjustment amount and each harmonic voltage adjustment amount are respectively input to the corresponding integral controller for processing to obtain the adjusted voltage correction amount; The voltage correction is converted into a switching angle disturbance based on the inverse matrix and DC bus voltage obtained during the solution process of the Newton-Ant Colony NR-ACA algorithm.

[0011] Preferably, the step of converting the voltage correction amount into the switching angle perturbation amount based on the inverse matrix and DC bus voltage obtained during the solution process of the Newton-Ant Colony NR-ACA algorithm is as follows: Read the pre-stored inverse matrix from the lookup table (LUT), which is the inverse matrix of the matrix constructed based on the initial switching angle obtained by the Newton-Ant Colony NR-ACA algorithm; The voltage correction values ​​obtained by the integral controller are used to construct a voltage correction vector. Based on the voltage correction vector, voltage coefficient, and inverse matrix, the switching angle disturbance vector is obtained through matrix multiplication.

[0012] Preferably, the step of superimposing the switching angle disturbance amount with the initial switching angle read from the lookup table (LUT) to obtain the actual switching angle is as follows: Read the initial switching angle vector corresponding to the current desired harmonic content from the lookup table (LUT); receive the switching angle disturbance vector calculated by the closed-loop control system. The initial switching angle vector and the switching angle disturbance vector are added element-wise to obtain the actual switching angle vector.

[0013] Preferably, the step of generating the drive pulse for the cascaded H-bridge inverter based on the actual switching angle is as follows: The actual switching angle vector is input to the pulse generation module; the pulse generation module generates the conduction timing of the switching transistors in each H-bridge unit based on the switching angle corresponding to each H-bridge unit, combined with the carrier period and the inverter output frequency. According to the conduction timing, a PWM drive pulse signal corresponding to each H-bridge unit is generated; wherein, the four switching transistors of each H-bridge unit are controlled according to the complementary conduction principle, so that each H-bridge unit outputs a three-level voltage waveform. The PWM drive pulses of each H-bridge unit are applied to the control terminal of the corresponding H-bridge unit's switching transistor, controlling all H-bridge units to turn on and off in sequence, so that the output terminal of the cascaded H-bridge inverter synthesizes a multi-level voltage waveform with the desired fundamental frequency and specified subharmonic content.

[0014] Preferably, the steps for achieving online generation of SHGPWM by performing closed-loop control of the fundamental and harmonic content of the output voltage based on the driving pulse are as follows: The actual switching angle vector is synchronously input to the transient-free internal observer; the transient-free internal observer calculates in real time the fundamental voltage amplitude and the amplitude of each specified harmonic voltage in the output voltage of the cascaded H-bridge inverter under the current driving pulse according to the preset harmonic voltage amplitude calculation formula. The calculated fundamental and harmonic voltage amplitudes are used as real-time feedback values ​​and output to the input of the closed-loop control system. The real-time feedback quantity is compared with the given fundamental and harmonic voltage amplitudes, and the resulting error signal is used for the calculation of the switching angle disturbance quantity update in the next sampling period. By continuously iterating the above steps, the fundamental frequency and harmonic content of the output voltage are made to track the given value in real time, thereby realizing the online generation and closed-loop control of SHGPWM.

[0015] The present invention has at least the following substantial beneficial effects: (1) This application designs a Newton-Ant Colony (NR-ACA) algorithm that does not depend on initial values ​​by taking advantage of the global optimization characteristics of the ant colony algorithm and the local high-precision convergence characteristics of the Newton-Raphson iteration method. First, the ant colony algorithm is used to perform global optimization on the switching angle to obtain an initial solution that meets the initial accuracy. Then, the initial solution is used as the initial value of the Newton iteration method for linearized iteration convergence. The accuracy of the switching angle solution is quantified by constructing an error function set and a fitness function. After iterating to meet the preset accuracy threshold, a high-precision switching angle is output. This realizes the fast, high-precision, and initial value-independent solution of the nonlinear equation system, fundamentally improving the theoretical upper limit of the steady-state accuracy of the harmonic control of the power grid simulator. It solves the technical problems of low accuracy of a single intelligent algorithm and sensitivity of initial values ​​of a single Newton iteration method, laying a high-precision switching angle foundation for subsequent real-time harmonic generation.

[0016] (2) This application constructs a closed-loop control strategy that integrates a quasi-proportional resonant (QPR) controller, a lookup table (LUT), an integral controller, and a transient-free internal observer. The high-precision initial switching angle obtained by the NR-ACA algorithm is stored in the LUT to achieve a fast feedforward dynamic response. At the same time, the high gain and wide bandwidth characteristics of the QPR controller near the resonant frequency are utilized to configure independent QPR controllers for the fundamental wave and the specified harmonics to extract the frequency components of the error signal. Combined with the integral controller, the error between the initial switching angle and the actual switching angle is compensated. The amplitude of the fundamental wave and harmonics of the output voltage is calculated in real time by the transient-free internal observer and a closed-loop feedback is formed. This achieves zero steady-state error tracking of the sinusoidal AC quantity, effectively compensates for the attenuation of the specified harmonics by the LC filter, and significantly reduces the impact of grid frequency fluctuations on the harmonic control effect. It takes into account both the fast dynamic response and zero steady-state error tracking performance of the control system.

[0017] (3) This application organically combines the offline high-precision switching angle solution of the NR-ACA algorithm with the online real-time compensation of the QPR closed-loop control. Based on the initial switching angle stored in the LUT, the switching angle disturbance is generated in real time by the closed-loop system and superimposed with the initial switching angle to obtain the actual switching angle. The drive pulse of the cascaded H-bridge inverter is generated based on the actual switching angle. At the same time, the fundamental and harmonic amplitudes are detected and fed back iteratively in real time through the non-transient internal observer, so that the fundamental and specified harmonic amplitudes of the cascaded output voltage and the filtered load voltage can accurately track the given value in real time. This realizes the online high-precision real-time generation of the harmonic content of the grid simulator output voltage. Under the conditions of dynamic adjustment of harmonic amplitude and fluctuation of fundamental frequency, it still maintains the steady-state and dynamic response performance with short adjustment time and fast transition process. It can accurately reproduce the fault waveforms such as grid harmonic distortion and frequency fluctuation, and meet the complex operating condition simulation requirements of the grid simulator for the grid adaptability test of the distributed system.

[0018] The above description of the invention is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0019] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings. The drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings.

[0020] Figure 1 This is a flowchart of the SHGPWM generation method for a power grid simulator based on QPR control, according to an embodiment of the present invention.

[0021] Figure 2 This is a topology diagram of the cascaded H-bridge inverter in this embodiment.

[0022] Figure 3 This is a stepped voltage waveform diagram of the (2N+1) level cascaded H-bridge inverter in this embodiment.

[0023] Figure 4 This is a flowchart illustrating the ant colony algorithm for solving the switching angle in this embodiment.

[0024] Figure 5 This is a diagram showing the switching angle relationship in this embodiment.

[0025] Figure 6 This is a system control block diagram for this embodiment, which includes a LUT, an integral controller, and a transient internal observer.

[0026] Figure 7 This is the frequency response diagram of QPR control in this embodiment.

[0027] Figure 8 This is the control block diagram of the cascaded H-bridge real-time SHGPWM based on QPR control in this embodiment.

[0028] Figure 9 This is an example. V h5 * When the voltage changes from 3 to 45V, and the fundamental frequency changes from 50Hz to 60Hz in 0.1 seconds, the cascaded output voltage... V o And its FFT analysis graph.

[0029] Figure 10 This is an example. V h5 * When the voltage changes from 3V to 15V, and the fundamental frequency changes from 50Hz to 60Hz in 0.1 seconds, the load voltage after LC filtering... U o And its FFT.

[0030] Figure 11 For this embodiment when V h5 * The cascaded output voltage changes from 0.6V to 3V. V o And its FFT analysis graph.

[0031] Figure 12 For this embodiment when V h5 * The load voltage changes from 0.6V to 3V after LC filtering. U oAnd its FFT analysis graph. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only one preferred embodiment of this invention and are only used to explain this invention. They do not limit the scope of protection of this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0033] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations (or steps) can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but it may also have additional steps not included in the figures; the process may correspond to a method, function, procedure, subroutine, subroutine, etc.

[0034] Example 1: As Figure 1 As shown, the SHGPWM generation method for a power grid simulator based on QPR control includes the following steps: Based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter, a set of SHGPWM nonlinear equations describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit is established. The SHGPWM nonlinear equations are solved using the Newton-Ant Colony NR-ACA algorithm to obtain the initial switching angle corresponding to the desired harmonic content, and the initial switching angle is stored in a lookup table (LUT). The given fundamental and harmonic voltage amplitudes are used as inputs to the closed-loop control system, and the output voltage of the cascaded H-bridge inverter detected in real time is used as feedback to the closed-loop control system. The QPR controller extracts each frequency component in the error signal, and the frequency components are converted into switching angle disturbances by the integral controller. The actual switching angle is obtained by superimposing the switching angle disturbance with the initial switching angle read from the lookup table (LUT); the drive pulse of the cascaded H-bridge inverter is generated based on the actual switching angle; and the fundamental and harmonic content of the output voltage is controlled in a closed loop based on the drive pulse to realize the online generation of SHGPWM.

[0035] In this embodiment, firstly, a set of SHGPWM nonlinear equations describing the relationship between output voltage and switching angle is constructed and solved offline using the Newton-Ant Colony NR-ACA algorithm to obtain a high-precision initial switching angle, which is then stored in a lookup table, fundamentally ensuring the theoretical upper limit of steady-state accuracy. Based on this, a closed-loop control system based on a quasi-proportional resonance QPR is constructed. Utilizing the high gain and wide bandwidth characteristics of the QPR controller at the resonant frequency, each frequency component in the output voltage error signal is extracted in real time and converted into a switching angle disturbance by an integral controller. This effectively compensates for the attenuation of the specified harmonic by the LC filter and suppresses the influence of frequency fluctuations. Finally, the offline-calculated high-precision initial switching angle is superimposed with the online-generated disturbance to obtain the actual switching angle for generating the drive pulse. This achieves an organic combination of fast feedforward response and zero steady-state error tracking, thereby achieving real-time and accurate generation of the fundamental frequency and harmonic content of the grid simulator output voltage.

[0036] As an optional embodiment, the step of establishing the SHGPWM nonlinear equation set describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter is as follows: Set the symmetry conditions for the output voltage waveform of the cascaded H-bridge inverter, including half-wave symmetry and 1 / 4-cycle symmetry; The Fourier series expression of the output voltage is obtained by performing Fourier series expansion on the output voltage waveform that satisfies the symmetry condition. Based on the Fourier series expression, the functional relationship between the amplitude of the nth harmonic voltage and the switching angle of each H-bridge unit is derived. Based on the expected output fundamental and harmonic voltage amplitudes, and using the aforementioned functional relationship as a basis, a set of SHGPWM nonlinear equations concerning the switching angle is established.

[0037] It should be noted that the topology of a cascaded H-bridge inverter is as follows: Figure 2 As shown, where: V a , V b , V c This is the cascaded output voltage of the three phases; E This is the DC bus voltage; for N Two H-bridges cascaded together N +1) For level inverters, their cascaded output voltage waveform is symmetrical with a 1 / 4 cycle, and can be controlled. N -1 harmonic at a specific frequency. Cascaded output voltage. V o For (2) N +1) level, connecting the AC sides of multiple full-bridge inverters with different conduction angles in series, to obtain (2 N+1) The first half-cycle waveform of the stepped voltage of the level-cascaded H-bridge inverter is as follows: Figure 3 As shown.

[0038] In this embodiment, in order to establish a precise mathematical mapping relationship between the harmonic amplitude of the output voltage of the cascaded H-bridge inverter and the switching angle of the H-bridge unit, and to solve the technical problem of the lack of clear quantitative basis for solving the switching angle in harmonic control, this embodiment sets physical constraints of half-wave symmetry and 1 / 4-cycle symmetry on the output voltage of the cascaded H-bridge inverter. Half-wave symmetry means that the positive and negative half-cycles of the output voltage waveform are mirror-symmetric about the point (π,0), and 1 / 4-cycle symmetry means that the waveform is symmetric about π / 2 for the first and second quarter cycles within the positive half-cycle. By eliminating even harmonics and DC components in the Fourier series expansion through the waveform symmetry characteristics, the computational complexity of the series expansion is greatly simplified, and the waveform characteristics of the output voltage are defined, thus defining the waveform basis for the subsequent precise control of the harmonic amplitude.

[0039] Furthermore, by performing a Fourier series expansion on the output voltage waveform of the cascaded H-bridge inverter that satisfies the half-wave and 1 / 4-cycle symmetry conditions, and combining the topology of the cascaded H-bridge with the conduction characteristics of the switching transistors, the Fourier series expression V(ωt) of the cascaded output voltage is derived. This step establishes a mathematical relationship between discrete switching angle control and continuous output voltage waveform, realizing the conversion from time-domain voltage waveform to frequency-domain harmonic components, and providing mathematical expression support for extracting the amplitude of each harmonic.

[0040] Furthermore, by extracting harmonic components from the Fourier series expression V(ωt) of the output voltage, the frequency and amplitude terms of the fundamental wave and each harmonic are separated, and the amplitude Vn of the nth harmonic voltage is derived from the relationship between the switching angle of each H-bridge unit. , , The functional relationship, that is The study achieved a quantitative correlation between harmonic amplitude and switching angle, transforming the harmonic control requirements of the power grid simulator into a solution requirement for the unknown switching angle, and clarifying the influence of switching angle adjustment on harmonic amplitude. Based on the desired output fundamental frequency (e.g., 50Hz power frequency fundamental frequency) and specified harmonic (e.g., 5th and 7th characteristic harmonics) voltage amplitudes required by the actual test of the power grid simulator, and using the derived functional relationship between harmonic amplitude and switching angle as a basis, the study substituted the desired harmonic amplitude into the functional relationship to establish a set of SHGPWM nonlinear equations with the switching angle of each H-bridge unit as the unknown. This transformed the actual harmonic control requirements of the engineering into a solvable mathematical problem, providing a clear solution target for the subsequent high-precision solution of the switching angle using the Newton-Ant Colony NR-ACA algorithm, and achieving a precise connection between mathematical modeling and engineering requirements.

[0041] As an optional embodiment, when the number of cascaded H-bridges is 3, the 3-variable nonlinear equation system established for the fundamental, 5th, and 7th harmonics when the 3 H-bridges are cascaded is specifically as follows: ; ;in, The modulation ratio of the fundamental frequency. The modulation ratio of the 5th harmonic. The modulation ratio of the 7th harmonic. , , The switching angles of the three H-bridge units.

[0042] As an optional embodiment, the steps for solving the SHGPWM nonlinear equations using the Newton-Ant Colony NR-ACA algorithm are as follows: A1. Rearrange the SHGPWM nonlinear equations to construct an error function set, denoted as... And construct the fitness function y based on the error function set; A2. Initialize the ant colony algorithm parameters, use the switching angle combination as the path solution for the ants, and use the fitness function y as the optimization target to perform a global search, and obtain the switching angle combination that makes the fitness function value optimal as the initial solution of Newton's iteration. A3. Substitute the initial solution into the Newton-Raphson iteration method as the initial value for iteration, linearize the SHGPWM nonlinear equation system, and solve the linear equation system to obtain the switching angle correction. A4. Continuously update the switching angle and determine whether the correction amount meets the preset accuracy requirements; if it does, stop the iteration and output the current switching angle as the initial switching angle; if it does not meet the requirements, return to step A3 for the next iteration.

[0043] In this embodiment, by rearranging the terms of the SHGPWM nonlinear equations to make the right side of the equation equal to 0, an error function set with the switching angle as the variable is constructed. Then, a fitness function y is constructed based on this error function set, transforming the problem of solving the nonlinear equations into an optimization problem of the fitness function. The closer the error function is to 0, the closer the fitness function value is to -1, indicating higher accuracy in solving the switching angle. This achieves a quantitative representation of the objective of solving the nonlinear equations, providing a clear and quantifiable evaluation standard for the subsequent global optimization of the ant colony algorithm, avoiding the blindness of the optimization process. The flowchart of the ant colony optimization algorithm for solving the switching angle is as follows: Figure 4 As shown, the core parameters of the ant colony algorithm are initialized, including the number of ants, the pheromone volatility coefficient, the heuristic function weight, and the switching angle solution space range. For example, the number of ants is set to 50, the pheromone volatility coefficient to 0.1, and the switching angle solution space to 0~90°. The switching angles of each H-bridge unit are then combined. As the path solutions for ants in the solution space, the constructed fitness function y is used as the global optimization objective. Ants perform global search and path optimization within the switching angle solution space, ultimately selecting the switching angle combination that makes the fitness function value closest to -1. This combination is then used as the initial solution for the Newton-Raphson iteration method. This embodiment utilizes the global optimization characteristic of the ant colony algorithm, effectively avoiding the problem of Newton's iteration method getting trapped in local optima due to improper initial value selection. Simultaneously, the obtained initial solution possesses a certain degree of accuracy, laying the foundation for the rapid convergence of the subsequent Newton iteration method. Furthermore, the initial switching angle solution obtained through global optimization by the ant colony algorithm... Substituting into the SHGPWM nonlinear equations, the nonlinear function exist By performing a Taylor expansion and ignoring higher-order terms, the nonlinear equations are linearized, resulting in a linearized expression. ,in, for exist Jacobian matrix at the location, Let be the switching angle correction amount. Solve the system of linear equations The switching angle correction amount is obtained. This step transforms the complex problem of solving nonlinear equations into a linear equation problem that is easier to solve in engineering, achieving precise mathematical correction of the initial switching angle and significantly improving the accuracy and efficiency of the switching angle solution; by using the initial solution of the switching angle... The correction amount obtained from the solution By performing element-by-element superposition, the updated switching angle is obtained. replace Initialize the values. The linearization process and the solution of the linear equation system are repeatedly performed as new initial values ​​for iteration to obtain the correction amount, while the switching angle correction amount obtained each time is judged in real time. If the modulus is less than the preset accuracy threshold, the iteration stops and the current switching angle is output as the high-precision initial switching angle. If it does not meet the preset accuracy requirements, the iteration continues. This step gradually reduces the solution error of the switching angle through the accuracy verification method of iterative convergence, realizes the controllability of the solution accuracy of the nonlinear equation system, and ensures that the final output switching angle can meet the high-precision requirements of the power grid simulator for precise harmonic control.

[0044] It should be noted that by rearranging the terms of the nonlinear equation system and subtracting the left and right sides, we obtain: ; .

[0045] As an optional embodiment, the step of constructing the fitness function y based on the error function set is as follows: The corresponding intermediate function is obtained by squaring each error function in the error function group. ; Summing all intermediate functions, adding 1, and then taking the negative reciprocal, we construct the fitness function, denoted as . N represents the number of cascaded H-bridges.

[0046] It should be noted that when N is 3, the intermediate function It is expressed as follows: .

[0047] As an optional embodiment, the steps of using the given fundamental and harmonic voltage amplitudes as inputs to the closed-loop control system, using the real-time detected output voltage of the cascaded H-bridge inverter as feedback, extracting each frequency component from the error signal through the QPR controller, and converting each frequency component into a switching angle disturbance through the integral controller are as follows: The given voltage signal is generated by multiplying the given fundamental voltage amplitude and the voltage amplitude of each harmonic by the corresponding unit sine signal and then superimposing them. The error signal is obtained by comparing the real-time detected output voltage of the cascaded H-bridge inverter with the given voltage signal. The error signal is input to the parallel fundamental QPR controller and each designated harmonic QPR controller, and each frequency component in the error signal is extracted to output the corresponding fundamental voltage adjustment amount and harmonic voltage adjustment amount. The fundamental voltage adjustment amount and each harmonic voltage adjustment amount are respectively input to the corresponding integral controller for processing to obtain the adjusted voltage correction amount; The voltage correction is converted into a switching angle disturbance based on the inverse matrix and DC bus voltage obtained during the solution process of the Newton-Ant Colony NR-ACA algorithm.

[0048] In this embodiment, to address the technical problems of traditional control strategies being unable to track sinusoidal AC quantities without steady-state error, being sensitive to grid frequency fluctuations, and having voltage errors that cannot be directly mapped to inverter switching angle adjustments, while LC filtering causes harmonic attenuation, this embodiment first generates a time-domain given voltage signal by multiplying the given fundamental and harmonic voltage amplitudes with corresponding frequency unit sinusoidal signals and then superimposing them. Then, by real-time subtraction of the output voltage of the cascaded H-bridge inverter (based on real-time sampling) with the generated time-domain given voltage signal, an error signal is obtained. This step, through direct comparison of time-domain signals, accurately extracts the overall deviation between the actual and desired output voltages, transforming the harmonic amplitude control accuracy requirement into a specific voltage error signal. This provides a clear adjustment target for subsequent error separation and compensation, while preserving the complete information of each frequency component in the error signal. The extracted error signal is simultaneously input to a pre-configured parallel fundamental QPR controller and each specified harmonic QPR controller. Each QPR controller is configured with resonance parameters according to its corresponding frequency, and its transfer function is... In the formula, h Indicates the harmonic order; K p These are controller parameters, similar to the "proportional parameters" in a PI controller; K hr It is the gain value at the resonant point; w hc Used to adjust the gain bandwidth at the resonant point; w o This is the set resonant frequency, which is the frequency to be tracked. This step achieves decoupled independent adjustment of different frequency components in the error signal, avoiding control coupling between the fundamental wave and harmonics, and between each harmonic. Simultaneously, the wide bandwidth effectively suppresses the impact of ±5Hz frequency fluctuations in the power grid on the control effect, ensuring the accuracy of error extraction for each frequency component. Finally, the fundamental voltage adjustment and each harmonic voltage adjustment output from the QPR controller are input to corresponding independent integrator controllers for integration. The transfer function of the integrator controller is... Furthermore, by configuring unity gain, voltage correction quantities ΔVh1, ΔVh5, and ΔVh7 without steady-state error are obtained. Utilizing the zero steady-state error regulation characteristic of the integral controller, the voltage regulation quantities for each iteration are integrated, effectively eliminating steady-state errors in the regulation process of the fundamental and harmonic voltages. Simultaneously, continuous compensation for the static deviation between the initial and actual switching angles is achieved, laying the foundation for subsequent precise regulation. The inverse matrix obtained during the solution of the nonlinear equations using the Newton-Ant Colony NR-ACA algorithm is retrieved from the lookup table (LUT). The voltage coefficient is determined by combining the DC bus voltage E of the cascaded H-bridge, and the voltage correction is constructed as a vector [ΔVh1, ΔVh5, ΔVh7]. TThrough matrix multiplication This step establishes a precise mathematical mapping relationship between voltage domain correction and switching angle domain adjustment, directly transforming the voltage error compensation requirement into the basis for inverter switching angle adjustment. Furthermore, the retrieval method of the pre-stored inverse matrix ensures the real-time nature of the conversion, providing quantified execution adjustment parameters for the subsequent superposition of the initial switching angle and disturbance.

[0049] As an optional embodiment, the step of converting the voltage correction amount into a switching angle disturbance amount based on the inverse matrix and DC bus voltage obtained during the solution process of the Newton-Ant Colony NR-ACA algorithm is as follows: Read the pre-stored inverse matrix from the lookup table (LUT), which is the inverse matrix of the matrix constructed based on the initial switching angle obtained by the Newton-Ant Colony NR-ACA algorithm; The voltage correction values ​​obtained by the integral controller are used to construct a voltage correction vector. Based on the voltage correction vector, voltage coefficient, and inverse matrix, the switching angle disturbance vector is obtained through matrix multiplication.

[0050] It should be noted that the NR-ACA algorithm is used to obtain the following result: when the voltages of the three DC buses are equal, m =0.7, m h7 When =0.06, m h5 The relationship between the switching angle and the switch angle is shown in the figure below. Figure 5 As shown: The detailed control diagram of the system with integral controller and no transient internal observer, obtained through lookup table (LUT), is as follows. Figure 6 As shown: In the feedforward path, the switching angle obtained using the NR-ACA algorithm is used as the initial switching angle. θ 10 , θ 20 , θ 30 The inverse matrix These data are stored in a lookup table (LUT) to achieve a fast dynamic response and ensure that the system is very close to steady state, so that a small-signal model can be applied during dynamic response analysis. V h1 * , V h5 * , V h7 * This represents the amplitude of the given fundamental, 5th, and 7th harmonics. The proportional gain of the controller. K 1= K 2= K3 = 1000.1 / s This represents an integral controller. Three integral controllers with unity gain are used to compensate for the initial switching angle. θ 10 , θ 20 , θ 30 and actual switching angle θ 1, θ 2, θ The error between 3. , , It involves disturbances at three switching angles. The disturbance range for the switching angles is set using three integrator modules: A system without transient internal observers is also known as a controlled system. , θ 1, θ 2, θ 3. Then, after passing through a non-transient internal observer, we obtain... V h1 , V h5 , V h7 . V h1 , V h5 , V h7 The input and output form a closed-loop system, using θ 1, θ 2, θ 3. Generate drive pulses for cascaded multilevel inverters (CMI) to ultimately achieve zero steady-state error.

[0051] In order to simultaneously control the cascaded output voltage V o and the filtered output voltage U o The fundamental frequency and the amplitude of harmonics of a specified order are required, so a closed-loop control strategy is needed to compensate for the attenuation of harmonics by the LC circuit. This is because quasi-proportional resonance (quasi-proportional resonance)... QPR The control creates a high-gain frequency band near the resonant frequency, thus reducing the impact of frequency shift. Simultaneously, the gain of the amplitude-frequency curve at the resonant frequency is also relatively high. The frequency characteristics of quasi-proportional resonance (QPR) control are as follows: Figure 7As shown. Because quasi-proportional resonance (QPR) control creates a high-gain frequency band near the resonant frequency, it can reduce the impact of frequency shift. The gain of the QPR amplitude-frequency curve at the resonant frequency is also relatively high, thus enabling it to track a specified AC signal. Therefore, this embodiment uses a QPR controller. The control block diagram of the cascaded H-bridge real-time SHGPWM based on QPR control is shown below. Figure 8 As shown. Figure 8 The meaning of variables in and Figure 7 Similarly, the meanings of the additional variables are as follows. wt In w Represents angular frequency. w =2 πf , f This indicates the fundamental frequency. V o This represents the cascaded output voltage, i.e., the output voltage before LC filtering. U o This represents the load voltage after LC filtering. QPR 1. QPR 5. QPR 7 indicates quasi-proportional resonance control for the fundamental, 5th, and 7th harmonics. submitV h1 , submitV h5 , submitV h7 The extraction process is represented sequentially. QPR The amplitudes of the fundamental, 5th, and 7th harmonics of the controlled output voltage. E This represents the DC bus voltage of each H-bridge.

[0052] Furthermore, QPR 1. QPR 5. QPR The parameter settings for 7 are as follows: If the allowable frequency fluctuation of the power grid is ±5Hz, then the corresponding w hc =2 π *5; that is QPR 1. QPR 5. QPR 7 w hc Set all to 2 π *5. K p Set them all to 1000. K hr Set all to 100.

[0053] w o It can be dynamically adjusted, for QPR1. To track the 50Hz fundamental frequency, you can set... w o =2 π *50 = 314 rad / s. For QPR 5. To track the 5th harmonic frequency (250Hz), you can set... w o =2 π *50*5=500 π rad / s. For QPR 7. To track the 7th harmonic frequency (350Hz), you can set... w o =2* π *50*7=700 π rad / s.

[0054] As an optional embodiment, the step of superimposing the switching angle disturbance amount with the initial switching angle read from the lookup table (LUT) to obtain the actual switching angle is as follows: Read the initial switching angle vector corresponding to the current desired harmonic content from the lookup table (LUT); receive the switching angle disturbance vector calculated by the closed-loop control system. The initial switching angle vector and the switching angle disturbance vector are added element-wise to obtain the actual switching angle vector.

[0055] In this embodiment, the LUT pre-stores multiple sets of high-precision initial switching angle vectors corresponding to different harmonic content combinations. These vectors can be quickly retrieved based on the real-time harmonic amplitude setpoint. This step utilizes the high-speed data reading characteristics of the lookup table to pre-store the high-precision switching angles that would otherwise require offline calculation, avoiding the computational delay of online real-time solutions. This achieves rapid and accurate retrieval of the initial switching angles, ensuring the system's rapid dynamic response characteristics. Simultaneously, the initial switching angles solved by the NR-ACA algorithm lay a foundation for high steady-state accuracy in the actual switching angles. The LUT receives a switching angle disturbance vector generated by a QPR-based closed-loop control system after multi-stage calculations considering real-time output voltage and setpoint errors, LC filter harmonic attenuation, and grid frequency fluctuations. Each element of this switching angle disturbance vector corresponds one-to-one with the H-bridge switching angle, providing real-time values ​​for each switching angle. The compensation amount enables real-time reception of quantitative compensation amounts for deviations in the real-time operating conditions of the power grid, overcoming the static limitations of offline initial switching angles. This allows switching angle adjustments to accurately adapt to real-time changes in the power grid, such as harmonic attenuation, frequency fluctuations, and system disturbances. By fusing the read initial switching angle vector with the received switching angle disturbance vector according to the element-wise addition rule, the actual switching angle vector is obtained. This step, based on the element-wise operation principle of vectors, ensures that the initial switching angle of each H-bridge receives corresponding independent disturbance compensation, achieving precise and independent adjustment of the switching angle of each H-bridge. This avoids adjustment coupling between H-bridges, and the final generated actual switching angle retains the high accuracy of the NR-ACA algorithm while possessing dynamic adaptability to the real-time operating conditions of the power grid. This provides accurate and realistic control quantities for the subsequent generation of precise drive pulses for cascaded H-bridge inverters.

[0056] As an optional embodiment, the step of generating the drive pulse for the cascaded H-bridge inverter based on the actual switching angle is as follows: The actual switching angle vector is input to the pulse generation module; the pulse generation module generates the conduction timing of the switching transistors in each H-bridge unit based on the switching angle corresponding to each H-bridge unit, combined with the carrier period and the inverter output frequency. According to the conduction timing, a PWM drive pulse signal corresponding to each H-bridge unit is generated; wherein, the four switching transistors of each H-bridge unit are controlled according to the complementary conduction principle, so that each H-bridge unit outputs a three-level voltage waveform. The PWM drive pulses of each H-bridge unit are applied to the control terminal of the corresponding H-bridge unit's switching transistor, controlling all H-bridge units to turn on and off in sequence, so that the output terminal of the cascaded H-bridge inverter synthesizes a multi-level voltage waveform with the desired fundamental frequency and specified subharmonic content.

[0057] This embodiment inputs the actual switching angle vector, which integrates the initial switching angle and real-time disturbance, into the pulse generation module. Based on the quantization mapping principle of angle and time, and combined with the preset carrier period and the actual output frequency of the inverter, this module converts the switching angle phase angle corresponding to each H-bridge into the turn-on and turn-off time nodes of the switching transistors, generating a precise turn-on sequence for each H-bridge unit's switching transistors. This achieves a precise conversion from digital domain switching angle control quantities to time domain switching transistor action commands, making abstract control parameters the basis for time-dimensional operations that the switching transistors can execute. Furthermore, the turn-on sequence precisely matches the inverter output frequency and carrier period, ensuring the adaptability of the drive signal to the grid operating conditions. Based on the generated turn-on sequence of each H-bridge switching transistor, corresponding PWM drive pulse signals are generated according to the drive logic of the power electronic devices. For the four switching transistors of each H-bridge unit, the principle of complementary conduction between the upper and lower transistors of the bridge arm is strictly followed, and a dead time is configured for control to avoid damage to the devices caused by bridge arm shoot-through. This allows each H-bridge unit to independently output a three-level voltage waveform of E, 0, and −E (E being the H-bridge DC bus voltage), realizing single H-bridge switching transistor... The system provides a safe and reliable drive, while simultaneously enabling a single H-bridge to output a standard three-level voltage waveform, laying the hardware foundation for subsequent cascaded multi-level waveform synthesis. Furthermore, the parameters of the PWM drive pulses are precisely matched with the driving characteristics of the switching transistors, ensuring the effectiveness of the drive signal. By independently applying the PWM drive pulses corresponding to each H-bridge unit to the control terminal of the corresponding H-bridge switching transistor, and controlling all H-bridge units to turn on and off sequentially according to their phases based on the conduction timing of each H-bridge, the system utilizes the series connection topology of the AC side of the cascaded H-bridge inverter to achieve the desired three-level voltage output from each H-bridge. The waveforms are superimposed to obtain a 7-level stepped voltage waveform of 3E, 2E, E, 0, −E, −2E, −3E, taking three cascaded H-bridges as an example. This realizes the synthesis of voltage waveforms from single H-bridge three-level to multi-H-bridge multi-level, allowing the harmonic control requirements based on high-precision actual switching angles to be realized as physical voltage output. The fundamental wave of the generated multi-level voltage waveform strictly matches the amplitude of the 5th and 7th harmonics to the expected output value of the power grid simulator. Moreover, the stepped waveform characteristics significantly reduce the content of high-order harmonics and improve the output waveform quality of the power grid simulator.

[0058] As an optional embodiment, the steps for achieving online generation of SHGPWM by performing closed-loop control of the fundamental and harmonic content in the output voltage based on the driving pulse are as follows: The actual switching angle vector is synchronously input to the transient-free internal observer; the transient-free internal observer calculates in real time the fundamental voltage amplitude and the amplitude of each specified harmonic voltage in the output voltage of the cascaded H-bridge inverter under the current driving pulse according to the preset harmonic voltage amplitude calculation formula. The calculated fundamental and harmonic voltage amplitudes are used as real-time feedback values ​​and output to the input of the closed-loop control system. The real-time feedback quantity is compared with the given fundamental and harmonic voltage amplitudes, and the resulting error signal is used for the calculation of the switching angle disturbance quantity update in the next sampling period. By continuously iterating the above steps, the fundamental frequency and harmonic content of the output voltage are made to track the given value in real time, thereby realizing the online generation and closed-loop control of SHGPWM.

[0059] In this embodiment, the actual switching angle vector is synchronously input to a transient-free internal observer, which is based on a preset harmonic voltage amplitude calculation formula consistent with the SHGPWM nonlinear equation set. Based on the precise quantitative mathematical mapping relationship between switching angle and harmonic amplitude, the fundamental and 5th and 7th harmonic voltage amplitudes of the output voltage of the cascaded H-bridge inverter under the current drive pulse are calculated in real time. This achieves rapid and accurate acquisition of harmonic amplitudes without the need for hardware detection, avoiding the delay problem of hardware sampling and ensuring the real-time performance and calculation accuracy of the feedback. By using the fundamental and harmonic amplitudes calculated by the transient-free internal observer as real-time feedback quantities, they are directly output to the input of the closed-loop control system composed of the QPR controller and integral controller. Relying on the precise docking of the quantized feedback quantity and the control system, a complete feedforward-feedback control closed loop is constructed, realizing the real-time perception of the actual value of the output voltage harmonic amplitude by the closed-loop system, providing a precise quantitative comparison basis for the subsequent extraction of error signals. By performing a difference calculation between this real-time feedback quantity and the given fundamental and harmonic voltage amplitudes expected to be output by the grid simulator, the quantized error signal between the two is extracted. This error signal will be used as the closed-loop control system for the next sampling cycle. The core input, after being decoupled and amplified by the QPR controller for each frequency component and converted into a new switching angle disturbance by the integral controller without steady-state error compensation, achieves accurate quantification and extraction of harmonic amplitude deviation. This allows the update calculation of the switching angle disturbance to have a clear compensation target, ensuring the targeted compensation effect of subsequent switching angle adjustment on amplitude deviation. By continuously iterating through the entire process of switching angle vector input, harmonic amplitude calculation, feedback comparison, error signal processing, and switching angle disturbance update, the actual switching angle of the cascaded H-bridge inverter is dynamically adjusted with the sampling period, and the drive pulse changes in real time with the switching angle. The fundamental frequency and harmonic amplitude of the inverter output voltage continuously converge to the given value, achieving zero steady-state error tracking between the fundamental frequency and the specified harmonic amplitude. This effectively compensates for the attenuation of harmonics by the LC filter and suppresses the impact of grid frequency fluctuations on the control effect. Ultimately, it achieves online real-time generation of SHGPWM and closed-loop control under all operating conditions, realizing accurate reproduction of fault conditions such as grid harmonic distortion and frequency fluctuations.

[0060] As a specific example of this embodiment, in order to realize SHGPWM based on QPR control when three H-bridges are cascaded online, the simulation parameters of the cascaded H-bridge multilevel inverters are set as follows: DC bus voltage E=100V, output side connected LCR , L =5mH, C =15uF, R =14Ω. At 0.06 seconds, let the fundamental modulation ratio... m =0.7, 5th harmonic modulation ratio m h5 =0.01, 7th harmonic modulation ratio m h7 =0.06 becomes m =0.7, m h5 =0.05, m h7 =0.06. Because V h5 = m h5 *3 E Therefore, the given value of the 5th harmonic amplitude is... V h5 * From 3 to 15V, V h1 * =210V, V h7 * =18V. Using the NR-ACA algorithm, the change in the switching angle is as follows: From θ 1 = 11.87 ° , θ 2 = 48.71 ° , θ 3 = 89.38 ° Change to θ 1 = 10.533656 ° , θ 2 = 51.383785 ° , θ 3 = 87.58784 ° At 0.1s, the fundamental frequency is set... f The frequency changes from 50Hz to 60Hz. Cascaded output voltage waveform. V o Waveform and FFT analysis, such as Figure 9 As shown; Figure 9 The diagram includes four scenarios, namely: 9(a) Cascaded output voltage of SHGPWM. Vo Waveform diagram, (9b) V h5 * =3V Vo The FFT analysis plot, (9c) V h5 *=15V V o The FFT analysis plot (9d) shows that the fundamental frequency changes from 50Hz to 60Hz in 0.1 seconds. V o The FFT analysis plot is made by Figure 9 It can be seen that for the cascaded output voltage waveform V o : In 0.06 seconds with a given value V h5 * The actual output value of the 5th harmonic amplitude when changing from 3 to 15V. V h5 Correspondingly, the voltage changes from 2.99V to 15.01V; the actual output value of the fundamental amplitude is 209.9V, almost equal to the given value of 210V; the actual output value of the 7th harmonic amplitude is 17.99V, almost equal to the given value of 18V; the fundamental frequency changes from 50Hz to 60Hz in 0.1 seconds. V o The actual output values ​​of the fundamental, 5th, and 7th harmonic amplitudes are 209.9V, 14.99V, and 17.99V respectively, which are also equal to the given values ​​of 210V, 15V, and 18V. The load voltage after LC filtering... U o FFT analysis, such as Figure 10 As shown, Figure 10 The diagram includes four scenarios, namely: (10a) Load voltage after LC filtering. U o Waveform diagram, (10b) V h5 * =3V U o The FFT analysis plot, (10c) V h5 * =15V U o The FFT analysis plot (10d) shows that after the fundamental frequency changes from 50Hz to 60Hz... U o The FFT analysis plot shows that QPR controls the fundamental, 5th, and 7th harmonic amplitudes of Vo and Uo before and after filtering, and filters out the higher harmonics of Uo.

[0061] Experimental verification: Taking the DC bus voltage E =20V, L =5mH, C =15uF, R =14Ω. Let m =0.7, m h5=0.01, m h7 =0.06 becomes m =0.7, m h5 =0.05, m h7 =0.06, that is, let V h5 * From 0.6 to 3V, V h1 * =42V, V h7 * =3.6V. Cascaded output voltage waveform V o FFT analysis, such as Figure 11 As shown, Figure 11 The diagrams include three scenarios: (11a) the waveform of the cascaded output voltage Vo of SHGPWM, (11b) the FFT analysis diagram of Vo when Vh5*=0.6V, and (11c) the waveform of the cascaded output voltage Vo of SHGPWM. V h5 * =3V V o The FFT analysis plot shows the load voltage after LC filtering. U o FFT analysis, such as Figure 12 As shown, Figure 12 The diagram includes three scenarios: (12a) the waveform of the cascaded output voltage Uo of SHGPWM, and (12b) the waveform of the cascaded output voltage Uo of SHGPWM. V h5 * =0.6V U o The FFT analysis plot, (12c) V h5 * =3V U o The FFT analysis plot.

[0062] In summary, this verifies the basis... QPR The SHGPWM control strategy simulates the effectiveness of the power grid and can precisely control the cascaded output voltage. V o Load voltage U oIt accurately measures the amplitudes of the fundamental and harmonic frequencies; it also features short adjustment times, fast transition processes, and good steady-state and dynamic response performance. Furthermore, it demonstrates the high precision of the NR-ACA algorithm, the accuracy of online implementation of the SHGPWM control strategy, applicability to various operating conditions, and the ability to precisely reproduce power grid fault waveforms. It can also intuitively reflect changes in harmonic amplitude and fundamental frequency.

[0063] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.

[0064] In the embodiments provided in this application, it should be understood that the disclosed structures or methods can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another structure, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection of structures or units, and may be electrical, mechanical, or other forms.

[0065] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0066] Furthermore, in the embodiments of this application, the functional units can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0067] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0068] The specific embodiments described above are preferred embodiments of the SHGPWM generation method for a power grid simulator based on QPR control of the present invention, and are not intended to limit the specific scope of the present invention. The scope of the present invention includes, but is not limited to, these specific embodiments. All equivalent changes made in accordance with the shape and structure of the present invention are within the protection scope of the present invention.

Claims

1. A method for generating SHGPWM in a power grid simulator based on QPR control, characterized in that: Includes the following steps: Based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter, a set of SHGPWM nonlinear equations describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit is established. The SHGPWM nonlinear equations are solved using the Newton-Ant Colony NR-ACA algorithm to obtain the initial switching angle corresponding to the desired harmonic content, and the initial switching angle is stored in a lookup table (LUT). The given fundamental and harmonic voltage amplitudes are used as inputs to the closed-loop control system, and the output voltage of the cascaded H-bridge inverter detected in real time is used as feedback to the closed-loop control system. The QPR controller extracts each frequency component in the error signal, and the frequency components are converted into switching angle disturbances by the integral controller. The actual switching angle is obtained by superimposing the switching angle disturbance amount with the initial switching angle read from the lookup table (LUT). The drive pulses for the cascaded H-bridge inverter are generated based on the actual switching angle. The fundamental and harmonic content of the output voltage is then controlled in a closed loop based on the drive pulses to achieve online generation of SHGPWM.

2. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1, characterized in that: The steps for establishing the SHGPWM nonlinear equations describing the mathematical relationship between the output voltage and the switching angle of each H-bridge unit based on the expected output fundamental and harmonic voltage amplitudes of the cascaded H-bridge inverter are as follows: Set the symmetry conditions for the output voltage waveform of the cascaded H-bridge inverter, including half-wave symmetry and 1 / 4-cycle symmetry; The Fourier series expression of the output voltage is obtained by performing Fourier series expansion on the output voltage waveform that satisfies the symmetry condition. Based on the Fourier series expression, the functional relationship between the amplitude of the nth harmonic voltage and the switching angle of each H-bridge unit is derived. Based on the expected output fundamental and harmonic voltage amplitudes, and using the aforementioned functional relationship as a basis, a set of SHGPWM nonlinear equations concerning the switching angle is established.

3. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1, characterized in that: The number of cascaded H-bridges is 3, and the SHGPWM nonlinear equation set is as follows: ; in, The modulation ratio of the fundamental frequency. The modulation ratio of the 5th harmonic. The modulation ratio of the 7th harmonic. , , The switching angles of the three H-bridge units.

4. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1, characterized in that: The steps for solving the SHGPWM nonlinear equations using the Newton-Ant Colony NR-ACA algorithm are as follows: A1. Rearrange the SHGPWM nonlinear equations to construct an error function set, denoted as... And construct the fitness function y based on the error function set; A2. Initialize the ant colony algorithm parameters, use the switching angle combination as the path solution for the ants, and use the fitness function y as the optimization target to perform a global search, and obtain the switching angle combination that makes the fitness function value optimal as the initial solution of Newton's iteration. A3. Substitute the initial solution into the Newton-Raphson iteration method as the initial value for iteration, linearize the SHGPWM nonlinear equation system, and solve the linear equation system to obtain the switching angle correction. A4. Continuously update the switching angle and determine whether the correction amount meets the preset accuracy requirements; if it does, stop the iteration and output the current switching angle as the initial switching angle; if it does not meet the requirements, return to step A3 for the next iteration.

5. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 4, characterized in that: The steps for constructing the fitness function y based on the error function set are as follows: The corresponding intermediate function is obtained by squaring each error function in the error function group. ; Summing all intermediate functions, adding 1, and then taking the negative reciprocal, we construct the fitness function, denoted as . N represents the number of cascaded H-bridges.

6. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1, characterized in that: The steps of using the given fundamental and harmonic voltage amplitudes as inputs to the closed-loop control system, using the real-time detected output voltage of the cascaded H-bridge inverter as feedback, extracting each frequency component from the error signal through the QPR controller, and converting each frequency component into a switching angle disturbance through the integral controller are as follows: The given voltage signal is generated by multiplying the given fundamental voltage amplitude and the voltage amplitude of each harmonic by the corresponding unit sine signal and then superimposing them. The error signal is obtained by comparing the real-time detected output voltage of the cascaded H-bridge inverter with the given voltage signal. The error signal is input to the parallel fundamental QPR controller and each designated harmonic QPR controller, and each frequency component in the error signal is extracted to output the corresponding fundamental voltage adjustment amount and harmonic voltage adjustment amount. The fundamental voltage adjustment amount and each harmonic voltage adjustment amount are respectively input to the corresponding integral controller for processing to obtain the adjusted voltage correction amount; The voltage correction is converted into a switching angle disturbance based on the inverse matrix and DC bus voltage obtained during the solution process of the Newton-Ant Colony NR-ACA algorithm.

7. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 6, characterized in that: The steps for converting the voltage correction amount into a switching angle perturbation amount based on the inverse matrix and DC bus voltage obtained during the solution process using the Newton-Ant Colony NR-ACA algorithm are as follows: Read the pre-stored inverse matrix from the lookup table (LUT), which is the inverse matrix of the matrix constructed based on the initial switching angle obtained by the Newton-Ant Colony NR-ACA algorithm; The voltage correction values ​​obtained by the integral controller are used to construct a voltage correction vector. Based on the voltage correction vector, voltage coefficient, and inverse matrix, the switching angle disturbance vector is obtained through matrix multiplication.

8. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1, characterized in that: The step of superimposing the switching angle disturbance amount with the initial switching angle read from the lookup table (LUT) to obtain the actual switching angle is as follows: Read the initial switching angle vector corresponding to the current desired harmonic content from the lookup table (LUT); receive the switching angle disturbance vector calculated by the closed-loop control system. The initial switching angle vector and the switching angle disturbance vector are added element-wise to obtain the actual switching angle vector.

9. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1 or 8, characterized in that: The steps for generating the drive pulses for the cascaded H-bridge inverter based on the actual switching angle are as follows: The actual switching angle vector is input to the pulse generation module; the pulse generation module generates the conduction timing of the switching transistors in each H-bridge unit based on the switching angle corresponding to each H-bridge unit, combined with the carrier period and the inverter output frequency. According to the conduction timing, a PWM drive pulse signal corresponding to each H-bridge unit is generated; wherein, the four switching transistors of each H-bridge unit are controlled according to the complementary conduction principle, so that each H-bridge unit outputs a three-level voltage waveform. The PWM drive pulses of each H-bridge unit are applied to the control terminal of the corresponding H-bridge unit's switching transistor, controlling all H-bridge units to turn on and off in sequence, so that the output terminal of the cascaded H-bridge inverter synthesizes a multi-level voltage waveform with the desired fundamental frequency and specified subharmonic content.

10. The SHGPWM generation method for a power grid simulator based on QPR control according to claim 1 or 8, characterized in that: The steps for achieving online generation of SHGPWM by performing closed-loop control of the fundamental and harmonic content in the output voltage based on the driving pulse are as follows: The actual switching angle vector is synchronously input to the transient-free internal observer; the transient-free internal observer calculates in real time the fundamental voltage amplitude and the amplitude of each specified harmonic voltage in the output voltage of the cascaded H-bridge inverter under the current driving pulse according to the preset harmonic voltage amplitude calculation formula. The calculated fundamental and harmonic voltage amplitudes are used as real-time feedback values ​​and output to the input of the closed-loop control system. The real-time feedback quantity is compared with the given fundamental and harmonic voltage amplitudes, and the resulting error signal is used for the calculation of the switching angle disturbance quantity update in the next sampling period. By continuously iterating the above steps, the fundamental frequency and harmonic content of the output voltage are made to track the given value in real time, thereby realizing the online generation and closed-loop control of SHGPWM.