Power transformer FPGA real-time simulation implementation method and system considering hysteresis effect

By using the admittance matrix method and Preisach theory on the FPGA platform, combined with the Newton-Raphson iteration method, the accuracy problem of the simulation of the hysteresis phenomenon of the power transformer is solved, efficient and real-time electromagnetic transient simulation is achieved, and the power system is improved. simulation accuracy and efficiency.

CN118551707AActive Publication Date: 2024-08-27WUHAN UNIV OF SCI & TECH

Patent Information

Application Number
CN202410500607.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2024-08-27
Estimated Expiration
2044-04-24

AI Technical Summary

Technical Problem

It is difficult to accurately simulate the hysteresis phenomenon of power transformers with existing technology, which affects the accuracy of power grid simulation. Moreover, traditional hardware simulation systems have deficiencies in real-time performance and accuracy.

Method used

The FPGA platform is used to establish a linear model of the power transformer through the admittance matrix method, and the Preisach theory and Newton-Raphson iteration method are combined to realize nonlinear simulation. Sparse matrix storage and deep pipeline architecture are used to perform real-time simulation.

Benefits of technology

It achieves accurate simulation of the hysteresis effect of power transformers, improves the real-time and accuracy of simulation, reduces hardware resource utilization, and significantly improves the efficiency and accuracy of electromagnetic transient simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551707A
    Figure CN118551707A
Patent Text Reader

Abstract

The invention belongs to the technical field of power system simulation, and discloses a power transformer FPGA real-time simulation implementation method and system considering a hysteresis effect, and the method comprises the steps: building a linear model of a power transformer based on an admittance matrix method; converting a control equation of the transformer into a continuous time differential equation, and discretizing by using a trapezoidal integral method; connecting a non-linear element outside the linear model so as to contain non-linear characteristics such as saturation and hysteresis effect; solving a nonlinear part by using a compensation method; according to a compensation method, superposing a current injection vector on a linear part of the network, and then solving the whole network to obtain a final solution; and judging whether the simulation moment t reaches the set simulation total time Tmax or not. According to the method, the hardware resource utilization rate is reduced, the calculation speed is increased, and larger-scale electromagnetic transient simulation can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of power system simulation, and in particular relates to a method and system for realizing FPGA real-time simulation of a power transformer taking hysteresis effect into consideration. Background Art

[0002] With the development of complex modern power system networks, the demand for more accurate and faster real-time simulation of electromagnetic transients has greatly increased. However, in traditional modeling, the transformer model is either completely omitted or represented by a simplified equivalent model that only contains the winding leakage impedance. Therefore, it is difficult to reflect the physical scenario of the actual operation of the device under test. Transformer modeling has been limited to low-order, piecewise linear and low-frequency behavior. Babak Asghari et al. proposed the "Sen" transformer model, which ignores the geometry of the transformer core. The nonlinear part is a piecewise linear representation based on the BH curve. However, the hysteresis characteristics are completely omitted. Therefore, it is necessary to establish a detailed and efficient transformer model. The most commonly used method for hysteresis models is curve fitting that ignores the behavior of magnetic materials. Although this method can simplify the model, it cannot reflect the hysteresis phenomenon of the transformer core in actual engineering, which has a certain impact on the accuracy of power grid simulation. A more complex method is to use the Jiles-Atherton model and the Preisach model. The difficulty lies in the determination of the parameters involved in the description of the magnetization mechanism, but it can effectively describe the hysteresis characteristics of the transformer core.

[0003] In real-time systems built with sequential hardware based on general-purpose CPUs or DSPs, the operation speed and simulation accuracy are limited due to the sequential execution of instructions, and real-time performance is usually difficult to meet engineering requirements; the increased computational complexity and the inability to provide real-time feedback on simulation results also make CPUs less suitable as a platform for real-time hardware simulation. The nonlinearity of transformer models in offline electromagnetic transient tools (such as ATP, PSCAD / EMTDC) is represented by piecewise linear representations, such as nonlinear inductance, but the frequent switching between segments still causes numerical oscillation problems. Field Programmable Gate Arrays (FPGAs) based on parallel hardware architecture, deep pipeline architecture, repetitive programmability, and high clock speeds show great potential in transient real-time simulation systems and can perform real-time calculations. Real-time simulation requires testing control devices in a hardware-in-the-loop configuration, and this real-time simulation method has the ability to perform hardware-in-the-loop simulation testing, which can realize online testing of power systems and control devices. Combined with historical data and real-time feedback data generated during operation, it can reflect the actual operating status of the system in real time, indirectly reflect the working characteristics of the power transformer, and effectively reduce R&D and test costs. Therefore, it is of great significance to invent a method for implementing FPGA real-time simulation of power transformers that takes hysteresis effects into consideration. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a method for implementing FPGA real-time simulation of a power transformer taking hysteresis effect into consideration.

[0005] The present invention is implemented as follows: a method for implementing FPGA real-time simulation of a power transformer taking into account hysteresis effect, the method comprising:

[0006] S1: Establish a linear model of the power transformer based on the admittance matrix method;

[0007] S2: Convert the control equation of the transformer in step S1 into a continuous time differential equation, and then discretize it using the trapezoidal integration method to obtain a Norton equivalent circuit form including an admittance matrix and historical current terms; since the parameters of the transformer such as R, L, G are fixed, the transformer parameter matrix is ​​pre-calculated and stored in the random access memory of the FPGA; the linear solution unit calculates the obtained historical current terms and saves the updated historical current terms, wherein the linear solution unit includes two matrix-vector multiplication units and a floating-point adder;

[0008] S3: Connect nonlinear elements outside the linear model to include nonlinear characteristics such as saturation and hysteresis effects; divide the n-node power system into linear and nonlinear parts, and solve the node voltage of the linear part by node analysis method; since the inverse admittance matrix is ​​sparse, a compact sparse matrix storage method is defined, and the calculation of unknown node voltage is realized in the FPGA through a fast sparse matrix vector multiplication unit;

[0009] S4: Solve the nonlinear part using the compensation method, and after finding the node voltages of the linear network, solve the n-node power system with nonlinear elements; linearize the nonlinear equations by the Newton-Raphson method, apply the first-order Taylor series expansion to the nonlinear functions, and solve the nonlinear equations to solve the current injection vectors of the nonlinear elements; wherein these nonlinear functions are generated by the Preisach theory to simultaneously represent the saturation effect and the hysteresis effect;

[0010] S5: According to the compensation method, the current injection vector obtained in step S4 is superimposed on the linear part of the network, and then the entire network is solved to obtain the final solution;

[0011] S6: Determine whether the simulation time t reaches the set simulation total time T max , if the set total simulation time T is reached max , the simulation ends; otherwise, the simulation time advances one time step, t=t+Δt, and returns to step S2 to update the historical current term through the linear solution unit.

[0012] Furthermore, the model in S1 is a linear model, which includes nonlinear characteristics such as saturation and hysteresis effects by connecting an external circuit. Under transient conditions, the expression of the three-phase transformer control equation is:

[0013] d TE / dt=L -1 v TE -L -1 Ri TE (1)

[0014] where v TE with i TE are the instantaneous terminal voltage and current respectively, R and L are the winding resistance and winding leakage inductance respectively measured by the short-circuit test.

[0015] Further, the Norton equivalent circuit expression is as follows:

[0016] i TE (t) = Gv TE (t)+i hist (t-Δt)

[0017] i hist (t-Δt)=αv TE (t-Δt)+βi hist (t-2Δt)(2)

[0018] Where G is the admittance matrix, α = 2(G-GRG), β = (I-2GR), i hist (t-Δt) is the historical current term, Δt is the simulation time step; the linear solution unit includes two matrix vector multiplication units and a floating point adder, and the floating point adder consumes 7 clock cycles; the historical current term i obtained by differentiating the transformer differential equation using the trapezoidal integral method hist (t-Δt) is updated at each time step, and the updated historical current term is calculated and saved in the linear solution unit; to reduce the computational complexity and delay, instead of pre-storing a single fixed parameter, α=2(G-GRG) and β=(I-2GR) are pre-stored in the random access memory RAM_α and RAM_β of the FPGA respectively; the node voltage v TE (t) Store to RAM_v TE , the historical current term i of the previous time step hist (t-Δt) is stored in RAM_i h In the above example, the updated historical current term i hist (t) Store to RAM_i hnew middle.

[0019] Furthermore, the pre-storage format of the transformer parameter matrix stored in the FPGA consists of two memories, a 32-bit memory val stores the matrix values ​​in row order until all parameter matrix values ​​are stored in the FPGA; a 9-bit memory, the high 8 bits col stores the column index values ​​of the matrix in row order, and the lowest bit row uses 0 or 1 to represent the same row of the storage matrix; the IEEE754 standard 32-bit single-precision floating point format is used, except that the accumulation operation in the adder uses a fixed-point number form; to ensure the range and accuracy, the fixed-point number is set to 64-bit data, of which the integer part is 30 bits and the decimal part is 34 bits; the matrix-vector multiplication unit includes a floating-point multiplier, a A floating-point to fixed-point converter, a fixed-point to floating-point converter, two fixed-point adders, a multiplexer and a row counter CNT complete the multiplication of row vectors in the form of a deep pipeline. The multiplexer selects the two adders by counting the row by the row counter CNT. Whenever a change in the value of row is detected, the row counter CNT increments by 1. The two fixed-point adders have opposite reset conditions. When fixed-point adder 1 accumulates the first matrix row vector multiplication, fixed-point adder 2 is cleared to prepare for the accumulation of the next row vector multiplication, and the accumulation is cyclic until completion. The floating-point multiplier consumes 5 clock cycles and the fixed-point adder consumes 1 clock cycle.

[0020] Furthermore, the linear part is solved by the node analysis method, and the expression is as follows:

[0021] Yv0=i (3)

[0022] Where Y is the admittance matrix without nonlinear elements, v0 and i are the unknown node voltage and known node current respectively. The unknown node voltage v0 can be divided into the unknown node voltage A and the known node voltage B. Formula (3) can be rewritten as:

[0023]

[0024] Further deformation, i A The unknown node voltage v is obtained from the historical current term A The solution of is given by:

[0025]

[0026]

[0027] In the process of solving the linear equations by node analysis, due to the admittance matrix Y AB With the inverse admittance matrix For sparse matrices, pre-calculated and stored in the FPGA memory RAM_Y AB and memory RAM_Y -1 AAIn the node current i A Stored in memory RAM_i A In the b Stored in memory RAM_i b In the example, the node voltage v is known. B Stored in memory RAM_v B The compact sparse matrix storage method is the same as the matrix-vector multiplication unit, except that only non-zero elements are stored in the sparse matrix, and each non-zero element value is stored row by row through a 32-bit memory val until all non-zero elements of the matrix are stored in the memory; the current i is realized by the fast sparse matrix-vector multiplication unit b The calculation process implemented in FPGA is as follows: the column index value of the sparse matrix is ​​stored in col in row order. The non-zero matrix values ​​are stored in col in row order. The non-zero values ​​of each row of the matrix are stored in row order. Row uses 0 or 1 to represent the same row of the storage matrix. Therefore, the memory RAM_v is taken out according to the column index value stored in col. B The known node voltage v corresponding to the row vector B Column vector, and then use the matrix vector multiplication unit to realize the current i b The calculation includes a floating-point subtractor to implement the subtraction operation of formula (5); the inverse admittance matrix is ​​multiplied by the current i through a fast sparse matrix vector multiplication unit. b To calculate the unknown node voltage v A .

[0028] Furthermore, the current injection vector solution process of the nonlinear element in step S4 is implemented by a Newton-Raphson nonlinear solution module:

[0029] f(i km )=v oc -r thev i km (7)

[0030] Where f(i km ) is a nonlinear function, v oc is the open circuit voltage without nonlinear elements (v0 subset), r thev is the Thevenin equivalent resistance matrix obtained from Y, i km The current injection vector for the nonlinear element;

[0031] Formula (6) is linearized successively by the Newton-Raphson method, and the expression is:

[0032]

[0033] Where J is the Jacobian matrix and k is the number of iterations; the calculation of J and -F is given by the following formula:

[0034]

[0035] The convergence condition of the Newton-Raphson iteration is given by the following formula, the values ​​of thresholds ∈1 and ∈2 are small enough;

[0036]

[0037] Specifically, when the external nonlinear element is a nonlinear inductor, the characteristic function is expressed as:

[0038] λ(t)=f λ (i km (t)) (11)

[0039] Among them, the magnetic flux λ(t) is the integral of the node voltage within a simulation time step. The integral is differentiated by the trapezoidal integration method and the expression is:

[0040]

[0041] According to formulas (11) and (12), we can determine i km The nonlinear equations are expressed as:

[0042]

[0043] Then formula (9) can be restated as:

[0044]

[0045] In the FPGA, the global control module realizes the orderly solution of the linear solution module and the Newton-Raphson nonlinear solution module, so that each module and each unit operates in parallel or sequentially according to the requirements of the transient algorithm; the Newton-Raphson nonlinear solution module includes the Preisach hysteresis unit, the Jacobian matrix calculation unit and the Gauss-Jordan elimination method unit; the solution process includes the following steps:

[0046] S41: Hysteresis nonlinear modeling based on Preisach theory, the hysteresis main loop function is represented by a hyperbolic function; in the Preisach hysteresis unit, with the help of FPGA parallel computing capabilities, the nonlinear function of the Newton-Raphson iteration is calculated in real time through a lookup table;

[0047] S42: After the nonlinear function calculation is completed, the Jacobian matrix and the value of the nonlinear equation are calculated by the Jacobian matrix calculation unit in the FPGA, and the result is substituted into the parallel Gauss-Jordan elimination method unit to calculate the current injection vector of the nonlinear element; if the current injection vector meets the Newton-Raphson iteration convergence condition, go to step S5; if it has not converged yet, return to step S41, and the Preisach hysteresis unit uses the current injection vector as input for the next iteration, iter=iter+1, until the iteration convergence condition is met or the maximum number of iterations is reached.

[0048] Further, the hysteresis main loop function in S41 is expressed by a hyperbolic function as follows:

[0049]

[0050] Where a u , b u 、c u is the hyperbolic template parameter, i km is the current injection vector flowing through the nonlinear inductor, λ p-m is the magnetic flux density corresponding to the current in the main circuit, subscript p_m Represents the Preisach main loop; when the hysteresis main loop function is determined, from the reversal point (i re ,λ re ) all small loop trajectories starting from follow this function;

[0051] The expressions of magnetic flux density of the rising branch and the falling branch of the small loop are as follows:

[0052] λ p_u (i km )=-λ p_m (-i km )-λ p_m (i re )+λ re +2K(-i re )K(i km )(16)

[0053] λ p_d (i km )=λ p_m (i km )+λ p_m (-i re )+λ re -2K(i re )K(-i km )(17)

[0054] Where K=[K1 K2 … K nq ], j = 1, 2, 3, ..., nq;

[0055]

[0056] The derivative expressions of the ascending branch and descending branch of the small loop are as follows:

[0057]

[0058]

[0059] The nonlinear function f(i km ) and its derivative df(i km ) / di km Parallel computing is achieved through a lookup table in the FPGA; in the Preisach hysteresis unit, the lookup table stores the λ p_m (±i km )、K(±i km )、K(±i re ) and dλ p_m (±i km ), the address generation unit is designed to convert the 32-bit floating point number i km Converted into integers to address the lookup table; Based on formulas (16)-(19), the calculation of the nonlinear function and its derivatives is solved through the lookup table, floating-point adder unit, floating-point multiplier unit, and multiplexer; Since the calculation of formulas (16)-(19) depends on the ascending branch or the descending branch, K(±i km ) Two lookup tables, through the multiplexer according to i km with -i km The first bit of the table is used to select which lookup tables participate in the calculation.

[0060] Furthermore, the output end of the Jacobian matrix calculation unit is connected to the input end of the Gauss-Jordan elimination method unit. Since nonlinear elements are included, if the LU decomposition method is used, it needs to be refactored, and the efficiency of the LU decomposition forward generation solution process and the back generation solution process will become low. The Gauss-Jordan elimination method can eliminate the rows of the matrix in parallel and then decompose it, and the hardware implementation in the FPGA is simpler; if the current injection vector i obtained by the Gauss-Jordan elimination method unit is km If the Newton-Raphson iteration convergence condition is met, the final solution is obtained by using the matrix-vector multiplication unit through the multiplexer; if i km If it has not converged yet, the multiplexer returns to step S41 where the Preisach hysteresis unit will km As input for the next iteration, iter = iter + 1, until the iteration convergence condition is met or the maximum number of iterations Iter is reached max .

[0061] Further, the compensation formula in S5 is:

[0062] v=v0-R Thev i km (20)

[0063] Where v is the node voltage with nonlinear branch, R Thev is the nxnq Thevenin matrix obtained from Y.

[0064] Another object of the present invention is to provide a system for implementing the above-mentioned power transformer FPGA real-time simulation implementation method, the system comprising:

[0065] Virtual FPGA device 101, physical system device to be tested 102, high-speed data acquisition device 201, analog-to-digital converter device 202, digital-to-analog converter device 203, amplifier device 204;

[0066] The virtual FPGA device 101 is a digital virtualized power transformer object generated in the FPGA development board, which receives historical operation data from the power transformer via the analog-to-digital converter device 202, and compares the real-time simulation results captured by the oscilloscope with the test results of the real system. Various physical quantity data can be used for visualization processing to reflect the real-time status of the power transformer;

[0067] The physical system device 102 to be tested is a physical system including a real power transformer, which is mapped to a virtual power transformer object established in the simulation environment FPGA;

[0068] The high-speed data acquisition device 201 collects the operating status data of the real power transformer in the physical system device 102 to be tested in real time through multiple sensors, and then transmits the operating data to the analog-to-digital converter device 202;

[0069] The analog-to-digital converter device 202 is used to convert the analog data collected by the high-speed data acquisition device 201 into digital data and then feed it back to the virtual FPGA device 101 in the form of digital quantity;

[0070] The digital-to-analog converter device 203 is used to convert the digital quantity data generated in real time in the virtual FPGA device 101 into digital-to-analog data and then transmit it to the amplifier device 204 in the form of analog quantity;

[0071] The amplifier device 204 is used to amplify the analog low-level signal output by the digital-to-analog converter device 203 to a high-level signal that can be tested by the physical system device 102 to be tested.

[0072] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0073] First, the present invention provides a method for implementing FPGA real-time simulation of power transformers considering hysteresis effect. The model includes a nonlinear simulation model based on Preisach theory, and performs nonlinear real-time solution through Newton-Raphson iteration. The influence of the hysteresis characteristics of the core on the electromagnetic transient of the power transformer is considered, and the hysteresis effect of the core can be accurately simulated. At the same time, it has high accuracy and fast calculation speed, and can be used for accurate characteristic evaluation of the electromagnetic transient of the power transformer.

[0074] Aiming at the real-time simulation problem of power transformers, the advantages of FPGA parallel architecture and deep pipeline architecture are combined to develop linear solution units, matrix-vector multiplication units, fast sparse matrix-vector multiplication units, etc. These units run in pipelines in FPGA to achieve high computing throughput and fast simulation steps, significantly improving the real-time performance of the simulation. At the same time, a compact sparse matrix storage method is proposed, which uses sparse technology to improve simulation efficiency and fully integrates the advantages of high floating-point precision and fast fixed-point calculation speed. While ensuring the accuracy of the solution, it saves logic resources and reduces clock delays. This method can be used to solve the problems of poor real-time performance and insufficient numerical accuracy brought by traditional models, and further improve the accuracy of electromagnetic transient simulation of power systems.

[0075] The FPGA-based hardware-in-the-loop realizes an accurate simulation result output closed loop. The real-time simulation results of each simulation time step are sent from the FPGA to the oscilloscope through the DAC board and verified against the offline software simulation results. This simulation method adopts a global control architecture, and the global control module realizes the orderly solution of the linear solution module and the Newton-Raphson nonlinear solution module. This real-time simulation method has the ability of hardware-in-the-loop simulation testing, which can realize online testing of power systems and control equipment. Combined with the historical data and real-time feedback data generated during operation, it can reflect the actual operating status of the system in real time, indirectly reflect the dynamic characteristics of the power transformer, and can effectively reduce the R&D and testing costs, and provide support for the subsequent transformer optimization structure design to improve its efficiency and stability.

[0076] Second, the present invention provides a method for implementing FPGA real-time simulation of power transformers taking into account the hysteresis effect. The linear model of the transformer is established by the admittance matrix method, and the hysteresis nonlinearity of the power transformer is modeled according to the Preisach theory. Due to the good nonlinear description ability of the hyperbolic function, the Preisach model based on the hyperbolic function can more accurately describe the rising and falling sections of the hysteresis loop, and it is more convenient to fit the secondary curve attached to the main loop through coordinate transformation. The compensation method is used, and the real-time nonlinear solution is performed through the Newton-Raphson iteration method. In view of the real-time simulation problem of power transformers, the advantages of FPGA parallel architecture and pipeline architecture are combined, and sparse technology is used to improve the simulation efficiency, so as to reduce the utilization of hardware resources and increase the calculation speed, which is conducive to the realization of larger-scale electromagnetic transient simulation.

[0077] Third, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:

[0078] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0079] In the power system, electromagnetic transient problems are crucial to the safe operation of equipment and systems. Real-time simulation methods can accurately predict the failure of power transformers, so that timely measures can be taken to avoid equipment damage and power outages, thereby improving the reliability of the power system and reducing the operation and maintenance costs of enterprises. At the same time, the improvement of power system efficiency and reliability reduces energy waste and carbon emissions, which meets the requirements of sustainable development strategies. On the basis of establishing an accurate transformer model, hardware-in-the-loop simulation testing can reduce the number of design iterations and the number of tests of physical prototypes, shorten the product development cycle to accelerate the return on investment, and significantly reduce R&D costs. In addition, as an advanced simulation technology application, enterprises can provide solutions with differentiated competitive advantages in the market. This can help enterprises attract more customers and increase market share and profitability. The application of this technical solution will enhance the technological competitiveness of enterprises and establish a leading position in the industry through continuous R&D and technological innovation.

[0080] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:

[0081] Accurate transformer models are essential for the simulation and analysis of power systems. However, due to the complex nature of transformers, it has always been a challenge to accurately describe their characteristics. Traditional transformer modeling usually ignores hysteresis nonlinearity and adopts linear models or equivalent circuit models, which leads to poor model accuracy and adaptability problems. Technical literature in recent years has shown that the Preisach model can be improved by hyperbolic functions, especially under dynamic conditions, which makes the Preisach model more flexible and accurate in describing nonlinear hysteresis phenomena. This improvement simplifies complex integral operations, reduces the difficulty of numerical solutions, and requires fewer model parameters, which can integrate multiple intelligent algorithms for parameter identification. By integrating the nonlinear model established by Preisach theory and the Newton-Raphson iterative algorithm, a more accurate solution is provided for nonlinear electromagnetic transient simulation. In addition, the introduction of hardware-in-the-loop testing can output simulation results in real time and interact with the physical system, providing a method for online testing and verification of power systems and control equipment, thereby accurately evaluating the working characteristics of transformers. This is crucial for power system analysis and protection that requires fast response. At present, there are few studies on real-time simulation of transformer nonlinear characteristics in the literature. This invention provides an efficient and real-time simulation solution for the power system field, filling the technical gap of transformer electromagnetic transient simulation at home and abroad. The application of this technology will help improve the accuracy and efficiency of power system analysis and promote the stable operation and safety of power systems.

[0082] Third, the present invention provides a method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect, and its technical characteristics and application advantages are mainly reflected in the following aspects:

[0083] First, through the parallel computing capability of FPGA, this method significantly improves the efficiency of electromagnetic transient simulation. The parallel characteristics of FPGA enable multiple steps in the simulation process to be executed in parallel, thereby effectively compressing the simulation calculation process and improving the simulation parallel performance. Especially when dealing with the simulation of large-scale power systems, this parallel computing capability can greatly shorten the simulation time and improve the simulation efficiency.

[0084] Secondly, this method improves the calculation accuracy of multi-rate decoupling parallel simulation of controller by combining the improved linear interpolation algorithm with Lagrange interpolation for error compensation. In the power system, due to the difference in the operating speed of devices such as controllers and power electronic switches, multi-rate decoupling calculation is required. By introducing the interpolation algorithm, this method can effectively compensate for the error caused by the rate difference and improve the accuracy of the simulation.

[0085] In addition, the method also focuses on analyzing different modeling methods for power electronic switching devices, and compares the simulation results under several modeling methods through examples to verify the accuracy of the proposed method. This is of great significance for accurately simulating the behavior of power electronic equipment and then accurately predicting and analyzing the electromagnetic transient process of the power system.

[0086] In industrial applications, this method solves the problems of low simulation efficiency and insufficient precision in existing technologies and has achieved significant technological progress. For example, in the design and optimization of power electronic systems, this method can provide fast and accurate simulation results, helping engineers better understand and analyze the behavior of the system, thereby optimizing the system design and improving the performance and stability of the system.

[0087] As for the technical problems solved by the mathematical models and mathematical methods described in the characteristic part, they are mainly reflected in the accurate description and efficient calculation of electromagnetic transient processes. By constructing an accurate power electronic switching device model and adopting efficient parallel computing and interpolation algorithms, this method can achieve accurate simulation and efficient calculation of electromagnetic transient processes, thereby solving the problem of insufficient simulation accuracy and efficiency in the existing technology.

[0088] Finally, the method proposes a compensation formula in S5 to compensate for the node voltage with nonlinear branches, instead of directly solving the entire nonlinear system, which reduces the amount of calculation and further improves the accuracy and real-time performance of the simulation. The introduction of this compensation formula enables the method to more accurately reflect the actual behavior of nonlinear elements when processing them, thereby improving the reliability of the simulation results.

[0089] The FPGA real-time simulation implementation method of power transformer considering hysteresis effect is efficient and accurate, and has important application value in the simulation and analysis of power systems.

[0090] Fourth, the present invention provides a method for implementing real-time simulation of power transformers using FPGAs taking into account the hysteresis effect, which provides an efficient and accurate solution for power system simulation, especially when dealing with the behavior of power transformers in nonlinear transient processes. The following is a detailed introduction to the prior art problems solved by the present invention and the significant technical progress achieved in industrial applications.

[0091] Existing technical problems solved:

[0092] 1. Slow simulation speed:

[0093] Most existing simulation tools are based on general-purpose computer systems. When processing complex power system models, especially when performing high-precision electromagnetic transient analysis, they are often slow due to limited computing resources. The present invention implements simulation on FPGA and utilizes its parallel processing capabilities to greatly improve the simulation speed.

[0094] 2. Insufficient precision:

[0095] Traditional simulation methods often rely on simplified or approximate mathematical models when dealing with nonlinear behaviors of power transformers (such as saturation and hysteresis effects), which leads to deviations between simulation results and actual conditions. The present invention improves the accuracy of simulation through more sophisticated mathematical models and algorithms, such as trapezoidal integration method and Preisach theory.

[0096] 3. High resource consumption:

[0097] Complex electromagnetic transient simulations usually require a lot of computing resources and storage space, which leads to low resource utilization and high cost on traditional computing platforms. The present invention optimizes the data storage and processing flow, especially introduces compact sparse matrix storage and efficient matrix-vector operations, significantly reducing the required resources.

[0098] Significant technological advances in industrial applications:

[0099] 1. Real-time simulation capability:

[0100] The FPGA infrastructure implemented by the present invention allows electromagnetic transient simulation of power transformers to be performed in real time, which is of great significance for real-time monitoring and control of power systems. Systems that can immediately feedback simulation results are particularly critical for preventing and responding to power grid failures.

[0101] 2. Enhanced system stability and reliability:

[0102] By accurately simulating the behavior of the transformer under various load and fault conditions, the present invention helps system engineers better understand the potential risks and dynamic response of the system, thereby optimizing system design and improving operational safety.

[0103] 3. Cost-effectiveness:

[0104] The use of FPGAs reduces the reliance on high-end computing resources and provides a more cost-effective solution compared to traditional CPU- or GPU-based simulation platforms. In the long run, this approach can significantly reduce the power industry's expenses on system analysis and testing.

[0105] 4. Scalability and flexibility:

[0106] The FPGA implementation of the present invention is not only applicable to power transformers, but can also be extended to the simulation of other power equipment. In addition, the programmability of FPGA allows the simulation algorithm to be updated according to new research results or industry standards, and can adapt to new technical requirements without replacing hardware.

[0107] The present invention provides an innovative solution, which significantly improves the simulation efficiency and accuracy of power transformers and related power equipment in electromagnetic transient analysis by combining advanced mathematical models, simulation technology and the high-performance processing capabilities of FPGA, and provides strong technical support for the design, testing and operation of power systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] Figure 1 A flow chart of a method for implementing FPGA real-time simulation of a power transformer taking into account hysteresis effect provided by an embodiment of the present invention;

[0109] Figure 2 A schematic diagram of a linear solution unit provided in an embodiment of the present invention;

[0110] Figure 3 A schematic diagram of a matrix-vector multiplication unit of a linear solution unit provided in an embodiment of the present invention;

[0111] Figure 4 A schematic diagram of a network of external nonlinear elements provided in an embodiment of the present invention;

[0112] Figure 5 The fast sparse matrix vector multiplication unit provided in the embodiment of the present invention solves the current i b Schematic diagram;

[0113] Figure 6 The fast sparse matrix vector multiplication unit provided in the embodiment of the present invention solves the voltage v A Schematic diagram;

[0114] Figure 7 A schematic diagram of the overall architecture provided for an embodiment of the present invention;

[0115] Figure 8 A schematic diagram of the structure of an FPGA-based system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0116] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0117] The present invention provides a method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect, which can be widely used in the design, testing and real-time monitoring of power systems. The following are two specific industrial application embodiments:

[0118] Example 1: Power Grid Fault Analysis and Response System

[0119] The power grid system frequently suffers from various faults caused by natural and human factors, such as short circuit, equipment failure, weather impact, etc. Real-time electromagnetic transient analysis of power transformers in the power grid can quickly locate the source of the fault and the nature of the fault, and then implement effective response measures.

[0120] System setup: Integrate the FPGA-based simulation system into the power control center to receive signals from various nodes of the power grid in real time.

[0121] Operation process:

[0122] Real-time monitoring: The system continuously monitors the operating status of the transformer and the power grid, and collects data such as voltage and current in real time.

[0123] Fault detection and analysis: When an abnormal signal is detected, the system immediately starts electromagnetic transient simulation to simulate the transformer's response when a fault occurs.

[0124] Rapid location and diagnosis: By comparing simulation results with actual measurement data, the system can quickly and accurately locate the source of the fault and analyze the fault type.

[0125] Response and control: Based on the analysis results, the control center can quickly take measures such as disconnecting the faulty part and reconfiguring the network to minimize the impact of the fault.

[0126] Improve the reliability and stability of the power grid: Timely response and accurate handling of power grid faults can avoid greater losses caused by fault expansion.

[0127] Reduce power outage time: Rapid fault handling significantly reduces system recovery time and improves power supply stability and reliability.

[0128] Example 2: Transformer design optimization and evaluation

[0129] During the design and manufacture of new power transformers, their performance under various operating conditions needs to be evaluated in detail to ensure that they meet the requirements of safety and efficiency.

[0130] System Setup: Designers use an FPGA-based simulation system to simulate the electromagnetic transient behavior of a newly designed transformer.

[0131] Operation process:

[0132] Design Input: Enter transformer design parameters such as windings, core materials, geometry, etc.

[0133] Performance simulation: The system performs electromagnetic transient simulation based on the input design parameters to simulate the behavior of the transformer under various conditions such as normal operation, overload, short circuit, etc.

[0134] Result analysis: Analyze the simulation results and evaluate the performance of the transformer, such as efficiency, thermal stability, electromagnetic compatibility, etc.

[0135] Design iteration: Adjust and optimize the design based on the simulation results, and iterate multiple times until the expected performance standards are achieved.

[0136] Improve design efficiency and accuracy: Through simulation evaluation, designers can foresee potential problems and optimize them before actual manufacturing, reducing trial and error costs.

[0137] Shorten product development cycle: accelerate the design verification process, quickly iterate and optimize, and significantly shorten the time from product design to market.

[0138] like Figure 1 As shown, an embodiment of the present invention provides a method for implementing FPGA real-time simulation of a power transformer considering hysteresis effect, the method comprising:

[0139] S1: Establish a linear model of the power transformer based on the admittance matrix method;

[0140] S2: Convert the control equation of the transformer in step S1 into a continuous time differential equation, and then discretize it using the trapezoidal integration method to obtain a Norton equivalent circuit form including an admittance matrix and historical current terms; since the parameters of the transformer such as R, L, G are fixed, the transformer parameter matrix is ​​pre-calculated and stored in the random access memory of the FPGA; the linear solution unit calculates the obtained historical current terms and saves the updated historical current terms, wherein the linear solution unit includes two matrix-vector multiplication units and a floating-point adder;

[0141] S3: Connect nonlinear elements outside the linear model to include nonlinear characteristics such as saturation and hysteresis effects; e.g. Figure 4 As shown, the n-node power system is divided into a linear part and a nonlinear part, and the node voltage of the linear part is solved by the node analysis method; since the inverse admittance matrix is ​​sparse, a compact sparse matrix storage method is defined, and the calculation of the unknown node voltage is realized in the FPGA through a fast sparse matrix vector multiplication unit;

[0142] S4: Solve the nonlinear part using the compensation method, and after finding the node voltages of the linear network, solve the n-node power system with nonlinear elements; linearize the nonlinear equations by the Newton-Raphson method, apply the first-order Taylor series expansion to the nonlinear functions, and solve the nonlinear equations to solve the current injection vectors of the nonlinear elements; wherein these nonlinear functions are generated by the Preisach theory to simultaneously represent the saturation effect and the hysteresis effect;

[0143] S5: According to the compensation method, the current injection vector obtained in step S4 is superimposed on the linear part of the network, and then the entire network is solved to obtain the final solution;

[0144] S6: Determine whether the simulation time t reaches the set simulation total time T max , if the set total simulation time T is reached max , the simulation ends; otherwise, the simulation time advances one time step, t=t+Δt, and returns to step S2 to update the historical current term through the linear solution unit.

[0145] Furthermore, the model in S1 is a linear model, which includes nonlinear characteristics such as saturation and hysteresis effects by connecting an external circuit. Under transient conditions, the expression of the three-phase transformer control equation is:

[0146] d TE / dt=L -1 v TE -L -1 Ri TE (1)

[0147] where v TE with i TE are the instantaneous terminal voltage and current respectively, R and L are the winding resistance and winding leakage inductance respectively measured by the short-circuit test.

[0148] Further, the Norton equivalent circuit expression is as follows:

[0149] i TE (t) = Gv TE (t)+i hist (t-Δt)

[0150] i hist (t-Δt)=αv TE (t-Δt)+βi hist (t-2Δt) (2)

[0151] Where G is the admittance matrix, α = 2(G-GRG), β = (I-2GR), α and β have no specific meaning, i hist (t-Δt) is the historical current term, Δt is the simulation time step; Figure 2 As shown, the linear solution unit includes two matrix vector multiplication units and a floating point adder, and the floating point adder consumes 7 clock cycles; the historical current term i is obtained by differentiating the transformer differential equation using the trapezoidal integral method. hist (t-Δt) is updated at each time step, and the updated historical current term is calculated and saved in the linear solution unit; to reduce the computational complexity and delay, instead of pre-storing a single fixed parameter, α=2(G-GRG) and β=(I-2GR) are pre-stored in the random access memory RAM_α and RAM_β of the FPGA respectively; the node voltage v TE(t) Store to RAM_v TE , the historical current term i of the previous time step hist (t-Δt) is stored in RAM_i h In the above example, the updated historical current term i hist (t) Store to RAM_i hnew middle.

[0152] Furthermore, the pre-storage format of the transformer parameter matrix stored in the FPGA consists of two memories, a 32-bit memory val stores the matrix values ​​in row order until all parameter matrix values ​​are stored in the FPGA; a 9-bit memory, the high 8 bits col stores the column index values ​​of the matrix in row order, and the lowest bit row uses 0 or 1 to represent the same row of the storage matrix; the IEEE754 standard 32-bit single-precision floating point format is used, except that the accumulation operation in the adder uses a fixed-point number form; to ensure the range and accuracy, the fixed-point number is set to 64-bit data, of which the integer part is 30 bits and the decimal part is 34 bits; Figure 3 As shown, the matrix-vector multiplication unit includes a floating-point multiplier, a floating-point to fixed-point converter, a fixed-point to floating-point converter, two fixed-point adders, a multiplexer and a row counter CNT. The multiplication of row vectors is completed in the form of a deep pipeline. The multiplexer selects the two adders through the counting of row by the row counter CNT. Whenever a change in the value of row is detected, the row counter CNT increments by 1. The two fixed-point adders have opposite reset conditions. When the fixed-point adder 1 accumulates the first matrix row vector multiplication, the fixed-point adder 2 is cleared to prepare for the accumulation of the next row vector multiplication, and the accumulation is cyclic until completion. The floating-point multiplier consumes 5 clock cycles and the fixed-point adder consumes 1 clock cycle.

[0153] Furthermore, the linear part is solved by the node analysis method, and the expression is as follows:

[0154] Yv0=i (3)

[0155] Where Y is the admittance matrix without nonlinear elements, v0 and i are the unknown node voltage and known node current respectively. The unknown node voltage v0 can be divided into the unknown node voltage A and the known node voltage B. Formula (3) can be rewritten as:

[0156]

[0157] Further deformation, i A The unknown node voltage v is obtained from the historical current term A The solution of is given by:

[0158]

[0159]

[0160] In the process of solving the linear equations by node analysis, due to the admittance matrix Y AB With the inverse admittance matrix For sparse matrices, pre-calculated and stored in the FPGA memory RAM_Y AB and memory RAM_Y -1 AA In the node current i A Stored in memory RAM_i A In the b (no specific meaning) stored in memory RAM_i b In the example, the node voltage v is known. B Stored in memory RAM_v B The compact sparse matrix storage method is the same as the matrix-vector multiplication unit, except that only non-zero elements are stored in the sparse matrix, and each non-zero element value is stored row by row through a 32-bit memory val until all non-zero elements of the matrix are stored in the memory; Figure 5 As shown, the current i is realized by a fast sparse matrix vector multiplication unit b The calculation process implemented in FPGA is as follows: the column index value of the sparse matrix is ​​stored in col in row order. The non-zero matrix values ​​are stored in col in row order. The non-zero values ​​of each row of the matrix are stored in row order. Row uses 0 or 1 to represent the same row of the storage matrix. Therefore, the memory RAM_v is taken out according to the column index value stored in col. B The known node voltage v corresponding to the row vector B Column vector, and then use the matrix vector multiplication unit to realize the current i b The calculation includes a floating-point subtractor to implement the subtraction operation solution of formula (5); Figure 6 As shown, the inverse admittance matrix is ​​multiplied by the current i through the fast sparse matrix-vector multiplication unit b To calculate the unknown node voltage v A .

[0161] Furthermore, the current injection vector solution process of the nonlinear element in step S4 is implemented by a Newton-Raphson nonlinear solution module:

[0162] f(i km )=v oc -r thev i km (7)

[0163] Where f(i km ) is a nonlinear function, v oc is the open circuit voltage without nonlinear elements (v0 subset), r thevis the Thevenin equivalent resistance matrix obtained from Y, i km The current injection vector for the nonlinear element;

[0164] Formula (6) is linearized successively by the Newton-Raphson method, and the expression is:

[0165]

[0166] Where J is the Jacobian matrix and k is the number of iterations; the calculation of J and -F is given by the following formula:

[0167]

[0168] The convergence condition of the Newton-Raphson iteration is given by the following formula, the values ​​of thresholds ∈1 and ∈2 are small enough;

[0169]

[0170] Specifically, when the external nonlinear element is a nonlinear inductor, the characteristic function is expressed as:

[0171] λ(t)=f λ (i km (t)) (11)

[0172] Among them, the magnetic flux λ(t) is the integral of the node voltage within a simulation time step. The integral is differentiated by the trapezoidal integration method and the expression is:

[0173]

[0174] According to formulas (11) and (12), we can determine i km The nonlinear equations are expressed as:

[0175]

[0176] Then formula (9) can be restated as:

[0177]

[0178] like Figure 7 As shown, in the FPGA, the global control module realizes the orderly solution of the linear solution module and the Newton-Raphson nonlinear solution module, so that each module and each unit operates in parallel or sequentially according to the requirements of the transient algorithm; the Newton-Raphson nonlinear solution module includes the Preisach hysteresis unit, the Jacobian matrix calculation unit and the Gauss-Jordan elimination method unit; the solution process includes the following steps:

[0179] S41: Hysteresis nonlinear modeling based on Preisach theory, the hysteresis main loop function is represented by a hyperbolic function; in the Preisach hysteresis unit, with the help of FPGA parallel computing capabilities, the nonlinear function of the Newton-Raphson iteration is calculated in real time through a lookup table;

[0180] S42: After the nonlinear function calculation is completed, the Jacobian matrix and the value of the nonlinear equation are calculated by the Jacobian matrix calculation unit in the FPGA, and the result is substituted into the parallel Gauss-Jordan elimination method unit to calculate the current injection vector of the nonlinear element; if the current injection vector meets the Newton-Raphson iteration convergence condition, go to step S5; if it has not converged yet, return to step S41, and the Preisach hysteresis unit uses the current injection vector as input for the next iteration, iter=iter+1, until the iteration convergence condition is met or the maximum number of iterations is reached.

[0181] Further, the hysteresis main loop function in S41 is expressed by a hyperbolic function as follows:

[0182]

[0183] Where a u , b u 、c u is the hyperbolic template parameter, i km is the current injection vector flowing through the nonlinear inductor, λ p_m is the magnetic flux density corresponding to the current in the main circuit, subscript p_m Represents the Preisach main loop; when the hysteresis main loop function is determined, from the reversal point (i re ,λ re ) all small loop trajectories starting from follow this function;

[0184] The expressions of magnetic flux density of the rising branch and the falling branch of the small loop are as follows:

[0185] λ p_u (i km )=-λ p_m (-i km )-λ p_m (i re )+λ re +2K(-i re )K(i km ) (16)

[0186] λ p_d (i km )=λ p_m (i km )+λ p_m (-i re )+λ re -2K(ire )K(-i km ) (17)

[0187] Where K=[K1 K2 … K nq ], j = 1, 2, 3, ..., nq;

[0188]

[0189] The derivative expressions of the ascending branch and descending branch of the small loop are as follows:

[0190]

[0191]

[0192] The nonlinear function f(i km ) and its derivative df(i km ) / di km Parallel computing is achieved through a lookup table in the FPGA; in the Preisach hysteresis unit, the lookup table stores the λ p_m (±i km )、K(±i km )、K(±i re ) and dλ p_m (±i km ), the address generation unit is designed to convert the 32-bit floating point number i km Converted into integers to address the lookup table; Based on formulas (16)-(19), the calculation of the nonlinear function and its derivatives is solved through the lookup table, floating-point adder unit, floating-point multiplier unit, and multiplexer; Since the calculation of formulas (16)-(19) depends on the ascending branch or the descending branch, K(±i km ) Two lookup tables, through the multiplexer according to i km with -i km The first bit of the table is used to select which lookup tables participate in the calculation.

[0193] Furthermore, the output end of the Jacobian matrix calculation unit is connected to the input end of the Gauss-Jordan elimination method unit. Since nonlinear elements are included, if the LU decomposition method is used, it needs to be refactored, and the efficiency of the LU decomposition forward generation solution process and the back generation solution process will become low. The Gauss-Jordan elimination method can eliminate the rows of the matrix in parallel and then decompose it, and the hardware implementation in the FPGA is simpler; if the current injection vector i obtained by the Gauss-Jordan elimination method unit is km If the Newton-Raphson iteration convergence condition is met, the final solution is obtained by using the matrix-vector multiplication unit through the multiplexer; if i kmIf it has not converged yet, the multiplexer returns to step S41 where the Preisach hysteresis unit will km As input for the next iteration, iter = iter + 1, until the iteration convergence condition is met or the maximum number of iterations Iter is reached max .

[0194] Further, the compensation formula in S5 is:

[0195] v=v0-R Thev i km (20)

[0196] Where v is the node voltage with nonlinear branch, R Thev is the nxnq Thevenin matrix obtained from Y.

[0197] like Figure 8 As shown, an embodiment of the present invention provides a system for implementing the method for implementing the FPGA real-time simulation of a power transformer considering the hysteresis effect, and the structure includes:

[0198] Virtual FPGA device 101, physical system device to be tested 102, high-speed data acquisition device 201, analog-to-digital converter device 202, digital-to-analog converter device 203, amplifier device 204;

[0199] The virtual FPGA device 101 is a digital virtualized power transformer object generated in the FPGA development board, which receives historical operation data from the power transformer via the analog-to-digital converter device 202, and compares the real-time simulation results captured by the oscilloscope with the test results of the real system. Various physical quantity data can be used for visualization processing to reflect the real-time status of the power transformer;

[0200] The physical system device 102 to be tested is a physical system including a real power transformer, which is mapped to a virtual power transformer object established in the simulation environment FPGA;

[0201] The high-speed data acquisition device 201 collects the operating status data of the real power transformer in the physical system device 102 to be tested in real time through multiple sensors, and then transmits the operating data to the analog-to-digital converter device 202;

[0202] The analog-to-digital converter device 202 is used to convert the analog data collected by the high-speed data acquisition device 201 into digital data and then feed it back to the virtual FPGA device 101 in the form of digital quantity;

[0203] The digital-to-analog converter device 203 is used to convert the digital quantity data generated in real time in the virtual FPGA device 101 into digital-to-analog data and then transmit it to the amplifier device 204 in the form of analog quantity;

[0204] The amplifier device 204 is used to amplify the analog low-level signal output by the digital-to-analog converter device 203 to a high-level signal that can be tested by the physical system device 102 to be tested.

[0205] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0206] The embodiment of the present invention provides a method for implementing FPGA real-time simulation of a power transformer considering hysteresis effect. It can be seen from the existing literature that the traditional transformer model, such as the linear model, simplifies the calculation amount but has low accuracy; the model based on the finite element method has a slow calculation speed and a long simulation time; the model based on the magnetic circuit contains nonlinear characteristics but has a large amount of calculation. Some documents try to use the first-order rotation curve method to simulate the hysteresis loop, but there are problems such as large errors in some magnetic materials and complex identification process, which affect the accuracy and applicability of the model. Compared with the traditional transformer model, this method has many advantages. The present invention uses the Preisach theory improved by hyperbolic function to establish a new and accurate transformer core hysteresis model to characterize the magnetization characteristics of the core. The model has fewer parameters and is relatively simple to identify, and is combined with the Newton-Raphson iterative algorithm to solve the current in real time. This modeling method provides the required high accuracy and high efficiency, so that the primary and secondary hysteresis loops of the model match the hysteresis loops of the actual transformer core material, making the transformer model closer to the real scene. In offline electromagnetic transient tools (such as ATP, EMTP-RV), nonlinear elements are represented by piecewise linear representation or iterative methods. However, piecewise linear representation will lead to overshoot problems, and the iterative process is very time-consuming, making it difficult to meet high-precision and real-time requirements. The computing power of traditional sequential hardware (such as CPU or DSP) is limited, making it impossible to complete the iterative method within the required time step to meet real-time requirements. The present invention utilizes the parallel processing capabilities and pipeline architecture of FPGA, and at the same time uses sparse technology to reduce hardware resource utilization and improve calculation speed. The hardware-in-the-loop method can test power systems and control equipment under extreme conditions, thereby analyzing the response of transformers under various fault conditions. It is economical, reliable and safe, and lays the foundation for the realization of large-scale FPGA-based real-time simulation of electronic transients in power systems.

[0207] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A method for implementing FPGA real-time simulation of power transformers considering hysteresis effect. It is characterized in that The method includes: S1: Establish a linear model of the power transformer based on the admittance matrix method; S2: Convert the control equation of the transformer in step S1 into a continuous time differential equation, and then discretize it using the trapezoidal integration method to obtain a Norton equivalent circuit form including an admittance matrix and historical current terms; since the parameters of the transformer such as R, L, G are fixed, the transformer parameter matrix is ​​pre-calculated and stored in the random access memory of the FPGA; the linear solution unit calculates the obtained historical current terms and saves the updated historical current terms, wherein the linear solution unit includes two matrix-vector multiplication units and a floating-point adder; S3: Connect nonlinear elements outside the linear model to include nonlinear characteristics such as saturation and hysteresis effects; divide the n-node power system into linear and nonlinear parts, and solve the node voltage of the linear part by node analysis method; since the inverse admittance matrix is ​​sparse, a compact sparse matrix storage method is defined, and the calculation of unknown node voltage is realized in the FPGA through a fast sparse matrix vector multiplication unit; S4: Solve the nonlinear part using the compensation method, and after finding the node voltages of the linear network, solve the n-node power system with nonlinear elements; linearize the nonlinear equations by the Newton-Raphson method, apply the first-order Taylor series expansion to the nonlinear functions, and solve the nonlinear equations to solve the current injection vectors of the nonlinear elements; wherein these nonlinear functions are generated by the Preisach theory to simultaneously represent the saturation effect and the hysteresis effect; S5: According to the compensation method, the current injection vector obtained in step S4 is superimposed on the linear part of the network, and then the entire network is solved to obtain the final solution; S6: Determine whether the simulation time t reaches the set total simulation time T max , if the set total simulation time T is reached max , the simulation ends; otherwise, the simulation time advances one time step, t=t+Δt, and returns to step S2 to update the historical current term through the linear solution unit.

2. The method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect as claimed in claim 1, It is characterized in that The model in S1 is a linear model, which includes nonlinear characteristics such as saturation and hysteresis effects by connecting an external circuit. Under transient conditions, the expression of the three-phase transformer control equation is: day TE / dt=L -1 v TE -L -1 In TE (1) where v TE with i TE are the instantaneous terminal voltage and current respectively, R and L are the winding resistance and winding leakage inductance respectively measured by the short-circuit test.

3. The method for implementing FPGA real-time simulation of a power transformer considering hysteresis effect as claimed in claim 1, It is characterized in that The Norton equivalent circuit expression is as follows: i TE (t)=Gv TE (t)+i hist (t-Δt) I hist (t-Δt)=αv TE (t-Δt)+βi hist (t-2Δt)(2) Where G is the admittance matrix, α = 2(G-GRG), β = (I-2GR), i hist (t-Δt) is the historical current term, Δt is the simulation time step; the linear solution unit includes two matrix vector multiplication units and a floating point adder, and the floating point adder consumes 7 clock cycles; the historical current term i obtained by differentiating the transformer differential equation using the trapezoidal integral method hist (t-Δt) is updated at each time step, and the updated historical current term is calculated and saved in the linear solution unit; to reduce the computational complexity and delay, instead of pre-storing a single fixed parameter, α=2(G-GRG) and β=(I-2GR) are pre-stored in the random access memory RAM_α and RAM_β of the FPGA respectively; the node voltage v TE (t) Store to RAM_v TE , the historical current term i of the previous time step hist (t-Δt) is stored in RAM_i h In the above example, the updated historical current term i hist (t) Store to RAM_i hnew middle.

4. The method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect as claimed in claim 1, It is characterized in that The pre-storage format of the transformer parameter matrix stored in the FPGA consists of two memories, a 32-bit memory val stores the matrix values ​​in row order until all parameter matrix values ​​are stored in the FPGA; a 9-bit memory, the high 8 bits col stores the column index values ​​of the matrix in row order, and the lowest bit row uses 0 or 1 to represent the same row of the storage matrix; IEEE 754 standard 32-bit single-precision floating-point format, the difference is that the accumulation operation in the adder uses fixed-point form; to ensure the range and accuracy, the fixed-point number is set to 64-bit data, of which the integer part is 30 bits and the decimal part is 34 bits; the matrix-vector multiplication unit includes a floating-point multiplier, a floating-point to fixed-point converter, a fixed-point to floating-point converter, two fixed-point adders, a multiplexer and a row counter CNT, which completes the multiplication of row vectors in the form of a deep pipeline. The multiplexer selects the two adders through the counting of row by the row counter CNT. Whenever the value of row is detected to change, the row counter CNT increases by 1; the two fixed-point adders have opposite reset conditions. When fixed-point adder 1 accumulates the first matrix row vector multiplication, fixed-point adder 2 is cleared to prepare for the accumulation of the next row vector multiplication, and the accumulation is cyclic until completion; the floating-point multiplier consumes 5 clock cycles and the fixed-point adder consumes 1 clock cycle.

5. The method for implementing FPGA real-time simulation of a power transformer considering hysteresis effect as claimed in claim 1, It is characterized in that The linear part is solved by node analysis method, and the expression is as follows: Yv 0 =i(3) Where Y is the admittance matrix without nonlinear elements, v 0 and i are the unknown node voltage and known node current respectively. The unknown node voltage v 0 It can be divided into the unknown node voltage A and the known node voltage B. Formula (3) can be rewritten as: Further deformation, i A The unknown node voltage v is obtained from the historical current term A The solution of is given by: In the process of solving the linear equations by node analysis, due to the admittance matrix Y AB With the inverse admittance matrix For sparse matrices, pre-calculated and stored in the FPGA memory RAM_Y AB and memory RAM_Y -1 In AA, the node current i A Stored in memory RAM_i A In the case of b Stored in memory RAM_i b In the equation, the node voltage v is known. B Stored in memory RAM_v B The compact sparse matrix storage method is the same as the matrix-vector multiplication unit, except that only non-zero elements are stored in the sparse matrix, and each non-zero element value is stored row by row through a 32-bit memory val until all non-zero elements of the matrix are stored in the memory; the current i is realized by the fast sparse matrix-vector multiplication unit b The calculation process implemented in FPGA is as follows: the column index value of the sparse matrix is ​​stored in col in row order. The non-zero matrix values ​​are stored in col in row order. The non-zero values ​​of each row of the matrix are stored in row order. Row uses 0 or 1 to represent the same row of the storage matrix. Therefore, the memory RAM_v is taken out according to the column index value stored in col. B The known node voltage v corresponding to the row vector B Column vector, and then use the matrix vector multiplication unit to realize the current i b The calculation includes a floating-point subtractor to implement the subtraction operation of formula (5); the inverse admittance matrix is ​​multiplied by the current i through a fast sparse matrix vector multiplication unit. b To calculate the unknown node voltage v A .

6. The method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect as claimed in claim 1, It is characterized in that The current injection vector solution process of the nonlinear element in step S4 is implemented by a Newton-Raphson nonlinear solution module: f(i km )=v oc -r thev i km (7) Where f(i km ) is a nonlinear function, v oc is the open circuit voltage without nonlinear components (v 0 subset), r thev is the Thevenin equivalent resistance matrix obtained from Y, i km The current injection vector for the nonlinear element; Formula (6) is linearized successively by the Newton-Raphson method, and the expression is: Where J is the Jacobian matrix and k is the number of iterations; the calculation of J and -F is given by the following formula: The Newton-Raphson iteration convergence condition is given by the following formula, the threshold ∈ 1 ,∈ 2 The value of is small enough; Specifically, when the external nonlinear element is a nonlinear inductor, the characteristic function is expressed as: λ(t)=f λ (i km (t))(11) Among them, the magnetic flux λ(t) is the integral of the node voltage within a simulation time step. The integral is differentiated by the trapezoidal integration method and the expression is: According to formulas (11) and (12), we can determine i km The nonlinear equations are expressed as: Then formula (9) can be restated as: In the FPGA, the global control module realizes the orderly solution of the linear solution module and the Newton-Raphson nonlinear solution module, so that each module and each unit operates in parallel or sequentially according to the requirements of the transient algorithm; the Newton-Raphson nonlinear solution module includes the Preisach hysteresis unit, the Jacobian matrix calculation unit and the Gauss-Jordan elimination method unit; the solution process includes the following steps: S41: Hysteresis nonlinear modeling based on Preisach theory, where the main hysteresis loop function is represented by a hyperbolic function; in the Preisach hysteresis unit, the nonlinear function of the Newton-Raphson iteration is calculated in real time through a lookup table with the help of FPGA parallel computing capability; S42: After the nonlinear function calculation is completed, the Jacobian matrix and the value of the nonlinear equation are calculated by the Jacobian matrix calculation unit in the FPGA, and the result is substituted into the parallel Gauss-Jordan elimination method unit to calculate the current injection vector of the nonlinear element; if the current injection vector meets the Newton-Raphson iteration convergence condition, go to step S5; if it has not converged yet, return to step S41, and the Preisach hysteresis unit uses the current injection vector as input for the next iteration, iter=iter+1, until the iteration convergence condition is met or the maximum number of iterations is reached.

7. A method for implementing FPGA real-time simulation of a power transformer taking into account hysteresis effect as claimed in claim 6, It is characterized in that The hysteresis main loop function in S41 is expressed by a hyperbolic function as follows: Where a u 、b u 、c u is the hyperbolic template parameter, i km is the current injection vector flowing through the nonlinear inductor, λ p_m is the magnetic flux density corresponding to the current in the main circuit, and the subscript p_m represents the Preisach main circuit; when the hysteresis main circuit function is determined, from the reversal point (i re ,λ re ) all small loop trajectories starting from follow this function; The expressions of magnetic flux density of the rising branch and the falling branch of the small loop are as follows: λ p_u (and km )=-λ p_m (-i km )-λ p_m (and re )+λ re +2K(-i re )K(i km )(16) λ p_d (and km )=λ p_m (and km )+λ p_m (-i re )+λ re -2K(i re )K(-i km )(17) Where K = [K 1 K 2 …K nq ], j = 1, 2, 3, ..., nq; The derivative expressions of the ascending branch and descending branch of the small loop are as follows: The nonlinear function f(i km ) and its derivative df(i km ) / di km Parallel computing is achieved through a lookup table in the FPGA; in the Preisach hysteresis unit, the lookup table stores the λ p_m (±i km )、K(±i km )、K(±i re ) and dλ p_m (±i km ), the address generation unit is designed to convert the 32-bit floating point number i km Converted into integers to address the lookup table; Based on formulas (16)-(19), the calculation of the nonlinear function and its derivatives is solved by the lookup table, floating-point adder unit, floating-point multiplier unit, and multiplexer; Since the calculation of formulas (16)-(19) depends on the ascending branch or the descending branch, K(±i km ) Two lookup tables, through the multiplexer according to i km with -i km The first bit of the table is used to select which lookup tables participate in the calculation.

8. The method for implementing FPGA real-time simulation of a power transformer taking into account the hysteresis effect as claimed in claim 6, It is characterized in that The output end of the Jacobian matrix calculation unit is connected to the input end of the Gauss-Jordan elimination method unit. Since it contains nonlinear elements, if the LU decomposition method is used, it needs to be re-factored, and the efficiency of the LU decomposition forward and back-generation solution processes will become low. The Gauss-Jordan elimination method can eliminate the rows of the matrix in parallel and then decompose it, and the hardware implementation in the FPGA is simpler; if the current injection vector i obtained by the Gauss-Jordan elimination method unit is km If the Newton-Raphson iteration convergence condition is met, the final solution is obtained by using the matrix-vector multiplication unit through the multiplexer; if i km If it has not converged yet, the multiplexer returns to step S41 where the Preisach hysteresis unit will km As input for the next iteration, iter = iter + 1, until the iteration convergence condition is met or the maximum number of iterations Iter is reached max .

9. The method for implementing FPGA real-time simulation of a power transformer considering hysteresis effect as claimed in claim 1, It is characterized in that The compensation formula in S5 is: v=v 0 -R Thev i km (20) Where v is the node voltage with nonlinear branch, R Thev is the nxnq Thevenin matrix obtained from Y.

10. A system for implementing the method for realizing FPGA real-time simulation of a power transformer according to any one of claims 1 to 9, It is characterized in that The system includes: A virtual FPGA device, a physical system to be tested device, a high-speed data acquisition device, an analog-to-digital converter device, a digital-to-analog converter device, and an amplifier device; The virtual FPGA device is a digital virtualized power transformer object generated in the FPGA development board. The historical operation data from the power transformer is received through the analog-to-digital converter device, and the real-time simulation results captured by the oscilloscope are compared with the test results of the real system. Various physical quantity data can be used for visualization processing to reflect the real-time status of the power transformer. The physical system device to be tested is a physical system including a real power transformer, which is mapped to a virtual power transformer object established in the simulation environment FPGA; The high-speed data acquisition device collects the operating status data of the real power transformer in the physical system device to be tested in real time through multiple sensors, and then transmits the operating data to the analog-to-digital converter device; The analog-to-digital converter device is used to convert the analog data collected by the high-speed data acquisition device into digital data and then feed it back to the virtual FPGA device in the form of digital quantity; The digital-to-analog converter device is used to convert the digital quantity data generated in real time in the virtual FPGA device into digital-to-analog data and then transmit it to the amplifier device in the form of analog quantity; The amplifier device is used to amplify the analog low-level signal output by the digital-to-analog converter device into a high-level signal that can be tested by the physical system device to be tested.

Citation Information

Patent Citations

  • Transformer hysteresis simulation method and device, computer equipment and readable storage medium

    CN113420463A

  • Power distribution network fine-grained parallel electromagnetic transient simulation method and system, terminal and medium

    CN114943133A

  • Electromagnetic transient parallel iteration real-time simulation compensation method and device

    CN116720338A

  • Multi-level hysteresis voltage controllers for voltage modulators and methods for control thereof

    WO2018232403A1

Cited By

  • Transformer broadband modeling method and system, electronic equipment and medium

    CN119337802A

  • Modeling method, system and equipment for power multiplication of transformer, medium and product

    CN119514220A

  • A method, system, device, medium, and product of modeling transformer power multiplication

    CN119514220B