# Input-to-State Stability of Variable Impedance Control for Robotic Manipulator
## 4 Simulation
### Extension to 6-DoFs Manipulator  
The planar two-link manipulator simulation is extended to the 6-DoFs spatial manipulator in this section. For the consistency, we keep the same design procedures as introduced in the previous section, for example, \(\alpha=0.75\) and \(\zeta=1\). Thus, the lower bound of linear combination of \(K(t)\) and \(D\) becomes equal to Equation (38). The initial gains are chosen for simplicity as follows;  
\[K(0)=80I\quad\text{and}\quad D=0.8I,\]  
where \(I\in\Re^{6\times 6}\) is an identity matrix. The simulation was conducted using the Gazebo in the ROS (Robot Operating System) environment. The Neuromeka Indy5 was selected for the simulation model, because Indy5 is a commonly used 6-DoFs manipulator like UR5, KUKA-series. A ball-shaped load model was attached to the end-effector of the manipulator to generate the external force. The mass of the load model was assumed to be 5 kg for simulation conditions similar to the two-link manipulator. Also, the force/torque sensor was attached to obtain the force data generated from the ball-shaped load. Figure 2: Snapshots of simulation result according to time progress, where the robotic manipulator used in the simulation has two links. The external force is applied to the x-axis direction forward and backward, alternatively, with 0.25 s duration. Also, \((x_{d},y_{d})=(0.0,0.2)\) was set at a target position from the beginning, and then the target position was changed into \((x_{d},y_{d})=(0.0,0.6)\) at the instant of 1 s.  
Figure 3: Simulation data while performing the simulation suggested in Figure 2; (**a**) Lyapunov function value of Equation (14) with \(\alpha=0.75\), where it was designed using kinetic plus potential energies. (**b**) Time derivative of Lyapunov function of Equation (21), where we could confirm whether the closed-loop control system is being stable. (**c**) \(K(t)\) and \(\dot{K}(t)\) were expressed with the proposed update rule Equation (26). We could confirm that the first sufficient condition of Equation (12) was satisfied. (**d**) Second sufficient condition, that is, \(\left\|\frac{(1-\alpha)}{2}K(t)+D\right\|_{l}-\left\|\frac{1}{2}\dot{H}(q) \right\|\geq 0\) of Equation (13), where we could confirm that Equation (13) was satisfied even though the impedance parameters of \(K(t)\) and \(H(q)\) (its time derivative \(\dot{H}(q)\)) were changed according to the joint configuration. (**e**) External force \(f_{ext}=50\) N applied to the x-axis, alternatively backward and forward with 0.25 s intervals. (**f**) External joint torques obtained by Equation (7). (**g**) Velocity error of the each joint. (**h**) Position error of each joint. Figure 4 shows snapshots regarding the simulation progress. For simplicity, all the desired joint angles are set to be the same values in response to the target posture changes. The initial posture was upright with \(q_{d,i}=0\), for \(i=1,2,\cdots,6\), the first target was given by \(q_{d,i}=\frac{\pi}{4}\) at the instant of 5 s, the second target by \(q_{d,i}=-\frac{\pi}{4}\) at the instant of 10 s, and finally, the target was changed into the initial upright at the instant of 15 s. Figure 5 shows the data plots during the simulation suggested in Figure 4. The behavior of the robotic manipulator was evaluated in the viewpoint of the Lyapunov function and the sufficient conditions suggested in Equations (12) and (13) as main contributions. The data plots were represented similarly to those of the previous two-link manipulator simulation. The Lyapunov function composed of total energy could not go to zero (equilibrium) as observed in Figure 5 when the external force was applied. Also, it is noted that the Lyapunov function value was abruptly increased at the instants of target changes. The time derivative of the Lyapunov function shown in Figure 5 was used to validate the stability of the closed-loop control system. The update rule for the stiffness matrix of Equation (26) was applied as the manner suggested in Theorem 3.