An FPGA design method for real-time simulation of power electronics systems
By adopting the FPGA hardware parallel characteristics and sparse matrix block storage method in the power electronics system, the real-time and computational storage challenges in the real-time simulation of the power electronics system are solved, efficient real-time simulation of the power electronics system is achieved, and the simulation accuracy and computational efficiency are improved.
Patent Information
- Application Number
- CN202310376616.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-04-10
AI Technical Summary
Existing real-time simulation methods for power electronic systems have difficulty ensuring real-time performance during large-scale simulations. Traditional real-time simulation systems face challenges in computing and storage capabilities, and constant admittance models may cause energy loss in virtual components and increase the difficulty of parameter adjustment.
Using FPGA as the underlying hardware, combined with the matrix exponential integration method and the sparse matrix block storage method, a real-time simulation function module was designed to separate the time-varying elements and constant elements in the state matrix. The parallel characteristics and pipeline architecture of FPGA were utilized to realize real-time simulation of power electronic systems.
It achieves efficient real-time simulation of power electronic systems, improves computing efficiency and simulation accuracy, meets the simulation requirements of high-frequency switching characteristics of power electronic equipment, and reduces energy loss of virtual components.
Smart Images

Figure CN116300530B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an FPGA design method, and more particularly to an FPGA design method for real-time simulation of power electronics systems. Background Art
[0002] With economic and technological development, modern society's demand for energy continues to increase. The large-scale development and utilization of fossil fuels has exacerbated problems such as energy depletion, environmental pollution, and climate change. The low-carbon transition of the energy industry is inseparable from renewable energy technologies, which typically require integration into the power system through power electronics. The widespread integration of renewable energy has led to a high proportion of power electronics in my country's power system. Power electronics typically feature high operating frequency, fast response speed, and low inertia. The evolution of traditional power systems towards new power systems with these "dual-high" characteristics is also a process of increasing complexity in the dynamic characteristics of power systems. Research on the dynamic characteristics of power electronics systems requires more than just offline simulation. Real-time simulation technology, a digital simulation technique whose simulation time is fully synchronized with the real clock, can realistically simulate actual physical systems and plays an irreplaceable role in fields such as digital-physical fusion simulation and hardware-in-the-loop testing.
[0003] The dual-resistance model and the constant admittance model are commonly used real-time power electronics simulation models. The dual-resistance model requires updating the system matrix at each switching time step, making real-time simulation difficult to ensure when the simulation scale is large. Another application approach is to use pre-stored matrices, generating all possible parameter matrices offline and pre-storing them in the real-time simulator. However, as the number of power electronic switches increases, the number of pre-stored matrices required increases exponentially, placing high demands on the simulator's memory capacity. To prevent the system matrix from changing with switching, a constant admittance model can be used. This model uses an inductor to simulate the on-state of the switch, and a series capacitor and resistor to simulate the off-state. By adjusting the inductor, capacitor, and resistor values, the equivalent conductance of the switch is maintained constant in different states, ensuring that the system matrix remains unchanged. However, the virtual inductors and capacitors in the constant admittance model may cause branch voltage or current oscillations. When the switch state changes, the energy loss of the virtual components increases the steady-state virtual losses of the converter. Furthermore, the constant admittance model requires parameter adjustment based on the operating state of the external circuit, which increases the difficulty of practical application. The real-time simulation method based on the matrix exponential integration method allows the system matrix to be decomposed into two parts: a constant matrix and a time-varying sparse matrix using the matrix decomposition method. When the state of the power electronic switch changes, only the sparse matrix needs to be updated, thereby avoiding the storage of data matrices or the use of equivalent models, and achieving better computational efficiency and simulation accuracy.
[0004] Efficient real-time simulation of power electronics requires not only efficient simulation methods but also underlying hardware suitable for large-scale, fast computation. Currently, commercial real-time simulators such as RTDS, ADPSS-STS, eMEGAsim, HYPERSIM, and NETOMAC have been widely used in the field of power system real-time simulation. These commercial real-time simulation systems primarily utilize serial processors as their underlying hardware. With the increasing application of power electronics technology in power grids, traditional real-time simulation systems face challenges in computing and storage capacity. FPGAs, as programmable logic devices with highly parallel hardware features, distributed memory, and a pipelined architecture, are well-suited for real-time simulation computations with small step sizes. Consequently, new real-time simulation research often utilizes FPGAs as the underlying hardware. Furthermore, the parallel nature of FPGA hardware can fully leverage the high degree of parallelism in the numerical computation of matrix exponential products. Combining the highly parallel and pipelined hardware characteristics of FPGAs with the numerical computational characteristics of matrix exponential methods, designing a real-time simulation system based on FPGAs offers a new solution for real-time power electronics simulation. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide an FPGA design method for real-time simulation of power electronic systems.
[0006] The technical solution adopted by the present invention is: an FPGA design method for real-time simulation of power electronic systems, comprising the following steps:
[0007] 1) In an offline environment, build a power electronics system simulation example, including m power electronic devices, where m is an integer greater than or equal to 1, read the electrical component parameters, and form the electrical system dynamic equation: Where x(t) is the state variable, is the derivative of the state variable, u(t) is the input variable, y(t) is the output variable, y switch (t) is the switch branch measurement vector, y control (t) is the control system measurement vector, t is time, is the state matrix of the power electronic device when the switching state S(t)=k, is the input matrix, is the output matrix, is the transfer matrix; read the control parameters of the power electronic equipment to form the control system parameter matrix P C ;
[0008] 2) In an offline environment, calculate the augmented state matrix in f is the system frequency, the augmented state matrix A kThe dimension is N, where N is an integer greater than 1, and the augmented state matrix A is obtained. k The constant part when k changes and the changing part Compute the constant state transition matrix Where h is the real-time simulation step size, and the calculation of the change parameter matrix Calculate the output parameter matrix
[0009] 3) The constant state transfer matrix M and the change parameter matrix N k , output parameter matrix C, control system parameter matrix P C and the real-time simulation step length h are stored in the FPGA real-time simulator;
[0010] 4) Setting simulation time t=0, setting the initial power electronic device switch state S(0), the initial value of the state variable x(0), the initial power electronic switch control signal g(0), and starting the FPGA real-time simulator;
[0011] 5) FPGA real-time simulator reads the change parameter matrix N from FPGA according to the switching state S(t) of the power electronic equipment k and the constant state transfer matrix M, calculate the state variable x(t+h)=M(x(t)+N k x(t)), after the calculation is completed, the simulation time advances one step, t = t + h, and the output variable y(t) = Cx(t) at time t is calculated. According to the power electronic switch control signal g(th) at time th and the switch branch measurement vector y at time t switch (t) Determine the switch state S(t) of the power electronic device at time t; at the same time, the FPGA real-time simulator performs control system simulation calculation to obtain the power electronic switch control signal g(t);
[0012] 6) Wait for the physical time to reach the simulation time t, and then proceed to the next step;
[0013] 7) Determine whether the simulation time t reaches the set simulation end time T end , such as reaching the set simulation end time T end , the simulation ends, otherwise returns to step 5).
[0014] The present invention provides an FPGA design method for real-time simulation of power electronic systems. To address the real-time simulation problem of power electronic systems, the present invention combines the advantages of FPGA hardware and the numerical characteristics of the matrix exponential integration method to design a real-time simulation function module. In view of the high-frequency switching characteristics of power electronics, the present invention uses a matrix decomposition method to separate the time-varying elements and the constant elements in the state matrix, thereby solving the problem of time-varying system topology caused by power electronic equipment. At the same time, a sparse matrix block storage method and a core computing unit reuse design method in FPGA are proposed, providing a new implementation method for real-time simulation of power electronic systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is the simulation flow chart of FPGA real-time simulator;
[0016] Figure 2 This is a schematic diagram of the DC microgrid example structure;
[0017] Figure 3 It is a schematic diagram of the DC / DC converter structure;
[0018] Figure 4 It is a schematic diagram of the AC / DC converter structure;
[0019] Figure 5 This is a schematic diagram of the overall architecture of the FPGA real-time simulator;
[0020] Figure 6 This is a schematic diagram of the sparse matrix-vector multiplication calculation module;
[0021] Figure 7 This is a schematic diagram of the multiplication and addition calculation unit of the dense matrix-vector multiplication calculation module;
[0022] Figure 8 is a schematic diagram of output calculation;
[0023] Figure 9 is the DC voltage V dc Simulation result diagram;
[0024] Figure 10 It is the DC side voltage error curve. DETAILED DESCRIPTION
[0025] The following describes in detail an FPGA design method for real-time simulation of power electronics systems according to the present invention in conjunction with the embodiments and drawings.
[0026] like Figure 1 As shown, the present invention provides an FPGA design method for real-time simulation of power electronics systems, comprising the following steps:
[0027] 1) In an offline environment, build a power electronics system simulation example, including m power electronic devices, where m is an integer greater than or equal to 1, read the electrical component parameters, and form the electrical system dynamic equation: Where x(t) is the state variable, is the derivative of the state variable, u(t) is the input variable, y(t) is the output variable, y switch (t) is the switch branch measurement vector, y control (t) is the control system measurement vector, t is time, is the state matrix of the power electronic device when the switching state S(t)=k, is the input matrix, is the output matrix, is the transfer matrix; read the control parameters of the power electronic equipment to form the control system parameter matrix P C ;
[0028] The example structure is as follows Figure 2 As shown, it includes 7 power electronic devices, including 5 DC / DC converters and 2 AC / DC converters. The converter structures are as follows: Figure 3 、 Figure 4 As shown, the DC bus voltage level is 375V, and the bus is connected to energy storage, electric vehicle charging piles, photovoltaics, DC loads and AC loads. The DC / DC of the energy storage adopts constant power control, the DC / DC of the electric vehicle charging pile controls the load side voltage, the DC / DC of the photovoltaic controls the photovoltaic outlet voltage, the DC / DC of the DC load is current control, and the inverter of the AC load adopts constant voltage and constant frequency control. The DC bus is connected to the grid through the line and the converter, and the converter adopts V dc -Q control, the DC bus voltage is jointly controlled by the converter and the power type energy storage unit. The power type energy storage adopts the power tracking control method to stabilize the power.
[0029] 2) In an offline environment, calculate the augmented state matrix in f is the system frequency, the augmented state matrix A k The dimension is N, where N is an integer greater than 1, and the augmented state matrix A is obtained. k The constant part when k changes and the changing part Compute the constant state transition matrix Where h is the real-time simulation step size, and the calculation of the change parameter matrix Calculate the output parameter matrix
[0030] 3) The constant state transfer matrix M and the change parameter matrix N k, output parameter matrix C, control system parameter matrix P c and the real-time simulation step length h are stored in the FPGA real-time simulator;
[0031] The parameter matrix N will be changed k The process of storing in FPGA real-time simulator is to adopt sparse matrix block storage method, which is to store the variable parameter matrix N k The non-zero elements that change with the switching state of the i-th power electronic device are divided into block change parameter matrices N k_i , i=1,2,...,m, the first block change parameter matrix N k_1 The non-zero elements in the first row of the matrix in the first switching state are stored in the FPGA in sequence, and then the non-zero elements in the next row of the matrix are stored until all the non-zero elements of the matrix are stored in the memory. Then, all the non-zero elements in the matrix in the next switching state are stored in the same way as the block matrix in the first switching state until the first block change parameter matrix N k_1 All non-zero elements in the matrix of all switch states are stored in FPGA, and then the parameter matrix N is changed according to the first block. k_1 The storage method stores the next block change parameter matrix N k_2 , until all block change parameter matrices are stored in FPGA.
[0032] 4) Setting simulation time t=0, setting the initial power electronic device switch state S(0), the initial value of the state variable x(0), the initial power electronic switch control signal g(0), and starting the FPGA real-time simulator;
[0033] 5) FPGA real-time simulator reads the change parameter matrix N from FPGA according to the switching state S(t) of the power electronic equipment k and the constant state transfer matrix M, calculate the state variable x(t+h)=M(x(t)+N k x(t)), after the calculation is completed, the simulation time advances one step, t = t + h, and the output variable y(t) = Cx(t) at time t is calculated. According to the power electronic switch control signal g(th) at time th and the switch branch measurement vector Y at time t switch (t) Determine the switch state S(t) of the power electronic device at time t; at the same time, the FPGA real-time simulator performs control system simulation calculation to obtain the power electronic switch control signal g(t); where:
[0034] The calculation of the state variable at time t+h is x(t+h)=M(x(t)+N k x(t)) is calculated by the sparse matrix vector multiplication calculation module and the dense matrix vector multiplication calculation module. Figure 6 As shown, the sparse matrix vector multiplication calculation module is composed of a group of multiplication and addition operation units, and the multiplication and addition operation unit includes a multiplier and an adder. The multiplication and addition operation unit in the sparse matrix vector multiplication calculation module performs the sparse matrix N in the form of a pipeline. k Multiplication operation with x(t); The dense matrix-vector multiplication calculation module consists of J groups of multiplication and addition units and a group of memories, where J is equal to the augmented state matrix A k The dimension N, such as Figure 7 As shown, in this embodiment, the dense matrix vector multiplication calculation module is composed of 46 groups of multiplication and addition operation units and a group of memories. The multiplication and addition operation units of the dense matrix vector multiplication calculation module are used to calculate the matrix M and the vector (x(t)+N k x(t)) multiplication operation, the adder in the multiplication and addition unit of the dense matrix vector multiplication calculation module is also used for x(t) and N k x(t) is summed, and the memory is used to store the vector (x(t)+N k x(t)), after completing the calculation of the state variable x(t+h) at time t+h, the simulation time advances one step, t=t+h.
[0035] The process of calculating the output variable y(t)=Cx(t) at time t is as follows: Figure 8 As shown, it is realized by a set of multiplication and addition units, which include a multiplier and an adder, and complete the multiplication operation of the C matrix and x(t) in the form of a pipeline, and obtain each element of the output variable y(t) in turn, Y switch When the calculation is completed, the power electronic switch control signal g(th) at time th and the switch branch measurement vector Y at time t are started. switch (t) judges the switch state S(t) at time t, and the multiplication and addition units calculate y in parallel control (t).
[0036] 6) Wait for the physical time to reach the simulation time t, and then proceed to the next step;
[0037] 7) Determine whether the simulation time t reaches the set simulation end time T end , such as reaching the set simulation end time T end , the simulation ends, otherwise returns to step 5).
[0038] This paper uses Altera's Stratix V series FPGA EP5SGSMD5K2F40C2 and its accompanying development board as the simulation platform. The real-time simulation system is driven by a 125MHz clock. The DC microgrid calculation example occupies 62.20% of logic resources, 10.64% of storage resources, and 15.60% of DSP resources. The actual calculation time per time step is 2.104μs. The simulation scenario is the change of light intensity. The FPGA simulation results are compared with the EMTP simulation results. Figure 9 、 10 From the comparison of simulation results, it can be seen that the FPGA simulation results are basically consistent with the EMTP simulation results, which proves the effectiveness of the real-time simulation system designed by the present invention.
Claims
1. An FPGA design method for real-time simulation of power electronics systems, characterized in that: The steps include: 1) In an offline environment, build a power electronics system simulation example, including m power electronic devices, where m is an integer greater than or equal to 1, read the electrical component parameters, and form the electrical system dynamic equation: Where x(t) is the state variable, is the derivative of the state variable, u(t) is the input variable, y(t) is the output variable, y switch (t) is the switch branch measurement vector, y control (t) is the control system measurement vector, t is time, is the state matrix of the power electronic device when the switching state S(t)=k, is the input matrix, is the output matrix, is the transfer matrix; read the control parameters of the power electronic equipment to form the control system parameter matrix P C ; 2) In an offline environment, calculate the augmented state matrix in f is the system frequency, the augmented state matrix A k The dimension is N, where N is an integer greater than 1, and the augmented state matrix A is obtained. k The constant part when k changes and the changing part Compute the constant state transition matrix Where h is the real-time simulation step size, and the calculation of the change parameter matrix Calculate the output parameter matrix 3) The constant state transfer matrix M and the change parameter matrix N k , output parameter matrix C, control system parameter matrix P c and the real-time simulation step length h are stored in the FPGA real-time simulator; 4) Setting simulation time t=0, setting the initial power electronic device switch state S(0), the initial value of the state variable x(0), the initial power electronic switch control signal g(0), and starting the FPGA real-time simulator; 5) FPGA real-time simulator reads the change parameter matrix N from FPGA according to the switching state S(t) of the power electronic equipment k and the constant state transfer matrix M, calculate the state variable x(t+h)=M(x(t)+N k x(t)), after the calculation is completed, the simulation time advances one step, t = t + h, and the output variable y(t) = Cx(t) at time t is calculated. According to the power electronic switch control signal g(th) at time th and the switch branch measurement vector y at time t switch (t) Determine the switch state S(t) of the power electronic device at time t; at the same time, the FPGA real-time simulator performs control system simulation calculation to obtain the power electronic switch control signal g(t); 6) Wait for the physical time to reach the simulation time t, and then proceed to the next step; 7) Determine whether the simulation time t reaches the set simulation end time T end , such as reaching the set simulation end time T end , the simulation ends, otherwise returns to step 5).
2. The FPGA design method for real-time simulation of power electronics system according to claim 1, characterized in that: Step 3) The parameter matrix N is changed k The process of storing in FPGA real-time simulator is to adopt sparse matrix block storage method, which is to store the variable parameter matrix N k The non-zero elements that change with the switching state of the i-th power electronic device are divided into block change parameter matrices N k_i , i=1,2,...,m, the first block change parameter matrix N k_1 The non-zero elements in the first row of the matrix in the first switching state are stored in the FPGA in sequence, and then the non-zero elements in the next row of the matrix are stored until all the non-zero elements of the matrix are stored in the memory. Then, all the non-zero elements in the matrix in the next switching state are stored in the same way as the block matrix in the first switching state until the first block change parameter matrix N k_1 All non-zero elements in the matrix of all switch states are stored in FPGA, and then the parameter matrix N is changed according to the first block. k_1 The storage method stores the next block change parameter matrix N k_2 , until all block change parameter matrices are stored in FPGA.
3. The FPGA design method for real-time simulation of power electronics system according to claim 1, characterized in that: Step 5) calculates the state variable x(t+h)=M(x(t)+N k x(t)) is calculated by a sparse matrix vector multiplication calculation module and a dense matrix vector multiplication calculation module. The sparse matrix vector multiplication calculation module is composed of a group of multiplication and addition operation units. The multiplication and addition operation unit includes a multiplier and an adder. The multiplication and addition operation unit in the sparse matrix vector multiplication calculation module performs the sparse matrix N in the form of a pipeline. k Multiplication operation with x(t); The dense matrix-vector multiplication calculation module consists of J groups of multiplication and addition units and a group of memories, where J is equal to the augmented state matrix A k The dimension N, the multiplication and addition unit of the dense matrix vector multiplication calculation module is used to combine the matrix M with the vector (x(t)+N k x(t)) multiplication operation, the adder in the multiplication and addition unit of the dense matrix vector multiplication calculation module is also used for x(t) and N k x(t) is summed, and the memory is used to store the vector (x(t)+N k x(t)).
4. The FPGA design method for real-time simulation of power electronics system according to claim 1, characterized in that: The process of calculating the output variable y(t)=Cx(t) at time t described in step 5) is implemented by a set of multiplication and addition units, which include a multiplier and an adder, and sequentially complete the multiplication operation of the C matrix and x(t) in the form of a pipeline, and sequentially obtain each element of the output variable y(t), y switch When the calculation is completed, the power electronic switch control signal g(th) at time th and the switch branch measurement vector y at time t are started. switch (t) judges the switch state S(t) at time t, and the multiplication and addition units calculate y in parallel control (t).
Citation Information
Patent Citations
Electromagnetic transient simulation method of electric system based on matrix exponential
CN103646152A
Electromagnetic transient implicit reduced order simulation method based on matrix index
CN104217074A