## 3 Attitude Controller Design
### Prediction Equation for the Feedback Linearized Model  
The discrete-time state-space equation of the feedback linearized model (12) can be obtained using the zero-order hold method:  
\[\mathbf{\kappa}_{[k+1]}=A_{\rm d}\mathbf{\kappa}_{[k]}+\mathbf{B}_{\rm d}\mathbf{\upsilon}_{[ k]}, \tag{16}\]  
where \(A_{\rm d}=\mathbf{e}^{AT_{s}}\), \(\mathbf{B}_{\rm d}=\mathbf{A}^{-1}(\mathbf{e}^{AT_{s}}-\mathbf{I})\mathbf{B}\). According to the model predictive control theory, (16) can be rewritten into an incremental form:  
\[\mathbf{\kappa}_{[k+1]}=\mathbf{A}_{\rm d}\delta\mathbf{\kappa}_{[k]}+\mathbf{B}_{\rm d}\delta \mathbf{\upsilon}_{[k]}+\mathbf{\kappa}_{[k]}, \tag{17}\]  
where \(\delta\mathbf{\upsilon}_{[k]}=\mathbf{\upsilon}_{[k]}-\mathbf{\upsilon}_{[k-1]}\), \(\delta\mathbf{\kappa}_{[k]}=\mathbf{\kappa}_{[k]}-\mathbf{\kappa}_{[k-1]}\). Based on the state vector \(\mathbf{\kappa}_{[k]}\) at step \(k\), the state vector at step \(k+1\) can be predicted as:  
\[\mathbf{\kappa}_{[k+1]k}=\mathbf{A}_{\rm d}\delta\mathbf{\kappa}_{[k]k}+\mathbf{B}_{\rm d} \delta\mathbf{\upsilon}_{[k]k}+\mathbf{\kappa}_{[k]k}, \tag{18}\]  
Figure 2: The attitude control system structure. the state vector at step \(k+2\) can be predicted as:  
\[\mathbf{\kappa}_{[k+2][k]} =(\mathbf{A_{\mathrm{d}}}^{2}+\mathbf{A_{\mathrm{d}}})\delta\mathbf{\kappa}_{[k [k]]}+(\mathbf{A_{\mathrm{d}}}\mathbf{B_{\mathrm{d}}}+\mathbf{B_{\mathrm{d}}})\delta\mathbf{v}_ {[k[k]]}+\mathbf{B_{\mathrm{d}}}\delta\mathbf{v}_{[k+1[k]]}+\mathbf{\kappa}_{[k[k]]}. \tag{19}\]  
where \(\delta\mathbf{v}_{[k+i[k]}\) is the control input increment at step \(k+i\) predicted at step \(k\); \(\mathbf{\kappa}_{[k+i[k]}\) is the system state vector predicted at step \(k+i\) from step \(k\). Similarly, the state vectors at step \(k+N_{\mathrm{c}}\) and at step \(k+N_{\mathrm{p}}\) are given by:  
\[\mathbf{\kappa}_{[k+N_{\mathrm{c}}[k]} =\sum_{i=1}^{N_{\mathrm{p}}}\mathbf{A_{\mathrm{d}}}^{i}\delta\mathbf{ \kappa}_{[k]}+\sum_{i=0}^{N_{\mathrm{p}}-1}\mathbf{A_{\mathrm{d}}}^{i}\mathbf{B_{ \mathrm{d}}}\delta\mathbf{v}_{[k[k]]}+\cdots+\mathbf{B_{\mathrm{d}}}\delta\mathbf{v}_{[k+N _{\mathrm{c}}-1[k]}+\mathbf{\kappa}_{[k]}. \tag{20}\] \[\mathbf{\kappa}_{[k+N_{\mathrm{p}}[k]} =\sum_{i=1}^{N_{\mathrm{p}}}\mathbf{A_{\mathrm{d}}}^{i}\delta\mathbf{ \kappa}_{[k]}+\sum_{i=0}^{N_{\mathrm{p}}-1}\mathbf{A_{\mathrm{d}}}^{i}\mathbf{B_{ \mathrm{d}}}\delta\mathbf{v}_{[k]}+\cdots+\sum_{i=0}^{N_{\mathrm{p}}-N_{\mathrm{c} }}\mathbf{A_{\mathrm{d}}}^{i}\mathbf{B_{\mathrm{d}}}\delta\mathbf{v}_{[k+N_{\mathrm{c}}-1 [k]}+\mathbf{\kappa}_{[k]}. \tag{21}\]  
where \(N_{\mathrm{c}}\) is the control horizon and \(N_{\mathrm{p}}\) is the prediction horizon. To reduce the computational burden, the control inputs will be held constant at the value from the previous time step once the time exceeds the control horizon. By combining equations (18) through (21) and defining the control input increment vector \(\delta\mathbf{V}_{[k]}^{\mathrm{T}}=\left(\delta\mathbf{v}_{[k]}\quad\delta\mathbf{v}_{[k +1][k]}\quad\cdots\quad\delta\mathbf{v}_{[k+N_{\mathrm{c}}[k]}\right)\) and state vector \(\mathbf{Z}_{[k]}^{\mathrm{T}}=\left(\mathbf{\kappa}_{[k+1][k]}\quad\mathbf{\kappa}_{[k+2 ][k]}\quad\cdots\quad\mathbf{\kappa}_{[k+N_{\mathrm{p}}[k]}\right)\), the predicted states from step \(k+1\) to \(k+N_{\mathrm{p}}\) can be written as:  
\[\mathbf{Z}_{[k]}=\mathbf{P}\delta\mathbf{\kappa}_{[k]}+\mathbf{I}\mathbf{\kappa}_{[k]}+\mathbf{H} \delta\mathbf{V}_{[k]}, \tag{22}\]  
where  
\[\mathbf{P}= \begin{pmatrix}\mathbf{A_{\mathrm{d}}}\\ \sum\limits_{i=1}^{2}\mathbf{A_{\mathrm{d}}}^{i}\\ \vdots\\ \sum\limits_{i=1}^{N_{\mathrm{p}}}\mathbf{A_{\mathrm{d}}}^{i}\\ \sum\limits_{N_{\mathrm{p}}\times 1}\end{pmatrix} \mathbf{J}= \begin{pmatrix}\mathbf{I}_{ \mathrm{n}\times n}\\ \mathbf{I}_{\mathrm{n}\times n}\\ \vdots\\ \mathbf{I}_{\mathrm{n}\times n}\end{pmatrix} _{N_{\mathrm{p}}\times 1},\mathbf{H}=