Electromagnetic transient simulation solving module and system
By designing the electromagnetic transient simulation solution module, including the node current merging unit in the group, the controllable accumulation module and the multiplier module, the problem that the existing technology is difficult to meet the simulation needs of high-frequency power electronic devices is solved, and efficient electromagnetic Transient simulation and optimal utilization of FPGA resources.
Patent Information
- Application Number
- CN202411399376.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-21
AI Technical Summary
The existing electromagnetic transient simulation technology is difficult to meet the simulation needs of high-frequency power electronic devices, especially in terms of accuracy and speed.
Design an electromagnetic temporary simulation and solution module, including the current node current merger unit, the Zerkecona cumulative module, and the method of module. Level, save FPGA computing resources.
The efficient electromagnetic temporary simulation is implemented. The simulation step can support below 250ns, meet the simulation requirements of high -frequency electric electronic devices, and improve the efficiency of FPGA resource utilization and simulation computing.
Smart Images

Figure CN119337602A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power systems, and in particular to an electromagnetic transient simulation solution module and system. Background Art
[0002] With the continuous increase in energy demand and the rapid development of renewable energy power generation, the power grid system presents the "double high" characteristics of high proportion of renewable energy and high proportion of power electronic equipment access. A large number of renewable energy power generation systems such as photovoltaic and wind power are connected to the power grid, which affects the security and stability of the power grid. In order to ensure the safe and stable operation of the power grid, power grid practitioners and renewable energy manufacturers are seeking more accurate and reliable solutions to analyze the impact of equipment access on the stability of the power grid. Therefore, electromagnetic transient simulation plays an increasingly important role in system planning, design and operation.
[0003] Hardware-in-the-loop simulation is currently a commonly used means to assess the safety risks of equipment access to the network. Different from large-scale system-level full electromagnetic transient simulation, the scale of hardware-in-the-loop simulation is often limited. It requires real-time simulation of the device under test and the digital model while ensuring accuracy, that is, the simulation results must be synchronized with the real-time clock to achieve real-time data interaction between the real physical device and the digital model. In real-time simulation, the simulation step size is a key factor in reproducing high-frequency transient characteristics. For power electronic systems, there are a large number of power electronic devices that open and close quickly, and the switching frequency is generally at the kHz level. According to the sampling law, in order to accurately sample and simulate the pulse width modulation (PWM) signal of such systems, the simulation cycle needs to be 1 / 50 or 1 / 100 of the PWM cycle, that is, at least 50 to 100 samples are required in one PWM cycle to better simulate the impact of the control signal on the power electronic system. Therefore, a simulation step size of microseconds or nanoseconds is required to meet the requirements of electromagnetic transient simulation of high-frequency power electronic devices. Summary of the invention
[0004] The purpose of the present invention is to provide an electromagnetic transient simulation solution module and system to improve the above-mentioned problems.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides an electromagnetic transient simulation solution module, the electromagnetic transient simulation solution module comprising an intra-group node current merging unit, Z controllable accumulation modules and a multiplier module, where Z is the total number of nodes in the electromagnetic transient simulation solution system;
[0007] The intra-group node current merging unit is used to obtain a current set of each node, wherein the current set includes an inflow current and an outflow current related to each branch of each node and each element combination;
[0008] The zth controllable accumulation module is used to accumulate the inflow current and outflow current related to the zth node in the current set to determine the node current corresponding to the zth node;
[0009] The multiplier module is used to perform calculations according to the node current vector and the impedance matrix parameters to obtain a voltage set corresponding to each node, wherein the node current vector includes the node current corresponding to each node, and the voltage set includes voltage information corresponding to each node;
[0010] The zth controllable accumulation module is used to accumulate the voltages associated with the zth node in the voltage set to determine the node voltage corresponding to the zth node, and then generate a node voltage vector.
[0011] Optionally, the intra-group node current merging unit includes a plurality of intra-group node current merging devices;
[0012] The node current merging device in the (i, 2j-1)th group is used to calculate the inflow current of the first type of node, wherein the first type of node is the head end node of the jth branch of any element in the i-th element combination, the inflow current of the first type of node includes the sum of the historical currents of the first type of branch, the first type of branch is the head end node of the first type of node, and is the jth branch of any element in the i-th element combination;
[0013] The node current merging device in the (i, 2j)th group is used to calculate the outflow current of the second type node, wherein the second type node is the end node of the jth branch of any element in the i-th element combination, the outflow current of the second type node includes the negative of the sum of the historical currents of the second type branch, the second type branch is the end node of the second type node, and is the jth branch of any element in the i-th element combination;
[0014] When the i-th element combination is any one of an RLC element combination, a power type element combination and a switch type element combination, the value of j is 1; when the i-th element combination is a four-port element combination, the value of j is 1 or 2; when the i-th element combination is a six-port element combination, the value of j is 1 to 3.
[0015] Optionally, the controllable accumulation module includes a controller, a storage unit, a selector and an M-stage pipeline adder;
[0016] The first end of the selector is connected to the intra-group node current merging unit, the second end of the selector is connected to the multiplier module, the third end of the selector is connected to the storage unit, the fourth end of the selector is connected to the controller, the fifth end of the selector is connected to the first input end of the first-stage adder, and the output end of the M-th-stage adder is respectively connected to the second input end of the first-stage adder, the storage unit and the multiplier module;
[0017] The controller is connected to the storage unit.
[0018] Optionally, the current set or the voltage set processed by the zth controllable accumulation module is a target data set, and the target data set includes N data;
[0019] The selector is used to sequentially transmit the data in the target data set to the first input terminal of the first-stage adder according to the clock cycle;
[0020] The output data of the M-th adder is used as the input data of the second input terminal of the 1st-level adder in the next clock cycle;
[0021] The M-stage pipeline adder is used to calculate the sum of the input data of the first input terminal and the input data of the second input terminal of the first-stage adder, and output it through the M-stage adder, wherein the calculation time is M clock cycles;
[0022] The controller is used to control the storage unit to store the partial sum of the M-stage pipeline adder, and at the corresponding reading time, send a switching instruction to the selector to transmit the partial sum in the storage unit to the first input end of the first-stage adder through the selector until the accumulation result of the target data set is obtained, and the accumulation result of the target data set is the node current or node voltage corresponding to the zth node.
[0023] Optionally, the controller is used to store the first partial sum S1 output by the M-stage pipeline adder into the storage unit in the T1th clock cycle, wherein T1 represents the effective time of the first partial sum;
[0024] The controller is used to store the second part and S2 output by the M-stage pipeline adder into the storage unit in the T2th clock cycle, wherein T2 represents the effective time of the second part and S2;
[0025] The controller is used to transmit the first part and S1 to the first input end of the first-stage adder in the T1+3th clock cycle, and the input data of the second input end of the first-stage adder is the third part and S3, and the M-stage pipeline adder executes S1+S3;
[0026] The controller is used for transmitting the second part and S2 to the first input terminal of the first-stage adder in the T2+3th clock cycle, when the input data of the second input terminal of the first-stage adder is the fourth part and S4, and the M-stage pipeline adder executes S2+S4;
[0027] The controller is used for M +M×(i-1)+4 clock cycles, S 2i+3 Transmitted to the first input terminal of the first-stage adder, and in the T M +M×i+3 clock cycles, the M-stage pipeline adder outputs S1+S3+…+S 2i+3 ; Among them, T M For Part M and the effective time, S 2i+3 For the T 2i+3 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle;
[0028] The controller is used for M +M×(i-1)+5 clock cycles, S 2i+4 Transmitted to the first input terminal of the first stage adder, and in the T M +M×i+4 clock cycles, the M-stage pipeline adder outputs S2+S4+…+S 2i+4 ; Among them, S 2i+4 For the T 2i+4 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle.
[0029] Optionally, the controller is used to record T when M is an odd number. SM1 =S1+S3+…+S M The clock cycle in which the accumulated result takes effect is T SM1 +1 clock cycle, S2+S4+…+S M-1 Transmitted to the first input terminal of the first-stage adder, and in the T SM1 +M clock cycles to obtain the accumulated result of the target data set;
[0030] The controller is used when M is an even number, T SM2 S2+S4+…+S M The clock cycle in which the accumulated result takes effect is T SM2 +1 clock cycle, S1+S3+…S M-1 Transmitted to the first input terminal of the first stage adder, and in the T SM2 +M clock cycles to obtain the accumulated result of the target data set.
[0031]
[0032] Among them, floor is the floor rounding function, mod is the remainder function, N represents the number of data in the target data set, T m Indicates the mth part and the effective time.
[0033] Optionally, the total calculation time of the accumulated result of the target data set is:
[0034]
[0035] In the formula, ceil is the upward rounding function, mod is the remainder function, T f Indicates the total calculation time.
[0036] Optionally, the multiplier module is used to obtain impedance matrix parameters from an initialization module.
[0037] In a second aspect, an embodiment of the present invention provides an electromagnetic transient simulation solution system, comprising a main control module, an initialization module, a component update module and a solution module, wherein the solution module is the above-mentioned electromagnetic transient simulation solution module;
[0038] The main control module is connected to the component update module, the solution module and the initialization module respectively, the component update module is connected to the solution module, the initialization module is connected to the component update module and the solution module respectively, and the initialization module is used to cache component parameters and impedance matrix parameters;
[0039] When the component update enable instruction transmitted by the main control module is obtained, the component update module is used to obtain the historical current of each component in the simulation period according to the component parameters and the node voltage vector of the previous simulation period;
[0040] After obtaining the solution instruction transmitted by the main control module, the solution module is used to perform a solution according to the historical current of each component in the simulation period and the impedance matrix parameters to obtain the node current vector and / or node voltage vector in the simulation period;
[0041] The node current vector includes the node current of each node in the simulation period, and the node voltage vector includes the node voltage of each node in the simulation period.
[0042] Compared with the prior art, an electromagnetic transient simulation solution module and system provided in an embodiment of the present invention, the electromagnetic transient simulation solution module includes a node current merging unit within the group, Z controllable accumulation modules and a multiplier module, Z is the total number of nodes in the electromagnetic transient simulation solution system; the node current merging unit within the group is used to obtain the current set of each node, wherein the current set includes the inflow current and outflow current related to each branch of each node and each component combination; the zth controllable accumulation module is used to accumulate the inflow current and outflow current related to the zth node in the current set to determine the node current corresponding to the zth node; the multiplier module is used to solve according to the node current vector and the impedance matrix parameters to obtain the voltage set corresponding to each node, wherein the node current vector includes the node current corresponding to each node, and the voltage set includes the voltage information corresponding to each node; the zth controllable accumulation module is used to accumulate the voltage related to the zth node in the voltage set to determine the node voltage corresponding to the zth node, and then generate the node voltage vector. By reusing the controllable accumulation module for accumulation operations, the pipeline depth M can be flexibly controlled according to the time constraint, and the vector length supported can also be flexibly controlled during operation. Therefore, this module can be used in the accumulation of node current merging, and can also be reused in the multiplication and accumulation process of network equation solving, which greatly saves FPGA computing resources and meets the requirements of electromagnetic transient simulation of high-frequency power electronic devices.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A schematic diagram of the structure of an electromagnetic transient simulation solution system provided in an embodiment of the present invention.
[0046] Figure 2 A schematic diagram of the structure of an electromagnetic transient simulation solution module provided in an embodiment of the present invention.
[0047] Figure 3 A schematic diagram of the relationship between the intra-group node current merging unit and the component updating module provided in an embodiment of the present invention.
[0048] In the figure: 10-main control module; 20-initialization module; 30-element update module; 40-solution module; 41-intra-group node current merging unit; 42-controllable accumulation module; 43-multiplier module. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0052] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0053] In the description of the present invention, it should be noted that the terms "upper", "lower", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are directions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0054] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "disposed" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0056] Most widely used electromagnetic transient simulators use digital signal processors (DSP) or general-purpose central processing units (CPU) for electromagnetic transient simulation calculations. DSP or CPU is based on serial computing mode, and parallelization will bring additional communication overhead. Their simulation step size generally supports 10us to 100us. There are also some electromagnetic transient simulation solvers built on field-programmable gate arrays (FPGAs), which speed up the calculation speed of digital simulation systems without sacrificing simulation accuracy and realize true parallel processing. However, there is still much room for improvement in the simulation efficiency and resource utilization of existing FPGA simulators.
[0057] The embodiment of the present invention provides an FPGA-based electromagnetic transient simulation solution system, which can realize precise control of the electromagnetic transient simulation process on the FPGA, improve the electromagnetic transient simulation calculation efficiency of the FPGA, and support the simulation step length to be less than 250ns. In addition, a reusable controllable accumulation module is proposed to realize the reuse of FPGA computing resources in the electromagnetic transient simulation calculation process, improve the utilization rate of FPGA resources, and thus lower the performance threshold of FPGA. On the one hand, the electromagnetic transient simulation solution system can be adapted to a wider range of FPGA models; on the other hand, the electromagnetic transient simulation solution system has scalability, which can further expand the scale of electromagnetic transient simulation that can be supported.
[0058] Please refer to Figure 1 , Figure 1 The schematic diagram of the structure of the electromagnetic transient simulation solution system provided by the embodiment of the present invention is as follows. The electromagnetic transient simulation solution system comprises a main control module 10, an initialization module 20, a component update module 30 and a solution module 40. The solution module 40 may be the following electromagnetic transient simulation solution module.
[0059] The main control module 10 is connected to the component update module 30, the solution module 40 and the initialization module 20 respectively. The component update module 30 is connected to the solution module 40. The initialization module 20 is connected to the component update module 30 and the solution module 40 respectively. The initialization module 20 is used to cache component parameters and impedance matrix parameters.
[0060] When the component update enable instruction transmitted by the main control module 10 is obtained, the component update module 30 is used to obtain the historical current of each component in the simulation period according to the component parameters and the node voltage vector of the previous simulation period.
[0061] After obtaining the solution instruction transmitted by the main control module 10, the solution module 40 is used to solve according to the historical current and impedance matrix parameters of each component in the simulation period to obtain the node current vector and / or node voltage vector in the simulation period;
[0062] The node current vector includes the node current of each node in the simulation period, and the node voltage vector includes the node voltage of each node in the simulation period.
[0063] Please continue to refer to Figure 1 In an optional implementation, the initialization module 20 is used to communicate with an external device after acquiring the initialization start instruction transmitted by the main control module 10 to receive initialization parameters, wherein the initialization parameters include simulation parameters, component parameters, and impedance matrix parameters.
[0064] Please refer to Figure 2 , Figure 2 The schematic diagram of the structure of the electromagnetic transient simulation solution module provided by the embodiment of the present invention is also called the node current merging and network equation solution module. Figure 2 ① represents the current set, ② represents the node current vector, ③ represents the voltage set (multiplication result), and ④ represents the node current vector.
[0065] The electromagnetic transient simulation solution module includes an intra-group node current merging unit 41, Z controllable accumulation modules 42 and a multiplier module 43, where Z is the total number of nodes in the electromagnetic transient simulation solution system.
[0066] The intra-group node current merging unit 41 is used to obtain the current set of each node, wherein the current set includes the inflow current and outflow current related to each branch of each node and each component combination.
[0067] The node current merging unit 41 in the group obtains the current set of each node according to the historical current transmitted by the component update module 30. Because each component update module 30 is independently and parallelly calculated in the FPGA, and their calculation complexity is different, the time to complete the component historical current calculation is also inconsistent. Therefore, for the component update module that completes the historical current calculation first, the node current in the group can be merged first.
[0068] The zth controllable accumulation module 42 is used to accumulate the inflow current and outflow current related to the zth node in the current set to determine the node current corresponding to the zth node.
[0069] The multiplier module 43 is used to perform calculations based on the node current vector and the impedance matrix parameters to obtain a voltage set corresponding to each node, wherein the node current vector includes the node current corresponding to each node, and the voltage set includes the voltage information corresponding to each node.
[0070] The zth controllable accumulation module 42 is used to accumulate the voltages related to the zth node in the voltage set to determine the node voltage corresponding to the zth node, and then generate a node voltage vector.
[0071] In the electromagnetic transient simulation solution module provided in the embodiment of the present invention, by reusing the controllable accumulation module 42 for accumulation operation, its flow depth M can be flexibly controlled according to the time constraint, and the vector length supported by it can also be flexibly controlled during operation. Therefore, the module can be used in the accumulation of node current merging, and can also be reused in the multiplication and accumulation process of the network equation solution process, which greatly saves FPGA computing resources and meets the electromagnetic transient simulation requirements of high-frequency power electronic devices.
[0072] Please refer to Figure 3 , Figure 3 A schematic diagram of the relationship between the intra-group node current merging unit and the component updating module provided in an embodiment of the present invention.
[0073] The component update module 30 includes any one or more of an RLC component update module, a power supply component update module, a switch component update module, a four-port component update module, and a six-port component update module. It should be noted that the number of each type of component update module included is not limited to 1, and can be greater than or equal to 1.
[0074] The RLC component update module is used to obtain the historical current of each RLC component during the simulation period. The power supply component update module is used to obtain the historical current of each power supply component during the simulation period. The switch component update module is used to obtain the historical current of each switch component during the simulation period. The four-port component update module is used to obtain the historical current of each four-port component during the simulation period. The six-port component update module is used to obtain the historical current of each six-port component during the simulation period.
[0075] It should be noted that each component update module manages a component combination respectively. When the component combination is any one of an RLC component combination, a power supply type component combination, and a switch type component combination, the components in the component combination correspond to only one branch, and the component combination corresponds to two intra-group node current merging devices. When the component combination is a four-port component combination, the components in the component combination correspond to two branches, and the component combination corresponds to four intra-group node current merging devices. When the component combination is a six-port component combination, the components in the component combination correspond to three branches, and the component combination corresponds to six intra-group node current merging devices.
[0076] Optionally, the intra-group node current merging unit 41 includes a plurality of intra-group node current merging devices.
[0077] The node current merging device within the (i, 2j-1)th group is used to calculate the inflow current of the first type of node, wherein the first type of node is the head end node of the jth branch of any element in the i-th element combination, the inflow current of the first type of node includes the sum of the historical currents of the first type of branches, the first type of branch is the head end node, is the first type of node, and is the jth branch of any element in the i-th element combination.
[0078] If it is not a first-type node, the solution result of the inflow current associated with the j-th branch of the i-th element combination is 0.
[0079] The node current merging device within the (i, 2j)th group is used to calculate the outflow current of the second type node, wherein the second type node is the end node of the jth branch of any element in the i-th element combination, the outflow current of the second type node includes the negative sum of the historical currents of the second type branch, the second type branch is the end node is the second type node, and is the jth branch of any element in the i-th element combination.
[0080] If it is not a second-type node, the solution result of the outflow current associated with the j-th branch of the i-th element combination is 0.
[0081] When the i-th element combination is any one of an RLC element combination, a power type element combination and a switch type element combination, the value of j is 1; when the i-th element combination is a four-port element combination, the value of j is 1 or 2; when the i-th element combination is a six-port element combination, the value of j is 1 to 3.
[0082] Please continue to refer to the figure. In an optional implementation, the controllable accumulation module 42 includes a controller, a storage unit, a selector, and an M-stage pipeline adder, wherein the storage unit is also called a partial sum result storage unit.
[0083] In an M-stage pipeline adder, the output end of the i-th stage adder is connected to the input end of the i+1-th stage adder, where i is less than M.
[0084] The first end of the selector is connected to the intra-group node current merging unit 41, the second end of the selector is connected to the multiplier module, the third end of the selector is connected to the storage unit, the fourth end of the selector is connected to the controller, the fifth end of the selector is connected to the first input end (in1) of the first-stage adder, and the output end of the M-th-stage adder is respectively connected to the second input end (in2) of the first-stage adder, the storage unit and the multiplier module 43. The controller is connected to the storage unit.
[0085] In an optional embodiment, the selector is also connected to the main control module 10. The main control module 10 can send a component node current accumulation instruction to the selector, so that the selector transmits the data in the current set obtained by the intra-group node current merging unit 41 to the M-level pipeline adder for accumulation operation. The main control module 10 can also send a matrix vector multiplication accumulation instruction to the selector, so that the selector transmits the data in the set obtained by the multiplier module 43 to the M-level pipeline adder for accumulation operation.
[0086] Optionally, the current set or voltage set processed by the zth controllable accumulation module 42 is a target data set, and the target data set includes N data.
[0087] The selector is used to transmit the data in the target data set to the first input terminal of the first-stage adder in sequence according to the clock cycle.
[0088] The output data of the Mth-stage adder is used as the input data of the second input terminal of the 1st-stage adder in the next clock cycle.
[0089] The M-stage pipeline adder is used to calculate the sum of the input data of the first input terminal and the input data of the second input terminal of the 1st stage adder, and output it through the M-th stage adder, wherein the calculation time length is M clock cycles.
[0090] The controller is used to control the storage unit to store the partial sum of the M-stage pipeline adder, and at the corresponding reading time, send a switching instruction (also called a partial sum accumulation read control instruction) to the selector to transmit the partial sum in the storage unit to the first input end of the first-stage adder through the selector until the accumulation result of the target data set is obtained, and the accumulation result of the target data set is the node current or node voltage corresponding to the zth node.
[0091] It should be noted that at the reading time, all data in the target data set are added to the first-level adder.
[0092] The controller is used for storing the first partial sum S1 outputted by the M-stage pipeline adder into the storage unit in the T1th clock cycle, wherein T1 represents the time when the first partial sum takes effect.
[0093] It should be noted that when a partial sum needs to be stored in a clock cycle of a storage unit, the controller can send a partial sum accumulation storage control instruction to the storage unit to store the partial sum output by the M-stage pipeline adder in the clock cycle in the storage unit.
[0094] The controller is used for storing the second part sum S2 outputted by the M-stage pipeline adder into the storage unit in the T2th clock cycle, wherein T2 represents the time when the second part sum takes effect.
[0095] The controller is used to transmit the first part and S1 to the first input end of the first-stage adder in the T1+3th clock cycle. At this time, the input data of the second input end of the first-stage adder is the third part and S3, and the M-stage pipeline adder executes S1+S3.
[0096] The controller is used to transmit the second part and S2 to the first input end of the first-stage adder in the T2+3th clock cycle. At this time, the input data of the second input end of the first-stage adder is the fourth part and S4, and the M-stage pipeline adder executes S2+S4.
[0097] The controller is used to M +M×(i-1)+4 clock cycles, S 2i+3 Transmitted to the first input terminal of the first stage adder, and in the T M +M×i+3 clock cycles M-stage pipeline adder outputs S1+S3+…+S 2i+3 ; Among them, T M For Part M and the effective time, S 2i+3 For the T 2i+3 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle.
[0098] The controller is used to M +M×(i-1)+5 clock cycles, S2i+4 Transmitted to the first input terminal of the first stage adder, and in the T M +M×i+4 clock cycles M-stage pipeline adder outputs S2+S4+…+S 2i+4 ; Among them, S 2i+4 For the T 2i+4 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle.
[0099] The controller is used when M is an odd number, record T SM1 =S1+S3+…+S M The clock cycle in which the accumulated result takes effect is T SM1 +1 clock cycle, S2+S4+…+S M-1 Transmitted to the first input terminal of the first stage adder, and in the T SM1 +M clock cycles to obtain the accumulated result of the target data set.
[0100] The controller is used when M is an even number, record T SM2 S2+S4+…+S M The clock cycle in which the accumulated result takes effect is T SM2 +1 clock cycle, S1+S3+…S M-1 Transmitted to the first input terminal of the first stage adder, and in the T SM2 +M clock cycles to obtain the accumulated result of the target data set.
[0101] When M is an odd number, the maximum value of i is (M-3)÷2; when M is an even number, the maximum value of i is (M-4)÷2.
[0102] The controller can determine the part and effective time based on the following formula.
[0103]
[0104] Among them, floor is the floor rounding function, mod is the remainder function, N represents the number of data in the target data set, T m Indicates the mth part and the effective time.
[0105] The total computation time of the cumulative result of the target data set is:
[0106]
[0107] In the formula, ceil is the upward rounding function, mod is the remainder function, T f Indicates the total calculation time.
[0108] Taking N as 64 and M = 5-stage pipeline adder as an example, the implementation method of the controllable accumulation module is specifically described. The in1 port inputs the target data set in the pipeline, recorded as data1~64; the in2 port inputs the "partial sum" after the 5-stage pipeline adder operation. The timestamp inputs the FPGA clock cycle into the controller, which is used by the controller to determine when to issue a partial sum accumulation storage or read instruction.
[0109] After the first adder cycle (5 clock cycles), the partial sum is now equal to data1. At the 6th clock cycle, data1 is input from the in2 port, and the first-level adder will perform the operation of data1+data6. Similarly, at the 11th clock cycle, the partial sum of data1+data6 and data11 will enter the first-level adder, at the 12th clock cycle, the partial sum of data2+data7 and data12 will enter the first-level adder, and at the 13th clock cycle, the partial sum of data3+data8 and data13 will enter the first-level adder.
[0110] After 6 clock cycles, all results are inputted. It is the thirteenth adder cycle. The values in the 5-stage adder will be data1+data6+data11+…+data61, data2+data7+…+data62, data3+data8+…+data63, data4+data9+…+data64, data5+data10+…+data60 respectively.
[0111] In the next five clock cycles, five partial sums can be obtained (M-stage adders will obtain M partial sums), and the controller stores them in the partial sum result storage unit. According to the order of effectiveness, the partial sum results are as follows:
[0112] 64 clock cycles to obtain S1 = data5 + data10 + data15 + data20 + data25 + data30 + data35 + data40 + data45 + data50 + data55 + data60
[0113] 65 clock cycles to obtain S2 = data1 + data6 + data11 + data16 + data21 + data26 + data31 + data36 + data41 + data46 + data51 + data56 + data61
[0114] 66 clock cycles to obtain S3 = data2 + data7 + data12 + data17 + data22 + data27 + data32 + data37 + data42 + data47 + data52 + data57 + data62
[0115] 67 clock cycles to obtain S4 = data3 + data8 + data13 + data18 + data23 + data28 + data33 + data38 + data43 + data48 + data53 + data58 + data63
[0116] 68 clock cycles to obtain S5 = data4 + data9 + data14 + data19 + data24 + data29 + data34 + data39 + data44 + data49 + data54 + data59 + data6
[0117] The controller can issue a partial sum accumulation read control instruction and change the selector to output the partial sum result. The controller inputs S1 into the in1 port in the 67th clock cycle, and the first-level adder will calculate S1+S3; inputs S2 into the in1 port in the 68th clock cycle, and the first-level adder will calculate S2+S4; inputs S5 into the in1 port in the 72nd clock cycle, and the first-level adder will calculate S5+(S1+S3); inputs S2+S4 into the in1 port in the 77th clock cycle, and the first-level adder will calculate (S2+S4)+(S5+S1+S3), and finally obtains the final calculation result in the 81st clock cycle.
[0118] Optionally, the multiplier module 43 is used to obtain impedance matrix parameters from the initialization module 20 .
[0119] The embodiment of the present invention proposes an electromagnetic transient simulation solution system based on FPGA. By simulating the main process control module, the electromagnetic transient simulation process based on FPGA can be accurately controlled, the electromagnetic transient simulation calculation efficiency of FPGA can be improved, and the simulation step length can be supported to less than 250ns. The proposed node current merging and network equation solving module includes intra-group node current merging, a controllable accumulation module and a multiplier module. By using the controllable accumulation module for accumulation operation, its flow depth can be flexibly controlled according to time constraints, and the vector length supported by it can also be flexibly controlled during operation. The module is enabled to be used in the accumulation of node current merging and reused in the multiplication and accumulation of the network equation solving process, which greatly saves FPGA computing resources, improves the utilization rate of FPGA computing resources, and lowers the performance threshold of FPGA selection. At the same time, the controllable accumulation module not only effectively improves the problem of long overall processing delay of the conventional matrix-vector multiplication structure, but also greatly improves the flexibility of matrix-vector multiplication operations. For vector inner products of arbitrary length and pipeline designs of different depths, this method can accurately analyze in which clock cycle the effective result is obtained, providing a basis for precise control of the main simulation process.
[0120] In summary, an electromagnetic transient simulation solution module and system are provided in an embodiment of the present invention, wherein the electromagnetic transient simulation solution module includes an intra-group node current merging unit, Z controllable accumulation modules and a multiplier module, where Z is the total number of nodes in the electromagnetic transient simulation solution system; the intra-group node current merging unit is used to obtain the current set of each node, wherein the current set includes the inflow current and outflow current related to each branch of each node and each component combination; the zth controllable accumulation module is used to accumulate the inflow current and outflow current related to the zth node in the current set to determine the node current corresponding to the zth node; the multiplier module is used to solve according to the node current vector and the impedance matrix parameters to obtain the voltage set corresponding to each node, wherein the node current vector includes the node current corresponding to each node, and the voltage set includes the voltage information corresponding to each node; the zth controllable accumulation module is used to accumulate the voltage related to the zth node in the voltage set to determine the node voltage corresponding to the zth node, and then generate the node voltage vector. By reusing the controllable accumulation module for accumulation operations, the pipeline depth M can be flexibly controlled according to the time constraint, and the vector length supported can also be flexibly controlled during operation. Therefore, this module can be used in the accumulation of node current merging, and can also be reused in the multiplication and accumulation process of network equation solving, which greatly saves FPGA computing resources and meets the requirements of electromagnetic transient simulation of high-frequency power electronic devices.
[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0122] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. An electromagnetic transient simulation solution module, characterized in that: The electromagnetic transient simulation solution module includes a node current merging unit within the group, Z controllable accumulation modules and a multiplier module, where Z is the total number of nodes in the electromagnetic transient simulation solution system; The intra-group node current merging unit is used to obtain a current set of each node, wherein the current set includes an inflow current and an outflow current related to each branch of each node and each element combination; The zth controllable accumulation module is used to accumulate the inflow current and outflow current related to the zth node in the current set to determine the node current corresponding to the zth node; The multiplier module is used to perform calculations according to the node current vector and the impedance matrix parameters to obtain a voltage set corresponding to each node, wherein the node current vector includes the node current corresponding to each node, and the voltage set includes voltage information corresponding to each node; The zth controllable accumulation module is used to accumulate the voltages associated with the zth node in the voltage set to determine the node voltage corresponding to the zth node, and then generate a node voltage vector.
2. The electromagnetic transient simulation solution module according to claim 1, characterized in that: The intra-group node current merging unit includes a plurality of intra-group node current merging devices; The node current merging device in the (i, 2j-1)th group is used to calculate the inflow current of the first type of node, wherein the first type of node is the head end node of the jth branch of any element in the i-th element combination, the inflow current of the first type of node includes the sum of the historical currents of the first type of branch, the first type of branch is the head end node of the first type of node, and is the jth branch of any element in the i-th element combination; The node current merging device in the (i, 2j)th group is used to calculate the outflow current of the second type node, wherein the second type node is the end node of the jth branch of any element in the i-th element combination, the outflow current of the second type node includes the negative of the sum of the historical currents of the second type branch, the second type branch is the end node of the second type node, and is the jth branch of any element in the i-th element combination; When the i-th element combination is any one of an RLC element combination, a power type element combination and a switch type element combination, the value of j is 1; when the i-th element combination is a four-port element combination, the value of j is 1 or 2; when the i-th element combination is a six-port element combination, the value of j is 1 to 3.
3. The electromagnetic transient simulation solution module according to claim 1, characterized in that: The controllable accumulation module includes a controller, a storage unit, a selector and an M-level pipeline adder; The first end of the selector is connected to the intra-group node current merging unit, the second end of the selector is connected to the multiplier module, the third end of the selector is connected to the storage unit, the fourth end of the selector is connected to the controller, the fifth end of the selector is connected to the first input end of the first-stage adder, and the output end of the M-th-stage adder is respectively connected to the second input end of the first-stage adder, the storage unit and the multiplier module; The controller is connected to the storage unit.
4. The electromagnetic transient simulation solution module according to claim 3, characterized in that: The current set or the voltage set processed by the z-th controllable accumulation module is a target data set, and the target data set includes N data; The selector is used to sequentially transmit the data in the target data set to the first input terminal of the first-stage adder according to the clock cycle; The output data of the M-th adder is used as the input data of the second input terminal of the 1st-level adder in the next clock cycle; The M-stage pipeline adder is used to calculate the sum of the input data of the first input terminal and the input data of the second input terminal of the first-stage adder, and output it through the M-stage adder, wherein the calculation time is M clock cycles; The controller is used to control the storage unit to store the partial sum of the M-stage pipeline adder, and at the corresponding reading time, send a switching instruction to the selector to transmit the partial sum in the storage unit to the first input end of the first-stage adder through the selector until the accumulation result of the target data set is obtained, and the accumulation result of the target data set is the node current or node voltage corresponding to the zth node.
5. The electromagnetic transient simulation solution module according to claim 4, characterized in that: The controller is used to store the first part sum S1 output by the M-stage pipeline adder into the storage unit in the T1th clock cycle, wherein T1 represents the effective time of the first part sum; The controller is used to store the second part and S2 output by the M-stage pipeline adder into the storage unit in the T2th clock cycle, wherein T2 represents the effective time of the second part and S2; The controller is used to transmit the first part and S1 to the first input end of the first-stage adder in the T1+3th clock cycle, and the input data of the second input end of the first-stage adder is the third part and S3, and the M-stage pipeline adder executes S1+S3; The controller is used for transmitting the second part and S2 to the first input terminal of the first-stage adder in the T2+3th clock cycle, when the input data of the second input terminal of the first-stage adder is the fourth part and S4, and the M-stage pipeline adder executes S2+S4; The controller is used for M +M×(i-1)+4 clock cycles, S 2i+3 Transmitted to the first input terminal of the first-stage adder, and in the T M +M×i+3 clock cycles, the M-stage pipeline adder outputs S1+S3+…+S 2i+3 ; Among them, T M For Part M and the effective time, S 2i+3 For the T 2i+3 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle; The controller is used for M +M×(i-1)+5 clock cycles, S 2i+4 Transmitted to the first input terminal of the first-stage adder, and in the T M +M×i+4 clock cycles, the M-stage pipeline adder outputs S2+S4+…+S 2i+4 ; Among them, S 2i+4 For the T 2i+4 The partial sum of the outputs of the M-stage pipeline adder in the clock cycle.
6. The electromagnetic transient simulation solution module according to claim 5, characterized in that: The controller is used when M is an odd number, record T SM1 =S1+S3+…+S M The clock cycle in which the accumulated result takes effect is T SM1 +1 clock cycle, S2+S4+…+S M-1 Transmitted to the first input terminal of the first-stage adder, and in the T SM1 +M clock cycles to obtain the accumulated result of the target data set; The controller is used when M is an even number, T SM2 S2+S4+…+S M The clock cycle in which the accumulated result takes effect is T SM2 +1 clock cycle, S1+S3+…S M-1 Transmitted to the first input terminal of the first-stage adder, and in the T SM2 +M clock cycles to obtain the accumulated result of the target data set.
7. The electromagnetic transient simulation solution module according to claim 5, characterized in that: Among them, floor is the floor rounding function, mod is the remainder function, N represents the number of data in the target data set, T m Indicates the mth part and the effective time.
8. The electromagnetic transient simulation solution module according to claim 5, characterized in that: The total calculation time of the accumulated result of the target data set is: In the formula, ceil is the upward rounding function, mod is the remainder function, T f Indicates the total calculation time.
9. The electromagnetic transient simulation solution module according to claim 1, characterized in that: The multiplier module is used to obtain impedance matrix parameters from the initialization module.
10. An electromagnetic transient simulation solution system, characterized in that: It comprises a main control module, an initialization module, a component update module and a solution module, wherein the solution module is the electromagnetic transient simulation solution module described in any one of claims 1 to 9; The main control module is connected to the component update module, the solution module and the initialization module respectively, the component update module is connected to the solution module, the initialization module is connected to the component update module and the solution module respectively, and the initialization module is used to cache component parameters and impedance matrix parameters; When the component update enable instruction transmitted by the main control module is obtained, the component update module is used to obtain the historical current of each component in the simulation period according to the component parameters and the node voltage vector of the previous simulation period; After obtaining the solution instruction transmitted by the main control module, the solution module is used to perform a solution according to the historical current of each component in the simulation period and the impedance matrix parameters to obtain the node current vector and / or node voltage vector in the simulation period; The node current vector includes the node current of each node in the simulation period, and the node voltage vector includes the node voltage of each node in the simulation period.