Control method and apparatus for robot, robot and storage medium
By acquiring posture data and applying a gravity compensation coefficient based on deviation data, the method and device improve robotic arm control accuracy in varied installation scenarios.
Patent Information
- Authority / Receiving Office
- HK · HK
- Patent Type
- Applications
- Current Assignee / Owner
- YUANHUA ORTHOPAEDIC ROBOTICS (SHENZHEN) LTD
- Filing Date
- 2026-05-12
- Publication Date
- 2026-07-17
AI Technical Summary
Existing robotic arm control technologies face reduced accuracy due to varied actual application scenarios, such as non-horizontal base installation or uneven sites, leading to mismatches in control parameters.
A method and device that acquire first posture data, determine deviation data using a coordinate transformation matrix, and apply a gravity compensation coefficient to offset installation deviations, improving control precision and accuracy.
Accurately controls robotic arms by determining and adjusting for actual installation conditions, enhancing control precision and accuracy by compensating for placement deviations.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
(19) State Intellectual Property Office (12) Invention Patent Application (10) Application Publication Number (43) Application Publication Date (21) Application Number 202610195448.6 (22) Application Date 2026.02.11 (71) Applicant: Gushengyuan Robotics (Shenzhen) Co., Ltd. Address: Room 2101, Building D1, Nanshan Zhiyuan, Changyuan Community, Taoyuan Street, Nanshan District, Shenzhen, Guangdong Province, 518000 (72) Inventors: Li Lu, Liu Tingting (74) Patent Agency: Shenzhen Zhongyi United Intellectual Property Agency Co., Ltd. 44414 Patent Attorney: Shen Zhijian (51) Int.Cl. B25J 9 / 16 (2006.01) B25J 13 / 08 (2006.01) (54) Invention Title: A Control Method, Device, Robot, and Storage Medium for a Robot (57) Abstract: This application relates to the field of equipment control technology and provides a control method, device, robotic arm, and storage medium for a robot, including: acquiring first posture data corresponding to the base where the robotic arm of the robot is located; determining 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; and controlling the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data. Using the above method, the gravity compensation coefficient can be determined based on the first posture data, and then the robotic arm can be controlled through the gravity compensation coefficient to offset the impact of uneven placement on the robot's control accuracy, achieving automatic compensation for placement deviation and improving the control precision and accuracy of the robot. Claims 3 pages, Description 13 pages, Drawings 7 pages, CN 121670691 A 2026.03.17 CN 1 21 67 06 91 A 1. A robot control method, characterized in that it includes: acquiring first posture data corresponding to a base where a robot arm is located; determining first deviation data corresponding to the base based on the first posture data and a coordinate transformation matrix between the robot arm and the base where the robot arm is located; controlling the robot arm based on a gravity compensation coefficient corresponding to the first deviation data. 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 robot arm and the base where the robot arm is located, it further includes: acquiring a first coordinate system corresponding to a motion sensor of the robot arm and a second coordinate system corresponding to the base; obtaining a mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system based on the first coordinate system and the second coordinate system; acquiring a rotation matrix corresponding to the rotation of the robot arm around the base; obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix.3. The control method according to claim 2, characterized in that, obtaining the rotation matrix corresponding to the rotation of the robotic arm around the base includes: determining the roll angle matrix of the robotic arm around a first coordinate axis of the motion sensor; the roll angle matrix is: [the matrix is missing here]; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; determining the pitch angle matrix of the robotic arm around a second coordinate axis of the motion sensor; the pitch angle matrix is: [the matrix is missing here]; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor; determining the deflection angle matrix of the robotic arm around a third coordinate axis of the motion sensor; the deflection angle matrix is: [the matrix is missing here]; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; determining the rotation matrix based on the roll angle matrix, the pitch angle matrix, and the deflection angle matrix; the rotation matrix is: [the matrix is missing here]; R1 is the rotation matrix. 4. The control method according to claim 2, characterized in that, obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix includes: obtaining a stiffness mapping matrix according to the distance vector between the motion sensor and the base and the mapping matrix; the stiffness mapping matrix is: where 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; z0 is the value of the distance vector on the third coordinate axis; obtaining the coordinate transformation matrix according to the stiffness mapping matrix and the rotation matrix; 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 a cosine function; s is a sinine function. 5. The control method according to any one of claims 1-4, characterized in that, acquiring the first posture data corresponding to the base where the robot's robotic arm is located includes: acquiring the first posture data corresponding to the base where the robot's robotic arm is located when the robotic arm is in a stationary state; after acquiring the first posture data corresponding to the base where the robot's robotic arm is located, further comprising, if the first posture data does not match the second posture data corresponding to the second deviation data, then performing the step of determining 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.The first deviation data is the data corresponding to the first posture; the second deviation data is the deviation data determined during historical use; 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, 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, then the gravity compensation coefficient is updated based on the third posture data; and the robotic arm is controlled based on the updated gravity compensation coefficient. 7. The control method according to any one of claims 1-4, characterized in that, controlling the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data includes: determining the gravity torque corresponding to each mechanical component according to the centroid position of each mechanical component on the robotic arm; importing the gravity compensation coefficient and the gravity torque into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm. 8. A control device for a robot, characterized in that, it includes: an attitude data acquisition unit, used to acquire first attitude data corresponding to the base where the robotic arm of the robot is located; a first deviation data determination unit, used to determine the first deviation data corresponding to the base according to the first attitude data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located; and a robotic arm control unit, used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data. 9. A robot, characterized in that, the robot includes a robotic arm, the robot 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 according to the steps of the method according to any one of claims 1 to 7. 10. 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 7. Claims 3 / 3 Page 4 CN 121670691 A A robot control method, device, robot, and storage medium Technical Field
[0001] This application belongs to the field of equipment control technology, and particularly relates to a robot control method, device, robot, and storage medium. Background Art
[0002] In applications such as medical surgery, industrial manufacturing, and precision assembly, it is necessary to frequently control the robotic arm carrying...The load completes high-precision operations, such as grasping parts and transporting materials by a robotic arm. 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 arm is required to be even higher.
[0003] In existing robotic arm control technology, the relevant parameters in the control process are determined based on the installation level of the robotic arm's base. However, the actual application scenarios of robotic arms are varied, and there may be situations such as the base not being installed horizontally or the site not being level, which leads to a mismatch between the relevant parameters and the actual installation scenario, reducing the control accuracy of the robot. Summary of the Invention
[0004] The embodiments of this application provide a robot control method, device, robot, and storage medium, which can solve the problem of low control accuracy of robotic arms due to the varied actual application scenarios of robotic arms and the situations such as the base not being installed horizontally or the site not being level.
[0005] In a first aspect, embodiments of this application provide a robot control method, the method comprising:
[0006] acquiring first posture data corresponding to a base on which a robot arm is located; determining first deviation data corresponding to the base based on the first posture data and a coordinate transformation matrix between the robot arm and the base on which the robot arm is located; and controlling the robot arm based on a gravity compensation coefficient corresponding to the first deviation data.
[0007] In a 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 robot arm and the base on which the robot arm is located, the method further comprises: acquiring a first coordinate system corresponding to a motion sensor of the robot arm and a second coordinate system corresponding to the base; obtaining a mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system based on the first coordinate system and the second coordinate system; acquiring a rotation matrix corresponding to the rotation of the robot arm around the base; and obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix.
[0008] In one possible implementation of the first aspect, obtaining the rotation matrix corresponding to the rotation of the robotic arm around the base includes: determining the roll angle matrix of the robotic arm around a first coordinate axis of the motion sensor; the roll angle matrix is: Specification 1 / 13 page 5 CN 121670691 A
[0009] where α is the roll angle matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor; determining the pitch angle matrix of the robotic arm around a second coordinate axis of the motion sensor; the pitch angle matrix is:
[0010] where β 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:
[0011] where is the deflection angle matrix; γ is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; determine the rotation matrix based on the roll angle matrix, the pitch angle matrix and the deflection angle matrix; the rotation matrix is:
[0012] where R1 is the rotation matrix.
[0013] In one possible implementation of the first aspect, obtaining the coordinate transformation matrix based on the mapping matrix and the rotation matrix includes: obtaining a stiffness mapping matrix based on the distance vector between the motion sensor and the base and the mapping matrix; the stiffness mapping matrix is:
[0014] where 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; z0 is the value of the distance vector on the third coordinate axis; obtaining the coordinate transformation matrix based on the stiffness mapping matrix and the rotation matrix; the coordinate transformation matrix is: Specification 2 / 13 Page 6 CN 121670691 A
[0015]
[0016] 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; γ Let c be the rotation angle of the robotic arm around the third coordinate axis of the motion sensor; c is the cosine function; s is the sinine function.
[0017] In one possible implementation of the first aspect, the step of acquiring the first posture data corresponding to the base where the robotic arm is located includes: acquiring the first posture data corresponding to the base where the robotic arm is located when the robotic arm is in a stationary state; after acquiring the first posture data corresponding to the base where the robotic arm is located, the step further includes: if the first posture data does not match the second posture data corresponding to the second deviation data, then performing the step of 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 where the robotic arm is located; the second deviation data is the deviation data determined during historical use; if the first posture data matches the second posture data corresponding to the second deviation data, then controlling the robotic arm according to the gravity compensation coefficient corresponding to the second deviation data.
[0018] In one possible implementation of the first aspect, 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 third posture data at any time...If the data deviation between the first posture data and the first posture data is greater than a preset deviation threshold, then the gravity compensation coefficient is updated based on the third posture data; the robotic arm is controlled based on the updated gravity compensation coefficient.
[0019] 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: determining the gravitational torque corresponding to each mechanical component based on the centroid position of each mechanical component on the robotic arm; importing the gravity compensation coefficient and the gravitational torque into the dynamic model corresponding to the robotic arm to determine the control parameters corresponding to the robotic arm.
[0020] In a second aspect, embodiments of this application provide a robot control device, the device including: a posture data acquisition unit, used to acquire first posture data corresponding to the base where the robotic arm of the robot is located; a first deviation data determination unit, 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; and a robotic arm control unit, used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data.
[0021] In a third aspect, 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. When the processor executes the computer program, it implements the method described in any of the first aspects above.
[0022] In a fourth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in any of the first aspects above.
[0023] In a fifth aspect, embodiments of this application provide a computer program product that, when run on a robotic arm, causes a drone to execute the method described in any of the first aspects above.
[0024] The beneficial effects of embodiments of this application compared to the prior art are: by acquiring first posture data corresponding to the robotic arm and importing the first posture data into a preset coordinate transformation matrix, determining the first deviation data corresponding to the first posture data, and then controlling the robotic arm according to the gravity compensation coefficient corresponding to the first deviation data, the purpose of accurately controlling the robotic arm according to the actual installation of the robotic arm's base is achieved. Compared to existing robot control technologies, the embodiments of this application 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, and then the gravity compensation coefficient can be adjusted accordingly.The force compensation coefficient controls the robotic arm, offsetting the impact of uneven placement on the robot's control accuracy, achieving automatic compensation for placement deviations, and improving the robot's control precision and accuracy.
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or 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.
[0026] Figure 1 is a structural schematic diagram of a robotic arm provided in one embodiment of this application; Figure 2 is a structural schematic diagram of a robotic arm provided in another embodiment of this application; Figure 3 is a schematic diagram of the implementation of a robot control method provided in an embodiment of this application; Figure 4 is a flowchart of the specific implementation of a robot control method provided in a second embodiment of this application before S302; Figure 5 is a schematic diagram comparing the first coordinate system and the second coordinate system provided in an embodiment of this application; Figure 6 is a flowchart of the specific implementation of a robot control method provided in a third embodiment of this application in S301; Figure 7 is a flowchart of the specific implementation of a robot control method provided in a fourth embodiment of this application in S303; Figure 8 is a flowchart of the specific implementation of a robot control method provided in a fifth embodiment of this application in S303; Figure 9 is a structural schematic diagram of a robot control device provided in an embodiment of this application; Figure 10 is a structural schematic diagram of a robot provided in an embodiment of this application. Detailed Description
[0027] In the following description, specific details such as particular system structures and techniques are set forth for illustration rather than limitation in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art should understand that this application can also be implemented in other embodiments without these specific details (pages 4 / 13 of CN 121670691 A). In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary details.
[0028] It should be understood that, when used in this application specification and 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 collections thereof.
[0029] In addition, in the description of this application specification and 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.
[0030] The robot control method provided in the embodiments of this application can be applied to the field of controlling a robotic arm.In the case of a robotic arm equipped with a processor, the execution subject of the above-mentioned robot control method can be a robotic arm. For example, Figure 1 shows a schematic diagram of the structure of a robotic arm provided in an embodiment of this application. Referring to Figure 1, the 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, a Bluetooth communication link, or a 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 through 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.
[0031] In some implementations, the motion sensor 13 can be an inertial measurement unit (IMU) or other motion sensors, which can be selected according to the actual situation.
[0032] In some possible implementations, the robotic arm can establish a communication link with an independent electronic device, and the robotic arm can be controlled by the electronic device to operate. For example, FIG2 shows a schematic diagram of the structure of a robotic arm provided in another embodiment of this application. Referring to FIG2, the robotic arm 21 can be connected to an electronic device 22. The robotic arm 21 can include a base 11 and a movable mechanical component 12. The base 11 can be equipped with a motion sensor 13, which can be connected to the electronic device 22 and send the attitude data of the robotic arm 21 to the electronic device 22. The electronic device 22 can determine the gravity compensation coefficient according to 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.
[0033] Please refer to Figure 3, which shows a schematic diagram of the implementation of a robot control method provided in this application embodiment. 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, such as the electronic device 22 shown in Figure 2. For example, the electronic device 22 is specifically a computer, laptop, server, or smartphone. For ease of description, the following description uses a robotic arm as an example. Specifically, the method includes the following steps: In S301, the first posture data corresponding to the base where the robot's robotic arm is located is obtained.
[0034] 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 around the x-axis, the pitch angle around the y-axis, and the yaw angle around the z-axis.
[0035] In some implementations, the robotic arm can be a 6-axis serial robotic arm. A torque sensor is installed at the end of the robotic arm. 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. Then, the control parameters of the robot manual page 5 / 13 9 CN 121670691 A can be determined based on the gravitational torque collected by the torque sensor.
[0036] In some implementations, the 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.
[0037] 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, a distance vector can be obtained between them. This distance vector can be used to determine the coordinate transformation relationship between the motion sensor and the centroid of the base. Based on this coordinate transformation relationship, the original posture data collected by the motion sensor can be calibrated to obtain the first posture data.
[0038] In this embodiment, before operation, the robotic arm can perform the operations S301~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.
[0039] In some implementations, the robotic arm can be set with corresponding compensation coefficient triggering conditions. If the triggering conditions are met, it indicates that the gravity compensation coefficient corresponding to the robotic arm needs to be determined. At this time, the robotic arm can perform the operations S301~S303.
[0040] 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.
[0041] 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.
[0042] 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 acquisition of posture information corresponding to the center of mass of the base, thereby determining the offset from the horizontal plane based on the center of mass information, which is the first deviation data.
[0043] In S303, the robotic arm is controlled based on the gravity compensation coefficient corresponding to the first deviation data.
[0044] In this embodiment, after determining the first deviation data between the base and the horizontal plane, the robotic arm can import the first deviation data into a preset deviation transformation function to calculate the degree of influence of the first deviation data on the torque of the robotic arm, thus obtaining the gravity compensation coefficient. 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 above deviation on the torque will be further increased. Therefore, the electronic device can calculate the gravity compensation coefficient based on the above first deviation data, and adjust the torque calculation function corresponding to each mechanical component based on the above gravity compensation coefficient. Based on the adjusted torque calculation function, the robotic arm can be controlled, thereby improving the accuracy of robotic arm control.
[0045] 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 above weight value and the above gravity compensation coefficient, thereby improving the accuracy of torque calculation and subsequently improving the accuracy of robot control.
[0046] In some possible implementations, when the robotic arm has an extendable function, the robotic arm can also determine the torque calculation function corresponding to each component on the robotic arm based on the weight value, the current extension length, and the gravity compensation coefficient, as described on page 6 / 13 of the specification (CN 121670691 A), to improve the accuracy of the torque calculation function and thus improve the subsequent control accuracy of the robot.
[0047] As can be seen above, the robot control method provided by the embodiments of this application obtains 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, thereby achieving the purpose of accurately controlling the robotic arm according to the actual installation of the base of the robotic arm. Compared with the existing robot control technology, the embodiments of this application can determine the first posture data corresponding to the base of the robotic arm before controlling the robotic arm.The first posture data does not default to the base being 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 according to the first posture data. Then, the robot arm can be controlled through the gravity compensation coefficient to offset the impact of non-horizontal placement on the robot's control accuracy. This achieves automatic compensation for placement deviation and improves the robot's control precision and accuracy.
[0048] Figure 4 shows a flowchart of the specific implementation of a robot control method provided in the second embodiment of this application before S302. Referring to Figure 4, compared with the embodiment described in Figure 3, the robot control method provided in this embodiment of this application further includes S401~S404 before S302, which are specifically described as follows: Specifically, before determining the first deviation data corresponding to the base based on the first posture data and the coordinate transformation matrix between the robot arm and the base where the robot arm is located, it further includes: In S401, the first coordinate system corresponding to the motion sensor of the robot arm and the second coordinate system corresponding to the base are obtained.
[0049] 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 so that coordinate transformation between the two positions can be realized subsequently. Among them, 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.
[0050] In some possible implementation examples, each coordinate axis on 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-hand coordinate system.
[0051] For example, FIG5 shows a comparative schematic diagram between the first coordinate system and the second coordinate system provided in an embodiment of this application. Referring to Figure 5, 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 plane where Figure 5 is located and points inward; the second coordinate system of the fir 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 to the plane where Figure 5 is located and points outward. Comparing the two coordinate systems, 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 has the same direction as the x+ direction of the second coordinate system, the y- direction of the first coordinate system is parallel to and has 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 has the same direction as the z+ direction of the second coordinate system.
[0052] In S402, based on the first coordinate system and the second coordinate system, a mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system is obtained.
[0053] 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.
[0054] For example, if the directions of the two coordinate systems are as shown in Figure 5, the mapping matrix R2' can be expressed as: Specification 7 / 13 Page 11 CN 121670691 A
[0055] Since the positive directions of the x-axis of the two coordinate systems are the same, the corresponding coefficient is 1. The directions of the y-axis and z-axis are opposite, so the corresponding coefficient is -1. Specifically, the mapping matrix R2' can be determined according to the positional relationship between the directions of each coordinate axis on the two coordinate systems, which is not limited here.
[0056] In S403, the rotation matrix corresponding to the rotation of the robotic arm around the base is obtained.
[0057] 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. Consequently, a coordinate transformation matrix can be established to convert the offset values (i.e., the first attitude data) in the first coordinate system into the first deviation data corresponding to the second coordinate system.
[0058] In this embodiment, the robotic arm can determine the offset amount of the deflection angle (i.e., roll angle) around the x-axis mapped to each coordinate axis, as well as the offset amount of the pitch angle around the y-axis mapped to each coordinate axis, and the offset amount of the deflection angle around the z-axis mapped to each coordinate axis. Based on these three different offsets, the aforementioned rotation matrix can be constructed.
[0059] Further, as another embodiment of this application, the above-mentioned determination of the rotation matrix may specifically include the following steps: 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:
[0060] α is the roll angle matrix; α is the rotation angle of the robotic arm around the first coordinate axis of the motion sensor.
[0061] In this embodiment, the first coordinate axis can be the x-axis on the first coordinate system, and the robotic arm can determine the offset of the roll angle α in each coordinate system, thereby constructing the above-mentioned roll angle matrix.
[0062] 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:
[0063] β is the pitch angle matrix; β is the rotation angle of the robotic arm around the second coordinate axis of the motion sensor.
[0064] In this embodiment, the second coordinate axis can be the y-axis in the first coordinate system. The robotic arm can determine the offset of the pitch angle β in each coordinate system, thereby constructing the pitch angle matrix described above.
[0065] 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: Specification 8 / 13 Page 12 CN 121670691 A
[0066] The deflection angle matrix is γ, which is the rotation angle of the robotic arm around the third coordinate axis of the motion sensor.
[0067] 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 γ in each coordinate system, thereby constructing the above-mentioned deflection angle matrix.
[0068] In S403.4, the rotation matrix is determined according to the roll angle matrix, the pitch angle matrix, and the deflection angle matrix; the rotation matrix is:
[0069] R1 is the rotation matrix.
[0070] In this embodiment, the robotic arm can establish the matrices corresponding to the three different angles, thereby obtaining the offset of the motion sensor at each coordinate axis corresponding to the first coordinate system in each coordinate system, i.e., obtaining the R1 matrix. Then, the first posture data collected by the motion sensor can be used to obtain the offset in each coordinate system, and this offset can be converted to calculate the offset data between the center of mass of the base and the horizontal plane.
[0071] 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 posture data can be converted into offsets on each coordinate axis, improving the accuracy of the offset calculation.
[0072] In S404, the coordinate transformation matrix is obtained based on the mapping matrix and the rotation matrix.
[0073] In this embodiment, the robotic arm can obtain the coordinate transformation matrix used to convert the first posture data into the first offset data corresponding to the center of mass of the base, based on the mapping matrix corresponding to the two coordinate axes and the rotation matrix used when converting the first posture data into offsets.
[0074] Further, as another embodiment of this application, the determination of the coordinate transformation matrix may specifically include the following steps: 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:
[0075] 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; z0 is the value of the distance vector on the third coordinate axis.
[0076] In this embodiment, the center of mass of the motion sensor and the base where the robotic arm is located are not completely coincident, and the two are rigidly fixed, that is, the relative positional relationship between the two is fixed. Therefore, the robotic arm can recordThere is a distance vector between the two, namely (x0, y0, z0). 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 based on the above distance vector and the determined mapping matrix, namely the above specification page 9 / 13 13 CN 121670691 A R2.
[0077] In S404.2, the coordinate transformation matrix is obtained according to the stiffness mapping matrix and the rotation matrix; the coordinate transformation matrix is:
[0078]
[0079] Wherein, 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 cos function; s is the sin function.
[0080] In this embodiment, the electronic device can combine the above stiffness mapping matrix and rotation matrix to obtain the coordinate transformation matrix used to determine the first deviation data. The motion sensor can acquire first attitude data, which may include the roll angle, pitch angle and yaw angle mentioned above. The robotic arm can substitute the three angles acquired into the coordinate transformation matrix mentioned above to calculate the first deviation data corresponding to the first attitude data.
[0081] For example, if the first attitude data acquired by the motion sensor of the robotic arm at a certain moment is (α1, β1, γ1), then the first attitude data can be substituted into the T2 matrix mentioned above to obtain the first deviation data corresponding to the first attitude data.
[0082] In the embodiments of this application, 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 corresponding centroid of the base. Then, it can realize the conversion of the first attitude data acquired by the motion sensor into the coordinate transformation matrix used to determine the base, thereby improving the calculation accuracy of the subsequent calculation of the first deviation data.
[0083] Figure 6 shows a flowchart of the specific implementation of a robot control method provided in the third embodiment of this application in S301. Referring to Figure 6, compared to the embodiments described in Figure 3 or Figure 4, the robot control method provided in this application includes S3011 in S301, and after S301, it also includes S3012 to S3013, which are specifically described as follows: 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.
[0084] In this embodiment, in order to improve the accuracy of the acquisition of the first posture data, the robotic arm can determine the base where the robotic arm is located and whether the robotic arm is in a stationary state through a motion sensor. If the robotic arm or the base is in a moving state...If the robot arm remains stationary, it can continue to wait and, with both the robot arm and the base in a stationary state, acquire the first posture data corresponding to the base where the robot arm is located again.
[0085] In this embodiment, the robot arm can record the second posture data recorded during the last run, as well as the gravity compensation coefficient corresponding to the second posture data. The robot arm can determine whether the gravity compensation coefficient needs to be recalculated by comparing whether there is a deviation between the two posture data.
[0086] In some possible implementations, the robot 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 the operation of S3013 is executed; conversely, 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 the operation of S3012 is executed.
[0087] In some possible implementations, if the first posture data and the second posture data are not the same, it can be identified that the two posture data do not match, and operation S3012 is executed; conversely, if the first posture data and the second posture data are the same, it can be identified that the two posture data match, and operation S3013 is executed.
[0088] In S3012, if the first posture data and the second posture data corresponding to the second deviation data do not match, 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.
[0089] In this embodiment, if the first posture data and the second posture data do not match, it indicates that the previously determined gravity compensation coefficient is not applicable to the current usage scenario, possibly due to base displacement or movement of the base location. In this case, the robotic arm can redetermine the gravity compensation coefficient based on 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.
[0090] 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.
[0091] In this embodiment, if the first posture data and the second posture data match, it indicates that the previously determined gravity compensation coefficient is suitable for the current usage scenario. In this case, there is no need to recalculate the gravity compensation coefficient. The corresponding gravity compensation coefficient can be determined based on the second deviation data corresponding to the second posture data, and the robotic arm is controlled based on the gravity compensation coefficient.
[0092] In this embodiment, by comparing the first posture data of the current usage scenario with the first posture data of the historical usage scenario,Whether the two posture data match is used to determine whether the historically determined gravity compensation coefficient can be reused, thereby avoiding the repeated calculation of the gravity compensation coefficient, simplifying operation and saving computing resources.
[0093] Figure 7 shows a flowchart of the specific implementation of a robot control method provided in the fourth embodiment of this application in S303. Referring to Figure 7, compared with the embodiment described in Figure 3 or Figure 4, the robot control method provided in this embodiment of this application includes S701~S702 in S303, which are specifically described as follows: 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.
[0094] In S702, the robotic arm is controlled based on the updated gravity compensation coefficient.
[0095] In this embodiment, when the load on the robotic arm is heavy, the base may shift, thereby affecting the degree of offset between the base and the horizontal plane. Based on this, in order to achieve real-time calibration of the gravity compensation coefficient, the robotic arm can collect the corresponding third posture data during operation and determine whether there is a deviation between the third posture data and the first posture data. If the data deviation between the two is greater than a preset deviation threshold, the gravity compensation coefficient can be updated based on the third posture data. The method of determining the gravity compensation coefficient based on the third posture data can be found in the relevant descriptions of S301 to S303, which will not be repeated here.
[0096] 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.
[0097] Figure 8 shows a flowchart of the specific implementation of a robot control method provided in the fifth embodiment of the application in S303. Referring to Figure 8, compared with the embodiment described in Figure 3 or Figure 4, the robot control method provided in this application includes S3031 to S3032 in S303, which are specifically described as follows: In S3031, the gravitational torque corresponding to each mechanical component is determined according to the position of the center of mass of each mechanical component on the robotic arm. Specification 11 / 13 pages 15 CN 121670691 A
[0098] In S3032, 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.
[0099] 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, for example, the end can be used to grasp an object. Therefore, when controlling the robotic arm, it is necessary to determine the gravitational torque of each mechanical component on the robotic arm.The gravitational torque corresponding to the mechanical component 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 weight distribution and load of the component, and determine the gravitational torque corresponding to the mechanical component based on the center of mass position.
[0100] 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 gravitational torque calculation, the robotic arm can adjust the dynamic model corresponding to the above-mentioned robotic arm through the gravity compensation coefficient and the gravitational torque. Thus, the control parameters corresponding to the current use scenario can be calculated based on the adjusted dynamic model, so as to control the operation of the robotic arm based on the control parameters adjusted by the gravity compensation coefficient, thereby improving the accuracy of the robotic arm control.
[0101] In this embodiment, FIG9 shows a structural block diagram of a robot control device provided in an embodiment of this application. The robot control device includes units for executing the steps of the device implementation for controlling the robotic arm in the embodiment corresponding to FIG3. Please refer to FIG3 and the relevant description in the embodiment corresponding to FIG3 for details. For ease of explanation, only the parts related to this embodiment are shown.
[0102] Referring to FIG. 9, a robot control device includes: an attitude data acquisition unit 91, used to acquire first attitude data corresponding to the base where the robot's robotic arm is located; a first deviation data determination unit 92, used to determine the first deviation data corresponding to the base based on the first attitude data and the coordinate transformation matrix between the robotic arm and the base where the robotic arm is located; and a robotic arm control unit 93, used to control the robotic arm based on the gravity compensation coefficient corresponding to the first deviation data.
[0103] It should be understood that in the structural block diagram of the device shown in FIG. 9, each module is used to execute the steps in any of the corresponding embodiments of FIG. 3, FIG. 4, FIG. 6, FIG. 7 and FIG. 8. The steps in the embodiments corresponding to FIG. 3, FIG. 4, FIG. 6, FIG. 7 and FIG. 8 have been explained in detail in the above embodiments. For details, please refer to the relevant descriptions in FIG. 3, FIG. 4, FIG. 6, FIG. 7, FIG. 8 and the embodiments corresponding to the above figures. They will not be repeated here.
[0104] FIG. 10 is a structural block diagram of a robot provided in another embodiment of this application. As shown in Figure 10, the robot 1000 of 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 in the various embodiments of the robot control methods described above, such as S301 to S303 as shown in Figure 3. Alternatively, when the processor 1010 executes the computer program 1030, it implements the functions of each module in the embodiment corresponding to Figure 9, such as the functions of units 91 to 93 as shown in Figure 9. Please refer to the relevant description in the embodiment corresponding to Figure 9 for details.
[0105] For example, the computer program 1030 can be divided into one or more modules. One or more modules are stored in the memory 1020 and executed by the processor 1010 to complete this application. 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, and the specific functions of each module are as described above.
[0106] The robot 1000 may include, but is not limited to, the processor 1010 and the memory 1020. Those skilled in the art will understand that FIG10 is merely an example of the robot 1000 and does not constitute a limitation on the robot 1000. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the robot may also include input / output devices, network access devices, buses, etc. Instruction manual, pages 12 / 13, 16 CN 121670691 A
[0107] The processor 1010 may be a central processing unit, or 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, etc.
[0108] The memory 1020 may be an internal storage unit of the robot 1000, such as the hard disk or memory of the robot 1000. The memory 1020 may also be an external storage device of the robot 1000, such as a plug-in hard disk, smart memory card, flash memory card, etc. equipped on the robot 1000. Furthermore, the memory 1020 may include both internal storage units and external storage devices of the robot 1000.
[0109] 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; and these 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. Specification 13 / 13 pages 17 CN 121670691 A Figure 1 Specification Figure 1 / 7 pages 18 CN 121670691 A Figure 2 Specification Figure 2 / 7 pages 19 CN 121670691 A Figure 3 Figure 4 Specification Figure 3 / 7 pages 20 CN 121670691 A Figure 5 Specification Figure 4 / 7 pages 21 CN 121670691 A Figure 6 Figure 7 Specification Figure 5 / 7 pages22 CN 121670691 A FIGS. 8 and 9, Sheet 6 / 7 of the drawings of the specification 23 CN 121670691 A FIG. 10, Sheet 7 / 7 of the drawings of the specification 24 CN 121670691 A ABSTRACT The present application is applicable to the field of equipment control technologies, and provides a control method and an apparatus for a robot, a mechanical arm and a storage medium. The method comprises: obtaining first posture data corresponding to a base where a mechanical arm of the robot is located; determining first deviation data corresponding to the base according to the first posture data and a coordinate transformation matrix between the mechanical arm and the base where the mechanical arm is located; controlling the mechanical arm based on a gravity compensation coefficient corresponding to the first deviation data. By adopting the aforementioned method, the gravity compensation coefficient can be determined according to the first posture data, and the mechanical arm is controlled by means of the gravity compensation coefficient, an adverse effect on robot controlaccuracy caused by uneven placement is neutralized, automatic compensation for placement deviations is realized, and the precision and accuracy of robot control are improved.
Claims
1. A control method of a robot characterized by, Comprise: Obtain the first attitude data corresponding to the base where the robot's mechanical arm is located; According to the first attitude data and the coordinate conversion matrix between the mechanical arm and the base where the mechanical arm is located, the first deviation data corresponding to the base is determined; Based on the gravity compensation coefficient corresponding to the first deviation data, the mechanical arm is controlled.
2. The control method according to claim 1, characterized by, Before the first attitude data and the coordinate conversion matrix between the mechanical arm and the base where the mechanical arm is located, it still includes: Obtain the first coordinate system corresponding to the motion sensor of the mechanical arm and the second coordinate system corresponding to the base; According to the first coordinate system and the second coordinate system, the mapping matrix corresponding to the mapping from the first coordinate system to the second coordinate system is obtained; Obtain the rotation matrix corresponding to the rotation of the mechanical arm around the base; Based on the mapping matrix and the rotation matrix, the coordinate conversion matrix is obtained.
3. The control method according to claim 2, characterized by, The rotation matrix corresponding to the rotation of the mechanical arm around the base includes: Determine the roll angle matrix of the mechanical arm around the first coordinate axis of the motion sensor; The roll angle matrix is: The is the roll angle matrix; a is the rotation angle of the robot arm around the first coordinate axis of the motion sensor; Determine the pitch angle matrix of the mechanical 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 mechanical arm around the second coordinate axis of the motion sensor; Determine the yaw angle matrix of the mechanical arm around the third coordinate axis of the motion sensor; The yaw angle matrix is: The is the deflection angle matrix; γ is the rotation angle of the mechanical arm around the third coordinate axis of the motion sensor; According to the roll angle matrix, the pitch angle matrix and the yaw angle matrix, the rotation matrix is determined; The rotation matrix is: The R1 is the rotation matrix.
4. The control method according to claim 2, characterized by, Based on the mapping matrix and the rotation matrix, the coordinate conversion matrix is obtained, including: According to the distance vector between the motion sensor and the base and the mapping matrix, the rigidity mapping matrix is obtained; The rigidity mapping matrix is: Wherein, the R2 is the rigidity mapping matrix; The (x0, y0, z0) is the distance vector; The x0 is the value of the distance vector on the first coordinate axis; The y0 is the value of the distance vector on the second coordinate axis; The z0 is the value of the distance vector on the third coordinate axis; According to the rigidity mapping matrix and the rotation matrix, the coordinate conversion matrix is obtained; The coordinate conversion matrix is: Wherein, T2 is the coordinate conversion matrix; Alpha is the rotation angle of the mechanical arm around the first coordinate axis of the motion sensor; Beta is the rotation angle of the mechanical arm around the second coordinate axis of the motion sensor; Gamma is the rotation angle of the mechanical arm around the third coordinate axis of the motion sensor; C is the cosine function; S is the sine function.
5. The control method according to any one of claims 1 to 4, characterized by, The first attitude data corresponding to the base where the robot's mechanical arm is located includes: In the case that the mechanical arm is in a static state, the first attitude data corresponding to the base where the robot's mechanical arm is located is obtained; After the first attitude data corresponding to the base where the robot's mechanical arm is located is obtained, it still includes If the first attitude data does not match second attitude data corresponding to second deviation data, the method comprises determining first deviation data corresponding to the base according to the first attitude data and a coordinate transformation matrix between the robot arm and the base on which the robot arm is located; the second deviation data is deviation data determined in a historical use process; If the first attitude data matches second attitude data corresponding to second deviation data, the method comprises controlling the robot arm according to a gravity compensation coefficient corresponding to the second deviation data.
6. The control method according to any one of claims 1 to 4, characterized by, The method comprises: In the process of controlling the robot arm based on the gravity compensation coefficient, if a data deviation between third attitude data at any time and the first attitude data is greater than a preset deviation threshold, the method comprises updating the gravity compensation coefficient based on the third attitude data; The method comprises controlling the robot arm based on the updated gravity compensation coefficient.
7. The control method according to any one of claims 1 to 4, characterized by, The method comprises: The method comprises determining a gravity moment corresponding to each mechanical component of the robot arm according to a center of mass position of each mechanical component of the robot arm; The method comprises importing the gravity compensation coefficient and the gravity moment into a dynamics model corresponding to the robot arm to determine a control parameter corresponding to the robot arm.
8. A control device of a robot characterized by comprising: The method comprises: An attitude data acquisition unit is configured to acquire first attitude data corresponding to a base on which a robot arm is located; A first deviation data determination unit is configured to determine first deviation data corresponding to the base according to the first attitude data and a coordinate transformation matrix between the robot arm and the base on which the robot arm is located; A robot arm control unit is configured to control the robot arm based on a gravity compensation coefficient corresponding to the first deviation data.
9. A robot, characterized in that The robot comprises a robot arm, a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to perform the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to perform the steps of the method according to any one of claims 1 to 7.