3.2. Validation of the Variable Impedance Control Strategy for the Robotic Arm
The regression trajectories obtained by processing multiple sets of demonstration trajectories through DTW–GMM–GMR were input into the DMP model for learning to improve the accuracy of reproducing the demonstration trajectories. According to the different task trajectories, by changing the initial and target positions of the joint motion trajectory, a generalized trajectory with the same motion trend as the demonstration trajectory can be obtained, which can meet the requirements of different task initial and target positions. The initial and target positions of the regression trajectory are shown in
Table 1. According to the task requirements, the regression demonstration trajectory was generalized, and the generalized trajectory is called trajectory 1. The initial and target positions of trajectory 1 were set as shown in
Table 2. Setting the parameters α to 35 and β to 35/4 = 8.75, the initial and target positions of the motion trajectory after generalization by the DMP model are shown in
Table 2. According to the analysis in
Table 2, the error between the initial position and the set initial position of trajectory 1 after generalization, as well as the error between the target position and the set target position, can meet the task requirements of trajectory design, as shown in
Table 3. As shown in
Figure 6, the generalized trajectory 1 demonstrates the accuracy of the trajectory generalization of the DMP model.
In the motion experiment of the robotic arm without a load, the maximum stiffness
kmax and minimum stiffness value
kmin for joints 1 to 4 are shown in
Table 4. The maximum damping
dmax and minimum damping
dmin for joints 1 to 4 are shown in
Table 5. According to the task characteristics of each joint and the indicative functions in Equations (1) and (2), the values of the variable stiffness c
1 adjustment process for joints 1 to 4, the variable damping cc
2 adjustment process, and the variable damping cc
3 adjustment process are shown in
Table 6. Based on the parameters shown in
Table 4,
Table 5 and
Table 6, the variable stiffness profile and variable damping profile were obtained, as shown in
Figure 7 and
Figure 8.
To validate the superiority of the proposed variable impedance control strategy in this paper, a comparison was made with the method presented in reference [
6]. When running the variable impedance control strategy from reference [
6], all parameters were set exactly the same as those in the proposed variable impedance control strategy in this paper. Equation (4) was used to calculate the torque required for the generalized trajectory to execute in torque mode and send the torque to the corresponding joint without any load or impact. During the torque application process, the joint angles of the robotic arm were recorded for two cases, as shown in
Figure 9. The angle errors for joints 1 to 4 in two cases are illustrated in
Figure 10. Finally, the Residual Standard Deviation (RSD) of the joint angles was used to evaluate the superiority, as shown in
Table 7.
where
K represents the number of samples,
σk represents the desired joint angles, and
represents the joint angles generated by the proposed variable impedance control strategy in this paper, or the joint angles generated by the variable impedance control strategy proposed in the reference literature.
By analyzing
Figure 9, it can be observed that the proposed variable stiffness and variable damping control strategies in this paper make the motion of the robotic arm more stable, without significant fluctuations.
Based on the RSD values of the joint trajectories and the analysis of
Figure 11 and
Table 7, it can be seen that the variable impedance control strategy proposed in this paper has significantly improved the accuracy of joint 1′s motion trajectory, and joint 2 to joint 4 have also been improved to varying degrees. The trajectory accuracy of joint 1 to joint 4 has been improved by 57.23%, 3.66%, 5.36%, and 20.16%. Therefore, the variable impedance control strategy proposed in this paper has significantly improved the motion accuracy of the robotic arm.
To verify the safety and flexibility of the proposed variable stiffness and variable impedance strategies, a large random impact force was applied to the robotic arm at the 3rd second. The angles of the robotic arm’s joints were recorded during the experimental process, as shown in
Figure 12.
From
Figure 12, it can be observed that the angle errors of each joint of the robotic arm at the last moment under external impact are −0.008 rad, −0.0007 rad, −0.0001 rad, and 0.0042 rad. The robotic arm was able to recover to the desired values within a certain period of time, demonstrating its compliance and safety in interacting with the external environment.
3.3. Transfer Experiment of Robotic Arm’s Variable Impedance Control
To validate that DMPs have not only the ability to generalize robotic arm joint trajectories but also the ability to transfer and generalize variable stiffness skills, ensuring smooth control in different tasks, the generalization capability of DMP was extended from position control mode to impedance control mode. In this experiment, the generalized trajectory from
Section 3.2, referred to as trajectory 1, as shown in
Figure 6, was used. Then, a different trajectory was generated using DMP, referred to as trajectory 2, which was distinct from trajectory 1. The robotic arm followed this newly generalized trajectory for its motion. To assess the impact of changes in the task trajectory and an increase in load on the transfer and the generalization of variable stiffness skills, five tasks were designed as follows. In
Figure 13, the specific task planning process is illustrated.
Task 1: The robotic arm follows the motion trajectory from
Section 3.2, referred to as trajectory 1, and the variable stiffness profile is learned from the regression trajectory.
Task 2: The robotic arm follows trajectory 2 as the desired motion trajectory and utilizes the variable stiffness and variable damping obtained from Task 1 for impedance control.
Task 3: The robotic arm follows trajectory 2 as the desired motion trajectory and utilizes DMP to transfer and generalize the variable stiffness profile learned from Task 1 for impedance control.
Task 4: The robotic arm follows trajectory 2 as the desired motion trajectory while carrying a payload with dimensions of 200 mm × 110 mm × 100 mm and a weight of 2.66 kg. It utilizes the impedance control with variable stiffness and variable damping obtained from Task 3 to perform impedance control in this situation.
Task 5: The robotic arm follows trajectory 2 as the desired motion trajectory and utilizes DMP to transfer and generalize the variable stiffness profile learned from Task 3 for impedance control.
As a reference, if the actual trajectory followed by the robotic arm is the same as or very close to the desired trajectory, the task is considered successful. The specific process and result analysis for each task is presented below.
The specific process and result analysis are presented as described in
Section 3.2.
Based on the regression trajectory, the generalization is performed again, which is different from the generalization trajectory 1 in
Section 3.2, making it easier to distinguish the generalization trajectory in
Section 3.2. The generalization trajectory in this section is trajectory 2, and the initial and target positions of the joint trajectory for trajectory 2 are set as shown in
Table 8. We set the parameters α to 35 and β to 35/4 = 8.75. After generalization by the DMP model, the initial and target positions of trajectory 2 are shown in
Table 8. According to the analysis in
Table 8, the error between the initial setting and the initial position of trajectory 2 after generalization, as well as the error between the target position and the set target position of trajectory 2 after generalization, could meet the task requirements of the trajectory design, as shown in
Table 9. As shown in
Figure 14, the generalized trajectory 2 demonstrates the accuracy of the trajectory generalization of the DMP model.
According to the requirements of Task 2, the robotic arm followed trajectory 2 as the desired motion trajectory, while the stiffness and damping adopted the variable stiffness and variable damping profiles from trajectory 1. No load was applied to the end effector of the robotic arm. The changes in joint angles during the experiment are depicted in
Figure 15.
Figure 15 represents the trajectory generated using impedance control with the variable stiffness and variable damping from Task 1, with trajectory 2 as the desired motion trajectory. Comparing the end points of this trajectory to the desired trajectory 2, the end point errors for joints 1 to 4 are 0.0196 rad, −0.0106 rad, −0.0060 rad, and 0.0019 rad. Additionally, the RSD values for joints 1 to 4 are 0.0259, 0.0149, 0.0055, and 0.0089. Joints 1 and 2 exhibit larger end point errors, while joints 3 and 4 have smaller errors. As a result, only the variable stiffness transfer was applied to joints 1 and 2.
Through Task 2, it can be seen that the impedance parameters of Task 1 did not meet the requirements of impedance control in Task 2. Therefore, the variable stiffness values of Task 1 were generalized using the DMP model to meet the requirements of Task 2. However, during the generalization of the variable stiffness profile, when the target stiffness value exceeded the initial stiffness value, the generalized stiffness curve tended to be opposite to the original stiffness curve. For example, the actual first joint variable stiffness profile is shown in
Figure 7, which is an increasing curve in the 0–4.35 s interval and a decreasing curve in the 4.35–10 s interval, as shown in Equation (17). Therefore, the stationary point of the variable stiffness profile was taken as the segment point, and each segment was kept monotonic to achieve the generalization of each segment and meet the requirements of variable impedance control. It is believed that the 87th sample of the first joint was the point of monotonic segmentation, t = 4.35 s. The segmentation points of the other joints were also determined in the same way. When the whole variable stiffness profile of the first joint was generalized, its variable stiffness profile is shown in
Figure 16, which is a decreasing curve in the 0–4.35 s interval and an increasing curve in the 4.35–10 s interval, opposite to the original trend of the variable stiffness profile, and it does not meet the requirements of generalization. Therefore, this chapter proposes to divide the variable stiffness profile of each joint into multiple monotonic trajectories using the DMP model, with the monotonic segmentation point as the segmentation point, and divide the variable stiffness profile into multiple monotonic trajectories. The segmentation point serves as the target value of the previous trajectory and the starting value of the subsequent trajectory. From the joint variable stiffness profile, it can be seen that the monotonic segmentation points of the first and second joints were 4.35 s and 7.05 s, respectively, as shown in Equations (18) and (19). Then, all joint stiffness profiles could be generalized based on the DMP model in a segmented manner, and the generalized variable stiffness profile is shown in
Figure 17.
After the segmented learning of variable stiffness for joint 1 and joint 2 based on the DMP model, it can be seen from
Figure 18 that the joint end errors of joint 1 and joint 2 after variable stiffness generalization are 0.0012 rad and −0.0021 rad, respectively, and the joint error values are relatively small. In addition, the RSD values of joint 1 and joint 2 trajectories relative to the expected trajectory 2 are 0.0168 and 0.0140, respectively. Compared to task 2, according to the analysis of the RSD values in
Table 10, it can be seen that the joint trajectory accuracy of joint 1 and joint 2 improved by 35.14% and 6.04%, respectively. From this, it can be seen that after the task trajectory changed, by performing variable stiffness generalization on the corresponding joints, it was possible to compensate for the changes in the required torque of the joints caused by the task changes, improve the accuracy of the joint motion trajectory, and meet the requirements of the task.
The robotic arm followed trajectory 2 as the desired motion trajectory while carrying a payload with dimensions of 200 mm × 110 mm × 100 mm and a weight of 2.66 kg. It utilized the impedance control with variable stiffness and variable damping obtained from Task 3 to perform impedance control in this situation. The angle changes from joint 1 to 4 during the experiment are shown in
Figure 19.
According to
Figure 19, the end point errors for joints 1 to 4 of the robotic arm are 0.1066 rad, −0.0420 rad, −0.0207 rad, and 0.4791 rad. The RSD values for the trajectories of joints 1 to 4 are 0.1343, 0.0345, 0.0148, and 0.1569. Therefore, it can be observed that during the variable impedance control in Task 4, joint 1 gradually deviated from the desired trajectory starting from the 3rd second. Joint 4 also gradually deviated from the desired trajectory starting from the 2nd second and at the 8th second, there was a sudden and significant deviation from the desired trajectory for joint 4. Joints 2 and 3 also exhibited varying degrees of deviation from the desired trajectory. This deviation indicates that the task failed.
According to Task 4, the variable stiffness value of Task 3 did not meet the requirements of Task 4. Therefore, the variable stiffness value of Task 3 was then segmented based on the DMP model to meet the requirements of Task 4. However, in the process of variable stiffness value generalization, the third joint had the same situation as the first joint in the overall stiffness generalization, and the monotony of the contour curve was opposite, which could meet the requirements of variable stiffness generalization. Moreover, the segment trend of the third joint was more complicated. In addition, the variable stiffness profile trend of the third joint was more complex. According to the variable stiffness profile of the third section, it was divided into three sections, and the section points were 4.9 s and 7.2 s. In the process of global stiffness generalization, the fourth joint showed a negative stiffness value and a serious generalization error, as shown in
Figure 20. According to the variable stiffness profile of the fourth joint, it was divided into two segments, with the segment point being 3.5 s. According to Task 3, piecewise DMP model learning was still carried out for the variable stiffness contour of each joint of the robotic arm. The piecewise point of the third and fourth joint is shown in Equations (20) and (21), and the variable stiffness contour of the third and fourth joint was generalized piecewise. The variation trend in the variable stiffness profile of the third joint and the fourth joint was satisfied, as shown in
Figure 21.
After the generalization of the variable stiffness profile, this experiment showed that the joint trajectories of the robotic arm from joints 1 to 4, as shown in
Figure 22, had end effector errors of 0.0081 rad, −0.0046 rad, −0.0097 rad, and 6.5347 × 10
−5 rad. The end effector errors of each joint trajectory were relatively small, meeting the requirements of end effector accuracy. The RSD values of the trajectories from joint 1 to joint 4 relative to the expected Trajectory 2 are 0.0199, 0.0133, 0.0078, and 0.0211. Compared to Task 4, the RSD value analysis in
Table 11 shows that the joint motion trajectory accuracy of joints 1 to 4 increased by 85.18%, 61.45%, 47.30%, and 86.55%. From this, it can be seen that the motion trajectory generalized by variable stiffness met the requirements of Task 5. By adjusting the variable impedance parameter profile, the torque output by the motor met the motor torque requirements of the task.
To more clearly illustrate the differences between Task 4 and Task 5, the actual experimental process of the robotic arm’s variable impedance is shown in
Figure 23. In the process of Task 4, the trajectory of motion began to deviate slightly at 2 s, and the fourth joint’s trajectory of motion deviated seriously downward at 8 s, which was not sufficient to lift the load. In addition, after returning to the initial position at 10 s, the robotic arm still maintained a deformed posture, that is, the robotic arm did not completely point straight down. On the other hand, Task 5 maintained the same motion trajectory as the desired trajectory throughout the variable impedance actual experimental process. Additionally, after returning to the initial position at 10 s, the robotic arm was able to completely point straight down. The trajectory of the robotic arm after the generalized variable stiffness had been applied to Task 4 met the requirements of the load task.