Robot control method and device, electronic equipment and storage medium

By constructing a compensation coordinate system to remap the workpiece motion trajectory, the problem of low efficiency in dynamic updating of the workpiece coordinate system in the existing technology is solved, realizing efficient and flexible workpiece coordinate system updating, and improving the response speed and accuracy of robot operation.

CN121928536APending Publication Date: 2026-04-28ZHUHAI GREE INTELLIGENT EQUIP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI GREE INTELLIGENT EQUIP CO LTD
Filing Date
2025-12-16
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency, high computational overhead, or insufficient system flexibility during dynamic updates of the workpiece coordinate system, making it difficult to meet the needs of flexible production, especially in high-cycle, high-precision operation scenarios.

Method used

By establishing the first homogeneous transformation matrix between the reference workpiece coordinate system and the robot base coordinate system, the second homogeneous transformation matrix of the current workpiece relative to the reference workpiece coordinate system is determined, and a compensation coordinate system is constructed to remap the reference motion trajectory as a whole, avoiding point-by-point pose compensation calculation.

Benefits of technology

It significantly reduces the real-time computing burden, improves system response speed and operating efficiency, ensures program traceability and reusability, and is suitable for high-cycle, high-precision operation scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121928536A_ABST
    Figure CN121928536A_ABST
Patent Text Reader

Abstract

The invention discloses a robot control method and device, electronic equipment and a storage medium, and the method comprises the steps: firstly building a reference workpiece coordinate system, and determining a first homogeneous transformation matrix of the reference workpiece coordinate system relative to a robot base coordinate system; based on the first homogeneous transformation matrix, determining a second homogeneous transformation matrix representing pose transformation of the current workpiece relative to the reference workpiece coordinate system; and finally, controlling the robot to move according to the target movement track under the robot base coordinate system. Determining a target motion track through a compensation coordinate system constructed by a first homogeneous transformation matrix and a second homogeneous transformation matrix representing pose transformation, and a reference motion track for a reference workpiece under a reference workpiece coordinate system, namely, performing overall coordinate system remapping on the original reference motion track through the compensation coordinate system, so as to obtain a target motion track; and pose compensation calculation does not need to be carried out on each motion point in the track independently, so that the real-time calculation burden is remarkably reduced, and the response speed and the operation efficiency of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial automation, and specifically relates to a robot control method, device, electronic equipment, and storage medium. Background Technology

[0002] In the field of industrial automation, industrial robots are widely used in high-precision operations such as assembly, welding, and gluing. To ensure that the robot's end effector can accurately complete operations according to a predetermined trajectory, a workpiece coordinate system (also known as a user coordinate system) fixed to the workpiece must be established to describe the precise position and orientation of the workpiece in the robot's workspace. This coordinate system is the foundation for robot motion planning and trajectory execution, and its accuracy directly determines the quality and consistency of the operation.

[0003] Currently, the establishment of a workpiece coordinate system mainly relies on two methods: one is the manual teaching method, where the operator manually guides the robot to touch several feature points (such as corners, holes, or edges) on the workpiece using a teaching pendant, thereby fitting the workpiece coordinate system. Although this method is simple to implement, it is highly dependent on the operator's experience, making it difficult to guarantee repeatability and positioning accuracy. Furthermore, it requires re-teaching after each workpiece change or tooling adjustment, resulting in low efficiency and difficulty in meeting the demands of flexible, high-cycle production.

[0004] The second approach is automatic positioning based on machine vision. A typical method involves capturing images and identifying preset features after the workpiece is in place, then calculating the workpiece's actual pose relative to the robot's base coordinate system. Existing technologies typically employ two processing strategies: Option A directly creates a new workpiece coordinate system based on the actual pose. However, this renders all previously taught trajectory points in the theoretical workpiece coordinate system invalid, requiring real-time conversion of all point data to the new coordinate system. This not only increases computational complexity but also overwrites the original teaching data, compromising program traceability and reusability. Option B uses the deviation between the actual and theoretical poses (including translation and rotation) as compensation, adding it point-by-point to all taught target points. While this method preserves the original teaching data, when dealing with a large number of trajectory points (such as continuous path gluing or complex welds), coordinate transformation is required for each point, significantly increasing the real-time computational burden on the controller, affecting motion timing, and potentially introducing cumulative errors.

[0005] In summary, existing technologies generally suffer from low efficiency, high computational overhead, or insufficient system flexibility during the dynamic updating of the workpiece coordinate system. Summary of the Invention

[0006] In view of the above problems, embodiments of the present invention are proposed to provide a robot control method, apparatus, electronic device and storage medium that overcomes or at least partially solves the above problems.

[0007] In a first aspect, embodiments of the present invention provide a robot control method, the method comprising: Establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system; Based on the first homogeneous transformation matrix, a second homogeneous transformation matrix is ​​determined to characterize the pose transformation of the current workpiece relative to the reference workpiece coordinate system. The robot is controlled to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the reference motion trajectory for the reference workpiece in the compensated coordinate system and the reference workpiece coordinate system. The compensated coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0008] Optionally, establishing the reference workpiece coordinate system includes: Determine the coordinates of at least two feature points on the reference workpiece in the robot's base coordinate system; The reference workpiece coordinate system is established based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system.

[0009] Optionally, determining the second homogeneous transformation matrix, which characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system, based on the first homogeneous transformation matrix, includes: Determine the coordinates of at least two feature points on the current workpiece in the robot base coordinate system; the at least two feature points on the current workpiece correspond one-to-one with the at least two feature points on the reference workpiece. Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix, a second homogeneous transformation matrix is ​​determined to characterize the pose transformation of the current workpiece relative to the reference workpiece coordinate system.

[0010] Optionally, determining the second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix includes: Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system and the first homogeneous transformation matrix, determine the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system. Based on the coordinates of at least two feature points on the current workpiece in the robot base coordinate system and the first homogeneous transformation matrix, determine the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system; Based on the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system and the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system, a second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined.

[0011] Optionally, the method further includes: Extract the deviation data from the second homogeneous transformation matrix; The deviation data is sent to the robot controller so that the robot controller determines the second homogeneous transformation matrix based on the deviation data, and determines the compensation coordinate system based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0012] Optionally, the reference motion trajectory includes the coordinates of multiple reference motion points; the method further includes: The reference motion point is associated with the compensation coordinate system, and the coordinates of the reference motion point in the compensation coordinate system are converted into the coordinates of the target motion point in the robot base coordinate system through the compensation coordinate system. The target motion trajectory is determined based on the coordinates of the target motion point.

[0013] Optionally, determining the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system includes: Acquire an image of the reference workpiece; Based on the image of the reference workpiece, determine the coordinates of at least two feature points on the reference workpiece in the image coordinate system; Convert the coordinates of at least two feature points in the image coordinate system to coordinates in the robot base coordinate system.

[0014] In a second aspect, embodiments of the present invention provide a robot control device, the device comprising: A reference workpiece coordinate system establishment module is used to establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system. The pose transformation determination module is used to determine a second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the first homogeneous transformation matrix. The compensation motion module is used to control the robot to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the compensation coordinate system and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensation coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0015] Optionally, the reference workpiece coordinate system establishment module includes: The first feature point coordinate determination submodule is used to determine the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system. The reference workpiece coordinate system establishment submodule is used to establish the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system.

[0016] Optionally, the pose transformation determination module includes: The second feature point coordinate determination submodule is used to determine the coordinates of at least two feature points on the current workpiece in the robot base coordinate system; the at least two feature points on the current workpiece correspond one-to-one with the at least two feature points on the reference workpiece. The second homogeneous transformation matrix determination submodule is used to determine a second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the coordinate system of the reference workpiece, based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix.

[0017] Optionally, the second homogeneous transformation matrix determination submodule includes: The third feature point coordinate determination unit is used to determine the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system and the first homogeneous transformation matrix. The fourth feature point coordinate determination unit is used to determine the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system based on the coordinates of at least two feature points on the current workpiece in the robot base coordinate system and the first homogeneous transformation matrix. The second homogeneous transformation matrix determination unit is used to determine a second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system and the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system.

[0018] Optionally, the device further includes: The deviation data extraction module is used to extract deviation data from the second homogeneous transformation matrix; The deviation data sending module is used to send the deviation data to the robot controller, so that the robot controller determines the second homogeneous transformation matrix based on the deviation data, and determines the compensation coordinate system based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0019] Optionally, the reference motion trajectory includes the coordinates of multiple reference motion points; the device further includes: The target motion trajectory determination module is used to associate the reference motion point with the compensation coordinate system, and convert the coordinates of the reference motion point in the compensation coordinate system into the coordinates of the target motion point in the robot base coordinate system, and determine the target motion trajectory based on the coordinates of the target motion point.

[0020] Optionally, the first feature point coordinate determination submodule includes: An image acquisition unit is used to acquire an image of the reference workpiece; The image coordinate determination unit is used to determine the coordinates of at least two feature points on the reference workpiece in the image coordinate system based on the image of the reference workpiece. The transformation unit is used to convert the coordinates of at least two feature points in the image coordinate system to coordinates in the robot base coordinate system.

[0021] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0022] Fourthly, embodiments of the present invention provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0023] This invention provides a robot control method. First, a reference workpiece coordinate system is established, and a first homogeneous transformation matrix is ​​determined relative to the robot's base coordinate system. Then, based on the first homogeneous transformation matrix, a second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined. Finally, the robot is controlled to move according to a target motion trajectory in the robot's base coordinate system. The target motion trajectory is determined based on a compensated coordinate system and a reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensated coordinate system is determined based on the first and second homogeneous transformation matrices. By constructing the compensated coordinate system using the first and second homogeneous transformation matrices, and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system, the target motion trajectory is determined. This means that the original reference motion trajectory is remapped across the entire coordinate system using the compensated coordinate system, eliminating the need for individual pose compensation calculations for each motion point in the trajectory. This significantly reduces the real-time computational burden and improves system response speed and operating efficiency. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the steps of a robot control method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a robot control system according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a robot control device according to an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] In the field of industrial automation, industrial robots are widely used in high-precision operations such as assembly, welding, and gluing. To ensure that the robot's end effector can accurately complete operations according to a predetermined trajectory, a workpiece coordinate system (also known as a user coordinate system) fixed to the workpiece must be established to describe the precise position and orientation of the workpiece in the robot's workspace. This coordinate system is the foundation for robot motion planning and trajectory execution, and its accuracy directly determines the quality and consistency of the operation.

[0027] Currently, the establishment of a workpiece coordinate system mainly relies on two methods: one is the manual teaching method, where the operator manually guides the robot to touch several feature points (such as corners, holes, or edges) on the workpiece using a teaching pendant, thereby fitting the workpiece coordinate system. Although this method is simple to implement, it is highly dependent on the operator's experience, making it difficult to guarantee repeatability and positioning accuracy. Furthermore, it requires re-teaching after each workpiece change or tooling adjustment, resulting in low efficiency and difficulty in meeting the demands of flexible, high-cycle production.

[0028] The second approach is automatic positioning based on machine vision. A typical method involves capturing images and identifying preset features after the workpiece is in place, then calculating the workpiece's actual pose relative to the robot's base coordinate system. Existing technologies typically employ two processing strategies: Option A directly creates a new workpiece coordinate system based on the actual pose. However, this renders all previously taught trajectory points in the theoretical workpiece coordinate system invalid, requiring real-time conversion of all point data to the new coordinate system. This not only increases computational complexity but also overwrites the original teaching data, compromising program traceability and reusability. Option B uses the deviation between the actual and theoretical poses (including translation and rotation) as compensation, adding it point-by-point to all taught target points. While this method preserves the original teaching data, when dealing with a large number of trajectory points (such as continuous path gluing or complex welds), coordinate transformation is required for each point, significantly increasing the real-time computational burden on the controller, affecting motion timing, and potentially introducing cumulative errors.

[0029] In summary, existing technologies generally suffer from low efficiency, high computational overhead, or insufficient system flexibility during the dynamic updating of the workpiece coordinate system.

[0030] One of the core concepts of this invention is to determine the target motion trajectory by constructing a compensation coordinate system using a first homogeneous transformation matrix and a second homogeneous transformation matrix representing pose transformation, and a reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. That is, the original reference motion trajectory is remapped in the overall coordinate system by the compensation coordinate system, without the need to perform pose compensation calculations for each motion point in the trajectory separately, thereby significantly reducing the real-time calculation burden and improving the system response speed and operating efficiency.

[0031] Reference Figure 1 The diagram illustrates a flowchart of a robot control method according to an embodiment of the present invention, which may specifically include the following steps: Step 101: Establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system.

[0032] In practical applications, the establishment of a reference workpiece coordinate system is performed once during system debugging or when replacing a new product model. For example, the workpiece can be a metal plate that needs to be coated with glue. The workpiece is placed on a worktable, and the robot can be a six-degree-of-freedom articulated industrial robot with a glue gun installed on its end flange.

[0033] The robot base coordinate system is the most fundamental and fixed reference coordinate system in an industrial robot system. It is also the world origin for all robot kinematic calculations. The robot base coordinate system is a Cartesian right-hand rectangular coordinate system fixed on the robot base (or mounting base). Its origin and direction are determined after the robot is installed and do not change with the robot's movement. All other coordinate systems are defined relative to it. All coordinates must eventually be transformed into the robot base coordinate system through a homogeneous transformation matrix in order to drive the robot's joint movements.

[0034] The reference workpiece coordinate system is a reference coordinate system established during the calibration phase and fixed to the reference workpiece. It is used to describe the position and orientation of the workpiece under ideal conditions, store the original taught trajectory, and serve as a reference for subsequent calculation of the actual workpiece pose deviation. The mathematical representation of the reference workpiece coordinate system is a homogeneous transformation matrix Tbase, which represents the pose of the coordinate system relative to the robot base coordinate system.

[0035] During the system calibration phase, a reference workpiece coordinate system is established, and the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system is determined. The first homogeneous transformation matrix is ​​used to associate the reference workpiece coordinate system with the robot base coordinate system.

[0036] Step 102: Based on the first homogeneous transformation matrix, determine the second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system.

[0037] The current workpiece is relative to the reference workpiece, referring to the actual workpiece to be processed that may have a positional deviation when placed on the worktable during actual production. Based on the first homogeneous transformation matrix, the second homogeneous transformation matrix is ​​calculated. The second homogeneous transformation matrix represents the positional transformation of the current workpiece relative to the coordinate system of the reference workpiece.

[0038] Step 103: Control the robot to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the reference motion trajectory of the reference workpiece in the compensation coordinate system and the reference workpiece coordinate system. The compensation coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0039] The reference motion trajectory for the reference workpiece in the reference workpiece coordinate system refers to the motion path of the robot end effector obtained by manual teaching or offline programming for the reference workpiece in the standard state during the calibration stage. The trajectory consists of a series of ordered teaching points, and the coordinates of each teaching point are stored with the reference workpiece coordinate system as the reference system.

[0040] The compensation coordinate system, also known as the virtual compensation coordinate system, is a temporarily constructed reference coordinate system aligned with the current actual workpiece. It maps the original teaching trajectory to the actual position of the current workpiece, and its pose is equal to the result of correcting the current workpiece pose deviation in the reference workpiece coordinate system. This seamlessly adapts the original teaching trajectory to the current workpiece, achieving precise operation without re-teaching. The virtual compensation coordinate system does not require physical tooling adjustment; it can be created through mathematical transformations and serves as the reference system for reinterpreting the teaching points. The virtual compensation coordinate system is determined by the product of the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0041] By using a virtual compensation coordinate system, the teaching points for the reference workpiece in the reference workpiece coordinate system are transformed to the robot base coordinate system to obtain the corresponding points in the target motion trajectory. Alternatively, the entire trajectory can be mapped at once through a coordinate system binding mechanism to generate a complete target motion trajectory. This target motion trajectory is automatically adapted to the actual pose of the current workpiece, controlling the robot to move according to the target motion trajectory in the robot base coordinate system. This allows for high-precision operation of the current workpiece without the need for re-teaching. Moreover, by constructing a virtual compensation coordinate system and binding the original reference motion trajectory to this coordinate system for execution, the pose adaptation of the entire trajectory can be completed with only one coordinate system transformation. On the one hand, the original teaching data remains unchanged, ensuring program traceability and reusability. On the other hand, point-by-point compensation calculations are avoided, significantly reducing the real-time load on the controller and improving the system's dynamic performance and operational efficiency. This is especially suitable for high-cycle, high-precision continuous trajectory application scenarios.

[0042] This invention provides a robot control method. First, a reference workpiece coordinate system is established, and a first homogeneous transformation matrix is ​​determined relative to the robot's base coordinate system. Then, based on the first homogeneous transformation matrix, a second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined. Finally, the robot is controlled to move according to a target motion trajectory in the robot's base coordinate system. The target motion trajectory is determined based on a compensated coordinate system and a reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensated coordinate system is determined based on the first and second homogeneous transformation matrices. By constructing the compensated coordinate system using the first and second homogeneous transformation matrices, and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system, the target motion trajectory is determined. This means that the original reference motion trajectory is remapped across the entire coordinate system using the compensated coordinate system, eliminating the need for individual pose compensation calculations for each motion point in the trajectory. This significantly reduces the real-time computational burden and improves system response speed and operating efficiency.

[0043] In this embodiment of the invention, step 101, establishing a reference workpiece coordinate system, may specifically include the following sub-steps: Sub-step S11: Determine the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system.

[0044] Sub-step S12: Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, establish the reference workpiece coordinate system.

[0045] For example, the reference workpiece may include two reference holes as feature points, the reference workpiece is fixed at a preset position on the worktable, such as a preset positioning pin, at least two non-collinear feature points on the workpiece are identified, such as the center of the positioning pin hole, and the coordinates of the at least two non-collinear feature points in the robot base coordinate system are determined.

[0046] Based on the coordinates of at least two feature points in the robot's base coordinate system, a Cartesian coordinate system fixed to the reference workpiece is constructed, namely the reference workpiece coordinate system. Specifically, with one of the feature points as the origin, the X and Y axes are defined using the vector relationships between the feature points, and the Z axis is determined by the right-hand rule, thus uniquely determining the pose of this coordinate system in space. This pose is ultimately stored as a first homogeneous transformation matrix for subsequent binding and compensation calculations of the taught trajectory. For example, in a two-dimensional planar positioning scenario, two feature points can be selected to determine the X-axis direction, the Z-axis is vertically upward, and the Y-axis is supplemented by the right-hand rule; in a three-dimensional scenario, three non-collinear points are required to determine the complete pose.

[0047] For example, suppose the three-dimensional coordinates of two feature points in the robot's base coordinate system are: P1 = (x1, y1, z1), P2 = (x2, y2, z2). Determine the origin: P1 is usually chosen as the origin of the reference workpiece coordinate system ({Base} coordinate system). Determine the X-axis direction: The X-axis direction is defined by the unit vector pointing from P1 to P2. Determine the Z-axis direction: For planar workpieces, it is usually assumed that the workpiece plane is parallel to the XY plane of the base coordinate system, or that the normal is known. If the workpiece plane is parallel to the XY plane of the base coordinate system, then the Z-axis is the same as the Z-axis of the base coordinate system. Determine the Y-axis direction: The Y-axis is obtained through a cross product, ensuring that the coordinate system is right-handed. Construct the rotation matrix R: Using the unit vectors as column vectors, form a 3×3 rotation matrix. Construct the first homogeneous transformation matrix T_base. Finally, verify that the X-axis of {Base} is consistent with the actual feature direction of the workpiece (such as the direction of the reference hole connection).

[0048] The established reference workpiece coordinate system is strictly aligned with the geometric features of the physical workpiece, providing a stable and consistent spatial reference for all subsequent teaching trajectories. This avoids operational deviations caused by reference system drift and is a necessary prerequisite for subsequent calculation of the current workpiece pose deviation (second homogeneous transformation matrix). All original teaching points are stored with this coordinate system as a reference, making the same program applicable to any batch and any pose of actual workpieces. It only needs to be adapted through subsequent compensation mechanisms without reprogramming.

[0049] In this embodiment of the invention, sub-step S11, which determines the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, may specifically include the following sub-steps: Sub-step S111: Obtain an image of the reference workpiece.

[0050] Sub-step S112: Based on the image of the reference workpiece, determine the coordinates of at least two feature points on the reference workpiece in the image coordinate system.

[0051] Sub-step S113 converts the coordinates of at least two feature points in the image coordinate system to coordinates in the robot base coordinate system.

[0052] It can acquire images of the reference workpiece captured by the camera, for reference. Figure 2The control system includes an industrial robot, exemplarily a six-degree-of-freedom articulated robot with a glue gun mounted on its end flange; a robot controller that controls all movements of the robot; a vision system including a fixedly mounted industrial camera (located above the worktable, with a field of view covering the workpiece placement area), a light source, and a vision processor; a workpiece, exemplarily a metal plate to be glued, with two reference holes serving as feature points; a communication network, with the robot controller and vision processor connected via an industrial Ethernet network, using sockets for data communication; and a switch that enables high-speed, stable network communication between multiple devices.

[0053] During the system calibration phase, to achieve high-precision trajectory compensation under vision guidance, hand-eye calibration must first be completed to establish the spatial pose association between the vision system and the robot, and to determine the homogeneous transformation matrix of the camera coordinate system relative to the robot's base coordinate system. Once the robot moves to the preset photographing pose, the robot controller sends a trigger signal to the camera to take a picture of the reference workpiece. After the camera completes image acquisition of the reference workpiece, the vision processor acquires the image of the reference workpiece and identifies and extracts the center pixel coordinates of at least two feature points in the image coordinate system. The center pixel coordinates represent the image position of the feature points.

[0054] The vision processor, combining camera intrinsic parameters, hand-eye calibration parameters, and workpiece geometric constraints (such as hole centers being on the same plane), transforms the coordinates of at least two feature points on the reference workpiece from the image coordinate system to the robot base coordinate system, which is then used to construct the workpiece coordinate system. The vision processor can automatically and efficiently convert feature points on the reference workpiece from image pixel coordinates to three-dimensional spatial coordinates in the robot base coordinate system, avoiding the tediousness and errors of manual teaching and positioning, and providing high-precision, repeatable input data for the subsequent establishment of the reference workpiece coordinate system.

[0055] In this embodiment of the invention, step 102, based on the first homogeneous transformation matrix, determines the second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system, which may specifically include the following sub-steps: Sub-step S21: Determine the coordinates of at least two feature points on the current workpiece in the robot base coordinate system; at least two feature points on the current workpiece correspond one-to-one with at least two feature points on the reference workpiece.

[0056] Sub-step S22: Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix, determine the second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system.

[0057] In practical applications, a new workpiece is transported to the work area by a conveyor belt. Due to positioning errors, its actual position may deviate from the reference position. After the sensor detects that the workpiece has arrived, it triggers the camera to take a picture. The vision processor determines the coordinates of at least two feature points on the current workpiece in the robot's base coordinate system. The specific implementation method can be the same as determining the coordinates of at least two feature points on the reference workpiece in the robot's base coordinate system. At least two feature points on the current workpiece need to correspond one-to-one with at least two feature points on the reference workpiece.

[0058] The vision processor determines a second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system, based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and a first homogeneous transformation matrix. Based on one-to-one feature point pairs and the calibrated reference workpiece pose (first homogeneous transformation matrix), the vision processor accurately and efficiently calculates the complete pose deviation of the current workpiece relative to the reference workpiece coordinate system (second homogeneous transformation matrix). This avoids modification of the original taught trajectory or point-by-point compensation calculations, requiring only a single coordinate system transformation to achieve adaptive remapping of the entire trajectory. This significantly improves the accuracy and robustness of pose calculation and greatly reduces the real-time computational burden on the robot controller.

[0059] In this embodiment of the invention, sub-step S22 may specifically include the following sub-steps: Sub-step S221: Determine the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system and the first homogeneous transformation matrix.

[0060] Sub-step S222: Based on the coordinates of at least two feature points on the current workpiece in the robot base coordinate system and the first homogeneous transformation matrix, determine the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system.

[0061] Sub-step S223: Based on the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system and the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system, determine the second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system.

[0062] The vision processor performs deviation calculations by determining the feature point sets of a reference workpiece and the current workpiece. The feature point set of the reference workpiece consists of the coordinates of at least two feature points of the reference workpiece in the reference workpiece coordinate system, and the feature point set of the current workpiece consists of the coordinates of at least two feature points of the current workpiece in the reference workpiece coordinate system. Then, based on the coordinates of at least two feature points on the reference workpiece and at least two feature points on the current workpiece in the reference workpiece coordinate system, a second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined. By uniformly representing the corresponding feature points of the current workpiece and the reference workpiece in the reference workpiece coordinate system, and performing rigid body pose registration based on this, the ambiguity of scale or direction caused by direct comparison across coordinate systems can be avoided, ensuring the mathematical rigor and numerical stability of the pose calculation. Furthermore, only two non-collinear points are needed to uniquely determine the pose in the planar scene. The resulting second homogeneous transformation matrix can be directly used to construct a virtual compensation coordinate system, realizing a one-time remapping of the entire teaching trajectory, avoiding point-by-point correction, significantly reducing the real-time computing load of the controller, and improving the system response speed and production cycle.

[0063] In this embodiment of the invention, the method further includes: Extract the deviation data from the second homogeneous transformation matrix; Deviation data is sent to the robot controller so that the robot controller can determine the second homogeneous transformation matrix based on the deviation data, and determine the compensation coordinate system based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0064] After determining the second homogeneous transformation matrix, the vision processor extracts the deviation data from it. The second homogeneous transformation matrix can typically be decomposed into translations: X-direction translation: ΔX = t_x; Y-direction translation: ΔY = t_y; Z-direction translation: ΔZ = t_z (relative to the {Base} coordinate system); and rotation: rotation around the Z-axis: Δθ (counterclockwise rotation around the Z_{Base} axis). The vision processor sends this deviation data (ΔX, ΔY, Δθ) to the robot controller via Ethernet. For planar applications, the main focus is on ΔX, ΔY, and Δθ.

[0065] After receiving the deviation data (ΔX, ΔY, Δθ), the robot controller determines the second homogeneous transformation matrix based on the deviation data (ΔX, ΔY, Δθ), and then dynamically creates a virtual compensation coordinate system {Compensated} in memory. The virtual compensation coordinate system {Compensated} is determined by the product of the first and second homogeneous transformation matrices. The robot controller performs the following calculation internally: {Compensated} = {Base} * T, where T is the second homogeneous transformation matrix and {Base} is the first homogeneous transformation matrix. The first homogeneous transformation matrix can be used to establish the reference workpiece coordinate system for the robot controller.

[0066] Origin of the virtual compensation coordinate system: O_comp = T_base × T × [0,0,0,1]^T, X-axis direction of the virtual compensation coordinate system: X_comp = T_base × T × [1,0,0,0]^T - O_comp, Y-axis direction of the virtual compensation coordinate system: Y_comp = T_base × T × [0,1,0,0]^T - O_comp, Z-axis direction of the virtual compensation coordinate system: Z_comp = T_base × T × [0,0,1,0]^T - O_comp.

[0067] The vision processor extracts key deviation data from the second homogeneous transformation matrix and sends this lightweight deviation data to the robot controller, effectively reducing the amount of communication data and protocol complexity between the vision system and the controller. This is particularly suitable for industrial environments with limited bandwidth or using traditional, simple communication interfaces. Based on the received deviation data, the robot controller can quickly reconstruct the second homogeneous transformation matrix and, combined with the stored first homogeneous transformation matrix, efficiently generate a compensation coordinate system. This allows for accurate overall compensation of the taught trajectory without relying on high-speed networks or complex data formats.

[0068] In this embodiment of the invention, the reference motion trajectory includes the coordinates of multiple reference motion points; the method further includes: The reference motion point is associated with the compensation coordinate system, and the coordinates of the reference motion point in the compensation coordinate system are converted into the coordinates of the target motion point in the robot base coordinate system. The target motion trajectory is determined based on the coordinates of the target motion point.

[0069] The reference motion trajectory is the teaching trajectory, and the coordinates of the reference motion points are the coordinates of the teaching points. During the reference establishment phase, the operator uses a teach pendant to manipulate the robot to drive the glue gun along the glue seam trajectory of the reference workpiece in the reference workpiece coordinate system for precise teaching. The coordinate values ​​of all teaching points are recorded in the robot controller with reference to the reference workpiece coordinate system. After determining the virtual compensation coordinate system, the robot controller does not modify any of the taught point coordinates. When the glue application program is started, the robot controller still reads the original teaching points, but interprets these points as target points in the virtual compensation coordinate system {Compensated}. Since the robot kinematics system is always solved based on the final coordinates of the target point in the base coordinate system, it automatically transforms the point P_i in the {Compensated} coordinate system to the actual position in the base coordinate system through {Base} and T transformations, and drives the joints to move. Finally, the robot accurately reproduces the complete trajectory taught on the reference workpiece on the new workpiece, perfectly compensating for the position and attitude deviations of the workpiece. By treating the pose compensation amounts (ΔX, ΔY, Δθ) for a new workpiece as a whole and applying them all at once to the entire workpiece coordinate system, the robot controller only needs to perform a coordinate system transformation calculation once, regardless of the number of points in the trajectory. This reduces the controller's workload and improves system response speed, as the coordinate system transformation is calculated only once per trajectory point, regardless of its complexity.

[0070] This invention creates and fixes a reference workpiece coordinate system to store all original, immutable teaching data. When the workpiece pose changes, a virtual, compensated coordinate system is dynamically generated based on the deviation data calculated visually. The robot's motion control is interpreted based on this virtual coordinate system, rather than modifying the original data, thus achieving the separation and mapping between the reference coordinate system and the virtual coordinate system. The pose compensation amount (ΔX, ΔY, Δθ) for the new workpiece is treated as a whole and applied to the entire workpiece coordinate system at once. Regardless of the number of points in the trajectory package, the controller only needs to perform a coordinate system transformation calculation once, achieving a lightweight computational model where compensation is applied once and takes effect globally. Eliminates repetitive teaching: For workpieces of the same model but with different poses, only one reference teaching is required, improving efficiency; Protects original data and offers high flexibility: The original teaching point data remains unchanged, and compensation is performed only at the coordinate system level; High computational efficiency: No matter how complex the trajectory, only one coordinate system transformation needs to be calculated each time, instead of compensating each trajectory point individually, reducing the controller's burden and improving system response speed; High and consistent accuracy: Fully automatic high-precision positioning is achieved by the vision system, ensuring the stability of product quality; Enhanced system flexibility: It can quickly adapt to fluctuations in the position and posture of incoming materials, making it particularly suitable for complex working conditions such as logistics and assembly.

[0071] ReferenceFigure 3 The diagram illustrates the structure of a robot control device according to an embodiment of the present invention, which may specifically include the following structure: The reference workpiece coordinate system establishment module 201 is used to establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system. The pose transformation determination module 202 is used to determine a second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the first homogeneous transformation matrix. The compensation motion module 203 is used to control the robot to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the compensation coordinate system and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensation coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0072] This invention provides a robot control device. First, a reference workpiece coordinate system is established, and a first homogeneous transformation matrix is ​​determined relative to the robot's base coordinate system. Then, based on the first homogeneous transformation matrix, a second homogeneous transformation matrix representing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined. Finally, the robot is controlled to move according to a target motion trajectory in the robot's base coordinate system. The target motion trajectory is determined based on a compensation coordinate system and a reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensation coordinate system is determined based on the first and second homogeneous transformation matrices. By constructing the compensation coordinate system using the first and second homogeneous transformation matrices, and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system, the target motion trajectory is determined. This means that the original reference motion trajectory is remapped across the entire coordinate system using the compensation coordinate system, eliminating the need for individual pose compensation calculations for each motion point in the trajectory. This significantly reduces the real-time computational burden and improves system response speed and operating efficiency.

[0073] In this embodiment of the invention, the reference workpiece coordinate system establishment module includes: The first feature point coordinate determination submodule is used to determine the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system. The reference workpiece coordinate system establishment submodule is used to establish the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system.

[0074] In this embodiment of the invention, the pose transformation determination module includes: The second feature point coordinate determination submodule is used to determine the coordinates of at least two feature points on the current workpiece in the robot base coordinate system; the at least two feature points on the current workpiece correspond one-to-one with the at least two feature points on the reference workpiece. The second homogeneous transformation matrix determination submodule is used to determine a second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the coordinate system of the reference workpiece, based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix.

[0075] In this embodiment of the invention, the second homogeneous transformation matrix determination submodule includes: The third feature point coordinate determination unit is used to determine the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system and the first homogeneous transformation matrix. The fourth feature point coordinate determination unit is used to determine the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system based on the coordinates of at least two feature points on the current workpiece in the robot base coordinate system and the first homogeneous transformation matrix. The second homogeneous transformation matrix determination unit is used to determine a second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system and the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system.

[0076] In this embodiment of the invention, the device further includes: The deviation data extraction module is used to extract deviation data from the second homogeneous transformation matrix; The deviation data sending module is used to send the deviation data to the robot controller, so that the robot controller determines the second homogeneous transformation matrix based on the deviation data, and determines the compensation coordinate system based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

[0077] In this embodiment of the invention, the reference motion trajectory includes the coordinates of multiple reference motion points; the device further includes: The target motion trajectory determination module is used to associate the reference motion point with the compensation coordinate system, and convert the coordinates of the reference motion point in the compensation coordinate system into the coordinates of the target motion point in the robot base coordinate system, and determine the target motion trajectory based on the coordinates of the target motion point.

[0078] In this embodiment of the invention, the first feature point coordinate determination submodule includes: An image acquisition unit is used to acquire an image of the reference workpiece; The image coordinate determination unit is used to determine the coordinates of at least two feature points on the reference workpiece in the image coordinate system based on the image of the reference workpiece. The transformation unit is used to convert the coordinates of at least two feature points in the image coordinate system to coordinates in the robot base coordinate system.

[0079] This invention also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described robot control method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0080] It should be noted that the electronic devices in the embodiments of the present invention include the mobile electronic devices and non-mobile electronic devices described above.

[0081] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described robot control method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0082] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0083] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0086] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these modifications are within the protection scope of the present invention.

Claims

1. A method for controlling a robot, characterized in that, The method includes: Establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system; Based on the first homogeneous transformation matrix, a second homogeneous transformation matrix is ​​determined to characterize the pose transformation of the current workpiece relative to the reference workpiece coordinate system. The robot is controlled to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the reference motion trajectory for the reference workpiece in the compensated coordinate system and the reference workpiece coordinate system. The compensated coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

2. The control method according to claim 1, characterized in that, The establishment of the reference workpiece coordinate system includes: Determine the coordinates of at least two feature points on the reference workpiece in the robot's base coordinate system; The reference workpiece coordinate system is established based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system.

3. The control method according to claim 2, characterized in that, The step of determining the second homogeneous transformation matrix, which characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system, based on the first homogeneous transformation matrix, includes: Determine the coordinates of at least two feature points on the current workpiece in the robot base coordinate system; the at least two feature points on the current workpiece correspond one-to-one with the at least two feature points on the reference workpiece. Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix, a second homogeneous transformation matrix is ​​determined to characterize the pose transformation of the current workpiece relative to the reference workpiece coordinate system.

4. The control method according to claim 3, characterized in that, The step of determining a second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system, the coordinates of at least two feature points on the current workpiece in the robot base coordinate system, and the first homogeneous transformation matrix includes: Based on the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system and the first homogeneous transformation matrix, determine the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system. Based on the coordinates of at least two feature points on the current workpiece in the robot base coordinate system and the first homogeneous transformation matrix, determine the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system; Based on the coordinates of at least two feature points on the reference workpiece in the reference workpiece coordinate system and the coordinates of at least two feature points on the current workpiece in the reference workpiece coordinate system, a second homogeneous transformation matrix characterizing the pose transformation of the current workpiece relative to the reference workpiece coordinate system is determined.

5. The control method according to claim 1, characterized in that, The method further includes: Extract the deviation data from the second homogeneous transformation matrix; The deviation data is sent to the robot controller so that the robot controller determines the second homogeneous transformation matrix based on the deviation data, and determines the compensation coordinate system based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

6. The control method according to claim 1, characterized in that, The reference motion trajectory includes the coordinates of multiple reference motion points; the method further includes: The reference motion point is associated with the compensation coordinate system, and the coordinates of the reference motion point in the compensation coordinate system are converted into the coordinates of the target motion point in the robot base coordinate system through the compensation coordinate system. The target motion trajectory is determined based on the coordinates of the target motion point.

7. The control method according to claim 2, characterized in that, Determining the coordinates of at least two feature points on the reference workpiece in the robot base coordinate system includes: Acquire an image of the reference workpiece; Based on the image of the reference workpiece, determine the coordinates of at least two feature points on the reference workpiece in the image coordinate system; Convert the coordinates of at least two feature points in the image coordinate system to coordinates in the robot base coordinate system.

8. A control device for a robot, characterized in that, The device includes: A reference workpiece coordinate system establishment module is used to establish a reference workpiece coordinate system and determine the first homogeneous transformation matrix of the reference workpiece coordinate system relative to the robot base coordinate system. The pose transformation determination module is used to determine a second homogeneous transformation matrix that characterizes the pose transformation of the current workpiece relative to the reference workpiece coordinate system based on the first homogeneous transformation matrix. The compensation motion module is used to control the robot to move according to the target motion trajectory in the robot base coordinate system. The target motion trajectory is determined based on the compensation coordinate system and the reference motion trajectory for the reference workpiece in the reference workpiece coordinate system. The compensation coordinate system is determined based on the first homogeneous transformation matrix and the second homogeneous transformation matrix.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of a robot control method as described in claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of a robot control method as described in claims 1-7.