A control method and device of a robot, the robot, and a storage medium
By acquiring the posture data of the robotic arm base and using coordinate transformation matrix and gravity compensation coefficient to control the robotic arm, the problem of control accuracy caused by the non-level installation of the base was solved, and higher control precision and accuracy were achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YUANHUA ORTHOPAEDIC ROBOTICS (SHENZHEN) LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-06-05
Smart Images

Figure CN121670691B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of equipment control technology, and in particular relates to a robot control method, device, robot, and storage medium. Background Technology
[0002] In applications such as medical surgery, industrial manufacturing, and precision assembly, it is necessary to frequently control the robotic arms on robots to carry loads and complete high-precision operations, such as grasping parts and transporting materials. Especially when robotic arms are applied to the field of medical surgery, the precision requirements are even higher, and the accuracy of gravity recognition of the robotic arms is required to be even higher.
[0003] Existing robotic arm control technologies determine the relevant parameters during the control process based on the horizontal mounting level of the robotic arm's base. However, the actual application scenarios of robotic arms are diverse, and there may be situations such as uneven base mounting or uneven terrain, leading to a mismatch between the relevant parameters and the actual installation scenario, thus reducing the robot's control accuracy. Summary of the Invention
[0004] This application provides a robot control method, device, robot, and storage medium, which can solve the problem of low control accuracy of robotic arms due to the diverse actual application scenarios of robotic arms, such as uneven base installation or uneven site.
[0005] In a first aspect, embodiments of this application provide a robot control method, the method comprising:
[0006] Obtain the first posture data corresponding to the base where the robot's robotic arm is located;
[0007] Based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the first deviation data corresponding to the base is determined;
[0008] The robotic arm is controlled based on the gravity compensation coefficient corresponding to the first deviation data.
[0009] In one possible implementation of the first aspect, before determining the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the method further includes:
[0010] Obtain the first coordinate system corresponding to the motion sensor of the robotic arm and the second coordinate system corresponding to the base;
[0011] Based on the first coordinate system and the second coordinate system, obtain the mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system;
[0012] Obtain the rotation matrix corresponding to the rotation of the robotic arm around the base;
[0013] The coordinate transformation matrix is obtained based on the mapping matrix and the rotation matrix.
[0014] In one possible implementation of the first aspect, obtaining the rotation matrix corresponding to the rotation of the robotic arm around the base includes:
[0015] Determine the roll angle matrix of the robotic arm around the first coordinate axis of the motion sensor; the roll angle matrix is:
[0016]
[0017] The α is the roll angle matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor;
[0018] Determine the pitch angle matrix of the robotic arm around the second coordinate axis of the motion sensor; the pitch angle matrix is:
[0019]
[0020] The β is the pitch angle matrix; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor;
[0021] Determine the deflection angle matrix of the robotic arm around the third coordinate axis of the motion sensor; the deflection angle matrix is:
[0022]
[0023] The γ is the deflection angle matrix; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor;
[0024] The rotation matrix is determined based on the roll angle matrix, the pitch angle matrix, and the yaw angle matrix; the rotation matrix is:
[0025]
[0026] R1 is the rotation matrix.
[0027] In one possible implementation of the first aspect, obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix includes:
[0028] Based on the distance vector between the motion sensor and the base and the mapping matrix, the stiffness mapping matrix is obtained; the stiffness mapping matrix is:
[0029]
[0030] Wherein, R2 is the stiffness mapping matrix; (x0, y0, z0) is the distance vector; x0 is the value of the distance vector on the first coordinate axis; y0 is the value of the distance vector on the second coordinate axis; and z0 is the value of the distance vector on the third coordinate axis.
[0031] Based on the stiffness mapping matrix and the rotation matrix, the coordinate transformation matrix is obtained; the coordinate transformation matrix is:
[0032]
[0033]
[0034] Where T2 is the coordinate transformation matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; c is the cosine function; and s is the sinine function.
[0035] In one possible implementation of the first aspect, obtaining the first posture data corresponding to the base where the robot's robotic arm is located includes:
[0036] When the robotic arm is stationary, acquire the first posture data corresponding to the base where the robotic arm is located;
[0037] After acquiring the first posture data corresponding to the base where the robot's robotic arm is located, the process also includes...
[0038] If the first posture data does not match the second posture data corresponding to the second deviation data, then the first deviation data corresponding to the base is determined based on the first posture data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located; the second deviation data is the deviation data determined during historical use.
[0039] If the first posture data matches the second posture data corresponding to the second deviation data, then the robotic arm is controlled according to the gravity compensation coefficient corresponding to the second deviation data.
[0040] In one possible implementation of the first aspect, controlling the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data includes:
[0041] During the process of controlling the robotic arm based on the gravity compensation coefficient, if the data deviation between the third posture data and the first posture data at any time is greater than a preset deviation threshold, the gravity compensation coefficient is updated based on the third posture data.
[0042] The robotic arm is controlled based on the updated gravity compensation coefficient.
[0043] In one possible implementation of the first aspect, controlling the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data includes:
[0044] Based on the position of the center of mass of each mechanical component on the robotic arm, determine the corresponding gravitational torque of each mechanical component;
[0045] The gravity compensation coefficient and the gravitational torque are imported into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm.
[0046] Secondly, embodiments of this application provide a robot control device, the device comprising:
[0047] The attitude data acquisition unit is used to acquire the first attitude data corresponding to the base where the robot's robotic arm is located;
[0048] The first deviation data determination unit is used to determine the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located.
[0049] The robotic arm control unit is used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data.
[0050] Thirdly, embodiments of this application provide a robot, the robot including a robotic arm, the robot further including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any of the first aspects above.
[0051] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0052] Fifthly, embodiments of this application provide a computer program product that, when run on a robotic arm, causes a drone to perform the method described in any one of the first aspects above.
[0053] The beneficial effects of this application embodiment compared with the prior art are as follows: By acquiring the first posture data corresponding to the robotic arm and importing the first posture data into a preset coordinate transformation matrix, the first deviation data corresponding to the first posture data is determined. Then, based on the gravity compensation coefficient corresponding to the first deviation data, the robotic arm is controlled, achieving the goal of accurately controlling the robotic arm according to the actual installation of the robotic arm's base. Compared with existing robot control technologies, this application embodiment can determine the first posture data corresponding to the base before controlling the robotic arm, rather than assuming the base is installed in a horizontal position. Since the first posture data can determine whether the base is in a horizontal position, if there is a deviation from the horizontal position, the gravity compensation coefficient can be determined based on the first posture data. Then, the robotic arm can be controlled through the gravity compensation coefficient to offset the impact of non-horizontal placement on the robot's control accuracy, achieving automatic compensation for placement deviation and improving the robot's control precision and accuracy. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic diagram of the structure of a robotic arm provided in one embodiment of this application;
[0056] Figure 2 This is a schematic diagram of the structure of a robotic arm provided in another embodiment of this application;
[0057] Figure 3 This is a schematic diagram illustrating the implementation of a robot control method provided in an embodiment of this application;
[0058] Figure 4 This is a flowchart illustrating the specific implementation of a robot control method provided in the second embodiment of this application before step S302;
[0059] Figure 5 This is a schematic diagram comparing the first coordinate system and the second coordinate system provided in an embodiment of this application;
[0060] Figure 6 This is a flowchart illustrating the specific implementation of a robot control method provided in the third embodiment of this application in step S301.
[0061] Figure 7 This is a flowchart illustrating the specific implementation of a robot control method provided in the fourth embodiment of this application in step S303.
[0062] Figure 8 This is a flowchart illustrating the specific implementation of a robot control method provided in the fifth embodiment of this application in step S303.
[0063] Figure 9 This is a schematic diagram of the structure of a robot control device provided in an embodiment of this application;
[0064] Figure 10 This is a schematic diagram of the robot provided in the embodiments of this application. Detailed Implementation
[0065] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0066] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0067] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0068] The robot control method provided in this application can be applied to scenarios involving the control of robotic arms. When a processor is configured on the robotic arm, the executing entity of the above-described robot control method can be a robotic arm. For example, Figure 1 A schematic diagram of the structure of a robotic arm according to an embodiment of this application is shown. See also... Figure 1The robotic arm includes a base 11, a movable mechanical component 12 fixed to the base 11, a motion sensor 13 disposed on the base 11, and a processing chip 14. The processing chip 14 can establish a communication link with the motion sensor 13 and the movable mechanical component 12. This communication link can be a wired communication link or a wireless communication link, such as a near-field communication link, Bluetooth communication link, or WiFi communication link. The motion sensor 13 can send the collected attitude data to the processing chip 14. The processing chip 14 can determine a gravity compensation coefficient based on the attitude data and control the movable mechanical component 12 according to the gravity compensation coefficient to achieve precise control of the robotic arm. The processor can be disposed on the base 11 or on the movable mechanical component 12; the specific installation position of the processor can be selected according to the actual situation and is not limited here.
[0069] In some implementations, the motion sensor 13 can be an inertial measurement unit (IMU) or other motion sensors, depending on the specific circumstances.
[0070] In some possible implementations, the robotic arm can establish a communication link with a separate electronic device, which then controls the robotic arm's operation. For example, Figure 2 A schematic diagram of the structure of a robotic arm according to another embodiment of this application is shown. See also Figure 2 As shown, the robotic arm 21 can be connected to an electronic device 22. The robotic arm 21 may include a base 11 and movable mechanical parts 12. A motion sensor 13 may be mounted on the base 11, and the motion sensor 13 can be connected to the electronic device 22 to send attitude data of the robotic arm 21 to the electronic device 22. The electronic device 22 can determine a gravity compensation coefficient based on the attitude data and control the operation of the robotic arm 21 according to the gravity compensation coefficient, thereby improving the control accuracy of the robotic arm 21.
[0071] Please see Figure 3 , Figure 3 The illustration shows a schematic diagram of a robot control method provided in an embodiment of this application. This robot control method can be applied to the processor of the aforementioned robotic arm, or to another electronic device connected to the robotic arm, as described above. Figure 2 The electronic device 22 shown is, for example, a computer, laptop, server, or smartphone. For ease of description, the following description uses a robotic arm as an example of the execution subject. Specifically, the method includes the following steps:
[0072] In S301, the first posture data corresponding to the base where the robot's robotic arm is located is obtained.
[0073] In this embodiment, a motion sensor can be installed on the base of the robotic arm. The motion sensor can be used to determine the first attitude data of the base where the robotic arm is located. For example, the first attitude data can include the roll angle of rotation around the x-axis, the pitch angle of rotation around the y-axis, and the yaw angle of rotation around the z-axis.
[0074] In some implementations, the aforementioned robotic arm can be a 6-axis serial robotic arm, with a torque sensor mounted at its end. The end of the torque sensor can be connected to the load of the robotic arm. The torque sensor on the robotic arm can be used to determine the gravitational torque of each mechanical component on the robotic arm, and then the control parameters of the robot can be determined based on the gravitational torque collected by the torque sensor.
[0075] In some implementations, the aforementioned motion sensor can be an attitude sensor that combines a 3-axis gyroscope and a 3-axis accelerometer to measure the Roll angle, Pitch angle, and Yaw angle, so as to determine the first attitude data corresponding to the base where the robotic arm is located based on the above three different angles.
[0076] In some possible implementations, the motion sensor can be rigidly fixed to the base of the robotic arm. Based on the relative positional relationship between the motion sensor and the corresponding centroid of the base, the distance vector between them can be obtained. The coordinate transformation relationship between the motion sensor and the centroid of the base can be determined through this distance vector. Based on the coordinate transformation relationship, the original posture data collected by the motion sensor can be calibrated to obtain the first posture data.
[0077] In this embodiment, before the robotic arm operates, it can perform the operations described in S301 to S303 to determine its corresponding gravity compensation coefficient, so that the robotic arm can be precisely controlled based on the gravity compensation coefficient during subsequent operation.
[0078] In some implementations, the robotic arm can be set with corresponding compensation coefficient triggering conditions. If the above triggering conditions are detected, it means that the gravity compensation coefficient corresponding to the robotic arm needs to be determined. At this time, the robotic arm can perform the above operations S301 to S303.
[0079] In S302, based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the first deviation data corresponding to the base is determined.
[0080] In this embodiment, after the robotic arm obtains the first posture data corresponding to its base, it can import the first posture data into the coordinate transformation matrix between the robotic arm and the base to determine the first deviation data corresponding to the base. The first deviation data is specifically used to determine the degree of offset between the base and the horizontal plane. The larger the first deviation data, the higher the degree of offset; conversely, the smaller the first deviation data, the lower the degree of offset.
[0081] In this embodiment, since the relative position between the base of the robotic arm and the motion sensor is fixed, the robotic arm can obtain the coordinate transformation matrix based on the distance vector between the base and the motion sensor, and import the first posture data collected by the motion sensor into the coordinate transformation matrix. This allows the robotic arm to obtain the posture information corresponding to the centroid of the base, thereby determining the offset from the horizontal plane based on the centroid information of the base, which is the first deviation data.
[0082] In S303, the robotic arm is controlled based on the gravity compensation coefficient corresponding to the first deviation data.
[0083] In this embodiment, after determining the first deviation data between the base and the horizontal plane, the robotic arm can import this first deviation data into a preset deviation conversion function to calculate the degree of influence of the first deviation data on the torque of the robotic arm, i.e., obtain the aforementioned gravity compensation coefficient. Since the degree of deviation from the horizontal plane directly affects the torque calculation results of each mechanical component on the robotic arm, especially when there is a load at the end of the robotic arm, the influence of the deviation on the torque will further increase. Therefore, the electronic device can calculate the gravity compensation coefficient based on the first deviation data and adjust the torque calculation function corresponding to each mechanical component based on the gravity compensation coefficient. This adjustment of the torque calculation function allows for control of the robotic arm, thereby improving the accuracy of robotic arm control.
[0084] In some possible implementations, the robotic arm can also obtain the weight value of the load at the end of the robotic arm, and determine the torque calculation function corresponding to each mechanical component on the robotic arm based on the weight value and the gravity compensation coefficient, thereby improving the accuracy of torque calculation and subsequently improving the control accuracy of the robot.
[0085] In some possible implementations, if the robotic arm has an extendable function, it can also determine the torque calculation function corresponding to each component on the robotic arm based on the aforementioned weight value, current extension length, and gravity compensation coefficient, so as to improve the accuracy of the aforementioned torque calculation function and thus improve the subsequent control accuracy of the robot.
[0086] As can be seen from the above, the robot control method provided in this application embodiment acquires the first posture data corresponding to the robotic arm, imports the first posture data into a preset coordinate transformation matrix, determines the first deviation data corresponding to the first posture data, and then controls the robotic arm according to the gravity compensation coefficient corresponding to the first deviation data. This achieves the goal of accurately controlling the robotic arm based on the actual installation of the robotic arm's base. Compared with existing robot control technologies, this application embodiment can determine the first posture data corresponding to the base before controlling the robotic arm, rather than assuming the base is installed in a horizontal position. Since the first posture data can determine whether the base is in a horizontal position, if there is a deviation from the horizontal position, a gravity compensation coefficient can be determined based on the first posture data. Then, the robotic arm can be controlled through the gravity compensation coefficient to offset the impact of non-horizontal placement on the robot's control accuracy, achieving automatic compensation for placement deviation and improving the robot's control precision and accuracy.
[0087] Figure 4 A flowchart illustrating the specific implementation of a robot control method according to the second embodiment of this application before step S302 is shown. See also... Figure 4 As shown, relative to Figure 3 In the embodiment provided in this application, the robot control method further includes steps S401 to S404 before step S302, as described in detail below:
[0088] Specifically, before determining the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the method further includes:
[0089] In S401, the first coordinate system corresponding to the motion sensor of the robotic arm and the second coordinate system corresponding to the base are obtained.
[0090] In this embodiment, there is a certain offset between the motion sensor on the robotic arm and the center of mass of the base on which the robotic arm is located; that is, the motion sensor and the center of mass are not completely coincident. In this case, it is necessary to establish corresponding coordinate systems for the two objects to enable coordinate transformation between the two positions. The coordinate system established based on the motion sensor is the first coordinate system mentioned above, which can be a three-dimensional coordinate system. The coordinate system established based on the center of mass of the base can be the second coordinate system mentioned above, which can also be a three-dimensional coordinate system.
[0091] In some possible implementation examples, each coordinate axis in the first coordinate system can be customized according to the application controlling the robotic arm. For example, the first coordinate system can be any coordinate system that satisfies the right-handed coordinate system.
[0092] For example, Figure 5 A schematic diagram comparing a first coordinate system and a second coordinate system provided in an embodiment of this application is shown. See also Figure 5 As shown, the first coordinate system includes an x-axis, a y-axis, and a z-axis, wherein the positive direction of the z-axis of the first coordinate system is perpendicular to the x-axis. Figure 5 The plane it occupies faces inwards; the second coordinate system of the cedar tree also includes an x-axis, a y-axis, and a z-axis, wherein the positive direction of the z-axis of the second coordinate system is perpendicular. Figure 5 The plane in question faces outwards. Comparing the two coordinate systems above, the x-axis of the two coordinate systems has the same direction, while the y-axis and z-axis have opposite directions. That is, the x+ direction of the first coordinate system is parallel to and in the same direction as the x+ direction of the second coordinate system, the y- direction of the first coordinate system is parallel to and in the same direction as the y+ direction of the second coordinate system, and the z- direction of the first coordinate system is parallel to and in the same direction as the z+ direction of the second coordinate system.
[0093] In S402, a mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system is obtained based on the first coordinate system and the second coordinate system.
[0094] In this embodiment, the robotic arm can determine the mapping matrix used when mapping from the first coordinate system to the second coordinate system based on the first coordinate system of the motion sensor and the second coordinate system corresponding to the base.
[0095] For example, if the directions of the two coordinate systems mentioned above are as follows: Figure 5 As shown, the mapping matrix R2' can be expressed as:
[0096]
[0097] Since the positive directions of the x-axis of the two coordinate systems are the same, the corresponding coefficient is 1. The y-axis and z-axis are opposite in direction, so the corresponding coefficient is -1. The specific mapping matrix R2' can be determined according to the positional relationship between the directions of the coordinate axes of the two coordinate systems, and is not limited here.
[0098] In S403, the rotation matrix corresponding to the rotation of the robotic arm around the base is obtained.
[0099] In this embodiment, the directions in which the robotic arm rotates around the base are the deflection angles around the coordinate axes collected by the motion sensor. This allows the data collected by the motion sensor to be converted into offset values corresponding to each coordinate axis in the first coordinate system. Subsequently, a coordinate transformation matrix can be established to convert the offset values (i.e., the first posture data) in the first coordinate system into the first deviation data corresponding to the second coordinate system.
[0100] In this embodiment, the robotic arm can determine the offset of the yaw angle (i.e., roll angle) rotating around the x-axis to each coordinate axis, the offset of the pitch angle rotating around the y-axis to each coordinate axis, and the offset of the yaw angle rotating around the z-axis to each coordinate axis. Based on the above three different offsets, the above rotation matrix can be constructed.
[0101] Furthermore, as another embodiment of this application, the above-described determination of the rotation matrix may specifically include the following steps:
[0102] In S403.1, the roll angle matrix of the robotic arm around the first coordinate axis of the motion sensor is determined; the roll angle matrix is:
[0103]
[0104] The α is the roll angle matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor.
[0105] In this embodiment, the first coordinate axis can be the x-axis in the first coordinate system. The robotic arm can determine the offset of the roll angle α in each coordinate system, thereby constructing the roll angle matrix.
[0106] In S403.2, the pitch angle matrix of the robotic arm around the second coordinate axis of the motion sensor is determined; the pitch angle matrix is:
[0107]
[0108] The β is the pitch angle matrix; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor.
[0109] In this embodiment, the second coordinate axis can be the y-axis on the first coordinate system. The robotic arm can determine the offset of the pitch angle β on each coordinate system, thereby constructing the pitch angle matrix.
[0110] In S403.3, the deflection angle matrix of the robotic arm around the third coordinate axis of the motion sensor is determined; the deflection angle matrix is:
[0111]
[0112] The γ is the deflection angle matrix; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor.
[0113] In this embodiment, the third coordinate axis can be the z-axis on the first coordinate system. The robotic arm can determine the offset of the deflection angle γ on each coordinate system, thereby constructing the aforementioned deflection angle matrix.
[0114] In S403.4, the rotation matrix is determined based on the roll angle matrix, the pitch angle matrix, and the yaw angle matrix; the rotation matrix is:
[0115]
[0116] R1 is the rotation matrix.
[0117] In this embodiment, the robotic arm can establish the above three matrices corresponding to different angles, thereby obtaining the offset of the motion sensor at each coordinate axis corresponding to each coordinate axis in each coordinate system, i.e., obtaining the above R1 matrix. Then, the first posture data collected by the motion sensor can be used to obtain the offset in each coordinate system, and then the offset can be converted to calculate the offset data between the center of mass of the base and the horizontal plane.
[0118] In this embodiment, by determining the matrix corresponding to the angle of rotation of the motion sensor around each coordinate system, the rotation matrix corresponding to the motion sensor can be obtained. Subsequently, the first attitude data can be converted into offsets on each coordinate axis, which improves the accuracy of offset calculation.
[0119] In S404, the coordinate transformation matrix is obtained based on the mapping matrix and the rotation matrix.
[0120] In this embodiment, the robotic arm can obtain the coordinate transformation matrix used to convert the first attitude data into the first offset data corresponding to the centroid of the base, based on the mapping matrix corresponding to the two coordinate axes and the rotation matrix used when converting the first attitude data into an offset.
[0121] Furthermore, as another embodiment of this application, the determination of the coordinate transformation matrix may specifically include the following steps:
[0122] In S404.1, a stiffness mapping matrix is obtained based on the distance vector between the motion sensor and the base and the mapping matrix; the stiffness mapping matrix is:
[0123]
[0124] Wherein, R2 is the stiffness mapping matrix; (x0, y0, z0) is the distance vector; x0 is the value of the distance vector on the first coordinate axis; y0 is the value of the distance vector on the second coordinate axis; and z0 is the value of the distance vector on the third coordinate axis.
[0125] In this embodiment, the center of mass of the motion sensor and the base on which the robotic arm is located are not completely coincident, and the two are rigidly fixed, meaning their relative positional relationship is fixed. Therefore, the robotic arm can record the distance vector between the two, namely (x0, y0, z0). Based on the distance vector and the determined mapping matrix, the robotic arm can obtain the stiffness mapping matrix between the motion sensor of the robotic arm and the center of mass of the base, namely R2.
[0126] In S404.2, the coordinate transformation matrix is obtained based on the stiffness mapping matrix and the rotation matrix; the coordinate transformation matrix is:
[0127]
[0128]
[0129] Where T2 is the coordinate transformation matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; c is the cosine function; and s is the sinine function.
[0130] In this embodiment, the electronic device can combine the aforementioned stiffness mapping matrix and rotation matrix to obtain a coordinate transformation matrix for determining the first deviation data. The motion sensor can acquire first attitude data, which may include the aforementioned roll angle, pitch angle, and yaw angle. The robotic arm can substitute the acquired three angles into the aforementioned coordinate transformation matrix to calculate the first deviation data corresponding to the first attitude data.
[0131] For example, if the first posture data (α1, β1, γ1) collected by the motion sensor of the robotic arm at a certain moment is obtained, the first posture data can be substituted into the T2 matrix mentioned above to obtain the first deviation data corresponding to the first posture data.
[0132] In this embodiment, the robotic arm can establish a transformation relationship between the first coordinate system of the motion sensor and the second coordinate system of the corresponding centroid of the base by determining the first coordinate system of the motion sensor and the second coordinate system of the base. This enables the conversion of the first posture data collected by the motion sensor into a coordinate transformation matrix for determining the base, thereby improving the accuracy of subsequent calculations of the first deviation data.
[0133] Figure 6 A flowchart illustrating the specific implementation of a robot control method according to the third embodiment of this application in step S301 is shown. See also... Figure 6 As shown, relative to Figure 3 or Figure 4 The robot control method provided in this embodiment includes S3011 in step S301, and further includes S3012-S3013 after S301, as described in detail below:
[0134] In S3011, when the robotic arm is in a stationary state, the first posture data corresponding to the base where the robotic arm is located is acquired.
[0135] In this embodiment, in order to improve the accuracy of the first posture data acquisition, the robotic arm can use motion sensors to determine whether the base on which the robotic arm is located and whether the robotic arm is in a stationary state. If the robotic arm or the base is in a moving state, it can continue to wait, and when both the robotic arm and the base are in a stationary state, it can acquire the first posture data corresponding to the base on which the robotic arm is located again.
[0136] In this embodiment, the robotic arm can record the second posture data from the previous run, as well as the gravity compensation coefficient corresponding to the second posture data. The robotic arm can determine whether the gravity compensation coefficient needs to be recalculated by comparing the two posture data to see if there is a deviation.
[0137] In some possible implementations, the robotic arm can be set with a corresponding deviation threshold. If the data difference between the first posture data and the second posture data is less than the above-mentioned deviation threshold, the two posture data are identified as matching, and operation S3013 is executed; otherwise, if the data difference between the first posture data and the second posture data is greater than or equal to the above-mentioned deviation threshold, the two posture data are identified as not matching, and operation S3012 is executed.
[0138] In some possible implementations, if the first attitude data and the second attitude data are different, the mismatch between the two attitude data can be identified, and operation S3012 can be executed; conversely, if the first attitude data and the second attitude data are the same, the match between the two attitude data can be identified, and operation S3013 can be executed.
[0139] In S3012, if the second posture data corresponding to the first posture data and the second deviation data do not match, then the first deviation data corresponding to the base is determined based on the first posture data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located; the second deviation data is the deviation data determined during historical use.
[0140] In this embodiment, if the first posture data and the second posture data do not match, it means that the previously determined gravity compensation coefficient is not applicable to the current usage scenario, which may be due to the displacement of the base or the movement of the base location. At this time, the robotic arm can redetermine the gravity compensation coefficient according to the first posture data, and control the robotic arm based on the newly determined gravity compensation coefficient to improve the accuracy of the gravity compensation coefficient.
[0141] In S3013, if the first posture data matches the second posture data corresponding to the second deviation data, the robotic arm is controlled according to the gravity compensation coefficient corresponding to the second deviation data.
[0142] In this embodiment, if the first posture data matches the second posture data, it means that the previously determined gravity compensation coefficient is suitable for the current application scenario. At this time, there is no need to recalculate the gravity compensation coefficient. The gravity compensation coefficient can be determined according to the second deviation data corresponding to the second posture data, and the robotic arm can be controlled based on the gravity compensation coefficient.
[0143] In this embodiment of the application, by comparing whether the first posture data of the current usage scenario matches the second posture data of the historical usage scenario, it is determined whether the historically determined gravity compensation coefficient can be reused, thereby avoiding the situation of repeatedly calculating the gravity compensation coefficient, simplifying operation and saving computing resources.
[0144] Figure 7 A flowchart illustrating the specific implementation of a robot control method according to the fourth embodiment of this application in step S303 is shown. See also Figure 7 As shown, relative to Figure 3 or Figure 4 In the embodiment provided by this application, a robot control method includes steps S701-S702 in step S303, as described in detail below:
[0145] In S701, during the process of controlling the robotic arm based on the gravity compensation coefficient, if the data deviation between the third posture data and the first posture data at any time is greater than a preset deviation threshold, the gravity compensation coefficient is updated based on the third posture data.
[0146] In S702, the robotic arm is controlled based on the updated gravity compensation coefficient.
[0147] In this embodiment, under heavy loads on the robotic arm, the base may shift, affecting the degree of offset between the base and the horizontal plane. Therefore, to achieve real-time calibration of the gravity compensation coefficient, the robotic arm can collect corresponding third-position data during operation and determine whether there is a deviation between the third-position data and the first-position data. If the data deviation is greater than a preset deviation threshold, the gravity compensation coefficient can be updated based on the third-position data. The method for determining the gravity compensation coefficient based on the third-position data can be found in the relevant descriptions in S301-S303, and will not be repeated here.
[0148] In this embodiment of the application, the robotic arm can determine whether the posture of its base has changed significantly during operation. If there is a significant change, the gravity compensation coefficient can be recalculated, and the robotic arm can be controlled based on the updated gravity compensation coefficient, thereby improving the control accuracy of the robot.
[0149] Figure 8 A flowchart illustrating the specific implementation of a robot control method according to the fifth embodiment of this application in step S303 is shown. See also... Figure 8 As shown, relative to Figure 3 or Figure 4 In the embodiment provided by this application, a robot control method includes steps S3031 to S3032 in step S303, which are described in detail below:
[0150] In S3031, the gravitational torque corresponding to each mechanical component is determined based on the position of the center of mass of each mechanical component on the robotic arm.
[0151] In S3032, the gravity compensation coefficient and the gravity torque are imported into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm.
[0152] In this embodiment, the robotic arm may include at least one mechanical component, and the end of the mechanical component may be loaded with a load, such as the end being used to grasp an object. Therefore, when controlling the robotic arm, it is necessary to determine the gravitational torque corresponding to each mechanical component on the robotic arm. The gravitational torque is related to the center of mass position of each mechanical component. The robotic arm can determine the center of mass position of the mechanical component based on the component weight distribution and load conditions, and determine the gravitational torque corresponding to the mechanical component based on the center of mass position.
[0153] In this embodiment, since there may be a certain deviation between the base and the horizontal plane, in order to improve the accuracy of the gravity torque calculation, the robotic arm can adjust the dynamic model corresponding to the above-mentioned robotic arm through the gravity compensation coefficient and the gravity torque. In this way, the control parameters corresponding to the current use scenario can be calculated based on the adjusted dynamic model, and the robotic arm can be controlled based on the control parameters adjusted by the gravity compensation coefficient, thereby improving the accuracy of the robotic arm control.
[0154] In this embodiment, Figure 9 This application shows a structural block diagram of a robot control device according to an embodiment of the present application. The robot control device includes units for performing various operations. Figure 3 The corresponding embodiment describes the steps implemented by the device controlling the robotic arm. Please refer to [link / reference] for details. Figure 3 and Figure 3 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown.
[0155] See Figure 9 A robot control device, comprising:
[0156] The attitude data acquisition unit 91 is used to acquire the first attitude data corresponding to the base where the robot's robotic arm is located;
[0157] The first deviation data determination unit 92 is used to determine the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located.
[0158] The robotic arm control unit 93 is used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data.
[0159] It should be understood that, Figure 9 In the structural block diagram of the device shown, each module is used to perform... Figure 3 , Figure 4 , Figure 6 , Figure 7 as well as Figure 8 Each step in any corresponding embodiment, and for Figure 3 , Figure 4 , Figure 6 , Figure 7 as well as Figure 8 The steps in the corresponding embodiments have been explained in detail in the above embodiments. Please refer to them for details. Figure 3 , Figure 4 , Figure 6 , Figure 7 , Figure 8 The relevant descriptions in the embodiments corresponding to the above figures will not be repeated here.
[0160] Figure 10 This is a structural block diagram of a robot provided in another embodiment of this application. For example... Figure 10 The robot 1000 in this embodiment includes a processor 1010, a memory 1020, and a computer program 1030 stored in the memory 1020 and executable on the processor 1010, such as a program for a robot control method. When the processor 1010 executes the computer program 1030, it implements the steps of the various embodiments of the robot control methods described above, for example... Figure 3 S301 to S303 are described above. Alternatively, the processor 1010 may implement the above when executing the computer program 1030. Figure 9 The functions of each module in the corresponding embodiments, for example, Figure 9 For details regarding the functions of units 91 to 93, please refer to [link / reference needed]. Figure 9 The relevant descriptions in the corresponding embodiments.
[0161] For example, the computer program 1030 can be divided into one or more modules, one or more of which are stored in the memory 1020 and executed by the processor 1010 to complete this application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 1030 in the robot 1000. For example, the computer program 1030 can be divided into various unit modules, each with the specific functions described above.
[0162] The robot 1000 may include, but is not limited to, a processor 1010 and a memory 1020. Those skilled in the art will understand that... Figure 10 This is merely an example of robot 1000 and does not constitute a limitation on robot 1000. It may include more or fewer parts than shown, or combine certain parts, or different parts. For example, the robot may also include input / output devices, network access devices, buses, etc.
[0163] The processor 1010 may be a central processing unit, or it may be other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0164] The memory 1020 can be an internal storage unit of the robot 1000, such as the robot 1000's hard drive or memory. The memory 1020 can also be an external storage device of the robot 1000, such as a plug-in hard drive, smart memory card, flash memory card, etc. equipped on the robot 1000. Furthermore, the memory 1020 can include both internal storage units and external storage devices of the robot 1000.
[0165] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for controlling a robot, characterized in that, include: Obtain the first posture data corresponding to the base where the robot's robotic arm is located; Based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the first deviation data corresponding to the base is determined; the first deviation data is specifically used to determine the degree of offset between the base and the horizontal plane; the coordinate transformation matrix is determined based on the distance vector between the center of mass of the base and the motion sensor; Based on the gravity compensation coefficient corresponding to the first deviation data, the robotic arm is controlled, including: Based on the position of the center of mass of each mechanical component on the robotic arm, determine the corresponding gravitational torque of each mechanical component; The gravity compensation coefficient and the gravitational torque are imported into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm.
2. The control method according to claim 1, characterized in that, Before determining the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located, the method further includes: Obtain the first coordinate system corresponding to the motion sensor of the base where the robotic arm is located and the second coordinate system corresponding to the base; Based on the first coordinate system and the second coordinate system, obtain the mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system; Obtain the rotation matrix corresponding to the rotation of the robotic arm around the base; The coordinate transformation matrix is obtained based on the mapping matrix and the rotation matrix.
3. The control method according to claim 2, characterized in that, The step of obtaining the rotation matrix corresponding to the rotation of the robotic arm around the base includes: Determine the roll angle matrix of the robotic arm around the first coordinate axis of the motion sensor; the roll angle matrix is: The α is the roll angle matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; Determine the pitch angle matrix of the robotic arm around the second coordinate axis of the motion sensor; the pitch angle matrix is: The β is the pitch angle matrix; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor; Determine the deflection angle matrix of the robotic arm around the third coordinate axis of the motion sensor; the deflection angle matrix is: The γ is the deflection angle matrix; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; The rotation matrix is determined based on the roll angle matrix, the pitch angle matrix, and the yaw angle matrix; the rotation matrix is: R1 is the rotation matrix.
4. The control method according to claim 2, characterized in that, The process of obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix includes: Based on the distance vector between the motion sensor and the base and the mapping matrix, the stiffness mapping matrix is obtained; the stiffness mapping matrix is: Wherein, R2 is the stiffness mapping matrix; (x0, y0, z0) is the distance vector; x0 is the value of the distance vector on the first coordinate axis; y0 is the value of the distance vector on the second coordinate axis; and z0 is the value of the distance vector on the third coordinate axis. Based on the stiffness mapping matrix and the rotation matrix, the coordinate transformation matrix is obtained; the coordinate transformation matrix is: Where T2 is the coordinate transformation matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; c is the cosine function; and s is the sinine function.
5. The control method according to any one of claims 1-4, characterized in that, The acquisition of the first posture data corresponding to the base where the robot's robotic arm is located includes: When the robotic arm is stationary, acquire the first posture data corresponding to the base where the robotic arm is located; After acquiring the first posture data corresponding to the base where the robot's robotic arm is located, the process also includes... If the first posture data does not match the second posture data corresponding to the second deviation data, then the first deviation data corresponding to the base is determined based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located; the second deviation data is the deviation data determined during historical use; the second posture data is the posture data recorded during the last run. If the first posture data matches the second posture data corresponding to the second deviation data, then the robotic arm is controlled according to the gravity compensation coefficient corresponding to the second deviation data.
6. The control method according to any one of claims 1-4, characterized in that, The step of controlling the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data includes: During the process of controlling the robotic arm based on the gravity compensation coefficient, if the data deviation between the third posture data and the first posture data at any time is greater than a preset deviation threshold, the gravity compensation coefficient is updated based on the third posture data; the third posture data is the posture data collected during the operation of the robotic arm. The robotic arm is controlled based on the updated gravity compensation coefficient.
7. A control device for a robot, characterized in that, include: The attitude data acquisition unit is used to acquire the first attitude data corresponding to the base where the robot's robotic arm is located; The first deviation data determination unit is used to determine the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robotic arm and the base on which the robotic arm is located; the first deviation data is specifically used to determine the degree of offset between the base and the horizontal plane; the coordinate transformation matrix is determined based on the distance vector between the center of mass of the base and the motion sensor; A robotic arm control unit is used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data, including: determining the gravitational torque corresponding to each mechanical component according to the center of mass position of each mechanical component on the robotic arm; The gravity compensation coefficient and the gravitational torque are imported into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm.
8. A robot, characterized in that, The robot includes a robotic arm, and further includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the steps of the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Robot arm
JP2013094947A