## 3 Design of the Improved NMPC Controller
### Design of the NMPC Controller  
The designed predictive controller refers to the classical NMPC control algorithm developed in [53]. NMPC is essentially a kind of optimal control that aims to minimize the  
Figure 4: The principle block diagram of the proposed controller. trajectory tracking error during control. Therefore, the cost function of the NMPC is often expressed as [53; 54]:  
\[J_{cost}=\frac{1}{2}{\int_{T_{1}}^{T_{2}}\mathbf{e}(t+\tau)^{\mathrm{T}}\mathbf{e}(t+\tau) d\tau} \tag{21}\]  
where \(\mathbf{e}(t+\tau)=\mathbf{q}(t+\tau)-\mathbf{q}_{d}(t+\tau)\) is the prediction error at time \(t+\tau\) and \(\tau\) is the prediction time. \(\mathbf{q}(t+\tau)\) and \(\mathbf{q}_{d}(t+\tau)\) represent the actual and desired joint angles of the system at time \(t+\tau\), respectively. The truncated Taylor series is applied to expand \(\mathbf{q}(t+\tau)\) as follows:  
\[\mathbf{q}(t+\tau)=\mathbf{q}(t)+\tau\hat{\mathbf{q}}(t)+\frac{\tau^{2}}{2}\hat{\mathbf{q}}( \mathrm{t}) \tag{22}\]  
If \(\mathbf{T}(t){=}\left[\mathbf{I}_{9\times 9}\tau\cdot\mathbf{I}_{9\times 9}\frac{\tau^{2}} {2}\cdot\mathbf{I}_{9\times 9}\right]\), \(\mathbf{\rho}\) (\(t\))\({=}\left[\mathbf{q}(t)\hat{\mathbf{q}}(t)\hat{\mathbf{q}}(t)\right]^{\mathrm{T}}\), and \(\mathbf{\rho}_{d}(t){=}\left[\mathbf{q}_{d}(t)\hat{\mathbf{q}}_{d}(t)\hat{\mathbf{q}}_{d}(t) \right]^{\mathrm{T}}\) are taken, then \(\mathbf{q}(t+\tau)\) and \(\mathbf{q}_{d}(t+\tau)\) can be expressed as:  
\[ \begin{array}{l}\mathbf{q}\ (t+\tau)=\mathbf{T}(t)\cdot\mathbf{\rho}(t)\\ \mathbf{q}_{d}(t+\tau)=\mathbf{T}(t)\cdot\mathbf{\rho}_{d}(t)\end{array}  \tag{23}\]  
According to Equation (23), the prediction error \(\mathrm{e}(t+\tau)\) can be re-expressed as:  
\[\mathbf{e}(t+\tau)=\mathbf{T}(t)(\mathbf{\rho}(t)-\mathbf{\rho}_{d}(t)) \tag{24}\]  
The nominal dynamic model of the free-floating dual-arm space robot under ideal conditions can be expressed as follows:  
\[\hat{\mathbf{M}}\cdot\hat{\mathbf{q}}(t)+\hat{\mathbf{h}}=\mathbf{u} \tag{25}\]  
where \(\hat{\mathbf{M}}\) and \(\hat{\mathbf{h}}\) are the nominal inertia matrix and nominal bias force vector of the free-floating dual-arm space robot constructed in the second section of this paper under ideal conditions. According to Equation (25), the vector \(\mathbf{\rho}(t)\) can be expressed as  
\[\mathbf{\rho}(t)= \begin{bmatrix}\mathbf{q}(t)\\ \hat{\mathbf{q}}(t)\\ \hat{\mathbf{q}}(t)\end{bmatrix} = \begin{bmatrix}\mathbf{q}(t)\\ \hat{\mathbf{q}}(t)\\ -\hat{\mathbf{M}}^{-1}\cdot\hat{\mathbf{h}}\end{bmatrix} + \begin{bmatrix}0_{9\times 1} \\ 0_{9\times 1}\\ \hat{\mathbf{M}}^{-1}\cdot\mathbf{u}\end{bmatrix}  \tag{26}\]  
According to Equation (26), the cost function \(J_{cost}\) in Equation (21) can be re-expressed as  
\[J_{\text{cos}\,t}=\frac{1}{2}(\mathbf{\rho}(t)-\mathbf{\rho}_{d}(t))^{\mathrm{T}}\mathbf{ \Pi}(\mathbf{\rho}(t)-\mathbf{\rho}_{d}(t)) \tag{27}\]  
The matrix \(\mathbf{\Pi}\) in the above formula is expressed as  
\[ \begin{array}{l}\mathbf{\Pi}=\int_{T_{1}}^{T_{2}}\mathbf{T}(t)^{\mathrm{T}}\mathbf{T}(t) d\tau\\ =\left[\begin{array}{c}T_{r}\cdot\mathbf{I}_{9\times 9}\frac{T_{2}}{3}\cdot\mathbf{I}_{9 \times 9}\frac{T_{4}}{8}\cdot\mathbf{I}_{9\times 9}\\ \frac{T_{r}}{6}\cdot\mathbf{I}_{9\times 9}\frac{T_{4}}{8}\cdot\mathbf{I}_{9\times 9} \frac{T_{5}}{20}\cdot\mathbf{I}_{9\times 9}\end{array}\right]\end{array}  \tag{28}\]  
where the rolling period \(T_{r}=T_{2}-T_{1}\). The system control law \(\mathbf{u}_{m}\) of the predictive control unit can be solved according to \(\frac{\partial\mathcal{I}_{\text{last}}}{\partial\mathbf{u}_{m}}=0\):  
\[\mathbf{u}_{m}=-\hat{\mathbf{M}}\left\{ \begin{array}{l}\left[\begin{array}{c}\frac{ 10}{3\mathcal{I}_{7}}\cdot\mathbf{I}_{9\times 9}\frac{5}{2\mathcal{I}_{7}}\cdot\mathbf{I}_{9 \times 9}&\mathbf{I}_{9\times 9}\end{array}\right]\cdot\\ \left\langle\left[\begin{array}{c}\mathbf{q}(t)-\mathbf{q}_{d}(t)\\ \mathbf{q}(t)-\mathbf{q}_{d}(t)\\ -\hat{\mathbf{M}}^{-1}\cdot\hat{\mathbf{q}}_{d}(t)\end{array}\right]\right.\end{array}