Simulation method and device suitable for multi-brand movement mechanism
By creating and loading a dynamic link library of reverse kinematics and beat simulation interface functions in the motion mechanism, the problem of simulation accuracy and beat deviation of motion mechanisms in the prior art is solved, and high-precision simulation of multi-brand motion mechanisms is achieved.
Patent Information
- Application Number
- CN202411917256.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-25
AI Technical Summary
Existing offline programming software for sports mechanisms has problems of accuracy and beat deviation in action simulation, especially when it is difficult to achieve high-precision simulation between sports mechanisms of different brands and configurations.
By creating inverse kinematics interface functions and beat simulation interface functions, compiling them into dynamic link libraries, loading them into motion mechanisms, and calling these interface functions to achieve high-precision motion mechanism simulation.
High-precision simulation of multi-brand sports institutions is achieved, the problems of accuracy and beat deviation in the existing technology are overcome, and the accuracy and reliability of simulation results are ensured.
Smart Images

Figure CN119885593A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of motion mechanisms and related technical fields, and in particular, to a simulation method and device applicable to multi-brand motion mechanisms. Background Art
[0002] In recent years, with the continuous advancement and widespread application of industrial motion mechanisms, motion mechanism offline programming simulation technology, as an important branch derived from it, has also achieved remarkable development.
[0003] However, in current industry practice, common offline programming software for motion mechanisms still faces certain challenges in the field of motion mechanism motion simulation. These software mainly rely on the digital model of the motion mechanism and the generated processing trajectory points for simulation operations. The process requires interpolation of the simulated motion of the motion mechanism according to the preset instruction type on the trajectory point, and further application of the inverse kinematics algorithm at the interpolation point to obtain the joint angle of the motion mechanism, thereby completing the simulation process. Unfortunately, since the interpolation algorithm and the inverse kinematics algorithm are often difficult to keep consistent with the real motion mechanism, the simulation results of the offline programming software often deviate from the real motion mechanism in terms of accuracy and beat. What is more complicated is that different brands of motion mechanisms (even motion mechanisms of different configurations within the same brand) also have significant differences in beat control and inverse kinematics algorithms.
[0004] Therefore, there is an urgent need for an offline programming technology that can overcome the above limitations and achieve high-precision simulation support for motion mechanisms of various brands. Summary of the invention
[0005] The embodiments described in this article provide a simulation method and device applicable to multi-brand motion mechanisms, solving the problems existing in the prior art.
[0006] According to a first aspect of the present disclosure, a simulation method applicable to multi-brand motion mechanisms is provided, comprising:
[0007] Receive the start command, parse it and obtain the offline programming file;
[0008] Based on the offline programming file, obtaining the name of the dynamic link library of the corresponding motion mechanism;
[0009] When the name of the dynamic link library is not empty, loading the dynamic link library;
[0010] When the dynamic link library is loaded successfully, obtaining the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library;
[0011] When the beat simulation interface function is not empty, the beat simulation interface function is called and the interpolation calculation parameters are passed in, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to realize the beat simulation.
[0012] In some embodiments of the present disclosure, the inverse kinematics interface function and the beat simulation interface function have been pre-packaged in the same dynamic link library as two functions of the dynamic link library.
[0013] In some embodiments of the present disclosure, before the step of receiving the start command, the step includes:
[0014] Creating the inverse kinematics interface function and the beat simulation interface function;
[0015] Compiling and encapsulating the inverse kinematics interface function and the beat simulation interface function into the same dynamic link library;
[0016] The name of the dynamic link library is stored in the motion mechanism.
[0017] In some embodiments of the present disclosure, after the step of acquiring the name of the dynamic link library of the motion mechanism based on the offline programming file, the following steps are included:
[0018] Determine whether the name of the dynamic link library is empty;
[0019] When the name of the dynamic link library is empty, a default interpolation algorithm is used for motion simulation.
[0020] In some embodiments of the present disclosure, after the step of loading the dynamic link library, the method further includes:
[0021] Determine whether the dynamic link library is loaded successfully;
[0022] When the dynamic link library fails to load, an error message is recorded, and a default interpolation algorithm is used to perform motion simulation.
[0023] In some embodiments of the present disclosure, after the step of obtaining the beat simulation interface function and the inverse kinematics interface function pre-created in the dynamic link library, the method further includes:
[0024] Determine whether the beat simulation interface function is empty;
[0025] When the beat simulation interface function is empty, the default interpolation algorithm motion simulation is used.
[0026] In some embodiments of the present disclosure, after the step of using the default interpolation algorithm to perform motion simulation, the following steps are included:
[0027] Determine whether the inverse kinematics interface function is empty;
[0028] When the inverse kinematics interface function is not empty, the inverse kinematics interface function is called and the interpolation calculation parameters are passed in, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to realize beat simulation and inverse kinematics calculation;
[0029] When the inverse kinematics interface function is empty, the default built-in inverse kinematics algorithm is used to perform inverse kinematics solution, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to achieve beat simulation and inverse kinematics calculation.
[0030] In some embodiments of the present disclosure, it further includes:
[0031] Monitor the status of the loaded dynamic link library in real time, including but not limited to the loading status of the interface function, the number of times the interface function is called, and the error log, and when an abnormal status is detected, warn the user or automatically try to reload the dynamic link library.
[0032] In some embodiments of the present disclosure, the step of updating the state of the motion mechanism using the result returned by the beat simulation interface function includes:
[0033] The obtained joint angles are used to update the angles of each axis of the motion mechanism.
[0034] According to a second aspect of the present disclosure, a simulation device applicable to multi-brand motion mechanisms is provided, comprising:
[0035] A parsing module, used for receiving a start command, parsing it and obtaining an offline programming file;
[0036] A first extraction module, used for acquiring the name of the dynamic link library of the corresponding motion mechanism based on the offline programming file;
[0037] A loading module, used for loading the dynamic link library when the name of the dynamic link library is not empty;
[0038] A second extraction module is used to obtain the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library when the dynamic link library is loaded successfully;
[0039] The first processing module is used to call the beat simulation interface function and pass in interpolation calculation parameters when the beat simulation interface function is not empty, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation.
[0040] In some embodiments of the present disclosure, it further includes:
[0041] A configuration module is used to create the inverse kinematics interface function and the beat simulation interface function; compile and encapsulate the inverse kinematics interface function and the beat simulation interface function into the same dynamic link library; and store the name of the dynamic link library in the motion mechanism.
[0042] In some embodiments of the present disclosure, it further includes:
[0043] A first judging module, used to judge whether the name of the dynamic link library is empty;
[0044] The second processing module is used to use a default interpolation algorithm to perform motion simulation when the name of the dynamic link library is empty.
[0045] In some embodiments of the present disclosure, it further includes:
[0046] A second judging module is used to judge whether the dynamic link library is loaded successfully;
[0047] The third processing module is used to record error information when the dynamic link library fails to load, and use a default interpolation algorithm to perform motion simulation.
[0048] In some embodiments of the present disclosure, it further includes:
[0049] The third judging module is used to judge whether the beat simulation interface function is empty;
[0050] The fourth processing module is used to use a default interpolation algorithm for motion simulation when the beat simulation interface function is empty.
[0051] In some embodiments of the present disclosure, it further includes:
[0052] A fourth judgment module, used to judge whether the inverse kinematics interface function is empty;
[0053] A fifth processing module, for, when the inverse kinematics interface function is not empty, calling the inverse kinematics interface function and passing in the interpolation calculation parameters, and using the result returned by the beat simulation interface function to update the state of the motion mechanism, so as to realize the beat simulation and inverse kinematics calculation;
[0054] The sixth processing module is used to use the default built-in inverse kinematics algorithm to perform inverse kinematics solution when the inverse kinematics interface function is empty, and to update the state of the motion mechanism using the result returned by the beat simulation interface function to achieve beat simulation and inverse kinematics calculation.
[0055] In some embodiments of the present disclosure, it further includes:
[0056] The monitoring module is used to monitor the status of the loaded dynamic link library in real time, including but not limited to the loading status of the interface function, the number of times the interface function is called, and the error log, and when an abnormal state is detected, it warns the user or automatically attempts to reload the dynamic link library.
[0057] According to a third aspect of the present disclosure, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method in any one of the above embodiments are implemented.
[0058] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.
[0059] The simulation method and device applicable to multi-brand motion mechanisms provided by the disclosed embodiment receive a start command, parse it and obtain an offline programming file, and obtain the name of the dynamic link library of the motion mechanism based on the offline programming file; when the name of the dynamic link library is not empty, load the dynamic link library; when the dynamic link library is loaded successfully, obtain the beat simulation interface function and the inverse kinematics interface function pre-created in the dynamic link library; when the beat simulation interface function is not empty, call the beat simulation interface function and pass in the interpolation calculation parameters, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation. It is achieved that by creating two interface functions and developing a corresponding dynamic link library, the inverse kinematics interface function and the beat simulation interface function can be called to achieve high-precision simulation of motion mechanisms of different brands by offline programming software.
[0060] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0062] Figure 1 It is a flow chart of a simulation method applicable to multi-brand motion mechanisms provided by an embodiment of the present disclosure;
[0063] Figure 2It is a structural schematic diagram of a simulation device applicable to multi-brand motion mechanisms provided by an embodiment of the present disclosure;
[0064] Figure 3 It is a flowchart of a simulation method of an example provided by an embodiment of the present disclosure;
[0065] Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present disclosure.
[0066] In the drawings, reference numerals with the same last two digits correspond to the same elements. It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0069] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists, A and B exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0070] Furthermore, in all embodiments of the present disclosure, terms such as “first” and “second” are used only to distinguish one component (or a part of a component) from another component (or another part of a component).
[0071] In the description of the present application, unless otherwise specified, "plurality" means more than two (including two), and similarly, "multiple groups" means more than two groups (including two).
[0072] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0073] Glossary:
[0074] Offline programming of motion mechanism: refers to the operator building a three-dimensional virtual environment of the entire motion mechanism working application scenario in the programming software, and then performing a series of operations according to relevant requirements such as processing technology to automatically generate the motion trajectory of the motion mechanism, that is, the control instructions, and then simulating and adjusting the trajectory in the software, and finally generating the motion mechanism execution program and transmitting it to the motion mechanism.
[0075] Dynamic Link Library: (DLL) is an executable file containing code and data, which allows the program to dynamically load and call functions in it at runtime. It can be called by multiple applications at the same time, realizing the sharing of code and resources and reducing the memory space occupied. Applications can load dynamic link libraries as needed at runtime instead of statically linking them to executable files at compile time. By updating the dynamic link library, you can easily add new features or fix errors to the application without recompiling the entire application. Working principle: When the application starts running or calls a function in the dynamic link library for the first time, the operating system loads the dynamic link library into memory. The loading process includes operations such as memory mapping, linking, and relocation to ensure that the functions and variables in the dynamic link library can be correctly accessed by the application. The dynamic link library loaded in memory will be shared by multiple applications, reducing the overhead of duplicate code.
[0076] Kernel: A set of code modules or runtime libraries that handle a specific task or function.
[0077] The simulation method applicable to multi-brand motion mechanisms provided in the embodiments of the present disclosure is applied to a terminal device based on offline programming software.
[0078] Based on the problems existing in the existing technology, Figure 1 is a flow chart of a simulation method applicable to multi-brand motion mechanisms provided by an embodiment of the present disclosure, such as Figure 1 As shown in the figure, the specific process of the simulation method applicable to multi-brand motion mechanisms includes:
[0079] S110, receiving a start command, parsing it and obtaining an offline programming file.
[0080] In the specific implementation process, at the initialization stage of the motion simulation of the motion mechanism, the offline programming software (such as PQArt offline programming software) first receives the start command from the user. This command triggers the start of the entire simulation process. Subsequently, the start command is parsed to extract key information from the start command. During the parsing process, the offline programming file is successfully obtained. The offline programming file is an important preparation before the motion mechanism is operated. It contains all the programming instructions and parameters required for the motion mechanism to perform specific tasks.
[0081] It should be noted that before implementing the above steps, the following steps are also included:
[0082] S100, creating the inverse kinematics interface function and the beat simulation interface function; compiling and encapsulating the inverse kinematics interface function and the beat simulation interface function into the same dynamic link library; storing the name of the dynamic link library into the file of the motion mechanism.
[0083] In the specific implementation process, in order to achieve accurate docking between the offline programming software and the motion mechanism, two core interface functions need to be created first: the inverse kinematics interface function and the beat simulation interface function. The implementation of these two interface functions must strictly follow the inverse kinematics solution algorithm and beat control logic in the real motion mechanism to ensure that their functions are consistent with the real motion mechanism. The main function of the inverse kinematics interface function is to infer the angles that each joint of the motion mechanism should reach based on the target position and posture of the end effector of the motion mechanism, which is the key to achieving precise motion control. This function usually receives the target position (such as three-dimensional coordinates) and posture (such as rotation matrix or Euler angle) of the end effector as input parameters, and returns a set of joint angles as output. The beat simulation interface function is used to simulate the motion process of the motion mechanism in the actual production environment, including the motion speed, acceleration and possible delay of each joint. This function usually receives a series of motion parameters (such as starting position, target position, motion trajectory, speed curve, etc.) as input, and returns a series of joint angles and timestamps to represent the state of the motion mechanism at different time points to evaluate its work efficiency and performance.
[0084] Next, the brand of the motion mechanism compiles and encapsulates the above-created inverse kinematics interface function and beat simulation interface function into the same C++ dynamic link library (DLL). According to the inverse kinematics solution and beat logic in the real machine, the two interface functions of interface function 1 and interface function 2 are implemented, and the dynamic link library is provided. This dynamic link library will contain all the necessary algorithms and logic to implement the functions of these two interface functions. The brand can choose to fully implement these two interface functions, or choose to only implement the inverse kinematics interface function. If only the inverse kinematics interface function is implemented, although the motion of the motion mechanism can be ensured to be consistent with the real motion mechanism in the simulation, that is, at a certain point in space, the joint angle of the motion mechanism in the offline simulation software of the motion mechanism is exactly the same as that of the real motion mechanism (that is, to achieve "high-precision" motion consistency), it cannot ensure that the beat is consistent with the real motion mechanism. The ideal fully high-precision simulation requires not only consistent movements, but also completely consistent beats. Therefore, implementing the beat simulation interface function can not only ensure that the beat is consistent with the real motion mechanism, but also further ensure the consistency of the movement.
[0085] During the compilation process, you need to ensure that the names and parameter types of the interface functions are consistent with the creation, and use appropriate compiler directives and linker settings to export these functions so that they can be called in the offline programming software.
[0086] Finally, in order to achieve the connection between the offline programming software and different brands of motion mechanisms, the brand of the motion mechanism stores the name of the dynamic link library that implements the above-mentioned inverse kinematics interface function and beat simulation interface function into the offline programming file of the motion mechanism. The offline programming file contains all the parameters and instructions required for the motion mechanism to move, as well as the reference information for calling a specific dynamic link library. By storing the name of the dynamic link library in the offline programming file, the corresponding interface function algorithm can be quickly loaded when needed, thereby achieving flexible support and efficient simulation of motion mechanisms of different brands.
[0087] By creating an interface function, compiling and encapsulating it into a dynamic link library, and storing the name of the dynamic link library in the offline programming file, the offline programming software can be accurately connected with different motion mechanism brands, and provide users with a high-precision and high-reliability simulation experience.
[0088] S120, extracting the name of the dynamic link library of the corresponding motion mechanism based on the offline programming file;
[0089] In the specific implementation process, the offline programming file contains the motion mechanism, and the name of the dynamic link library is recorded in the motion mechanism. Once the offline programming file is successfully obtained by the offline programming software, the offline programming software will extract the name of the dynamic link library recorded with the current motion mechanism. The dynamic link library is an indispensable part of the motion mechanism software. It contains the functions and algorithms required for the motion mechanism to perform various tasks. By extracting the name of the dynamic link library, the required library file can be accurately located, preparing for the subsequent loading and use of the functions in the library.
[0090] In addition, after the implementation of S120, it also includes:
[0091] Determine whether the name of the dynamic link library is empty;
[0092] When the name of the dynamic link library is empty, a default interpolation algorithm is used for motion simulation.
[0093] In a specific implementation, an interpolation algorithm is a commonly used mathematical method that can deduce unknown data points based on known data points. In motion simulation of a motion mechanism, an interpolation algorithm can be used to deduce parameters such as the angles and speeds of each joint in the motion process of the motion mechanism based on the starting point and end point of the motion mechanism, as well as possible intermediate points. Although the interpolation algorithm may not be as accurate and efficient as the professional algorithm in the dynamic link library, in some cases, it can still be used as an effective alternative to ensure the smooth progress of the simulation process. Using the default interpolation algorithm for motion simulation means that it will not rely on a specific dynamic link library or external algorithm, but uses built-in mathematical methods or logic to deduce parameters such as the angles and speeds of each joint of the motion mechanism in the motion process. These interpolation algorithms are usually based on some basic mathematical principles, such as linear interpolation, quadratic interpolation, cubic spline interpolation, etc., which can deduce unknown motion parameters based on known motion parameters of the motion mechanism (such as starting point, end point, motion trajectory, etc.).
[0094] Although the default interpolation algorithms may not be as accurate and efficient as those in professional dynamic link libraries, they can still serve as an effective alternative in some cases. Especially when the dynamic link library is unavailable, fails to load, or has incompatible versions, using the default interpolation algorithm can ensure the smooth progress of the simulation process and avoid simulation failure or interruption due to missing algorithms.
[0095] When using the default interpolation algorithm for motion simulation, the parameters such as the joint angles and speeds of the motion mechanism during the motion process are calculated based on the motion parameters and process parameters of the motion mechanism provided in the offline programming file and combined with the mathematical principles of the interpolation algorithm. Then, these parameters are used to update the state of the motion mechanism, for example, the angles of the axes of the motion mechanism are refreshed using parameters such as joint angles and speeds to reflect the actual motion of the motion mechanism in the current simulation step.
[0096] It should be noted that since the default interpolation algorithm may not fully simulate the complex motion process of the motion mechanism in the actual production environment, there may be certain errors or limitations when using them for simulation. In order to obtain more accurate and reliable simulation results, it is recommended to use professional dynamic link libraries and algorithms for simulation whenever possible. At the same time, when using the default interpolation algorithm for simulation, the system should also issue corresponding prompts or warnings to the user so that the user understands the limitations and potential risks of the simulation.
[0097] S130: when the name of the dynamic link library is not empty, load the dynamic link library;
[0098] In a specific implementation, when the name of the dynamic link library is not empty, the dynamic link library is loaded to flexibly call the inverse kinematics algorithm and beat simulation algorithm corresponding to motion mechanisms of different brands or models, thereby achieving accurate simulation effects.
[0099] In addition, after the implementation of S130, it also includes:
[0100] Determine whether the dynamic link library is loaded successfully;
[0101] When the dynamic link library fails to load, an error message is recorded, and a default interpolation algorithm is used to perform motion simulation.
[0102] In the specific implementation process, judging whether the dynamic link library is loaded successfully usually involves the following checks: 1. Loading status check: The system checks the loading status code or error information returned by the operating system. If the status code indicates that the loading is successful, or no error information is returned, the dynamic link library can be considered to have been successfully loaded. 2. Function verification: For the beat simulation interface function in the dynamic link library, determine whether it is empty. If it is not empty and points to a valid memory address, it can be considered that the corresponding function has been successfully loaded and can be used for simulation. 3. Dependency check: The dynamic link library may depend on other libraries or resources. The system checks whether these dependencies have also been successfully loaded. If any dependency fails to load, the dynamic link library may not work properly. 4. Logging and error handling: During the process of loading the dynamic link library, the system will record detailed log information, including the time of the load attempt, the name of the loaded library, the loading status, and any related error information. This information is crucial for subsequent problem diagnosis and troubleshooting.
[0103] If the dynamic link library fails to load, the system will trigger the error handling mechanism, which may include displaying an error message to the user, recording an error log, trying to load an alternative dynamic link library, or using the default interpolation algorithm for simulation.
[0104] S140, when the dynamic link library is loaded successfully, obtaining the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library;
[0105] In a specific implementation, the inverse kinematics interface function and the beat simulation interface function have been pre-packaged in the same dynamic link library as two functions of the dynamic link library.
[0106] In addition, after the implementation of S140, it also includes:
[0107] Determine whether the beat simulation interface function is empty;
[0108] When the beat simulation interface function is empty, the default interpolation algorithm motion simulation is used.
[0109] In a specific implementation, it is determined whether the beat simulation interface function is empty. If the beat simulation interface function is empty, it indicates that no corresponding beat simulation interface function is found in the dynamic link library. In this case, an alternative solution will be adopted:
[0110] 1. Use the default interpolation algorithm: Call the built-in default interpolation algorithm for motion simulation. These algorithms are usually based on some basic mathematical methods, such as linear interpolation, quadratic interpolation, etc., which are used to calculate the angles of each joint in the motion process of the motion mechanism based on the starting and ending points of the motion mechanism and possible intermediate points.
[0111] 2. Evaluate simulation results: After simulating using the default interpolation algorithm, the simulation results are evaluated. Although these results may not be as accurate as those obtained using the professional beat simulation interface functions, in some cases they can still serve as an effective alternative to ensure the smooth progress of the simulation process.
[0112] Through the above steps, it can be ensured that the interface function can be successfully called for beat simulation in the future.
[0113] S150. When the beat simulation interface function is not empty, call the beat simulation interface function and pass in interpolation calculation parameters, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation.
[0114] The obtained joint angles are used to update the angles of each axis of the motion mechanism.
[0115] In a specific implementation, when the dynamic link library is successfully loaded and the beat simulation interface function is not empty, the actual call of the beat simulation will be performed next, which simulates the movement process of the motion mechanism in the actual production environment and evaluates the working efficiency and performance of the motion mechanism accordingly.
[0116] Specifically, if the beat simulation interface function is not empty, the following operations will be performed:
[0117] 1. Prepare interpolation calculation parameters: Prepare parameters for interpolation calculation according to the motion parameters and process parameters of the motion mechanism provided in the offline programming file. These parameters may include the starting position, target position, motion trajectory, speed, acceleration, etc. of the motion mechanism.
[0118] 2. Call the beat simulation interface function and pass the prepared interpolation calculation parameters in. The interface function will calculate the joint angles of the motion mechanism during the motion process based on these parameters and the algorithm encapsulated in the dynamic link library as the result returned by the beat simulation interface function.
[0119] 3. Use the results returned by the beat simulation interface function to update the state of the motion mechanism. For example, after receiving the joint angles returned by the beat simulation interface function, use the joint angles to refresh the angles of each axis in the motion mechanism to reflect the actual state of the motion mechanism in the current simulation step.
[0120] 4. Subsequent simulation steps: After updating the status of the motion mechanism, for example, refreshing the angles of each axis of the motion mechanism, continue to execute subsequent simulation steps until the entire simulation process is completed.
[0121] It should be noted that when using the default interpolation algorithm for simulation, the algorithm can be adjusted and optimized according to the parameters provided in the offline programming file to improve the accuracy and efficiency of the simulation. At the same time, the use of the default interpolation algorithm can be recorded, and warnings or prompts can be issued to the user when possible so that the user understands the limitations and potential risks of the simulation.
[0122] In addition, after implementing the steps described above for using the default interpolation algorithm for dynamic simulation, it also includes:
[0123] S160, determining whether the inverse kinematics interface function is empty;
[0124] S170, when the inverse kinematics interface function is not empty, calling the inverse kinematics interface function and passing in the interpolation calculation parameters, and using the result returned by the beat simulation interface function to update the state of the motion mechanism, so as to realize the beat simulation and inverse kinematics calculation;
[0125] S180. When the inverse kinematics interface function is empty, the default built-in inverse kinematics algorithm is used to perform inverse kinematics solution, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to achieve beat simulation and inverse kinematics calculation.
[0126] In addition, after implementing the above steps, it also includes:
[0127] S190. Monitor the status of the loaded dynamic link library in real time, including but not limited to the loading status of the interface function, the number of times the interface function is called, and the error log. When an abnormal state is detected, warn the user or automatically try to reload the dynamic link library to ensure the stability and accuracy of the simulation.
[0128] The simulation method applicable to multi-brand motion mechanisms provided by the disclosed embodiment receives a start command, parses it and obtains an offline programming file, and obtains the name of the dynamic link library of the motion mechanism based on the offline programming file; when the name of the dynamic link library is not empty, loads the dynamic link library; when the dynamic link library is loaded successfully, obtains the beat simulation interface function and the inverse kinematics interface function pre-created in the dynamic link library; when the beat simulation interface function is not empty, calls the beat simulation interface function and passes in the interpolation calculation parameters, and uses the result returned by the beat simulation interface function to update the state of the motion mechanism to realize beat simulation. It is realized that by creating two interface functions and developing a corresponding dynamic link library, the inverse kinematics interface function and the beat simulation interface function can be called to realize the high-precision simulation of motion mechanisms of various brands by offline programming software.
[0129] On the basis of the above embodiments, the present disclosure also provides a simulation device applicable to multi-brand motion mechanisms, such as Figure 3 As shown, the simulation device suitable for multi-brand motion mechanisms includes:
[0130] The parsing module 210 is used to receive the start command, parse it and obtain the offline programming file;
[0131] A first extraction module 220, for acquiring the name of the dynamic link library of the corresponding motion mechanism based on the offline programming file;
[0132] A loading module 230, configured to load the dynamic link library when the name of the dynamic link library is not empty;
[0133] A second extraction module 240 is used to obtain the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library when the dynamic link library is loaded successfully;
[0134] The first processing module 250 is used to call the beat simulation interface function and pass in interpolation calculation parameters when the beat simulation interface function is not empty, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation.
[0135] In a specific embodiment, it also includes:
[0136] Configuration module 200 is used to create the inverse kinematics interface function and the beat simulation interface function; compile and encapsulate the inverse kinematics interface function and the beat simulation interface function into the same dynamic link library; and store the name of the dynamic link library in the motion mechanism.
[0137] In a specific embodiment, it also includes:
[0138] A first judging module 261 is used to judge whether the name of the dynamic link library is empty;
[0139] The second processing module 262 is used to use a default interpolation algorithm to perform motion simulation when the name of the dynamic link library is empty.
[0140] In a specific embodiment, it also includes:
[0141] The second judging module 271 is used to judge whether the dynamic link library is loaded successfully;
[0142] The third processing module 272 is used to record error information when the dynamic link library fails to load, and use a default interpolation algorithm to perform motion simulation.
[0143] In a specific embodiment, it also includes:
[0144] The third judging module 281 is used to judge whether the beat simulation interface function is empty;
[0145] The fourth processing module 282 is used to use the default interpolation algorithm motion simulation when the beat simulation interface function is empty.
[0146] In a specific embodiment, it also includes:
[0147] The fourth judging module 291 is used to judge whether the inverse kinematics interface function is empty;
[0148] The fifth processing module 292 is used for calling the inverse kinematics interface function and passing in the interpolation calculation parameters when the inverse kinematics interface function is not empty, and using the result returned by the beat simulation interface function to update the state of the motion mechanism to realize the beat simulation and inverse kinematics calculation;
[0149] The sixth processing module 293 is used to use the default built-in inverse kinematics algorithm to perform inverse kinematics solution when the inverse kinematics interface function is empty, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation and inverse kinematics calculation.
[0150] In a specific embodiment, it also includes:
[0151] The monitoring module is used to monitor the status of the loaded dynamic link library in real time, including but not limited to the loading status of the interface function, the number of times the interface function is called, and the error log, and when an abnormal state is detected, it warns the user or automatically attempts to reload the dynamic link library.
[0152] The simulation device suitable for multi-brand motion mechanisms provided by the embodiment of the present disclosure realizes high-precision simulation of motion mechanisms of various brands by offline programming software by calling inverse kinematics interface functions and beat simulation interface functions by creating two interface functions and developing a corresponding dynamic link library.
[0153] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0154] The following is an example to illustrate: Figure 3 The figure shows a flow chart of this embodiment.
[0155] Step 1: Create an interface function
[0156] In order to ensure that the PQArt offline programming software can seamlessly connect with the real logic of different motion mechanism brands, two interface functions are created: interface function 1 (inverse kinematics interface function) and interface function 2 (beat simulation interface function) to enhance the high-precision simulation capability of the PQArt offline programming software, so that it can more accurately simulate the motion performance of the motion mechanism in the actual production environment.
[0157] Interface function 1: Inverse kinematics interface function
[0158] Function: According to the target position and posture of the end effector of the kinematic mechanism, the angles that each joint of the kinematic mechanism should reach are inferred. This is the basis for ensuring that the kinematic mechanism in the simulation is consistent with the real kinematic mechanism.
[0159] Application scenarios: Mainly used for functions similar to "moving to a point", that is, moving the motion mechanism to a specific point and verifying whether its posture at this point is accurate.
[0160] The inverse kinematics interface functions are shown in Table 1:
[0161]
[0162] Table 1
[0163] Interface function 2: Beat simulation interface function
[0164] Function: Simulate the motion process of the motion mechanism in the actual production environment, including the motion speed, acceleration and possible delay of each joint, so as to evaluate the working efficiency and performance of the motion mechanism.
[0165] Application scenarios: Mainly used in simulation situations, where users need to see the continuity of the motion mechanism's actions, including changes in acceleration and deceleration, to ensure that the beat is consistent with the real motion mechanism.
[0166] The beat simulation interface function is shown in Table 2:
[0167]
[0168] Table 2
[0169] Step 2: Development of dynamic link library, implementation and storage of interface functions
[0170] In order to encapsulate the interpolation and inverse kinematics algorithm logic in the motion mechanism controller, a dynamic link library was developed using the C++ language. In this dynamic link library, the above two interface functions are implemented: interface function 1 (inverse kinematics interface function) and interface function 2 (beat simulation interface function). During the simulation process, the PQArt offline programming software will directly call these two interface functions from the same dynamic link library as needed. For interface function 1, it is mainly used to verify whether the position and posture of the motion mechanism at a specific point are accurate; while for interface function 2, it is used to simulate the continuity and beat of the motion of the motion mechanism to provide a more realistic simulation experience.
[0171] Each motion mechanism brand needs to develop its own dynamic link library based on the C / C++ language according to the agreed interface function specifications. According to the R&D capabilities of the motion mechanism brand, it can choose to implement two interface functions, or only implement the inverse kinematics interface function. However, it should be noted that only implementing the inverse kinematics interface function can only ensure that the motion mechanism action in the simulation is consistent with the real machine, but cannot ensure the beat consistency.
[0172] The implementation of the interface function needs to be carried out strictly in accordance with the inverse kinematics solution and beat logic in the real machine to ensure the accuracy and reliability of the simulation.
[0173] The names of the dynamic link libraries that implement the inverse kinematics interface function and the beat simulation interface function are stored in the offline programming file. In this way, when the PQArt offline programming software loads a certain offline programming file, it can automatically identify and load the dynamic link library of the corresponding motion mechanism.
[0174] Step 3: Start PQArt offline programming software and select the corresponding motion mechanism based on the offline programming file;
[0175] Step 4: When the user of the PQArt offline programming software uses the motion mechanism for simulation, PQArt will obtain the name of the dynamic link library of the corresponding motion mechanism and determine whether the name of the dynamic link library is empty.
[0176] Step 5: When the name of the dynamic link library is empty, use the default interpolation algorithm to perform motion simulation, and then determine whether interface function 1 is empty; if it is not empty, call interface function 1 and pass in the interpolation calculation parameters, and use the obtained joint angles to refresh the angles of each axis of the motion mechanism; if it is empty, use the default built-in inverse kinematics algorithm to perform inverse kinematics solution, and use the obtained joint angles to refresh the angles of each axis of the motion mechanism.
[0177] Step 6: When the name of the dynamic link library is not empty, load the dynamic link library according to the name of the dynamic link library.
[0178] Step 7: Determine whether the dynamic link library is loaded successfully:
[0179] Step eight, when the dynamic link library fails to load, record the error information, use the default interpolation algorithm to perform motion simulation, and then determine whether the interface function 1 is empty; if it is not empty, call the interface function 1 and pass in the interpolation calculation parameters, and use the obtained joint angles to refresh the angles of each axis of the motion mechanism; if it is empty, use the default built-in inverse kinematics algorithm to perform inverse kinematics solution, and use the obtained joint angles to refresh the angles of each axis of the motion mechanism.
[0180] Step nine, when the dynamic link library is loaded successfully, obtaining the pre-created interface function 1 and interface function 2 from the dynamic link library;
[0181] Step 10, determine whether interface function 2 is empty;
[0182] When interface function 2 is empty, the default interpolation algorithm motion simulation is used, and then it is determined whether interface function 1 is empty; if it is not empty, interface function 1 is called and the interpolation calculation parameters are passed in, and the obtained joint angles are used to refresh the angles of each axis of the motion mechanism; if it is empty, the default built-in inverse kinematics algorithm is used for inverse kinematics solution, and the obtained joint angles are used to refresh the angles of each axis of the motion mechanism.
[0183] Through the above embodiments, a clear and feasible solution is provided for the connection between PQArt offline programming software and different brands of motion mechanisms. By creating two interface functions and developing a corresponding dynamic link library, it can ensure that PQArt offline programming software can accurately simulate the motion mechanism's actions and evaluate its work efficiency and performance during the simulation process, thereby providing users with a more reliable and accurate simulation experience.
[0184] The present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0185] The computer device includes a memory 410 and a processor 420 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with components 410-420, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0186] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.
[0187] The memory 410 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, for example, a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of a computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 410 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card or a flash card (FlashCard) equipped on the computer device. Of course, the memory 410 may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory 410 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 410 may also be used to temporarily store various data that have been output or are to be output.
[0188] The processor 420 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 410 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 420 is used to execute the program codes or instructions stored in the memory 410 or process data, such as running the program code of the above method.
[0189] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0190] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.
[0191] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.
[0192] The creation of the memory and the processor may refer to the description of the aforementioned computer device embodiment, which will not be repeated here.
[0193] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface functions, the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0194] Each functional unit or module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0195] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0196] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0197] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present application.
[0198] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.
Claims
1. A simulation method applicable to multi-brand motion mechanisms, characterized in that: include: Receive the start command, parse it and obtain the offline programming file; Based on the offline programming file, obtaining the name of the dynamic link library of the corresponding motion mechanism; When the name of the dynamic link library is not empty, loading the dynamic link library; When the dynamic link library is loaded successfully, obtaining the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library; When the beat simulation interface function is not empty, the beat simulation interface function is called and the interpolation calculation parameters are passed in, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to realize the beat simulation.
2. The method according to claim 1, characterized in that Before the step of receiving the start command, the method includes: Creating the inverse kinematics interface function and the beat simulation interface function; Compiling and encapsulating the inverse kinematics interface function and the beat simulation interface function into the same dynamic link library; The name of the dynamic link library is stored in the motion mechanism.
3. The method according to claim 1, characterized in that After the step of extracting the name of the dynamic link library of the corresponding motion mechanism, the method further comprises: Determine whether the name of the dynamic link library is empty; When the name of the dynamic link library is empty, a default interpolation algorithm is used for motion simulation.
4. The method according to claim 1, characterized in that: After the step of loading the dynamic link library, the method further includes: Determine whether the dynamic link library is loaded successfully; When the dynamic link library fails to load, an error message is recorded, and a default interpolation algorithm is used to perform motion simulation.
5. The method according to claim 1, characterized in that After the step of acquiring the pre-created beat simulation interface function and the inverse kinematics interface function from the dynamic link library, the method further includes: Determine whether the beat simulation interface function is empty; When the beat simulation interface function is empty, the default interpolation algorithm motion simulation is used.
6. The method according to any one of claims 3 to 5, characterized in that: The steps of using the default interpolation algorithm for motion simulation include: Determine whether the inverse kinematics interface function is empty; When the inverse kinematics interface function is not empty, the inverse kinematics interface function is called and the interpolation calculation parameters are passed in, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to realize beat simulation and inverse kinematics calculation; When the inverse kinematics interface function is empty, the default built-in inverse kinematics algorithm is used to perform inverse kinematics solution, and the result returned by the beat simulation interface function is used to update the state of the motion mechanism to achieve beat simulation and inverse kinematics calculation.
7. The method according to any one of claims 1 to 6, characterized in that: Also includes: Monitor the status of the loaded dynamic link library in real time, including but not limited to the loading status of the interface function, the number of times the interface function is called, and the error log, and when an abnormal status is detected, warn the user or automatically try to reload the dynamic link library.
8. A device suitable for simulating multi-brand motion mechanisms, characterized in that: include: A parsing module, used for receiving a start command, parsing it and obtaining an offline programming file; A first extraction module, used for acquiring the name of the dynamic link library of the corresponding motion mechanism based on the offline programming file; A loading module, used for loading the dynamic link library when the name of the dynamic link library is not empty; A second extraction module is used to obtain the pre-created beat simulation interface function and inverse kinematics interface function from the dynamic link library when the dynamic link library is loaded successfully; The first processing module is used to call the beat simulation interface function and pass in interpolation calculation parameters when the beat simulation interface function is not empty, and use the result returned by the beat simulation interface function to update the state of the motion mechanism to achieve beat simulation.
9. A computer device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.