Abstract
This paper introduces a methodology for controlling parallel robots in case they are used as a kind of specialized fixture to expand the technological capabilities of machines. The parallel robot is mounted on the workbench to extend the number of degrees of freedom. However, there are always measurable kinematic errors of the workbench which will be eliminated by the robot’s motion. The actual working motion of the robot is then still performed by its active joints. Therefore, the displacement of each movable joint is now decided by two sources, one is due to the error compensation motion of the workbench, the other is the required work movement. According to the superposition principle, these two motions are combined into a single displacement characteristic curve to control the robot. The base exchange technique to determine the error compensation motion of the workbench, the technique of solving the inverse kinematics problem by the generalized reduced gradient (GRG) method, and the principle of joint motion combination are then introduced in detail in the paper. Finally, an example with the hexapod is presented. The obtained results, which use the robot itself to generate error-compensated movements of the workbench by means of the base exchange technique, will open up the possibility of intervening in hybrid machine systems to ensure the desired forming accuracy without no hardware intervention required.
1. Introduction
Since their first appearance for more than two decades, parallel robots have been expected to replace conventional Computer Numerical Controlled (CNC) machines with serial kinematics. However, there are many unresolved problems existed, especially in machining applications that require precision, rigidity, dexterity, and large workspaces [1].
To improve the problem of limited working space while preserving the characteristics such as high rigidity, high precision, and high speed of parallel robots, many scholars have researched, designed, and applied a combination of chain mechanisms (such as CNC machines) and parallel robots, called hybrid mechanisms. Hybrid mechanisms are mainly used in machine tools [2]. Zhu et al. [3] considered the 3-TPS hybrid machine tool (In there, the parallel has three legs, each leg has three joints: T-Twisting joint, P-Prismatic joint, and S- Spherical joint). The research has solved the problem of selecting motor parameters and mechanism design. Zhang et al. [4] presented a novel parallel manipulator with one translational and two rotational degrees of freedom (DOF). This 5 DOF hybrid kinematic machine tool is used in the aerospace field for large heterogeneous complex structural component machining. In this research, a three-degree-of-freedom 2PRU-PRPS parallel manipulator is proposed to increase stiffness (P denotes the Prismatic active joint, R denotes the Rotational joint, and U denotes the Universal joint). Song et al. [5] performed kinematic modal characteristic analysis on the 4PRR-P hybrid mechanism. In the studies of hybrid machine tools, 5-axis hybrid milling machines are mentioned most, especially in terms of kinematics, dynamics, and control [6–12]. Antonov [13] presented a forward and inverse kinematics solution for a five-degree-of-freedom parallel-serial manipulator. Similarly, the problem of kinematic analysis for hybrid machine tools was performed by Kang et al. [14], Harib et al. [9], etc.
In addition, some studies on hybrid structures used in other fields are also presented. Zhou [15] investigated a robot system for subretical insertion integrated with intraoperative optical coherence tomography. This is a micromanipulator hybrid system of two parallel and one serial structure. Meanwhile, a serial-parallel hybrid worm-like robot with 9 DOF is proposed to move on typical terrains such as the stair, the slope, the gap, and the narrow passage [16].
In hybrid mechanisms, the parallel part has outstanding properties that cannot be obtained by chain structures such as rigidity, light structure, high precision, and high speed [17]. Hexapods or Stewart platforms are typical parallel structures with 6 legs and are used in many different applications [18]. Many studies on hexapods can be found as in [19–21]. The error on the end-effector of a small hexapod milling machine is corrected using a coordinate measuring machine [19]. The hexapod is used as a coordinate measuring machine in [20]. Hexapods are used to measure forces in space when machining in [21].
Recently, 6-leg parallel configurations are being applied to machines to improve the rigidity, stability, and accuracy [22]. The end-effector is used as the main-stock or workbench of the machine tools [23–25].
Ni et al. [26] developed an integrated geometric error modelling method under the unified coordinate system framework for a general five-axis hybrid machine tool (including 3-PRS parallel spindle head and X–Y serial workbench) based on small perturbation theory and a vector chain method. Antonov et al. [13] presented inverse and forward kinematics and workspace analysis of a novel 5-DOF (3T2R) parallel-serial (hybrid) manipulator, in which a parallel kinematic series is generated in the form of a tripod, and a serial part with two DOFs (2T motion pattern) based on two carriages displaced in perpendicular directions (3T2R). Zhou et al. [27] proposed an intelligent algorithm based on the extreme learning machine (ELM) and sequential mutation genetic algorithm (SGA) to determine the inverse kinematic solutions of a robot controller with six degrees of freedom. Huang et al. [28] introduced the configuration and calibration method of the 3-P(4R) S-XY hybrid machine tool. Based on the simplification of the parallel 3-P(4R)S to 3-PRS, error models and error kinematics are derived to integrate all possible manufacturing and assembly errors in the calibration process. Guo et al. [29] proposed the design and kinematic analysis of a 5 DOF hybrid manipulator with five-face machining capability. With the same opinion, Zhang et al. [30] solved the inverse kinematics problem by the closed-loop vector method for a hybrid mechanism with a fixed base, a movable platform and four variable length legs (2RPU and 2SPR), where R is a rotary joint, P is a prismatic joint, U is a universal joint, and S is a spherical joint. Tao et al. [31] analyzed the kinematics and workspace for a 4 DOF palletizing robot hybrid structure with a base, a waist weld frame, and a parallel machine arm drive. Harib et al. [1] studied the mobility of three classes of mechanisms (serial, parallel, and hybrid kinematic structures) and focused on the mobility according to their application in parallel and hybrid structures to reduce the number of passive joints. Zhang et al. [4] presented a novel parallel manipulator with one translational degree of freedom and two degrees of rotation (PRU) that can be used to form a 5 DOF composite kinematic machine tool for machining large heterogeneous complex structural components in the aerospace field.
Many scholars have studied the hybrid structure and hexapod robots. Some focus is on exploiting, optimizing, and effectively using the features of these structures. Although the parallel mechanism has high accuracy, the cumulative error leads to the inaccuracy of the end-effector when combined with the serial structure. To ensure accuracy while expanding the working space, improving the technological capabilities of the hexapod, a solution when the hexapod is mounted on a CNC workbench will be presented in this paper.
2. Principle of End-Effector Error Compensation by the Base Exchange Method
This paper presents research on a hybrid machine tool, the combination structure of CNC machine table and parallel robot hexapod 6SPS.
There are 4 reference systems in Figure 1 as follows: OM: the frame of reference attached to the machine; OT: the frame of reference attached to the cutting tool; O0: the frame of reference attached to the fixed plate center of the parallel robot; O1: the frame of reference attached to the center of the moving plate of the parallel robot;

Since the robot is attached to the workbench, O0 and OM can be converted to each other by the following axis transfer relationship:
The cutting tool trajectory described in the O0 frame of reference is as (2):
The kinematic equation of the robot in the O0 frame of reference is as (3):
The desired trajectory of the workbench is as (4)
The actual trajectory of the table, including its kinematic error, is (5)
This means that the hybrid machine tool will combine the movement of the workbench and the 6DOF hexapod robot as a fixture to expand the technological possibilities for orbital completion (2). However, instead of the ideal trajectory (4), due to the position error, the workbench moves along the trajectory (5), which then affects the workpiece as the path (2) is no longer correct. The hexapod robot itself has a very high rigidity, the errors of the fixture can be neglected, while to achieve the desired accuracy in shaping, the errors of the workbench need to be compensated. There are two ways to do it as follows:(i)The first option is to correct the workbench itself so that the actual trajectory (5) returns to the ideal one (4), this option needs to interfere with the machine tool's hardware and cannot eliminate the errors of the workbench thoroughly and permanently. Therefore, it is not the subject of this paper.(ii)The second option is to accept the error of the workbench, and its actual trajectory is (5). Since the hexapod has extra degrees of freedom, they can be used to create compensatory motions to eliminate errors in the workbench. Simultaneously, the robot also combines with the workbench to create the movements according to (2) to complete its task. Thus, the robot's motion now has two functions, shaping through the movement of the workbench and eliminating the errors created by the workbench. This process requires no hardware intervention as the first option and it allows long-term precision mastery. This is the objective of this paper.
To eliminate the kinematic errors of the workbench, first it is necessary to evaluate the error at the ith point of the trajectory as follows:
If the hexapod robot stays still and the workbench moves, this error will be copied to the O1 frame of reference according to the rule (6). In order for the table not to transmit this error from O0 to O1, assuming the point O1 is fixed at coordinates , it is necessary to control the moving joints of the hexapod mechanism so that the point O0 moves from to . In other words, a movement of the robot mechanism generated at point Pi propagating in the direction from O1 to O0 will eliminate the transmission error in the direction from O0 to O1. To calculate this compensatory motion of the robot, the base conversion and quantitative problem (7) allows to determine the motion of each joint:
In which, the left side of (7) is the robot kinematics equation that changes from the O0 frame of reference to the O1 frame, the right side of (7) implies that the point O0 moves from to . However, since the left side of (7) is written in the O1 frame of reference, its right side has become as follows:where T2 is the axis transfer matrix between O0 and O1 in the home position of the hexapod robot.
3. Motion of Intermediate Joints of the Robot
To expand the workspace of the parallel robot, the hexapod is placed on the workbench of the 3D CNC machine tool. This combination will bring great benefits as mentioned above. However, as a serial mechanism, the workbench has considerable errors, especially after a period of work. In this paper, we propose a method in which the hexapod will eliminate errors caused by the workbench at the same time (simultaneously) with its own operation. The basis of this activity is shown as follows:
3.1. Using a Hexapod Robot as a Motion Mechanism
The differential mechanism is to aggregate two sources of motion with different properties into one, it is widely used in gear processing. In cars, the differential mechanism is used with the opposite function, i.e., dividing torque and revolutions to both output shafts. Likewise, here, the hexapod plays a similar role as a differential mechanism when merges the movement from two component movements.
There are two problems and a three-step process to implement the control model as shown in Figure 2 as follows:(i)Problem 1: determine the characteristics of each joint when the robot performs the error-compensating motion of the floor according to (7). This process is repeated for all keypoints on the trajectory to build a group of compensatory properties which is the solution of (7) and is symbolled as follows:(ii)Problem 2: determine the motion characteristics of each joint when the robot executes the trajectory of the cutting tool according to (2). The kinematic model of this problem is as follows:

Thus, the total displacement of each joint on the hexapod robot along the toolpath while compensating the error of the floor, will be (12):
These data are a direct output to control the active joints to achieve the desired trajectory (4) instead of without compensating this trajectory (5).
The three-step control process mentioned above is as follows: Step 1: set up and solve equation (7); Step 2: set and solve equation (10); Step 3: determine the kinematic properties according to equation (12).
3.2. Methods for Preparing Kinematic Data for Robots
To prepare the kinematic data of the robot, it is necessary to perform the three-step process mentioned at the end of Section 3.1, of which the most important is solving equations (7) and (10). These two equations have the same nonlinear and transcendent nature with the same solving method. In this paper, we will apply the GRG method to solve these equations, this problem is mentioned in the documents [20, 32, 33] and not repeated here.
4. An Example with Hexapod
The illustrated computational model is a hybrid structure: a parallel hexapod robot is placed on a CNC machine workbench. The error of the workbench will be compensated by the hexapod at the same time as the orbital movement required by the robot. The trajectory to be taken is a circle with a diameter of 300 mm. The operation process undergoes these two movements: the workbench moves in a circle of diameter 150 mm, the center of the moving plate of the tool-mounted robot also moves with a circle of diameter 150 mm. As mentioned above, the parallel robot has very high accuracy, so the error caused by the robot can be ignored. At this time, the error caused by the workbench moving with the orbit of 150 mm will be compensated by the movement of the hexapod itself.
The accuracy of the end-effector is assured by the following steps.
4.1. Kinematic Model of the Hexapod Robot with SPS Configuration and Hybrid Structure
The linear drive leg in the hexapod structure makes the vector loop form through one leg and it takes the form of a tetragonal loop instead of a pentagonal loop (Figure 3).

Because bi and pi cross each other in space, it requires a rotation matrix RRPY to turn them coplanar. The equation of the closed loop on the quadrilateral is written as follows:
The instantaneous value and direction cosine must be preknown to describe the detailed coordinates of the node Bi. Notice that in this case, the rotation around the AiBi axis does not create a new kinematic solution, so the joint S is modeled by two variables u and equivalent to the U (cardan) joint, consider the diagram of Figure 4:

Therefore, for the detailed equation of the ith leg is written as follows:
Retrieve for 6 legs to get full kinematics equations.
4.2. Kinematic Error of Workbench
The workbench makes the motion according to the desired trajectory, which is a circle of diameter 150 mm. In real motion, there is an error at every single point on the trajectory. In this model, the author uses the errors of the workbench in [34]. Totally 64 points are surveyed on the orbital circle.
The desired and actual trajectory of the workbench is shown in Figure 5:

4.3. Error Compensation Motion
The error compensation values, after being taken from the inverse of the coordinates of the errors, will be used as input for the hexapod displacement kinematics problem. GRG numerical method with optimal function is applied to solve this problem. The displacements of the joint’s variables and the auxiliary parameters at the error compensation points are determined:
From the kinematic diagram of the leg ith when transferring axis is as shown in Figure 6, the kinematic vector equation of the robot when transferring axis is as follows:where the elements of the inverse matrix RRPY are as follows: a11 = (cos(β+γ)+cos(β-γ))/2, a12 = (sin(β+γ)-sin(β-γ))/2, a13 = -sin(β), a21 = (-cos(α+β+γ)+cos(α-β+γ)-cos(α+β-γ)+cos(α-β-γ)-2 ∗ sin(α+γ)+2 ∗ sin(α-γ))/4, a22 = (2 ∗ cos(α+γ)+2 ∗ cos(α-γ)-sin(α+β+γ)+sin(α-β+γ)+ sin(α+β-γ)-sin(α-β-γ))/4, a23 = (sin(α+β)+sin(α-β))/2, a31 = (-2 ∗ cos(α+γ)+2 ∗ cos(α-γ)+sin(α+β+γ)-sin(α-β+γ)+ sin(α+β-γ)-sin(α-β-γ))/4, a32 = (-cos(α+β+γ)+cos(α-β+γ)+cos(α+β-γ)-cos(α-β-γ)-2 ∗ sin(α+γ)-2 ∗ sin(α-γ))/4, a33 = (cos(α+β)+cos(α-β))/2.

Therefore, the system of kinematic equations for the ith leg of the hexapod robot applying the base exchange method is as follows:(i)Px = xBi - li.Cui.Cvi - ((cos(β+γ)+cos(β-γ))/2).xAi - ((sin(β+γ)-sin(β-γ))/2).yAi - (-sin(β)).zAi(ii)Py = yBi - li.Cui.Svi - ((-cos(α+β+γ)+cos(α-β+γ)- cos(α+β-γ)+cos(α-β-γ)-2∗sin(α+γ)+2∗sin(α-γ))/ 4).xAi - ((2∗cos(α+γ)+2∗cos(α-γ)-sin(α+β+γ)+ sin(α-β+γ)+sin(α+β-γ)-sin(α-β-γ))/4).yAi - ((sin (α+β)+sin(α-β))/2).zAi(iii)Pz = zBi -li.Sui - ((-2∗cos(α+γ)+2∗cos(α-γ)+sin(α+ β+γ)-sin(α-β+γ)+sin(α+β-γ)-sin(α-β-γ))/4).xAi - ((-cos(α+β+γ)+cos(α-β+γ)+cos(α+β-γ)-cos(α-β-γ)- 2∗sin(α+γ)-2∗sin(α-γ))/4). yAi - ((cos(α+β)+cos(α-β))/2). zAi
The optimal function is developed to solve the problem according to the GRG numerical method as follows: (Px + xBi - li.Cui.Cvi - ((cos(ßβ+γ)+cos(β-γ))/2).xAi - ((sin(ßβ+γ)-sin(β-γ))/2).yAi - (-sin(β)).zAi)^2 = 0 (Py + yBi - li.Cui.Svi - ((-cos(aα+ßβ+γ)+cos(α-β+γ)-cos(aα+β-γ)+cos(α-β-γ)-2∗sin(aα+γ)+2∗sin(α-γ))/4).xAi - ((2∗cos(aα+γ)+2∗cos(α-γ)-sin(aα+ßβ+ γ)+sin(α-β+γ)+sin(aα+β-γ)-sin(α-β-γ))/4).yAi - ((sin (aα+β)+sin(α-β))/2).zAi)^2 = 0. (Pz + zBi -li.Sui - ((-2∗ cos(aα+γ)+2∗cos(α-γ)+sin(aα+ßβ+γ)-sin(α-β+γ)+sin (aα+β-γ)-sin(α-β-γ))/4).xAi - ((-cos(aα+ßβ+γ)+cos(α-β+γ)+cos(aα+β-γ)-cos(α-β-γ)-2∗sin(aα+γ)-2∗sin(α-γ))/ 4). yAi - ((cos(aα+β)+cos(α-β))/2). zAi)^2 = 0
Similar process is needed to do for the 6 legs of the hexapod to solve the kinematic problem.
The inverse kinematic problem solved by numerical method GRG is applied to determine joint variables and sub-parameters at 64 survey points-64 coordinates of error compensation points. The values of 6 active joint variables at 64 survey points are shown in Figure 7.

4.4. Feed Movement
The hexapod robot performs a movement trending a circular tool with a diameter of 150 mm. Use equation (15) for 6 legs and change them to the optimal form: (Px - xAi + Cβ.Cγ.xBi + (Sα.Sβ.Cγ - Cα.Sγ).yBi + (Cα.Sβ.Cγ + Sα.Sγ).zBi - li.Cui.Cvi)2 = 0 (Py - yAi + Cβ.Sγ.xBi + (Sα.Sβ.Sγ + Cα.Cγ).yBi + (Cα.Sβ.Sγ - Sα.Cγ).zBi - li.Cui.Svi)2 = 0 (Pz - zAi - Sβ.xBi + Sα.Cβ. yBi + Cα.Cβ.zBi - li.Sui)2 = 0
The GRG numerical method is applied to solve these optimal functions. Solving the inverse kinematic problem at 64 survey points will give 64 sets of values of joint variables and corresponding sub-parameters. In which, the value sets of 6 control joint variables are illustrated as in the following graph (Figure 8):

4.5. Synthetic Motion
The synthetic motion in the hexapod control is the value of the active joint variable when participating in two processes: error compensation for the CNC workbench and the main feed movement of 150 mm.
The data set for the synthetic motion processes is shown graphically as follows (Figure 9):

4.6. Comparison before and after Error Compensation
The results after compensation at the center of the moving plate of the hexapod robot have shown the correctness of the proposed theory. The errors have been reduced to very small, insignificant, as shown in Figure 10.

5. Conclusions
With the assumption that the robot's degrees of freedom can be used to create error-compensating movements of the workbench, the paper shows the way to build control data for a hybrid system including machine tools and the hexapod robot. The goal of this work is not interfering with the hardware of the machine tool and still maintaining the accuracy of the shaping movement. It is a viable idea to manipulate the system through software only, forcing the robot to generate compensatory movements and adding it to the initial shaping motion, which allows for long-term accuracy to be maintained even if the workbench’s accuracy continues to decrease with operating time.
Data Availability
For more information on how to compose the data availability statements, including the example, please visit: https://www.mediafire.com/file/qibbcqtqat6f61z/case+study.xlsx/file.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This work was supported by the Thai Nguyen University of Technology (TNUT), Thai Nguyen Province, Vietnam.