Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings and examples.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for calibrating a motion control command of a robot according to a first embodiment of the present invention. In this embodiment, the method of correcting a motion control command of a robot may include the steps of:
step S11: first position data of three preset points on a workpiece are acquired.
In this embodiment, the preset three points may be any three points that are not collinear and are set on the workpiece in advance. The first position data may be position data of the three points after the workpiece is changed from the position. The acquisition of the first position data of the three preset points on the workpiece can be realized by acquiring teaching data input by a user to control the robot to enable the tool to contact the three points after the workpiece is changed in position, and then the acquisition of the first position data is realized according to the teaching data. In other embodiments, the first position data of the three preset points on the workpiece may be obtained through other manners, such as measurement calibration, which is not limited in this embodiment, and refer to the following description specifically.
Step S12: and acquiring pre-stored second position data of the three points.
In this embodiment, the second position data may be position data of the three points before the workpiece is shifted. And acquiring pre-stored second position data of the three points, for example, the robot pre-stores the second position data of the three points before the workpiece is changed in position, and acquires the second position data from a memory of the robot. In this embodiment, the second position data may be obtained and stored by teaching the three points before the position of the workpiece is changed, specifically, refer to the following description. In other embodiments, the second position data may be obtained by other means, such as measurement calibration, and then stored in memory.
Step S13: a first position transition parameter is determined based on the first position data and the second position data.
In this embodiment, determining the first position conversion parameter according to the first position data and the second position data may be calculating a conversion matrix according to the first position data and the second position data, and in other embodiments, other position conversion parameters may be calculated according to the first position data and the second position data. The embodiment of the present invention is not limited thereto.
Step S14: and correcting the motion control command of the robot according to the first position conversion parameter to obtain the corrected motion control command of the robot.
In this embodiment, the correcting the motion control command of the robot according to the first position conversion parameter, and the obtaining the corrected motion control command of the robot may include: correcting the three-dimensional coordinates in the motion control command of the robot according to the first position conversion parameter; and correcting the rotation angle in the motion control command of the robot according to the first position conversion parameter, which is described in detail below.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for calibrating a motion control command of a robot according to a second embodiment of the present invention. In this embodiment, acquiring first position data of three predetermined points on the workpiece includes: receiving teaching data input by a user to control the robot to enable the tool to contact three preset points on the workpiece; first position data is acquired based on the teaching data. Correcting the motion control command of the robot according to the first position conversion parameter comprises the following steps: and correcting the three-dimensional coordinates in the motion control command of the robot according to the first position conversion parameter and correcting the rotation angle in the motion control command of the robot according to the first position conversion parameter.
In this embodiment, the method of correcting a motion control command of a robot may include the steps of:
step S21: first teaching data input by a user is received to control the robot to enable the tool to contact three preset points on the workpiece.
In this embodiment, the preset three points may be any three points that are not collinear and are set on the workpiece in advance. The tool may be a robot-mounted tool. The tool may be rigidly connected to a flange of the robot. The tool may be a point contact tool. For example, the tool may be a welding gun. In other embodiments, the tool may be other tools, and the connection with the robot may be in other manners. Preferably, the first teaching data input by the user is received to control the robot to drive a tool mounted on the robot to contact three preset points on the workpiece after the workpiece is changed to the position. Teaching of the robot by the user means that when the user controls the robot to execute a specific motion, the robot records teaching data corresponding to the specific motion and can execute the specific motion according to the teaching data in a subsequent process.
Step S22: first position data is acquired based on the teaching data.
In this embodiment, the first position data is obtained according to the first teaching data, and the first position data may be position data of the three points after the workpiece is shifted. Acquiring the first position data according to the first teaching data may include: acquiring third position data of the three points in a basic coordinate system according to the first teaching data; converting the third position data into first position data in a flange coordinate system. Converting the third position data into first position data in a flange coordinate system may include: converting the third position data to the first position data using a second position conversion parameter between the known base coordinate system and the flange coordinate system.
Preference is given toThe first position data comprise the coordinates of each of the three points in the flange coordinate system after the workpiece has been displaced, the first point of said three points, for example, having x' coordinates in each of the three coordinate axes of the flange coordinate systemf1,y'f1,z'f1The first position data further includes attitude angles a ', b ', c ' of the first point in the base coordinate system with respect to three coordinate axes after the workpiece is repositioned.
Preferably, the third position data obtained from the first teaching data includes coordinates of each of the three points in the base coordinate system after the workpiece is changed in position, the coordinates of the first point in the base coordinate system being x ', y', z ', respectively, taking the first point as an example, and the fourth position data further includes attitude angles a', b ', c' of the first point in the base coordinate system with respect to three coordinate axes after the workpiece is changed in position.
The third position data is converted into the first position data using the second position conversion parameter. For example, using a known transformation relationship f1The coordinates x ', y', z 'of the first point in the base coordinate system after the workpiece has been repositioned are converted into the coordinates x' in the flange coordinate systemf1,y'f1,z'f1。
Step S23: and acquiring pre-stored second position data of the three points.
In this embodiment, the second position data may be position data of the three points before the workpiece is shifted. And acquiring pre-stored second position data of the three points, for example, the robot pre-stores the second position data of the three points before the workpiece is changed in position, and acquires the second position data from a memory of the robot. The pre-storing the second position data of the three points may specifically include: and receiving second teaching data input by a user in advance to control the robot to enable the tool to contact the three points before the position of the workpiece is changed, acquiring second position data according to the second teaching data, and storing the second position data in a memory. Acquiring the second position data according to the second teaching data may include: acquiring fourth position data of the three points in a basic coordinate system according to the second teaching data; and converting the fourth position data into second position data in a flange coordinate system. Converting the fourth position data into second position data in a flange coordinate system may include: and converting the fourth position data into the second position data by using a second position conversion parameter between the known basic coordinate system and the flange coordinate system.
Preferably, the second position data comprise the coordinates of each of the three points in the flange coordinate system before the workpiece is repositioned, taking as an example the first point whose coordinates in the three coordinate axes of the flange coordinate system are x respectivelyf1,yf1,zf1The second position data further includes attitude angles a, b, c of the first point with respect to three coordinate axes in the base coordinate system before the workpiece is repositioned.
Preferably, the fourth position data acquired from the second teaching data includes coordinates of each of the three points in the basic coordinate system before the workpiece is repositioned, the coordinates of the first point in the basic coordinate system are x, y, z, respectively, taking the first point as an example, and the fourth position data further includes attitude angles a, b, c of the first point in the basic coordinate system with respect to the three coordinate axes before the workpiece is repositioned.
Preferably, the fourth position data is converted into the second position data using a second position conversion parameter between the known base coordinate system and the flange coordinate system. For example, using a known transformation relationship f1Converting the coordinates x, y, z of the first point in the basic coordinate system before the workpiece is repositioned to the coordinates x in the flange coordinate systemf1,yf1,zf1. It is understood that since the base coordinate system and the flange coordinate system are known, the conversion relationship therebetween, i.e., the second position conversion parameter, is known.
Step S24: determining a first position transition parameter based on the first position data and the second position data.
In this embodiment, determining a first position conversion parameter from the first position data and the second position data comprises: a transformation matrix is calculated from the first position data and the second position data.
Preferably, the calculating the conversion matrix from the first position data and the second position data comprises: setting a first point of the three points to coincide with an origin of a first three-dimensional rectangular coordinate system before the workpiece is shifted, and setting the first point to coincide with an origin of a second three-dimensional rectangular coordinate system after the workpiece is shifted, wherein the position relation between the coordinate axis of the first three-dimensional rectangular coordinate system and the three points is consistent with the relative position relation between the coordinate axis of the second three-dimensional rectangular coordinate system and the three points;
the transformation matrix is calculated by the following formula:
εX=a'-a;εY=b'-b;εz=c'-c
wherein x isf1,yf1,zf1For the coordinates, x', of the first point in the flange coordinate system in the three coordinate axes before the workpiece change positionf1,y'f1,z'f1The coordinate of the first point on three coordinate axes of the flange coordinate system after the workpiece is changed, a, b and c are respectively the attitude angle of the first point on the basic coordinate system before the workpiece is changed, a ', b ' and c ' are respectively the attitude angle of the first point on the basic coordinate system after the workpiece is changed, epsilonX,εY,εZThe included angles of the three coordinate axes of the first three-dimensional rectangular coordinate system and the three coordinate axes of the corresponding second three-dimensional rectangular coordinate system are respectively included.
The derivation process of the transformation matrix is as follows:
the calculation of the conversion matrix between the first three-dimensional rectangular coordinate system and the second three-dimensional rectangular coordinate system can be obtained by adopting a mode of adding three rotation matrixes and translation:
wherein R is1(εX)R2(εY)R3(εZ) The three-dimensional rectangular coordinate system is a rotation matrix around three coordinate axes of x, y and z of the first three-dimensional rectangular coordinate system.
The transformation matrix can thus be obtained as:
step S25: and correcting the three-dimensional coordinates in the motion control command of the robot according to the first position conversion parameter and correcting the rotation angle in the motion control command of the robot according to the first position conversion parameter.
In this embodiment, the motion control command may be third teaching data of a user input received in advance. The third teaching data is corrected to generate fourth teaching data. Specifically, the coordinates and rotation angles of the respective points on the first motion trajectory recorded in the third teaching data are converted into new coordinates by the first conversion parameter to generate the second motion trajectory, and the corresponding fourth teaching data is generated by passing the points on the first trajectory through the conversion matrix TmThe robot can drive the tool to move according to the second motion trail recorded in the fourth teaching data so as to accurately process the workpiece after changing the position without inputting the teaching data again, and the robot can be realized according to the original teaching data and the first position conversion parameterPrecise control of the person. In other embodiments, the motion control command may be other commands for controlling the motion of the robot, which is not limited in the present invention.
Referring to fig. 3, fig. 3 is a schematic diagram of a robot controller module according to an embodiment of the invention. In this embodiment, the robot controller includes a memory 11 and a processor 12, the memory 11 stores executable programs and data, and the processor 12 calls the executable programs and data in the memory 11 to perform the following steps: acquiring first position data of three preset points on a workpiece; acquiring second position data of three prestored points; determining a first position conversion parameter according to the first position data and the second position data; and correcting the motion control command of the robot according to the first position conversion parameter to obtain the corrected motion control command of the robot.
For a detailed description of the steps of the processor 12 calling the executable program and executing the data in the memory 11, please refer to the foregoing description, which is not described herein again. The data stored in the memory 11 may include: any of the above embodiments may be implemented with the first position data, the second position data, the third position data, the fourth position data, the first position transition parameter, the second position transition parameter, the first teaching data, the second teaching data, the third teaching data, the fourth teaching data, and the other data mentioned in the above embodiments.
Referring to fig. 4, fig. 4 is a schematic diagram of a robot module according to an embodiment of the invention. In the present embodiment, the robot includes a robot main body 21 and a controller 22, and the controller 22 is configured to: acquiring first position data of three preset points on a workpiece; acquiring second position data of three prestored points; determining a first position conversion parameter according to the first position data and the second position data; and correcting the motion control command of the robot according to the first position conversion parameter to obtain the corrected motion control command of the robot.
Preferably, the controller 22 is configured to: correcting the three-dimensional coordinates in the motion control command of the robot according to the first position conversion parameter; and correcting the rotation angle in the motion control command of the robot according to the first position conversion parameter.
Preferably, the controller 22 is configured to: receiving teaching data input by a user to control the robot to enable the tool to contact three preset points on the workpiece; first position data is acquired based on the teaching data.
Preferably, the controller 22 is configured to: acquiring third position data of the three points in the basic coordinate system according to the teaching data;
preferably, the controller 22 is configured to: the third position data is converted into first position data in a flange coordinate system.
Preferably, the controller 22 is configured to: the third position data is converted to the first position data using a second position conversion parameter between the known base coordinate system and the flange coordinate system.
Preferably, the three predetermined points on the workpiece are not collinear.
Preferably, the controller is for: a transformation matrix is calculated from the first position data and the second position data.
Preferably, the first position data is position data of three points after the workpiece is changed in position, the second position data is position data of three points before the workpiece is changed in position,
the controller 22 is configured to:
setting a first point of three points before the workpiece is changed to coincide with the origin of a first three-dimensional rectangular coordinate system, and setting the first point after the workpiece is changed to coincide with the origin of a second three-dimensional rectangular coordinate system, wherein the position relation between the coordinate axis of the first three-dimensional rectangular coordinate system and the three points is consistent with the relative position relation between the coordinate axis of the second three-dimensional rectangular coordinate system and the three points;
the transformation matrix is calculated by the following formula:
εX=a'-a;εY=b'-b;εz=c'-c
wherein x isf1,yf1,zf1For changing position of workCoordinates, x' of the first point in front on three coordinate axes of the flange coordinate systemf1,y'f1,z'f1The coordinate of the first point on three coordinate axes of the flange coordinate system after the workpiece is changed, a, b and c are respectively the attitude angle of the first point on the basic coordinate system before the workpiece is changed, a ', b ' and c ' are respectively the attitude angle of the first point on the basic coordinate system after the workpiece is changed, epsilonX,εY,εZThe included angles of the three coordinate axes of the first three-dimensional rectangular coordinate system and the three coordinate axes of the corresponding second three-dimensional rectangular coordinate system are respectively included.
Preferably, the tool is a point contact tool.
Preferably, the tool is a welding gun.
Preferably, the tool is rigidly connected to the flange of the robot.
Referring to fig. 5, fig. 5 is a block diagram of a memory device according to an embodiment of the invention. In the present embodiment, the storage device 31 stores an executable program executed to implement the method for correcting the motion control command of the robot according to any one of the above-described embodiments. The storage device 31 may be a usb disk, an optical disk, a hard disk, a removable hard disk, a server, or the like, and of course, the storage device 31 may also be the memory 11 in the above embodiments.
The method is different from the prior art in that first position data of three preset points on a workpiece are acquired; acquiring second position data of three prestored points; determining a first position conversion parameter according to the first position data and the second position data; and correcting the motion control command of the robot according to the first position conversion parameter to obtain the corrected motion control command of the robot, and accurately controlling the robot to move according to the corrected motion control command after the position of the workpiece is changed under the condition that the workpiece coordinate system is not calibrated in advance.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.