Finite element motor real-time simulation method and system based on FPGA
By real-time simulation of finite element motors on FPGAs, the problem that the characteristics of high-speed motors and power electronic switches in the prior art are solved, and high-precision simulation of step size of 1 microsecond is achieved, which improves the accuracy of the hardware in-loop testing of the motor drive system.
Patent Information
- Application Number
- CN202411788362.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
AI Technical Summary
The real-time simulation system of existing motor systems cannot accurately simulate the characteristics of high-speed motors and power electronic switching, and the CPU implementation of finite element motors results in insufficient simulation step size, which cannot meet the simulation requirements of 1 microsecond level.
The real-time simulation method of finite element motor based on FPGA is adopted. By obtaining the finite element motor parameters and data tables, the data tables are reorganized and stored in the DDR of FPGA, and the parallel computing module and the bilinear interpolation calculation module are used to realize high-precision real-time simulation of the finite element motor.
Real-time simulation of finite element motors with high precision in step size of 1 microsecond is realized, which can accurately simulate the magnetic saturation characteristics and power electronic switching characteristics of the motor, and improve the accuracy of the hardware in-loop testing of the motor drive system.
Smart Images

Figure CN119720649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of real-time simulation of motor systems, and in particular to a finite element motor real-time simulation method and system based on FPGA. Background Art
[0002] In the industrial field, it is usually necessary to use real motors, inverters, power supplies, controllers and other physical equipment to test the electric drive controller in various working conditions and functions. This physical testing method is costly and inefficient, and cannot perform some complex and extreme working condition tests. In recent years, with the advancement of real-time simulation technology and the rapid development of the automotive industry, the use of real-time simulators to simulate motor test platforms for controller hardware-in-the-loop testing has become the preferred solution for many companies.
[0003] In the current real-time simulation system of the motor system, the motor model is usually modeled on the FPGA by simply equivalent to a linear motor, without considering the magnetic saturation characteristics, and cannot accurately reflect the physical characteristics of the real motor, and cannot reflect the accurate control effect of the electric drive controller. The finite element motor model takes into account the mechanical structure such as the stator tooth slot, the motor characteristics such as magnetic saturation, and is a high-precision detailed model, but the finite element motor has high computing resource requirements and complex data processing. In many real-time simulation systems of motor systems, the finite element motor is implemented in the CPU and simulated with a step size of tens of microseconds. This CPU simulation of the finite element motor real-time simulation system cannot simulate the operating characteristics of high-speed motors, nor can it accurately simulate the characteristics of power electronic switches.
[0004] Nowadays, in the application of electric drive systems, the switching frequency of power electronic devices is getting higher and higher, and the speed of motors is getting faster and faster. Engineers have lower and lower requirements for the simulation step size in the hardware-in-the-loop test of the controller of the motor drive system, and at least a simulation step size of 1 microsecond is required to realize the motor model. Therefore, it is very necessary to use FPGA to realize the finite element motor model with large computing resources and complex processing, and use the hardware characteristics of FPGA to realize high-performance real-time computing in a short time period of 1 microsecond. Summary of the invention
[0005] The purpose of the present invention is to provide a finite element motor real-time simulation method and system based on FPGA in order to achieve microsecond-level step-size simulation of a motor model.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] As a first aspect of the present invention, a finite element motor real-time simulation method based on FPGA is provided, characterized in that the steps include:
[0008] Obtain finite element motor parameters and a data table, wherein the data table includes a three-dimensional query table: a three-dimensional query table of currents of the d and q axes in a stationary coordinate system and a three-dimensional query table of torques;
[0009] Reorganize the finite element motor data table, expand the three-dimensional query table into a one-dimensional array and then store it serially in the DDR of the FPGA;
[0010] Sampling the three-phase voltage at the output end of the inverter and the three-phase current output by the finite element motor at the starting moment;
[0011] Two parallel calculation modules are used to respectively calculate: based on the three-phase voltage at the output end of the inverter, the three-phase current output by the finite element motor and the three-phase flux of the finite element motor at the previous moment, the three-phase flux of the finite element motor at the current moment is calculated; based on the input torque and output torque of the finite element motor, the sine value and cosine value of the finite element motor angle and the motor angle are calculated;
[0012] The flux of the d and q axes is calculated based on the three-phase flux of the finite element motor and the sine and cosine values of the motor angle;
[0013] Based on the current values of the magnetic flux and current of the d and q axes and the angle of the finite element motor, two sets of parallel processing DDR data reading units are used to read the vertex data of the corresponding three-dimensional adjacent intervals in the three-dimensional query table of current and torque of the d and q axes stored in the DDR respectively;
[0014] Based on the vertex data of the three-dimensional adjacent intervals of the current value in the two three-dimensional query tables, the current of the d and q axes and the output torque of the finite element motor are calculated respectively through two parallel bilinear interpolation calculation modules;
[0015] According to the d-axis and q-axis currents and the motor angle obtained by the bilinear interpolation calculation module, the three-phase current output by the finite element motor at the current moment is calculated.
[0016] As a preferred technical solution, the data table includes: a one-dimensional data table: magnetic flux F, F of d and q axes q , d, q axis current I d ,I q And the motor angle θ; three-dimensional query table: the current query table I of the d and q axes in the stationary coordinate system d (F d ,F q ,θ)、I q (F d ,F q ,θ) and torque query table T e (I d ,I q ,θ);
[0017] The reorganized finite element motor data table specifically includes:
[0018] For each one-dimensional data table, the maximum value of the data, the minimum value of the data address, the data length, the minimum data interval and the index array in the array can be parsed, and the pre-processed data, the finite element motor parameters and the original one-dimensional data group are serially stored in the BRAM of the FPGA;
[0019] Expand the three-dimensional query table and arrange the three-dimensional data into a one-dimensional array table according to the design order, and store the one-dimensional array serially in the DDR of the FPGA.
[0020] As a preferred technical solution, the operation of the FPGA after power-on is divided into an initialization configuration phase and an operation phase. In the initialization configuration phase, the data in the BRAM is read and configured into the status register in the finite element motor IP. After the configuration is completed, the initialization completion flag is pulled high. After the state switching logic detects that the flag is pulled high, the finite element motor IP enters the operation phase and starts subsequent operations according to the start signal input by the block-level handshake protocol. In the operation phase, the finite element motor IP accesses the DDR address in real time and performs data acquisition operations.
[0021] As a preferred technical solution, the three-phase flux of the finite element motor is obtained by using the trapezoidal integration method:
[0022]
[0023] Among them, t represents the current time, dt is the simulation step size on the FPGA; t-dt represents the previous time on the FPGA, V abc is the three-phase voltage at the inverter output, I abc is the three-phase current output by the motor; Res is the stator side resistance.
[0024] As a preferred technical solution, the DDR data reading units for calculating the currents corresponding to the d and q axes respectively include:
[0025] The data index calculation module enters the corresponding data index calculation module according to the current d-axis and q-axis magnetic flux and finite element motor angle, and calculates the d-axis and q-axis magnetic flux index numbers F respectively. d _index, F q _index and the finite element motor angle index number θ_index, and obtain F d 、F q 、The data values before and after the current value of θ in the one-dimensional array F d1 、F d2 、F q1 、F q2 , θ1, θ2;
[0026] DDR address calculation module, input the magnetic linkage index number F of d and q axes d _index, F q _index and the finite element motor angle index number θ_index, calculate the data address DDR_address;
[0027] DDR data reading module, according to the data address DDR_address, query from DDR and read the magnetic flux F of d and q axes. d 、F q The three-dimensional query table I of the current value of the finite element motor angle θ in the d and q axes respectively d (F d ,F q ,θ)、I q (F d ,F q ,θ) corresponds to the current data values of the d and q axes of the vertices of the three-dimensional adjacent interval.
[0028] As a preferred technical solution, the data index calculation module calculates the index number specifically as follows:
[0029] Subtract the current data data from the minimum data value data_min, and obtain the integer part of the ratio of the difference value to the minimum data interval data_delta as the data address, and finally obtain the value data_index of the data address in the index array.
[0030] As a preferred technical solution, the DDR address calculation module is specifically calculated as follows:
[0031] DDR_address=[(θ_index*data_size+F d _index)*data_size+F q _index]*16
[0032] Among them, data_size is a one-dimensional array F d Length, F d _index, F q _index, θ_index are the current moment F d 、F q , the index number of the θ value.
[0033] As a preferred technical solution, each time the finite element motor on the FPGA is updated, the DDR data reading module reads and writes the DDR once, and the FPGA reads the magnetic flux F of the d and q axes from the DDR each time. d 、F qThe three-dimensional query table I of the current of the d and q axes of the finite element motor angle θ in the stationary coordinate system d (F d ,F q ,θ)、I q (F d ,F q ,θ) corresponds to the current data values of the d and q axes of the vertices of the three-dimensional adjacent interval.
[0034] As a preferred technical solution, the bilinear interpolation method is specifically as follows:
[0035] In the θ1 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows:
[0036]
[0037] In the θ2 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows:
[0038]
[0039] Perform linear interpolation in the θ direction to solve the current I of the three-phase current of the finite element motor on the d and q axes d and I q The linear interpolation formula is as follows:
[0040]
[0041] In the formula, F d 、F q is the current value of magnetic flux of d and q axes; F d1 、F d2 、F q1 、F q2 F d 、F q The corresponding integer values before and after in a one-dimensional array; I dq ,I dq2 Represents the current values of d and q axes in θ1 and θ2 dimensions respectively; I dq _θ1_1,I dq _θ1_2, I dq _θ1_3,I dq _θ1_4 respectively represent the d-axis and q-axis current values of the vertices of the three-dimensional adjacent interval read.
[0042] As a second aspect of the present invention, a finite element motor real-time simulation system based on FPGA is provided, wherein the system implements the finite element motor real-time simulation method based on FPGA as described above, comprising:
[0043] A motor three-phase flux calculation module and a motor angle, sine and cosine value calculation module for parallel calculation, wherein the motor three-phase flux calculation module is input with the three-phase voltage at the output end of the inverter, the three-phase current output by the finite element motor and the three-phase flux of the finite element motor at the previous moment, and calculates and outputs the three-phase flux of the finite element motor at the current moment; the motor angle, sine and cosine value calculation module is input with the input torque and output torque of the finite element motor, and calculates and outputs the finite element motor angle and the sine value and cosine value of the motor angle;
[0044] The d and q axis flux solution module is input with the three-phase flux of the finite element motor at the current moment output by the motor three-phase flux calculation module and the sine value and cosine value of the finite element motor angle output by the motor angle, sine and cosine value calculation module, and the d and q axis flux solution module performs Park transformation to obtain and output the current d and q axis flux;
[0045] The parallel processing DDR data reading unit reads the magnetic flux and current of the d and q axes and the current value of the finite element motor angle respectively, and reads the vertex data of the corresponding three-dimensional adjacent intervals in the three-dimensional query table of the current of the d and q axes and the three-dimensional query table of the output torque of the finite element motor in the stationary coordinate system stored in the DDR;
[0046] Two parallel bilinear interpolation calculation modules calculate the output d-axis and q-axis currents and the output torque of the finite element motor based on the vertex data read by the DDR data reading unit. The output d-axis and q-axis current values are fed back to the input of the DDR data reading unit corresponding to the output torque of the finite element motor. The output torque of the finite element motor is fed back to the input of the motor angle, sine and cosine value calculation module.
[0047] The three-phase current solving module calculates the three-phase current output by the finite element motor at the current moment according to the current of the d and q axes and the motor angle obtained by the bilinear interpolation calculation module; the obtained three-phase current is fed back to the input of the motor three-phase flux calculation module.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] The FPGA-based finite element motor real-time simulation method proposed in the present invention can effectively utilize the FPGA's unique pipeline mechanism and parallel mechanism to realize the finite element motor real-time simulation with small steps at the us level by preprocessing the finite element motor data and optimizing the implementation steps. It can present the nonlinear characteristics of the motor including magnetic saturation characteristics, mechanical structure characteristics such as stator teeth, etc. with high precision, effectively verify the correctness of the motor design, and improve the accuracy of the hardware-in-the-loop test of the motor drive system. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the FPGA-based finite element motor real-time simulation method of the present invention;
[0051] Figure 2 It is a block diagram of the finite element motor implementation architecture based on FPGA in an embodiment of the present invention;
[0052] Figure 3 A schematic diagram of a bilinear interpolation method in an embodiment of the present invention;
[0053] Figure 4 The topology of the finite element motor model in the embodiment of the present invention;
[0054] Figure 5 The FPGA-based finite element motor current waveform sampled by the oscilloscope in the embodiment of the present invention;
[0055] Figure 6 This is a finite element motor torque waveform based on FPGA sampled by an oscilloscope in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0057] Example 1
[0058] In order to meet the simulation step size requirements for the hardware-in-the-loop test of the controller of the motor drive system, the present invention provides a real-time simulation method for multiple types of motors based on FPGA. The finite element motor model with large computing resources and complex processing is implemented using FPGA. By preprocessing the finite element motor data and optimizing the implementation steps, the hardware parallelism of FPGA is used to achieve high-performance real-time calculation within a short time period of 1 microsecond.
[0059] The process is as follows Figure 1 As shown, the steps include:
[0060] Step 1: Obtain finite element motor parameters and data tables, including rotor inertia J, stator side resistance Res, friction coefficient B, pole pair number P and other parameters; the data table includes a one-dimensional data table F d 、F q ,I d 、i q , θ, three-dimensional query table i d (F d ,F q ,θ)、I q (F f ,F q ,θ) and T e(I d ,I q ,θ);
[0061] Step 2: Reorganize the finite element motor data table, pre-process the five one-dimensional data tables, and store them serially in the BRAM of the FPGA together with the motor parameters and the original one-dimensional data group, and expand the three three-dimensional query tables and store them serially in the DDR of the FPGA;
[0062] The step 2 comprises the following steps:
[0063] The five one-dimensional data tables F obtained d 、F q ,I d ,I q , θ need to be preprocessed in RT, each one-dimensional data table can be parsed to obtain the maximum data value data_max, the minimum data value data_min, the maximum data address data_address, the data length data_size, the minimum data interval data_delta, and the index array data_index
[1024] with a data length of 1024 in the array, and then stored in series with the finite element motor parameters and the original one-dimensional data group in the BRAM of the FPGA;
[0064] The three 3D query tables I obtained d (F f ,F q ,θ)、I q (F d ,F q ,θ) and T e (I d ,I q ,θ) also needs preprocessing. Each three-dimensional query table needs to be expanded. The three-dimensional data is arranged into the required one-dimensional array according to the design order, and then the three one-dimensional arrays are serially stored in the DDR of the FPGA. Specifically, the three 3D data tables I d _3D,i q _3D, T e _3D is expanded into three one-dimensional data tables according to the principle of adjacent data arrangement. d _1D, I q _3D, T e _3D, and then the three one-dimensional data tables are sorted according to I d ,I q 、T e The 1D data table DDR_data is formed in sequence, and then each time the FPGA runs, 16 data are read through the data address DDR_address for use.
[0065] The operation of FPGA after power-on is divided into initialization configuration stage and operation stage. In the initialization configuration stage, the data in BRAM is read and configured to the status register in the finite element motor IP. After the configuration is completed, the initialization completion flag is pulled high. After the state switching logic detects that the flag is pulled high, the finite element motor IP enters the operation stage and starts the subsequent operation according to the start signal input by the block-level handshake protocol. In the operation stage, the finite element motor IP accesses the DDR address in real time and performs data acquisition operations;
[0066] Step 3: Sample the three-phase voltage V at the inverter output a 、V b 、V c , sampling finite element motor output three-phase current I a ,I b ,I c ;
[0067] Step 4: Use the trapezoidal integration method to obtain the three-phase flux F of the finite element motor a 、F b 、F c ;
[0068] The step 4 is specifically expressed as follows:
[0069]
[0070] Among them, t represents the current time, dt is the simulation step size on the FPGA; t-dt represents the previous time on the FPGA, V abc is the three-phase voltage at the inverter output, I abc Output three-phase current to the motor;
[0071] Step 5: Obtain the finite element motor angle θ and calculate the sine and cosine values of the angle. Specifically, the motor angle θ can be obtained by solving the angle formula of the motor mechanical department, and then the sine and cosine values of the angle can be solved;
[0072] The formula for solving the motor angle θ is as follows:
[0073]
[0074] Among them, T e is the output torque of the finite element motor, T m is the finite element motor input torque, ω m is the mechanical speed, ω e is the electrical speed, J is the rotor inertia, B is the friction coefficient, and P is the number of pole pairs;
[0075] Step 6: Obtain the magnetic flux F of the d and q axes in the stationary coordinate system d and F q , the motor three-phase flux Fa 、F b 、F c Perform ABC to DQ transformation to obtain the components F on the d and q axes of the rotating coordinate system d and F q ;
[0076] The transformation formula from ABC coordinate system to DQ coordinate system is:
[0077]
[0078] Step 7: According to the current magnetic flux F of d and q axes d 、F q and the finite element motor angle θ, enter the data index calculation module, DDR address calculation module and DDR data reading module in turn, and then use the bilinear interpolation method to calculate the finite element motor three-phase current in the stationary coordinate system d, q axis current I d and I q ;
[0079] like Figure 2 As shown, step 7 includes the following:
[0080] According to the current d and q axis magnetic flux F d 、F q and the finite element motor angle θ, respectively enter the corresponding data index calculation module, and calculate F d _index, F q _index, θ_index, and obtain F d 、F q 、θ corresponds to the data value before and after in the one-dimensional array F d1 、F d2 、F q1 、F q2 , θ1, θ2; Since F is obtained by FPGA calculation d 、F q , θ is floating point data with a decimal point, and the data stored in DDR is integer data, so the data value F obtained here d1 、F d2 、F q1 、F q2 , θ1, θ2 are the integer values closest to the current value.
[0081] Enter the DDR address calculation module and substitute F d _index, F q _index, θ_index, calculate the required data address DDR_address;
[0082] Entering the DDR data reading module, DDR reads data from the three-dimensional query table I according to the data address DDR_address index. d (F d ,F q ,θ)、I q (F d ,F q ,θ) to obtain the magnetic flux F of the d and q axes d 、F q The current data values corresponding to the eight vertices of the three-dimensional adjacent intervals in the three-dimensional query table of the d-axis and q-axis currents in the stationary coordinate system and the current value of the finite element motor angle θ, that is, I d _θ1_1,I d _θ1_2, I d _θ1_3,I d _θ1_4,I d _θ2_1,I d _θ2_2,I d _θ2_3,I d _θ2_4 and I q _θ1_1,I q _θ1_2, I q _θ1_3,I q _θ1_4,I q _θ2_1,I q _θ2_2,I q _θ2_3,I q _θ2_4;
[0083] Based on the data values of the eight vertices in the three-dimensional adjacent interval, the bilinear interpolation method is used to calculate the current i of the d and q axes of the three-phase current of the finite element motor in the stationary coordinate system. d and I q ;
[0084] The data index calculation module is specifically as follows:
[0085] Subtract the current data data from the minimum data value data_min, then calculate the integer part of the ratio of the difference value to the minimum data interval data_data as the data address, and finally calculate the value data_index of the data address in the index array data_index
[1024] ;
[0086] The DDR address calculation module is specifically as follows:
[0087] DDR_address=[(θ_index*data_size+F d _index)*data_size+F q _index]*16
[0088] Among them, date_size is a one-dimensional array F d Length, F d _index, F q _index, θ_index are the current moment F d 、F q , the index number of the θ value;
[0089] The DDR data reading module needs to read and write DDR every time the motor is updated on the FPGA. The FPGA reads 16 data from DDR each time;
[0090] like Figure 3 As shown, the bilinear interpolation method can be specifically expressed as:
[0091] In the θ1 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows:
[0092]
[0093] In the θ2 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows:
[0094]
[0095] Perform linear interpolation in the θ direction to solve the current I of the finite element motor three-phase current in the d and q axes in the stationary coordinate system. d and I q The linear interpolation formula is as follows:
[0096]
[0097] Step 8: According to the current I of the d and q axes d ,I q and the finite element motor angle θ, enter the data index calculation module, DDR address calculation module and DDR data reading module in turn, and then use the bilinear interpolation method to calculate the finite element motor output torque T e ;
[0098] like Figure 2 As shown, in step 8, the bilinear interpolation method of the data index calculation module, the DDR address calculation module and the DDR data reading module is consistent with the method used in step 7;
[0099] Step 9: According to I d ,I q, θ, calculate the current moment finite element motor output three-phase current I abc ;
[0100] The I obtained at the current moment d ,I q Perform an inverse Park transformation from DQ to ABC to calculate the three-phase current I output by the finite element motor at the current moment abc , the DQ to ABC transformation formula is:
[0101]
[0102] The following is a simulation example:
[0103] Figure 4 It is based on the finite element motor application topology circuit. The DC source, inverter, and finite element motor are all simulated in real time on the same FPGA module.
[0104] Figure 5 , Figure 6 The stator current waveform and torque waveform of the finite element motor are simulated in real time based on FPGA using the method in this paper. The FPGA simulation step size is 1us, the number of pole pairs of the finite element motor is 4, the motor speed is 300r / s, and the torque T m It is 200N·m. From the oscilloscope, we can see that the finite element motor current and torque are nonlinear, which is significantly different from the traditional simplified motor model and basically consistent with the theoretical calculation results.
[0105] In summary, FPGA is used to implement real-time simulation of finite element motor at the microsecond level with small step size, and the nonlinear characteristics of the test motor (magnetic saturation characteristics, mechanical structure characteristics such as stator teeth, etc.) are presented with high precision, which verifies the correctness of the motor design and improves the accuracy of the hardware-in-the-loop test of the motor drive system.
[0106] Example 2
[0107] As another implementation of the present invention, this embodiment also provides a FPGA-based finite element motor real-time simulation system for implementing the FPGA-based finite element motor real-time simulation method described in Example 1 above, the system, such as Figure 2 As shown, the system specifically includes:
[0108] A motor three-phase flux calculation module and a motor angle, sine and cosine value calculation module for parallel calculation, wherein the motor three-phase flux calculation module is input with the three-phase voltage at the output end of the inverter, the three-phase current output by the finite element motor and the three-phase flux of the finite element motor at the previous moment, and calculates and outputs the three-phase flux of the finite element motor at the current moment; the motor angle, sine and cosine value calculation module is input with the input torque and output torque of the finite element motor, and calculates and outputs the finite element motor angle and the sine value and cosine value of the motor angle;
[0109] The d and q axis flux solution module is input with the three-phase flux of the finite element motor at the current moment output by the motor three-phase flux calculation module and the sine value and cosine value of the finite element motor angle output by the motor angle, sine and cosine value calculation module, and the d and q axis flux solution module performs Park transformation to obtain and output the current d and q axis flux;
[0110] The parallel processing DDR data reading unit reads the magnetic flux and current of the d and q axes and the current value of the finite element motor angle respectively, and reads the vertex data of the corresponding three-dimensional adjacent intervals in the three-dimensional query table of the current of the d and q axes and the three-dimensional query table of the output torque of the finite element motor in the stationary coordinate system stored in the DDR;
[0111] Two parallel bilinear interpolation calculation modules calculate the output d-axis and q-axis currents and the output torque of the finite element motor based on the vertex data read by the DDR data reading unit. The output d-axis and q-axis current values are fed back to the input of the DDR data reading unit corresponding to the output torque of the finite element motor. The output torque of the finite element motor is fed back to the input of the motor angle, sine and cosine value calculation module.
[0112] The three-phase current solving module calculates the three-phase current output by the finite element motor at the current moment according to the current of the d and q axes and the motor angle obtained by the bilinear interpolation calculation module; the obtained three-phase current is fed back to the input of the motor three-phase flux calculation module.
[0113] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A finite element motor real-time simulation method based on FPGA, characterized in that the steps include: Obtain finite element motor parameters and a data table, wherein the data table includes a three-dimensional query table: a three-dimensional query table of currents of the d and q axes in a stationary coordinate system and a three-dimensional query table of torques; Reorganize the finite element motor data table, expand the three-dimensional query table into a one-dimensional array and then store it serially in the DDR of the FPGA; Sampling the three-phase voltage at the output end of the inverter and the three-phase current output by the finite element motor at the starting moment; Two parallel calculation modules are used to respectively calculate: based on the three-phase voltage at the output end of the inverter, the three-phase current output by the finite element motor and the three-phase flux of the finite element motor at the previous moment, the three-phase flux of the finite element motor at the current moment is calculated; based on the input torque and output torque of the finite element motor, the sine value and cosine value of the finite element motor angle and the motor angle are calculated; The flux of the d and q axes is calculated based on the three-phase flux of the finite element motor and the sine and cosine values of the motor angle; Based on the current values of the magnetic flux and current of the d and q axes and the angle of the finite element motor, two sets of parallel processing DDR data reading units are used to read the vertex data of the corresponding three-dimensional adjacent intervals in the three-dimensional query table of current and torque of the d and q axes stored in the DDR respectively; Based on the vertex data of the three-dimensional adjacent intervals of the current value in the two three-dimensional query tables, the current of the d and q axes and the output torque of the finite element motor are calculated respectively through two parallel bilinear interpolation calculation modules; According to the d-axis and q-axis currents and the motor angle obtained by the bilinear interpolation calculation module, the three-phase current output by the finite element motor at the current moment is calculated.
2. The FPGA-based finite element motor real-time simulation method according to claim 1, characterized in that: The data table includes: a one-dimensional data table: magnetic flux F, F of d and q axes q , d, q axis current I d ,I q And the motor angle θ; three-dimensional query table: the current query table I of the d and q axes in the stationary coordinate system d (F d ,F q ,θ)、I q (F d ,F q ,θ) and torque query table T e (I d ,I q ,θ); The reorganized finite element motor data table specifically includes: For each one-dimensional data table, the maximum value of the data, the minimum value of the data address, the data length, the minimum data interval and the index array in the array can be parsed, and the pre-processed data, the finite element motor parameters and the original one-dimensional data group are serially stored in the BRAM of the FPGA; Expand the three-dimensional query table and arrange the three-dimensional data into a one-dimensional array table according to the design order, and store the one-dimensional array serially in the DDR of the FPGA.
3. The FPGA-based finite element motor real-time simulation method according to claim 2 is characterized in that: The operation of the FPGA after power-on is divided into an initialization configuration phase and an operation phase. In the initialization configuration phase, the data in the BRAM is read and configured into the status register in the finite element motor IP. After the configuration is completed, the initialization completion flag is pulled high. After the state switching logic detects that the flag is pulled high, the finite element motor IP enters the operation phase and starts subsequent operations according to the start signal input by the block-level handshake protocol. In the operation phase, the finite element motor IP accesses the DDR address in real time and performs data acquisition operations.
4. The FPGA-based finite element motor real-time simulation method according to claim 1, characterized in that: The three-phase flux of the finite element motor is obtained by using the trapezoidal integration method: Among them, t represents the current time, dt is the simulation step size on the FPGA; t-dt represents the previous time on the FPGA, V abc is the three-phase voltage at the inverter output, I abc is the three-phase current output by the motor; Res is the stator side resistance.
5. The FPGA-based finite element motor real-time simulation method according to claim 1, characterized in that: The DDR data reading units corresponding to the currents of the d and q axes respectively include: The data index calculation module enters the corresponding data index calculation module according to the current d-axis and q-axis magnetic flux and finite element motor angle, and calculates the d-axis and q-axis magnetic flux index numbers F respectively. d _index, F q _index and the finite element motor angle index number θ_index, and obtain F d 、F q 、The data values before and after the current value of θ in the one-dimensional array F d1 、F d2 、F q1 、F q2 , θ1, θ2; DDR address calculation module, input the magnetic linkage index number F of d and q axes d _index, F q _index and the finite element motor angle index number θ_index, calculate the data address DDR_address; DDR data reading module, according to the data address DDR_address, query from DDR and read the magnetic flux F of d and q axes. d 、F q The three-dimensional query table I of the current value of the finite element motor angle θ in the d and q axes respectively d (F d ,F q ,θ)、I q (F d ,F q ,θ) corresponds to the current data values of the d and q axes of the vertices of the three-dimensional adjacent interval.
6. The FPGA-based finite element motor real-time simulation method according to claim 5, characterized in that: The data index calculation module calculates the index number specifically as follows: Subtract the current data data from the minimum data value data_min, and obtain the integer part of the ratio of the difference value to the minimum data interval data_delta as the data address, and finally obtain the value data_index of the data address in the index array.
7. The FPGA-based finite element motor real-time simulation method according to claim 5, characterized in that: The DDR address calculation module is specifically calculated as follows: DDR_address=[(θ_index*data_size+F d _index)*data_size+F q _index]*16 Among them, data_size is a one-dimensional array F d Length, F d _index, F q _index, θ_index are the current moment F d 、F q , the index number of the θ value.
8. The FPGA-based finite element motor real-time simulation method according to claim 5, characterized in that: Each time the finite element motor on the FPGA is updated, the DDR data reading module reads and writes the DDR once, and the FPGA reads the magnetic flux F of the d and q axes from the DDR each time. d 、F q The three-dimensional query table I of the current of the d and q axes of the finite element motor angle θ in the stationary coordinate system d (F d ,F q ,θ)、I q (F d ,F q ,θ) corresponds to the current data values of the d and q axes of the vertices of the three-dimensional adjacent interval.
9. The FPGA-based finite element motor real-time simulation method according to claim 5, characterized in that: The bilinear interpolation method is specifically as follows: In the θ1 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows: In the θ2 dimension, F d 、F q Linear interpolation is performed in the direction, and the linear interpolation formula is as follows: Perform linear interpolation in the θ direction to solve the current I of the three-phase current of the finite element motor on the d and q axes d and I q The linear interpolation formula is as follows: In the formula, F d 、F q is the current value of magnetic flux of d and q axes; F d1 、F d2 、F q1 、F q2 F d 、F q The corresponding integer values before and after in a one-dimensional array; I dq1 ,I dq2 Represents the current values of d and q axes in θ1 and θ2 dimensions respectively; I dq _θ1_1,I dq _θ1_2, I dq _θ1_3,I dq _θ1_4 respectively represent the d-axis and q-axis current values of the vertices of the three-dimensional adjacent interval read.
10. A finite element motor real-time simulation system based on FPGA, characterized in that: The system implements the FPGA-based finite element motor real-time simulation method according to any one of claims 1 to 9, comprising: A motor three-phase flux calculation module and a motor angle, sine and cosine value calculation module for parallel calculation, wherein the motor three-phase flux calculation module is input with the three-phase voltage at the output end of the inverter, the three-phase current output by the finite element motor and the three-phase flux of the finite element motor at the previous moment, and calculates and outputs the three-phase flux of the finite element motor at the current moment; the motor angle, sine and cosine value calculation module is input with the input torque and output torque of the finite element motor, and calculates and outputs the finite element motor angle and the sine value and cosine value of the motor angle; The d and q axis flux solution module is input with the three-phase flux of the finite element motor at the current moment output by the motor three-phase flux calculation module and the sine value and cosine value of the finite element motor angle output by the motor angle, sine and cosine value calculation module, and the d and q axis flux solution module performs Park transformation to obtain and output the current d and q axis flux; The parallel processing DDR data reading unit reads the magnetic flux and current of the d and q axes and the current value of the finite element motor angle respectively, and reads the vertex data of the corresponding three-dimensional adjacent intervals in the three-dimensional query table of the current of the d and q axes and the three-dimensional query table of the output torque of the finite element motor in the stationary coordinate system stored in the DDR; Two parallel bilinear interpolation calculation modules calculate the output d-axis and q-axis currents and the output torque of the finite element motor based on the vertex data read by the DDR data reading unit. The output d-axis and q-axis current values are fed back to the input of the DDR data reading unit corresponding to the output torque of the finite element motor. The output torque of the finite element motor is fed back to the input of the motor angle, sine and cosine value calculation module. The three-phase current solving module calculates the three-phase current output by the finite element motor at the current moment according to the current of the d and q axes and the motor angle obtained by the bilinear interpolation calculation module; the obtained three-phase current is fed back to the input of the motor three-phase flux calculation module.
Citation Information
Cited By
FPGA-based real-time simulation method and system for finite element motor
WO2026118535A1