## 4 Inner Loop Controller Design
### Stability Analysis
Meanwhile, if the obstacle avoidance mission is active and conflicts with the escort mission, then \(\dot{V}_{2}\) is in the form  
\[\ddot{q}_{i}=\ddot{q}_{i,r}-\dot{s}_{i} \tag{11}\]6  
where \(X=\left[\overline{\sigma}_{1}^{T},\overline{\sigma}_{2}^{T},\overline{\sigma}_ {3}^{T}\right]^{T}\) and \(P=\left[p_{ij}\right],i,j=1,2,3\) with submatrices given by \(p_{11}=\eta_{1}\lambda_{1}\), \(p_{21}=\eta_{2}\lambda_{1}J_{1}^{+}\), \(p_{22}=\eta_{2}\Lambda_{2}-\eta_{2}\Lambda_{2}J_{1}^{+}J_{1}J_{2}^{+}\), \(p_{23}=-\eta_{2}J_{2}J_{1}^{+}J_{1}J_{3}^{+}\Lambda_{3}+\eta_{2}J_{2}J_{1}^{+}J _{1}J_{2}^{+}J_{3}^{+}\Lambda_{3}\), \(p_{31}=\eta_{3}\lambda_{1}J_{3}J_{1}^{+}\), \(p_{32}=\eta_{3}\Lambda_{2}J_{3}J_{2}^{+}-\eta_{3}\Lambda_{2}J_{3}J_{1}^{+}J_{1}J _{2}^{+}\), and \(p_{33}=\eta_{3}\Lambda_{3}-\eta_{3}J_{3}J_{2}^{+}J_{2}J_{3}^{+}\Lambda_{3}- \eta_{3}J_{3}J_{1}^{+}J_{1}J_{3}^{+}\Lambda_{3}  
In this situation, the solution in Theorem 1, which implies that obstacle avoidance mission has a higher priority and will be fulfilled first when it conflicts with the escort mission, is achieved. Then, the escort mission can be accomplished when there is no conflict. As the NSB method is kinematic, acting on the dynamics through the desired velocity and not the desired position, it is necessary to design \(\lambda_{i,1}\) properly to make the velocity error dominate the position error. The sliding surface (7) contains both position and velocity errors. By inserting Equation (2) into Equation (7) and considering the fact that if every two tasks conflict, then the contributions from \(\widetilde{\sigma}_{2}\) and \(\widetilde{\sigma}_{3}\) can be removed, thus \(\hat{q}_{d}=\hat{q}_{1}\). We require that  
\[ \begin{split}&\left(\hat{q}_{i}-\int_{i,1}^{+}\lambda_{i,1} \widetilde{\sigma}_{i,1}\right)^{T}k_{di}\Big{(}\hat{q}_{i}-\int_{i,1}^{+} \lambda_{i,1}\widetilde{\sigma}_{i,1}\Big{)}\\ &>k_{di}\varepsilon_{i}^{T}\gamma_{i}^{T}e_{i}+k_{di}\gamma_{i} e_{i}\Big{(}\hat{q}_{i}-\int_{i,1}^{+}\lambda_{i,1}\widetilde{\sigma}_{i,1} \Big{)}^{T}+k_{di}\gamma_{i}e_{i}^{T}\Big{(}\hat{q}_{i}-\int_{i,1}^{+}\lambda_ {i,1}\widetilde{\sigma}_{i,1}\Big{)}\end{split}  \tag{23}\]  
By manipulating Equation (23) as an equality and taking the norm on both sides of it, we obtain  
\[\lambda_{i,1}^{\bigstar}\Big{(}\|e_{i}\|,\|\hat{q}_{i}\|\Big{)}=\frac{b_{i}+ \sqrt{b_{i}^{2}+4a_{i}c_{i}}}{2a_{i}}\]  
\[a_{i}=\overline{\sigma}_{i,1}^{2}\]  
\[b_{i}=2\widetilde{\sigma}_{i,1}\Big{(}\|\hat{q}_{i}\|-2\gamma_{i}\|e_{i}\| \Big{)}\]  
\[c_{i}=\gamma_{i}^{2}\|e_{i}\|^{2}+2\gamma_{i}\|e_{i}\|\|\hat{q}_{i}\|-\|\hat{ q}_{i}\|^{2} \tag{24}\]  
Thus, by choosing \(\lambda_{i,1}\Big{(}\|e_{i}\|,\|\hat{q}_{i}\|\Big{)}=\lambda_{i,1}^{\bigstar} \Big{(}\|e_{i}\|,\|\hat{q}_{i}\|\Big{)}+\varrho_{i}\), where \(\varrho_{i}>0\) is chosen based on the robustness to noise, this constant ensures that the robot moves away from the obstacle. Remark 5. If just the two tasks of the escort mission are in conflict, then each robot fulfills only the first two higher-level tasks. Conflicts will not occur where \(\hat{q}_{d}=\hat{q}_{1}+(I-\int_{1}^{+}J_{1})\hat{q}_{2}\). Remark 6. Following [17; 38], if a robot is going to frontally collide with an obstacle and the projection along the tangential direction is null, the robot will stop. Measurement noise \(\varrho_{i}\) can avoid the local minimum which is caused by this situation.