## 7 Experimental Setup
### Control System Performance Test  
To evaluate NMPC-ECBF, we implement it for a 7-DOF Baxter robot simulated in CoppeliaSim using a standard NMPC controller as a baseline comparison [15]. The system model employed in the MPC controller is discretized using the Euler method. The weight matrices in \(\ell\) and \(\ell_{r}\) are selected as \(\mathbf{Q}_{v}=\text{diag}(1,1,1,1,1,1,1)\), \(\mathbf{Q}_{p}=\text{diag}(5,5,5,1,1,0)\), \(\mathbf{R}_{v}=\text{diag}(0.1,0.1,0.1,0.1,0.1,0.1,0.1)\) and \(\mathbf{R}_{p}=\text{diag}(3,3,3,0,0,0)\). Solution tolerances \(e_{a}=10^{-2}\) and \(e_{b}=10^{-4}\) are set for the fixed-point residual and the infeasibility, respectively. For the safety filter, safe set \(\mathcal{U}\) for input \(\mathbf{u}_{\text{act}}\) is \((-40\,\text{N},40\,\text{N})\). The parameters of the low-level controller are selected as \(k_{z}=5\) and \(c_{1}=0.01\). Noting the maximum joint prediction errors in Figure 6, we set the safe distance (\(d_{\text{safe}}\)) as 10 cm. The ECBF coefficients \(\mathbf{k}_{b}\) are chosen as \([7,7]\), while \(\mathbf{K}_{D}=\text{diag}(5,5,5)\); these values are determined within the range to satisfy Equation (32b). In the CoppeliaSim simulation, the movement of the human is modeled using the recorded trajectories of the skeleton joints. The [PERSON] robot starts from different initial positions and is required to reach the estimated position without collision with the simulated human, as shown in Figure 7a. Under the same conditions, the acceleration and the minimum distance between the end-effector and human obstacle using different algorithms in scenario 1 are plotted in Figure 7b and 7c, respectively. The acceleration plot shows that NMPC-ECBF yields fewer abrupt changes in acceleration than the baseline NMPC path planner. The minimum distance plot highlights that the trajectory generated by NMPC violates the safe area at several points during the robot's motion and that the inclusion of the ECBF safety filter has the desired effect of maintaining the motion within the safe area. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Pick Up** & **Move Forward** & **Take the Screw** & **Operate** & **Move Backward** & **Put Down** \\ \hline LSTM-3 LR [45] & 2.41 & 2.26 & 2.73 & 2.52 & 2.68 & 2.88 \\ \hline Res-sup [46] & 2.18 & 2.14 & 2.42 & 2.38 & 2.57 & 2.71 \\ \hline Traj-GCN [47] & 1.95 & 2.01 & 2.29 & 2.21 & 2.46 & 2.61 \\ \hline SPGSN [48] & 1.33 & 1.96 & 2.01 & 2.09 & 2.41 & 2.37 \\ \hline
**Ours** & **1.29** & **1.92** & **1.98** & **2.07** & **2.39** & **2.35** \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of MPJPE between models for 1000 ms prediction. Figure 7: **(a)** HRC scenario when the initial position is close to the operator. (b) The acceleration of the end-effector; (c) The minimum distance to the obstacles among all the robot links. To prove the stability of the controller, Figure 8a,b illustrates the state of \(V(z_{1})\) and \(\dot{V}(z_{1})\), respectively. It shows the maximum value of \(V(z_{1})\) is less than \(2.5\times 10^{-3}\), which is close to 0. At the same time, the derivative of the Lyapunov function is less than 0.1, which proves the marginal stability of the system. To further assess the robustness and reliability of the controller, we perform 100 dynamic path-planning HRC experiments, with each one corresponding to a randomly generated robot start position and one of the three sets of human screwdriver usage task movement trajectories. For each experiment, we recorded the maximum acceleration of the end-effector and the minimum distance between the end-effector and the target safety margin during the task execution. Table 2 reports the mean and most extreme values observed over the 100 experiments. The results show that NMCP-ECBF is able to strictly keep the robot motion within the safe area for all 100 simulations, with no violations of the safety margin (\(d=0\)).