Industrial robot machining program migration method based on configuration description file
By using configuration description files and object-oriented modeling techniques, the problem of long debugging cycles for machining programs caused by errors in the same model of robot was solved, enabling fast and accurate machining program migration and improving production efficiency and consistency.
Patent Information
- Application Number
- CN202610052132.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-05-01
AI Technical Summary
In industrial automation, industrial robots of the same model may experience trajectory deviations, posture distortions, and process fluctuations when running on new equipment due to differences in manufacturing tolerances, assembly errors, and dynamic characteristics. This results in long debugging times and reduced production efficiency.
A configuration description file-based approach is adopted, which uses object-oriented modeling technology to generate an industrial robot machining program migration method. This includes constructing a configuration description file for the prototype robot to ensure that the target robot is consistent with the prototype, using visual sensing technology to correct assembly errors, obtaining accurate coordinate relationships, and generating joint coordinates through inverse kinematics to achieve rapid migration of the machining program.
It significantly shortens the deployment time for machine replication, improves the efficiency of enterprise expansion, ensures that the processing effect of the target robot is consistent with that of the prototype robot, avoids trajectory deviation and process fluctuation, and reduces the technology implementation cost of multi-model production lines.
Smart Images

Figure CN121957677A_ABST
Abstract
Description
A method for migrating industrial robot machining programs based on configuration description files Technical Field
[0001] This invention relates to the field of non-standard automated equipment control technology, specifically to a method for migrating industrial robot machining programs based on configuration description files. Background Technology
[0002] With the rapid development of industrial automation technology, the application of industrial robots in the field of non-standard automation is becoming increasingly widespread. Customized equipment such as dispensing machines and welding robots have become core equipment for improving production efficiency and ensuring product quality. The core requirement for this type of equipment is to quickly build adaptable machine control programs and processing programs according to different production scenarios and process requirements in order to cope with diversified and flexible production tasks.
[0003] In the field of automated manufacturing, companies often need to rapidly expand production capacity by replicating the same model of equipment (such as electronic assembly lines). However, due to differences in manufacturing tolerances, assembly errors, and dynamic characteristics, industrial robots of the same model can exhibit phenomena such as trajectory deviation, posture distortion, and process fluctuations when running verified machining programs on new equipment. The time spent debugging these new machines on verified machining programs can sometimes exceed the time spent resetting a machine from scratch, resulting in reduced production efficiency and negating the purpose of replicating the machine. Therefore, a method is needed to improve the accuracy and efficiency of machine replication. Summary of the Invention
[0004] The purpose of this invention is to provide a method for migrating industrial robot machining programs based on configuration description files, which enables rapid migration of machining programs between industrial robots with similar configurations, achieves machine replication, and improves on-site debugging efficiency.
[0005] This invention is achieved through the following technical solution: a method for migrating industrial robot machining programs based on configuration description files, comprising the following steps: Step S1: Constructing a configuration description file for a prototype industrial robot, wherein the configuration description file is generated based on an object-oriented abstract modeling method and includes kinematic modeling information, peripheral modeling information, communication modeling information, and machining programs of the prototype industrial robot; Step S2: Assembling a target industrial robot according to the physical structure of the prototype industrial robot, ensuring that the target industrial robot and the prototype industrial robot are of the same configuration, and that their component assembly relationships, axis motion directions, and origin coordinates are consistent; Step S3: Loading the constructed configuration description file of the prototype industrial robot into the target industrial robot; Step S4: Correcting the machining assembly errors of the target industrial robot using visual sensing technology, obtaining the accurate coordinate relationships between the components of the target industrial robot, and then generating joint coordinates based on the inverse kinematics solution; Step S5: The target industrial robot executes the adapted machining program to achieve machining program migration.
[0006] To better implement the method of the present invention, further, in step S1, the construction process of the configuration description file of the prototype industrial robot includes the following steps: Step S11: Divide the components with independent functions on the original industrial robot into peripheral components, communication components, and basic components according to their functional uniqueness; Step S12: Using an object-oriented modeling method, model all components according to the dimension of motion capability, model peripheral components according to the dimension of functional interface, and model communication components according to the dimension of interaction logic; Step S13: Integrate the object-oriented modeling results, using the basic components as the carrier, and combining the modeling data and configuration parameters of peripheral components and communication components, design the processing program using a flowchart compilation method, and generate a configuration description file containing all modeling parameters and program flow.
[0007] To better implement the method of the present invention, further, in step S12, an object-oriented modeling method is adopted. The process of modeling all components according to the dimension of motion capability is as follows: by encapsulating motion attributes, constructing assembly trees and motion chains, and establishing coordinate system transformation rules, the forward and inverse kinematics solutions are calculated. The process of modeling peripheral components according to the dimension of functional interfaces is as follows: by encapsulating communication configuration parameters and dedicated process parameters, abstracting core functional interfaces, and implementing interface calls and extensions through scripts or plug-in packages. The process of modeling communication components according to the dimension of interaction logic is as follows: by encapsulating dedicated communication parameters, and implementing multi-scenario message interaction and parsing through sending scripts, unpacking scripts, and message processing scripts.
[0008] To better implement the method of this invention, an object-oriented modeling method is further adopted. The specific process of modeling all components according to the dimension of motion capability includes the following steps: Step S1211: Divide all components into three types of motion objects according to their motion capability: stationary objects, translational objects, and rotational objects; Step S1212: Encapsulate a fixed coordinate system describing the spatial position of each type of motion object, and define the parent coordinate system association rules based on the physical installation relationship; Step S1213: Extract the continuous path between any two target nodes in the assembly tree as a motion chain, and according to the parent coordinate system association rules, superimpose the coordinate system transformation matrices of each motion object on the motion chain to calculate the coordinate transformation relationship between the target nodes, thereby realizing the calculation of the forward and inverse kinematics solutions; The coordinate system transformation matrices of each type of motion object are encapsulated as follows: Stationary object: Transformation matrix is Where R is a 3×3 rotation matrix and T is a 3×1 translation vector, representing the fixed spatial position relationship of a stationary object relative to its parent object; for a translational object: the transformation matrix is... Where R is a 3x3 rotation matrix, T is a 3x1 translation vector, and I is the identity matrix. The direction of linear motion is x, and the distance of linear motion of the component is x; the object being rotated has the following transformation matrix: Where R is a 3x3 rotation matrix and T is a 3x1 translation vector. Let x be the matrix corresponding to the rotation of the component by x radians. These are the x, y, and z components of the rotation axis, respectively. The forward kinematics calculation process is as follows: given the motion parameters of the translational and rotational objects on the kinematic chain, the spatial position of the peripheral component relative to the base component is obtained by combining the transformation matrices. The inverse kinematics calculation process is as follows: given the target spatial position of the peripheral component, the motion parameters of the translational and rotational objects on the kinematic chain are calculated in reverse. Step S1214: encapsulate the calibration parameters and modular combination rules for compensating for installation deviations, supporting the free combination of translational, rotational, and composite motion objects. The modeling results are integrated into the configuration description file, which can be dynamically loaded to adapt to different robot configurations.
[0009] To better implement the method of the present invention, the specific process of modeling peripheral components according to the functional interface dimension using the object-oriented modeling method includes the following steps: Step S1221: Construct a unified peripheral base class to encapsulate the common communication parameters and exclusive process parameters of peripheral components, and uniformly incorporate them into the peripheral base class. All peripheral components inherit from the peripheral base class. Step S1222: Based on the core operating functions of peripheral components, abstract standardized functional interfaces that are strongly related to the process. The standardized functional interfaces are bound to the peripheral base class. Step S1223: Implement function calls using an object-oriented interface extension mechanism. Specifically, this is achieved by compiling sending scripts, unpacking scripts, message processing scripts, or configuring plug-in packages containing dynamic link libraries to adapt to the protocol differences of peripherals from different manufacturers. Step S1224: The upper-level processing program only calls the standardized functional interfaces of the peripheral base class and does not directly associate them with the underlying implementation logic of the scripts or plug-in packages. By changing the scripts or plug-in packages, it can adapt to the same type of peripheral components from different manufacturers, realizing plug-and-play functionality of peripherals.
[0010] To better implement the method of this invention, an object-oriented modeling method is further adopted. The specific process of modeling communication components according to the interaction logic dimension includes the following steps: Step S1231: Abstracting various communication components into independent communication objects, each communication object corresponds to a standardized carrier of a data interaction function; Step S1232: Encapsulating exclusive core parameters for each communication object and incorporating them into a unified communication base class to ensure the stability of communication connections and the standardization of interaction; Step S1233: Realizing multi-scenario message interaction and parsing through sending scripts, unpacking scripts, and message processing scripts; the same communication object can be bound to multiple sets of scripts, each corresponding to the message sending rules and receiving parsing logic of different scenarios.
[0011] To better implement the method of the present invention, the specific process of step S13 further includes the following steps: Step S131: Using the basic component as the core carrier, import all components that have completed motion attribute encapsulation, reproduce the installation connection relationship between components according to the actual physical configuration of the industrial robot, and improve the assembly tree structure; based on the assembly tree, verify the integrity of the motion chain of the key operation path to ensure the feasibility of kinematic forward and inverse kinematics calculation; bind the peripheral components that have completed functional interface modeling and the communication components that have completed interaction logic modeling to the corresponding nodes of the assembly tree according to the actual application scenario to realize the functional connection of motion, peripherals, and communication. Step S132: Configure motion control parameters, peripheral component parameters, and communication component parameters sequentially; Step S133: Encapsulate basic functions into independent sub-process nodes. All nodes are associated with configured component resources. By dragging and dropping nodes and defining node order and branch relationships, build a process logic that fits the actual processing technology to ensure the consistency of parameter calls for each node in the process; Step S134: Solidify the model integration results, full-dimensional configuration parameters, and processing program flowchart logic into a configuration file in a standardized format. Associate the configuration files with each other and ensure that the parameters correspond one-to-one to form a configuration description file.
[0012] To better implement the method of the present invention, further, the specific process of step 4 is as follows: Step S41: The kinematic parameters of each component of the target industrial robot are calibrated and calculated by calibrating the sensor; Step S42: Based on the kinematic parameters of each component after calibration, and combined with the component connection relationship clearly defined in the assembly tree, the accurate coordinate transformation relationship between each component of the target industrial robot is directly derived, including the coordinate mapping rules of all components such as the base and each axis, each axis and peripherals, and peripherals and worktable; Step S43: The configuration description file loaded into the target industrial robot is called, and the pre-stored prototype industrial robot processing trajectory data is extracted; the trajectory has been defined based on the prototype machine worktable coordinate system.
[0013] Step S44: Based on the accurate coordinate transformation relationship between the components of the target industrial robot, lock the core kinematic chain between the machining head and the worktable, take the machining trajectory in the worktable coordinate system of the prototype industrial robot as input, and perform inverse kinematics calculation; through inverse kinematics calculation, adapt and convert the machining trajectory of the prototype industrial robot into joint coordinates that the target industrial robot can recognize and execute, and complete the core adaptation of the machining program.
[0014] To better implement the method of the present invention, further, in step S41, the specific process of completing the calibration calculation of the kinematic parameters of each component of the target industrial robot by calibration sensor is as follows: Step S411: Start the calibration process of the target industrial robot, generate the assembly tree of the target industrial robot based on the component classification logic of the prototype industrial robot in the configuration description file, clarify the parent-child connection level of all components, and uniformly mark all components in the assembly tree as uncalibrated.
[0015] Step S412: Select a 2D industrial camera or a 3D line scan camera as a calibration sensor from the peripheral modeling of the assembly tree. The calibration sensor completes the connection configuration according to the communication modeling in the configuration description file. Step S413: Select an uncalibrated component node from the assembly tree, fix the calibration plate or calibration ball on the component to form a dedicated calibration motion chain between the calibration sensor and the target component, and clarify the parent-child relationship between each component in the motion chain. Step S414: Generate a preset motion path based on the motion control parameters in the configuration description file, control the target industrial robot according to the preset motion path, drive the target component with the fixed calibration plate or calibration ball to move, and collect the detection data of the calibration sensor in multiple different postures. The data must include the transformation matrix between the calibration sensor and the calibration plate or calibration ball, as well as the mechanical axis coordinates in the corresponding posture.
[0016] Step S415: Substitute the collected multi-pose detection data into the optimization objective function, calculate the precise kinematic parameters of each component in the calibration kinematic chain, complete the calibration of all related components in the kinematic chain, and update the status of these components to calibrated; Step S416: Check whether there are still uncalibrated components in the assembly tree. If there are, return to step S413 and repeat the process of selecting uncalibrated components, fixing calibration parts, collecting data, and calculating parameters; if all components have been marked as calibrated, stop the loop calibration.
[0017] To better implement the method of the present invention, the optimization objective function in step S415 is further defined as follows: In the formula, Let Z be the transformation matrix from the Z-axis to the camera. Let be the transformation matrix from the i-th X-axis to the Z-axis. Let be the transformation matrix from the i-th base to the X-axis. Let be the i-th transformation matrix from the Y-axis to the base. Let be the i-th transformation matrix from the A-axis to the Y-axis. Let be the i-th transformation matrix from the C-axis to the A-axis. Let be the i-th transformation matrix from the worktable to the C-axis. The transformation matrix from the calibration board to the worktable. Let j be the coordinates of the j-th point on the calibration plate in the calibration plate coordinate system. The coordinates of the j-th point on the calibration plate in the camera coordinate system.
[0018] Compared with the prior art, the present invention has the following advantages and beneficial effects: (1) The present invention encapsulates the kinematics, peripherals, communication modeling information and machining trajectory under the worktable coordinate system of the prototype machine through the configuration description file. After the target machine loads the file, it only needs to correct its own machining / assembly error through visual sensing calibration, and can quickly adapt to the machining program through inverse kinematics solution. (1) It completely solves the problem that the program migration and debugging cycle of traditional robots of the same model is long due to individual errors, even exceeding the reprogramming, significantly shortens the deployment time of machine replication, and improves the efficiency of enterprise expansion; (2) For the processing tolerance and assembly deviation of the same type of robot, this invention accurately obtains the coordinate transformation relationship between each part of the target machine by visual calibration of each part and optimization of the objective function calculation; combined with the forward and inverse kinematics algorithm, it realizes the accurate mapping of the prototype machine processing trajectory to the joint coordinate of the target machine, effectively avoiding problems such as trajectory deviation, posture distortion, and process fluctuation, and ensuring that the processing effect of the target machine and the prototype machine is consistent; (3) This invention obtains the processing trajectory and positioning benchmark under the workpiece coordinate system by flexibly constructing the kinematic chain, and realizes the migration of the processing program in the target industrial robot by combining the kinematic attribute parameters after kinematic calibration of each industrial robot; (4) In this invention, kinematic modeling adopts the modular strategy of assembly tree and kinematic chain, supports the free combination of translation, rotation and compound motion parts, can dynamically load and adapt to industrial robots of different configurations, and does not need to develop a separate modeling scheme for different models, which broadens the scope of application of the technology and reduces the technology implementation cost of multi-model production lines. Attached Figure Description
[0019] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 is a flowchart of the method described in the present invention; Figure 2 is a detailed flowchart of the configuration description file for constructing a prototype industrial robot in the present invention; Figure 3 is a schematic diagram of the assembly tree of the five-axis dispensing machine in the present invention; Figure 4 is a flowchart of generating joint coordinates after the calibration calculation of each component of the target industrial robot in the present invention; Figure 5 is a flowchart of the calibration of the kinematic parameters of each component of the target industrial robot in the present invention. Detailed Implementation
[0020] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0021] To make the objectives, process conditions, and advantages of the present invention clearer, the present invention will be further described in detail with reference to the following embodiments. However, the embodiments of the present invention are not limited thereto. Various substitutions and modifications can be made based on common technical knowledge and conventional means in the art without departing from the above-described technical concept of the present invention, and all such substitutions and modifications should be included within the scope of the present invention. The specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0022] Example 1: This example describes a method for migrating an industrial robot machining program based on a configuration description file, as shown in Figure 1. The method includes the following steps: Step S1: Constructing a configuration description file for a prototype industrial robot. This file is generated based on an object-oriented abstract modeling method and includes the prototype industrial robot's kinematic modeling information, peripheral modeling information, communication modeling information, and machining program. Step S2: Assembling the target industrial robot according to the prototype industrial robot's physical structure, ensuring that the target and prototype industrial robots are of the same configuration and that their component assembly relationships, axis motion directions, and origin coordinates are consistent. Step S3: Loading the constructed configuration description file of the prototype industrial robot into the target industrial robot. Step S4: Correcting the machining assembly errors of the target industrial robot using visual sensing technology, obtaining the accurate coordinate relationships between the components of the target industrial robot, and then generating joint coordinates based on the inverse kinematics solution. Step S5: The target industrial robot executes the adapted machining program, thus achieving machining program migration.
[0023] Example 2: Based on the above examples, this example further defines the specific process of constructing the configuration description file of the prototype industrial robot, as shown in Figure 2, including the following steps: Step S11: Based on the abstraction concept of object-oriented programming, the components of the industrial robot platform with independent functions are divided into three categories according to their functional uniqueness: basic components (carrying and installing other components), peripheral components (completing processing technology or auxiliary operations), and communication components (realizing data interaction). Each component belongs to only one category, providing a unified object carrier for subsequent modeling; peripheral components are devices that can complete specific processing technology or auxiliary operations, specifically including glue valves, temperature controllers, air pressure controllers, light source controllers, barcode scanners, electronic balances, needle alignment devices, 2D cameras, 3D line scan cameras, 3D structured light cameras, monitoring cameras, and laser height measuring instruments; communication components are functional modules that can realize data interaction between the robot and external systems or external devices, specifically including PLC communication, TCP communication, UDP communication, Modbus communication, FTP communication, MQTT communication, and HTTP communication; basic components are devices that can carry and install all other components, specifically including worktables, bases, and motion axes.
[0024] Step S12: Using an object-oriented modeling approach, modeling is completed in three dimensions: Motion capability dimension: All components are classified into three types of motion objects based on their motion attributes: stationary, translational, and rotational. By encapsulating coordinate systems, constructing assembly trees and kinematic chains, and defining transformation matrices, forward and inverse kinematics calculations are achieved. Functional interface dimension: A unified peripheral base class is constructed for peripheral components, encapsulating common communication parameters and exclusive process parameters, and abstracting standardized functional interfaces. Interface calls and extensions are implemented through scripts or plug-in packages. Interaction logic dimension: Communication components are abstracted into independent communication objects, exclusive communication parameters are encapsulated, and multi-scenario message interaction and parsing are achieved through multiple sets of scripts.
[0025] Step S13: Using basic components as the carrier, integrate multi-dimensional modeling results, improve assembly tree and kinematic chain verification, configure all-dimensional parameters, adopt flowchart compilation method, build the machining program through sub-process node combination, and generate a configuration description file containing modeling parameters and program flow.
[0026] Step S14: Import the configuration description file into the industrial robot development platform. After integrity verification, resource mapping and initialization, the industrial robot can be controlled.
[0027] Based on their kinematic properties, this invention classifies various components on a robot into three categories: stationary, translational, and rotational. Stationary components are those that cannot move on their own, including robot bases, industrial cameras, and valves. Translational components are those that can move linearly, typically linear motors, linear modules, and cylinders. Rotational components are those that can move in rotation, typically rotary motors.
[0028] Each of the above three types of components can define an associated coordinate system to describe its own motion. Due to the relativity of motion, a parent coordinate system also needs to be defined as a reference system to describe the component's motion. This invention introduces the concept of a parent component for each component. The parent component is formed by starting from the machine base and following the connection relationships between the components, forming an assembly tree. Each component corresponds to a node in the tree, and the parent node component corresponding to the current component node is the parent component. The coordinate system to which the parent component is fixed is the parent coordinate system of the child component. A typical assembly tree of a five-axis cradle-type dispensing machine industrial robot is shown in Figure 1.
[0029] The motion of a component's coordinate system is relative to its parent coordinate system. Therefore, the transformation of a stationary component relative to its parent coordinate system can be described as follows: (1) Where R is a 3*3 rotation matrix and T is a 3*1 translation vector.
[0030] The change of the translational component relative to the parent coordinate system can be described as follows: (2) Where R is a 3*3 rotation matrix, T is a 3*1 translation vector, and I is the identity matrix. .
[0031] The transformation of the rotating component relative to the parent coordinate system can be described as follows: (3) Where R is a 3*3 rotation matrix and T is a 3*1 translation vector. Let x be the matrix corresponding to the rotation of the component by x radians. (4) Among them These are the x, y, and z components of the rotational axis, respectively.
[0032] According to the above formula, the kinematic transformation matrices of various component coordinate systems relative to the parent coordinate system can be obtained. Meanwhile, the inverse of the above transformation matrix is the kinematic transformation matrix of the parent coordinate system relative to the component coordinate system.
[0033] By taking any two nodes from the assembly tree, we can obtain the path between these two nodes, which we can call the kinematic chain. According to the connection order of the components in the kinematic chain, we can obtain the transformation relationship between the two ends of the kinematic chain, and use this as the basis for calculating the forward and inverse kinematic solutions. Taking the five-axis dispensing machine assembly tree in Figure 1 as an example, the kinematic chain from the dispensing valve to the worktable is: dispensing valve → Z-axis → X-axis → base → Y-axis → A-axis → C-axis → worktable. At this point, the transformation relationship from the dispensing valve coordinate system to the worktable coordinate system can be obtained as follows: in This is the transformation matrix from the glue valve to the Z-axis. This is the transformation matrix from the Z-axis to the X-axis. This is the transformation matrix from the X-axis to the base. Let be the transformation matrix from the base to the Y-axis. Let be the transformation matrix from the Y-axis to the A-axis. Let be the transformation matrix from the A-axis to the C-axis. This is the transformation matrix from the C-axis to the worktable. When the coordinates of each axis in the kinematic chain are known, the matrices on the right side of the equation are definite values, and the transformation matrix from the valve coordinate system to the worktable coordinate system can be obtained (calculation of the forward kinematics); when the transformation matrix of the equation is a definite value, the coordinates of each axis in the kinematic chain can be calculated in reverse (calculation of the inverse kinematics).
[0034] The modeling process for peripheral components of industrial robots is as follows: Different types of peripherals are modeled using object-oriented methods, creating corresponding peripheral classes, such as electronic balance classes, 2D camera classes, etc. These classes encapsulate the basic parameters of the peripherals, such as communication configurations, as well as configuration parameters unique to different types of peripherals.
[0035] Communication configuration is the fundamental configuration for peripherals to establish communication and implement their functions. This invention encapsulates these configuration parameters as common parameters within the peripheral's base class. Considering that most peripherals use serial communication or TCP communication as their basic communication protocol, this invention encapsulates serial communication parameters (baud rate, data bits, stop bits, etc.) and TCP communication parameters (IP address, port number, etc.) into the base class. In addition, it also encapsulates the parameters required for UDP and Modbus communication.
[0036] Based on this, and according to the characteristics of the peripherals, this invention abstracts the most critical and important functional interfaces for this type of peripheral. For example, a peripheral like an electronic balance has three functional interfaces: 1-acquiring the weighing value, 2-zeroing, and 3-tare. This invention allows the use of custom-written scripts to implement these functional interfaces.
[0037] In this way, when modeling an electronic balance peripheral, only a sending script is needed to organize the instructions to be sent to the electronic balance when calling the functional interface, as well as an unpacking script and a message processing script to parse the information received from the peripheral. This is sufficient to implement the corresponding functional interface. For electronic balances from different manufacturers, we only need to write scripts according to their protocols. This design allows our system to support and expand with similar peripherals from different manufacturers in the future. In the upper-level process flow, the focus is only on the functional interface to be used, without needing to know how the interface is implemented.
[0038] Taking the RADWAG-AS220.R2 balance as an example, its three scripts are as follows: Send script: function main() --add your code here --function Id="1" if function Id=="1" then nmsgToSend=" "elseiffunctionId=="2"thenmsgToSend=" "elseiffunctionId=="3"thenmsgToSend=" "end--print("[Send Script] Send Message: ".msgToSend)end Unpacking Script function main() localbuffer="" while true do localframe=GetNextFrame()--1. Concatenate new data to the buffer buffer=buffer..frame--print("[Unpacking Script] Current Buffer: "..buffer)--2. Loop through CRLF and extract all complete messages while true do--Find the position of CRLF (the 4th parameter true means "plain text matching" to avoid escaping issues) localcrlfStart,crlfEnd=string.find(buffer," ",1,true)ifnotcrlfStartthen--CRLF not found, cache incomplete, exit loop and wait for next data--print("[Unpacking script] No complete message detected (no CRLF), cache waiting...")breakend--3. Extract complete message (from the beginning of the cache to the character before CRLF, excluding CRLF itself)localmsg=string.sub(buffer,1,crlfStart-1)--4. Call message processing script to process the current complete message SetMsg(msg)--print("[Unpacking script] Set complete message: ".msg)--5. Update cache (delete Processed messages + CRLF, retaining remaining unprocessed data) buffer = string.sub(buffer,crlfEnd+1) --print("[Unpacking script] After cache update: "..(buffer~="" and bufferor" empty")) end end end Message processing script function main() while true do local fullMsg = GetNextMsg() --print(string.format("[Processing script] Start processing: %s",fullMsg)) localmsgType = string.sub(full Msg, 1, 2) local continueProcessing = true ------------------------------ 1. Parse the response of “Zero Command (Z)” ---------------------------- if msgType == "Z" then local respType = string.sub(fullMsg, 3) local result = {cmd = "Zero", success = false, status = "Unknown response"} if respType == "A" then result.status = "Command received (waiting for execution)" is Ok_ = nil elseifrespType == "D" or respType == "OK" then result.success = true result.status = "Zeroing successful" is Ok_ = true elseifrespType == "I" or respType == "^" or respType == "v" or respType == "E" then localreasonMap = {I = "Cannot execute at present", ["^"] = "Exceeds maximum value range", v = "Exceeds minimum value range", E = "Waiting for stability timeout"} result.status = string.format("Failed to clear (reason: %s, %s)", respType, reasonMap[respType]) isOk_ = false end --print(string.format("[processing script] %s-%s", result.cmd, result.status)) ------------------------------2. Parse the response of "Peel command (T)"----------------------------elseif msgType == "T" then local respType = string.sub(fullMsg, 3) local result = {cmd="Peel", success = false, status="Unknown response"} if respType == "A" then result.status="Command received (waiting to execute)" isOk_ = nil else respType == "D" or respType == "OK" then result.success = true result.status="Peeling successful" isOk_=true else efrespType=="I" or respType=="^" or respType=="v" or respType=="E" then localreasonMap={I="Cannot execute at present",["^"]="Exceeds maximum value range",v="Exceeds minimum value range",E="Waiting for stabilization timeout"} result.status=string.format("Peeling failed (reason: %s, %s)",respType,reasonMap[respType]) isOk_=false end--print(string.format("[Processing script]%s-%s",result.cmd,result.status))------------------------------3. Parse the "Get Weight Value (SI)" response---------------------------- elseif msgType=="SI" then weightValue_=-1 if string.match(fullMsg,"^SI%s+A$")then--print("[Processing script] Get weighing value - Command received (waiting for measurement value return)")continueProcessing=falseendifcontinueProcessingthen--Matching mode: Correctly capture stability marker, plus or minus sign, value, unit localstableMarker,sign,massNum,unit=string.match(fullMsg,"^SI%s(.)%s+([+-]?)%s*([%d%.]+)%s+([%a]+)")- - Format validation if not (stableMarker and massNum and unit) then -- print (string.format(--"[Processing script] Get weighing value - Error: Format mismatch, original message: %s",--fullMsg--)) isOk_=false continueProcessing=false endif continueProcessing then -- Check if it is an unstable state (store the state in a variable) local isUnstable=(stableMarker=="?") -- Convert mass value localmassValue=tonumber(massNum) if not massValue then -- print (string.format(--"[Processing script] Get weighing value - Error: Invalid mass value, original string: %s",--massNum--)) isOk_=false continueProcessing=false endif continueProcessing then -- Process the sign if sign=="-" then massValue=-massValue end -- Convert g to mg (multiply by 1000) localmassIn Mg = massValue * 1000 -- Grams to mg -- Assign value to global variable weightValue_ = massInMg isOk_ = true -- Output result: localunstableHint = isUnstable and "(Result is unstable)" or "" -- print(string.format(--"[Processing script] Get weighing value - Result: %0.1fmg%s",--massInMg,--unstableHint--Dynamically add unstable prompt--)) endendend------------------------------4.Unknown Message Handling ---------------------------- else local errMsg = "[Processing Script] Error: " if string.sub(fullMsg, 1, 2) == "ES" then errMsg = errMsg.." Command not recognized (response: %s) " else see errMsg = errMsg.." Unknown message (original message: %s) " end -- print(string.format(errMsg, fullMsg)) isOk_ = false weightValue_ = -1 end -- print(string.format("[Processing Script] End of processing: %s", fullMsg)) end end After establishing peripheral communication, when the 1-Get Weighing Value function interface is called, the corresponding command will be sent through communication by parsing the sending script. Then, the electronic balance will send the weighing value back via message, first triggering the unpacking script. After the unpacking script determines that the received content is a complete message, it triggers the message processing script to parse the weighing value and transmit the result to the variables associated with that interface. This thus implements the functionality of the interface.
[0039] In addition to implementing functional interfaces via scripts as described above, this invention also supports implementing and extending similar peripheral functional interfaces through plugin packages (containing dynamic link libraries). Taking an electronic balance as an example again, with the same three functional interfaces, if plugin implementation is chosen, a corresponding plugin package needs to be configured for the peripheral. This plugin package needs to inherit and implement the specified interfaces.
[0040] After configuring the plugin for the electronic balance, calling the "1-Get Weighing Value" function interface will directly call the corresponding interface encapsulated in the dynamic link library of the plugin package to implement the function. This approach is also flexible and can be adapted to products from different manufacturers, especially peripheral products that only provide an SDK without providing a communication protocol, such as 2D cameras.
[0041] In summary, by encapsulating the communication parameters, implementation type parameters, and special parameters of peripherals, and defining the functional interfaces of different types of peripherals, and implementing the functional interfaces by writing scripts or plugins, the peripheral modeling method of this invention is constituted. This method has considerable flexibility and scalability, and can introduce and adapt different types and models of peripherals to the entire system.
[0042] The modeling process for the communication components of an industrial robot is as follows: Communication is an essential function for any device on a production line. The MES system can remotely control the equipment through communication, improving the overall production efficiency of the factory. This invention supports various commonly used communication types, such as TCP, UDP, serial port, FTP, MQTT, HTTP, and other communication methods.
[0043] Similar to the modeling of peripherals, the modeling of communication also includes the encapsulation of communication parameters and the scripting process to adapt to different communication scenarios. The difference lies in the greater flexibility of communication applications. Unlike peripherals, which have precise functional interfaces, communication can have multiple sending and receiving scripts to handle sending and receiving messages.
[0044] This invention encapsulates different parameters for different communication types. For example, TCP client communication includes parameters such as remote IP, remote port, whether to reconnect, number of reconnections, and whether TLS is enabled.
[0045] Besides parameters, communication also requires scripts to determine the message content to be sent. For received messages, the content needs to be parsed according to certain rules to extract key information. This process involves three types of scripts: sending scripts, unpacking scripts, and message processing scripts. Their functions are similar to the three scripts mentioned in peripheral modeling. This enables the machine to support different types and scenarios of message interaction, achieve complex communication control, improve the automation level of the machine, and even achieve the control effect of an unmanned workshop.
[0046] When modeling the machine as a whole, the first step is to build a virtual robot on the base based on the specific physical configuration of the machine, using components such as translational axes, rotational axes, and peripherals to form an assembly tree, thereby determining the basic motion chain of the machine.
[0047] Once the assembly tree is in place, control parameters need to be configured for motion control-related components such as axes, input ports, and output ports. These parameters include controller port number, filter time, pulse equivalent, various effective levels of the axes, motor reversal, encoder frequency multiplication and reversal, etc.
[0048] Add and configure the corresponding peripherals and communication according to the specific features of the model.
[0049] Based on this, a machining program can be designed for this machine model. This invention uses a flowchart approach for program design, expressing the sequence and branching relationships between each node through the flowchart. Basic motion control, peripheral control, communication control, and process control-related functions are encapsulated into individual nodes, called sub-processes, including: motion control, camera image acquisition, laser line scanning, vision positioning, IO status acquisition, axis status acquisition, barcode scanning, height measurement, trajectory generation, dispensing, needle alignment, weighing, message sending, variable generation, variable assignment, custom scripts, collision detection, dual 2D camera calibration, single 2D camera calibration, process control, conditional waiting, etc. These sub-processes can use the previously configured component resources. By creating flowcharts, highly flexible control scenarios can be achieved, building an executable process, which is the machining program for the machine model.
[0050] The parameters mentioned above will be saved as a series of configuration files, forming the machine's configuration description file.
[0051] Example 3: Based on the above examples, this example uses a five-axis cradle dispensing machine as a prototype industrial robot example to provide a detailed construction process for a complete configuration description file. The assembly tree of the five-axis cradle dispensing machine is shown in Figure 3, and is as follows: Step S1: Unique classification of component functions Based on the physical configuration and functional requirements of the five-axis cradle dispensing machine, the components are classified as follows: Basic components: core carriers and mounting carriers, including the worktable (carrying the workpiece), base (fixing each motion axis and peripherals), and motion axes; Peripheral components: participating in the dispensing process or auxiliary operations, including glue valves (dispensing execution), 2D cameras (visual positioning), laser height gauges (height calibration), needle alignment devices (alignment calibration), and temperature controllers (glue temperature control); Communication components: realizing data interaction, including TCP communication (interaction with the host computer), Modbus communication (interaction with peripherals such as temperature controllers), and MQTT communication (reporting production data to the MES system).
[0052] All components are uniquely classified into one category. For example, a rubber valve belongs only to peripheral components, and a base belongs only to basic components. There is no overlap in classification, ensuring a clear classification logic.
[0053] Step S2: Multi-dimensional object-oriented modeling implementation 1. Motion capability dimension modeling (1) Classification of motion objects Static objects: base, workbench, 2D camera, glue valve (no active motion capability); Translational objects: X-axis, Y-axis, Z-axis (driven by linear motor to achieve linear displacement); Rotational objects: A-axis, C-axis (driven by rotary motor to achieve angle adjustment).
[0054] (2) The coordinate system and parent component are defined as the fixed coordinate system of each type of motion object: the fixed coordinate system of the base is established with the geometric center of the base as the origin (reference coordinate system); the origin of the X-axis fixed coordinate system is set at the center of the connection surface between the X-axis and the base, the origin of the Y-axis fixed coordinate system is set at the center of the connection surface between the Y-axis and the base, and the fixed coordinate system of the other components is set with its own geometric center as the origin.
[0055] An assembly tree is constructed based on physical installation relationships: the base is the root node, the X and Y axes are child nodes of the base, the Z axis is a child node of the X axis, the glue valve is a child node of the Z axis, the A axis is a child node of the Y axis, the C axis is a child node of the A axis, the worktable is a child node of the C axis, and the 2D camera is a child node of the Z axis. The component corresponding to the parent node of each node is the parent component, and the fixed coordinate system of the parent component is the motion reference coordinate system of the child component (e.g., the parent component of the Z axis is the X axis, and the motion references the fixed coordinate system of the X axis).
[0056] (3) Transformation Matrix and Forward and Inverse Solving Calculation of the Transformation Matrix of a Stationary Object: Taking a glue valve as an example, its transformation matrix relative to the Z-axis (parent object) is as follows: , where R is a 3×3 unit rotation matrix (the valve does not rotate relative to the Z-axis), and T is a 3×1 translation vector (the distance vector from the end of the Z-axis to the valve mounting surface, set to [0,0,50] mm), describing the fixed spatial position of the valve relative to the Z-axis.
[0057] Translational object transformation matrix: Taking the X-axis as an example, its transformation matrix relative to the base (parent object) is as follows: , where R is a 3×3 unit rotation matrix, T is a 3×1 translation vector (the distance vector from the base to the initial position of the X-axis [0,0,0]), I is a 3×3 unit matrix, V is the X-axis motion direction vector [1,0,0] (along the positive X-axis direction), and x is the X-axis motion distance (e.g., when x=100mm, it describes the X-axis moving 100mm along the positive direction).
[0058] Transformation matrix of a rotated object: Taking the A-axis as an example, its transformation matrix relative to the Y-axis (parent object) is as follows: Where R is a 3×3 unit rotation matrix, T is a 3×1 translation vector [0,0,0], R(x) is the matrix corresponding to the rotation x radians along the A-axis, and the rotation axis vector is [0,1,0] (along the Y-axis direction). Kinematic chain and forward / inverse kinematics calculation: Taking the kinematic chain "glue valve → worktable" (glue valve - Z-axis - X-axis - base - Y-axis - A-axis - C-axis - worktable) as an example, the coordinate transformation relationship of the nodes at both ends of the kinematic chain is as follows: Correct calculation: Given the X-axis movement distance x = 100mm and the A-axis rotation angle x = π / 2 radians, with the other axis parameters fixed, substituting each transformation matrix into the formula yields the spatial position transformation matrix of the glue valve relative to the worktable, thus determining the actual position of the glue valve.
[0059] Inverse calculation: Given the target position transformation matrix of the glue valve relative to the worktable (e.g., [100, 50, 80] mm, angle 0 radians), decompose the above combination matrix in reverse to calculate parameters such as the X-axis needing to move 100 mm, the A-axis needing to rotate π / 2 radians, and the Z-axis needing to move 80 mm.
[0060] (4) Precision optimization and modular adaptation introduce calibration parameters to compensate for installation deviations: The deviation between the actual movement distance and the theoretical distance of the X-axis is measured by a laser interferometer, and the calibration parameter Δx=0.02mm is obtained and integrated into the transformation matrix; a modular strategy is adopted to support the free combination of the X-axis, Y-axis and A-axis, C-axis, adapting to dispensing mechanism configurations with different number of axes, and the modeling results are dynamically loaded with the configuration description file.
[0061] 2. Peripheral Function Interface Dimension Modeling Taking the electronic balance (peripheral component) as an example, the specific implementation process is as follows: (1) Peripheral base class parameter encapsulation Construct the peripheral base class and encapsulate two types of parameters: common communication parameters: TCP communication parameters (IP address 192.168.1.100, port number 8080); exclusive process parameters: range 0-220g, accuracy 0.1mg.
[0062] (2) Standardized functional interface abstraction Three functional interfaces that are strongly related to the weighing process are abstracted and bound to the peripheral base class: Interface 1: Get weighing value; Interface 2: Zero; Interface 3: Tare.
[0063] (3) The interface is implemented using a script binding method, and three types of scripts are compiled: Sending script: instructions are organized according to the functional interface ID, and the instruction corresponding to interface 1 is " Interface 2 corresponds to the instruction " Interface 3 corresponds to the instruction " Unpacking script: By detecting " "" serves as the message terminator, concatenating the data cache and extracting the complete message; Message processing script: Parses the response message, such as when interface 1 receives "SI100.5g", extracts the weighing value of 100.5g and converts it to 100500mg, assigning it to the global variable weightValue_.
[0064] If replaced with a 2D camera that only provides an SDK, the implementation is achieved using a plugin package inheritance: configure a plugin package (including dynamic link library) that conforms to the peripheral base class interface specification, inherit the "image acquisition" and "parameter configuration" interfaces, and call the underlying functions encapsulated by the SDK.
[0065] (4) The upper-level processing program only calls the "Get Weighing Value" interface and does not need to pay attention to the underlying implementation of the script or plug-in. When changing electronic balances from different manufacturers, only the corresponding three types of scripts need to be replaced to achieve plug-and-play functionality.
[0066] 3. Communication interaction logic dimension modeling Taking TCP communication (communication component) as an example, the specific implementation process is as follows: (1) Definition of communication object Abstract TCP communication into an independent communication object as a standardized carrier for data interaction with the MES system.
[0067] (2) Encapsulation of dedicated parameters: encapsulate TCP client-specific parameters: remote IP (192.168.1.200), remote port (9090), whether to reconnect (yes), number of reconnections (3 times), whether to enable TLS (no), and include them in the unified communication base class.
[0068] (3) Binding the interaction scripts to bind two sets of scripts to adapt to different interaction scenarios: Scenario 1 (production data reporting): The sending script defines the message format as “Device ID: D001, weighing value: 100500mg, time: 2024-01-01 10:00:00”; the unpacking script processes the confirmation response of the MES system; the message processing script parses the “reporting successful” instruction and updates the status variables.
[0069] Scenario 2 (Remote Control Command Reception): The sending script is empty (passive reception); the unpacking script extracts the complete control command; the message processing script parses the command "adjust the pressure of the glue valve to 0.3MPa", extracts the target pressure parameter, and transmits it to the glue valve control module.
[0070] (III) Step S3: Modeling Integration and Program Design Implementation 1. Model Integration Taking the base and workbench as the core carriers, import all moving objects, peripheral components and communication components, reproduce the physical installation relationship, and improve the assembly tree structure; verify the integrity of the motion chain of "glue valve → workbench" and "2D camera → processing area" to ensure that forward and inverse kinematics calculations are feasible; bind the glue valve to the Z-axis end, and associate the electronic balance with the control system through the TCP communication object to realize the linkage of "motion-peripheral-communication" functions.
[0071] 2. Parameter Configuration: Motion Control Parameters: X-axis pulse equivalent 10000 pulses / mm, filtering time 20ms, motor phase reversal parameter is "No"; Peripheral Parameters: glue valve dispensing pressure 0.25MPa, electronic balance TCP communication parameters (IP: 192.168.1.100, port 8080); Communication Parameters: TCP communication object remote IP (192.168.1.200), reconnection count 3; Accuracy Compensation Parameters: X-axis calibration parameter Δx=0.02mm, Z-axis calibration parameter Δz=0.01mm.
[0072] 3. The machining program design adopts a flowchart approach, combining the following sub-process nodes: "Needle alignment and calibration → 2D camera visual positioning → trajectory generation → Z-axis descent → glue valve opening (dispensing operation) → Z-axis ascent → electronic balance weighing detection → TCP communication data reporting → conditional judgment (continue if weighing is qualified, alarm if unqualified)". The consistency of parameter calls at each node is verified; for example, the weighing detection node calls the "get weighing value" interface of the electronic balance, and the data reporting node calls the sending script of the TCP communication object.
[0073] 4. Configuration description file generation: The model integration results, all-dimensional parameters, and flowchart logic are solidified in a standardized format to form a configuration description file, including kinematic modeling parameter file, peripheral configuration parameter file, communication configuration parameter file, and machining procedure flow file. The files are linked through parameter indexes.
[0074] Example 4: Based on the above examples, this example further uses a five-axis dispensing machine as an example to provide a specific process for migrating the processing program of an industrial robot, as shown in Figure 4. Specifically, it is as follows: First, ensure that the assembly relationship of each component of the target industrial robot and the prototype industrial robot, the movement direction of each axis and the origin coordinates are consistent with the prototype machine. Then, complete the kinematic calibration of each machine to obtain the accurate coordinate transformation relationship between each component on the assembly tree.
[0075] When migrating a machining program to a target industrial robot, the machining program, along with its configuration description file, is copied to the target industrial robot. The workpiece is fixed on the target industrial robot, the corresponding sensor and worktable are selected, and the vision template in the machining program is used. A visual positioning algorithm is employed to obtain the coordinates of the positioning point in the sensor coordinate system. The kinematic chain transformation between the sensor and the worktable yields the coordinates of the positioning point in the current worktable coordinate system. By comparing the positioning point coordinates in the machining program (i.e., the coordinates of the positioning point in two different coordinate systems), an algorithm calculates the transformation matrix between the worktable coordinate system in the machining program and the current worktable coordinate system. This transformation yields the machining trajectory and attitude vector in the current worktable coordinate system, as shown in the following formula: In the above formula, This represents the j-th point in the worktable coordinate system during the machining process. This represents the j-th point in the current workbench coordinate system. By solving the above equation, we can obtain the transformation matrix H between the two coordinate systems.
[0076] By calculating the inverse kinematics of the kinematic chain between the current target industrial robot's processing head and the worktable, the joint (axis) coordinates of the current target industrial robot's processing trajectory are obtained, thus realizing the transfer of the industrial robot's processing program.
[0077] Example 5: Based on the above examples, this example further defines the calibration and calculation process of the kinematic parameters of each component of the target industrial robot, as shown in Figure 5. Specifically, the present invention defines a set of general kinematic calibration methods, which realizes the method of calibrating the kinematic properties of components using various vision sensors such as 2D industrial cameras and 3D line scan cameras. This avoids the problem that robots of the same model have different kinematic property parameters due to assembly or processing errors, and cannot perform accurate coordinate transformation.
[0078] Due to machining and assembly errors in robots, the kinematic transformation matrix parameters of each component in each robot are different. This invention designs a universal kinematic calibration method that can use a 2D industrial camera or a 3D line scan camera to calibrate and calculate the kinematic transformation matrix parameters of each component.
[0079] The assembly tree of the five-axis dispensing machine is shown in Figure 3. A calibration plate can be fixed on the worktable, and the calibration plate can be regarded as a sub-component of the worktable.
[0080] By capturing images of the calibration board with a 2D camera under different postures, a set of different 2D camera-to-calibration board transformation matrices and mechanical axis coordinates can be obtained. At this point, an optimization objective function can be defined: in Let Z be the transformation matrix from the Z-axis to the camera. Let be the transformation matrix from the i-th X-axis to the Z-axis. Let be the transformation matrix from the i-th base to the X-axis. Let be the transformation matrix from the i-th Y-axis to the base. Let be the i-th transformation matrix from the A-axis to the Y-axis. Let be the i-th transformation matrix from the C-axis to the A-axis. Let be the transformation matrix from the i-th worktable to the C-axis. The transformation matrix from the calibration board to the worktable. Let j be the coordinates of the j-th point on the calibration plate in the calibration plate coordinate system. The coordinates of the j-th point on the calibration plate in the camera coordinate system are used to calibrate the kinematic parameters of each component in this kinematic chain by calculating the parameters of each matrix when the objective function value is minimized.
[0081] Fix the workpiece on the prototype machine's worktable, select the machining head and worktable in the assembly tree, obtain the current machining motion chain, teach the machining trajectory in the joint (axis) coordinate system through the machining head, and then obtain the machining trajectory and attitude vector in the worktable coordinate system through motion chain transformation; select appropriate marks on the workpiece as the workpiece's positioning points, and select a 2D industrial camera in the assembly tree to create a visual template for the positioning points on the workpiece. Through visual template matching, the coordinate values of the positioning points in the pixel plane can be obtained. When shooting the positioning points on the workpiece in multiple postures, the coordinates of the positioning points in the worktable coordinate system can be calculated by the following formula.
[0082] In the above formula, s is the scaling factor. Let K be the pixel coordinates of the i-th positioning point, and K be the camera memory matrix. Let P be the transformation matrix from the worktable coordinates to the camera coordinate system for the i-th iteration, and let P be the worktable coordinates of the positioning point to be calculated.
[0083] Alternatively, a 3D line scan camera can be selected on the assembly tree to create a visual template for the positioning points on the workpiece. The coordinates of the positioning points in the 3D camera coordinate system can be obtained directly, and the coordinates of the positioning points in the worktable coordinate system can be obtained through the kinematic chain transformation between the 3D camera and the worktable.
[0084] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for migrating industrial robot machining programs based on configuration description files, characterized in that, Includes the following steps: Step S1: Construct a configuration description file for the prototype industrial robot. This configuration description file is generated based on an object-oriented abstract modeling method and includes the kinematic modeling information, peripheral modeling information, communication modeling information, and machining program of the prototype industrial robot. S2: Assemble the target industrial robot according to the physical structure of the prototype industrial robot, ensuring that the target industrial robot and the prototype industrial robot have the same configuration, and that their component assembly relationships, axis motion directions, and origin coordinates are consistent. S3: Load the constructed configuration description file of the prototype industrial robot into the target industrial robot. S4: Correct the machining and assembly errors of the target industrial robot using visual sensing technology, obtain the accurate coordinate relationships between the components of the target industrial robot, and then generate joint coordinates based on the inverse kinematics solution. S5: The target industrial robot executes the adapted machining program to achieve machining program migration.
2. The industrial robot machining program migration method based on configuration description files according to claim 1, characterized in that, In step S1, the process of constructing the configuration description file of the prototype industrial robot includes the following steps: Step S11: Divide the components with independent functions on the original industrial robot into peripheral components, communication components, and basic components according to their functional uniqueness; Step S12: Using an object-oriented modeling method, model all components according to the dimension of motion capability, model peripheral components according to the dimension of functional interface, and model communication components according to the dimension of interaction logic; Step S13: Integrate the object-oriented modeling results, using the basic components as the carrier, and combining the modeling data and configuration parameters of peripheral components and communication components, design the processing program using a flowchart compilation method, and generate a configuration description file containing all modeling parameters and program flow.
3. The industrial robot machining program migration method based on configuration description files according to claim 2, characterized in that, In step S12, the object-oriented modeling method is used to model all components according to the dimension of motion capability. The process is as follows: by encapsulating motion attributes, constructing assembly trees and motion chains, and establishing coordinate system transformation rules, the forward and inverse kinematics solutions are calculated. The process of modeling peripheral components according to the dimension of functional interfaces is as follows: by encapsulating communication configuration parameters and dedicated process parameters, abstracting core functional interfaces, and implementing interface calls and extensions through scripts or plug-in packages. The process of modeling communication components according to the dimension of interaction logic is as follows: by encapsulating dedicated communication parameters, and implementing multi-scenario message interaction and parsing through sending scripts, unpacking scripts, and message processing scripts.
4. The industrial robot machining program migration method based on configuration description files according to claim 3, characterized in that, The specific process of modeling all components according to their motion capabilities using an object-oriented modeling method includes the following steps: Step S1211: Divide all components into three types of motion objects according to their motion capabilities: stationary objects, translational objects, and rotational objects; Step S1212: Encapsulate a fixed coordinate system describing the spatial position of each type of motion object, and define the parent coordinate system association rules based on the physical installation relationship; Step S1213: Extract the continuous path between any two target nodes in the assembly tree as a motion chain, and superimpose the coordinate system transformation matrices of each motion object on the motion chain according to the parent coordinate system association rules to calculate the coordinate transformation relationship between the target nodes, thereby realizing the calculation of forward and inverse kinematics solutions; Step S1214: Encapsulate calibration parameters and modular combination rules for compensating for installation deviations, supporting the free combination of translational objects, rotational objects, and composite motion objects. The modeling results are integrated into the configuration description file, which can be dynamically loaded to adapt to different robot configurations.
5. A method for migrating industrial robot machining programs based on configuration description files according to claim 3 or 4, characterized in that, The specific process of modeling peripheral components according to the functional interface dimension using the object-oriented modeling method includes the following steps: Step S1221: Construct a unified peripheral base class to encapsulate the common communication parameters and specific process parameters of peripheral components, and uniformly incorporate them into the peripheral base class. All peripheral components inherit from the peripheral base class; Step S1222: Based on the core operating functions of peripheral components, abstract standardized functional interfaces that are strongly related to the process. The standardized functional interfaces are bound to the peripheral base class; Step S1223: Implement function calls using an object-oriented interface extension mechanism; Step S1224: The upper-level machining program only calls the standardized functional interfaces of the peripheral base class and does not directly associate with the underlying implementation logic of the script or plug-in package. By changing the script or plug-in package, it can adapt to the same type of peripheral components from different manufacturers, realizing plug-and-play functionality of peripherals.
6. A method for migrating industrial robot machining programs based on configuration description files according to claim 3 or 4, characterized in that, The specific process of modeling communication components according to the interaction logic dimension using an object-oriented modeling method includes the following steps: Step S1231: Abstract various communication components into independent communication objects, each communication object corresponding to a standardized carrier of a data interaction function; Step S1232: Encapsulate exclusive core parameters for each communication object and incorporate them into a unified communication base class to ensure the stability of communication connections and the standardization of interaction; Step S1233: Implement the interaction logic of communication objects through scripts. Communication objects have no fixed functional interfaces, and the same communication object can be bound to multiple sets of scripts to adapt to different scenario message interactions.
7. A method for migrating industrial robot machining programs based on configuration description files according to any one of claims 2 to 4, characterized in that, The specific process of step S13 includes the following steps: Step S131: Using the basic component as the core carrier, import all components that have completed motion attribute encapsulation, reproduce the installation connection relationship between components according to the actual physical configuration of the industrial robot, and improve the assembly tree structure; based on the assembly tree, verify the integrity of the motion chain of the key operation path to ensure the feasibility of kinematic forward and inverse kinematics calculation; bind the peripheral components that have completed functional interface modeling and the communication components that have completed interaction logic modeling to the corresponding nodes of the assembly tree according to the actual application scenario to realize the functional linkage of motion, peripherals, and communication; Step S132: Complete the configuration of motion control related parameters, peripheral component parameters, and communication component parameters in sequence; Step S133: Encapsulate the basic functions into independent sub-process nodes, and associate all nodes with the configured component resources. By dragging and dropping nodes, defining the node order and branch relationship, build a process logic that fits the actual processing technology to ensure the consistency of parameter calls of each node in the process; Step S134: Solidify the model integration results, full-dimensional configuration parameters, and processing program flowchart logic into a configuration file in a standardized format, and associate the configuration files with each other and correspond the parameters one by one to form a configuration description file.
8. A method for migrating industrial robot machining programs based on configuration description files according to any one of claims 1 to 4, characterized in that, The specific process of step 4 is as follows: Step S41: The kinematic parameters of each component of the target industrial robot are calibrated and calculated using calibration sensors; Step S42: Based on the calibrated kinematic parameters of each component and the clearly defined component connection relationships in the assembly tree, the accurate coordinate transformation relationship between each component of the target industrial robot is directly derived; Step S43: The configuration description file loaded into the target industrial robot is called, and the pre-stored prototype industrial robot machining trajectory data is extracted; Step S44: Based on the accurate coordinate transformation relationship between each component of the target industrial robot, the core kinematic chain between the machining head and the worktable is locked, and the machining trajectory in the worktable coordinate system of the prototype industrial robot is used as input to perform inverse kinematics calculation; Through inverse kinematics calculation, the machining trajectory of the prototype industrial robot is adapted and converted into joint coordinates that the target industrial robot can recognize and execute, thus completing the core adaptation of the machining program.
9. The industrial robot machining program migration method based on configuration description files according to claim 8, characterized in that, In step S41, the specific process of calculating the kinematic parameters of each component of the target industrial robot by using calibration sensors is as follows: Step S411: Initiate the calibration process of the target industrial robot. Based on the component classification logic of the prototype industrial robot in the configuration description file, generate the assembly tree of the target industrial robot, clarify the parent-child connection hierarchy of all components, and mark all components in the assembly tree as uncalibrated. Step S412: Select a 2D industrial camera or a 3D line scan camera as the calibration sensor from the peripheral modeling of the assembly tree. The calibration sensor completes the connection configuration according to the communication modeling in the configuration description file. Step S413: Select an uncalibrated component node from the assembly tree, and fix the calibration plate or calibration ball on the component to form a calibration sensor. The calibration motion chain between the sensor and the target component is defined, clarifying the parent-child relationship between each component in the motion chain; Step S414: Control the target industrial robot according to the preset motion path, driving the target component with the calibration plate or calibration ball fixed to move, and collect the detection data of the calibration sensor in multiple different postures; Step S415: Substitute the collected multi-posture detection data into the optimization objective function, calculate the accurate kinematic parameters of each component in the calibration motion chain, complete the calibration of all related components in the motion chain, and update the status of these components to calibrated; Step S416: Check whether there are still uncalibrated components in the assembly tree. If there are, return to step S413 and repeat the process of selecting uncalibrated components, fixing calibration parts, collecting data, and calculating parameters; If all components are marked as calibrated, then stop the cyclic calibration.
10. The method for migrating industrial robot machining programs based on configuration description files according to claim 8, characterized in that, The objective function for optimization in step S415 is: In the formula, Let Z be the transformation matrix from the Z-axis to the camera. Let be the transformation matrix from the i-th X-axis to the Z-axis. Let be the transformation matrix from the i-th base to the X-axis. Let be the i-th transformation matrix from the Y-axis to the base. Let be the i-th transformation matrix from the A-axis to the Y-axis. Let be the i-th transformation matrix from the C-axis to the A-axis. Let be the i-th transformation matrix from the worktable to the C-axis. The transformation matrix from the calibration board to the worktable. Let j be the coordinates of the j-th point on the calibration plate in the calibration plate coordinate system. The coordinates of the j-th point on the calibration plate in the camera coordinate system.
