Motor control system test method based on semi-physical simulation

Through the semi-physical simulation method, combined with motor test bench and software simulation, the problems of high cost and low efficiency in motor control testing are solved, and high-precision simulation of complex working conditions and rapid optimization are achieved.

CN120669559APending Publication Date: 2025-09-19NORTH CHINA UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510873689.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing motor control testing technologies have problems such as high cost, low efficiency and poor accuracy. Pure software simulation cannot truly simulate complex working conditions, and the hardware testing platform has limited functions and is prone to human errors.

Method used

Using a hardware-in-the-loop simulation approach, by building a motor test bench, deploying real motor controllers and sensors, and combining MATLAB/Simulink and CarMaker software, a motor control algorithm model is constructed to achieve real-time interaction and data monitoring between the motor and load, simulating motor performance under complex working conditions.

Benefits of technology

It improves the accuracy and efficiency of motor control testing, reduces R&D costs, can truly simulate the operating status of the motor under complex working conditions, reduce human errors, and shorten the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120669559A_ABST
    Figure CN120669559A_ABST
Patent Text Reader

Abstract

The invention discloses a motor control system test method based on semi-physical simulation. The method comprises the following steps: step 1, designing a motor twin-trawling rack structure; step 2, quickly controlling prototype construction; 3, building a motor control algorithm model and deploying an algorithm; 4, building an electric vehicle simulation platform of the real-time simulation machine; 5, parameter adjustment and data monitoring are carried out, and actually measured data and expected indexes are compared; 6, repeating the above steps, and carrying out iterative verification; the system is simple in structure and convenient to use, optimized C codes or embedded codes can be automatically generated through graphical configuration, one-key generation of codes capable of being deployed to a real controller is supported, and the development cycle and human errors are reduced; the high-precision motor-load joint model is operated through the real-time simulation machine, the real twin-trawling working condition is simulated in a closed-loop mode through pure electric signals, the problems of high cost, poor effect, inconvenient use and the like can be solved, meanwhile, the working state in a real scene can be simulated, the motor operation working condition can be simulated more truly, the test precision and efficiency are improved, and the research and development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor control testing, in particular to a motor control system testing method based on hardware-in-the-loop simulation. Background Art

[0002] Currently, the most common methods for motor control testing are pure software simulation testing and simple hardware testing platforms. Pure software simulation testing primarily involves running specialized simulation software on a computer to build a mathematical model of the motor control system for simulation testing. This involves using a module library to build a model of the motor and its control system, setting different operating parameters to simulate the motor's operating state, and performing preliminary verification of the control algorithm. Simple hardware testing platforms typically consist of only a motor, a simple drive circuit, and basic sensors such as a torque sensor and tachometer. By manually adjusting the drive circuit parameters to drive the motor, measuring instruments are used to read the motor's operating parameters, such as voltage, current, and speed, to evaluate the performance of the motor control system.

[0003] Disadvantages of existing technical solutions: 1. Pure software simulation testing: Because it cannot reflect the influence of actual physical factors, motor control systems designed based on pure software simulation often require redesign and retesting if they fail to achieve the expected performance in actual applications. This prolongs the R&D cycle and significantly increases labor and material costs. Furthermore, there is a significant gap between the simulation environment and reality. In actual application scenarios, the complex operating conditions faced by motor control systems are difficult to fully simulate using pure software simulation, resulting in a lack of practical application of the simulation results.

[0004] 2. Hardware Test Platform: Testing capabilities are limited to basic parameter measurements, making it impossible to fully evaluate the performance of motor control systems under complex operating conditions. This makes it difficult to identify potential issues that may arise during actual operation, and therefore fails to meet the requirements for developing high-performance motor control systems. The testing process requires manual parameter adjustment and data reading, which is not only cumbersome but also prone to human error. The accuracy and real-time nature of data acquisition and analysis are difficult to guarantee, severely impacting test efficiency and accuracy, hindering the rapid development and optimization of motor control systems.

[0005] The above-mentioned prior art has problems such as high cost, poor effect, and inconvenience in use. Summary of the Invention

[0006] The technical problem to be solved by the present invention is to provide a motor control system testing method based on semi-physical simulation, which can effectively solve the problems raised in the above background technology.

[0007] To solve the above problems, the technical solution adopted by the present invention is: a motor control system testing method based on semi-physical simulation, comprising the following steps: Step 1: Design the motor test bench structure, deploy the real motor controller, signal conditioning module and sensor group, establish the communication protocol between the MCU and X86 platform, and complete the communication protocol signal channel self-test; Step 2: Build a rapid control prototype based on the MCU and X86 platform. Automatically generate C code for the motor control algorithm through graphical configuration, implement ADC / DAC signal acquisition and output logic design, and encapsulate the permanent magnet synchronous motor FOC control interface. Step 3: Build a motor control algorithm model in the MATLAB / Simulink environment, including the speed / current dual closed-loop control module, Clark / Park transform module, and SVPWM module. Use the code generation toolchain to compile the model into an executable file and deploy it to the hardware platform. Step 4: Use CarMaker software to build an electric vehicle dynamics model, simulate the motor load signal under real vehicle conditions, and implement closed-loop interaction between the virtual load and the real controller through a real-time simulator. Step 5: Establish a network connection between the host computer and the simulation platform, configure Simulink external mode parameters, adjust the motor control parameters in real time through the XCP protocol, and monitor operating data including speed, current, and torque; Step 6: Verify the performance of the control algorithm under actual driving conditions through iterative verification of complex operating scenarios, and evaluate the performance of the control algorithm by comparing the measured data with the expected indicators.

[0008] As a further preferred embodiment of the present invention, the rapid control prototype construction in step 2 includes: (a) Design MCU and X86 drive solutions for motors, including ADC / DAC; (b) Implement data acquisition and conversion logic to ensure that signal conversion accuracy and rate meet simulation requirements; (c) Based on different interface packages of MCU and X86 solutions, it is used for FOC control of permanent magnet synchronous motors; (d) Use the rtw model compilation process to generate a C code project, which is then compiled into an executable file after being linked with the TMF template.

[0009] As a further preferred embodiment of the present invention, the construction of the algorithm model in step 3 includes: (a) Establish an offline simulation model of a permanent magnet synchronous motor based on the MATLAB / Simulink motor object library; (b) Add CAN / CANFD communication interface module to realize signal interaction with vehicle controller; (c) After verifying the convergence of the control algorithm through model-in-the-loop testing, the target code is generated and deployed to the MCU.

[0010] As a further preferred embodiment of the present invention, the real-time simulation implementation in step 4 includes: (a) Build a co-simulation vehicle model in CarMaker that includes the motor, transmission system, and vehicle dynamics; (b) Add a control algorithm model based on the vehicle model, use the vehicle motor load signal to control the motor, and treat the motor as a load motor; (c) Compile and download the vehicle model to the X86 real-time simulator.

[0011] As a further preferred embodiment of the present invention, the step five further comprises: (a) Configure Simulink external mode parameters, XCP protocol, and communication port; (b) Change motor control parameters in real time through the Simulink interface and obtain motor signals; (c) Analyze motor data and evaluate motor control performance: motor speed and current response dynamic response effect, torque output effect.

[0012] As a further preferred embodiment of the present invention, the complex operating scenario in step six includes a load mutation scenario when the new energy vehicle is driving on a rough road, and the stability of the motor speed and torque output is verified through iteration.

[0013] Compared with the prior art, the present invention provides a motor control system testing method based on semi-physical simulation, which has the following beneficial effects: The present invention has a simple structure and is easy to use. It can automatically generate optimized C code or embedded code through graphical configuration, and supports one-click generation of code that can be deployed to a real controller, reducing development cycle and human errors. It runs a high-precision motor-load joint model (such as dynamic load curve and mechanical inertia simulation) on a real-time simulator, and simulates the real towing working condition with a pure electric signal closed loop, which can solve the problems of high cost, poor effect, and inconvenience in use. At the same time, it can simulate the working state in the real scene, simulate the motor operating condition more realistically, improve test accuracy and efficiency, and reduce R&D costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 Schematic diagram of the working method of the present invention; Figure 2 This is a schematic diagram of the overall framework simulation of the present invention; Figure 3 Schematic diagram of the FOC control framework of the permanent magnet synchronous motor of the present invention; DETAILED DESCRIPTION

[0015] It should be noted that if "and / or" or "and / or" appears in the full text, its meaning includes three parallel options. Taking "A and / or B" as an example, it includes option A, or option B, or options in which A and B are met at the same time.

[0016] In addition, the embodiments are based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0017] Reference Figure 1-3 The present invention provides a motor control system testing method based on semi-physical simulation, comprising: Step 1: Motor test bench construction includes test bench design, motor selection, and hardware deployment. The test bench then starts the controller and motor control system, connects the actual motor controller, signal conditioning module, and sensor group, and completes a self-test of the communication protocol signal channel. Step 2: Rapid control prototype controller design involves the development of a target controller and a code generation tool chain. This allows for automatic code generation for the target lower computer. The motor algorithm development can be done using a model. This includes: 1. Design MCU and X86 drive solutions for motors, including ADC / DAC; 2. Implement data acquisition and conversion logic to ensure that signal conversion accuracy and rate meet simulation requirements; 3. Based on different interface packages of MCU and X86 solutions, it is used for permanent magnet synchronous motor FOC control implementation (reference Figure 3 ); The code generation process for MCU and X86 platform designs is as follows: The motor control model undergoes the rtw model compilation process, generating a .rtw model TLC system target file. The TLC target file then executes the .tlc file to convert the rtw file into C code and header files, forming a complete C language project. Finally, using the TMF template binder file to generate a .mk file, the C language project is compiled into an executable file.

[0018] Step 3: Use a high-precision permanent magnet synchronous motor model in the simulation layer to build a FOC algorithm model for the permanent magnet synchronous motor. This allows you to verify and implement various upper-layer control algorithms based on FOC, perform model-in-the-loop testing (MIL), and once control expectations are met, use the rapid control prototyping platform to compile and deploy the implemented motor control algorithm to the hardware platform. This includes: 1. Use the motor object model in MATLAB / Simulink to build an offline motor control model and verify the model control effect; 2. Based on the above model, combined with the ADC / DAC / PWM interfaces in the module library, build a motor control model that can run online.

[0019] 3. Use the tool chain in step 2 to generate a target file from the control model, which can be directly downloaded to the MCU to realize motor control.

[0020] Step 4: The real-time simulator uses CarMaker software, which can simulate various vehicle conditions and body component signals of real electric vehicles under different vehicle conditions. Using this software, the electric vehicle load signal simulates the motor load, enabling the test bench to simulate the load signal of the towing motor, verifying the adaptability and robustness of the drive motor control algorithm. Specifically, this includes: 1. Use CarMaker to build a vehicle dynamics model.

[0021] 2. Based on the above vehicle model, add a control algorithm model, use the vehicle motor load signal to control the motor, and treat the motor as a load motor.

[0022] 3. Based on the above tool chain, compile and download the vehicle model to the x86 real-time simulator.

[0023] Step 5: Parameter adjustment and data monitoring, comparing measured data with expected indicators, performance testing and optimization, specifically including: 1. Establish a network connection between the host and the simulation platform.

[0024] 2. Configure Simulink external mode parameters and specify the XCP protocol and communication port.

[0025] 3. Change motor control parameters in real time through the Simulink interface and obtain motor signals.

[0026] 4. Analyze motor data and evaluate motor control performance: motor speed and current response dynamic response effect, torque output effect.

[0027] Step 6: Adjust model parameters or test cases based on test results and repeat the above steps to cover complex vehicle operating conditions and controller verification. For example, when a new energy vehicle is driving on a rough road or other complex road conditions, the test bench motor output speed and torque are stable when simulating changes in vehicle motor load to verify the performance of the motor controller. As a specific embodiment of the present invention: 1. Use two 600W permanent magnet synchronous motors as the control objects. The two motors are coaxially connected using torque sensors. The motor controller uses MCU (STM32) and X86 industrial computer. After the hardware and motor are built, power on and test them. All components are powered normally. 2. Design the ADC signal acquisition and DAC signal output of the motor controller, and design the ADC and DAC trigger timing based on the motor's 10 kHz frequency. Finally, encapsulate the S-function in MATLAB / Simulink, integrate the ADC / DAC into Simulink, and use MATLAB / Simulink to implement model-generated code that automatically runs on the controller.

[0028] 3. Build a motor control model in Simulink, including modules such as speed loop, current loop, Clark transform, Park change and SVPWM. Use the high-precision motor model in Simulink to verify whether the control model can drive the motor normally. Finally, combine the control model with the module in step 2 to directly generate the target file and run it to the MCU controller to drive the active motor.

[0029] 4. Use CarMaker software to build a vehicle model and operating scenario, use the motor torque signal of the vehicle chassis as the control target of the load motor, and combine it with the motor control model to generate a target file and run it to X86 to drive the load motor.

[0030] 5. After completing the above steps, run the drive motor to control the speed and the load motor to simulate the load torque. Use the development computer to connect to the controller via Ethernet to monitor the actual speed and output torque of the motor.

[0031] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made by using the contents of the present invention description and drawings under the inventive concept of the present invention, or direct / indirect application in other related technical fields are included in the patent protection scope of the present invention.

Claims

1. A motor control system testing method based on hardware-in-the-loop simulation, characterized in that: The following steps are involved: Step 1: Design the motor test bench structure, deploy the real motor controller, signal conditioning module and sensor group, establish the communication protocol between the MCU and X86 platform, and complete the communication protocol signal channel self-test; Step 2: Build a rapid control prototype based on the MCU and X86 platform. Automatically generate C code for the motor control algorithm through graphical configuration, implement ADC / DAC signal acquisition and output logic design, and encapsulate the permanent magnet synchronous motor FOC control interface. Step 3: Build a motor control algorithm model in the MATLAB / Simulink environment, including the speed / current dual closed-loop control module, Clark / Park transform module, and SVPWM module. Use the code generation toolchain to compile the model into an executable file and deploy it to the hardware platform. Step 4: Use CarMaker software to build an electric vehicle dynamics model, simulate the motor load signal under real vehicle conditions, and implement closed-loop interaction between the virtual load and the real controller through a real-time simulator. Step 5: Establish a network connection between the host computer and the simulation platform, configure Simulink external mode parameters, adjust the motor control parameters in real time through the XCP protocol, and monitor operating data including speed, current, and torque; Step 6: Verify the performance of the control algorithm under actual driving conditions through iterative verification of complex operating scenarios, and evaluate the performance of the control algorithm by comparing the measured data with the expected indicators.

2. The motor control system testing method based on hardware-in-the-loop simulation according to claim 1, characterized in that: The rapid control prototype construction in step 2 includes: (a) Design MCU and X86 drive solutions for motors, including ADC / DAC; (b) Implement data acquisition and conversion logic to ensure that signal conversion accuracy and rate meet simulation requirements; (c) Based on different interface packages of MCU and X86 solutions, it is used for FOC control of permanent magnet synchronous motors; (d) Use the rtw model compilation process to generate a C code project, which is then compiled into an executable file after being linked with the TMF template.

3. The motor control system testing method based on hardware-in-the-loop simulation according to claim 1, characterized in that: The construction of the algorithm model in step 3 includes: (a) Establish an offline simulation model of a permanent magnet synchronous motor based on the MATLAB / Simulink motor object library; (b) Add CAN / CANFD communication interface module to realize signal interaction with vehicle controller; (c) After verifying the convergence of the control algorithm through model-in-the-loop testing, the target code is generated and deployed to the MCU.

4. The motor control system testing method based on hardware-in-the-loop simulation according to claim 1, characterized in that: The real-time simulation implementation in step 4 includes: (a) Build a co-simulation vehicle model in CarMaker that includes the motor, transmission system, and vehicle dynamics; (b) Add a control algorithm model based on the vehicle model, use the vehicle motor load signal to control the motor, and treat the motor as a load motor; (c) Compile and download the vehicle model to the X86 real-time simulator.

5. The motor control system testing method based on hardware-in-the-loop simulation according to claim 1, characterized in that: The step five further includes: (a) Configure Simulink external mode parameters, XCP protocol, and communication port; (b) Change motor control parameters in real time through the Simulink interface and obtain motor signals; (c) Analyze motor data and evaluate motor control performance: motor speed and current response dynamic response effect, torque output effect.

6. The motor control system testing method based on hardware-in-the-loop simulation according to claim 1, characterized in that: The complex operating scenario in step six includes a sudden load change scenario when the new energy vehicle is driving on a rough road, and the stability of the motor speed and torque output is verified through iteration.