## 3 The MPC Controller Design for the Controllable Pitch Propeller  
### Mathematical Modeling  
In designing an MPC-derived controller, a mathematical model allowing for the prediction of the controlled system's state is necessary. This model is typically described in a state-space pattern in modern control. At the moment \(k\), the state of the controlled system \(x(k)\in R^{n}\), the control input \(u(k)\in R^{l}\), and the output \(y(k)\in R^{q}\) can be obtained. Correspondingly, the controlled model at \(k\) can be written as:  
\[x(k+1)=f(x(k),u(k)),x(0)=x_{0} \tag{9a}\] \[y(k)=h(x(k),u(k)) \tag{9b}\]  
According to Equation (9), \(p\) is taken as the prediction time domain, the measured output of the system \(y(k)\) can be considered as the starting point of the output, and \(x(k)\) can be regarded as the beginning of the prediction state. The output of the prediction time domain \(p\) can be estimated at any moment from \(k+1\) to \(k+p\) according to the moment \(k\). The output of the \(k+i\) can be expressed as follows:  
\[y_{p}(k+i|k) \tag{10}\]  
Subsequently, the system's output in the prediction time domain \(p\) is recorded as:  
\[\left\{y_{p}(k+1|k),y_{p}(k+2|k)\dots y_{p}(k+p|k)\right\} \tag{11}\]  
Similarly, the control input within the prediction time domain \(p\) is defined as:  
Figure 6: System identification results. \[U_{k}=\{u(k|k),u(k+1|k),\cdots,u(k+p-1|k)\} \tag{12}\]  
Each component of the control input vector \(U_{k}\) is independent and needs to be solved as an optimization problem. The controller's goal is to minimize the output for the desired one. The reference input in the control time domain includes:  
\[\{r(k+1),r(k+2),\cdots,r(k+p)\} \tag{13}\]  
To maximize the consistency between the predicted and the expected outputs, the difference between the two output vector components should be accumulated when establishing the optimization objective function. The optimization objective function can be defined as:  
\[J(y(k),U_{k})=\sum_{i=k+1}^{k+p}\left(r(i)-y_{p}(i|k)\right)^{2} \tag{14}\]  
For the control inputs and system outputs, constraints are generally imposed for engineering applications. The limits can be expressed as below:  
\[ \begin{array}{l}u_{\min}\leq u(k+i)\leq u_{\max},i\geq 0\\ y_{\min}\leq y(k+i)\leq y_{\max},i\geq 0\end{array}  \tag{15}\]  
Solving the optimal control inputs can be divided into two parts. First, the controller inputs to the system can minimize the output, considering the reference inputs. Second, by solving the control inputs \(U_{k}\), the control inputs and the system outputs can meet the control constraints \(u_{\min}\leq u(k+i)\leq u_{\max}\) and the output constraints \(y_{\min}\leq y(k+i)\leq y_{\max}\). Ultimately, an optimal solution addressing the above problem at \(k\) can be obtained:  
\[U_{k}^{*}=\{u^{*}(k|k),u^{*}(k+1|k),\cdots,u^{*}(k+p-1|k)\} \tag{16}\]  
Based on the mechanical modeling and system identification of the pitch paddle hydraulic system in Section 2, Equation (9) can be rewritten in incremental form, and the hydraulic system can be represented as a state space:  
\[ \begin{array}{l}\Delta x(k+1)=A\Delta x(k)+B_{u}\Delta u(k)+B_{d}\Delta d(k )\\ y_{c}(k)=C_{c}\Delta x(k)+y_{c}(k-1)\end{array}  \tag{17}\]  
where \(A= \begin{pmatrix}-1.9480&-1.7010\\ 1.000&0\end{pmatrix} \), \(B_{u}= \begin{pmatrix}1\\ 0\end{pmatrix} \), \(C_{c}= \begin{pmatrix}-0.0766&2.303\end{pmatrix} \), \(x(k)\in R^{n_{x}}\) corresponds to the state variable, \(u(k)\in R^{n_{u}}\) denotes the control input variable, \(y_{c}(k)\in R^{n_{c}}\) stands for the controlled output variable, and \(d(k)\in R^{n_{d}}\) signifies the measurable external disturbance variable. When the MPC controller works, the speed of solving the optimization problem will affect the controller's timeliness. For a faster computing speed on the part of the algorithm, the number of independent variables for the optimization problem is typically reduced.