WO2023178723A1 - Simulation control platform based on model development, and loading handover test method - Google Patents

Simulation control platform based on model development, and loading handover test method Download PDF

Info

Publication number
WO2023178723A1
WO2023178723A1 PCT/CN2022/084038 CN2022084038W WO2023178723A1 WO 2023178723 A1 WO2023178723 A1 WO 2023178723A1 CN 2022084038 W CN2022084038 W CN 2022084038W WO 2023178723 A1 WO2023178723 A1 WO 2023178723A1
Authority
WO
WIPO (PCT)
Prior art keywords
computer module
module
lower computer
data
handover
Prior art date
Application number
PCT/CN2022/084038
Other languages
French (fr)
Chinese (zh)
Inventor
杜文豪
Original Assignee
上海御微半导体技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海御微半导体技术有限公司 filed Critical 上海御微半导体技术有限公司
Publication of WO2023178723A1 publication Critical patent/WO2023178723A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B17/00Systems involving the use of models or simulators of said systems
    • G05B17/02Systems involving the use of models or simulators of said systems electric

Definitions

  • the invention relates to the technical field of electromechanical system equipment, and in particular to a simulation control platform based on model development and a material loading and handover test method.
  • precision control is particularly important in the semiconductor industry or the medical device industry.
  • the development of a set of precision instruments requires the coordination and unification of multiple disciplines in optics, mechanics, electronics, control, and software.
  • the development process includes requirement identification, design, material input, testing, optimized design, and launch.
  • model-based development only designs and develops core algorithms or functional logic, then generates code and integrates it into manual code, generates executable files, and burns them into the control board for debugging.
  • model-based development has been relatively mature for various vehicle subsystems, such as automatic power steering systems, lane departure warning systems, etc.
  • commercial software such as Carsim, Trucksim
  • there is already mature commercial software such as Carsim, Trucksim
  • the use of model-based development is relatively simple and superficial, and no development tool chain has been formed.
  • matlab/simulink is only It is limited to the simulation and analysis of control algorithms and the use of toolboxes for data analysis.
  • the purpose of the present invention is to provide a simulation control platform and a loading and handover test method based on model development.
  • system modeling of the control object is realized to complete system-level testing and simulation, and improve Improve development efficiency.
  • the simulation control platform based on model development of the present invention includes a host computer module, a process logic conversion module, a lower computer module and a virtual object module that are communicated in sequence, wherein the host computer module is To communicate with the lower computer module, the lower computer module is used to generate motion firmware that can be executed by the virtual object module.
  • the virtual object module is used to model and design the target control object.
  • the process logic The conversion module is used to logically convert the processes in the lower computer module to unify the timing in the lower computer module and the upper computer module.
  • the beneficial effect of the simulation control platform based on model development of the present invention is that: the simulation control platform is composed of a host computer module, a process logic conversion module, a lower computer module and a virtual object module, and the nonlinear hardware is linearly modeled to realize Control objects perform system modeling to complete system-level testing and simulation through the simulation control platform, which not only reduces coding work and technical complexity, but also allows developers to focus on functionality and performance, further improving product competition. Powerful, and can run the entire machine software separately from the physical object, decouple software and hardware, and improve maintainability and inheritance.
  • the process logic conversion module includes at least one of a blocking state switching unit, a periodic interrupt unit, a process switching unit and a priority switching unit.
  • the blocking state switching unit is used to convert the blocking state in the lower computer module to The state process is switched to a non-blocking state process
  • the periodic interrupt unit is used to convert the multi-period interrupt task in the lower computer module into a time slice polling task
  • the process switching unit is used to convert the lower computer module to a polling task.
  • Some multi-process diagnostic tasks in the lower computer module are switched to single-process diagnostic tasks; the priority switching unit is used to adjust the priority and task scheduling of some processes in the lower computer module.
  • the blocking state switching unit includes at least one of a timeout conversion subunit and an asynchronous switching subunit.
  • the timeout switching subunit is used to set a timeout time for the blocking state process in the lower computer module, and in After waiting for the timeout period and no valid data is received, switch from the current process to execute other processes; the asynchronous switching subunit is used to switch the synchronous command processing mechanism in the communication process to an asynchronous command processing mechanism to achieve Parallel processing of multiple commands.
  • the motion firmware generated in the lower computer module includes a hardware diagnostic process, which includes queue processing tasks, communication tasks, control algorithms, diagnostic tasks and command processing tasks, and the periodic interrupt unit is used to The queue processing task, the communication task, the control algorithm, the diagnostic task and the command processing task are executed according to a polling mechanism.
  • a hardware diagnostic process which includes queue processing tasks, communication tasks, control algorithms, diagnostic tasks and command processing tasks, and the periodic interrupt unit is used to The queue processing task, the communication task, the control algorithm, the diagnostic task and the command processing task are executed according to a polling mechanism.
  • the periodic interrupt unit expands the cache of the queue processing task and sets timeout logic for the communication task.
  • the diagnostic tasks include chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks.
  • the process switching unit switches the chip-level diagnostic subtasks, the board-level diagnostic subtasks, and the board-level diagnostic subtasks.
  • the level diagnosis subtask, the component level diagnosis subtask and the system level diagnosis subtask are executed in the same cycle to locate the fault location and fault time.
  • the priority switching unit switches the tasks of different priorities of some processes in the lower computer module to a unified priority, and switches preemptive task scheduling to non-preemptive task scheduling.
  • the invention also discloses a loading and handover test method, which uses the above-mentioned simulation control platform based on model development for testing.
  • the loading and handover test method includes:
  • the lower computer module uses the first environment data to indicate the presence of materials at the handover position, it notifies the upper computer module;
  • the lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position
  • the upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position to complete the loading test process.
  • the beneficial effect of the loading and handover testing method of the present invention is that the loading and handover testing method is executed through the above-mentioned simulation control platform based on model development, and the entire testing process can be completed only by the cooperation of the upper computer module and the lower computer module.
  • the entire testing process can be completed without physical operations, which not only improves testing efficiency, but also significantly reduces testing costs and can be applied to various scenarios.
  • sending handover command data to the lower computer module through the upper computer module, so that the lower computer module controls the virtual object module to move to the handover position includes:
  • the host computer module sends the handover command data to the slave computer module, where the handover command data includes handover position coordinate data;
  • the lower computer module runs the firmware control algorithm according to the handover position coordinate data in the handover command data to obtain the first force data, and obtains the displacement data and the first sensor data before the firmware control algorithm is run;
  • the lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model in the virtual object module through the first force data. Algorithm to move the virtual object module to the handover position.
  • the feedback of the first environment data to the lower computer module includes:
  • the displacement data and the first sensor data are obtained, and the displacement data and the first sensor data are sent to the lower computer module.
  • the lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position, including:
  • the lower computer module sends flag information to the virtual object module to simulate the movement of materials to the preset position, where the flag information includes moving material flags and fixed material flags.
  • the upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position, including:
  • the upper computer module sends the processing command data to the lower computer module, runs the processing command data through the lower computer module to obtain the second force data, and sends the second force data to the virtual computer module. and an object module to run the control object model algorithm through the second force data to move the virtual object module to the processing position.
  • Figure 1 is a structural block diagram of a simulation control platform based on model development according to the embodiment of the present invention
  • Figure 2 is a schematic diagram of a process based on synchronization command processing in the prior art
  • Figure 3 is a schematic diagram of the process of asynchronous command processing of the simulation control platform based on model development according to the embodiment of the present invention
  • FIG. 4 is a schematic diagram of the hardware diagnosis process in the prior art
  • Figure 5 is a schematic diagram of the processing process of the hardware diagnosis process by the simulation control platform based on model development according to the embodiment of the present invention
  • Figure 6 is a schematic diagram of the processing process of a diagnostic task in the prior art
  • Figure 7 is a schematic diagram of the processing process of diagnostic tasks by the simulation control platform based on model development according to the embodiment of the present invention.
  • Figure 8 is a schematic diagram of the processing process of tasks with different priorities in the prior art
  • Figure 9 is a schematic diagram of the processing process of unified priority tasks by the simulation control platform based on model development according to the embodiment of the present invention.
  • Figure 10 is a schematic diagram of the design process of the simulation control platform based on model development according to the embodiment of the present invention.
  • Figure 11 is a flow chart of the material loading and handover test method according to the embodiment of the present invention.
  • Figure 12 is a schematic diagram of the specific process of the material loading and handover test method according to the embodiment of the present invention.
  • Figure 13 is a structural block diagram of the process logic conversion module of the simulation control platform developed based on the model according to the embodiment of the present invention.
  • embodiments of the present invention provide a simulation control platform based on model development.
  • a host computer module 10 includes a host computer module 10, a process logic conversion module 20, a lower computer module 30 and Virtual object module 40, wherein the upper computer module 10 is used to communicate with the lower computer module 30, and the lower computer module 30 is used to generate motion firmware that can be executed by the virtual object module 40.
  • the virtual The object module 40 is used to model and design the target control object, and the process logic conversion module 20 is used to perform logical conversion on the processes in the lower computer module 30 to combine the lower computer module 30 and the upper computer. Timing unification in module 10.
  • the simulation control platform forms a platform that can run independently through the upper computer module 10, the process logic conversion module 20, the lower computer module 30 and the virtual object module 40.
  • the target control object is processed through the virtual object module 40.
  • Modeling is designed to obtain a virtual model corresponding to the target control object, and the upper computer module 10 communicates with the lower computer module 30 to issue control instructions to control the lower computer module 30, and the lower computer module 30 is mainly used to generate
  • the motion firmware is executed by the virtual object module 40 to control the motion of the virtual object module 40 through the lower computer module 30, thereby facilitating the control of the virtual model generated by the virtual object module 40.
  • the simulation control platform runs on a Windows platform of a computer
  • the host computer module 10 is software developed based on a programming language, which is called host computer software or host computer project (Host.sln);
  • the lower computer module 30 is generated by the modeling software based on the motion control situation, and forms engineering firmware that can be run independently based on the centralized development environment;
  • the virtual object module 40 is also generated by the modeling software based on the target control object modeling.
  • the engineering firmware formed by the code; among them, the engineering firmware is a file that can be run and executed independently to facilitate the completion of the simulation process.
  • the upper computer module 10 is upper computer software developed based on the programming language C# or python, including interfaces, various types of drivers and module components with different functions.
  • the lower computer module 30 and the The virtual object modules 40 are all engineering firmware modeled based on the modeling software simulink, and the centralized development environment of the lower computer module 30 and the virtual object module 40 is VS2019.
  • the lower computer module 30 and the upper computer module 10 run on the windows platform of the same computer, so that during the operation of the entire simulation control platform, the upper computer module 10 does not need a separate
  • the driver software layer can control the lower computer module 30 to realize the full-scenario test process, effectively reducing the labor cost and time cost of testing.
  • the lower computer module 30 is a motion control firmware in a semiconductor device.
  • the motion control firmware is modeled and designed through the modeling software simulink to obtain the firmware model Fireware.mdl.
  • the coder simulink coder generates the code source file Fireware.c of the firmware model, and then imports it into the integrated development environment VS2019 to obtain the VS project Fireware.sln.
  • the virtual object module 40 is a Plant.mdl file obtained through the modeling and design of the modeling software simulink. It generally includes a scheduling module, an algorithm module, a diagnostic module, a communication module and a queue module.
  • the firmware is generated through the modeling software simulink coder.
  • the code source file Plant.c of the model is then imported into the integrated development environment VS2019 to obtain the VS project Plant.sln, so that the host computer module 30 and the virtual object module 40 can correspond one-to-one on different platforms.
  • the process logic conversion module 20 includes at least one of a blocking state switching unit 201, a periodic interrupt unit 202, a process switching unit 203, and a priority switching unit 204.
  • the blocking state switching unit 201 is used to convert The blocking state process in the lower computer module 30 is switched to a non-blocking state process
  • the periodic interrupt unit 202 is used to convert the multi-period interrupt task in the lower computer module 30 into a time slice polling task
  • the process switching unit 203 is used to switch some multi-process diagnostic tasks in the lower computer module 30 to single-process diagnostic tasks
  • the priority switching unit 204 is used to adjust some processes in the lower computer module 30 priority and task scheduling.
  • the process logic conversion module 20 includes a blocking state switching unit 201, a periodic interrupt unit 202, a process switching unit 203 and a priority switching unit 204, so that the process logic conversion module 20 can
  • the computer module 30 performs blocking state switching, cycle termination, process switching and priority switching processing, thereby unifying the communication timing between the lower computer module 30 and the upper computer module 10 in each state.
  • the blocking state switching unit 201 includes at least one of a timeout switching subunit 2011 and an asynchronous switching subunit 2012.
  • the timeout switching subunit 2011 is used to switch the blocking state in the lower computer module 30.
  • the process sets a timeout, and after waiting for the timeout and not receiving valid data, switches from the current process to executing other processes;
  • the asynchronous switching subunit 2012 is used to switch the synchronous command processing mechanism in the communication process It is an asynchronous command processing mechanism to achieve parallel processing of multiple commands.
  • multiple processes in the lower computer module 30 include communication modules and queue modules, and communication modules and queue modules generally include blocked processes, they are in a state of receiving data for a long time, resulting in It takes a long time and is time-consuming to wait.
  • the timeout switching subunit 2011 performs timeout switching, and a timeout time t is set for the blocked process in the lower computer module 30.
  • the blocked process still does not receive the message. If there is valid data, it will switch to the execution of other tasks, thereby switching the blocking process to the non-blocking process to improve the execution efficiency of the process and avoid excessive waiting.
  • a synchronous command processing mechanism is usually used, that is, after the upper computer module 10 sends a command, the lower computer module 30 sequentially accepts the command, The process of command execution and response sending is completed after the host computer module 10 accepts the response.
  • this method requires that the entire synchronization command processing be completed before other processes can be carried out, which prolongs the processing time of the process to a certain extent, and The timing cannot be controlled.
  • the upper computer module 10 can receive the "command acceptance" from the lower computer module 30.
  • the lower computer module 30 sends an accept return instruction to the upper computer module 10, and the upper computer module 10 receives the accept return instruction.
  • Other processes can be executed, and the command execution process is executed in the lower computer module 30. If the upper computer module 10 wants to obtain the response result, the lower computer module 30 will send the response result after receiving the instruction to send the response, and the upper computer module 10 will obtain the response result. response results, thereby realizing parallel processing of multiple command acceptance and command execution, effectively reducing the execution time of the process.
  • the motion firmware generated in the lower computer module 30 includes a hardware diagnostic process, which includes queue processing tasks, communication tasks, control algorithms, diagnostic tasks and command processing tasks.
  • the periodic interrupt unit 2012 is used to execute the queue processing task, the communication task, the control algorithm, the diagnosis task and the command processing task according to a polling mechanism.
  • the traditional running sequence is a multi-cycle interrupt task.
  • the control algorithm is first completed, and the queue processing tasks and communication tasks are completed in sequence during the rest of the time.
  • diagnostic tasks but because the running environment on the computer is a time-sharing processing system, it cannot be guaranteed to be processed according to this timing. Therefore, the hardware diagnosis process is processed through the periodic interrupt unit 2012. Referring to FIG. 5, the hardware diagnosis process is changed from the original execution timing to polling.
  • the periodic interrupt unit 2012 expands the cache of the queue processing task and sets timeout logic for the communication task. This expands the performance of queues and communications to ensure that queue processing tasks and communication tasks will not be blocked when executing the hardware diagnostic process.
  • the diagnostic tasks include chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks.
  • the process switching unit 2013 converts the chip-level diagnostic subtasks into The board-level diagnosis subtask, the component-level diagnosis subtask and the system-level diagnosis subtask are executed in the same cycle to locate the fault location and fault time.
  • the traditional method is to interrupt chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks and system-level diagnostic subtasks in different cycles.
  • the chip-level diagnostic subtask is interrupted in The board-level diagnostic subtask is scheduled to interrupt at 200us
  • the component-level diagnostic subtask is scheduled to interrupt at 500us
  • the system diagnostic subtask is scheduled to interrupt at 1ms.
  • the priority and timing mechanisms in the computer cannot operate effectively at the same time, this This method cannot ensure that the diagnostic subtasks are executed in a multi-cycle time and sequence, which affects the efficiency of fault diagnosis.
  • chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks are run cyclically within a diagnostic cycle to ensure that on the computer time flow Complete each diagnostic function in a controllable manner, locate the corresponding fault location and time, complete the fault diagnosis process, and improve diagnostic efficiency.
  • the priority switching unit 204 switches tasks with different priorities of some processes in the lower computer module 30 to a unified priority, and switches preemptive task scheduling to non-preemptive task scheduling.
  • the time allocated to each task is fixed and is a multiple of the system clock, such as 5 times.
  • the running process is as follows: run task one first, and after running for 5 clock cycles, switch to task two through time slice scheduling. After task two runs for 5 system clock cycles, switch to task three through time slice scheduling. Task three is in The blocking API function is called during operation. After calling the function, it will switch to the next task four through time slice scheduling. Even if the five system time ticks of task three have not been used up at this time, task four will run for five system clock ticks. , switch to task one through time slice scheduling. Under the above time slice polling, the workload of task allocation and task timing design can be reduced, and the platform construction time is greatly reduced.
  • the design process of the lower computer module 30 and the virtual object module 40 in the simulation control platform is as follows:
  • the characteristic information of the target control object includes mechanical characteristic information, electrical characteristic information, motion characteristic information and application scenario characteristic information.
  • the characteristic information of the motion firmware Including functional requirement information and performance requirement information, the simulation software Simulink models the target control object and motion firmware. After the modeling is completed, the target control object and motion firmware are integrated for simulation testing based on the simulation software Simulink to further optimize the model.
  • the project files Plant.mdl and Firmware.mdl corresponding to the virtual object module 40 and the host computer module 30 are obtained respectively.
  • the obtained optimization model is a project file in mdl format
  • Plant.mdl and Firmware.mdl are synchronized to generate C language code
  • a .sln project file is formed based on the integrated development environment VS2019, that is, Plant.sln and Firmware.sln, which can be found in Plant.sln and Firmware.sln are jointly tested under the integrated development environment to verify the accuracy of the final model.
  • the testing process is software-in-the-loop testing.
  • the design of the host computer module is completed simultaneously to obtain the corresponding project file Host.sln of the host computer, which can then be combined with Plant.sln and Firmware.sln. Test, complete the full-scenario test of the host computer module, and finally verify with the hardware, the final host computer module 10 can be obtained to complete the model design process.
  • the specific design process is as follows. Referring to Figure 10, the firmware design process is first carried out. After the characteristic information of the target control object and the characteristic information of the motion firmware are input into the simulation software Simulink, the code is modeled and generated respectively and obtained Project files Plant.mdl and Firmware.mdl; then perform firmware function test, performance test and interface test on the project files Plant.mdl and Firmware.mdl respectively. If the motion firmware is not tested, optimize the Firmware.mdl and retest until After the test is completed, the firmware design process ends.
  • the host computer design process input the host computer requirements, develop the corresponding host computer model, and perform test optimization to obtain the optimized host computer model.
  • the host computer model is debugged, conduct full-scenario testing, and complete the full scenario After the testing process, continue to judge whether the debugging is completed.
  • the design process ends and the final host computer model is obtained. Among them, every time it is judged whether the debugging is completed, if the debugging is not completed, the process of testing and optimizing the host computer model will continue to be performed, which will not be described again here.
  • the simulation control platform of the present invention is suitable for traditional manufacturing industries, including medical equipment, semiconductor equipment and other equipment that require high-precision control.
  • the software development process can be freed from the constraints of hardware.
  • the host computer can complete the entire process test in the Windows environment.
  • the host computer When installing the complete machine, the host computer only needs to debug the performance of the device, and the workload related to the hardware is It can be greatly reduced, and the development time can be greatly shortened and the development efficiency can be improved.
  • the present invention also provides a loading and handover test method.
  • the above-mentioned simulation control platform based on model development is used for testing.
  • the loading and handover test method includes the steps:
  • sending handover command data to the lower computer module through the upper computer module, so that the lower computer module controls the virtual object module to move to the handover position includes:
  • the host computer module sends the handover command data to the slave computer module, where the handover command data includes handover position coordinate data;
  • the lower computer module runs a firmware control algorithm according to the handover position coordinate data in the handover command data to obtain the first force data, and obtains the displacement data and the first sensor data before the firmware control algorithm is run;
  • the lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model in the virtual object module through the first force data. Algorithm to move the virtual object module to the handover position.
  • the host computer module first sends the data containing the handover position coordinates to the lower computer module through Ethernet, so as to control the XY axis movement in the loading equipment to the handover position, where the handover position
  • the coordinate data is recorded as (x exchange , y exchange ).
  • the lower computer module After the lower computer module receives the handover position coordinate data in the handover command data, the lower computer module cyclically runs the firmware control algorithm according to the handover position coordinate data to obtain the first force data, and sends the first force data through the Ethernet after each cycle. force data to the virtual object module.
  • the slave computer module obtains the displacement data and the first sensor data respectively when running the firmware control algorithm in each cycle.
  • the displacement data is the displacement data of the XY axis moving to the handover position.
  • the first sensor data includes sensor data Flag EX of the handover position.
  • the lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model algorithm in the virtual object module according to the first force data, thereby causing the virtual object module to simulate Move to the handover position to complete the preliminary motion simulation process.
  • the feedback of the first environment data to the lower computer module includes:
  • the displacement data and the first sensor data are obtained, and the displacement data and the first sensor data are sent to the lower computer module.
  • the displacement data and the first sensor data are sent to the lower computer module to facilitate subsequent judgment of whether there is material at the handover position.
  • the host computer module After the host computer module receives the first environment data, it obtains the pressure data of the vacuum sensor in the first environment data to determine whether there is material at the handover position. After determining that the material exists, a notification message is sent to the host computer module so that The loading process is simulated in the host computer module.
  • the lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position.
  • the process includes:
  • the lower computer module sends flag information to the virtual object module to simulate the movement of materials to the preset position, where the flag information includes moving material flags and fixed material flags.
  • the lower computer module sends moving material flags and fixed material flags to the virtual object module respectively, thereby simulating the process of the material moving to the preset position.
  • the moving material mark indicates that the robot moves the material to the corresponding position in the equipment
  • the fixed material mark indicates that the simulated vacuum solenoid valve is opened to vacuum to simulate the material being fixed at the corresponding position.
  • the process of simulating the material moving to the corresponding position and being fixed at the corresponding position is set to 1 to 10 seconds.
  • the upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position to complete the loading test process.
  • the above process includes:
  • the upper computer module sends the processing command data to the lower computer module, runs the processing command data through the lower computer module to obtain the second force data, and sends the second force data to the virtual computer module. and an object module to run the control object model algorithm through the second force data to move the virtual object module to the processing position.
  • the upper computer module sends processing command data to the lower computer module, so that the lower computer module runs the firmware model algorithm according to the processing command data to obtain the second force data, and sends the second force data to
  • the virtual object module enables the virtual object module to run the control object model algorithm according to the second force data, thereby moving the virtual object module to the processing position on the platform to complete the entire loading and testing process.
  • processing command data includes processing position coordinate data
  • the loading and handover test is carried out through the simulation control platform established above.
  • the entire loading and handover process can be tested only in the Windows environment of the computer. There is no need to use With physical testing, the workload related to hardware is greatly reduced, which not only effectively reduces testing time, but also improves development efficiency.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A simulation control platform based on model development, and a loading handover test method. The simulation control platform based on model development comprises an upper computer module (10), a process logic conversion module (20), a lower computer module (30) and a virtual object module (40), which are sequentially in communication connection, wherein the upper computer module (10) is used for communicating with the lower computer module (30); the lower computer module (30) is used for generating motion firmware that can be executed by the virtual object module (40); the virtual object module (40) is used for performing modeling design on a target control object; and the process logic conversion module (20) is used for performing logical conversion on a process in the lower computer module (30), so as to unify time sequences in the lower computer module (30) and the upper computer module (10). Nonlinear hardware is linearly modeled, such that system modeling is performed on a controlled object, so as to complete system-level test and simulation, thereby improving the development efficiency.

Description

基于模型开发的仿真控制平台及上料交接测试方法Simulation control platform and material loading and handover test method based on model development
交叉引用cross reference
本申请要求2022年03月24日提交的申请号为2022102961506的中国申请的优先权。上述申请的内容以引用方式被包含于此。This application claims priority to the Chinese application with application number 2022102961506 submitted on March 24, 2022. The contents of the above application are incorporated herein by reference.
技术领域Technical field
本发明涉及机电系统设备技术领域,尤其涉及一种基于模型开发的仿真控制平台及上料交接测试方法。The invention relates to the technical field of electromechanical system equipment, and in particular to a simulation control platform based on model development and a material loading and handover test method.
技术背景technical background
随着制造业的不断发展,精密控制在半导体行业汇总或者医疗器械行业中显得尤为重要,而针对一套精密仪器设备的开发,需要光学、机械、电子电气、控制、软件多个专业联合协调统一开发,流程包括需求识别、设计、投料、测试、优化设计、上线。With the continuous development of the manufacturing industry, precision control is particularly important in the semiconductor industry or the medical device industry. The development of a set of precision instruments requires the coordination and unification of multiple disciplines in optics, mechanics, electronics, control, and software. The development process includes requirement identification, design, material input, testing, optimized design, and launch.
传统的基于模型开发,只对核心算法或者功能逻辑进行设计和开发,然后生成代码并集成到手工代码中,生成可执行文件,烧录到控制板卡中,进行调试。在汽车领域中,对于各类车载子系统,比如自动助力转向系统、车道偏离预警系统等,使用基于模型开发已经较为成熟,在做模型在环测试时,已经有成熟的商用软件(比如Carsim、Trucksim)作为汽车模型,来联合仿真测试。但是在传统的高精密仪器设备行业,比如半导体设备、医疗设备,暂时没有成熟的商用软件来模拟控制对象,基于模型开发的使用较为简单与粗浅,未形成开发工具链,matlab/simulink的使用只限于控制算法的仿真和分析,以及使用工具箱进行数据分析,而在基于模型开发的优势包括提高开发效率,降低开发时间和人力成本,降低编码工作等都未有体现。Traditional model-based development only designs and develops core algorithms or functional logic, then generates code and integrates it into manual code, generates executable files, and burns them into the control board for debugging. In the automotive field, model-based development has been relatively mature for various vehicle subsystems, such as automatic power steering systems, lane departure warning systems, etc. When doing model-in-the-loop testing, there are already mature commercial software (such as Carsim, Trucksim) as a vehicle model for joint simulation testing. However, in the traditional high-precision instrument and equipment industry, such as semiconductor equipment and medical equipment, there is currently no mature commercial software to simulate control objects. The use of model-based development is relatively simple and superficial, and no development tool chain has been formed. The use of matlab/simulink is only It is limited to the simulation and analysis of control algorithms and the use of toolboxes for data analysis. The advantages of model-based development, including improving development efficiency, reducing development time and labor costs, and reducing coding work, are not reflected.
因此,有必要提供一种新型的基于模型开发的仿真控制平台及上料交接测试方法以解决现有技术中存在的上述问题。Therefore, it is necessary to provide a new model-based simulation control platform and material loading and handover test method to solve the above problems existing in the existing technology.
发明概要Summary of the invention
本发明的目的在于提供一种基于模型开发的仿真控制平台及上料交接测试方法,通过将非线性硬件线性化建模,实现对控制对象进行系统建模,以完成系统级测试和仿真,提高了开发效率。The purpose of the present invention is to provide a simulation control platform and a loading and handover test method based on model development. By linearly modeling nonlinear hardware, system modeling of the control object is realized to complete system-level testing and simulation, and improve Improve development efficiency.
为实现上述目的,本发明的所述一种基于模型开发的仿真控制平台,包括依次通信连接的上位机模块、进程逻辑转换模块、下位机模块和虚拟对象模块,其中,所述上位机模块用于与所述下位机模块进行通信,所述下位机模块用于生成可供所述虚拟对象模块执行的运动固件,所述虚拟对象模块用于对目标控制对象进行建模设计,所述进程逻辑转换模块用于对所述下位机模块中的进程进行逻辑转换,以将所述下位机模块和所述上位机模块中的时序统一。In order to achieve the above object, the simulation control platform based on model development of the present invention includes a host computer module, a process logic conversion module, a lower computer module and a virtual object module that are communicated in sequence, wherein the host computer module is To communicate with the lower computer module, the lower computer module is used to generate motion firmware that can be executed by the virtual object module. The virtual object module is used to model and design the target control object. The process logic The conversion module is used to logically convert the processes in the lower computer module to unify the timing in the lower computer module and the upper computer module.
本发明所述基于模型开发的仿真控制平台的有益效果在于:通过上位机模块、进程逻辑转换模块、下位机模块和虚拟对象模块组成仿真控制平台,通过将非线性硬件线性化建模,实现对控制对象进行系统建模,以通过所述仿真控制平台完成系统级测试和仿真,不仅减少了编码工作,降低了技术复杂度,可以让开发人员的工作重心侧重于功能和性能,进一步提高产品竞争力,而且可以将整机软件脱离实物运行,解耦软件和硬件,提高维护性和继承性。The beneficial effect of the simulation control platform based on model development of the present invention is that: the simulation control platform is composed of a host computer module, a process logic conversion module, a lower computer module and a virtual object module, and the nonlinear hardware is linearly modeled to realize Control objects perform system modeling to complete system-level testing and simulation through the simulation control platform, which not only reduces coding work and technical complexity, but also allows developers to focus on functionality and performance, further improving product competition. Powerful, and can run the entire machine software separately from the physical object, decouple software and hardware, and improve maintainability and inheritance.
可选的,所述进程逻辑转换模块包括阻塞状态切换单元、周期中断单元、进程切换单元和优先级切换单元中的至少一个,所述阻塞状态切换单元用于 将所述下位机模块中的阻塞态进程切换为非阻塞态进程,所述周期中断单元用于将所述下位机模块中的多周期中断的任务转换为按时间片轮询的任务;所述进程切换单元用于将所述下位机模块中的部分多进程的诊断任务切换为单进程的诊断任务;所述优先级切换单元用于调整所述下位机模块中部分进程的优先级和任务调度情况。Optionally, the process logic conversion module includes at least one of a blocking state switching unit, a periodic interrupt unit, a process switching unit and a priority switching unit. The blocking state switching unit is used to convert the blocking state in the lower computer module to The state process is switched to a non-blocking state process, and the periodic interrupt unit is used to convert the multi-period interrupt task in the lower computer module into a time slice polling task; the process switching unit is used to convert the lower computer module to a polling task. Some multi-process diagnostic tasks in the lower computer module are switched to single-process diagnostic tasks; the priority switching unit is used to adjust the priority and task scheduling of some processes in the lower computer module.
可选的,所述阻塞状态切换单元包括超时转换子单元和异步切换子单元中的至少一个,所述超时切换子单元用于对所述下位机模块中的阻塞态进程设置超时时间,并在等待所述超时时间且未收到有效数据后,从当前进程切换至执行其它进程;所述异步切换子单元用于将所述通信进程中的同步命令处理机制切换为异步命令处理机制,以实现多个命令的并行处理。Optionally, the blocking state switching unit includes at least one of a timeout conversion subunit and an asynchronous switching subunit. The timeout switching subunit is used to set a timeout time for the blocking state process in the lower computer module, and in After waiting for the timeout period and no valid data is received, switch from the current process to execute other processes; the asynchronous switching subunit is used to switch the synchronous command processing mechanism in the communication process to an asynchronous command processing mechanism to achieve Parallel processing of multiple commands.
可选的,所述下位机模块中生成的运动固件包括硬件诊断进程,所述硬件诊断进程包括队列处理任务、通信任务、控制算法、诊断任务和命令处理任务,所述周期中断单元用于将所述队列处理任务、所述通信任务、所述控制算法、所述诊断任务和所述命令处理任务按照轮询机制执行。Optionally, the motion firmware generated in the lower computer module includes a hardware diagnostic process, which includes queue processing tasks, communication tasks, control algorithms, diagnostic tasks and command processing tasks, and the periodic interrupt unit is used to The queue processing task, the communication task, the control algorithm, the diagnostic task and the command processing task are executed according to a polling mechanism.
可选的,所述周期中断单元将所述队列处理任务扩大缓存,对所述通信任务设置超时逻辑。Optionally, the periodic interrupt unit expands the cache of the queue processing task and sets timeout logic for the communication task.
可选的,所述诊断任务包括芯片级诊断子任务、板级诊断子任务、组件级诊断子任务和系统级诊断子任务,所述进程切换单元将所述芯片级诊断子任务、所述板级诊断子任务、所述组件级诊断子任务和所述系统级诊断子任务在同一个循环周期内执行,以定位出故障位置和故障时刻。Optionally, the diagnostic tasks include chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks. The process switching unit switches the chip-level diagnostic subtasks, the board-level diagnostic subtasks, and the board-level diagnostic subtasks. The level diagnosis subtask, the component level diagnosis subtask and the system level diagnosis subtask are executed in the same cycle to locate the fault location and fault time.
可选的,所述优先级切换单元将所述下位机模块中部分进程不同优先级的任务切换为统一的优先级,并将抢占式任务调度切换为非抢占式任务调 度。Optionally, the priority switching unit switches the tasks of different priorities of some processes in the lower computer module to a unified priority, and switches preemptive task scheduling to non-preemptive task scheduling.
本发明还公开了一种上料交接测试方法,采用上述的基于模型开发的仿真控制平台进行测试,所述上料交接测试方法包括:The invention also discloses a loading and handover test method, which uses the above-mentioned simulation control platform based on model development for testing. The loading and handover test method includes:
通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,并反馈第一环境数据至所述下位机模块;Send handover command data to the slave computer module through the host computer module, so that the slave computer module controls the virtual object module to move to the handover position and feeds back the first environment data to the slave computer module;
在所述下位机模块通过所述第一环境数据在所述交接位置存在物料之后,通知所述上位机模块;After the lower computer module uses the first environment data to indicate the presence of materials at the handover position, it notifies the upper computer module;
所述下位机模块发送物料运动命令数据,以模拟待运输的物料移动并固定在预设位置;The lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position;
所述上位机模块发送处理命令数据至所述下位机模块,以使得所述下位机模块控制所述虚拟对象模块移动到处理位置,完成上料测试过程。The upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position to complete the loading test process.
本发明所述上料交接测试方法的有益效果在于:通过上述的基于模型开发的仿真控制平台执行所述上料交接测试方法,整个测试过程只需要上位机模块和下位机模块相互配合就可以完成整个测试过程,不需要进行实物操作就可以完成上料测试过程,不仅提高了测试效率,而且显著降低了测试成本,能够适用于各个场景。The beneficial effect of the loading and handover testing method of the present invention is that the loading and handover testing method is executed through the above-mentioned simulation control platform based on model development, and the entire testing process can be completed only by the cooperation of the upper computer module and the lower computer module. The entire testing process can be completed without physical operations, which not only improves testing efficiency, but also significantly reduces testing costs and can be applied to various scenarios.
可选的,所述通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,包括:Optionally, sending handover command data to the lower computer module through the upper computer module, so that the lower computer module controls the virtual object module to move to the handover position, includes:
所述上位机模块发送所述交接命令数据至所述下位机模块,所述交接命令数据包括交接位置坐标数据;The host computer module sends the handover command data to the slave computer module, where the handover command data includes handover position coordinate data;
所述下位机模块根据所述交接命令数据中的所述交接位置坐标数据运 行固件控制算法以得到第一力数据,并获取在所述固件控制算法运行之前的位移数据和第一传感器数据;The lower computer module runs the firmware control algorithm according to the handover position coordinate data in the handover command data to obtain the first force data, and obtains the displacement data and the first sensor data before the firmware control algorithm is run;
所述下位机模块将所述第一力数据、所述位移数据和所述第一传感器数据发送至所述虚拟对象模块,通过所述第一力数据运行所述虚拟对象模块中的控制对象模型算法,以将所述虚拟对象模块移动到交接位置。The lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model in the virtual object module through the first force data. Algorithm to move the virtual object module to the handover position.
可选的,所述反馈第一环境数据至所述下位机模块,包括:Optionally, the feedback of the first environment data to the lower computer module includes:
在运行所述控制对象模型算法的过程中,获取所述位移数据和所述第一传感器数据,并将所述位移数据和所述第一传感器数据发送至所述下位机模块。During the process of running the control object model algorithm, the displacement data and the first sensor data are obtained, and the displacement data and the first sensor data are sent to the lower computer module.
可选的,所述下位机模块发送物料运动命令数据,以模拟待运输的物料移动并固定在预设位置,包括:Optionally, the lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position, including:
所述下位机模块发送标志位信息至所述虚拟对象模块,以模拟物料运动到所述预设位置,其中,所述标志位信息包括移动物料标志位和固定物料标志位。The lower computer module sends flag information to the virtual object module to simulate the movement of materials to the preset position, where the flag information includes moving material flags and fixed material flags.
可选的,所述上位机模块发送处理命令数据至所述下位机模块,以使得所述下位机模块控制所述虚拟对象模块移动到处理位置,包括:Optionally, the upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position, including:
所述上位机模块发送所述处理命令数据至所述下位机模块,通过所述下位机模块运行所述处理命令数据之后得到第二力数据,并将所述第二力数据发送至所述虚拟对象模块,以通过所述第二力数据运行所述控制对象模型算法,将所述虚拟对象模块移动到所述处理位置。The upper computer module sends the processing command data to the lower computer module, runs the processing command data through the lower computer module to obtain the second force data, and sends the second force data to the virtual computer module. and an object module to run the control object model algorithm through the second force data to move the virtual object module to the processing position.
附图说明Description of the drawings
图1为本发明实施例所述基于模型开发的仿真控制平台的结构框图;Figure 1 is a structural block diagram of a simulation control platform based on model development according to the embodiment of the present invention;
图2为现有技术中基于同步命令处理的过程示意图;Figure 2 is a schematic diagram of a process based on synchronization command processing in the prior art;
图3为本发明实施例所述基于模型开发的仿真控制平台的基于异步命令处理的过程示意图;Figure 3 is a schematic diagram of the process of asynchronous command processing of the simulation control platform based on model development according to the embodiment of the present invention;
图4为现有技术中的硬件诊断进程处理过程示意图;Figure 4 is a schematic diagram of the hardware diagnosis process in the prior art;
图5为本发明实施例所述基于模型开发的仿真控制平台对硬件诊断进程的处理过程示意图;Figure 5 is a schematic diagram of the processing process of the hardware diagnosis process by the simulation control platform based on model development according to the embodiment of the present invention;
图6为现有技术中诊断任务的处理过程示意图;Figure 6 is a schematic diagram of the processing process of a diagnostic task in the prior art;
图7为本发明实施例所述基于模型开发的仿真控制平台对诊断任务的处理过程示意图;Figure 7 is a schematic diagram of the processing process of diagnostic tasks by the simulation control platform based on model development according to the embodiment of the present invention;
图8为现有技术中对不同优先级的任务的处理过程示意图;Figure 8 is a schematic diagram of the processing process of tasks with different priorities in the prior art;
图9为本发明实施例所述基于模型开发的仿真控制平台对统一优先级任务的处理过程示意图;Figure 9 is a schematic diagram of the processing process of unified priority tasks by the simulation control platform based on model development according to the embodiment of the present invention;
图10为本发明实施例所述基于模型开发的仿真控制平台的设计过程示意图;Figure 10 is a schematic diagram of the design process of the simulation control platform based on model development according to the embodiment of the present invention;
图11为本发明实施例所述上料交接测试方法的流程图;Figure 11 is a flow chart of the material loading and handover test method according to the embodiment of the present invention;
图12为本发明实施例所述上料交接测试方法的具体过程示意图;Figure 12 is a schematic diagram of the specific process of the material loading and handover test method according to the embodiment of the present invention;
图13为本发明实施例所述基于模型开发的仿真控制平台的进程逻辑转换模块的结构框图。Figure 13 is a structural block diagram of the process logic conversion module of the simulation control platform developed based on the model according to the embodiment of the present invention.
发明内容Contents of the invention
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实 施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。除非另外定义,此处使用的技术术语或者科学术语应当为本发明所属领域内具有一般技能的人士所理解的通常意义。本文中使用的“包括”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。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 will be clearly and completely described below in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are part of the present invention. Examples, not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention. Unless otherwise defined, technical or scientific terms used herein shall have their ordinary meaning understood by one of ordinary skill in the art to which this invention belongs. The use of "comprising" and similar words herein means that the elements or things appearing before the word include the elements or things listed after the word and their equivalents, without excluding other elements or things.
针对现有技术存在的问题,本发明的实施例提供了一种基于模型开发的仿真控制平台,参考图1,包括依次通信连接的上位机模块10、进程逻辑转换模块20、下位机模块30和虚拟对象模块40,其中,所述上位机模块10用于与所述下位机模块30进行通信,所述下位机模块30用于生成可供所述虚拟对象模块40执行的运动固件,所述虚拟对象模块40用于对目标控制对象进行建模设计,所述进程逻辑转换模块20用于对所述下位机模块30中的进程进行逻辑转换,以将所述下位机模块30和所述上位机模块10中的时序统一。In view of the problems existing in the existing technology, embodiments of the present invention provide a simulation control platform based on model development. Referring to Figure 1, it includes a host computer module 10, a process logic conversion module 20, a lower computer module 30 and Virtual object module 40, wherein the upper computer module 10 is used to communicate with the lower computer module 30, and the lower computer module 30 is used to generate motion firmware that can be executed by the virtual object module 40. The virtual The object module 40 is used to model and design the target control object, and the process logic conversion module 20 is used to perform logical conversion on the processes in the lower computer module 30 to combine the lower computer module 30 and the upper computer. Timing unification in module 10.
在本实施例中,所述仿真控制平台通过上位机模块10、进程逻辑转换模块20、下位机模块30和虚拟对象模块40形成一个可以独立运行的平台,通过虚拟对象模块40对目标控制对象进行建模设计以得到与目标控制对象对应的虚拟模型,而上位机模块10通过与下位机模块30进行通信,以发出控制指令对下位机模块30进行控制,而下位机模块30主要用于生成可供虚拟对象模块40执行的运动固件,以通过下位机模块30控制虚拟对象模块40的运动,从而便于完成虚拟对象模块40生成的虚拟模型的控制。In this embodiment, the simulation control platform forms a platform that can run independently through the upper computer module 10, the process logic conversion module 20, the lower computer module 30 and the virtual object module 40. The target control object is processed through the virtual object module 40. Modeling is designed to obtain a virtual model corresponding to the target control object, and the upper computer module 10 communicates with the lower computer module 30 to issue control instructions to control the lower computer module 30, and the lower computer module 30 is mainly used to generate The motion firmware is executed by the virtual object module 40 to control the motion of the virtual object module 40 through the lower computer module 30, thereby facilitating the control of the virtual model generated by the virtual object module 40.
在一些实施例中,所述仿真控制平台运行在计算机的windows平台上, 所述上位机模块10为基于编程语言开发的软件,称为上位机软件或者上位机工程(Host.sln);所述下位机模块30为由建模软件根据运动控制情况建模生成代码,并形成基于集中开发环境的可单独运行的工程固件;所述虚拟对象模块40也是由建模软件根据目标控制对象建模生成代码并形成的工程固件;其中,工程固件为可独立运行并执行的文件,从而以便于完成仿真过程。In some embodiments, the simulation control platform runs on a Windows platform of a computer, and the host computer module 10 is software developed based on a programming language, which is called host computer software or host computer project (Host.sln); The lower computer module 30 is generated by the modeling software based on the motion control situation, and forms engineering firmware that can be run independently based on the centralized development environment; the virtual object module 40 is also generated by the modeling software based on the target control object modeling. The engineering firmware formed by the code; among them, the engineering firmware is a file that can be run and executed independently to facilitate the completion of the simulation process.
具体的,在本实施例中,所述上位机模块10为基于编程语言C#或python开发的上位机软件,包括界面、各类驱动以及不同功能的模块组件,所述下位机模块30和所述虚拟对象模块40均为基于建模软件simulink建模得到的工程固件,且所述下位机模块30和所述虚拟对象模块40的集中开发环境均为VS2019。Specifically, in this embodiment, the upper computer module 10 is upper computer software developed based on the programming language C# or python, including interfaces, various types of drivers and module components with different functions. The lower computer module 30 and the The virtual object modules 40 are all engineering firmware modeled based on the modeling software simulink, and the centralized development environment of the lower computer module 30 and the virtual object module 40 is VS2019.
在另外一些实施例中,所述下位机模块30与所述上位机模块10运行在同一个计算机的windows平台上,从而在整个仿真控制平台运行过程中,所述上位机模块10不需要单独的驱动软件层就能够实现对下位机模块30的控制以实现全场景测试过程,有效减少了测试的人力成本和时间成本。In some other embodiments, the lower computer module 30 and the upper computer module 10 run on the windows platform of the same computer, so that during the operation of the entire simulation control platform, the upper computer module 10 does not need a separate The driver software layer can control the lower computer module 30 to realize the full-scenario test process, effectively reducing the labor cost and time cost of testing.
在又一些实施例中,所述下位机模块30在半导体设备中为运动控制固件,本实施例中通过建模软件simulink对运动控制固件进行建模设计得到固件模型Fireware.mdl,通过建模软件编码器simulink coder生成固件模型的代码源文件Fireware.c,再导入集成开发环境VS2019之中得到VS工程Fireware.sln。In some embodiments, the lower computer module 30 is a motion control firmware in a semiconductor device. In this embodiment, the motion control firmware is modeled and designed through the modeling software simulink to obtain the firmware model Fireware.mdl. The coder simulink coder generates the code source file Fireware.c of the firmware model, and then imports it into the integrated development environment VS2019 to obtain the VS project Fireware.sln.
而所述虚拟对象模块40为通过建模软件simulink建模设计得到的Plant.mdl文件,一般包括调度模块、算法模块、诊断模块、通信模块和队列 模块,通过建模软件编码器simulink coder生成固件模型的代码源文件Plant.c,再导入集成开发环境VS2019之中得到VS工程Plant.sln,以便于下位机模块30和虚拟对象模块40能够在不同的平台上一一对应。The virtual object module 40 is a Plant.mdl file obtained through the modeling and design of the modeling software simulink. It generally includes a scheduling module, an algorithm module, a diagnostic module, a communication module and a queue module. The firmware is generated through the modeling software simulink coder. The code source file Plant.c of the model is then imported into the integrated development environment VS2019 to obtain the VS project Plant.sln, so that the host computer module 30 and the virtual object module 40 can correspond one-to-one on different platforms.
由于下位机模块30在集成开发环境VS2019中建模得到的Fireware.sln文件中存在许多进程,直接采用PC进行进程管理的话,由于计算机为时间片轮询,用户无法对每个进程的运行状态完成预测,则无法保证上位机模块10和下位机模块30之间进行有序通讯,通过进程逻辑转换模块20对所述下位机模块30中的进程进行逻辑转换,以将所述下位机模块30和所述上位机模块10中的时序统一,以便于实现有序通讯。Since there are many processes in the Fireware.sln file modeled by the lower computer module 30 in the integrated development environment VS2019, if the PC is directly used for process management, the user cannot complete the running status of each process because the computer is time slice polling. If it is predicted, orderly communication between the upper computer module 10 and the lower computer module 30 cannot be guaranteed. The process in the lower computer module 30 is logically converted through the process logic conversion module 20 to convert the lower computer module 30 and the lower computer module 30 . The timing in the host computer module 10 is unified to facilitate orderly communication.
在一些实施例中,所述进程逻辑转换模块20包括阻塞状态切换单元201、周期中断单元202、进程切换单元203和优先级切换单元204中的至少一个,所述阻塞状态切换单元201用于将所述下位机模块30中的阻塞态进程切换为非阻塞态进程,所述周期中断单元202用于将所述下位机模块30中的多周期中断的任务转换为按时间片轮询的任务;所述进程切换单元203用于将所述下位机模块30中的部分多进程的诊断任务切换为单进程的诊断任务;所述优先级切换单元204用于调整所述下位机模块30中部分进程的优先级和任务调度情况。In some embodiments, the process logic conversion module 20 includes at least one of a blocking state switching unit 201, a periodic interrupt unit 202, a process switching unit 203, and a priority switching unit 204. The blocking state switching unit 201 is used to convert The blocking state process in the lower computer module 30 is switched to a non-blocking state process, and the periodic interrupt unit 202 is used to convert the multi-period interrupt task in the lower computer module 30 into a time slice polling task; The process switching unit 203 is used to switch some multi-process diagnostic tasks in the lower computer module 30 to single-process diagnostic tasks; the priority switching unit 204 is used to adjust some processes in the lower computer module 30 priority and task scheduling.
在本实施例中,参考图13,所述进程逻辑转换模块20包括阻塞状态切换单元201、周期中断单元202、进程切换单元203和优先级切换单元204,从而使得进程逻辑转换模块20能够对下位机模块30进行阻塞状态切换、周期终端、进程切换和优先级切换处理,从而将各个状态下的下位机模块30和上位机模块10之间进行通讯时序统一。In this embodiment, referring to Figure 13, the process logic conversion module 20 includes a blocking state switching unit 201, a periodic interrupt unit 202, a process switching unit 203 and a priority switching unit 204, so that the process logic conversion module 20 can The computer module 30 performs blocking state switching, cycle termination, process switching and priority switching processing, thereby unifying the communication timing between the lower computer module 30 and the upper computer module 10 in each state.
在一些实施例中,所述阻塞状态切换单元201包括超时转换子单元2011和异步切换子单元2012中的至少一个,所述超时切换子单元2011用于对所述下位机模块30中的阻塞态进程设置超时时间,并在等待所述超时时间且未收到有效数据后,从当前进程切换至执行其它进程;所述异步切换子单元2012用于将所述通信进程中的同步命令处理机制切换为异步命令处理机制,以实现多个命令的并行处理。In some embodiments, the blocking state switching unit 201 includes at least one of a timeout switching subunit 2011 and an asynchronous switching subunit 2012. The timeout switching subunit 2011 is used to switch the blocking state in the lower computer module 30. The process sets a timeout, and after waiting for the timeout and not receiving valid data, switches from the current process to executing other processes; the asynchronous switching subunit 2012 is used to switch the synchronous command processing mechanism in the communication process It is an asynchronous command processing mechanism to achieve parallel processing of multiple commands.
具体的,由于下位机模块30中的多个进程中包括通信模块和队列模块,而通信模块和队列模块中一般包括阻塞态进程,因此长期处于接收数据的状态,从而导致在下位机模块30中的占用时间较长,等待耗时。而通过超时切换子单元2011进行超时切换,对于下位机模块30中的阻塞态进程设置超时时间t,在阻塞态进程执行过程中,当等到超时时间t后,所述阻塞态进程依旧没有收到有效数据,则切换至执行其它任务,从而将阻塞态进程切换为执行非阻塞态进程,以提高进程的执行效率,避免过长时间的等待。Specifically, since multiple processes in the lower computer module 30 include communication modules and queue modules, and communication modules and queue modules generally include blocked processes, they are in a state of receiving data for a long time, resulting in It takes a long time and is time-consuming to wait. The timeout switching subunit 2011 performs timeout switching, and a timeout time t is set for the blocked process in the lower computer module 30. During the execution of the blocked process, after the timeout time t, the blocked process still does not receive the message. If there is valid data, it will switch to the execution of other tasks, thereby switching the blocking process to the non-blocking process to improve the execution efficiency of the process and avoid excessive waiting.
另一方面,在上位机模块10和下位机模块30的通信过程中,参考图2,通常是采用同步命令处理机制,即在上位机模块10发送命令之后,下位机模块30依次进行命令接受、命令执行和应答发送的过程,并在上位机模块10进行应答接受之后完成进程,但是这种方式导致需要整个同步命令处理完成之后才能进行其它进程,在一定程度上延长了进程的处理时间,而且无法做到时序可控。在本方案中,参考图3,通过采用所述异步切换子单元2012将同步命令处理切换为异步命令处理,基于异步命令处理机制,上位机模块10可以在收到下位机模块30中“命令接受”进程的“接收返回”信号后即可处理其它进程,不需要等到下位机模块30上的“命令接受”、“命令执 行”和“应答发送”都完成后收到“应答接受”信号才能进行其它进程,可以实现多个命令接受与命令执行并行处理,从而减少进程时间。On the other hand, during the communication process between the upper computer module 10 and the lower computer module 30, referring to Figure 2, a synchronous command processing mechanism is usually used, that is, after the upper computer module 10 sends a command, the lower computer module 30 sequentially accepts the command, The process of command execution and response sending is completed after the host computer module 10 accepts the response. However, this method requires that the entire synchronization command processing be completed before other processes can be carried out, which prolongs the processing time of the process to a certain extent, and The timing cannot be controlled. In this solution, referring to Figure 3, by using the asynchronous switching subunit 2012 to switch synchronous command processing to asynchronous command processing, based on the asynchronous command processing mechanism, the upper computer module 10 can receive the "command acceptance" from the lower computer module 30. "After receiving the return signal of the process, other processes can be processed. There is no need to wait until the "command acceptance", "command execution" and "response sending" on the lower computer module 30 are completed and the "response accept" signal is received before proceeding. For other processes, multiple command acceptance and command execution can be processed in parallel, thereby reducing process time.
具体的,上位机模块10将命令发送到下位机模块30之后,下位机模块30在接收到命令之后,发送接受返回指令到上位机模块10,而上位机模块10在接收到接受返回指令之后就可以执行其它进程,而命令执行的过程在下位机模块30中执行,若上位机模块10要获取应答结果,则下位机模块30在接收到应答发送的指令之后发送应答结果,上位机模块10获取应答结果,从而实现多个命令接受和命令执行的并行处理过程,有效减小了进程的执行时间。Specifically, after the upper computer module 10 sends the command to the lower computer module 30, after receiving the command, the lower computer module 30 sends an accept return instruction to the upper computer module 10, and the upper computer module 10 receives the accept return instruction. Other processes can be executed, and the command execution process is executed in the lower computer module 30. If the upper computer module 10 wants to obtain the response result, the lower computer module 30 will send the response result after receiving the instruction to send the response, and the upper computer module 10 will obtain the response result. response results, thereby realizing parallel processing of multiple command acceptance and command execution, effectively reducing the execution time of the process.
在一些实施例中,所述下位机模块30中生成的运动固件包括硬件诊断进程,所述硬件诊断进程包括队列处理任务、通信任务、控制算法、诊断任务和命令处理任务,所述周期中断单元2012用于将所述队列处理任务、所述通信任务、所述控制算法、所述诊断任务和所述命令处理任务按照轮询机制执行。In some embodiments, the motion firmware generated in the lower computer module 30 includes a hardware diagnostic process, which includes queue processing tasks, communication tasks, control algorithms, diagnostic tasks and command processing tasks. The periodic interrupt unit 2012 is used to execute the queue processing task, the communication task, the control algorithm, the diagnosis task and the command processing task according to a polling mechanism.
具体的,参考图4,对于下位机模块30中的硬件诊断进程,传统的运行时序是为多周期中断任务,在时间Ts内,首先完成控制算法,其余时间按照顺序完成队列处理任务、通信任务、诊断任务,但是由于在计算机上的运行环境为一个分时处理系统,无法保证按照该时序进行处理。因此通过周期中断单元2012对硬件诊断进程进行处理,参考图5,将硬件诊断进程由原来的执行时序变为轮询。Specifically, referring to Figure 4, for the hardware diagnosis process in the lower computer module 30, the traditional running sequence is a multi-cycle interrupt task. Within the time Ts, the control algorithm is first completed, and the queue processing tasks and communication tasks are completed in sequence during the rest of the time. , diagnostic tasks, but because the running environment on the computer is a time-sharing processing system, it cannot be guaranteed to be processed according to this timing. Therefore, the hardware diagnosis process is processed through the periodic interrupt unit 2012. Referring to FIG. 5, the hardware diagnosis process is changed from the original execution timing to polling.
在进一步的一些实施例中,所述周期中断单元2012将所述队列处理任务扩大缓存,对所述通信任务设置超时逻辑。从而拓展了队列和通信的性能, 以保证在执行硬件诊断进程的时候,队列处理任务和通信任务不会出现阻塞。In some further embodiments, the periodic interrupt unit 2012 expands the cache of the queue processing task and sets timeout logic for the communication task. This expands the performance of queues and communications to ensure that queue processing tasks and communication tasks will not be blocked when executing the hardware diagnostic process.
在又一些实施例中,所述诊断任务包括芯片级诊断子任务、板级诊断子任务、组件级诊断子任务和系统级诊断子任务,所述进程切换单元2013将所述芯片级诊断子任务、所述板级诊断子任务、所述组件级诊断子任务和所述系统级诊断子任务在同一个循环周期内执行,以定位出故障位置和故障时刻。In some embodiments, the diagnostic tasks include chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks. The process switching unit 2013 converts the chip-level diagnostic subtasks into The board-level diagnosis subtask, the component-level diagnosis subtask and the system-level diagnosis subtask are executed in the same cycle to locate the fault location and fault time.
具体的,参考图6,传统的方式是分别将芯片级诊断子任务、板级诊断子任务、组件级诊断子任务和系统级诊断子任务在不同的周期内中断,比如芯片级诊断子任务在20us定时中断,板级诊断子任务在200us定时中断,组件级诊断子任务在500us定时中断以及系统诊断子任务在1ms定时中断,但是由于计算机中优先级和定时机制无法同时有效运作,所以这种方式无法保证按照诊断子任务按照多周期的时间和顺序执行,影响故障诊断的效率。而在本方案中,参考图7,通过将芯片级诊断子任务、板级诊断子任务、组件级诊断子任务和系统级诊断子任务在一个诊断周期内循环运行,以确保在计算机时间流上可控的完成各个诊断功能,定位出相应的故障位置和时刻,完成故障诊断过程,提高诊断效率。Specifically, referring to Figure 6, the traditional method is to interrupt chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks and system-level diagnostic subtasks in different cycles. For example, the chip-level diagnostic subtask is interrupted in The board-level diagnostic subtask is scheduled to interrupt at 200us, the component-level diagnostic subtask is scheduled to interrupt at 500us, and the system diagnostic subtask is scheduled to interrupt at 1ms. However, because the priority and timing mechanisms in the computer cannot operate effectively at the same time, this This method cannot ensure that the diagnostic subtasks are executed in a multi-cycle time and sequence, which affects the efficiency of fault diagnosis. In this solution, referring to Figure 7, chip-level diagnostic subtasks, board-level diagnostic subtasks, component-level diagnostic subtasks, and system-level diagnostic subtasks are run cyclically within a diagnostic cycle to ensure that on the computer time flow Complete each diagnostic function in a controllable manner, locate the corresponding fault location and time, complete the fault diagnosis process, and improve diagnostic efficiency.
在一些实施例中,所述优先级切换单元204将所述下位机模块30中部分进程不同优先级的任务切换为统一的优先级,并将抢占式任务调度切换为非抢占式任务调度。In some embodiments, the priority switching unit 204 switches tasks with different priorities of some processes in the lower computer module 30 to a unified priority, and switches preemptive task scheduling to non-preemptive task scheduling.
具体的,参考图8,以五个执行任务为例,任务一、任务二和任务三的优先级依次递增,在任务一挂起状态恢复到就绪态时,在抢占式调度器的作 用下,任务一的执行就会被任务二抢占,而计算机上对于这种任务抢占逻辑的实现较为复杂,并且当有共享资源时,很难实现多任务的共同使用。因此本方案通过优先级切换单元2014将部分进程不同优先级的任务切换为统一的优先级,并将抢占式任务调度切换为非抢占式任务调度,能够有效降低任务分配和时序设计的工作量。参考图9,设计为四个同优先级任务一、任务二、任务三和任务四,每个任务分配的时间大小固定,均为系统时钟的倍数,比如5倍。其运行过程如下:先运行任务一,运行达到5个时钟周期后,通过时间片调度切换任务二,在任务二运行够5个系统时钟周期后,通过时间片调度切换到任务三,任务三在运行期间调用了阻塞API函数,调用函数后,会通过时间片调度切换到下一个任务四,即使此时任务三的5个系统时间节拍大小还没有用完,任务四运行5个系统时钟节拍后,通过时间片调度切换到任务一。在上述时间片轮询下,可以降低任务分配与任务时序设计的工作量,平台搭建时间大大降低。Specifically, refer to Figure 8, taking five execution tasks as an example. The priorities of task one, task two and task three increase in sequence. When task one returns to the ready state from the suspended state, under the action of the preemptive scheduler, The execution of task one will be preempted by task two. The implementation of this task preemption logic on the computer is more complicated, and when there are shared resources, it is difficult to realize the common use of multiple tasks. Therefore, this solution uses the priority switching unit 2014 to switch tasks of different priorities in some processes to a unified priority, and switches preemptive task scheduling to non-preemptive task scheduling, which can effectively reduce the workload of task allocation and timing design. Referring to Figure 9, the design is four tasks one, two, three and four with the same priority. The time allocated to each task is fixed and is a multiple of the system clock, such as 5 times. The running process is as follows: run task one first, and after running for 5 clock cycles, switch to task two through time slice scheduling. After task two runs for 5 system clock cycles, switch to task three through time slice scheduling. Task three is in The blocking API function is called during operation. After calling the function, it will switch to the next task four through time slice scheduling. Even if the five system time ticks of task three have not been used up at this time, task four will run for five system clock ticks. , switch to task one through time slice scheduling. Under the above time slice polling, the workload of task allocation and task timing design can be reduced, and the platform construction time is greatly reduced.
在另外一些实施例中,针对不同的设备,所述仿真控制平台中下位机模块30和虚拟对象模块40的设计过程如下:In some other embodiments, for different devices, the design process of the lower computer module 30 and the virtual object module 40 in the simulation control platform is as follows:
首先,在仿真软件Simulink中输入目标控制对象的特性信息和运动固件的特性信息,目标控制对象的特性信息包括机械特性信息、电气特性信息、运动特性信息和应用场景特性信息,运动固件的特性信息包括功能需求信息和性能需求信息,仿真软件Simulink对目标控制对象和运动固件进行建模,建模完成后,再基于仿真软件Simulink将目标控制对象和运动固件集成进行仿真测试,以进一步优化模型,分别得到虚拟对象模块40和下位机模块30对应的工程文件Plant.mdl与Firmware.mdl。First, input the characteristic information of the target control object and the characteristic information of the motion firmware into the simulation software Simulink. The characteristic information of the target control object includes mechanical characteristic information, electrical characteristic information, motion characteristic information and application scenario characteristic information. The characteristic information of the motion firmware Including functional requirement information and performance requirement information, the simulation software Simulink models the target control object and motion firmware. After the modeling is completed, the target control object and motion firmware are integrated for simulation testing based on the simulation software Simulink to further optimize the model. The project files Plant.mdl and Firmware.mdl corresponding to the virtual object module 40 and the host computer module 30 are obtained respectively.
由于得到的优化模型为mdl格式的工程文件,将Plant.mdl与Firmware.mdl同步生成C语言代码,并基于集成开发环境VS2019形成.sln工程文件,也就是Plant.sln与Firmware.sln,可在集成开发环境下将Plant.sln与Firmware.sln进行联合测试,以验证最终得到的模型的准确性。具体的,该测试过程为软件在环测试。Since the obtained optimization model is a project file in mdl format, Plant.mdl and Firmware.mdl are synchronized to generate C language code, and a .sln project file is formed based on the integrated development environment VS2019, that is, Plant.sln and Firmware.sln, which can be found in Plant.sln and Firmware.sln are jointly tested under the integrated development environment to verify the accuracy of the final model. Specifically, the testing process is software-in-the-loop testing.
需要说明的是,在运动固件与目标控制对象的设计过程中,同步完成上位机模块的设计,以得到上位机对应的额工程文件Host.sln,之后即可与Plant.sln、Firmware.sln联合测试,完成上位机模块的全场景测试,最后与硬件进行验证之后,即可得到最终的上位机模块10,以完成模型的设计过程。It should be noted that during the design process of motion firmware and target control objects, the design of the host computer module is completed simultaneously to obtain the corresponding project file Host.sln of the host computer, which can then be combined with Plant.sln and Firmware.sln. Test, complete the full-scenario test of the host computer module, and finally verify with the hardware, the final host computer module 10 can be obtained to complete the model design process.
在一些实施例中,具体的设计流程如下,参考图10,首先进行固件设计流程,在仿真软件Simulink中输入目标控制对象的特性信息和运动固件的特性信息之后,分别建模和生成代码并得到工程文件Plant.mdl与Firmware.mdl;之后分别对工程文件Plant.mdl与Firmware.mdl进行固件功能测试、性能测试和接口测试,若运动固件为测试完毕则对Firmware.mdl优化之后重新测试,直至测试完毕后结束固件设计流程。In some embodiments, the specific design process is as follows. Referring to Figure 10, the firmware design process is first carried out. After the characteristic information of the target control object and the characteristic information of the motion firmware are input into the simulation software Simulink, the code is modeled and generated respectively and obtained Project files Plant.mdl and Firmware.mdl; then perform firmware function test, performance test and interface test on the project files Plant.mdl and Firmware.mdl respectively. If the motion firmware is not tested, optimize the Firmware.mdl and retest until After the test is completed, the firmware design process ends.
之后进入到上位机设计流程,输入上位机需求之后开发完成对应的上位机模型,并进行测试优化得到优化后的上位机模型,在上位机模型调试完毕之后进行全场景测试,并在完成全场景测试过程之后继续判断是否调试完毕,在确定上位机模型最终调试完毕之后结束设计流程,得到最终的上位机模型。其中,在每次判断是否调试完毕的时候,如果没有调试完毕,则继续执行对上位机模型测试优化的过程,此处不再赘述。Then enter the host computer design process, input the host computer requirements, develop the corresponding host computer model, and perform test optimization to obtain the optimized host computer model. After the host computer model is debugged, conduct full-scenario testing, and complete the full scenario After the testing process, continue to judge whether the debugging is completed. After confirming that the final debugging of the host computer model is completed, the design process ends and the final host computer model is obtained. Among them, every time it is judged whether the debugging is completed, if the debugging is not completed, the process of testing and optimizing the host computer model will continue to be performed, which will not be described again here.
需要说明的是,本发明的仿真控制平台适用于传统制造业中,包括医疗 器械、半导体设备等各种需要高精度控制的设备,基于该仿真控制平台,可以让软件开发过程中不由硬件所拘束,通过对控制对象的精确分析和完整建模,上位机可在windows环境下就可完成全流程测试,而上整机时,上位机只需要对设备的性能进行调试,与硬件相关的工作量大量减少,并且可以讲开发时间较大缩短,提高开发效率。It should be noted that the simulation control platform of the present invention is suitable for traditional manufacturing industries, including medical equipment, semiconductor equipment and other equipment that require high-precision control. Based on this simulation control platform, the software development process can be freed from the constraints of hardware. , through precise analysis and complete modeling of the control objects, the host computer can complete the entire process test in the Windows environment. When installing the complete machine, the host computer only needs to debug the performance of the device, and the workload related to the hardware is It can be greatly reduced, and the development time can be greatly shortened and the development efficiency can be improved.
本发明还提供了一种上料交接测试方法,参考图11,采用上述的基于模型开发的仿真控制平台进行测试,所述上料交接测试方法包括步骤:The present invention also provides a loading and handover test method. Referring to Figure 11, the above-mentioned simulation control platform based on model development is used for testing. The loading and handover test method includes the steps:
S1101、通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,并反馈第一环境数据至所述下位机模块。S1101. Send handover command data to the slave computer module through the host computer module, so that the slave computer module controls the virtual object module to move to the handover position and feeds back the first environment data to the slave computer module.
在一些实施例中,所述通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,包括:In some embodiments, sending handover command data to the lower computer module through the upper computer module, so that the lower computer module controls the virtual object module to move to the handover position, includes:
所述上位机模块发送所述交接命令数据至所述下位机模块,所述交接命令数据包括交接位置坐标数据;The host computer module sends the handover command data to the slave computer module, where the handover command data includes handover position coordinate data;
所述下位机模块根据所述交接命令数据中的所述交接位置坐标数据运行固件控制算法以得到第一力数据,并获取在所述固件控制算法运行之前的位移数据和第一传感器数据;The lower computer module runs a firmware control algorithm according to the handover position coordinate data in the handover command data to obtain the first force data, and obtains the displacement data and the first sensor data before the firmware control algorithm is run;
所述下位机模块将所述第一力数据、所述位移数据和所述第一传感器数据发送至所述虚拟对象模块,通过所述第一力数据运行所述虚拟对象模块中的控制对象模型算法,以将所述虚拟对象模块移动到交接位置。The lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model in the virtual object module through the first force data. Algorithm to move the virtual object module to the handover position.
具体的,参考图12,在上料开始阶段,首先上位机模块通过以太网将包 含交接位置坐标数据发送到下位机模块,以便于控制上料设备中的XY轴运动到交接位置,其中交接位置坐标数据记为(x exchange,y exchange)。 Specifically, with reference to Figure 12, at the beginning of loading, the host computer module first sends the data containing the handover position coordinates to the lower computer module through Ethernet, so as to control the XY axis movement in the loading equipment to the handover position, where the handover position The coordinate data is recorded as (x exchange , y exchange ).
之后在下位机模块接收到交接命令数据中的交接位置坐标数据之后,下位机模块根据交接位置坐标数据循环运行固件控制算法得到第一力数据,并在每个循环结束之后通过以太网发送第一力数据至虚拟对象模块,同时所述下位机模块在每次循环运行固件控制算法的时候,分别获取位移数据和第一传感器数据,其中位移数据为XY轴运动到交接位置的位移数据,所述第一传感器数据包括交接位置的传感器数据Flag EXAfter the lower computer module receives the handover position coordinate data in the handover command data, the lower computer module cyclically runs the firmware control algorithm according to the handover position coordinate data to obtain the first force data, and sends the first force data through the Ethernet after each cycle. force data to the virtual object module. At the same time, the slave computer module obtains the displacement data and the first sensor data respectively when running the firmware control algorithm in each cycle. The displacement data is the displacement data of the XY axis moving to the handover position. The first sensor data includes sensor data Flag EX of the handover position.
之后下位机模块将第一力数据、所述位移数据和所述第一传感器数据发送至虚拟对象模块,并根据第一力数据运行虚拟对象模块中的控制对象模型算法,从而使得虚拟对象模块模拟运动到交接位置,以便于完成初步的运动模拟过程。Afterwards, the lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model algorithm in the virtual object module according to the first force data, thereby causing the virtual object module to simulate Move to the handover position to complete the preliminary motion simulation process.
在又一些实施例中,所述反馈第一环境数据至所述下位机模块,包括:In some embodiments, the feedback of the first environment data to the lower computer module includes:
在运行所述控制对象模型算法的过程中,获取所述位移数据和所述第一传感器数据,并将所述位移数据和所述第一传感器数据发送至所述下位机模块。During the process of running the control object model algorithm, the displacement data and the first sensor data are obtained, and the displacement data and the first sensor data are sent to the lower computer module.
具体的,在每次循环运行所述控制对象模型算法结束之后,将位移数据和第一传感器数据发送给下位机模块,以便于后续判断交接位置是否存在物料。Specifically, after each cycle of running the control object model algorithm ends, the displacement data and the first sensor data are sent to the lower computer module to facilitate subsequent judgment of whether there is material at the handover position.
S1102、在所述下位机模块通过所述第一环境数据在所述交接位置存在物料之后,通知所述上位机模块。S1102. After the lower computer module uses the first environment data to indicate the presence of materials at the handover position, notify the upper computer module.
具体的,当下位机模块接收到第一环境数据之后,获取第一环境数据中的真空传感器的压力数据以判断交接位置是否存在物料,在确定存在物料之后,发送通知信息至上位机模块,以便于上位机模块对上料过程进行模拟。Specifically, after the host computer module receives the first environment data, it obtains the pressure data of the vacuum sensor in the first environment data to determine whether there is material at the handover position. After determining that the material exists, a notification message is sent to the host computer module so that The loading process is simulated in the host computer module.
S1103、所述下位机模块发送物料运动命令数据,以模拟待运输的物料移动并固定在预设位置。S1103. The lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position.
在一些实施例中,其过程包括:In some embodiments, the process includes:
所述下位机模块发送标志位信息至所述虚拟对象模块,以模拟物料运动到所述预设位置,其中,所述标志位信息包括移动物料标志位和固定物料标志位。The lower computer module sends flag information to the virtual object module to simulate the movement of materials to the preset position, where the flag information includes moving material flags and fixed material flags.
具体的,所述下位机模块向虚拟对象模块分别发送移动物料标志位和固定物料标志位,从而模拟物料运动到预设位置的过程。其中,移动物料标志位对应表示在设备中机械手将物料搬运到对应位置,而固定物料标志位则表示模拟真空电磁阀打开至真空,以模拟物料固定在对应位置。Specifically, the lower computer module sends moving material flags and fixed material flags to the virtual object module respectively, thereby simulating the process of the material moving to the preset position. Among them, the moving material mark indicates that the robot moves the material to the corresponding position in the equipment, while the fixed material mark indicates that the simulated vacuum solenoid valve is opened to vacuum to simulate the material being fixed at the corresponding position.
在一些实施例中,模拟物料运动至对应位置和固定在对应位置的过程设置为1至10秒。In some embodiments, the process of simulating the material moving to the corresponding position and being fixed at the corresponding position is set to 1 to 10 seconds.
S1104、所述上位机模块发送处理命令数据至所述下位机模块,以使得所述下位机模块控制所述虚拟对象模块移动到处理位置,完成上料测试过程。S1104. The upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position to complete the loading test process.
在一些实施例中,上述过程包括:In some embodiments, the above process includes:
所述上位机模块发送所述处理命令数据至所述下位机模块,通过所述下位机模块运行所述处理命令数据之后得到第二力数据,并将所述第二力数据 发送至所述虚拟对象模块,以通过所述第二力数据运行所述控制对象模型算法,将所述虚拟对象模块移动到所述处理位置。The upper computer module sends the processing command data to the lower computer module, runs the processing command data through the lower computer module to obtain the second force data, and sends the second force data to the virtual computer module. and an object module to run the control object model algorithm through the second force data to move the virtual object module to the processing position.
当物料移动并固定在对应的位置之后,上位机模块发送处理命令数据至下位机模块,使得下位机模块根据处理命令数据运行固件模型算法后得到第二力数据,并将第二力数据发送至虚拟对象模块,使得虚拟对象模块根据第二力数据运行控制对象模型算法,从而在平台上将虚拟对象模块移动到处理位置,完成整个上料测试过程。When the material moves and is fixed at the corresponding position, the upper computer module sends processing command data to the lower computer module, so that the lower computer module runs the firmware model algorithm according to the processing command data to obtain the second force data, and sends the second force data to The virtual object module enables the virtual object module to run the control object model algorithm according to the second force data, thereby moving the virtual object module to the processing position on the platform to complete the entire loading and testing process.
其中,所述处理命令数据包括处理位置坐标数据Wherein, the processing command data includes processing position coordinate data
Figure PCTCN2022084038-appb-000001
以便于虚拟对象模块模拟运动到该位置。
Figure PCTCN2022084038-appb-000001
In order to facilitate the virtual object module to simulate movement to this position.
在上述的上料交接测试方法中,通过前述建立的仿真控制平台进行上料交接测试,只需要在计算机的windows环境下就可以完成对整个上料交接过程全流程的测试过程,不需要用到实物测试,与硬件相关的工作量大大减少,不仅有效减少了测试时间,而且提高了开发效率。In the above loading and handover test method, the loading and handover test is carried out through the simulation control platform established above. The entire loading and handover process can be tested only in the Windows environment of the computer. There is no need to use With physical testing, the workload related to hardware is greatly reduced, which not only effectively reduces testing time, but also improves development efficiency.
虽然在上文中详细说明了本发明的实施方式,但是对于本领域的技术人员来说显而易见的是,能够对这些实施方式进行各种修改和变化。但是,应理解,这种修改和变化都属于权利要求书中所述的本发明的范围和精神之内。而且,在此说明的本发明可有其它的实施方式,并且可通过多种方式实施或实现。Although the embodiments of the present invention have been described in detail above, it will be obvious to those skilled in the art that various modifications and changes can be made to these embodiments. However, it should be understood that such modifications and changes are within the scope and spirit of the invention as described in the claims. Furthermore, the invention described herein is capable of other embodiments and of being practiced or carried out in various ways.

Claims (12)

  1. 一种基于模型开发的仿真控制平台,其特征在于,包括依次通信连接的上位机模块、进程逻辑转换模块、下位机模块和虚拟对象模块,其中,所述上位机模块用于与所述下位机模块进行通信,所述下位机模块用于生成可供所述虚拟对象模块执行的运动固件,所述虚拟对象模块用于对目标控制对象进行建模设计,所述进程逻辑转换模块用于对所述下位机模块中的进程进行逻辑转换,以将所述下位机模块和所述上位机模块中的时序统一。A simulation control platform based on model development, characterized by including a host computer module, a process logic conversion module, a slave computer module and a virtual object module that are communicated with each other in sequence, wherein the host computer module is used to communicate with the slave computer module communicates, the lower computer module is used to generate motion firmware that can be executed by the virtual object module, the virtual object module is used to model and design the target control object, and the process logic conversion module is used to The process in the lower computer module is logically converted to unify the timing in the lower computer module and the upper computer module.
  2. 根据权利要求1所述的基于模型开发的仿真控制平台,其特征在于,所述进程逻辑转换模块包括阻塞状态切换单元、周期中断单元、进程切换单元和优先级切换单元中的至少一个,所述阻塞状态切换单元用于将所述下位机模块中的阻塞态进程切换为非阻塞态进程,所述周期中断单元用于将所述下位机模块中的多周期中断的任务转换为按时间片轮询的任务;所述进程切换单元用于将所述下位机模块中的部分多进程的诊断任务切换为单进程的诊断任务;所述优先级切换单元用于调整所述下位机模块中部分进程的优先级和任务调度情况。The simulation control platform based on model development according to claim 1, characterized in that the process logic conversion module includes at least one of a blocking state switching unit, a periodic interrupt unit, a process switching unit and a priority switching unit, and The blocking state switching unit is used to switch the blocking state process in the lower computer module to a non-blocking state process, and the periodic interrupt unit is used to convert the multi-cycle interrupted tasks in the lower computer module into time-based rounds. The process switching unit is used to switch some multi-process diagnostic tasks in the lower computer module to single-process diagnostic tasks; the priority switching unit is used to adjust some processes in the lower computer module priority and task scheduling.
  3. 根据权利要求2所述的基于模型开发的仿真控制平台,其特征在于,所述阻塞状态切换单元包括超时转换子单元和异步切换子单元中的至少一个,所述超时切换子单元用于对所述下位机模块中的阻塞态进程设置超时时间,并在等待所述超时时间且未收到有效数据后,从当前进程切换至执行其它进程;所述异步切换子单元用于将所述通信进程中的同步命令处理机制切换为异步命令处理机制,以实现多个命令的并行处理。The simulation control platform based on model development according to claim 2, characterized in that the blocking state switching unit includes at least one of a timeout switching subunit and an asynchronous switching subunit, and the timeout switching subunit is used to The blocked process in the lower computer module sets a timeout, and after waiting for the timeout and no valid data is received, it switches from the current process to executing other processes; the asynchronous switching subunit is used to switch the communication process The synchronous command processing mechanism in is switched to an asynchronous command processing mechanism to achieve parallel processing of multiple commands.
  4. 根据权利要求2所述的基于模型开发的仿真控制平台,其特征在于, 所述下位机模块中生成的运动固件包括硬件诊断进程,所述硬件诊断进程包括队列处理任务、通信任务、控制算法、诊断任务和命令处理任务,所述周期中断单元用于将所述队列处理任务、所述通信任务、所述控制算法、所述诊断任务和所述命令处理任务按照轮询机制执行。The simulation control platform based on model development according to claim 2, characterized in that, the motion firmware generated in the lower computer module includes a hardware diagnosis process, and the hardware diagnosis process includes queue processing tasks, communication tasks, control algorithms, Diagnosis task and command processing task, the periodic interrupt unit is used to execute the queue processing task, the communication task, the control algorithm, the diagnosis task and the command processing task according to the polling mechanism.
  5. 根据权利要求4所述的基于模型开发的仿真控制平台,其特征在于,所述周期中断单元将所述队列处理任务扩大缓存,对所述通信任务设置超时逻辑。The simulation control platform based on model development according to claim 4, characterized in that the periodic interrupt unit expands the cache of the queue processing task and sets timeout logic for the communication task.
  6. 根据权利要求4所述的基于模型开发的仿真控制平台,其特征在于,所述诊断任务包括芯片级诊断子任务、板级诊断子任务、组件级诊断子任务和系统级诊断子任务,所述进程切换单元将所述芯片级诊断子任务、所述板级诊断子任务、所述组件级诊断子任务和所述系统级诊断子任务在同一个循环周期内执行,以定位出故障位置和故障时刻。The simulation control platform based on model development according to claim 4, characterized in that the diagnostic tasks include chip-level diagnostic sub-tasks, board-level diagnostic sub-tasks, component-level diagnostic sub-tasks and system-level diagnostic sub-tasks. The process switching unit executes the chip-level diagnosis subtask, the board-level diagnosis subtask, the component-level diagnosis subtask and the system-level diagnosis subtask in the same cycle to locate the fault location and fault time.
  7. 根据权利要求2所述的基于模型开发的仿真控制平台,其特征在于,所述优先级切换单元将所述下位机模块中部分进程不同优先级的任务切换为统一的优先级,并将抢占式任务调度切换为非抢占式任务调度。The simulation control platform based on model development according to claim 2, characterized in that the priority switching unit switches the tasks of different priorities of some processes in the lower computer module to a unified priority, and preemptively Task scheduling switches to non-preemptive task scheduling.
  8. 一种上料交接测试方法,其特征在于,采用上述权利要求1至7任一项所述的基于模型开发的仿真控制平台进行测试,所述上料交接测试方法包括:A loading and handover test method, characterized in that the simulation control platform based on model development according to any one of the above claims 1 to 7 is used for testing, and the loading and handover test method includes:
    通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,并反馈第一环境数据至所述下位机模块;Send handover command data to the slave computer module through the host computer module, so that the slave computer module controls the virtual object module to move to the handover position and feeds back the first environment data to the slave computer module;
    在所述下位机模块通过所述第一环境数据在所述交接位置存在物料之后,通知所述上位机模块;After the lower computer module uses the first environment data to indicate the presence of materials at the handover position, it notifies the upper computer module;
    所述下位机模块发送物料运动命令数据,以模拟待运输的物料移动并固定在预设位置;The lower computer module sends material movement command data to simulate the movement of materials to be transported and fix them at a preset position;
    所述上位机模块发送处理命令数据至所述下位机模块,以使得所述下位机模块控制所述虚拟对象模块移动到处理位置,完成上料测试过程。The upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position to complete the loading test process.
  9. 根据权利要求8所述的上料交接测试方法,其特征在于,所述通过上位机模块发送交接命令数据至所述下位机模块,以使得所述下位机模块控制虚拟对象模块移动到交接位置,包括:The material loading and handover test method according to claim 8, characterized in that the handover command data is sent to the slave computer module through the host computer module, so that the slave computer module controls the virtual object module to move to the handover position, include:
    所述上位机模块发送所述交接命令数据至所述下位机模块,所述交接命令数据包括交接位置坐标数据;The host computer module sends the handover command data to the slave computer module, where the handover command data includes handover position coordinate data;
    所述下位机模块根据所述交接命令数据中的所述交接位置坐标数据运行固件控制算法以得到第一力数据,并获取在所述固件控制算法运行之前的位移数据和第一传感器数据;The lower computer module runs a firmware control algorithm according to the handover position coordinate data in the handover command data to obtain the first force data, and obtains the displacement data and the first sensor data before the firmware control algorithm is run;
    所述下位机模块将所述第一力数据、所述位移数据和所述第一传感器数据发送至所述虚拟对象模块,通过所述第一力数据运行所述虚拟对象模块中的控制对象模型算法,以将所述虚拟对象模块移动到交接位置。The lower computer module sends the first force data, the displacement data and the first sensor data to the virtual object module, and runs the control object model in the virtual object module through the first force data. Algorithm to move the virtual object module to the handover position.
  10. 根据权利要求9所述的上料交接测试方法,其特征在于,所述反馈第一环境数据至所述下位机模块,包括:The material loading and handover test method according to claim 9, characterized in that the feedback of the first environmental data to the lower computer module includes:
    在运行所述控制对象模型算法的过程中,获取所述位移数据和所述第一传感器数据,并将所述位移数据和所述第一传感器数据发送至所述下位机模 块。In the process of running the control object model algorithm, the displacement data and the first sensor data are obtained, and the displacement data and the first sensor data are sent to the lower computer module.
  11. 根据权利要求8所述的上料交接测试方法,其特征在于,所述下位机模块发送物料运动命令数据,以模拟待运输的物料移动并固定在预设位置,包括:The material loading and handover test method according to claim 8, characterized in that the lower computer module sends material movement command data to simulate the movement of the material to be transported and fix it at a preset position, including:
    所述下位机模块发送标志位信息至所述虚拟对象模块,以模拟物料运动到所述预设位置,其中,所述标志位信息包括移动物料标志位和固定物料标志位。The lower computer module sends flag information to the virtual object module to simulate the movement of materials to the preset position, where the flag information includes moving material flags and fixed material flags.
    根据权利要求8所述的上料交接测试方法,其特征在于,所述上位机模块发送处理命令数据至所述下位机模块,以使得所述下位机模块控制所述虚拟对象模块移动到处理位置,包括:The material loading and handover test method according to claim 8, characterized in that the upper computer module sends processing command data to the lower computer module, so that the lower computer module controls the virtual object module to move to the processing position. ,include:
  12. 所述上位机模块发送所述处理命令数据至所述下位机模块,通过所述下位机模块运行所述处理命令数据之后得到第二力数据,并将所述第二力数据发送至所述虚拟对象模块,以通过所述第二力数据运行所述控制对象模型算法,将所述虚拟对象模块移动到所述处理位置。The upper computer module sends the processing command data to the lower computer module, runs the processing command data through the lower computer module to obtain the second force data, and sends the second force data to the virtual computer module. and an object module to run the control object model algorithm through the second force data to move the virtual object module to the processing position.
PCT/CN2022/084038 2022-03-24 2022-03-30 Simulation control platform based on model development, and loading handover test method WO2023178723A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210296150.6 2022-03-24
CN202210296150.6A CN114690663A (en) 2022-03-24 2022-03-24 Simulation control platform based on model development and material loading handover test method

Publications (1)

Publication Number Publication Date
WO2023178723A1 true WO2023178723A1 (en) 2023-09-28

Family

ID=82138753

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084038 WO2023178723A1 (en) 2022-03-24 2022-03-30 Simulation control platform based on model development, and loading handover test method

Country Status (2)

Country Link
CN (1) CN114690663A (en)
WO (1) WO2023178723A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116227220B (en) * 2023-03-15 2023-11-03 广东工业大学 Construction method and system of three-dimensional virtual single machine configuration platform of SLT equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058854A1 (en) * 2013-08-20 2015-02-26 Synopsys, Inc. Direct Memory Interface Access in a Multi-Thread Safe System Level Modeling Simulation
CN104598306A (en) * 2014-12-05 2015-05-06 中国航空工业集团公司第六三一研究所 Process scheduling method in PHM simulation verification
CN105573296A (en) * 2016-01-15 2016-05-11 上海汽车变速器有限公司 Hardware-in-loop-based automation test system for automobile diagnosis, and method thereof
CN107367956A (en) * 2017-07-31 2017-11-21 北京金恒博远科技股份有限公司 A kind of automation simulation system and method
CN111103811A (en) * 2020-01-20 2020-05-05 清华大学 Control system semi-physical simulation platform
CN111739170A (en) * 2020-06-24 2020-10-02 武汉久同智能科技有限公司 Visual platform of industrial robot workstation
CN111782358A (en) * 2020-06-22 2020-10-16 北京北方华创微电子装备有限公司 Software control method for semiconductor process equipment and semiconductor process equipment
CN111985102A (en) * 2020-08-19 2020-11-24 西安中锐创联科技有限公司 Distributed integrated simulation method and system for multi-source heterogeneous model
CN112306875A (en) * 2020-10-30 2021-02-02 南京汽车集团有限公司 Automatic testing method based on HIL (hardware-in-the-loop) rack
CN113867889A (en) * 2021-09-24 2021-12-31 北京机电工程研究所 Distributed real-time simulation platform

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058854A1 (en) * 2013-08-20 2015-02-26 Synopsys, Inc. Direct Memory Interface Access in a Multi-Thread Safe System Level Modeling Simulation
CN104598306A (en) * 2014-12-05 2015-05-06 中国航空工业集团公司第六三一研究所 Process scheduling method in PHM simulation verification
CN105573296A (en) * 2016-01-15 2016-05-11 上海汽车变速器有限公司 Hardware-in-loop-based automation test system for automobile diagnosis, and method thereof
CN107367956A (en) * 2017-07-31 2017-11-21 北京金恒博远科技股份有限公司 A kind of automation simulation system and method
CN111103811A (en) * 2020-01-20 2020-05-05 清华大学 Control system semi-physical simulation platform
CN111782358A (en) * 2020-06-22 2020-10-16 北京北方华创微电子装备有限公司 Software control method for semiconductor process equipment and semiconductor process equipment
CN111739170A (en) * 2020-06-24 2020-10-02 武汉久同智能科技有限公司 Visual platform of industrial robot workstation
CN111985102A (en) * 2020-08-19 2020-11-24 西安中锐创联科技有限公司 Distributed integrated simulation method and system for multi-source heterogeneous model
CN112306875A (en) * 2020-10-30 2021-02-02 南京汽车集团有限公司 Automatic testing method based on HIL (hardware-in-the-loop) rack
CN113867889A (en) * 2021-09-24 2021-12-31 北京机电工程研究所 Distributed real-time simulation platform

Also Published As

Publication number Publication date
CN114690663A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
Gerstlauer et al. RTOS modeling for system level design
US20070168082A1 (en) Task-based robot control system for multi-tasking
KR101522477B1 (en) Simulation method, system and program
Stewart et al. The Chimera II real-time operating system for advanced sensor-based control applications
JP4975544B2 (en) Simulation apparatus and program
US8473269B1 (en) System-level hardware and software development and co-simulation system
JP5651251B2 (en) Simulation execution method, program, and system
JPH0895821A (en) Method and device for multitask program debugging
CN109814990A (en) A kind of distributed parallel collaborative simulation framework
WO2023178723A1 (en) Simulation control platform based on model development, and loading handover test method
US20140025365A1 (en) Simulation method, system, and program
WO2023115758A1 (en) Multi-thread controller of parallel robot
JP2014102734A (en) Performance verification program, performance verification method, and performance verification device
CN104597832B (en) PLC program scheduler IP core based on AMBA bus
EP2278454A1 (en) Method for correct-by-construction development of real-time-systems
JP4132802B2 (en) Method, apparatus and program for simulating general multitask software
Bruno et al. CAB: An environment for developing concurrent application
Goel et al. Handling multithreading approach using java
JP5226848B2 (en) Simulation apparatus and program
Li et al. Multi-tasking syetem design for multi-axis synchronous control of robot based on RTOS
US8914274B1 (en) Method and system for instruction set simulation with concurrent attachment of multiple debuggers
JPH0938876A (en) Simulation device
Ang et al. A Petri net based task scheduler as a real-time FMS controller
JPH07121405A (en) Simulation system
Havelund et al. Formal verification of an audio/video power controller using the real-time model checker UPPAAL

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22932784

Country of ref document: EP

Kind code of ref document: A1