Two-channel motor control system hardware-in-loop simulation method based on saber

By building a simulation model of the motor control system in saber and interacting with external hardware, the code-level verification of the motor control strategy and the synchronization of data flow are achieved, and the problem of disconnection between simulation and actual verification in the existing technology is solved, and the problem of improvement of the disconnection between simulation and actual verification is improved. Simulation efficiency and accuracy.

CN119472328APending Publication Date: 2025-02-18JINCHENG NANJING ELECTROMECHANICAL HYDRAULIC PRESSURE ENG RES CENT AVIATION IND OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411434425.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the simulation and verification process of motor control strategies, code-level verification cannot be achieved in the existing technology, resulting in low code modification efficiency, slow troubleshooting speed, and traditional hardware in-loop simulation testing is complex and expensive.

Method used

Using the hardware in-loop simulation method of dual-channel motor control system based on Saber, the simulation model is built in Saber, and the information interaction with the external hardware is realized by calling the external program interface. The simulation test is carried out in combination with the emulator and code debugging software to achieve code-level verification. Synchronization with data flow.

Benefits of technology

It realizes code-level verification of motor control strategies, simplifies software testing, improves simulation accuracy and accuracy, optimizes simulation and verification processes, and reduces the time and cost of later real physical system testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119472328A_ABST
    Figure CN119472328A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of hardware-in-loop simulation, and particularly relates to a double-channel motor control system hardware-in-loop simulation method based on a saber. A simulation model of the system is built in simulation software saber, information interaction with external hardware is achieved by calling an external program interface, the external hardware conducts simulation testing through a simulator and code debugging software, and the simulation system based on the external hardware in the loop is achieved. Through a hardware-in-the-loop method, code-level verification in a motor control strategy development process is realized, and software testing is simplified. In addition, through combination of simulation software and a controller part, data interaction of multiple pieces of software is achieved through a software interface, circulation of data streams in the simulation software and controller hardware is achieved, the simulation accuracy and precision are improved, the simulation and verification processes are optimized, and simulation and verification are synchronously carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of hardware-in-the-loop simulation, and in particular relates to a hardware-in-the-loop simulation method for a dual-channel motor control system based on Saber. Background Art

[0002] At present, the R&D system of electromechanical system manufacturers at home and abroad is relatively mature, and their design, simulation, verification and other means are relatively complete. The advanced R&D means they adopt, such as IPD integrated product development environment and double V development mode, have played an important role in shortening the product development cycle and improving the overall performance of products. However, there is a lack of effective means for system control strategy simulation. At the beginning of the design, only EDA simulation software is used, and simulation cannot be applied to the entire stage of technology development.

[0003] The simple construction of a simulation model cannot correspond to the actual running code after verifying the control strategy, resulting in low code modification efficiency and slow troubleshooting, which greatly slows down the project development progress.

[0004] Traditional hardware-in-the-loop simulation has a complex testing process and an expensive test platform. It mostly performs system simulation on motor control strategies and cannot complete code-level verification. Therefore, in order to complete code-level verification of motor control strategies in the entire product development and design stage, and to be applicable in software testing and testability evaluation, a dual-channel motor control system hardware-in-the-loop simulation method based on Saber is proposed. Summary of the invention

[0005] The purpose of the present invention is to provide a hardware-in-the-loop simulation method for a dual-channel motor control system based on Saber, build a simulation model of the system in the simulation software Saber, and realize information interaction with external hardware by calling an external program interface. The external hardware is simulated and tested through a simulator and code debugging software to realize a simulation system based on external hardware in the loop.

[0006] Through the hardware-in-the-loop method, code-level verification is achieved during the development of motor control strategies, simplifying software testing. In addition, through the combination of simulation software and controller parts, data interaction between multiple software is achieved through software interfaces, and data flow is realized in simulation software and controller hardware, which improves the accuracy and precision of simulation, optimizes the simulation and verification process, and realizes the synchronization of simulation and verification.

[0007] The technical solution adopted in this application is:

[0008] A dual-channel motor control system hardware-in-the-loop simulation method based on Saber, the steps of implementation include:

[0009] Step 1: To complete the modeling of the entire motor control system, relevant models are established in Saber.

[0010] Step 2: Create a dynamic link library file in Visual Studio to realize the connection of the software interface.

[0011] Step 3: To develop the motor control strategy, the engineering file of the motor control strategy is established on the controller prototype control board based on Code Composer Studio (CCS).

[0012] Step 4: To realize the interaction of data information, an interface file is established in Saber based on the MAST language, and the dynamic link library file generated by Visual Studio is called.

[0013] Step 5: To achieve information interaction with the hardware, the computing chips of the two channels complete information interaction through the communication interface to complete the control of the dual-channel motor. The communication interface here includes CAN, 232, and SPI communication.

[0014] The present invention is also characterized in that:

[0015] In step 1, specifically:

[0016] S101: Build a model in Saber.

[0017] Complete the power supply model in Saber. The power supply model includes Saber's built-in model and self-built model.

[0018] Complete the inverter model in Saber. The inverter model includes a three-phase inverter module and a three-level inverter module.

[0019] Complete the dual-channel motor model in Saber. The dual-motor model can be replaced by other forms of motors, including permanent magnet synchronous motors, brushless DC synchronous motors and asynchronous motors.

[0020] The control unit model is completed in Saber. The control unit model includes a digital signal processor (DSP) and a field programmable gate array (FPGA).

[0021] Complete the construction of other models in Saber. Other models include sampling model, temperature calculation model, and logic control model.

[0022] In step 2, specifically:

[0023] S102: Create a dynamic link library file in Visual Studio.

[0024] The dynamic link library file created in Visual Studio completes the programming of the interface with Saber, and at the same time completes the interface programming with external hardware for information interaction. The information interaction method is usually a communication method, which includes CAN communication, 232 communication, and 422 communication.

[0025] In step 3, specifically:

[0026] S103: Create a motor control project file in CCS.

[0027] Depending on the selected device, different development software can be selected. In one embodiment, CCS software is selected to complete the motor control engineering file. The software writing of the motor control strategy is completed, which is consistent with the actual running software code, and an interface program for interacting with the dynamic link library is added. Here, the selected devices include DSP and FPGA.

[0028] In step 4, specifically:

[0029] S104: Call the dynamic link library file in Saber to interact with the motor control project file of CCS.

[0030] After completing the interface writing of multiple software, the call to the dynamic link library can be completed in Saber based on the MAST language, the motor control engineering file can run in real time, and the hardware-in-the-loop simulation can be completed.

[0031] In step 5, specifically:

[0032] S105: The motor control project files complete interaction through communication.

[0033] In one embodiment of the present application, based on a dual-channel motor control system, the two control channels need to complete information transmission and interaction through communication. Here, communication includes CAN communication, 232 communication, and SPI communication.

[0034] A single-channel motor control system or a multi-channel motor control system using the hardware-in-the-loop simulation method is also applicable.

[0035] Furthermore, before step 1, the computing processing chip used in the dual-channel motor control system of the hardware-in-the-loop simulation method, and the control unit containing the chip should include one or more corresponding CAN communication, 232 communication, and 422 communication interfaces.

[0036] Furthermore, after step 5, the dual-channel motor control system of the hardware-in-the-loop simulation method is constructed, and the motor control system simulation can be started by running the engineering file program and then running the simulation software, without adding other hardware facilities. The correctness of the constructed motor control system based on hardware-in-the-loop is verified by observing the current waveform and fault simulation state generated by the simulation.

[0037] Furthermore, the dynamic link library file described in step 2 realizes information interaction through the communication interface. The speed of information interaction is related to the communication baud rate. In particular, the CAN communication baud rate is increased from 500K to 1000K, which speeds up the information exchange and improves the simulation rate.

[0038] The beneficial effects of the present invention are:

[0039] The described Saber-based dual-channel motor control system hardware-in-the-loop simulation method is also applicable to other control systems involving computing processing chips, not limited to motor control systems, such as flight control systems and power control systems.

[0040] The simulation method based on hardware in the loop can solve the problem of disconnection between simulation and actual verification. The program used for simulation verification is basically similar to the program code actually running, and only a communication interface needs to be added to meet the requirements of hardware in the loop simulation.

[0041] The hardware-in-the-loop-based simulation method can complete the test of the software logic control in advance for different working conditions during software testing for software projects with complex control logic and large amount of code, thereby improving the test efficiency, reducing the test time during the later real physical system testing, and reducing the test cost.

[0042] The hardware-in-the-loop based simulation method can test specific functions during later software troubleshooting, and can inject multiple faults to complete fault simulation, thereby reducing the risk of hardware damage during actual hardware testing.

[0043] The hardware-in-the-loop simulation method has a lower system construction cost and occupies a smaller area than other hardware-in-the-loop systems, thus improving the work efficiency of system verification and saving a lot of hardware costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flowchart of a hardware-in-the-loop simulation method of a dual-channel motor control system based on Saber provided in an embodiment of the present application.

[0045] Figure 2 It is a data flow diagram of the Saber-based dual-channel motor control system hardware-in-the-loop simulation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical scheme and advantages of the implementation of the present invention clearer, the technical scheme in the embodiment of the present invention will be described in more detail in combination with the embodiment of the present invention. In the example, the same or similar reference numerals throughout represent the same or similar originals or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, not all of them. The embodiments described below by reference are exemplary and intended to be used to explain the present invention, and should not be construed as limitations on the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The following is a detailed description in combination with the embodiments of the present invention.

[0047] The present invention is further described in detail below through specific implementation modes.

[0048] Figure 1 The flowchart of the hardware-in-the-loop simulation method of the dual-channel motor control system based on Saber is shown. The method may include the following steps:

[0049] S101: Build a model in Saber.

[0050] Complete the power supply model in Saber. The power supply model includes Saber's built-in model and self-built model.

[0051] Complete the inverter model in Saber. The inverter model includes a three-phase inverter module and a three-level inverter module.

[0052] Complete the dual-channel motor model in Saber. The dual-motor model can be replaced by other forms of motors, including permanent magnet synchronous motors, brushless DC synchronous motors and asynchronous motors.

[0053] The control unit model is completed in Saber. The control unit model includes a digital signal processor (DSP) and a field programmable gate array (FPGA).

[0054] Complete the construction of other models in Saber. Other models include sampling model, temperature calculation model, and logic control model.

[0055] S102: Create a dynamic link library file in Visual Studio.

[0056] The dynamic link library file created in Visual Studio completes the programming of the interface with Saber, and at the same time completes the interface programming with external hardware for information interaction. The information interaction method is usually a communication method, which includes CAN communication, 232 communication, and 422 communication.

[0057] S103: Create a motor control project file in CCS.

[0058] Depending on the selected device, different development software can be selected. In one embodiment, CCS software is selected to complete the motor control engineering file. The software writing of the motor control strategy is completed, which is consistent with the actual running software code, and an interface program for interacting with the dynamic link library is added. Here, the selected devices include DSP and FPGA.

[0059] S104: Call the dynamic link library file in Saber to interact with the motor control project file of CCS.

[0060] After completing the interface writing of multiple software, the call to the dynamic link library can be completed in Saber based on the MAST language, the motor control engineering file can run in real time, and the hardware-in-the-loop simulation can be completed.

[0061] S105: The motor control project files complete interaction through communication.

[0062] In one embodiment of the present application, based on a dual-channel motor control system, the two control channels need to complete information transmission and interaction through communication. Here, communication includes CAN communication, 232 communication, and SPI communication.

[0063] A single-channel motor control system or a multi-channel motor control system using the hardware-in-the-loop simulation method is also applicable.

[0064] Figure 2 The data flow diagram of the hardware-in-the-loop simulation method of the dual-channel motor control system based on Saber is given. The host computer 1 is connected to the control board chip 2 through the communication channel, the host computer 1 is connected to the control chip 3 through the communication channel, and the control chip 2 and the control chip 3 complete the information exchange through the communication channel 7. The interaction with the dynamic link library 5 is completed through the data bus 6. The SABER model 4 completes the real-time simulation of the hardware in the loop by obtaining the information of the dynamic link library 5.

[0065] It is understood by those skilled in the art that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of ordinary technicians in the field to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and unless defined as here, will not be interpreted with idealized or overly formal meanings. The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Within the spirit and principle of the present invention, any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment of equivalent changes for application in other fields, but any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the technical solution content of the present invention, any modification, equivalent replacement, improvement, etc., made according to the technical essence of the present invention, should be included in the protection scope of the present invention.

Claims

1. A dual-channel motor control system hardware-in-the-loop simulation method based on saber, characterized in that: Here are the steps: Step 1: To complete the modeling of the entire motor control system, relevant models are established in Saber respectively; Step 2: Create a dynamic link library file in Visual Studio to connect the software interface. Step 3, to realize the development of the motor control strategy, the engineering file of the motor control strategy is established on the controller prototype control board based on Code Composer Studio, Code Composer Studio is abbreviated as CCS; Step 4: To realize the interaction of data information, an interface file is established in Saber based on the MAST language, and the dynamic link library file generated by VisualStudio is called; Step 5, in order to realize information interaction with the hardware, the computing chips of the two channels complete information interaction through the communication interface to complete the control of the dual-channel motor; the communication interface here includes CAN, 232, and SPI communication.

2. The simulation method according to claim 1, characterized in that: In step 1, specifically: S101: Build a model in Saber; Complete the power supply model in Saber. The power supply model includes Saber's own model and self-built model; Complete the inverter model in Saber. The inverter model includes a three-phase inverter module and a three-level inverter module. Complete the dual-channel motor model in Saber. The dual-motor model can be replaced by other forms of motors, including permanent magnet synchronous motors, brushless DC synchronous motors, and asynchronous motors. Complete the control unit model in Saber; the control unit model includes a digital signal processor DSP and a field programmable gate array FPGA; Complete the construction of other models in Saber; other models include sampling model, temperature calculation model, and logic control model.

3. The simulation method according to claim 2, characterized in that: In step 2, specifically: S102: Create a dynamic link library file in Visual Studio; The dynamic link library file established in Visual Studio completes the programming of the interface with Saber, and at the same time completes the interface programming with external hardware for information interaction; the information interaction method is usually a communication method, which includes CAN communication, 232 communication, and 422 communication.

4. The simulation method according to claim 3, characterized in that: In step 3, specifically: S103: Create motor control engineering files in CCS; Different development software can be selected according to the selected devices; in one embodiment, CCS software is selected to complete the motor control engineering file; the software writing of the motor control strategy is completed, which is consistent with the actual running software code, and an interface program for interaction with the dynamic link library is added; here, the selected devices include DSP and FPGA.

5. The simulation method according to claim 4, characterized in that: In step 4, specifically: S104: Call the dynamic link library file in Saber to interact with the motor control project file of CCS; After completing the interface writing of multiple software, the call to the dynamic link library can be completed in Saber based on the MAST language, the motor control engineering file can run in real time, and the hardware-in-the-loop simulation can be completed.

6. The simulation method according to claim 5, characterized in that: In step 5, specifically: S105: The motor control engineering files complete the interaction through communication; Based on the dual-channel motor control system, the two control channels need to complete information transmission and interaction through communication; here, the communication includes CAN communication, 232 communication, and SPI communication.

7. The simulation method according to claim 6, characterized in that: A single-channel motor control system or a multi-channel motor control system using the hardware-in-the-loop simulation method is also applicable.

8. The simulation method according to claim 7, characterized in that: Furthermore, before step 1, the computing processing chip used in the dual-channel motor control system of the hardware-in-the-loop simulation method, and the control unit containing the chip should include one or more corresponding CAN communication, 232 communication, and 422 communication interfaces.

9. The simulation method according to claim 8, characterized in that: Furthermore, after step 5, the dual-channel motor control system of the hardware-in-the-loop simulation method is constructed, and by running the engineering file program and then running the simulation software, the motor control system simulation can begin without adding other hardware facilities; By observing the current waveform and fault simulation status generated by the simulation, the correctness of the constructed motor control system based on hardware in the loop is verified.

10. The simulation method according to claim 9, characterized in that: The dynamic link library file described in step 2 realizes information interaction through the communication interface. The speed of information interaction is related to the communication baud rate.