PMSM motor controller hardware-in-the-loop test method
By using the imitation voltage and table lookup method in the ring test of PMSM motor controller hardware, the problem of low debugging efficiency is solved, and more efficient and accurate controller debugging and testing is achieved.
Patent Information
- Application Number
- CN202210871051.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-07-22
AI Technical Summary
The prior art has the problem of low debugging efficiency in the PMSM motor controller hardware in ring testing, making it difficult to quickly and accurately debug and verify the functions of the controller.
The analog voltage channel is used to realize the transmission of temperature signals through the imitation of voltage, and the voltage values at different temperatures are obtained by using the table lookup method. During the debugging process, the table is checked through a one-dimensional array, the magnetic flux and inductance parameters are debugged, and automatic test cases are written using automatic testing software to generate automatic test reports.
It improves the debugging efficiency of the controller, shortens the debugging time, enhances the accuracy and automation of the test, and reduces the workload of manual debugging.
Smart Images

Figure CN115309136B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of hardware-in-the-loop testing of a PMSM controller, and in particular to a hardware-in-the-loop testing method for a PMSM motor controller. Background Art
[0002] In order to adapt to the development of the new "four modernizations" of automobiles, the development and manufacturing of mechanical-based transmissions are no longer conducive to the development of the industry. The research and development of motors, electronic controls and new energy drive systems based on this architecture is essential, especially the current industry's transformation and development based on electrification and intelligence.
[0003] The current software development needs to have a very deep understanding of the electronic and electrical architecture, characteristics and control principles of hybrid and pure electric special transmission systems, and can understand system requirements, system architecture, software and hardware interfaces, and hardware design and development. In the field of software process and architecture development, he has experience in software development and development management, Aspice software development process, functional safety development process, and is proficient in three-layer software architecture design that meets functional safety requirements and AutoSAR software architecture development. He can propose ideas and guiding suggestions for the power domain control software architecture and propose implementation plans.
[0004] Hardware-in-the-loop testing is a key step in the development of hybrid power controllers and component controllers. It can verify the controller functions before bench tests and road tests, shortening the controller development cycle. Build a hybrid power hardware-in-the-loop testing system to perform hardware-in-the-loop testing on the vehicle controller and component controllers. Compare the automatic generation methods of control strategy test cases, and use genetic algorithms to automatically generate test cases for hybrid power control strategies, which improves the efficiency of controller development.
[0005] The hardware-in-the-loop test system uses a real-time processor to run a simulation model to simulate the operating state of the controlled object, connects to the ECU under test through the I / O interface, and performs a comprehensive and systematic test on the ECU under test. Considering safety, feasibility and reasonable cost, hardware-in-the-loop testing has become a very important part of the ECU development process, reducing the number of real vehicle road tests, shortening development time and reducing costs, while improving the software quality of the MCU and reducing the risks of automobile manufacturers.
[0006] In the new field of new energy vehicles, hardware-in-the-loop testing is particularly important for the three core electronic control systems: vehicle control system, BMS battery management system, and MCU motor controller. Summary of the invention
[0007] The present invention provides a PMSM motor controller hardware-in-the-loop testing method, which is beneficial to improving the debugging efficiency of the controller.
[0008] The technical solutions to the above problems are as follows:
[0009] The PMSM motor controller hardware-in-the-loop test method includes the following steps:
[0010] S1, U, V, W three-phase temperature, through the analog voltage channel, adopts the voltage simulation method to achieve, using the corresponding relationship between temperature and voltage, simulate the transmission of temperature signals, temperature simulation through the voltage channel, adopts the table lookup method to obtain different temperatures;
[0011] S2, the motor temperature adopts the voltage simulation method, obtains the voltage value at different temperatures by looking up the table, and shifts at the first temperature to obtain different voltages, which are transmitted to the main control board to realize the forward transmission of the motor temperature and the measurement and control system;
[0012] S3, when debugging flux linkage, adding a given fixed flux linkage can obtain the table-lookup flux linkage, and display it in a fixed two-fold relationship, so that the table-lookup value can be obtained when a fixed value is given;
[0013] S4, using a one-dimensional array to look up a table, using Id to look up a one-dimensional data table to obtain Ld, and using Iq to look up a one-dimensional data table to obtain Ld, where Id represents the d-axis current, Iq represents the q-axis current, and Ld represents the d-axis inductance;
[0014] S5, adopts the method of selecting fixed values and table lookup values for flux linkage parameters and inductance parameters. During the debugging process, the fixed parameter method is first used for testing, and then the table lookup method is used to determine how to adjust the parameters based on the test results;
[0015] S6, using the Ld independent selection mode, set a fixed value Ld during open-loop debugging, and then collect internal variables through INCA to make Ld equal to the INCA internal variable Ld, ensuring that the resolver offset angle is normal to complete the open-loop debugging of Ld;
[0016] S7, add a layout interface to the debugging interface, set up the way the torque changes over time to obtain the changing trend of torque and speed, and generate an automatic curve;
[0017] S8, when adjusting the resolver zero position, set the resolver initial angle Angle_Offset[deg] / Value to 296.4° so that the motor can obtain the most accurate speed accuracy;
[0018] S9, write automatic test cases through the automatic test software Automation desk and generate automatic test reports. Use Python programming to call INCA internal calibration and observation quantities, and display the results in the report.
[0019] S10, adjusting the PI parameters of the three speeds of high, medium and low respectively to obtain the optimal torque parameter combination value, where the PI represents proportion and integral.
[0020] Through the above method, at the beginning of hardware-in-the-loop debugging, the signal interface is organized according to the established distribution method and a solution document is formed. The specific interface of the circuit board output or input is connected to the Phoenix end of the hardware-in-the-loop test system through the flying line method. Usually, the specific signal of the circuit board is transmitted to the DS2655, DS2680 terminals, ECU1, and ECU2 external line ends of the HIL test system through the lead. The bridge between the circuit board and the test system is established through the upper computer Configuration desk. MATALAB and control desk are respectively associated with the corresponding software upper computer to form a hardware-in-the-loop test system. The purpose of simulation test is achieved by simulating voltage signals, simulating temperature, PWM wave signals, and receiving resolver excitation signals. When the resistance signal is obtained, the corresponding resistance value is obtained by simulating the voltage signal, and the current signal is obtained by debugging the function relationship corresponding to the voltage. The resolver collects the excitation signal and outputs the sin cos wave to the circuit board for adjustment. When adjusting parameters such as flux linkage and inductance, the table flux linkage value is obtained through the fixed value flux linkage, which is convenient for table parameter adjustment. Look up Ld through Id, look up Lq through Iq, use the one-dimensional array table lookup method, adopt the method of fixed value and table lookup value selectable, the specific parameters obtained according to the fixed value in debugging can be used as the basis for table lookup value processing, and the torque change curve is obtained by using the torque change over time method to generate an automatic curve. According to the test results, how to adjust the parameters can be obtained. Automatic test cases are written through the automatic testing software Automation desk, and automatic test reports are generated. The python language is used to program and call the internal calibration quantity and observation quantity of INCA, and the results are displayed in the report.
[0021] The present invention organically combines the controller, software, and test bench, analyzes the difficulties and key points of software testing and debugging, and flashes the configuration to make each controller debugging more efficient and the path more concise. In this way, the efficiency of software development work is improved while ensuring software testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 To debug the bench schematic;
[0023] Figure 2 It is a flow chart of the debugging process of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention are described in more detail below in conjunction with the drawings in the embodiments of the present invention. The described embodiments are part of the embodiments of the present invention, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain the present invention, and cannot be simply understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention. The embodiments of the present invention are described in detail below in conjunction with the drawings:
[0025] like Figure 1 As shown in the figure, the circuit board is subdivided into 8 types, including power supply, sensor, fault signal, CPLD, PWM, CAN, SPI, and wiring harness. The HIL test system is used to simulate the motor temperature, UVW three-phase temperature, UVW three-phase current signal, bus voltage signal, fault signal injection, etc. By receiving the MCU controller PWM wave signal and the resolver excitation signal to achieve the real simulation state, the software logic function is verified to be normal, and the software current loop, torque loop, speed loop and fault diagnosis functions are verified to be normal. During the flux debugging, programming is used to obtain the table flux given by the fixed flux. During the inductance debugging, the table is looked up by using a one-dimensional array, and the flux parameters and inductance parameters are fixed and the table values are selectable. When debugging the ID in the open loop, an independent ID selection method is used to debug the ID current. A layout interface is added to the debugging interface to generate the speed torque automatic curve, and the PI parameters of the three speeds of high, medium and low are adjusted to prevent the current from being too high to cause a fault alarm. The automatic test software Automation desk is used to write automatic test cases and generate automatic test reports. At the same time, the python language is used to program and call the internal calibration quantity and observation quantity of INCA, and the results are displayed in the report. By enumerating the signals before debugging, the test points are shown in Table 1 below.
[0026] Table 1 Signal test points
[0027]
[0028]
[0029]
[0030]
[0031] like Figure 2 As shown, the PMSM motor controller hardware-in-the-loop testing method of the present invention comprises the following steps:
[0032] S1, U, V, W three-phase temperature, through the simulation voltage channel, adopts the voltage simulation method to realize, using the corresponding relationship between temperature and voltage, simulates the transmission of temperature signal, temperature simulation through the voltage channel, adopts the table lookup method to get different temperatures; during the test, the temperature value change range is detected in real time, and the temperature accuracy is observed.
[0033] In this step, the MATALABE modeling method is used to establish the relationship between the three-phase voltages U, V, and W and the temperature. The corresponding voltage is obtained by programming, and a bridge link MATALABE is established through the Configuration desk. Finally, it is output to the test board through the voltage channel. Similarly, the relationship between voltage and motor temperature is used to model and implement the simulated voltage signal output in the same way. The simulated temperature also has a shifting function.
[0034] S2, the motor temperature adopts the voltage simulation method, obtains the voltage value at different temperatures by looking up the table, and shifts at the first temperature to obtain different voltages, which are transmitted to the main control board to realize the forward transmission of the motor temperature and the measurement and control system. In this step, the first temperature is 50℃, and after the forward transmission of the motor temperature and the measurement and control system, the temperature value change range is detected in real time during the test, and it is checked whether to shift gears.
[0035] S3, when debugging the flux linkage, a given fixed flux linkage is added to obtain a table-lookup flux linkage, and it is displayed in a fixed two-fold relationship, so that a table-lookup value can be obtained when a fixed value is given. In step S3, after displaying in a fixed two-fold relationship, a programming module is built through Matlab programming, the fixed flux linkage is linked to the table-lookup flux linkage, and the table-lookup value can be obtained by adding a fixed value. This helps to shorten the debugging time, and after debugging is completed, accurate parameters can be obtained by using the table-lookup method.
[0036] S4, using a one-dimensional array to look up a table, using Id to look up a one-dimensional data table to obtain Ld, and using Iq to look up a one-dimensional data table to obtain Ld, where Id represents the d-axis current, Iq represents the q-axis current, and Ld represents the d-axis inductance;
[0037] The corresponding inductance parameters are obtained by looking up the table in the one-dimensional array form of Id and Ld, Iq and Lq, and the corresponding torque value is further obtained. The one-dimensional data structure is concise and the accuracy is high, which reduces the debugging workload of testers and greatly shortens the open-loop and closed-loop debugging time, preparing for subsequent automatic testing.
[0038] S5 adopts a method in which fixed values and table lookup values of flux parameters and inductance parameters are selectable. During the debugging process, the fixed parameter method is first used for testing, and then the table lookup method is used. The parameter adjustment is obtained based on the test results, which is conducive to problem finding during the debugging process, shortens the problem finding time, and determines how to adjust the dynamic parameters based on the debugging results.
[0039] Use Control Desk to add a magnetic linkage interface, set up two windows respectively, display the table magnetic linkage while inputting fixed values, and use a fixed two-fold relationship so that the table value can be obtained when a fixed value is given, which is conducive to dynamically adjusting the table coefficient and obtaining the most ideal coefficient result. Edit the .m file through MATALABE, load the relationship between Id and Ld, Iq and Lq into the .m file, use a one-dimensional array to look up the table, use Id to look up the one-dimensional data table to get Ld, and use Iq to look up the one-dimensional data table to get Ld, and the lookup table content does not conflict.
[0040] Fixed value variables are added to the .m file edited by MATALABE and combined with the software model. The fixed values of the flux parameters and inductance parameters and the table lookup values are selectable. During the debugging process, the fixed parameter method is first used for testing, and then the table lookup method is used. The parameters can be adjusted according to the test results.
[0041] S6, using the Ld independent selection method, sets a fixed value Ld during open-loop debugging, and then collects internal variables through INCA to make Ld equal to the INCA internal variable Ld, ensuring that the resolver offset angle is normal to complete the open-loop debugging of Ld.
[0042] Use Ld to add variables independently in the Control Desk. Set a fixed value Ld during open-loop debugging. Then collect internal variables through INCA to make Ld equal to the INCA internal variable Ld. Ensure that the resolver offset angle is normal, which is beneficial for subsequent closed-loop torque debugging and speed debugging.
[0043] In step S6, after the open-loop debugging Ld is completed, the resolver offset angle is fixed as a guarantee of the closed-loop debugging torque, which is conducive to finding the corresponding problem later.
[0044] S7, add a layout interface to the debugging interface, set up the way torque changes over time to obtain the changing trend of torque and speed, and generate an automatic curve.
[0045] In the Control Desk, add a layout interface to the debugging interface, edit the settings to establish how the torque changes over time, get the changing trend of torque and speed, and generate an automatic curve.
[0046] This step uses the method of changing torque and speed over time to obtain the torque change curve and generate an automatic speed torque curve to prevent U / V / W three-phase overcurrent or MCU false alarm of other faults caused by large torque step.
[0047] S8, when adjusting the resolver zero position, set the resolver initial angle Angle_Offset[deg] / Value to 296.4°, so that the motor can obtain the most accurate speed accuracy. During the automatic test, the automatic test case is written through the automatic test software Automation desk, and the automatic test report is generated. The python language is used to program and call the internal calibration and observation of INCA, and the results are automatically output in the report.
[0048] S9, writes automatic test cases through the automatic testing software Automation desk and generates automatic test reports. Uses Python programming to call INCA internal calibration quantities and observation quantities, and displays the results in the report. This can avoid the problem that the hardware-in-the-loop test system cannot connect to the lower version of INCA and operate its internal variables, so that the test report can be obtained smoothly with the help of existing tools during testing.
[0049] S10, respectively adjust the PI parameters of the three speeds of high, medium and low to obtain the best torque parameter combination value, where PI represents proportion and integral. When overcurrent occurs, respectively adjust the PI parameters of the three speeds of high, medium and low to obtain the best parameter combination value to avoid overcurrent caused by a large step size and ensure that the torque accuracy is within a higher range.
Claims
1. A PMSM motor controller hardware-in-the-loop test method, characterized in that: The following steps are involved: S1, U, V, W three-phase temperature, through the simulation voltage channel, adopts the voltage simulation method to achieve, using the corresponding relationship between temperature and voltage, simulate the transmission of temperature signal, temperature simulation through the voltage channel, adopts the table lookup method to obtain different temperatures; S2, the motor temperature adopts the voltage simulation method, obtains the voltage value at different temperatures by looking up the table, and shifts when the first temperature is 50℃ to obtain different voltages, which are transmitted to the main control board to realize the forward transmission of the motor temperature and the measurement and control system; S3, when debugging flux linkage, adding a given fixed flux linkage can obtain the table-lookup flux linkage, and display it in a fixed two-fold relationship, so that the table-lookup value can be obtained when a fixed value is given; S4, using a one-dimensional array to look up a table, using Id to look up a one-dimensional data table to obtain Ld, and using Iq to look up a one-dimensional data table to obtain Ld, where Id represents the d-axis current, Iq represents the q-axis current, and Ld represents the d-axis inductance; S5, adopts the method of selecting fixed values and table lookup values for flux linkage parameters and inductance parameters. During the debugging process, the fixed parameter method is first used for testing, and then the table lookup method is used to determine how to adjust the parameters based on the test results; S6, using the Ld independent selection mode, set a fixed value Ld during open-loop debugging, and then collect internal variables through INCA to make Ld equal to the INCA internal variable Ld, ensuring that the resolver offset angle is normal to complete the open-loop debugging of Ld; S7, add a layout interface to the debugging interface, set up the way the torque changes over time to obtain the changing trend of torque and speed, and generate an automatic curve; S8, when adjusting the resolver zero position, set the resolver offset angle Angle_Offset[deg] / Value to 296.4° so that the motor can obtain the most accurate speed accuracy; S9, write automatic test cases through the automatic test software Automation desk and generate automatic test reports. Use Python programming to call INCA internal calibration and observation quantities, and display the results in the report. S10, adjusting the PI parameters of the three speeds of high, medium and low respectively to obtain the optimal torque parameter combination value, where the PI represents proportion and integral.
2. The PMSM motor controller hardware-in-the-loop testing method according to claim 1, characterized in that: In step S2, the gear is shifted at the first temperature, and after the motor temperature is forwardly transmitted to the measurement and control system, the temperature value variation range is detected in real time during the test, and it is checked whether to shift gears.
3. The PMSM motor controller hardware-in-the-loop testing method according to claim 1, characterized in that: In step S3, after displaying with a fixed two-fold relationship, a programming module is built through Matlab programming to link the fixed flux linkage with the table lookup flux linkage, and the table lookup value can be obtained by adding the fixed value.
4. The PMSM motor controller hardware-in-the-loop testing method according to claim 1, characterized in that: In step S6, after the open-loop debugging Ld is completed, the resolver offset angle is fixed to ensure the closed-loop debugging torque.
Citation Information
Patent Citations
device for simulating, controlling and testing three-phase machines
DE102016109750A1
Method for performing a functional test of an electronic control unit in a hardware-in-the-loop test (HIL test), as well as HIL test bench and electronic control unit
DE102017211433A1