1 Introduction

The parallel kinematics mechanisms (PKMs) which consist of a base, some legs, and a moving platform in a closed-chain configuration have been proposed and developed to achieve more accuracy in the precision manipulation. Furthermore, hybrid kinematics machines (HKMs) have been introduced and developed to integrate the advantages of both the serial kinematics mechanism (SKM) and PKM. Any of the three schemes can compose an HKM: (1) serially connecting two or more PKMs, (2) serially connecting a PKM with an SKM, or (3) serially combining two or more PKMs, or a PKM with an SKM, through a rigid connection. In the third scheme, the rigid connection is considered a type of serial connection. In some applications such as machining, a PKM is typically used together with an SKM or another PKM and therefore becomes an HKM. Moreover, more attention has been given to the use of lower degree-of-freedom (DOF) PKMs due to less complexity in their modeling. For a precision manipulation, an accurate pose of the moving platform is the aim to be achieved during its controlled motion. Since the control is commonly performed in the joint space, forward kinematics of the mechanism is required to transform the active joint positions to the pose of the moving platform. As the trajectory is commonly planned in the task space, inverse kinematics is needed to transform the planned trajectory to the joint space in which the control is applied. Consequently, the accuracy of the kinematics affects positioning accuracy. A kinematic calibration is commonly conducted to estimate the kinematic parameters accurately and subsequently, a compensation is performed by correcting the software, which is, in this case, the kinematics of the machine.

In general, the kinematic calibration can be either an external calibration, a constrained calibration, or a self-calibration [1]. The external and constrained calibration can be conducted offline, and the number of calibration poses is usually limited. Here the number and the choice of the calibration poses become an issue. The number of the calibration poses should be adequate, whereas the selection of the calibration poses is shown to be vital as it affects the quality of the calibration. According to Bai and Theo [2], the optimal number of calibration poses is 10 or more. Moreover, a full pose measurement typically requires less number of calibration poses to get an accurate estimation [1].

In a nutshell, the kinematic calibration is performed by firstly determining the parameters to be calibrated, followed by modeling, measurement (data collection), identification (estimation), and compensation (correction) [3, 4]. Various algorithms in the identification stage are used to minimize the residual error. To mention some of them in the kinematic calibration of PKMs and HKMs, Vischer and Clavel [5] used the Levenberg–Marquardt algorithm for kinematic calibration of a Delta robot. Yang et al. [6] used a linear least squares algorithm for kinematic calibration of a spatial 3-DOF PKM. Patel and Ehmann [7] as well as Iurascu and Park [8] applied the total least squares algorithm for kinematic calibration of PKMs. Yu [9] used nonlinear least squares for kinematic calibration of a hexapod. Wang et al. [10] used minimal linear combinations of error parameters for kinematic calibration of a spatial 3-DOF PKM in a five-axis HKM milling machine. Wang et al. [11] applied the Markov Chain Monte Carlo method for kinematic calibration of an HKM. Liu et al. [12] proposed the use of the genetic algorithm for kinematic calibration of a Stewart platform while Fan et al. [13] proposed it for an HKM polishing machine.

While researchers [14, 15] investigate the kinematic calibration of five-axis SKMs, this paper discusses the kinematic calibration of a five-axis HKM. This paper uses an external kinematic calibration of an HKM machine tool utilizing two different identification algorithms, namely a nonlinear least squares algorithm and an iterative linear least squares algorithm. In particular, a subset selection approach is proposed to overcome the rank deficiency in the nonlinear least squares algorithm. Furthermore, an iteration is introduced to be used in the linear least squares to achieve a solution convergence. This scheme is the first novelty of this paper. The implementation of the two algorithms as well as a comparison of the estimation accuracy provided by both algorithms is presented. This comparative study is another contribution of this paper. The HKM machine tool was built by conjugating two lower-DOF, planar PKMs having a similar topology but different geometric parameters. The planar state of the PKMs as will be shown results in a configuration degeneracy which indicates unidentified parameters in the off-plane direction of the mechanism. A physical adjustment should be conducted to impose a certain value, typically zero for convenience, of the unidentified parameters. The implementation of the mentioned algorithms to this new topology of HKM composed of planar PKMs is another novelty of this paper.

Laser tracker, which is capable of providing a full pose measurement, was used to conduct the kinematic calibration. The laser tracker offers a high accuracy pose measurement with easy use, although it is relatively expensive [16]. It was mentioned earlier that a minimum of ten calibration poses should be used while a full pose measurement can reduce the required number of calibration poses. Accordingly, a full pose measurement of twelve unique poses is taken in this work. The unrepeated coordinate values for each DOF of the poses provide the uniqueness of the poses. The geometric parameters of the PKMs, which include the length of all the legs and the moving platform as well as the position of the joints connecting the legs with the moving platform, and the actual relative position between the two conjugated PKMs are the parameters to be calibrated. The model function to be used in the calibration is the forward kinematics of the machine’s mechanisms. Finally, the accuracy improvement was evaluated after performing the compensation.

This paper is organized into several sections. Section 1 gives an introduction to the paper and describes its novelty. Section 2 provides the kinematics of the individual mechanism and subsequently presents the solution of its forward kinematics by using both Euler angles and quaternions representations. The quaternions are used to overcome the formulation singularity. Section 3 presents the hand-eye and robot-world calibration which should be performed before the calibration of the mechanism geometric parameters. Section 4 presents the kinematics of the complete mechanism with the external measurement device in the setup. Section 5 presents the use of nonlinear least squares to refine the hand-eye and robot-world calibration and to estimate the mechanism geometric parameters. Section 6 presents the use of iterative linear least squares to estimate the mechanism geometric parameters. In Sect. 7, the estimates of the mechanism geometric parameters obtained by both the nonlinear least squares and the iterative linear least squares are used for compensation. The accuracy of the position tracking corresponding to the estimates obtained by the two algorithms is compared. Finally, Sect. 8 concludes the paper.

2 Kinematics of the Individual Mechanism

2.1 Kinematics Equations

The HKM calibrated in this work is used for five-axis machining and composed by the third scheme of hybridization. A PKM which serves as the workpiece platform (lower platform) is conjugated with another PKM as the spindle platform (upper platform). Both the lower and upper platforms use planar PKMs because they are easier to design than spatial PKMs and more geometrical constraints on the DOFs will minimize the error due to joints’ errors. The lower and upper platforms use an identical PKM topology called the 3PRR, planar PKM as depicted in Fig. 1a and optimized to a simpler topology as shown in Fig. 1b. This PKM has three DOFs which adequately enable required general motion consisting of translation in X-axis, translation in Y-axis, and rotation about the Z-axis, where the three axes are orthogonal and follow the right-hand rule. It consists of a fixed base, three legs, a moving platform, and several joints. The joints used in an order starting from the fixed base are prismatic (P) joints, revolute (R) joints which connect the sliders with the legs, and other revolute (R) joints which connect the legs with the moving platform. Therefore, the mechanism is called the 3PRR PKM. The prismatic joints are actuated, have translation along X-axis, and are implemented by using sliders moving along the base through guideway. The use of the sliders creates more workspace and enables the moving platform to move upward and downward as well as to tilt. The actuation is provided by linear motors which give more accuracy compared with pneumatic/hydraulic pistons and lead screws.

Fig. 1
figure 1

Schematic of the a general and b optimized mechanism topology (with the Z-axis perpendicular to the paper through the origin)

In this proposed mechanism, three legs are required to constrain the mechanism fully. Furthermore, two neighboring legs are maintained in a crossing configuration to avoid singularity as well as maximize the useful workspace and the stiffness of the mechanism. Point (x, y) in the moving platform is used to evaluate the general motion of the moving platform. Any other point in the moving platform can also be used as the moving platform is rigid. The selection of point (x, y) is mainly for more convenience. Besides, the orientation of the platform is defined as the angle made by the platform with respect to the fixed base. Upon the dimensional optimization of the mechanism by considering its workspace, stiffness magnitude, and stiffness uniformity, the mechanism is simplified to a topology with two coincident upper joints as shown in Fig. 1b. As a result, xp2 = xp3 = xp. The optimization procedure is discussed in [17]. Figure 2 shows the hybrid scheme of the machine. The conjugation of the two planar PKMs in perpendicular directions easily creates the required spatial workspace and provides six DOFs.

Fig. 2
figure 2

The prototype of the hybrid kinematics machine

The tool spindle is oriented horizontally to avoid redundancy between the rotation of the spindle and the rotation of the upper mechanism. This results in the proposed five-axis machine configuration. The five-axis machine has translational DOFs in x, y, and z directions as well as rotational DOFs about the Z and Y axes. Moreover, there is a redundancy between the two mechanisms in the X translational motion. This redundancy is advantageous as it provides an additional workspace in the x-direction. However, this also results in more complexity in determining which mechanism to move when a translation in the x-direction is required. In this case, one can pre-determine which mechanism is fixed while another mechanism is moved. A more systematic approach is a determination using an optimization scheme based on a defined objective to be optimized, such as energy consumption (control effort), accuracy, or stiffness.

The kinematics equations of the proposed parallel mechanism can be obtained easily by the algebraic approach. According to the geometry of the mechanism shown in Fig. 1, the following geometric relations are found for the legs:

$$L_{1}^{2} = (x + x_{p2} \cos \theta - x_{1} )^{2} + (y + x_{p2} \sin \theta )^{2}$$
(1)
$$L_{2}^{2} = (x - x_{2} )^{2} + (y)^{2}$$
(2)
$$L_{3}^{2} = (x + x_{p3} \cos \theta - x_{3} )^{2} + (y + x_{p3} \sin \theta )^{2}$$
(3)

In this paper, only the forward kinematics of the mechanism is discussed as it is required in the kinematic calibration.

The kinematics of the mechanism has the following constraints:

$$\begin{aligned} & 0 \le L_{1} \le y_{\hbox{max} } \\ & 0 \le L_{2} \le y_{\hbox{max} } \\ & 0 \le L_{3} \le y_{\hbox{max} } \\ & 0 \le x_{p2} \le x_{p3} \le x_{\hbox{max} } \\ & L_{1} + L_{2} - x_{p2} \le x_{\hbox{max} } \\ & L_{1} + L_{3} - x_{p2} + x_{p3} \le x_{\hbox{max} } \\ \end{aligned}$$
(4)

where ymax and xmax are the vertical and horizontal limits of the machine volume having the numerical values of 1200 mm and 1700 mm, respectively. Those constraints indicate that the mechanism should always be inside the specified machine volume, the sliders should not interfere with each other, and two adjacent legs must always be crossing each other.

2.2 Forward Kinematics with Known θ

The complete forward kinematics of the mechanism at hand which includes the determination of the angle θ can be seen in [17]. In this paper, only the determination of x and y given the angle θ is presented for the kinematic calibration purpose. In the case of a known θ, the value of x and y can be obtained through a more straightforward derivation. Let us rearrange the kinematics Eqs. (1), (2), and (3) in the following set of equations:

$$\begin{aligned} & x^{2} + y^{2} + 2xx_{p2} \cos \theta + 2yx_{p2} \sin \theta \\ & - 2x_{1} x - 2x_{1} x_{p2} \cos \theta = L_{1}^{2} - x_{1}^{2} - x_{p2}^{2} = c_{1} \\ \end{aligned}$$
(5)
$$x^{2} + y^{2} - 2x_{2} x = L_{2}^{2} - x_{2}^{2} = c_{2}$$
(6)
$$\begin{aligned} & x^{2} + y^{2} + 2xx_{p3} \cos \theta + 2yx_{p3} \sin \theta \hfill \\ &- 2x_{3} x - 2x_{3} x_{p3} \cos \theta = L_{3}^{2} - x_{3}^{2} - x_{p3}^{2} = c_{3} \hfill \\ \end{aligned}$$
(7)

Collecting x and y in (5)–(7) in the left-hand sides yields:

$$\begin{aligned} x^{2} - (2x_{1} + 2x_{p2} \cos \theta )x + y^{2} + (2x_{p2} \sin \theta )y \hfill \\ = 2x_{1} x_{p2} \cos \theta + L_{1}^{2} - x_{1}^{2} - x_{p2}^{2} = c_{4} \hfill \\ \end{aligned}$$
(8)
$$x^{2} - (2x_{2} )x + y^{2} = L_{2}^{2} - x_{2}^{2} = c_{2}$$
(9)
$$\begin{aligned} x^{2} - (2x_{3} + 2x_{p3} \cos \theta )x + y^{2} + (2x_{p3} \sin \theta )y \hfill \\ = 2x_{3} x_{p3} \cos \theta + L_{3}^{2} - x_{3}^{2} - x_{p3}^{2} = c_{5} \hfill \\ \end{aligned}$$
(10)

Furthermore, subtracting (9) from (8) and (10) yields a more compact set of equations as follows:

$$\begin{aligned} & ( - 2x_{1} )x + (2x_{p2} \cos \theta )x + (2x_{2} )x \\ & \quad + \;(2x_{p2} \sin \theta )y = ax + by = c_{4} - c_{2} = c \hfill \\ \end{aligned}$$
(11)
$$x^{2} - (2x_{2} )x + y^{2} = L_{2}^{2} - x_{2}^{2} = c_{2}$$
(12)

where

$$\begin{aligned} a &= - 2x_{1} + 2x_{2} + 2x_{p2} \cos \theta \\ b &= 2x_{p2} \sin \theta \\ c &= c_{4} - c_{2} \\ d &= - 2x_{3} + 2x_{2} + 2x_{p3} \cos \theta \\ e &= 2x_{p3} \sin \theta \\ f &= c_{5} - c_{2} \\ \end{aligned}$$

Equations (11) and (12) have to be solved simultaneously as x and y exist in both of the equations. The solution is given by:

$$x = \left( {\frac{{f - \frac{ec}{b}}}{{d - \frac{ea}{b}}}} \right)$$
(13)
$$y = \frac{c - ax}{b}$$
(14)

2.3 Forward Kinematics Using Quaternion

Observing the solution of the forward kinematics given in (13) and (14), we realize that division by zero occurs when θ = 0 and therefore b = 0. In this situation, x still can be solved by using (13) by converting zero θ to a minimal value near (above or under) zero. The effect of the closeness of θ to zero can be evaluated by observing the value of the solution, i.e. x and y, as well as the corresponding links’ dimension if we apply the solution. The latter shows a more obvious effect. After scanning some values of θ close to zero, it is shown that θ should not be larger than 1 × 10−5. This will give an accurate solution to four decimal places. Using a closer value of θ to zero increases further the accuracy. Table 1 shows the values of the link lengths corresponding to different values of θ near zero, given the expected actual values of L1= 600 mm, L2 = 600 mm, and L3 = 750 mm.

Table 1 The link lengths corresponding to values of θ near zero when solving for x

On the other hand, division by zero in (14) is very sensitive. Even a minimal value of θ replacing an exact zero θ leads to a significant error in the solution, i.e. the value of y. Therefore, (14) cannot be used to solve for y in the case of zero tilting angle of the moving platform. In such a case, either one of the following two ways can be used. First, using an iterative technique by spanning over possible values of y and checking with the inverse kinematics. For any set of x, y, and θ, it should be observed if it retrieves a known set of x1, x2, and x3. However, the accuracy of this technique is affected by the interval of y used in the iteration. Besides, this technique is computationally intensive. Second, solving the forward kinematics by using quaternion. The reason for using the quaternion is because a formulation singularity causes this problem due to the use of Euler angle θ. Therefore, avoiding using the Euler angle by using the quaternion will avoid the formulation singularity.

Recall the mechanism at hand defined by some position vectors as shown in Fig. 3. The geometric relations in the mechanism can also be written using a vectorial approach as follows:

$$\begin{aligned} r_{p} &= X_{2} + R_{2} S_{2} \\ r_{p} &= X_{1} + R_{1} S_{1} - R_{4} S_{p2} \\ r_{p} &= X_{3} + R_{3} S_{3} - R_{4} S_{p3} \\ \end{aligned}$$
(15)

Using Euler angles, (15) can be expanded to the following:

$$\begin{aligned} x &= x_{2} + L_{2} \cos \alpha_{2} \\ y &= L_{2} \sin \alpha_{2} \\ x &= x_{1} + L_{1} \cos \alpha_{1} - x_{p2} \cos \theta \\ y &= L_{1} \sin \alpha_{1} - x_{p2} \sin \theta \\ x &= x_{3} + L_{3} \cos \alpha_{3} - x_{p3} \cos \theta \\ y &= L_{3} \sin \alpha_{3} - x_{p3} \sin \theta \\ \end{aligned}$$
(16)
Fig. 3
figure 3

The position vectors defined in the mechanism

From (16), we know that we have six equations with nine variables, i.e. x, y, θ, α1, α2, α3, x1, x2, and x3. However, three variables among the nine variables are known. In other words, we have six equations with six unknowns.

A quaternion can be written as:

$$q = q_{0} + q_{1} \hat{i} + q_{2} \hat{j} + q_{3} \hat{k} = \left[ {\begin{array}{*{20}c} {q_{0} } & {q_{1} } & {q_{2} } & {q_{3} } \\ \end{array} } \right]^{T}$$
(17)

where i, j, and k are the unit vectors in x, y, and z directions, respectively.

A rotation in a three-dimensional space can be represented by a rotation matrix R in terms of quaternions as follows:

$$R = \left[ {\begin{array}{*{20}c} {1 - 2\left( {q_{2}^{2} + q_{3}^{2} } \right)} & {2\left( {q_{1} q_{2} + q_{0} q_{3} } \right)} & {2\left( {q_{0} q_{2} - q_{1} q_{3} } \right)} \\ {2\left( {q_{1} q_{2} + q_{0} q_{3} } \right)} & {1 - 2\left( {q_{1}^{2} + q_{3}^{2} } \right)} & {2\left( {q_{2} q_{3} - q_{0} q_{1} } \right)} \\ {2\left( {q_{1} q_{3} - q_{0} q_{2} } \right)} & {2\left( {q_{0} q_{1} - q_{2} q_{3} } \right)} & {1 - 2\left( {q_{1}^{2} + q_{2}^{2} } \right)} \\ \end{array} } \right]$$
(18)

The rotation of the legs and the moving platform of the mechanism, which is about the Z-axis, can be written in the quaternion notation in terms of the Euler angles α1, α2, α3, and θ as follows:

$$q\left( {\alpha_{i} } \right) = \left[ {\begin{array}{*{20}c} {q_{0} (\alpha_{i} )} \\ {q_{1} (\alpha_{i} )} \\ {q_{2} (\alpha_{i} )} \\ {q_{3} (\alpha_{i} )} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\cos \left( {\alpha_{i} /2} \right)} \\ 0 \\ 0 \\ {\sin \left( {\alpha_{i} /2} \right)} \\ \end{array} } \right];\quad i = 1,2,3$$
(19)
$$q\left( \theta \right) = \left[ {\begin{array}{*{20}c} {q_{0} (\theta )} \\ {q_{1} (\theta )} \\ {q_{2} (\theta )} \\ {q_{3} (\theta )} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\cos \left( {\theta /2} \right)} \\ 0 \\ 0 \\ {\sin \left( {\theta /2} \right)} \\ \end{array} } \right]$$
(20)

Substituting any of (19)–(20) into (18) as they have a similar form to get the corresponding rotation matrix, the rotation about the Z-axis can be written in a rotation matrix in terms of the quaternions as follows:

$$R = \left[ {\begin{array}{*{20}c} {1 - 2q_{3}^{2} } & { - 2q_{0} q_{3} } & 0 \\ {2q_{0} q_{3} } & {1 - 2q_{3}^{2} } & 0 \\ 0 & 0 & 1 \\ \end{array} } \right]$$
(21)

Now we can express the geometric relations (16) by utilizing the rotation matrices in terms of the quaternions (21):

$$x = x_{2} + L_{2} (1 - 2q_{3} (\alpha_{2} )^{2} )$$
(22)
$$y = 2L_{2} q_{0} (\alpha_{2} )q_{3} (\alpha_{2} )$$
(23)
$$x = x_{1} + L_{1} (1 - 2q_{3} (\alpha_{1} )^{2} ) - x_{p2} (1 - 2q_{3} (\theta )^{2} )$$
(24)
$$y = 2L_{1} q_{0} (\alpha_{1} )q_{3} (\alpha_{1} ) - 2x_{p2} q_{0} (\theta )q_{3} (\theta )$$
(25)
$$x = x_{3} + L_{3} (1 - 2q_{3} (\alpha_{3} )^{2} ) - x_{p3} (1 - 2q_{3} (\theta )^{2} )$$
(26)
$$y = 2L_{3} q_{0} (\alpha_{3} )q_{3} (\alpha_{3} ) - 2x_{p3} q_{0} (\theta )q_{3} (\theta )$$
(27)

Furthermore, we can write the unit norm constraints of the quaternions as follows:

$$q_{0} (\alpha_{i} )^{2} + q_{1} (\alpha_{i} )^{2} + q_{2} (\alpha_{i} )^{2} + q_{3} (\alpha_{i} )^{2} = 1;\begin{array}{*{20}c} {} \\ \end{array} i = 1,2,3$$
(28)
$$q_{0} (\theta )^{2} + q_{1} (\theta )^{2} + q_{2} (\theta )^{2} + q_{3} (\theta )^{2} = 1$$
(29)

Since in this case:

$$\begin{aligned} & q_{1} (\alpha_{1} ) = q_{2} (\alpha_{1} ) = q_{1} (\alpha_{2} ) = q_{2} (\alpha_{2} ) \\ & \quad = q_{1} (\alpha_{3} ) = q_{2} (\alpha_{3} ) = q_{1} (\theta ) = q_{2} (\theta ) = 0 \\ \end{aligned}$$
(30)

then we can rewrite (28)–(29) as follows:

$$q_{0} (\alpha_{i} )^{2} + q_{3} (\alpha_{i} )^{2} = 1;\begin{array}{*{20}c} {} & {} \\ \end{array} i = 1,2,3$$
(31)
$$q_{0} (\theta )^{2} + q_{3} (\theta )^{2} = 1$$
(32)

To this point, we can see that we have ten equations with thirteen variables, i.e. x, y, q0(α1), q3(α1), q0(α2), q3(α2), q0(α3), q3(α3), q0(θ), q3(θ), x1, x2, and x3. However, three variables among the 13 variables are known. In other words, we have ten equations with ten unknowns.

For ease, x can be computed using (13). When θ is zero, we can replace it with a small value near zero to accurately compute x. Once θ and x are obtained, we can use any pair of (22)–(23), (24)–(25), or (26) – (27). Using (22)–(23) is easier since we do not involve q3(θ) for which we need to convert θ to get q3(θ). From (22), we have:

$$q_{3} (\alpha_{2} ) = \sqrt {\left( {\frac{1}{2} - \frac{{x - x_{2} }}{{2L_{2} }}} \right)}$$
(33)

Substituting (33) into (31), we obtain the following:

$$q_{0} (\alpha_{2} ) = \sqrt {\left( {\frac{1}{2} + \frac{{x - x_{2} }}{{2L_{2} }}} \right)}$$
(34)

Now we can get y in terms of the knowns by substituting (34) into (23):

$$y = \sqrt {\left( {L_{2}^{2} - \left( {x - x_{2} } \right)^{2} } \right)}$$
(35)

It is worth mentioning that (35) applies for all values of θ, not only for θ equal or close to zero. Therefore, it is more practical to use (35) instead of (14) to compute y for all cases.

3 Hand-Eye and Robot-World Calibration

The kinematic calibration presented in this paper utilized a Leica absolute laser tracker in combination with a T-Mac TMC30-F reflector to measure the platform poses. The laser tracker head is automatically controlled to track the pose of the reflector rigidly attached on the platform. Therefore, the laser tracker measures the pose of the reflector instead of the platform. The use of a similar laser tracker for the external kinematic calibration of a serial kinematics mechanism can be found in [18]. The laser tracker in combination with the reflector used in this work is capable of measuring all rigid body DOFs which include both position and orientation, i.e. three translational DOFs and three rotational DOFs. Figure 4 shows the local frame of the reflector. As shown in the figure, the origin of the reflector frame takes place at the center of the reflector prism whereas the three axes of the reflector frame are aligned with the geometry of the reflector. The accuracy of the laser tracker is ± 15 μm for the position and 0.01 degree for the rotation.

Fig. 4
figure 4

The T-Mac TMC30-F reflector and its local frame

Since the laser tracker is an external device, the reflector pose is provided with respect to the measurement frame fixed to the laser tracker frame. Figure 5 depicts the transformations among the machine base frame FB, the platform frame FP, the measurement frame FM, and the reflector frame Fr. T1 is the transformation from the machine base frame to the platform. This is given by the forward kinematics of the mechanism. T2 is the transformation from the measurement frame to the reflector frame. X1 is the transformation from the reflector frame to the platform, whereas X2 is the transformation from the measurement frame to the machine base frame. The platform or end-effector is commonly called a hand whereas the reflector is called an eye. A calibration to estimate the transformation X1 is accordingly called the hand-eye calibration. The measurement frame is also commonly called the world frame and consequently a calibration to estimate the transformation X2 is usually called the robot-world calibration. Since the laser tracker at hand is capable of providing the six-DOF pose of the reflector, T2 is wholly known. Unfortunately, X1 and X2 are unknown. As a result, they should be estimated before calibrating the mechanism.

Fig. 5
figure 5

Transformations T1, T2, X1, and X2

To solve for X1 and X2, at least three different poses of the mechanism should be measured and T1 should be available. In this case, T1 is obtained based on the nominal values of the mechanism geometry. Hence, the estimation of X1 and X2 assumes that the nominal values of the mechanism geometry are good enough. These nominal values are to be calibrated later based on the obtained X1 and X2. The estimation of X1 and X2 can be classified into two broad categories: separable (sequential) and simultaneous techniques. The former techniques include [19,20,21,22,23] whereas the latter techniques include [24,25,26,27,28,29,30,31]. In the former techniques, X1 is first obtained and subsequently, X2 is computed based on the obtained X1. This approach is more straightforward but gives a less precise solution. On the other hand, the latter techniques estimate both X1 and X2 simultaneously. In this work, the former approach is applied only to obtain the initial values for the next algorithm proposed to refine the solution.

Let T1, T2, X1, and X2 be homogeneous transformation matrices which contain both rotation and translation components. The estimation of X1 can be derived based on the following relation among the transformation matrices:

$$T_{2} X_{1} = X_{2} T_{1}$$
(36)

For a pair of mechanism poses as illustrated in Fig. 6, we have the following:

$$T_{21} X_{1} = X_{2} T_{11}$$
(37a)
$$T_{22} X_{1} = X_{2} T_{12}$$
(37b)
Fig. 6
figure 6

Transformations in a pair of mechanism poses

It can be observed from Fig. 6 that X1 and X2 are constant, whereas T1 and T2 change with the mechanism pose.

Upon manipulating (37a) and (37b), we have:

$$AX_{1} = X_{1} B$$
(38)

where

$$A = T_{22}^{ - 1} T_{21} = \left[ {\begin{array}{*{20}c} {R_{A} } & {t_{A} } \\ 0 & 1 \\ \end{array} } \right]$$
(39)
$$B = T_{12}^{ - 1} T_{11} = \left[ {\begin{array}{*{20}c} {R_{B} } & {t_{B} } \\ 0 & 1 \\ \end{array} } \right]$$
(40)

Notice that A and B are homogeneous transformation matrices. RA and RB are rotation matrices whereas tA and tB are position vectors. Equation (38), commonly known as AX = XB problem, is the hand-eye calibration problem.

A separable closed-form hand-eye calibration following [19] is employed here. Instead of describing the hand-eye calibration procedure in a derivation format, the procedure is described briefly here in a sequential manner as the following:

  • Step 1 Find the transformation T1 of two different poses. This is obtained by the forward kinematics of the mechanism using the nominal values of the mechanism geometry, namely L1, L2, L3, xp2, and xp3.

  • Step 2 Find the transformation T2 of the two poses. This is given directly by the measurement of the full pose of the reflector by using the laser tracker. In this work, the measurement of the reflector orientation is provided in quaternions.

  • Step 3 Compute the matrices A and B for the two poses by using (39) and (40).

  • Step 4 Convert the rotation matrices RA and RB into an axis-angle representation defined by a rotation angle α and a rotation axis (n1, n2, n3).

  • Step 5 Define \(\bar{P}_{A}\) and \(\bar{P}_{B}\) as follows:

    $$\bar{P}_{A} = 2\sin \left( {\frac{{\alpha^{(A)} }}{2}} \right)\left[ {\begin{array}{*{20}c} {n_{1}^{(A)} } \\ {n_{2}^{(A)} } \\ {n_{3}^{(A)} } \\ \end{array} } \right];\quad 0 \le \alpha^{(A)} \le \pi$$
    (41)
    $$\bar{P}_{B} = 2\sin \left( {\frac{{\alpha^{(B)} }}{2}} \right)\left[ {\begin{array}{*{20}c} {n_{1}^{(B)} } \\ {n_{2}^{(B)} } \\ {n_{3}^{(B)} } \\ \end{array} } \right];\quad 0 \le \alpha^{(B)} \le \pi$$
    (42)
  • Step 6 Define υ and S as follows:

    $$\upsilon = \left[ {\begin{array}{*{20}c} {\upsilon_{x} } \\ {\upsilon_{y} } \\ {\upsilon_{z} } \\ \end{array} } \right] = \bar{P}_{A} + \bar{P}_{B}$$
    (43)
    $$S = skew(\upsilon ) = \left[ {\begin{array}{*{20}c} 0 & { - \upsilon_{z} } & {\upsilon_{y} } \\ {\upsilon_{z} } & 0 & { - \upsilon_{x} } \\ { - \upsilon_{y} } & {\upsilon_{x} } & 0 \\ \end{array} } \right]$$
    (44)

Step 7 We have the following linear system:

$$S\bar{\bar{P}}_{{X_{1} }} = \bar{P}_{A} - \bar{P}_{B}$$
(45)

With only a pair of poses, this linear system is singular. Therefore, at least two pairs of poses, i.e. three different poses, are required. Perform Step 1 to Step 7 for all n poses and accordingly stack (45) from all pairs of poses to compose the following overdetermined system:

$$\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{S} \bar{\bar{P}}_{{X_{1} }} = \left[ {\begin{array}{*{20}c} {S_{1} } \\ {S_{2} } \\ \vdots \\ {S_{n} } \\ \end{array} } \right] \bar{\bar{P}}_{{X_{1} }} = b = \left[ {\begin{array}{*{20}c} {\left( {\bar{P}_{A} - \bar{P}_{B} } \right)_{1} } \\ {\left( {\bar{P}_{A} - \bar{P}_{B} } \right)_{2} } \\ \vdots \\ {\left( {\bar{P}_{A} - \bar{P}_{B} } \right)_{n} } \\ \end{array} } \right]$$
(46)

Solve for \(\bar{\bar{P}}_{{X_{1} }}\) by using linear least squares:

$$\bar{\bar{P}}_{{X_{1} }} = \left( {\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{S}^{T} \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{S} } \right)^{ - 1} \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{S}^{T} b$$
(47)
  • Step 8 Compute \(\bar{P}_{{X_{1} }}\) as follows:

    $$\bar{P}_{{X_{1} }} = \frac{{2\bar{\bar{P}}_{{X_{1} }} }}{{\sqrt {1 + \left\| {\bar{\bar{P}}_{{X_{1} }} } \right\|^{2} } }}$$
    (48)
  • Step 9 Convert \(\bar{P}_{{X_{1} }}\) to the rotation matrix of the transformation X1, namely \(R_{{X_{1} }}\):

    $$R_{{X_{1} }} = \left( {1 - \frac{{\left\| {\bar{P}_{{X_{1} }} } \right\|^{2} }}{2}} \right) I + \frac{1}{2}\left( {\bar{P}_{{X_{1} }} \bar{P}_{{X_{1} }}^{T} + \sqrt {4 - \left\| {\bar{P}_{{X_{1} }} } \right\|^{2} } skew\left( {\bar{P}_{{X_{1} }} } \right)} \right)$$
    (49)

    where I is an identity matrix whereas \(skew\left( {\bar{P}_{{X_{1} }} } \right)\) is a skew-symmetric matrix defined in a similar fashion to (44). To this point, we solve for the rotation matrix of the transformation X1.

  • Step 10: Define a linear system involving the translation vector of the transformation X1, namely tX1, as follows:

    $$Gt_{{X_{1} }} = \left( {R_{B} - I} \right)t_{{X_{1} }} = d = R_{{X_{1} }} t_{A} - t_{B}$$
    (50)

Solve the linear system (50) by using linear least squares:

$$t_{{X_{1} }} = \left( {G^{T} G} \right)^{ - 1} G^{T} d$$
(51)

Equations (50) and (51) hold in general for three-dimensional Euclidean space. Since the mechanism at hand is planar, the dimensions of (50) and (51) should be reduced to a two-dimensional Euclidean space. Having the mechanism on the XY plane, the elements corresponding to the Z-axis in (50) and (51) should be suppressed. If it is not suppressed and accordingly x, y, and z elements of tX1 are all to be solved, the system will be rank deficient. This indicates a configuration degeneracy. Physically, this means that there is no reference in the z-direction to which the z element of tX1 should be defined. As a result, an infinite number of possible values of z exist.

Equations (49) and (51) completely define the transformation matrix X1:

$$X_{1} = \left[ {\begin{array}{*{20}c} {R_{{X_{1} }} } & {t_{{X_{1} }} } \\ 0 & 1 \\ \end{array} } \right]$$
(52)

where, in the case of planar mechanism working on the XY plane:

$$t_{{X_{1} }} = \left[ {\begin{array}{*{20}c} {t_{{X_{1} (x)}} } \\ {t_{{X_{1} (y)}} } \\ 0 \\ \end{array} } \right]$$
(53)

Equation (53) also implies that the zero coordinate of the Z-axis is aligned with the reflector.

After the hand-eye transformation X1 has been estimated, the robot-world transformation X2 can be easily estimated by rearranging (36):

$$X_{2} = T_{2} X_{1} T_{1}^{ - 1}$$
(54)

Using n different mechanism poses in the measurement, we accordingly have n different T1 and T2. As a result, there will be n different X2. To obtain a single X2, which is expected to be constant, we average the elements of T1 and T2 in an element-wise manner to get an averaged, constant X2.

It is worth mentioning that the selected poses should be completely different from each other in all coordinates in order to get the best estimates. In this case, the x, y, and θ values should be completely different among the poses. In this work, twelve experimental measurement data was carefully taken in which the x, y, and θ values of the poses are entirely different.

4 Kinematics of the Combined Mechanism with the External Measurement Device

The pose measurement is always provided with respect to the measurement frame. Since the kinematic calibration uses an external pose-measurement device, an extended kinematic model should be established to include the hand-eye and robot-world transformations as described earlier. A homogeneous transformation is very convenient to be used to represent this kinematics. Figure 7 shows all the homogeneous transformation matrices in the combined mechanism. For convenience, a similar matrix notation is used for the upper mechanism. The asterisk superscripts indicate transformation matrices belonging to the upper mechanism.

Fig. 7
figure 7

Homogeneous transformations in the combined mechanism with a laser tracker and reflectors, namely T1, T2, X1, X2 (for the lower mechanism), \(T_{1}^{*}, T_{2}^{*}, X_{1}^{*}, X_{2}^{*}\) (for the upper mechanism), and X0 which connects both mechanisms

The transformation among the laser tracker, the reflector, and the lower mechanism has been described earlier in (36). Similarly, the homogeneous transformation of the laser tracker, the reflector, and the upper mechanism can be written as:

$$T_{2}^{*} X_{1}^{*} = X_{2}^{*} T_{1}^{*}$$
(55)

Alternatively, the following homogeneous transformation can also be used:

$$T_{2}^{*} X_{1}^{*} = X_{2} X_{0} T_{1}^{*}$$
(56)

where X0 denotes the homogeneous transformation from the machine base frame to the base frame of the upper mechanism. Using (56), we have:

$$T_{2}^{*} = X_{2} X_{0} T_{1}^{*} \left( {X_{1}^{*} } \right)^{ - 1}$$
(57)
$$T_{1}^{*} = \left( {X_{2} X_{0} } \right)^{ - 1} T_{2}^{*} X_{1}^{*}$$
(58)

Another way to express the kinematics involving the laser tracker and the reflector is by using vector notation. Figure 8 shows the position vectors in the combined mechanism. The superscript indicates the frame in which a position vector r is expressed, whereas the subscript indicates a point defined by the position vector. The subscripts and superscripts M, B, O, P, and r respectively represent the measurement frame, machine base frame, base frame of the upper mechanism, platform frame, and reflector frame. For example, a notation \(r_{B}^{M}\) denotes the position vector of the machine base frame origin B with respect to the measurement frame M.

Fig. 8
figure 8

Position vectors in the combined mechanism with a laser tracker and reflectors, where the subscripts indicate the points of interest whereas the superscripts indicate the reference frames

The additional subscripts L and U indicate the lower and upper mechanism, respectively. The transformation between frames may involve a rotation matrix R which represents the rotational transformation between two frames. Similarly, a notation \(R_{B}^{M}\), as an example, denotes the rotation matrix from the machine base frame B to the measurement frame M.

For more clarity, mainly when dealing with rotational transformation, Fig. 9 shows only the orientation of all the frames. The drawn axes indicate the positive directions of the axes. The orientation of the axes shown in this figure follows the right-hand rule in which the cross product between the X and Y axes gives the direction of the Z-axis. For more convenience, the base frame of the upper mechanism is oriented such that its X and Y axes create the planar workspace of the upper mechanism. Accordingly, the positive Z-axis is pointing downward. Using such an orientation, the inverse and forward kinematics of both the lower and upper mechanisms can be written on the XY plane.

Fig. 9
figure 9

Orientation of the frames (drawn axes indicate positive directions) namely the measurement frame M, the lower machine base frame B, the upper machine base frame O, the lower platform frame P,L, the upper platform frame P,U, the lower reflector frame r,L, and the upper reflector frame r,U

Since the mechanisms are planar, by referring to Fig. 6, their rotation about their base frames can be represented by an elementary rotation matrix about the Z-axis, i.e.:

$$R_{P,L}^{B} = R_{z} \left( {\theta_{L} } \right)$$
(59)
$$R_{P,U}^{O} = R_{z} \left( {\theta_{U} } \right)$$
(60)

where Rz is an elementary rotation matrix about Z-axis whereas θL and θU are the rotation angles of the lower and upper mechanisms, respectively.

The reflectors are attached to the platforms, as shown in Fig. 6, such that:

$$R_{r,L}^{P,L} = I$$
(61)
$$R_{r,U}^{P,U} = R_{x} \left( { - \frac{\pi }{2}} \right)$$
(62)

where I and Rx are an identity matrix and an elementary rotation matrix about the X-axis, respectively. This means that the lower reflector frame is aligned with the lower platform frame whereas the upper reflector frame is also aligned but rotated about the X-axis by –π/2 rad. This arrangement can be made with the aid of measurement devices such as digital calipers, digital depth gage, and precision square.

The position of the reflector mounted on the lower platform can be expressed in the measurement frame as follows:

$$r_{r,L}^{M} = r_{B}^{M} + R_{B}^{M} r_{r,L}^{B} = r_{B}^{M} + R_{B}^{M} \left( {r_{P,L}^{B} + R_{P,L}^{B} r_{r,L}^{P,L} } \right)$$
(63)

where \(R_{B}^{M}\) denotes the rotation matrix from the machine base frame to the measurement frame whereas \(R_{r,L}^{B}\) denotes the rotation matrix from the reflector frame to the machine base frame.

Since the reflector frame is aligned with the platform frame, i.e. the orientation transformation between them is represented by an identity rotation matrix \(R_{r,L}^{P,L}\), the rotation of the reflector frame in the measurement frame is given by:

$$R_{r,L}^{M} = R_{P,L}^{M} = R_{B}^{M} R_{P,L}^{B} R_{r,L}^{P,L} = R_{B}^{M} R_{P,L}^{B}$$
(64)

As a result, we have:

$$R_{P,L}^{B} = \left( {R_{B}^{M} } \right)^{ - 1} R_{r,L}^{M}$$
(65)

Substituting (65) into (63), we obtain:

$$r_{r,L}^{M} = r_{B}^{M} + R_{B}^{M} \left( {r_{P,L}^{B} + \left( {R_{B}^{M} } \right)^{ - 1} R_{r,L}^{M} r_{r,L}^{P,L} } \right)$$
(66)

Simplifying (66) yields:

$$r_{r,L}^{M} = r_{B}^{M} + R_{B}^{M} r_{P,L}^{B} + R_{r,L}^{M} r_{r,L}^{P,L}$$
(67)

Both the position of the reflector \(r_{r,L}^{M}\) and the orientation of the reflector \(R_{r,L}^{M}\), expressed in the measurement frame, are measured by using the laser tracker. The rotation matrix \(R_{B}^{M}\) and the position vector \(r_{B}^{M}\) can be estimated by using the robot-world calibration, whereas the position vector \(r_{r,L}^{P,L}\) can be estimated by using the hand-eye calibration.

The position of the platform end-effector in the base frame \(r_{P,L}^{B}\) is given by the forward kinematics, i.e.:

$$r_{P,L}^{B} = \left[ {\begin{array}{*{20}c} {x_{L} } \\ {y_{L} } \\ {z_{L} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {f_{1} (x_{1} ,x_{2} ,x_{3} ,P_{L} )} \\ {f_{2} (x_{1} ,x_{2} ,x_{3} ,P_{L} )} \\ 0 \\ \end{array} } \right]$$
(68)

where f1 and f2 are the forward kinematics equations and PL contains all the geometric parameters of the lower mechanism.

For convenience, the Z-axis of the machine base frame is assumed to be aligned with the Z-axis of the reflector frame. In other words, the z coordinate of the reflector frame origin with respect to the machine base frame is zero:

$$r_{r,L}^{P,L} = \left[ {\begin{array}{*{20}c} {x_{r,L} } \\ {y_{r,L} } \\ {z_{r,L} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {x_{r,L} } \\ {y_{r,L} } \\ 0 \\ \end{array} } \right]$$
(69)

Similarly, the position of the reflector mounted on the upper platform can be expressed in the measurement frame as follows:

$$r_{r,U}^{M} = r_{O}^{M} + R_{O}^{M} r_{r,U}^{O} = r_{O}^{M} + R_{O}^{M} \left( {r_{P,U}^{O} + R_{P,U}^{O} r_{r,U}^{P,U} } \right)$$
(70)

The rotation of the reflector frame in the measurement frame, which is measured by using the laser tracker, can be written as:

$$R_{r,U}^{M} = R_{O}^{M} R_{P,U}^{O} R_{r,U}^{P,U}$$
(71)

Solving for \(R_{P,U}^{O}\) from (71) yields:

$$R_{P,U}^{O} = \left( {R_{O}^{M} } \right)^{ - 1} R_{r,U}^{M} \left( {R_{r,U}^{P,U} } \right)^{ - 1}$$
(72)

Because we have (62), then:

$$R_{P,U}^{O} = \left( {R_{O}^{M} } \right)^{ - 1} R_{r,U}^{M} \left( {R_{x} \left( { - \frac{\pi }{2}} \right)} \right)^{ - 1}$$
(73)

Substituting (73) into (70), we obtain:

$$\begin{aligned} r_{r,U}^{M} & = r_{O}^{M} + R_{O}^{M} r_{r,U}^{O} \hfill \\ \begin{array}{*{20}c} {} \\ \end{array} & = r_{O}^{M} + R_{O}^{M} \left( {r_{P,U}^{O} + \left( {\left( {R_{O}^{M} } \right)^{ - 1} R_{r,U}^{M} \left( {R_{x} \left( { - \frac{\pi }{2}} \right)} \right)^{ - 1} } \right)r_{r,U}^{P,U} } \right) \hfill \\ \end{aligned}$$
(74)

In fact, both the position of the reflector \(r_{r,U}^{M}\) and the orientation of the reflector \(R_{r,U}^{M}\), expressed in the measurement frame, are measured by using the laser tracker. The rotation matrix \(R_{O}^{M}\) and the position vector \(r_{O}^{M}\) can be estimated by using the robot-world calibration, whereas the position vector \(r_{r,U}^{P,U}\) can be estimated by using the hand-eye calibration. The position of the platform end-effector in the base frame of the upper mechanism \(r_{P,U}^{O}\) is given by the forward kinematics, i.e.:

$$r_{P,U}^{O} = \left[ {\begin{array}{*{20}c} {x_{U} } \\ {y_{U} } \\ {z_{U} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {f_{1} (x_{4} ,x_{5} ,x_{6} ,P_{U} )} \\ {f_{2} (x_{4} ,x_{5} ,x_{6} ,P_{U} )} \\ 0 \\ \end{array} } \right]$$
(75)

where f1 and f2 are the forward kinematics equations and PU contains all the geometric parameters of the upper mechanism.

The transformation from the machine base frame B to the base frame of the upper mechanism O can be obtained from the following relations:

$$R_{O}^{M} = R_{B}^{M} R_{O}^{B}$$
(76)
$$r_{O}^{M} = r_{B}^{M} + R_{B}^{M} r_{O}^{B}$$
(77)

From (76) and (77), we obtain:

$$R_{O}^{B} = \left( {R_{B}^{M} } \right)^{ - 1} R_{O}^{M}$$
(78)
$$r_{O}^{B} = \left( {R_{B}^{M} } \right)^{ - 1} \left( {r_{O}^{M} - r_{B}^{M} } \right)$$
(79)

Figure 10 shows the laser tracker fixed sitting beside the prototype machine. Figure 11 depicts the reflector mounted on the lower and upper platforms. Since only one reflector is available, the reflector was first mounted on the lower platform and subsequently mounted on the upper platform, or vice versa. In each setup, the estimation of the hand-eye transformation, robot-world transformation, and the geometric parameters of the lower mechanism was conducted. As mentioned earlier, the reflector should be installed to satisfy (61) and (62). To verify this alignment, one should observe the estimated rotation matrix of the reflector frame with respect to the platform frame, namely \(R_{{X_{1} ,L}} = R_{r,L}^{P,L}\) and \(R_{{X_{1} ,U}} = R_{r,U}^{P,U}\). After the estimation was conducted for both the mechanisms, the transformation from the machine base frame B to the base frame of the upper mechanism O can be estimated.

Fig. 10
figure 10

The laser tracker with a reflector installed on the machine

Fig. 11
figure 11

The reflector mounted a on the upper platform and b on the lower platform

5 Estimation Using Nonlinear Least Squares

5.1 Nonlinear least squares algorithm

In this section, Gaussian least squares differential correction (GLSDC) algorithm [32,33,34] (also called the Gauss–Newton nonlinear least squares) is applied for the refinement of the hand-eye calibration as well as the calibration of the mechanism geometric parameters. Using this algorithm, the nonlinearity of the system is taken into consideration.

Let P and Y be the parameters to be estimated and the model function, respectively, then the measured function values are given with a noise υ as follows:

$$\tilde{Y} = Y\left( P \right) + v$$
(80)

The noise υ is typically Gaussian with zero mean and a standard deviation is given by the uncertainty of the measurement device.

The model function Y for the lower mechanism is given by (67), i.e.:

$$Y = r_{r,L}^{M} = r_{B}^{M} + R_{B}^{M} r_{P,L}^{B} + R_{r,L}^{M} r_{r,L}^{P,L}$$
(81)

whereas the model function Y for the upper mechanism is given by (74), i.e.:

$$\begin{aligned} Y &= r_{r,U}^{M} = r_{O}^{M} + R_{O}^{M} r_{r,U}^{O} \hfill \\ \begin{array}{*{20}c} {} \\ \end{array} &= r_{O}^{M} + R_{O}^{M} \left( {r_{P,U}^{O} + \left( {\left( {R_{O}^{M} } \right)^{ - 1} R_{r,U}^{M} \left( {R_{x} \left( { - \frac{\pi }{2}} \right)} \right)^{ - 1} } \right)r_{r,U}^{P,U} } \right) \hfill \\ \end{aligned}$$
(82)

The residual error is given by:

$$e = \Delta Y = \tilde{Y} - \hat{Y}(\hat{P})$$
(83)

Notice that the tilde (~) mark on a parameter indicates a measured parameter whereas a hat mark indicates an estimated parameter. Given m measurements, the measured function values \(\tilde{Y}\), the estimated function values \(\hat{Y}\), and accordingly the residual errors e should be stacked in a single vector.

For the calibration of the lower mechanism, the residual error is defined as:

$$e = \tilde{Y} - \hat{Y}(\hat{P}) = \tilde{r}_{r,L}^{M} - \hat{r}_{r,L}^{M}$$
(84)

The measured position vector \(\tilde{r}_{r,L}^{M}\) is provided by the laser tracker, whereas the estimated position vector \(\hat{r}_{r,L}^{M}\) is evaluated by using (67) or (81). Similarly, the residual error for the calibration of the upper platform is defined as:

$$e = \tilde{Y} - \hat{Y}(\hat{P}) = \tilde{r}_{r,U}^{M} - \hat{r}_{r,U}^{M}$$
(85)

While the laser tracker provides the measured position vector \(\tilde{r}_{r,U}^{M}\), the estimated position vector \(\hat{r}_{r,U}^{M}\) is evaluated by using (74) or (82).

Besides the position vectors \(\tilde{r}_{r,L}^{M}\) and \(\tilde{r}_{r,U}^{M}\), the other parameters given by measurements are the orientation matrices \(R_{r,L}^{M}\) and \(R_{r,U}^{M}\), as well as the active joint positions which contribute to the forward kinematics solution of both mechanisms.

The estimation is conducted to find the estimates of the parameters \(\hat{P}\) which minimizes the following cost function:

$$F = \left\| e \right\|^{2} = \frac{1}{2}e^{T} We$$
(86)

and accordingly minimizes the residual error in (83)–(85). The cost function F in (86) indicates the norm or the square of the residual error. The matrix W denotes the weight matrix which is, in this work, chosen to be an identity matrix. Using GLSDC, the parameter estimates are computed iteratively as follows:

$$\hat{X}_{k + 1} = \hat{X}_{k} + \Delta x$$
(87)

where

$$\Delta x = \left( {H_{k}^{T} WH_{k} } \right)^{ - 1} H_{k}^{T} We_{k}$$
(88)

and the subscript k indicates the k-th iteration.

A modification to (88) called the Levenberg–Marquardt algorithm (also called the damped least squares) had been proposed to speed up the convergence in the case of initial values far from the “true” values. Since the initial values assigned in this work are considered close enough to the “true” values, the GLSDC is sufficient to give a fast convergence.

The Jacobian matrix H is obtained by differentiating the model function with respect to the estimated parameters:

$$H = \frac{\partial Y}{\partial P} = \left[ {\begin{array}{*{20}c} {H_{x} } & {H_{y} } & {H_{z} } \\ \end{array} } \right]^{T} = \left[ {\begin{array}{*{20}c} {\frac{{\partial Y_{x} }}{\partial P}} & {\frac{{\partial Y_{y} }}{\partial P}} & {\frac{{\partial Y_{z} }}{\partial P}} \\ \end{array} } \right]^{T}$$
(89)

where Yx, Yy, and Yz denote the x, y, and z components of the model function Y.

Given m measurements, the Jacobian matrix H should be stacked as follows:

$$H_{x} = \left[ {\begin{array}{*{20}c} {\frac{{\partial Y_{{x_{1} }} }}{\partial P}} \\ \vdots \\ {\frac{{\partial Y_{{x_{m} }} }}{\partial P}} \\ \end{array} } \right];\begin{array}{*{20}c} {} \\ \end{array} H_{y} = \left[ {\begin{array}{*{20}c} {\frac{{\partial Y_{{y_{1} }} }}{\partial P}} \\ \vdots \\ {\frac{{\partial Y_{{y_{m} }} }}{\partial P}} \\ \end{array} } \right];\begin{array}{*{20}c} {} \\ \end{array} H_{z} = \left[ {\begin{array}{*{20}c} {\frac{{\partial Y_{{z_{1} }} }}{\partial P}} \\ \vdots \\ {\frac{{\partial Y_{{z_{m} }} }}{\partial P}} \\ \end{array} } \right]$$
(90)
$$H_{3mx5} = \left[ {\begin{array}{*{20}c} {H_{x} } & {H_{y} } & {H_{z} } \\ \end{array} } \right]^{T}$$
(91)

The squared system Jacobian matrix in each iteration is the inverted part in (88), i.e.:

$$J = H_{k}^{T} WH_{k}$$
(92)

The matrix J should have a full rank in order to give a trusted solution. This full rank indicates that all the parameters are independent and therefore fully identified. In other words, a rank deficiency by n indicates that n parameters are dependent and therefore unidentified. The determination of the unidentified parameters can be done mathematically or through knowledge on the parameter dependency of the physical system. In a system with a rank deficiency, the dependent parameters should be eliminated until a full-rank system is obtained. In such a case, the nominal parameter values can be used. The dependent parameters can be estimated in the next step employing the estimates of the independent parameters having been obtained previously. This is commonly called the subset selection which results in a sequential estimation, i.e. the estimation is conducted in several steps. This approach assumes that the nominal parameter values should be good enough. Figure 12 shows how the subset selection is implemented in the GLSDC algorithm. As shown in the flowchart, if J does not have a full rank N then only M parameters are firstly estimated where M < N is the rank of J. This, as will be discussed soon, includes the following sequential estimation stages:

Fig. 12
figure 12

Flowchart of the subset selection in the implementation of GLSDC

  • Stage 1 Estimation of the hand-eye and robot-world transformation parameters to refine the closed-form solution obtained previously.

  • Stage 2 Estimation of the geometric parameters of the lower mechanism. This consists of two steps.

  • Stage 3 Estimation of the position of the base frame of the upper mechanism,\(r_{O}^{B}\).

  • Stage 4 Estimation of the geometric parameters of the upper mechanism. Similar to the case of the lower platform, this consists of two steps.

The iterations in the GLSDC keeps running until the norm of ∆F is less than a specified threshold. This is the stopping criteria of the GLSDC algorithms. In this work, the norm (∆F) of 1.0 × 10−10 is used.

5.2 Refinement of the Hand-Eye and Robot-World Calibration

After the procedure described in Sect. 1 has been performed to obtain the rough estimates of the hand-eye and robot-world transformations, a refinement is conducted by using the obtained estimates as initial values in an iterative estimation using GLSDC. For the lower mechanism, since the orientation of the reflector frame is aligned with that of the platform frame, the remaining parameters which should be estimated to establish the hand-eye and robot-world transformations are the position and orientation of the machine base frame with respect to the measurement frame, namely \(r_{B}^{M}\) and \(R_{B}^{M}\), as well as the position of the reflector with respect to the lower platform frame, namely \(r_{r,L}^{P,L}\). As the rotation matrix \(R_{B}^{M}\) is defined in terms of quaternions, namely q0, q1, q2, and q3, the position vector \(r_{B}^{M}\) is defined by the components xB, yB, and zB, and the position vector \(r_{r,L}^{P,L}\) is defined by the components xr and yr while zr= 0, the parameters to be estimated are:

$$P = \left[ {\begin{array}{*{20}c} {q_{0} } & {q_{1} } & {q_{2} } & {q_{3} } & {x_{B} } & {y_{B} } & {z_{B} } & {x_{r} } & {y_{r} } \\ \end{array} } \right]^{T}$$
(93)

Similarly for the upper mechanism, since the orientation of the reflector frame is aligned with that of the platform frame with a rotation of –π/2 about X-axis, the remaining parameters which should be estimated to establish the hand-eye and robot-world transformations are the position and orientation of the machine base frame with respect to the measurement frame, namely \(r_{O}^{M}\) and \(R_{O}^{M}\), as well as the position of the reflector with respect to the lower platform frame, namely \(r_{r,U}^{P,U}\). As the rotation matrix \(R_{O}^{M}\) is defined in terms of quaternions, namely q0, q1, q2, and q3, the position vector \(r_{O}^{M}\) is defined by the components xO, yO, and zO, and the position vector \(r_{r,U}^{P,U}\) is defined by the components xr and zr while yr= 0, the parameters to be estimated are:

$$P = \left[ {\begin{array}{*{20}c} {q_{0} } & {q_{1} } & {q_{2} } & {q_{3} } & {x_{O} } & {y_{O} } & {z_{O} } & {x_{r} } & {z_{r} } \\ \end{array} } \right]^{T}$$
(94)

The evaluation of the squared system Jacobian matrix J for both the lower and upper mechanisms shows that its rank is 9 (full rank) and therefore all the parameters in (93) and (94) can be estimated in a single step for each mechanism. Tables 2 and 3 show both the estimates obtained using the closed-form solution as described in Sect. 1 and those obtained through the refinement using the GLSDC, for the lower and upper mechanisms, respectively.

Table 2 The estimated hand-eye and robot-world transformation parameters for the lower mechanism
Table 3 The estimated hand-eye and robot-world transformation parameters for the upper mechanism

As a partial benchmark, the available nominal value of yr is 185 mm. Since the reflector is mounted well on the lower platform, the deviation from the nominal value should not be too large. The estimated value of yr = 186.087565 mm is considered acceptable. This indicates that the refinement works well.

After the hand-eye and robot-world transformations for both the lower and upper mechanisms have been performed, the transformation from the machine base frame B to the base frame of the upper mechanism O can be easily computed by using (78) and (79). The obtained rotation matrix is:

$$R_{O}^{B} = \left[ {\begin{array}{*{20}c} {1.001862} & { - 0.001390} & { - 0.001831} \\ { - 0.001834} & { - 0.002087} & { - 1.001861} \\ {0.001386} & {1.001862} & { - 0.002090} \\ \end{array} } \right]$$
(95)

whereas the position vector from B to O is:

$$r_{O}^{B} = \left[ {\begin{array}{*{20}c} {x_{O}^{B} } \\ {y_{O}^{B} } \\ {z_{O}^{B} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} { - 2.084870} \\ {898.462981} \\ { - 637.302275} \\ \end{array} } \right]$$
(96)

This shows that the origin of the X-axis of the base frame of the upper mechanism O is shifted by − 2.084870 mm from that of the machine base frame B. In the design, \(x_{O}^{B}\) is expected to be zero. However, the estimated value shows that it is not zero. This occurs because there may be an error in the manufacturing of the machine base structure.

5.3 Estimation of the Mechanism Geometric Parameters

For each mechanism, there are five geometric parameters to be estimated, namely l1, l2, l3, xp2 and xp3. In the case of xp2= xp3= xp, which is the case of the prototype machine, there are four geometric parameters to be estimated, i.e. l1, l2, l3,and xp. Therefore, the parameters to be estimated are:

$$P = \left[ {\begin{array}{*{20}c} {L_{1} } & {L_{2} } & {L_{3} } & {x_{p} } \\ \end{array} } \right]^{T}$$
(97)

The observation shows that the squared system Jacobian matrix J gives only a rank of 4 in the case of five parameters to be estimated, i.e. when xp2 xp3, and a rank of 3 in the case of four parameters to be estimated, i.e. when xp2= xp3= xp. This is because one of all the geometric parameters to be estimated is dependent on the other four parameters. In other words, all the geometric parameters but one are known then the one parameter remaining can be calculated by using the closed-form geometric relation of the mechanism.

Another approach is to estimate all the geometric parameters in two steps. In the first step, L2, L3, xp2, and xp3 are estimated. In this step, the nominal value of L1 is used in the estimation iterations. In the second step, the remaining parameter, i.e. L1, is estimated. Although the nominal value of L1 is used in the first step, L1 is subsequently estimated in the second step. Using twelve unique calibration poses for each of the lower and upper mechanisms, the estimates of the geometric parameters of the lower and upper mechanisms along with their nominal values are shown in Tables 4 and 5. The errors are defined as the difference between the estimates and the nominal values. It can be observed in Tables 4 and 5 that the estimate of L1 is similar to its nominal value. This is because the nominal value of L1 is used in the first step and subsequently it is estimated after the other parameters have been estimated. In other words, the nominal values of L1 are retrieved in this two-step estimation.

Table 4 The estimates of geometric parameters of the lower mechanism (xp2 = xp3 = xp)
Table 5 The estimates of geometric parameters of the upper mechanism (xp2 = xp3 = xp)

6 Estimation of the Geometric Parameters Using Iterative Linear Least Squares

In this section, a linear error model is used for the kinematic calibration. Accordingly, the closed-form linear least squares estimation can be employed. From the kinematic relations given in (1)–(3), a small perturbation can be introduced to all the parameters which include the geometric parameters P, the active joint positions q, and the platform pose X. This small perturbation which represents a small error is a first-order approximation. Following (1)–(3), the perturbed kinematics can be written by differentiating the kinematics with respect to all parameters:

$$\begin{aligned} &L_{1} \delta l_{1} = (x + x_{p2} \cos (\theta ) - x_{1} ) \hfill \\ &\quad (\delta x + \delta x_{p2} \cos (\theta ) - x_{p2} \sin (\theta )\delta \theta - \delta x_{1} ) \hfill \\ &\quad +\, (y + x_{p2} \sin (\theta ))(\delta y + \delta x_{p2} \sin (\theta ) + x_{p2} \cos (\theta )\delta \theta ) \hfill \\ \end{aligned}$$
(98)
$$L_{2} \delta l_{2} = (x - x_{2} )(\delta x - \delta x_{2} ) + y\delta y$$
(99)
$$\begin{aligned} &L_{3} \delta l_{3} = (x + x_{p3} \cos (\theta ) - x_{3} ) \\ &\quad (\delta x + \delta x_{p3} \cos (\theta ) - x_{p3} \sin (\theta )\delta \theta - \delta x_{3} ) \\ & \quad +\, (y + x_{p3} \sin (\theta ))(\delta y + \delta x_{p3} \sin (\theta ) + x_{p3} \cos (\theta )\delta \theta ) \\ \end{aligned}$$
(100)

In a matrix form, (98)–(100) can be written compactly as:

$$J_{x} \delta X + J_{q} \delta q = J_{p} \delta P$$
(101)

where

$$J_{x} = \left[ {\begin{array}{*{20}c} {\hat{X}_{1} } & {y + x_{p2} \sin (\theta )} & {\hat{X}_{1} x_{p2} \left( {\cos (\theta ) - \sin (\theta )} \right)} \\ {(x - x_{2} )} & y & 0 \\ {\hat{X}_{3} } & {y + x_{p3} \sin (\theta )} & {\hat{X}_{3} x_{p3} \left( {\cos (\theta ) - \sin (\theta )} \right)} \\ \end{array} } \right]$$
(102)
$$J_{q} = \left[ {\begin{array}{*{20}c} { - \hat{X}_{1} } & 0 & 0 \\ 0 & {x_{2} - x} & 0 \\ 0 & 0 & { - \hat{X}3} \\ \end{array} } \right]$$
(103)
$$J_{p} = \left[ {\begin{array}{*{20}c} {L_{1} } & 0 & 0 & { - \hat{X}_{1} \left( {\cos \theta + \sin \theta } \right)} & 0 \\ 0 & {L_{2} } & 0 & 0 & 0 \\ 0 & 0 & {L_{3} } & 0 & { - \hat{X}_{3} \left( {\cos \theta + \sin \theta } \right)} \\ \end{array} } \right]$$
(104)
$$\hat{X}_{1} = x + x_{p2} \cos (\theta ) - x_{1}$$
(105)
$$\hat{X}_{3} = x + x_{p3} \cos (\theta ) - x_{3}$$
(106)
$$\delta X = \left[ {\begin{array}{*{20}c} {\delta x} & {\delta y} & {\delta \theta } \\ \end{array} } \right]^{T}$$
(107)
$$\delta q = \left[ {\begin{array}{*{20}c} {\delta x_{1} } & {\delta x_{2} } & {\delta x_{3} } \\ \end{array} } \right]^{T}$$
(108)
$$\delta P = \left[ {\begin{array}{*{20}c} {\delta L_{1} } & {\delta L_{2} } & {\delta L_{3} } & {\delta_{xp2} } & {\delta_{xp3} } \\ \end{array} } \right]^{T}$$
(109)

Let all the terms in the left-hand side be called A, i.e.:

$$A = J_{x} \delta X + J_{q} \delta q$$
(110)

and \(B = J_{p}\), then we can rewrite (101) as:

$$A = B\delta P$$
(111)

Having m measurements, we can stack (110) into the following overdetermined system:

$$\bar{A} = \bar{B}\delta P$$
(112)

where

$$\bar{A} = \left[ {\begin{array}{*{20}c} {A_{1} } \\ {A_{2} } \\ \vdots \\ {A_{m} } \\ \end{array} } \right];\begin{array}{*{20}c} {} & {} \\ \end{array} \bar{B} = \left[ {\begin{array}{*{20}c} {B_{1} } \\ {B_{2} } \\ \vdots \\ {B_{m} } \\ \end{array} } \right]$$
(113)

The estimation of \(\delta P\) is aimed at minimizing the following cost function:

$$F = \left\| {\bar{B}\delta p - \bar{A}} \right\|^{2} = \frac{1}{2}\left( {\bar{B}\delta p - \bar{A}} \right)^{2}$$
(114)

As the problem is an overdetermined system, a closed-form solution for δp is given by the following linear least squares:

$$\delta P = \left( {\bar{B}^{T} \bar{B}} \right)\bar{B}^{T} \bar{A}$$
(115)

Since (115) denotes the errors in the geometric parameters, the estimated geometric parameters are given by:

$$\hat{P} = P + \delta P$$
(116)

where \(\hat{P}\) and P denote the estimated and nominal values of the geometric parameters, respectively.

Assuming that the measurement is given with respect to the machine base frame, the following is the sequential procedure to implement the linear least squares estimation based on the abovementioned linear error model:

  • Step 1 Assign the poses to be visited, X.

  • Step 2 Measure the poses, Xmeasured.

  • Step 3 Calculate δX = Xmeasured − X.

  • Step 4 Perform the inverse kinematics to obtain the active joint positions q = f(X,P).

  • Step 5 Measure the active joint positions, qmeasured.

  • Step 6 Calculate δq = qmeasuredq.

  • Step 7 Calculate \(A(X,\delta X,q,\delta q,P) = J_{x} \delta X + J_{q} \delta q\) [Eq. (110)].

  • Step 8 Compose the vector B(X,q,P).

  • Step 9 Repeat Step 1 to Step 8 for m measurements. Compose \(\bar{A}\) and \(\bar{B}\) as in (113).

  • Step 10 Check the rank of \(\bar{B}^{T} \bar{B}\).

  • Step 11 If \(\bar{B}^{T} \bar{B}\) has full rank, then compute the linear least squares solution (115). Otherwise, eliminate the dependent parameters either mathematically, such as through SVD, or based on knowledge on the physical system.

In real practice, the measured poses Xmeasured is often given by an external measurement device such as a camera or a laser tracker as in this work. As a result, Xmeasured is given with respect to a measurement frame which is not aligned with the machine base frame. Accordingly, the assigned poses X should be defined with respect to the measurement frame. The values of X with respect to the measurement frame can be derived from (67) or (81) for the lower mechanism and from (74) or (82) for the upper mechanism.

From (67) or (81), we obtain:

$$X_{L} = r_{P,L}^{B} = \left( {R_{B}^{M} } \right)^{ - 1} \left( {r_{r,L}^{M} - r_{B}^{M} - R_{r,L}^{M} r_{r,L}^{P,L} } \right)$$
(117)

In a similar fashion, from (74) or (81) we have:

$$X_{U} = r_{P,U}^{O} = \left( {R_{O}^{M} } \right)^{ - 1} \left( {r_{r,U}^{M} - r_{O}^{M} - R_{r,U}^{M} \left( {R_{x} \left( { - \frac{\pi }{2}} \right)} \right)^{ - 1} r_{r,U}^{P,U} } \right)$$
(118)

The sequential procedure to implement the linear least squares estimation based on the linear model when an external pose measurement device is used can be summarized as follows:

  • Step 1 Estimate the hand-eye and robot-world transformations.

  • Step 2 Assign X with respect to the machine base frame FB for the lower mechanism and with respect to the base frame of the upper mechanism FO for the upper mechanism.

  • Step 3 Measure the reflector position with respect to the measurement frame, namely \(r_{r,L}^{M}\) for the lower mechanism and \(r_{r,U}^{M}\) for the upper mechanism.

  • Step 4 Calculate Xmeasured by utilizing (117) for the lower mechanism and (118) for the upper mechanism.

  • Step 5 Perform Step 3 to Step 11 as described for the pose measurement in the machine base frame.

Using the same measurement data as used in the GLSDC, the resulting overdetermined linear system (112) with all the geometric parameters to be estimated has a full-ranked \(\bar{B}^{T} \bar{B}\). Therefore, the estimation can be performed straightforwardly in a single step. However, the estimates given by a single run of the algorithm are not satisfying. They are inconsistent and not guaranteed to be the optimum solution. Some coordinates may have an error less than that of the uncalibrated one, but some other coordinates may have an even more significant error than that of the uncalibrated one. This implies that the estimation algorithm fails to minimize the cost function, i.e. the residual errors.

To overcome this problem, the linear least squares algorithm as described above needs to be iterated until a minimum norm of the residual errors ε is achieved. Since this iterative linear least squares algorithm requires higher computational cost compared to the iterative nonlinear least squares, one can also stop the algorithm after a certain amount of time or a certain number of iterations and evaluate the obtained estimates. The flowchart of the iterative linear least squares is depicted in Fig. 13. It can be seen in the flowchart that the estimated parameter values are updated and subsequently supplied to the new linear system which will be solved iteratively until the stopping criteria as discussed is achieved. Furthermore, the norm of the residual is evaluated between any two consecutive iterations. If the norm of the residual is increasing, the new parameter values should be subtracted by the parameter errors. Otherwise, they should be summed. Using twelve unique calibration poses for each of the lower and upper mechanisms, the iterative linear least squares (124) provides the estimated geometric parameters of the lower and upper mechanisms as shown in Tables 6 and 7, respectively. In a similar manner with the two-step estimation using the nonlinear least squares, the errors are defined as the difference between the estimated and nominal values.

Fig. 13
figure 13

Flowchart of the iterative linear least squares

Table 6 Estimated geometric parameters of the lower mechanism obtained by using iterative linear least squares
Table 7 Estimated geometric parameters of the upper mechanism obtained by using iterative linear least squares

To this point, it still cannot be judged whether the estimates of the geometric parameters obtained by using the nonlinear least squares or those obtained by the iterative linear squares are more accurate as the true values of the geometric parameters are unknown. To evaluate and compare the accuracy of the estimates obtained by using both the algorithms, the pose errors will be evaluated in the next section upon the compensation of the kinematic parameters.

7 Compensation

After the estimation of the geometric parameters has been done, compensation should be conducted to improve the accuracy of the machine. This is performed by replacing the nominal geometric parameter values in the kinematics by the estimated ones. Since two estimation techniques have been implemented, the estimates from both the techniques were used for the compensation. To evaluate the accuracy of the mechanism pose, pose errors are defined for all coordinates of the pose, i.e. x, y, and θ at the twelve different poses. Figure 14 shows a comparison between the pose errors of the uncalibrated and calibrated lower mechanism at the twelve different poses. For conciseness, the pose errors of the uncalibrated and calibrated upper mechanism are not shown in this paper as their behavior is similar to those of the lower mechanism. The pose errors are presented for each coordinate of the pose, i.e. x, y, and θ. It can be seen that the both the iterative nonlinear least squares (NLS, i.e. GLSDC) and the iterative linear least squares (LLS) algorithms successfully suppress the pose errors to values very close to zero. Some of the plots in this figure cannot show clearly the difference between the pose errors corresponding to both the algorithms as the error curves look coincident although they have a small difference. It is shown that the average position accuracy before the calibration is around 0.9 mm whereas the average orientation accuracy is less than 0.2 degree. The calibration using GLSDC provides an average accuracy of less than 0.004 mm for the position and less than 0.0002 degrees for the orientation, whereas the iterative linear least squares algorithm provides an average accuracy of less than 0.01 mm for the position and a similar average accuracy in the orientation to the GLSDC. In general, both the calibration algorithms can improve the position accuracy by around 0.2 mm. To illustrate more clearly, the plots of the pose errors of the lower mechanism corresponding to only the calibrated parameters at the twelve different poses are shown in Fig. 15. The plots show clearly that the GLSDC performs better in the position accuracy than the iterative linear least squares. However, both algorithms do not perform differently in the orientation accuracy. It can be seen in these plots that the iterative nonlinear least squares algorithm outperforms the iterative linear least squares in the pose error suppression. In addition to that, the former algorithm also outperforms the latter in the computational cost as the former converges faster than the latter.

Fig. 14
figure 14

Pose errors of a x coordinates, b y coordinates, and c angles θ of the lower mechanism at twelve data points (poses) before calibration and after calibration using NLS and iterative LLS

Fig. 15
figure 15

Pose errors of a x coordinates, b y coordinates, and c angles θ of the lower mechanism at twelve data points (poses) after calibration using NLS and iterative LLS

The improved accuracy mentioned above is position and orientation accuracy in the case of position tracking. To evaluate the effect of calibration in the accuracy of contour tracking, a test contour was executed using both the nominal and estimated parameters. Since the estimated parameters obtained by using the nonlinear least squares are more accurate than those obtained by the iterative linear least squares, they are used in the test contour. In this work, a full circle was selected as the test contour. Figure 16 shows the contour performed by the lower mechanism and therefore lying on the XY plane. The circle is centered at (400, 300) mm and has a radius of 50 mm. As shown in the figure, the contour corresponding to the nominal parameters was at a glance very close to that corresponding to the calibrated (estimated) parameters. In order to compare the accuracy, contour errors which are defined as the difference between the nominal coordinates and the calibrated coordinates were plotted as shown in Fig. 17. Since the planar contour has two coordinates, i.e. x and y, the contour errors should be evaluated for each coordinate. The figures depict the contour errors along the whole trajectory of the contour. It is shown in the figures that the contour corresponding to the calibrated parameters is more accurate by around 0.2 mm than that corresponding to the nominal (uncalibrated) parameters. This is consistent with the position accuracy of around 0.2 mm provided by both the calibration algorithms. The remaining position accuracy is basically due to the posture and/or dynamics of the mechanism which is a task for the control system to overcome. Along the trajectory of the circle, the mechanism posture keeps changing. As can be seen in Fig. 17, at some postures the error is zero while at other postures the error starts increasing.

Fig. 16
figure 16

Test contour performed by the lower mechanism (blue: using nominal values, red: using calibrated values). (Color figure online)

Fig. 17
figure 17

Contour errors of a the absicca (x) coordinates and b ordinate (y) coordinates of the test contour

8 Conclusion

It is shown that the nonlinear least squares algorithm successfully refined the hand-eye and robot-world transformation previously obtained by using a simple separable technique. The evaluation of the contouring error also shows that the nonlinear least squares algorithm estimates more accurately the geometric parameters of the machine’s mechanisms than the iterative linear least squares algorithm. In return to this higher accuracy, the nonlinear least squares algorithm should be performed in two steps by employing the subset selection approach in which m parameters should be firstly fixed at their nominal values while the rest of the parameters are estimated (where N is the total number of parameters to be estimated, r is the rank of the system Jacobian matrix, and m = N  r). Subsequently, the previously fixed parameter(s) should be estimated in the next estimation step. This implies that the fixed parameter(s) in the first step should have a considerably accurate value. Among all the estimated parameters, the parameter(s) which is believed to have the most accurate value(s) can be chosen as the fixed parameter(s). Such dependency to the nominal values of the parameters does not only occur in this situation; it also occurs in the hand-eye and robot-world calibration which assumes some degree of accuracy of the nominal values of the mechanism geometric parameters. On the other hand, the closed-form solution of the linear least squares should be iterated until it converges to the actual values. Otherwise, it may give estimates of the parameters that are worse than the nominal values due to divergence from the actual values. Finally, using the compensated kinematics, it is shown that both the position tracking error and the contour tracking error were reduced.