2.1. Design of the Experimental Structure
In this paper, TM5M-900 robot is used to verify the calibration experiments shown in
Figure 1 [
17,
18]. This 6-axis robot is suitable for mobile assembly applications in the automated chemical and electronic industries. It is easy to program, highly customizable, has a radius range of 900 mm, and has a payload of 4 kg. The TCP, shown in
Figure 1, is the working point used by the robot with a reference coordinate system attached to the robot’s flange. Typically, the robot motion is programmed to define a path relative to the reference coordinate preset, which can be represented by various coordinate systems. In addition, a robot system can have multiple TCPs in it but it can only have one TCP active at a time. The robot base coordinates are attached to the robot base, and, in this study, the base coordinate system corresponds to the world coordinate system. The wrist frame is attached to the robot flange and the surface is on the robot’s last axis and can mount tools. The center of the wrist frame is located in the flange center, the six axes of the robot are coinciding with the blue z-axis of the wrist frame, and the red axis and green axis represent the X and Y axes, respectively.
First, the z-axis of the tool coordinate systems is defined as the direction extending in the tool axis direction, and the TCP, which is also the origin of the tool coordinate system, is defined at this end effector (
Figure 2a) [
18].
From
Figure 2, we can find that since the cylindrical tool is symmetrical in the X and Y axes, the rotation error along the z-axis is negligible. In this case, if the actual position and direction of the TCP, i.e., the coordinate system of the tool, is required, only the axial direction of the tool is required and then the direction of the coordinate system can be obtained by calculation. Once the direction of the coordinate system is obtained by calculation, the position of the coordinate system can be calculated by finding the end of the tool along the axial direction (
Figure 2b).
Secondly, we set up the laser sensor that operates by sending a Boolean value when the laser is detecting an object. The precise position of the TCP is unknown, and to ensure the TCP can be correctly detected by a laser sensor, use two laser sensors on the same plane, one in the X-axis direction and the other in the Y-axis direction, also, the calibration is executed according to this plane (
Figure 3).
2.2. Tool State Analysis and Error Modeling
Before deriving the various theoretical formulas, it is necessary to define the tool state before calibration. There are four types: Ideal case, offset, runout, and offset with runout (
Figure 4a) [
19].
In
Figure 4, the horizontal line at the top of each state represents the flange surface, the solid black line below the horizontal line and the dark red solid line below represent the tools, and the black dashed line below each state is the ideal tool state for comparison. For the definition of each state, the tool offset represents the error of the tool’s position relative to the ideal tool state, this means the tool has only the position displacement error concerning the ideal tool; the tool runout represents that the tool has only the rotation error concerning the ideal case. The tool offset and runout errors are the errors of tool position and rotation concerning the ideal case. However, in reality, when the tool is installed, the ideal tool coordinate system and the flange coordinate system usually have relative rotational deviation, so a more exact illustration of the tool condition is shown in
Figure 4b.
After analyzing the possible states of the tool, the error modeling of the tool coordinate system can be performed using nonlinear equations [
19], because in the kinematic model, the externally mounted tool can be considered as an extension of the robot arm; in addition, the orientation of the tool coordinate system in the robot arm base coordinate system can be expressed as a nonlinear function of the geometric parameters of the robot arm linkage, the geometric parameters of the tool, and the angular values of the joints, so the relationship between the ideal tool coordinate system and the ideal robot arm base coordinate system can be expressed as Equation (1),
where
Pit represents the measured TCP posture under the ideal robot arm base coordinate system; the vector
represents the angle value of each joint of the robot arm; vector
represents the ideal linkage geometric parameter of the robot arm; and the vector
represents the ideal tool geometric parameter.
Practically, the robot model does not anticipate the exact position and orientation of the additional mounted tools. Therefore, the difference between the actual tool pose and the robot kinematic tool pose is the geometric error of the tool installation and the link geometry error of the robot, as shown in Equation (2).
where
Pat represents the measured TCP posture under the actual robot arm base coordinate system; the vector
is the error of the geometric parameters between the ideal and the actual robot arm connecting linkage; and the vector
is the error of geometric parameters between the ideal tool and the actual tool.
From Equations (1) and (2), the errors of the actual robot arm and actual tool can be derived as Equations (3) and (4).
where
represents the tool coordinate and the ideal tool coordinate posture error after the actual tool linked by actual robot.
The purpose of this study is to discuss TCP calibration, so it is assumed that the robotic arm has already completed its native calibration, and the main calibration error model is shown in Equation (5).
where
represents the posture error model of the actual tool coordinate system concerning the ideal tool coordinate system after the robot has been calibrated; and the vector
represents the linkage geometric parameters after the robot arm has been calibrated.
In the next section, the calibration theory will be derived for in Equation (5), i.e., the error in the geometric parameters between the actual tool and the ideal tool. In the parameter derivation section, how to obtain the actual tool attitude will be discussed, which is mainly for the calibration of runout and offset.
2.3. Runout Calibration
Runout calibration can be divided into three steps. First, the tool center offset is calculated by position method and then the projection angle is derived. Finally, the rotation matrix can be solved to express the position of an object rotating in space. The position method is used to derive the tool center offset and record the position of the tool when the laser beam is triggered. As the laser sensor is triggered, the coordinates of the TCP are recorded in real-time, and four positions of the TCP are known in each moving cycle.
Figure 5a shows the actual and hypothetical trajectories and
Figure 5b,c show the position of the tool when it triggers the laser sensor. There are two laser beams, one is along the X-axis and another one is along the Y-axis, I
ideal is the ideal into point, I
actual is the actual tool into point, and P1 to P4 is the position when the laser sensor is triggered.
After calculating the tool center offset, the runout angle can be obtained by performing a trigonometric calculation by the height difference.
Figure 6a represents the ideal tool coordinate system (
Cp) and the runout error of coordinate system (
Cp′). When the tool has a runout error, the base point of the tool on the flange coordinate system is defined as (
,
,
) and the projection angle is defined as
θy in Y-axis. As two laser sensor units are parallel to the X and Y axes of the coordinate system, then the tool contacts the X and Y laser four times during the linear motion of the laser device. The projection angle
θy can be found by Equation (6).
where ∆
x1 and ∆
x2 are the tool center offset value at plane one and plane two, respectively;
z1 and
z2 are the value of two planes in the
z-axis.
In order to express the relationship of rotation matrix and projection angle, this study uses the Euler angle of the X-Y-Z rotation sequence. The first rotation is defined as an angle
counterclockwise around the X-axis with rotation matrix,
, and the second rotation is counterclockwise rotating with an angle
around the Y-axis by matrix
. For the rotation of the Z-axis, it does not affect the error. The final rotation matrix (
) for the ideal tool coordinate system is shown as Equation (7):
Assume that there is a point
P in the ideal tool coordinate system and it will become point
Q after rotating to a new coordinate system. Then, position of
Q can be calculated and obtained. Accordingly, the rotation matrix of the current tool (
R) is derived by the initial tool rotation matrix (
R0) and the ideal tool coordinate system (
Rd) shown in Equation (8).
2.4. Offset Calibration
Figure 7 shows that
O,
O′, and
O″ are the ideal tool coordinate, runout tool coordinate, and runout with offset tool coordinate system, respectively.
Sc (
Xs, Ys, Zs) is the tool installed station, and
Pc (
X0, Y0, Z0),
Pc′ (
X0′,
Y0′,
Z0′), and
Pc″ (
X0″,
Y0″,
Z0″) are the original points of the ideal tool coordinate, runout tool coordinate, and runout with offset tool coordinate system, respectively.
According to the relationship between the coordinate systems, the relative equation can be derived as follows.
where
Zh is the distance between
Pc and
Sc and expressed as a spatial vector
ZT.
The calibration process is shown in
Figure 8. In the runout calibration, the actual tool information is obtained after two planes of motion and the tool center offset parameters can be obtained, which are then used to calculate the runout angle and rotation matrix. The first preliminary offset calibration is also performed. After completing the runout calibration, a second preliminary offset calibration is executed using the tool information obtained from the third plane motion to accurately calculate the X and Y axis offset parameters based on the tool coordinate system. The last process is the final offset calibration. The tool moves over the laser beam, triggering the laser sensor to go vertically down and find the
Z-axis parameters of the TCP according to the tool coordinate system.
In
Figure 8, the first preliminary offset calibration is performed after the 2nd plane movement is completed. The first preliminary offset calibration, which estimates the tool height
Zh, can be performed when the tool only has an offset. The second preliminary offset calibration is performed by deriving the tool offsets
δX and
δY from the tool center offset equation.
Figure 9 represents how the tool height
Zh is calculated.
Looking in from the positive direction of the Y-axis of the coordinates of the tool mounting point, where
O is the tool mounting station and the origin of the coordinate system, the coordinates of
are (0, 0,
Zh) and the coordinates of
are (
x′,
y′,
z′). Let the first plane of calibrated motion be
M1 and the second plane be
M2, where
intersects with plane
M1 at
and with plane
M2 at
,
intersects the plane
M1 at
,
intersects the plane
M2 at
, and the parameters ∆
x1, ∆
x2, ∆
y1, ∆
y1 have been obtained from Equation (6). Let the height from plane one to
, labeled
be ∆
H, and the height between plane one and plane two, labeled
be ∆
h. After defining the above information, the following Equations (12) and (13) can be obtained.
where
Zh is the tool height that needs to be derived; ∆
H and ∆
h is the parameter set by the user. Use space linear proportion and the center offset parameter, which is ∆
x1, ∆
x2, ∆
y1, ∆
y1. Then, through relational substitution
Z1 and
Z2 can be solved.
To express the spatial linear scale, the coordinates of at least two points in space must be known. Herby, assume there are two points, A (
x1,
y1,
z1) and B (
x2,
y2,
z2), the line
η between these two points can be expressed in the spatial linear scale as Equation (14).
Similarly, since ∆
x1, ∆
x2, ∆
y1, ∆
y1,
z1,
z2 can construct two points
and
, the linear
H is expressed by the spatial linear scale,
In this case, since the line
H passes through the tool mounting point, after substituting Equation (15) and combining Equation (13) with Equation (12), then we can obtain
Zh as Equation (16).
After the above calculation, it seems that the tool height Zh has been solved; however, a tool with offset error will result in a denominator equal to zero, while a tool with offset and offset error will result in a line H not passing through the tool mounting point O. Therefore, for runout error or runout plus offset error, the original tool height will be used directly as the tool length Zh.
The first preliminary offset calibration only roughly calculated the tool height, the runout plus offset error of the coordinates still can not be solved, so in the first preliminary offset calibration, use Zh generation back to Equation (11) to obtain the tool center point that is the current tool coordinate origin, set to , and the coordinates will be returned to the robot arm controller; the first preliminary offset calibration is completed.