Robot gravity compensation method and device, motor driver and storage medium

By automatically estimating and determining the gravity compensation current value, the problems of the end drop phenomenon and debugging difficulty of industrial robots are solved, and the robot is smoothly enabled and high-precision control are achieved.

CN120222879APending Publication Date: 2025-06-27SHENZHEN LEISAI SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311831263.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

At the moment when the end of the robot arm is enabled, the end load and the existence of the robotic arm's own gravity will cause a downward phenomenon, which affects the stability and control accuracy. The existing technology requires users to manually calculate the gravity compensation value, making debugging difficult.

Method used

By obtaining the q-axis current of the motor during the brake delay time, estimating the estimated gravity compensation current value, and combining the torque compensation delay time, the gravity compensation current value required when the motor driver is enabled is automatically determined to achieve automatic gravity compensation.

Benefits of technology

It eliminates the drop phenomenon at the end of the robot when enabled, reduces the difficulty of system parameter adjustment, and realizes the smooth enablement of the robot and high-precision control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120222879A_ABST
    Figure CN120222879A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a gravity compensation method and device of a robot, a motor driver and a storage medium, and can automatically confirm a gravity compensation current value when the robot is enabled so as to reduce the parameter adjustment difficulty of a system. A gravity compensation current estimated value is obtained according to the q-axis current, and the band-type brake delay time is the time from sending a band-type brake signal to actual band-type brake braking of the motor after the motor driver is disconnected and enabled; and according to the gravity compensation current estimated value and the torque compensation delay time, a gravity compensation current value needed when the motor driver is enabled is determined, and the torque compensation delay time is the time from starting enabling of the motor driver to starting operation of the motor. Through the gravity compensation scheme, the current compensation value capable of counteracting the mechanical arm and load gravity of the robot can be automatically obtained when the robot is enabled, so that the robot can be enabled stably, and the nodding phenomenon is eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of robot control, and in particular, to a gravity compensation method and device for a robot, a motor driver, and a storage medium. Background Art

[0002] Servo drivers are widely used in industrial automation equipment. With the rapid development of the industrial automation industry, industrial robots are more and more widely used. However, the structure and operating state of industrial robots are complex, and there will be many problems during use. For example, due to the existence of the end load and the self-gravity of the robotic arm at the moment when the robot is enabled, the end of the robotic arm of the robot will droop (nod). This phenomenon will cause damage to the workpieces processed at the end of the robot. For example, in scenarios such as welding and handling of multi-axis robots, due to the gravity of the robotic arm, welding torch or goods, there is a "nodding" phenomenon of the robotic arm at the moment when the servo driver is enabled, which affects the stability and control accuracy of the multi-axis robot.

[0003] In the related art, by means of performing gravity compensation in the torque link of the servo driver, that is, adding a torque (i.e., the gravity compensation value) opposite to the gravity direction to the torque command, the "nodding" phenomenon of the robotic arm can be effectively avoided. However, the foregoing gravity compensation value is a constant value and needs to be obtained by user calculation or trial and error. When the application scenario of the servo driver changes (either the robotic arm or the load changes), the gravity compensation value needs to be recalculated, which increases the difficulty of user parameter debugging. Summary of the Invention

[0004] The embodiments of the present application provide a gravity compensation method and device for a robot, a motor driver, and a storage medium, which are used to automatically confirm the gravity compensation current value when the robot is enabled, so as to reduce the difficulty of system parameter adjustment.

[0005] The first aspect of the embodiments of the present application provides a gravity compensation method for a robot, including:

[0006] Obtain the q-axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current according to the q-axis current, where the brake delay time is the time from when the motor driver disconnects the enable signal to when the motor actually brakes;

[0007] Determine the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time, where the torque compensation delay time is the time from when the motor driver enables the motor to when the motor starts to run.

[0008] In some specific implementation manners, the obtaining the q-axis current of the motor during the brake delay time and obtaining an estimated value of the gravity compensation current according to the q-axis current includes:

[0009] Obtain the accumulated value of the q-axis current of the motor within the brake delay time;

[0010] Determine the estimated value of the gravity compensation current according to the ratio of the accumulated value of the q-axis current to the brake delay time.

[0011] In some specific implementation manners, the determining the estimated value of the gravity compensation current according to the ratio of the accumulated value of the q-axis current to the brake delay time includes:

[0012] If the ratio is greater than a preset first threshold, use the first threshold as the estimated value of the gravity compensation current;

[0013] If the ratio is less than a preset second threshold, use the second threshold as the estimated value of the gravity compensation current;

[0014] If the ratio is not greater than the first threshold and not less than the second threshold, use the ratio as the estimated value of the gravity compensation current.

[0015] In some specific implementation manners, after obtaining the estimated value of the gravity compensation current, the method further includes:

[0016] Judge whether the current observation value in the previous gravity compensation process is zero. If so, use the estimated value of the gravity compensation current as the initial value of the gravity compensation current value;

[0017] If not, use the current observation value as the initial value of the gravity compensation current value.

[0018] In some specific implementation manners, the determining the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time includes:

[0019] Use the estimated value of the gravity compensation current as the gravity compensation current value within the torque compensation delay time.

[0020] In some specific implementation manners, the determining the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time includes:

[0021] S1: Use the estimated value of the gravity compensation current as the first gravity compensation current value within the torque compensation delay time;

[0022] S2: Determine the product of the estimated value of the gravity compensation current and the torque compensation delay time, and use the difference obtained by subtracting the product from the first gravity compensation current value as the second gravity compensation current value within the torque compensation delay time;

[0023] S3: Detect whether the motor starts to run. If so, end the torque compensation. If not, use the difference as the new first gravity compensation current value and execute step S2 to update the second gravity compensation current value to obtain multiple gravity compensation current values.

[0024] In some specific implementation manners, the method further includes:

[0025] S4: Use the second gravity compensation current value as the current observation value during the gravity compensation process;

[0026] Before step S4, it further includes: If the second gravity compensation current value is less than a preset value, use the preset value as the second gravity compensation current value.

[0027] The second aspect of the embodiments of the present application provides a gravity compensation device for a robot, including:

[0028] An acquisition unit, configured to acquire the q-axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current according to the q-axis current. The brake delay time is the time from when the motor driver disconnects the enable signal to when the motor actually brakes.

[0029] A determination unit, configured to determine the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time. The torque compensation delay time is the time from when the motor driver enables the enable signal to when the motor starts to run.

[0030] In some specific implementation manners, the acquisition unit is specifically configured to acquire the accumulated value of the q-axis current of the motor during the brake delay time;

[0031] Determine the estimated value of the gravity compensation current according to the ratio of the accumulated value of the q-axis current to the brake delay time.

[0032] In some specific implementation manners, the determination unit is specifically configured to: if the ratio is greater than a preset first threshold, use the first threshold as the estimated value of the gravity compensation current;

[0033] if the ratio is less than a preset second threshold, use the second threshold as the estimated value of the gravity compensation current;

[0034] if the ratio is not greater than the first threshold and not less than the second threshold, use the ratio as the estimated value of the gravity compensation current.

[0035] In some specific implementation manners, the obtaining unit is specifically configured to determine whether the current observation value in the previous gravity compensation process is zero. If so, the estimated gravity compensation current value is used as the initial value of the gravity compensation current value;

[0036] If not, the current observation value is used as the initial value of the gravity compensation current value.

[0037] In some specific implementation manners, the determining unit is specifically configured to use the estimated gravity compensation current value as the gravity compensation current value within the torque compensation delay time.

[0038] In some specific implementation manners, the determining unit is specifically configured to: S1: Use the estimated gravity compensation current value as the first gravity compensation current value within the torque compensation delay time;

[0039] S2: Determine the product of the estimated gravity compensation current value and the torque compensation delay time, and use the difference obtained by subtracting the product from the first gravity compensation current value as the second gravity compensation current value within the torque compensation delay time;

[0040] S3: Detect whether the motor starts to run. If so, end the torque compensation. If not, use the difference as the new first gravity compensation current value and execute step S2 to update the second gravity compensation current value to obtain multiple gravity compensation current values.

[0041] In some specific implementation manners, the determining unit is further configured to: S4: Use the second gravity compensation current value as the current observation value in the gravity compensation process;

[0042] Before step S4, the determining unit is further configured to, if the second gravity compensation current value is less than a preset value, use the preset value as the second gravity compensation current value.

[0043] A third aspect of the embodiments of the present application provides a motor driver, including:

[0044] A central processing unit, a memory, and a communication bus;

[0045] The communication bus is used to implement connection communication between the central processing unit and the memory;

[0046] The central processing unit is configured to execute one or more computer programs stored in the memory to implement the method described in the first aspect.

[0047] A fourth aspect of the embodiments of the present application provides a computer program product containing instructions. When the computer program product runs on a computer, the computer is caused to execute the method described in the first aspect.

[0048] A fifth aspect of the embodiments of the present application provides a computer storage medium, in which one or more computer programs are stored, and the one or more computer programs can be executed by one or more processors to implement the method described in the first aspect.

[0049] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: within the brake delay time, an estimated value of the gravity compensation current is estimated according to the feedback current of the q-axis of the motor (i.e., the q-axis current). Then, based on the estimated value of the gravity compensation current and the torque compensation delay time, the value of the gravity compensation current required when the motor driver is enabled is calculated, realizing automatic gravity compensation, enabling the robot to enable smoothly, eliminating the nodding phenomenon, without the need for the user to manually try and adjust, and effectively reducing the difficulty of gravity compensation. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of a timing state of parameters related to driver enabling disclosed in the embodiments of the present application;

[0051] Figure 2 It is a schematic flowchart of a gravity compensation method disclosed in the embodiments of the present application;

[0052] Figure 3 It is a schematic flowchart of a gravity compensation link disclosed in the embodiments of the present application;

[0053] Figure 4 It is another schematic flowchart of a gravity compensation link disclosed in the embodiments of the present application;

[0054] Figure 5 It is a schematic flowchart of a torque estimation link disclosed in the embodiments of the present application;

[0055] Figure 6 It is a schematic structural diagram of a gravity compensation device of a robot disclosed in the embodiments of the present application;

[0056] Figure 7 It is a schematic structural diagram of a motor driver disclosed in the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0058] The embodiments of the present application provide a gravity compensation method and device for a robot, a motor driver, and a storage medium, which are used to automatically confirm the gravity compensation value to reduce the difficulty of system parameter adjustment.

[0059] To better illustrate the technical solution of the present application, please refer to Figure 1 In the embodiments of the present application, the timing state of the parameters related to servo enable is as Figure 1 shown.

[0060] Figure 1 In, *1 corresponds to the gravity compensation link after the motor driver is enabled (i.e., the link that performs the gravity compensation operation), and the corresponding time is the torque compensation delay time (generally several tens of milliseconds); *2 represents the delay time from the effective output of the BRK_OFF signal to the actual braking of the motor brake, that is, the brake delay time (generally several tens of milliseconds), and this time depends on the hardware characteristics of the motor brake; at the same time, *2 also corresponds to the torque estimation link (i.e., the link that determines the estimated value of the gravity compensation current); t represents the time for the motor to decelerate to the speed threshold of the motor brake after the enable is disabled (i.e., the motor is braked after decelerating to this speed threshold). It should be noted that the time delay from the effective SRV_ON signal (i.e., the effective enable signal) to the BRK (brake signal) being set from OFF (invalid) to ON (effective) is less than 500 microseconds.

[0061] Please refer to Figure 2 In the embodiments of the present application, a gravity compensation method for a robot is provided, including the following steps:

[0062] 201. Obtain the q-axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current according to the q-axis current. The brake delay time is the time from when the motor driver disables the enable and issues a brake signal to the actual braking of the motor.

[0063] The prerequisite for performing gravity compensation on the robot is to determine the gravity compensation current value. In the embodiments of the present application, considering that affected by gravity, the q-axis of the motor can detect the feedback current during the brake delay time, and this feedback current is related to the gravity it receives. Therefore, an estimated value of the gravity compensation current can be obtained according to the q-axis current. Subsequently, based on the estimated value of the compensation current, the gravity compensation current value required when the motor driver is enabled can be determined.

[0064] In the embodiments of the present application, after the motor driver disables the enable, an estimated value of the gravity compensation current is obtained during the motor shutdown phase. Generally, this step can be triggered by a torque estimation instruction. The torque estimation instruction can be triggered by the user, or automatically triggered during shutdown after the user enables the gravity compensation function, and there is no limitation here. Usually, the user will initiate the torque estimation instruction when the load of the robot changes or its application scenario changes.

[0065] 202. Determine the gravity compensation current value required when the motor driver is enabled based on the estimated value of the gravity compensation current and the torque compensation delay time. The torque compensation delay time is the time from when the motor driver is enabled to when the motor starts running.

[0066] In the embodiment of the present application, after the motor driver is enabled, the gravity compensation current value is determined and gravity compensation is performed. The gravity compensation current value generates a gravity compensation torque to counteract the load gravity torque and the gravity torque of the robotic arm.

[0067] In practical applications, the q-axis current generated by the motor during the brake delay time is due to the nodding phenomenon. The larger the nodding amplitude, the larger the q-axis current. Therefore, the present application believes that the magnitude of the q-axis current (q-axis feedback current) of the motor during the brake delay time is positively correlated with the required gravity compensation current value. In addition, in order to avoid still performing gravity compensation after the motor starts running, which affects the normal operation of the robot, the gravity compensation current value required when the motor driver is enabled in this step also needs to be determined in combination with the torque compensation delay time.

[0068] In the embodiment of the present application, during the brake delay time, the estimated value of the gravity compensation current is estimated according to the feedback current of the q-axis of the motor (i.e., the q-axis current). Then, based on the estimated value of the gravity compensation current and the torque compensation delay time, the gravity compensation current value required when the motor driver is enabled is calculated, realizing automatic gravity compensation, enabling the robot to enable smoothly, eliminating the nodding phenomenon, without the need for the user to manually try and adjust, and effectively reducing the difficulty of gravity compensation.

[0069] In some specific implementation manners, in order to perform gravity compensation more accurately, in the torque estimation stage, the embodiment of the present application can obtain the cumulative value of the q-axis current of the motor at multiple moments during the brake delay time, and take the average as the estimated value of the gravity compensation current. Specifically, the cumulative value of the q-axis current of the motor during the brake delay time can be obtained; then, the estimated value of the gravity compensation current is determined according to the ratio of the cumulative value of the q-axis current to the brake delay time.

[0070] In practical applications, in order to avoid instability problems caused by the gravity compensation value being too large (close to 1) or too small (close to -1), according to the performance of the motor, the user can configure a first threshold and a second threshold to limit the value range of the estimated value of the gravity compensation current. The following steps can be referred to: If the ratio is greater than the preset first threshold, the first threshold is used as the estimated value of the gravity compensation current; if the ratio is less than the preset second threshold, the second threshold is used as the estimated value of the gravity compensation current; if the ratio is not greater than the first threshold and not less than the second threshold, the ratio is used as the estimated value of the gravity compensation current.

[0071] Specifically, by using the limiting function of [the second threshold, the first threshold], it can be ensured that the estimated value of the gravity compensation current obtained after calculating (the ratio of the q-axis current cumulative value to the brake delay time, or the average value of the q-axis current cumulative values at multiple times within the brake delay time) is not greater than the first threshold and not less than the second threshold.

[0072] Based on the foregoing embodiments, based on the estimated value of the gravity compensation current obtained in the foregoing torque estimation section, the gravity compensation section can be executed. It can be a fixed value of the estimated value of the gravity compensation current as the gravity compensation current value within the torque compensation delay time, or not compensated according to a fixed value, but slowly decreased according to time.

[0073] If a non-fixed-value compensation scheme is adopted, the following steps can be referred to: S1: Take the estimated value of the gravity compensation current as the first gravity compensation current value within the torque compensation delay time; S2: Determine the product of the estimated value of the gravity compensation current and the torque compensation delay time, and take the difference between the first gravity compensation current value and the product as the second gravity compensation current value within the torque compensation delay time; S3: Detect whether the motor starts to run. If so, end the gravity compensation. If not, take the difference as the new first gravity compensation current value and execute step S2 to update the second gravity compensation current value to obtain multiple gravity compensation current values. Among them, ending the torque compensation means stopping the calculation of the gravity compensation current value and stopping providing the gravity compensation current value to the motor.

[0074] Specifically, please refer to Figure 3 . After starting the gravity compensation section, each time a new gravity compensation value is calculated, it is the difference between the previously calculated gravity compensation current value and the product of (the estimated value of the gravity compensation current and the torque compensation delay time). In particular, the first gravity compensation current value is the first of the multiple gravity compensation current values required by the motor driver in the gravity compensation section. Since the product of (the estimated value of the gravity compensation current and the torque compensation delay time) is fixed, therefore, the gravity compensation current value calculated each time in the embodiments of the present application slowly decreases with time (or with each iteration update), which is more in line with the change of torque under real working conditions and makes the system operation more stable. It can be understood that the steps of calculating the gravity compensation current value in the embodiments of the present application are carried out synchronously with the steps of providing the gravity compensation current value to the motor. Whenever a new gravity compensation current value is calculated, this new gravity compensation current value will be used for gravity compensation until the motor starts to run.

[0075] It should be noted that if the above non-fixed-value compensation scheme is adopted, continuous iterative updates will be carried out. Eventually, a negative gravity compensation current value will be obtained in a certain iteration, and it is obviously unreasonable to provide a negative gravity compensation current for the motor. Another possibility is that the motor has started running before a negative gravity compensation current value is obtained. At this time, performing gravity compensation on the motor will affect the normal operation of the motor, which is unreasonable.

[0076] In view of the above problems, the embodiments of the present application further propose the following solution: after determining each gravity compensation current value, it can be first determined whether the gravity compensation current value is greater than a preset value; if the gravity compensation current value is less than the preset value, the gravity compensation is ended. Among them, according to the actual situation, the preset value can be set to 0 or any other value that can avoid the above problems, which is not limited here.

[0077] In practical applications, if the motor is interrupted when the gravity compensation link is not completed (that is, the operation of ending the gravity compensation is not executed), then in order to ensure the stability of the robot after the motor starts, the embodiments of the present application further include step S4 after step S3: after determining each gravity compensation current value (including the first gravity compensation current value and the second gravity compensation current value), determine the gravity compensation current value as the current observation value during the gravity compensation process, that is, each time a gravity compensation current value is determined, it will be assigned to the current observation value. In this way, if the gravity compensation link is interrupted, when the gravity compensation is restarted, it is necessary to determine whether the current observation value during the previous gravity compensation process is zero. If so, the gravity compensation current estimated value is used as the initial value of the gravity compensation current value; if not, the current observation value is used as the initial value of the gravity compensation current value, and the previous incomplete gravity compensation is continued.

[0078] After describing various implementation manners of the embodiments of the present application above, with reference to Figure 1 、 Figure 4 and Figure 5 shown below, in a specific scenario, the gravity compensation method of the robot according to the embodiments of the present application is described.

[0079] First, according to Figure 1 the timing relationship of the servo enable related parameters shown below, the gravity compensation method of the present application is divided into three links: the servo enable link, the gravity compensation link, and the torque estimation link.

[0080] First, the servo enable link performs a gravity compensation function judgment, that is: if the gravity compensation function is enabled, the gravity compensation link is enabled; if not, no gravity compensation is performed. If the gravity compensation function is enabled, gravity compensation is performed after the motor driver is enabled, and gravity compensation stops when the motor starts running; when the motor driver enables the gravity compensation function for the first time, the initial values of all parameters are zero. After the motor runs for a short time after enabling (that is, the motor runs smoothly, or the motor speed reaches the rated speed), the enable is turned off. During the motor shutdown period after the servo driver disables the enable, the estimated value of the gravity compensation current is determined, that is, the torque estimation link is entered.

[0081] Second, gravity compensation is performed in the gravity compensation link. That is: when the gravity compensation function is enabled, gravity compensation is performed after the motor driver is enabled, and the value of the gravity compensation current can decrease with the torque compensation delay time (that is, the time for gravity compensation after servo enable), and drops to zero when the motor starts running.

[0082] Third, the estimated value of the gravity compensation current is estimated in the torque estimation link, that is: in the torque estimation link, after the motor driver disables the enable after the motor is enabled and runs, the motor driver automatically determines the estimated value of the gravity compensation current during the motor shutdown period.

[0083] When the motor driver enables the gravity compensation function for the first time, in the gravity compensation link, during the first run, the estimated value of the gravity compensation current = the current observation value = 0 (all variables are set to zero during the first run).

[0084] Reference Figure 5 As shown, after the motor driver disables the enable and the motor is shut down, the estimated value of the gravity compensation current is calculated from the accumulated current Iq of the q-axis feedback before the brake. At this time, the current observation value is 0, and the estimated value of the gravity compensation current is used as the initial value (that is, the first gravity compensation current value for this gravity compensation).

[0085] When the motor driver enables the gravity compensation function again, reference Figure 4 As shown, in the gravity compensation link, the gravity compensation current value calculated at the (i + 1)th time = the gravity compensation current value calculated at the ith time - (the estimated value of the gravity compensation current * the torque compensation delay time). The gravity compensation current value calculated each time decreases continuously within the torque compensation delay time. When the calculated gravity compensation current value ≤ 0, the gravity compensation current value is set to 0, and the current observation value = the gravity compensation current value = 0; when the calculated gravity compensation current value > 0, the current observation value = the calculated gravity compensation current value.

[0086] In the embodiments of the present application, each time the motor driver is enabled and the gravity compensation function is turned on, the gravity compensation current value is automatically determined. The torque generated by the gravity compensation current value is opposite to the torque directions of the gravity of the robotic arm itself and the gravity of the end load, so as to cancel the nodding phenomenon when the gravity of the robotic arm itself and the gravity of the end load are disabled; and each time the motor driver is disabled, the gravity compensation current value required for enabling is estimated during the motor shutdown period, so that when the application scenario of the load or the motor driver changes, the gravity compensation current value required for enabling can be automatically re - estimated, enabling the motor driver to adapt to various application environments.

[0087] Please refer to Figure 6 , an embodiment of the present application provides a gravity compensation device for a robot, including:

[0088] An acquisition unit 601, configured to acquire the q - axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current according to the q - axis current. The brake delay time is the time from when the motor driver disables and issues a brake signal to when the motor actually brakes.

[0089] A determination unit 602, configured to determine the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time. The torque compensation delay time is the time from when the motor driver enables to when the motor starts to run.

[0090] In some specific implementation manners, the acquisition unit 601 is specifically configured to acquire the accumulated value of the q - axis current of the motor during the brake delay time;

[0091] Determine the estimated value of the gravity compensation current according to the ratio of the accumulated value of the q - axis current to the brake delay time.

[0092] In some specific implementation manners, the determination unit 602 is specifically configured to, if the ratio is greater than a preset first threshold, use the first threshold as the estimated value of the gravity compensation current;

[0093] If the ratio is less than a preset second threshold, use the second threshold as the estimated value of the gravity compensation current;

[0094] If the ratio is not greater than the first threshold and not less than the second threshold, use the ratio as the estimated value of the gravity compensation current.

[0095] In some specific implementation manners, the acquisition unit 601 is specifically configured to determine whether the current observation value in the previous gravity compensation process is zero. If so, use the estimated value of the gravity compensation current as the initial value of the gravity compensation current value;

[0096] If not, use the current observation value as the initial value of the gravity compensation current value.

[0097] In some specific implementation manners, the determining unit 602 is specifically configured to use the estimated value of the gravity compensation current as the gravity compensation current value within the torque compensation delay time.

[0098] In some specific implementation manners, the determining unit 602 is specifically configured to perform the following steps: S1: Use the estimated value of the gravity compensation current as the first gravity compensation current value within the torque compensation delay time;

[0099] S2: Determine the product of the estimated value of the gravity compensation current and the torque compensation delay time, and use the difference obtained by subtracting the product from the first gravity compensation current value as the second gravity compensation current value within the torque compensation delay time;

[0100] S3: Detect whether the motor starts to operate. If so, end the torque compensation. If not, use the difference as the new first gravity compensation current value and execute step S2 to update the second gravity compensation current value to obtain multiple gravity compensation current values.

[0101] In some specific implementation manners, the determining unit 602 is further configured to perform the following step: S4: Use the second gravity compensation current value as the current observation value during the gravity compensation process;

[0102] Before step S4, the determining unit 602 is further configured to use the preset value as the second gravity compensation current value if the second gravity compensation current value is less than the preset value.

[0103] Figure 7 FIG. is a schematic structural diagram of a motor driver provided by an embodiment of the present application. The motor driver 700 may include one or more central processing units (CPUs) 701 and a memory 705. One or more application programs or data are stored in the memory 705.

[0104] Among them, the memory 705 may be volatile storage or persistent storage. The program stored in the memory 705 may include one or more modules, and each module may include a series of instruction operations on the motor driver. Further, the central processor 701 may be configured to communicate with the memory 705 and execute a series of instruction operations in the memory 705 on the motor driver 700.

[0105] The motor driver 700 may further include one or more power supplies 702, one or more wired or wireless network interfaces 703, one or more input / output interfaces 704, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0106] The central processing unit 701 can execute the operations performed by the motor driver in the foregoing Figures 1 to 6 embodiment shown, and the details are not described herein again.

[0107] It should be noted that although the steps in the flowcharts involved in the embodiments are drawn in sequence according to the arrows, unless otherwise clearly stated in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0108] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0109] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.

[0110] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0111] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0112] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, read-only memory), random access memories (RAM, random access memory), magnetic disks, or optical discs.

[0113] An embodiment of this application also provides a computer program product containing instructions. When the computer program product runs on a computer, it enables the computer to execute the gravity compensation method of the robot as described above.

Claims

1. A gravity compensation method for a robot, characterized in that Including: Obtain the q-axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current based on the q-axis current, where the brake delay time is the time from when the motor driver disconnects the enable signal to when the motor actually brakes; Determine the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time, where the torque compensation delay time is the time from when the motor driver enables to when the motor starts to run.

2. The gravity compensation method according to claim 1, wherein The obtaining the q-axis current of the motor during the brake delay time and obtaining an estimated value of the gravity compensation current based on the q-axis current includes: Obtain the cumulative value of the q-axis current of the motor during the brake delay time; Determine the estimated value of the gravity compensation current according to the ratio of the cumulative value of the q-axis current to the brake delay time.

3. The gravity compensation method according to claim 2, wherein The determining the estimated value of the gravity compensation current according to the ratio of the cumulative value of the q-axis current to the brake delay time includes: If the ratio is greater than a preset first threshold, then use the first threshold as the estimated value of the gravity compensation current; If the ratio is less than a preset second threshold, then use the second threshold as the estimated value of the gravity compensation current; If the ratio is not greater than the first threshold and not less than the second threshold, then use the ratio as the estimated value of the gravity compensation current.

4. The gravity compensation method according to any one of claims 1-3, characterized in that, After obtaining the estimated value of the gravity compensation current, the method further includes: Judge whether the current observation value in the previous gravity compensation process is zero. If so, use the estimated value of the gravity compensation current as the initial value of the gravity compensation current value; If not, use the current observation value as the initial value of the gravity compensation current value.

5. The gravity compensation method according to claim 1, wherein The determining the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time includes: Use the estimated value of the gravity compensation current as the gravity compensation current value during the torque compensation delay time.

6. The gravity compensation method according to claim 1, wherein The determining the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time includes: S1: Use the estimated value of the gravity compensation current as the first gravity compensation current value during the torque compensation delay time; S2: Determine the product of the estimated value of the gravity compensation current and the torque compensation delay time, and use the difference obtained by subtracting the first gravity compensation current value from the product as the second gravity compensation current value during the torque compensation delay time; S3: Detect whether the motor starts to run. If so, end the gravity compensation. If not, use the difference as the new first gravity compensation current value and execute step S2 to obtain the new second gravity compensation current value until the motor starts to run.

7. The gravity compensation method according to claim 6, wherein The method further includes: S4: Use the second gravity compensation current value as the current observation value during the gravity compensation process; Before step S4, it further includes: if the second gravity compensation current value is less than a preset value, then use the preset value as the second gravity compensation current value.

8. A gravity compensation device for a robot, characterized in that, Including: An acquisition unit, configured to acquire the q-axis current of the motor during the brake delay time, and obtain an estimated value of the gravity compensation current according to the q-axis current, where the brake delay time is the time from when the motor driver disconnects the enable signal to when the motor actually brakes; A determination unit, configured to determine the gravity compensation current value required when the motor driver is enabled according to the estimated value of the gravity compensation current and the torque compensation delay time, where the torque compensation delay time is the time from when the motor driver enables to when the motor starts to run.

9. A motor driver, characterized in that, Comprising: A central processing unit, a memory, and a communication bus; The communication bus is used to realize the connection and communication between the central processing unit and the memory; The central processing unit is configured to execute one or more computer programs stored in the memory to implement the steps of the gravity compensation method for the robot according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, One or more computer programs are stored in the computer-readable storage medium, and the one or more computer programs can be executed by one or more processors to implement the steps of the gravity compensation method for the robot according to any one of claims 1 to 7.