Semi-real-time simulation system for engineering machinery controller

By designing a semi-real-time simulation system for engineering machinery controllers, the problems of single communication methods, poor flexibility, high cost and inability to achieve closed-loop control in the existing technology are solved, and a low-cost, safe and reliable controller simulation system is realized, which improves the efficiency and flexibility of prototype design and software control testing.

CN119689888APending Publication Date: 2025-03-25JIANGSU ADVANCED CONSTR MASCH INNOVATION CENT LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411720097.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing simulation systems have problems in the electronic control system of engineering machinery, such as single communication methods, poor flexibility, high cost and inability to achieve closed-loop control of the system, resulting in time-consuming and costly prototype design and software control testing programs.

Method used

A semi-real-time simulation system for engineering machinery controllers is designed, including modeling support module, adaptive packaging and unpacking module for communication packets, automatic code integration, compilation, download tool chain, target controller operation control and monitoring module and prototype design module. Through these modules, various communication methods and system closed-loop control between the monitoring host and the target controller are realized.

Benefits of technology

It realizes a low-cost, safe and reliable controller semi-real-time simulation system, which can quickly produce engineering machinery controller prototypes, reduces the time and cost of prototype design and software control testing, and improves the flexibility and closed-loop control capabilities of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119689888A_ABST
    Figure CN119689888A_ABST
Patent Text Reader

Abstract

The invention discloses a semi-real-time simulation system for an engineering machinery controller. Information interaction between a monitoring host and a target controller is realized through network communication or serial port communication or CAN communication and a communication protocol stack. And realizing automatic integration, compiling and downloading of model generation codes through a series of M scripts and. Bat scripts. Operation control and monitoring of the controller are realized through a series of model callback, module callback scripts and a data display module. The simulation system almost does not need to be supported by peripheral equipment, the cost is low, the environment is convenient to build, and model verification can be efficiently carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a semi-real-time simulation system for an engineering machinery controller, belonging to the technical field of engineering machinery simulation. Background Art

[0002] As the complexity of digital control algorithms used in construction machinery electronic control systems continues to increase, prototyping and software control testing procedures are becoming more time consuming and costly.

[0003] The existing simulation system can only monitor the information exchange between the host and the target controller through the CAN card. The communication method is single and the flexibility is poor. It needs to use the signal acquisition board to collect data, which is costly. It does not have the function of operating control and monitoring the target controller, and cannot complete the closed-loop control of the system.

[0004] Therefore, in order to shorten the time to market and improve software quality assurance to the greatest extent, those skilled in the art urgently need to improve the existing controller simulation system. Summary of the invention

[0005] Purpose: In order to overcome the deficiencies in the prior art, the present invention provides a semi-real-time simulation system for an engineering machinery controller, and proposes a low-cost, safe and reliable controller semi-real-time simulation system for rapid production of engineering machinery controller prototypes.

[0006] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A semi-real-time simulation system for an engineering machinery controller comprises: a modeling support module, a communication message adaptive packing and unpacking module, an automatic code integration, compilation and downloading tool chain, a target controller operation control and monitoring module, and a prototype design module.

[0008] The modeling support module is used to provide parameter support for building a monitoring host model and a target controller model, so as to realize the communication parameter modification, communication transceiver function and communication protocol stack integration between the monitoring host and the target controller through a CAN card, a serial port card or a network card.

[0009] The communication message adaptive packaging and unpacking module is used to perform adaptive design and data conversion of communication messages according to the number and type of signals of the target controller model to be tested.

[0010] The automatic code integration, compilation and downloading tool chain is used to realize the functions of automatic integration, compilation, linking, generation of executable files and downloading of generated code and underlying code.

[0011] The target controller operation control and monitoring module is used to implement the operation control and monitoring of the target controller, including starting, pausing, resetting, time monitoring and data monitoring of the target controller to be tested.

[0012] The prototype design module includes: a target controller model and a monitoring host model.

[0013] As a preferred solution, the target controller model is used for communication driver initialization configuration. When communication is successfully received, the data unpacked according to the protocol is transmitted to the input interface of the target controller to be tested. After the operation of the target controller to be tested is completed, the data is output and the completion time of the operation is recorded. The output data is parsed according to the protocol and uploaded to the monitoring host model through the communication module for processing.

[0014] The monitoring host model is used for initialization configuration of the communication driver, and its configuration parameters are consistent with the processor model. Data is output through the peripheral model or the test data sequence is injected, and it is packaged according to the protocol and sent to the target controller to be tested. At the same time, the communication data from the target controller to be tested is received, and the communication data is connected to the message unpacking module for signal analysis. It is loaded onto the target controller model, and the output is run through the processor and the monitoring function to realize data display and comparison.

[0015] As a preferred solution, the parameters supported include but are not limited to:

[0016] A module library that supports configuration of CAN communication, serial communication or network communication parameters of the monitoring host.

[0017] A library of modules that support CAN communication, serial communication or network communication modules of the target controller.

[0018] A library of modules that support communication modules for other processors.

[0019] As a preferred solution, the CAN communication includes: CAN communication of PCAN, KVASER or CANOE.

[0020] As a preferred solution, the module library is produced by using Legacy Code Tool and then packaged by MASK.

[0021] As a preferred solution, since the number and type of signal interfaces of the target controller model to be tested in Simulink vary, a module that can automatically adjust the communication protocol according to the model signal interface must be designed. The adaptive design of communication messages and data conversion specifically include:

[0022] Call the Simulink M script to obtain the serial number and type of the input and output interfaces of the current target controller model to be tested.

[0023] Generate signal packing and unpacking modules according to the serial number and type of the input and output interfaces.

[0024] The monitoring host model and the target controller model implement communication message parsing through signal packing and unpacking modules.

[0025] As a preferred solution, the automatic code integration, compilation, and download tool chain specifically includes:

[0026] After the Simulink code is generated, the script is called to realize the automatic integration of the application layer program and the underlying program, wherein the automatic integration includes integrating the generated algorithm function into the communication callback function for triggering the function call of the underlying program.

[0027] Implement commands for automatically compiling, downloading, and generating executable files.

[0028] The corresponding compilation and download information is output to the MATLAB diagnostic window to facilitate users to view and troubleshoot problems.

[0029] As a preferred solution, the script is used to obtain the IDE (programming environment and integrated development environment) or compiler path, add the compiler path to the system environment variables, and add the environment variables required by the Simulink toolbox to Matlab.

[0030] As a preferred solution, the time monitoring of the target controller to be tested includes: triggering the operation of the target controller to be tested after communication is received, recording the tick of the system timer at this time, waiting for the target controller to be tested to complete execution, and then recording the tick of the system timer again, taking the difference between the two moments to obtain the running time of the target controller to be tested, and uploading the running time of the target controller to be tested and the output data of the target controller to be tested to the monitoring host according to the protocol.

[0031] As a preferred solution, the data monitoring of the target controller to be tested includes: using the oscilloscope and signal analyzer modules of Simulink for real-time comparison, analysis and display, storing the data to be measured in real time in the workspace, and performing data graphics drawing and data differential comparison output by stopping callback.

[0032] Beneficial effects: The semi-real-time simulation system for engineering machinery controller provided by the present invention realizes information interaction between the monitoring host and the target controller through network communication, serial communication, CAN communication and communication protocol stack. The automatic integration, compilation and download of model generation code are realized through a series of M scripts and .bat scripts. The operation control and monitoring of the controller are realized through a series of model callbacks, module callback scripts and data display modules. The system requires almost no peripheral equipment support, is low-cost, and is easy to build an environment, and can efficiently verify the model.

[0033] Compared with the prior art, the present invention has the following advantages:

[0034] The present invention can utilize the modeling support module to quickly build a simulation environment and a model.

[0035] The present invention can realize automatic code integration, compilation and downloading of a target controller.

[0036] The present invention can realize flexible adjustment of the packing and unpacking of communication messages according to the interface of the model to be tested.

[0037] The present invention can realize the control and monitoring of the target controller. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the architecture of the semi-real-time simulation system of the engineering machinery controller of the present invention.

[0039] Figure 2 It is a schematic diagram of the interaction of the semi-real-time simulation system for the engineering machinery controller of the present invention.

[0040] Figure 3 It is a schematic diagram of the operating hardware architecture of the semi-real-time simulation system for the engineering machinery controller of the present invention. DETAILED DESCRIPTION

[0041] The following is a clear and complete description of the technical solutions in the examples of the present invention in conjunction with the accompanying drawings in the examples of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the protection scope of the present invention.

[0042] The present invention will be further described below in conjunction with specific embodiments.

[0043] Example 1

[0044] This embodiment introduces a semi-real-time simulation system for a construction machinery controller. Figure 1 As shown, it includes: modeling support module, communication message adaptive packaging and unpacking module, automatic code integration, compilation, and download tool chain, target controller operation control and monitoring module, and prototype design module.

[0045] The modeling support module is used to provide parameter support for building a monitoring host model and a target controller model, so as to realize the communication parameter modification, communication transceiver function and communication protocol stack integration between the monitoring host and the target controller through a CAN card, a serial port card or a network card.

[0046] Furthermore, the parameters supported include but are not limited to:

[0047] A module library that supports configuration of CAN communication, serial communication or network communication parameters of the monitoring host.

[0048] A library of modules that support CAN communication, serial communication or network communication modules of the target controller.

[0049] A library of modules that support communication modules for other processors.

[0050] Furthermore, the CAN communication includes: CAN communication of PCAN, KVASER or CANOE.

[0051] Furthermore, the module library is produced by using the Legacy Code Tool and is packaged by using MASK after production.

[0052] The communication message adaptive packaging and unpacking module is used to perform adaptive design and data conversion of communication messages according to the number and type of signals of the target controller model to be tested.

[0053] Furthermore, since the number and type of signal interfaces of the target controller model to be tested in Simulink vary, a module that can automatically adjust the communication protocol according to the model signal interface must be designed. The adaptive design of communication messages and data conversion specifically include:

[0054] Call the Simulink M script to obtain the serial number and type of the input and output interfaces of the current target controller model to be tested.

[0055] Generate signal packing and unpacking modules according to the serial number and type of the input and output interfaces.

[0056] The monitoring host model and the target controller model implement communication message parsing through signal packing and unpacking modules.

[0057] The automatic code integration, compilation and downloading tool chain is used to realize the functions of automatic integration, compilation, linking, generation of executable files and downloading of generated code and underlying code.

[0058] Furthermore, the automatic code integration, compilation, and downloading tool chain specifically includes:

[0059] After the Simulink code is generated, the script is called to realize the automatic integration of the application layer program and the underlying program, wherein the automatic integration includes integrating the generated algorithm function into the communication callback function for triggering the function call of the underlying program.

[0060] Implement commands for automatically compiling, downloading, and generating executable files.

[0061] The corresponding compilation and download information is output to the MATLAB diagnostic window to facilitate users to view and troubleshoot problems.

[0062] Furthermore, the script is used to obtain the IDE (programming environment and integrated development environment) or compiler path, add the compiler path to the system environment variables, and add the environment variables required by the simulink toolbox to matlab.

[0063] The target controller operation control and monitoring module is used to implement the operation control and monitoring of the target controller, including starting, pausing, resetting, time monitoring and data monitoring of the target controller to be tested.

[0064] Furthermore, the time monitoring of the target controller to be tested includes: triggering the operation of the target controller to be tested after communication is received, recording the tick of the system timer at this time, waiting for the target controller to be tested to complete execution, and then recording the tick of the system timer again, calculating the difference between the two moments, obtaining the running time of the target controller to be tested, and uploading the running time of the target controller to be tested and the output data of the target controller to be tested to the monitoring host according to the protocol.

[0065] Furthermore, the data monitoring of the target controller to be tested includes: using the oscilloscope and signal analyzer modules of Simulink to perform real-time comparison analysis and display, storing the data to be measured in the workspace in real time, and performing data graphics drawing and data differential comparison output by stopping callback.

[0066] The prototype design module, such as Figure 2 As shown, it includes: target controller model and monitoring host model.

[0067] The target controller model is used for communication driver initialization configuration. When communication is successfully received, the data after unpacking according to the protocol is transmitted to the input interface of the target controller to be tested. After the target controller to be tested completes operation, it outputs data and records the time of completion of the operation. After the output data is parsed according to the protocol, it is uploaded to the monitoring host model through the communication module for processing.

[0068] The monitoring host model is used for initialization configuration of the communication driver, and its configuration parameters are consistent with the processor model. Data is output through the peripheral model or the test data sequence is injected, and it is packaged according to the protocol and sent to the target controller to be tested. At the same time, the communication data from the target controller to be tested is received, and the communication data is connected to the message unpacking module for signal analysis. It is loaded onto the target controller model, and the output is run through the processor and the monitoring function to realize data display and comparison.

[0069] Embodiment 2:

[0070] like Figure 3As shown, the semi-real-time simulation system of the engineering machinery controller of the present invention runs in the equipment of the monitoring host, and communicates with the target controller to be tested through the communication driver card, which can verify the consistency of the algorithm execution of the target controller to be tested on the computer and the processor, and check the possible problems of the target compiler. At the same time, it has the functions of controller operation control and data monitoring, which is convenient for users to optimize the model algorithm. In addition, the input and output of the physical object model can also be connected to realize the closed loop between the controller and the physical model.

[0071] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A semi-real-time simulation system for engineering machinery controller, characterized in that: include: Modeling support module, communication message adaptive packaging and unpacking module, automatic code integration, compilation, and download tool chain, target controller operation control and monitoring module, and prototype design module; The modeling support module is used to provide parameter support for building a monitoring host model and a target controller model, so as to realize the communication parameter modification, communication transceiver function and communication protocol stack integration between the monitoring host and the target controller through a CAN card, a serial port card or a network card; The communication message adaptive packaging and unpacking module is used to perform adaptive design and data conversion of communication messages according to the number and type of signals of the target controller model to be tested; The automatic code integration, compilation and downloading tool chain is used to realize the functions of automatic integration, compilation, linking, generation of executable files and downloading of generated code and underlying code; The target controller operation control and monitoring module is used to realize the operation control and monitoring of the target controller, including starting, pausing, resetting, time monitoring and data monitoring of the target controller to be tested; The prototype design module includes: a target controller model and a monitoring host model.

2. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The target controller model is used for initialization configuration of the communication driver. After successful communication reception, the data after unpacking according to the protocol is transmitted to the input interface of the target controller to be tested. After the target controller to be tested is completed, the data is output and the completion time of the operation is recorded. After the output data is parsed according to the protocol, it is uploaded to the monitoring host model through the communication module for processing; The monitoring host model is used for initializing the communication driver configuration, and its configuration parameters are consistent with the processor model; output data or inject test data sequence through the peripheral model, and send it to the target controller to be tested after packaging according to the protocol; at the same time, receive the communication data from the target controller to be tested, and access the communication data to the message unpacking module for signal analysis; and load it to the target controller model, and output it through the processor operation and monitoring function to realize data display and comparison.

3. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The parameters supported include but are not limited to: A module library that supports configuration of CAN communication, serial communication or network communication parameters of the monitoring host; Module library supporting CAN communication, serial communication or network communication modules of the target controller; A library of modules that support communication modules for other processors.

4. The semi-real-time simulation system for engineering machinery controller according to claim 3 is characterized in that: The CAN communication includes: CAN communication of PCAN, KVASER or CANOE.

5. The semi-real-time simulation system for engineering machinery controller according to claim 3 is characterized in that: The module library is produced by using the Legacy Code Tool and is packaged by using MASK after production.

6. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The adaptive design and data conversion of communication messages specifically include: Call the Simulink M script to obtain the serial number and type of the input and output interfaces of the current target controller model to be tested; Generate signal packing and unpacking modules according to the serial number and type of input and output interfaces; The monitoring host model and the target controller model implement communication message parsing through signal packing and unpacking modules.

7. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The automatic code integration, compilation, and downloading tool chain specifically includes: After the Simulink code is generated, the script is called to realize the automatic integration of the application layer program and the underlying program. The automatic integration includes integrating the generated algorithm function into the communication callback function for triggering the function call of the underlying program. Implement commands for automatically compiling, downloading, and generating executable files; The corresponding compilation and download information is output to the MATLAB diagnostic window to facilitate users to view and troubleshoot problems.

8. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The script is used to obtain the IDE or compiler path, add the compiler path to the system environment variables, and add the environment variables required by the Simulink toolbox to MATLAB.

9. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The time monitoring of the target controller to be tested includes: triggering the operation of the target controller to be tested after receiving communication, recording the tick of the system timer at this time, waiting for the target controller to be tested to complete execution, and then recording the tick of the system timer again, calculating the difference between the two moments, obtaining the running time of the target controller to be tested, and uploading the running time of the target controller to be tested and the output data of the target controller to be tested to the monitoring host according to the protocol.

10. The semi-real-time simulation system for engineering machinery controller according to claim 1, characterized in that: The data monitoring of the target controller to be tested includes: using the oscilloscope and signal analyzer modules of Simulink to perform real-time comparison, analysis and display, storing the data to be measured in real time in the work area, and performing data graphics drawing and data differential comparison output by stopping callback.