Disclosure of Invention
An object of the embodiments of the present application is to provide a robot drag teaching method, device, electronic device, and storage medium, which can avoid the problem of errors in kinetic parameter identification in a kinetic compensation method.
In a first aspect, an embodiment of the present application provides a robot dragging teaching method, where the robot includes a robot body, a six-dimensional force sensor, and a base, the robot body is disposed on the base, the six-dimensional force sensor is configured to detect a constraint force parameter of the robot body to the base, and the method includes the following steps:
acquiring an initial position parameter, an initial speed parameter and an initial acceleration parameter of the tail end of the robot body;
acquiring effective constraint force parameters of the robot body on the base in each period of a plurality of continuous periods;
inputting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective restraining force parameter detected in each period into a mass-spring-damper system model so as to respectively calculate an actual position parameter, an actual acceleration parameter and an actual speed parameter at the end point of the corresponding period;
and controlling the corresponding joints of the robot to move according to the actual position parameters, the actual acceleration parameters and the actual speed parameters, thereby finishing the dragging teaching in the corresponding period.
According to the embodiment of the application, the dragging teaching is carried out based on the detection parameters of the six-dimensional force sensor on the base, so that the problem that errors exist in the kinetic parameter identification in a kinetic compensation method can be avoided; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome.
Optionally, in the robot drag teaching method according to an embodiment of the present application, before the step of obtaining the effective constraint force parameter of the robot body on the base in each of a plurality of consecutive periods, the method further includes:
acquiring a first constraint force parameter detected by the six-dimensional force sensor when the robot is in a static state;
and the step of obtaining the effective constraint force parameter of the robot body on the base in each of a plurality of continuous cycles comprises:
acquiring a second constraint force parameter detected by the six-dimensional force sensor in each period of a plurality of continuous periods;
and calculating to obtain the effective constraint force parameter of the robot body to the base according to the first constraint force parameter and the second constraint force parameter.
According to the embodiment of the application, the effective constraint force parameter is calculated by adopting the second constraint force parameter detected in real time and the first constraint force parameter in the static state, so that the error influence of the weight of the robot body on the dragging teaching is avoided, and the calculation accuracy can be improved.
Optionally, in the robot drag teaching method according to an embodiment of the present application, the step of acquiring a second constraint force parameter detected by the six-dimensional force sensor in each of a plurality of consecutive periods includes:
collecting the measured values of the restraint force parameters detected by the six-dimensional force sensor at preset time intervals in each period;
and calculating to obtain a second constraint force parameter according to the constraint force parameter measured values acquired in each period.
According to the embodiment of the application, the second constraint force parameter is calculated by adopting a plurality of detection values in one period, so that the accuracy of calculation of the constraint force parameter of the robot body on the base can be improved.
Optionally, in the robot drag teaching method according to an embodiment of the present application, the step of inputting the initial position parameter, the initial velocity parameter, the initial acceleration parameter, and the effective restraining force parameter obtained by each detection into the mass-spring-damper system model to respectively calculate the actual position parameter, the actual acceleration parameter, and the actual velocity parameter at the end point of each period includes:
the mass-spring-damper system model is discretized to generate the following three equations:
wherein x (k) is the end position of the robot at time k, x
d(k) For the desired position of the robot end at time k,
the velocity of the end of the robot at time k,
for the desired velocity of the robot end at time k,
for the robot tip acceleration at time k,
the expected acceleration of the tail end of the robot at the moment k; x (k +1) is the tail end position of the robot at the moment k + 1; xd (k +1) is the expected position of the tail end of the robot at the moment k + 1;
the terminal speed of the robot at the moment k + 1;
the expected speed of the tail end of the robot at the moment k + 1;
the terminal acceleration of the robot at the moment k + 1;
at the moment k +1, the expected acceleration of the tail end of the robot is obtained, T is the cycle length, F is an effective constraint force parameter of the robot body to the base, and M, B, K is an admittance control parameter;
and substituting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective constraint force parameter obtained by each detection into the three formulas to respectively calculate and obtain an actual position parameter, an actual acceleration parameter and an actual speed parameter of the end point of each period.
According to the method and the device, the dragging teaching is carried out based on the detection parameters of the six-dimensional force sensor on the base, the problem that errors exist in kinetic parameter identification in a kinetic compensation method can be avoided, and the difficulty degree of dragging can be adjusted by adjusting admittance control parameters; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome.
Optionally, in the robot drag teaching method according to an embodiment of the present application, before the step of obtaining an initial position parameter, an initial velocity parameter, and an initial acceleration parameter of the end of the robot body is performed, the method further includes the following steps:
and starting the admittance control function of the robot.
In a second aspect, an embodiment of the present application further provides a robot dragging teaching device, the robot includes a robot body, a six-dimensional force sensor and a base, the robot body set up in on the base, the six-dimensional force sensor is used for detecting the robot body is right the constraint force parameter of the base, the device includes:
the robot comprises a first acquisition module, a second acquisition module and a control module, wherein the first acquisition module is used for acquiring an initial position parameter, an initial speed parameter and an initial acceleration parameter of the tail end of a robot body;
the second acquisition module is used for acquiring effective constraint force parameters of the robot body on the base at intervals of the same period;
the calculation module is used for inputting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective constraint force parameter obtained by each detection into a mass-spring-damper system model so as to respectively calculate an actual position parameter, an actual acceleration parameter and an actual speed parameter at the end point of each period;
and the control module is used for controlling the corresponding joint of the robot to move according to the actual position parameter, the actual acceleration parameter and the actual speed parameter so as to finish the dragging teaching.
Optionally, in the robot dragging teaching device according to the embodiment of the present application, the robot dragging teaching device further includes a third obtaining module, configured to obtain a first constraint force parameter detected by the six-dimensional force sensor when the robot is in a stationary state;
and the second acquisition module comprises:
the first acquisition unit is used for acquiring a second constraint force parameter detected by the six-dimensional force sensor in each period of a plurality of continuous periods;
and the calculating unit is used for calculating to obtain the effective constraint force parameter of the robot body to the base according to the first constraint force parameter and the second constraint force parameter.
Optionally, in the robot drag teaching apparatus according to an embodiment of the present application, the first obtaining unit is configured to: collecting the measured values of the restraint force parameters detected by the six-dimensional force sensor at preset time intervals in each period; and calculating to obtain a second constraint force parameter according to the constraint force parameter measured values collected in each preset time period in each period.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method as provided in the first aspect are executed.
In a fourth aspect, embodiments of the present application provide a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps in the method as provided in the first aspect.
As can be seen from the above, the robot dragging teaching method, device, electronic device and storage medium provided in the embodiments of the present application obtain an initial position parameter, an initial velocity parameter and an initial acceleration parameter of the end of the robot body; acquiring effective constraint force parameters of the robot body on the base in each period of a plurality of continuous periods; inputting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective restraining force parameter detected in each period into a mass-spring-damper system model so as to respectively calculate an actual position parameter, an actual acceleration parameter and an actual speed parameter at the end point of the corresponding period; controlling the corresponding joints of the robot to move according to the actual position parameters, the actual acceleration parameters and the actual speed parameters, thereby finishing the dragging teaching of the corresponding period; the dragging teaching is carried out based on the detection parameters of the six-dimensional force sensor on the base, the problem that errors exist in kinetic parameter identification in a kinetic compensation method can be avoided, and the dragging difficulty can be adjusted by adjusting admittance control parameters; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a robot drag teaching method according to some embodiments of the present disclosure, in which a robot includes a robot body, a six-dimensional force sensor, and a base. The robot body is arranged on the base, and the six-dimensional force sensor is used for detecting the constraint force parameter of the robot body on the base. The robot dragging teaching method comprises the following steps:
s101, acquiring an initial position parameter, an initial speed parameter and an initial acceleration parameter of the tail end of the robot body.
S102, acquiring effective constraint force parameters of the robot body on the base in each period of a plurality of continuous periods.
S103, inputting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective restraining force parameter detected in each period into a mass-spring-damper system model so as to respectively calculate the actual position parameter, the actual acceleration parameter and the actual speed parameter of the end point of the corresponding period.
And S104, controlling the robot to move according to the actual position parameter, the actual acceleration parameter and the actual speed parameter, thereby finishing the dragging teaching.
The above steps S101 to S104 do not form a limitation on the execution order thereof. The above steps will be described in detail below.
In step S101, the initial position parameter, the initial velocity parameter and the initial acceleration parameter are parameters of a cartesian space. Before executing the step S101, the admittance control function of the robot is started, so that the dragging direction X \ Y \ Z linear motion and the R \ P \ Y rotational motion are allowed.
In step S102, the effective constraint force parameter is used as an admittance control parameter, and the ease of dragging can be adjusted by adjusting the admittance control parameter; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome. And obtaining the effective constraint force parameter of the robot body to the base through the constraint force parameter detected by the six-dimensional force sensor. Wherein, in each period, the effective constraint force parameters of the robot body to the base are basically equal.
In some embodiments, in order to avoid the influence of the acting force of the self weight of the robot body on the base on the overall calculation, the constraint force parameter at rest can be used as the offset value. Therefore, before executing step S102, it is necessary to execute: and acquiring a first constraint force parameter detected by the six-dimensional force sensor when the robot is in a static state.
And the step S102 includes: s1021, acquiring a second constraint force parameter detected by the six-dimensional force sensor in each period of a plurality of continuous periods; and S1022, calculating to obtain the effective constraint force parameter of the robot body to the base in the corresponding period according to the first constraint force parameter and the second constraint force parameter. The effective constraint force parameter can be obtained by subtracting the first constraint force parameter from the second constraint force parameter. Specifically, the step S1021 includes: in each period, collecting the measured values of the restraint force parameters detected by the six-dimensional force sensor at preset time intervals; and calculating to obtain a second constraint force parameter according to the constraint force parameter measured values collected in each preset time period in the period. The controller requests data from the six-dimensional force sensor every 1ms, analyzes the data into force and moment in units of N and N · m, and stores the force and moment, for example, the period is 50ms, obtains 50 measured values of the constraint force parameter in total, and then obtains an average value according to the 50 measured values of the constraint force parameter, that is, the second constraint force parameter. The constraint force parameters comprise acting force and moment of the robot body on the base.
In step S103, the mass-spring-damper system model is:
wherein, F is the effective constraint force parameter of the robot body to the base, E is the terminal pose compensation value of the robot, and M, B, K is the admittance control parameter. This step S103 includes the following substeps:
and S1031, carrying out discrete processing on the mass-spring-damper system model to generate the following three formulas:
and S1032, substituting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective constraint force parameter obtained by each detection into the three formulas to respectively calculate and obtain an actual position parameter, an actual acceleration parameter and an actual speed parameter of the end point of each period.
In a specific operation process, discretizing the mass-spring-damper system model can obtain:
where T is a sampling time, i.e., a time length of one cycle.
Discretizing the mass-spring-damper system model to obtain three formulas, and further converting the three formulas to obtain three target calculation formulas:
wherein x (k) is the end position of the robot at time k, x
d(k) For the desired position of the robot end at time k,
the velocity of the end of the robot at time k,
for the desired velocity of the robot end at time k,
for the robot tip acceleration at time k,
the expected acceleration of the tail end of the robot at the moment k; x (k +1) is the tail end position of the robot at the moment k + 1; xd (k +1) is the expected position of the tail end of the robot at the moment k + 1;
the terminal speed of the robot at the moment k + 1;
the expected speed of the tail end of the robot at the moment k + 1;
the terminal acceleration of the robot at the moment k + 1;
the robot end expects acceleration for time k + 1. Wherein, the k time is separated from the k +1 time by one period. In the drag teaching scene, the desired end position, the desired end velocity, and the desired end acceleration at time k are all 0, and the desired end position, the desired end velocity, and the desired end acceleration at time k +1 are all 0.
In the actual operation process, when k is 0, that is, at an initial time, the initial position parameter, the initial velocity parameter, the initial acceleration parameter, and the constraint force parameter F of the robot body on the base are taken into the three target calculation formulas to calculate and obtain an actual position parameter, an actual acceleration parameter, and an actual velocity parameter at a time k +1, that is, at a time 1. Then, the actual position parameter, the actual acceleration parameter, and the actual velocity parameter at time 2 are obtained by taking k as 1.
In step S104, the robot is controlled to perform a corresponding operation based on the calculated actual acceleration parameter, actual velocity parameter, and actual position parameter at the end point of each cycle. The dragging is performed once every one period.
And on the premise of ensuring the stability of the tail end of the robot, in order to enable the tail end of the robot to be more compliant, the parameter B can be reduced, and in order to ensure that the response time is unchanged, the parameter M can be correspondingly reduced.
According to the method and the device, the dragging teaching is carried out based on the detection parameters of the six-dimensional force sensor on the base, the problem that errors exist in kinetic parameter identification in a kinetic compensation method can be avoided, and the difficulty degree of dragging can be adjusted by adjusting admittance control parameters; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome.
Referring to fig. 2, fig. 2 is a structural diagram of a robot drag teaching device in some embodiments of the present application. The robot drag teaching device includes: a first acquisition module 201, a second acquisition module 202, a calculation module 203, and a control module 204.
The first obtaining module 201 is configured to obtain an initial position parameter, an initial velocity parameter, and an initial acceleration parameter of the end of the robot body; the initial position parameter, the initial velocity parameter, and the initial acceleration parameter are parameters of a cartesian space.
The second obtaining module 202 is configured to obtain the effective constraint force parameter of the robot body on the base every the same period.
Referring to fig. 3, in some embodiments, in order to avoid the influence of the acting force of the robot body on the base on the overall calculation, the constraint force parameter at rest may be used as the offset value. Therefore, the apparatus further comprises a third obtaining module 205: the third obtaining module 205 obtains a first constraint force parameter detected by the six-dimensional force sensor when the robot is in a static state.
Correspondingly, the second obtaining module 202 includes: a first obtaining unit 2021, configured to obtain a second constraint force parameter detected by the six-dimensional force sensor in each of a plurality of consecutive cycles; the calculating unit 2022 is configured to calculate an effective constraint force parameter of the robot body to the base according to the first constraint force parameter and the second constraint force parameter. The controller requests data from the six-dimensional force sensor every 1ms, analyzes the data into force and moment in units of N and N · m, and stores the force and moment, for example, the period is 50ms, obtains 50 measured values of the constraint force parameter in total, and then obtains an average value according to the 50 measured values of the constraint force parameter, that is, the second constraint force parameter. The constraint force parameters comprise acting force and moment of the robot body on the base.
The calculating module 203 is configured to input the initial position parameter, the initial velocity parameter, the initial acceleration parameter, and the effective restraining force parameter obtained by each detection into a mass-spring-damper system model, so as to calculate an actual position parameter, an actual acceleration parameter, and an actual velocity parameter at an end point of each period respectively. The mass-spring-damper system model is:
the calculation module 203 is used for performing discrete processing on the mass-spring-damper system model to generate the following three formulas:
wherein x (k) is the position of the end of the robot at time k, x
d(k) Is a non-volatile organic compound (I) with a value of 0,
the velocity of the end of the robot at time k,
is a non-volatile organic compound (I) with a value of 0,
for the robot tip acceleration at time k,
is 0; x (k +1) is the tail end position of the robot at the moment k + 1; xd (k +1) is 0;
the terminal speed of the robot at the moment k + 1;
is 0;
the terminal acceleration of the robot at the moment k + 1;
is 0; and substituting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective constraint force parameter obtained by each detection into the three formulas to respectively calculate and obtain an actual position parameter, an actual acceleration parameter and an actual speed parameter of the end point of each period.
The control module 204 is configured to control the corresponding joint of the robot to move according to the actual position parameter, the actual acceleration parameter, and the actual speed parameter, so as to complete the dragging teaching. The control module 204 controls the robot to perform corresponding operations according to the calculated actual acceleration parameter, actual speed parameter and actual position parameter at the end point of each period. The dragging is performed once every one period.
As can be seen from the above, the robot dragging teaching device provided in the embodiment of the present application obtains an initial position parameter, an initial velocity parameter, and an initial acceleration parameter of the end of the robot body; acquiring effective constraint force parameters of the robot body on the base in each period of a plurality of continuous periods; inputting the initial position parameter, the initial speed parameter, the initial acceleration parameter and the effective restraining force parameter detected in each period into a mass-spring-damper system model so as to respectively calculate an actual position parameter, an actual acceleration parameter and an actual speed parameter at the end point of the corresponding period; controlling the corresponding joints of the robot to move according to the actual position parameters, the actual acceleration parameters and the actual speed parameters, thereby finishing the dragging teaching of the corresponding period; the dragging teaching is carried out based on the detection parameters of the six-dimensional force sensor on the base, the problem that errors exist in kinetic parameter identification in a kinetic compensation method can be avoided, and the dragging difficulty can be adjusted by adjusting admittance control parameters; and no matter which part of the robot is contacted, the tail end of the robot can be dragged, so that the defect that the tail end sensor can only drag and drag the tail end is overcome.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, in which an electronic device 3 includes: the processor 301 and the memory 302, the processor 301 and the memory 302 being interconnected and communicating with each other via a communication bus 303 and/or other form of connection mechanism (not shown), the memory 302 storing a computer program executable by the processor 301, the processor 301 executing the computer program when the computing device is running to perform the method of any of the alternative implementations of the embodiments described above.
The embodiment of the present application provides a storage medium, and when being executed by a processor, the computer program performs the method in any optional implementation manner of the above embodiment. The storage medium may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as a Static Random Access Memory (SRAM), an electrically erasable programmable Read-only memory (EEPROM), an erasable programmable Read-only memory (EPROM), a programmable Read-only memory (PROM), a Read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.