## 4 Simulations
### Simulation Results
The force performances in two situations are depicted in Figure 10 in which the continuous black line represents desired force \(F_{desired}\), the blue dot-dash line represents external interactive force  
Figure 8: Position tracking effort along the Z-direction. Figure 6: Position response along the X-direction. Figure 7: Position tracking effort along the Y-direction. in conventional impedance \(F_{ext-imp}\), and the dash red line represents the external interactive force of impedance-contact-loss \(F_{ext-imp-cl}\) in the X-direction. The parameter \(\beta\) changes its value from 1 to 0 after contact-loss happens along with the change in parameter \(\varphi\) and tank variable \(x_{t}\) in Figure 9. The time for switching value of both parameter \(\beta\) is slightly delayed from the time of contact-loss. The reason for this phenomenon is that when contact-loss happens at the time of 7.62 s, the value of the tank variable \(x_{t}\) increases; thus, increasing the value of energy tank \(T\) until reaching the upper limitation \(T^{u}\). When the value of \(T\) equals \(T^{u}\), parameter \(\beta\) is automatically passively switched from 1 to 0, and the trajectory is then faded. The switching of parameter \(\varphi\) occurs when satisfying both two conditions: after contact-loss is detected and condition in Equation (27). It is noticed that the problem of overshoot at the beginning of contact motion is not considered in this study. This problem will be considered as the next step of improvements for safety interactions. In the second simulation, we consider the case of a rippled surface of the constrained framework to evaluate responses of the energy tank variable under several different values of force control gains. The constrained framework is presented as  
\[x_{env}=\left\{ \begin{array}{ll}2200\ +20\sin(2\pi t/1.75)(mm)&if\ t<7s\\ 2200\ (mm)&if\ 7\leq t\leq 7.62s\\ 2535(mm)&\text{otherwise}\end{array} \right. \tag{51}\]  
Similar to the first case study, we suppose that the contact-loss happens at the time of 7.62 s. In this case study, only tracking evaluation along the X-direction and response of the virtual energy tank variable are discussed due to similar responses of tracking performances in Y- and Z-directions and other switching parameters. Furthermore, we investigate the end-effector and energy variable  
Figure 10: Force tracking effort when considering contact-loss problem. Figure 9: Response of the switched parameter \(\beta\) when contact-loss happens. behaviors under several different control gains. Herein, we consider nine different control gains and we display them in different line styles. The tracking effort and response of the energy variable are displayed in Figures 11 and 12. Particularly, green lines, blue lines, and red lines denote tracking efforts when the force proportional gain is set as \(K_{pf}=1,K_{pf}=1.75,K_{pf}=2\), respectively. Among that, dashed lines, dashed-dot lines, and continuous lines present system behaviors when the force integral gains are \(K_{lf}=1,K_{lf}=2,K_{lf}=3\), respectively. (Note that since the force control is only regulated in the X-direction, then in this case, we consider force control gains as a scalar, not matrix as defined above.) As can be seen in Figures 11 and 12, the tracking performance of the end-effector changes under rippled framework no matter how different values of force control gains are. Due to consideration of the rippled surface, the force tracking effort varies around the desired value of 100 (N). The force tracking effort directly affects position tracking performance. Generally, larger values of the force control gains generate more accurate, faster, and smoother response of the end-effector when contact-loss happens. However, too-large values of control gains (in this case is when the value of \(K_{pf}\) is greater than 2) may degrade tracking efforts and execute unexpected motions as a trade-off. As revealed in Figure 12, large gains may result in more overshoot phenomena at the beginning.