1. Introduction
Collaborative robots, or cobots, are increasingly prevalent in industrial and research environments due to their ability to work alongside human operators and their adaptability to various tasks. The precision and accuracy of these robots are critical, particularly in applications requiring intricate movements and precise positioning [Reference Paden, Čáp, Yong, Yershov and Frazzoli1]. One of the key challenges in the field of collaborative robotics is the accurate capture and playback of robot trajectories. This ability is essential for tasks such as repetitive assembly, quality inspection, and precise manipulation in dynamic environments [Reference Sun, Yu, Zhong, Dong, Zhang and Yu2].
This paper presents a novel high-precision trajectory capture and playback mechanism specifically designed for the KUKA iiwa collaborative robot [Reference Biswas, Kar and Feron3]. The mechanism leverages advanced data processing techniques and Ju-Gibbs attitude quaternion to ensure the fidelity and accuracy of captured trajectories, addressing common challenges such as noise and variable movement speeds [Reference Fu, Chen and Sun4, Reference Zhang, Li, Ren and Ren5].
Liu [Reference Sun, Wang, Yu, Zhang, Dong and Gao6] developed a high-precision trajectory replication method using advanced adaptive spline interpolation, addressing the challenges in robotic trajectory replication from the aspects of spatial accuracy, temporal fidelity, and dynamic response optimization. Patel [Reference Sun, Zhong, Huang and Dong7] proposed a novel trajectory correction algorithm based on real-time feedback and predictive control for enhanced trajectory accuracy in complex environments. Zhang [Reference Dong and Zhang8] utilized a dual-objective optimization approach incorporating machine learning techniques to refine the trajectory by minimizing deviations and maximizing efficiency. Kalman [Reference Hamilton9] pioneered the classic Kalman filter, providing a robust statistical method that optimally estimates the states of linear dynamic systems from a series of incomplete and noisy measurements. However, traditional trajectory replication methods in robotics may face difficulties in achieving such high precision due to their dependence on simpler interpolation techniques, which lack the capability to effectively manage complex kinematic behaviors and environmental interactions [Reference Sun, Yu, Zhang, Dong, Yu and Zhong10].
The main improvements made in this study are:
-
1. Developing a new sliding filter to reduce noise, maintaining path integrity, and ensuring accurate playback, which optimizes trajectory details more effectively.
-
2. Utilizing the Ju-Gibbs attitude quaternion to optimize kinematic modeling for multi-axis systems (MAS). This method simplifies variables, reduces dimensions, and enhances symbolic clarity, overcoming the limitations of traditional rotation vectors and unit quaternions.
The proposed mechanism has been thoroughly tested and validated through a series of experiments. The results demonstrate a significant improvement in the precision of trajectory capture and playback, confirming the efficacy of the approach. This system provides a robust solution for real-time trajectory acquisition and reproduction, paving the way for more advanced and precise applications of collaborative robots in various fields.
The remainder of this paper is organized as follows. Section 2 shows the quaternion and kinematic analysis. Section 3 details the methodology includes data processing, filtering, storage, and trajectory playback. Section 4 presents the experimental procedures used to assess the proposed system, including the setup and execution of tests. Section 5 summarizes the research findings and outlines future directions for further study and potential improvements.
2. Methodology
The research began with the identification of a critical issue: the KUKA iiwa robot exhibited noticeable errors in trajectory reproduction, which posed challenges in achieving the desired precision and computational efficiency. The primary goal was to develop a solver capable of high-precision trajectory capture and playback while simultaneously improving computational efficiency.
To address this problem, new technologies were developed. The research leveraged the advantages of the Ju-Gibbs quaternion, primarily utilizing it for kinematic modeling while employing Denavit–Hartenberg (D–H) parameters and homogeneous transformation matrices as secondary aids. This approach aimed to enhance computational efficiency. Additionally, a novel filter was developed to replace the simple sliding average filter, effectively reducing noise and enabling higher precision in trajectory reproduction.
The newly developed techniques were then tested through experiments that involved running a sinusoidal trajectory. The primary objective was to evaluate the noise reduction capabilities of the new filter. The results were captured in three sets of comparative experimental figures. In the MoveIt visual interface, the end-effector’s movement was traced by a blue line, visibly representing the trajectory. The experiments successfully replicated the trajectory in both the Gazebo simulation environment and on the physical KUKA iiwa robot.
Further experiments involved running an arc trajectory, which provided data for analyzing joint angles and conducting an Iinverse kinematic error analysis. The results confirmed that computations using Ju-Gibbs quaternions were faster, demonstrating the efficiency and effectiveness of the newly developed methods.
2.1. Kinematic analysis
The Kuka LBR iiwa 7 R800 is a seven degrees-of-freedom (DOF) manipulator. Hence, the robot manipulator is kinematically redundant, with a least one redundant DOF, with respect to the task dimension. Table I gives the modified D–H parameters [Reference Craig20] provided by the robot manufacturer.
Although D–H parameters and homogeneous transformation matrices are widely accepted and utilized in many robotics applications, they can introduce computational complexity and inefficiencies when dealing with systems that have complex joint configurations and multiple DOF [Reference Ju32]. Considering these challenges, the quaternion method has been opted to optimize the kinematic model, with D–H parameters playing a complementary role.
In the robotic manipulators, each joint’s rotation can be elegantly described using quaternions. For a system like the KUKA iiwa, which features multiple articulated joints, the orientation of each segment relative to a fixed base can be computed through the product of quaternion rotations corresponding to each joint [Reference Rusu and Cousins11]. The total orientation of the end-effector relative to the robot base can be calculated by the cumulative multiplication of individual joint quaternions:
where qi is the quaternion representing the rotation imparted by the i-th joint [Reference Clifford12].
Consider the transformation at joint k. The quaternion qk rotates the local frame from Ok−1 to Ok as illustrated in Fig. 1. The vector lk, representing the arm link, transforms according to:
where v k−1 is the vector position of the link in the previous joint’s coordinate frame and $q_{k}^{-1}$ is the conjugate (inverse) of q k [Reference Cohen and Shoham13, Reference Ahmed, Ju, Yang and Xu14].
2.2. Ju-Gibbs quaternion
In this study, an analytical quaternion was utilized to describe the rotation of multi-axis chains, achieving optimal kinematic modeling through the elimination of variables, reduction in dimensionality, and comprehensive symbol analysis. This approach facilitated more precise and simplified modeling of complex robotic movements.
The natural space has 6D; from this perspective, it is clear that the position and orientation equations based on rotation vectors, rotation matrices, and unit quaternion do not meet the minimum requirements for describing kinematic equations robots formula [Reference Faria, Ferreira, Erlhagen, Monteiro and Bicho15, Reference Thrun, Burgard and Fox16]. Therefore, the kinematic equations must be constructed not to be redundant, for describing the kinematic transformations of MAS. To enhance quaternion features and eliminate some existing cons of a unit quaternion, the tangent quaternion named Ju-Gibbs attitude quaternion is proposed as an analytical quaternion to describe the orientation of bodies in a unified form, which is the isomorphism to unit quaternion established by Hamilton [Reference Hamilton9] and Jet Propulsion Laboratory [Reference Trawny and Roumeliotis31] for analytical description and kinematic solutions, but not fully homomorphism for numerical calculation; it is defined as
where $\vec {{\unicode[Arial]{x03C4}} _{l}}={\unicode[Arial]{x03B7}} _{l}\cdot \tan (\theta _{l}/2)={\unicode[Arial]{x03B7}} _{l}\cdot {\unicode[Arial]{x03C4}} _{l}$ is the vector part and $\dot{\tau _{l}}$ is a scalar part.
The multiplication algorithm of such Ju-Gibbs quaternion and the operation product still result in the rotational formula [Reference Cui, Yang and Wang17]. It is similar to the complex multiplication law [Reference Liu, Wang and Jin18–Reference Craig20]; rotations of quaternions and in 3D space is shown in Fig. 2. The quaternion can write in universal form as
where · denotes the quaternion multiplication.
From Eqs. (3) and (4), the quaternion multiplication can represent the forward rotation operation of the kinematic axis chain as
where ${ }^{k-2}{\tilde{\mathcal{T}}_{k-1}}{}$ is 4 × 4 matrix. Equation (5) showed that the quaternion multiplication could be replaced by its 4 × 4 matrix calculation called a quaternion concatenation calculation; it is written as
Equations (5) and (6) consist of forward and backward in chain ordering $\vec {{\unicode[Arial]{x03C4}} }_{l-1}, -\vec {{\unicode[Arial]{x03C4}} }_{l-1}^{\mathrm{T}}$ , respectively; the upper left contains ${\unicode[Arial]{x03C4}} _{l-1}\cdot 1+\vec {{\unicode[Arial]{x03C4}} }_{l-1}^{\times }$ it is 3 × 3 matrix. For MAS, Eq. (6) can be expressed as
where i, j>3 kinematic joints.
Equations (4)–(6) are similar to 4D complex multiplication formula in 4D space, which corresponds to homogeneous transformation. The quaternion multiplications for two orthogonal axes can be written as
3. Data processing algorithm design
Traditional sliding average filters, which smooth time series by averaging data within a fixed window, frequently encounter difficulties with high-frequency fluctuations. To overcome this issue, the Dynamic Adaptation Sliding Filter (DASF) has been developed. This advanced sliding average filter is specifically designed to enhance the processing of robotic trajectory data.
The moving average filter smooths the collected trajectory data, reducing noise and improving accuracy. It works by averaging a set of data points to smooth out fluctuations. When employing a simple moving average filter in data analysis, the formula used is
where $SMA(t)$ represents the moving average at time $t$ , $N$ is the size of the moving window, indicating the number of data points considered, and $x_{i}$ denotes the data value at time point $i$ [Reference Samson and Ait-Abderrahim22].
The approach utilizes weights $w_{i}$ that are adjusted based on the distance of data points from the center of the window. The formula for calculating the weighted average of sensor data points is
where $S_{t}$ represents the output of the DASF at time $t$ , $x_{t}$ represents the observed value at time $t$ , and $n$ is the half-width of the window.
Weights are calculated using a Gaussian function, emphasizing central data points and reducing the influence of edge points [Reference Murray, Li and Sastry23]. Weights $w_{i}$ are assigned using a Gaussian distribution to prioritize central data points:
where μ represents the mean or the center of the window in the Gaussian function and σ denotes the standard deviation in the Gaussian function, effectively emphasizing more relevant data and reducing noise from outliers [Reference Jiang and Mei24].
The core mechanism of the DASF, highlighted in step 6 of the algorithm, introduces a method to dynamically adjust the window size in order to accommodate data variability:
where $\sigma _{t}$ represents the standard deviation of the data within the current window, $\alpha$ is a scaling factor in the formula for dynamically adjusting the window size, $n(t)$ , and $\beta$ acts as an offset in the dynamic window size calculation, enhancing the filter’s flexibility.
The weights $w_{i}$ in the DASF are adjusted not only based on their position within the window but also to swiftly adapt to significant motion by refining the weighting scheme. As described in steps 12 and 13, this modification increases the weights based on the rate of change between consecutive data points; this refined weighting scheme increases the weights in response to the rate of change between consecutive data points, $\dot{x}_{t}$ and $\dot{x}_{t-1}$ :
where $\gamma$ is used in the adjustment of weights, $w_{i}(t)$ , it modulates the sensitivity of the weight adjustments to changes in the rate of data change, represented by the difference in derivatives, $| \dot{x_{t}}-\dot{x_{t-1}}|$ [Reference Kavraki, Švestka, Latombe and Overmars25, Reference Liu, Huang, Liu, Guo, Wang and Tan26].
Additionally, static data points at the trajectory’s start and end are removed, focusing analysis on the most dynamic and relevant segments. Details of the complete data processing method are depicted in Fig. 3.
By integrating DASF, automatic sampling rate adjustment, and removal of static data points, this study achieved a high-precision trajectory capture and playback mechanism for collaborative robots. Further details can be found in Appendix.
4. Experiments
The experiments were conducted using the Robot Operating System (ROS) [Reference Dong and Zhang8] platform with MoveIt [Reference Dong and Zhang8] and Gazebo [Reference Cui, Yang and Wang17] for simulation, as well as the KUKA Sunrise for controlling the real robot. The aim was to validate the effectiveness of the high-precision trajectory capture and playback mechanism. The experimental setup and results are detailed below.
The experimental setup is shown in Fig.4: a Kuka LBR iiwa 7 R800 robot, a laptop running ROS with MoveIt and Gazebo for simulation, and an Ethernet cable for communication between the robot and the laptop.
The control system was divided into two main parts: ROSCORE and SUNRISE. The ROSCORE part included C++ and Python nodes that handled the robot’s state and command data. The SUNRISE part included the robotic application and KUKA Sunrise OS [Reference Ardiani, Benoussaad and Janot27]. Figure 5 outlines the robotic system setup using ROS to control a KUKA robot. At its core, the setup includes a ROS Master on a PC coordinating the communication between various ROS nodes, which may be spread across different devices within a network. One of these nodes, developed in Python, interfaces directly with the KUKA Sunrise Cabinet that controls the robot through a dedicated Java daemon [Reference Xu28]. This architecture not only enables the robot to perform tasks based on commands sent from the ROS nodes but also ensures smooth and reliable communication over Transmission Control Protocol connections.
4.1. Filtering effect experiments
Two sets of experiments were conducted using a sinusoidal trajectory, starting from the initial position (−348.5686, −2.7714, 697.1189) and ending at the final position (255.3793, 493.7929, 466.1564), as modeled in Fig. 6, to quantitatively assess the impact of data smoothing and adaptive sampling rate adjustments on the quality of trajectory data. The first set was performed without the implementation of a sliding average filter and without automatic adjustments in the sampling rate. This experiment provided a baseline dataset, saved in a CSV file format, capturing the raw sensor outputs as the robot executed predefined tasks. Subsequently, a second experiment incorporated both a sliding average filter and an adaptive sampling rate mechanism.
The experimental data from this experiment was recorded and processed into curve plots for comparative analysis, as shown in Figs. 7– 9. The comparative analysis focused on the smoothness and noise levels in the trajectory data from both experiments. It was observed that the introduction of the sliding average filter and adaptive sampling frequency significantly smoothed the data curves. This effect was evident as it effectively reduced random fluctuations and noise, providing a clearer and more consistent representation of the end-effector’s trajectory.
It was noted that the errors were primarily concentrated in the early to mid-phases of the motion. In the initial phase of motion, the KUKA iiwa robot’s end-effector transitions from rest to active motion, striving to adhere to the predefined trajectory. This transitional period is characterized by significant dynamic changes. The end-effector’s inertia and the immediate adjustments required by the control system often result in initial overshooting or oscillatory movements [Reference Trawny and Roumeliotis31]. Such dynamics are prevalent in robotic systems, where initial discrepancies predominantly stem from the control system’s delay in effectively responding to rapid changes in the trajectory. This adjustment period can induce pronounced errors at the beginning of the movement, which tend to stabilize as the system reaches a dynamic equilibrium.
In this study, the developed approach was successfully applied to both Gazebo simulations and the physical KUKA iiwa robot, demonstrating the ability to accurately reproduce smooth sinusoidal trajectories. These trajectories are visually represented by blue lines in the MoveIt visualization interface, as shown in Fig.10. The consistent results across both simulated and real-world environments confirm the effectiveness of the proposed method.
4.2. Forward and inverse kinematics calculations
In this study, the end-effector of the robot completes the spatial trajectory depicted in Fig. 11, starting from the initial position of (−348.5686, −2.7714, 697.1189) and concluding at the final position of (255.3793, 493.7929, 466.1564). The trajectory is divided into 50 segments, with a step duration of 0.05 s per segment, culminating in a total duration of 2.5 s for the robot to complete the arc trajectory.
The inverse kinematics of a seven DOF robotic arm is addressed by decomposing the solution into two main parts within a unified approach. Initially, the first six DOF are treated as a standard six DOF mechanism, ensuring that the end-effector reaches the desired position and orientation. Subsequently, the seventh DOF, typically an additional rotational joint near the end-effector, is utilized to optimize the solution or meet specific criteria. This approach is particularly effective for simple motion trajectories, where the focus is primarily on the angular displacements of the six primary joints.
Since the positions of two fixed points on rotation axis ξ1 remain unchanged, the second-type subproblems are first used to solve for angles θ2 and θ3. Following this, the first-type subproblems are employed to determine angle θ1. After acquiring angles θ1, θ2, and θ3, the initial position of the robot arm’s end-effector changes. The process continues with the second-type subproblems to solve for angles θ4 and θ5. Once angles θ1, θ2, θ3, θ4, and θ5 have been obtained, a point outside the axis is located, and the first-type subproblems are used to solve for angle θ6. This procedure is repeated to yield a series of 50 corresponding outputs. As shown in Fig.12, the experimentally obtained angular displacement curves for each joint are smooth, indicating that the inverse solutions derived from the subproblems are continuous.
The computed joint angles from the inverse kinematic process are analyzed using Ju-Gibbs quaternions and the exponential product method. To efficiently compare computation times, calculations for both methods are performed alternately, as illustrated in Fig.13. This comparison reveals that Ju-Gibbs quaternion computations are more efficient than the exponential product method, offering better real-time performance. Additionally, the Ju-Gibbs quaternions exhibit minimal time fluctuation across different data sets, enhancing the stability of robotic operations.
Finally, the joint angles obtained from the inverse kinematic process are used to compute forward kinematics. The spatial positions derived are then compared with the desired positions. As depicted in Fig.14, the discrepancies in the end-effector positions determined by the subproblem solutions are within ±5 × 10–2 mm, meeting the accuracy requirements for practical robotic applications.
From these experimental results, it is evident that the utilization of the Ju-Gibbs quaternion provides substantial advantages, including the maintenance of precision within an acceptable error margin, which is essential for practical implementations in robotic systems.
5. Conclusion
The advancements presented in this paper significantly elevate the precision and efficiency of robotic trajectory planning. The new sliding filter ensures more reliable data processing, while the application of the Ju-Gibbs attitude quaternion provides a robust framework for kinematic analysis in complex systems.
This research encompassed two pivotal experiments utilizing the KUKA iiwa robotic platform. The first experiment demonstrated the effectiveness of the DASF across four distinct trajectories, highlighting its superior performance in enhancing trajectory accuracy and noise reduction. The second experiment compared the computational techniques of screw theory exponential product and the Ju-Gibbs quaternion for kinematics calculations. The results distinctly favored the Ju-Gibbs quaternion approach, proving its enhanced efficiency and accuracy in handling complex rotational movements of robotic joints. These findings validate the integration of the DASF and Ju-Gibbs quaternion as substantial advancements in robotic trajectory precision and control.
The experimental results demonstrate the effectiveness of these improvements in achieving high-precision trajectory capture and playback. The end-effector position error analysis, alongside a comparison of position data before and after the application of the DASF, underscores the enhanced accuracy and reliability of the system. The implementation of these advancements has been successfully replicated on the KUKA iiwa robot, demonstrating the practical applicability of these solutions in real-world settings.
In conclusion, the proposed trajectory capture and playback mechanism offers significant improvements in data quality and system performance for collaborative robots. These enhancements render the system a valuable tool for a variety of robotic applications, encompassing fields such as manufacturing, medical robotics, and research [Reference Pomerleau, Colas and Siegwart29]. Future work will focus on further refining the algorithms, exploring additional filtering techniques, and extending the system to other robotic platforms to validate its robustness and versatility [Reference Fox, Burgard and Thrun30].
Author contributions
Z.R.L.: writing—original draft, writing—review and editing, conceptualization, methodology, software, validation, formal analysis, investigation, data curation, visualization. J.H.Y.: writing—review and editing, validation, conceptualization, methodology. A.F.: conceptualization, validation. C.X.L.: conceptualization, validation, resources, supervision, writing—review and editing.
Financial support
This research received no specific grant from any funding agency, commercial or not-for-profit sectors.
Competing interests
The authors declare no conflicts of interest exist.
Ethical approval
Not applicable.
Appendix
The specific implementation of DASF is as follows: