## 3 Nonlinear Model Predictive Control Formulation
### Two-Link Robot Arm  
The dynamics model of the system is (shown in Figure 9) given by  
\[\mathbf{M}_{r}(\theta_{r})\dot{\theta}_{r}+\mathbf{C}_{r}(\theta_{r},\dot{ \theta}_{r})=\mathbf{u}_{r} \tag{47}\]  
where \(\theta_{r}\) and \(\mathbf{u}_{r}\) are vectors of the link angles and applied torques, respectively; \(\mathbf{M}_{r}(\theta_{r})\) is a mass matrix function of \(\theta_{r}\) and \(\mathbf{C}_{r}(\theta_{r},\dot{\theta}_{r})\) is a Coriolis force vector function of \(\theta_{r}\) and \(\dot{\theta}_{r}\), and both are given as  
\[\mathbf{M}_{r}(\theta_{r})=\left[ \begin{array}{cc}(m_{r_{1}}+m_{r_{2}})L_{r_ {1}}^{2}+m_{r_{2}}L_{r_{2}}^{2}+2m_{r_{2}}L_{r_{1}}L_{r_{2}}\cos\theta_{r_{2}} &m_{r_{2}}L_{r_{2}}^{2}+m_{r_{2}}L_{r_{1}}L_{r_{2}}\cos\theta_{r_{2}}\\ m_{r_{2}}L_{r_{2}}^{2}+m_{r_{2}}L_{r_{1}}L_{r_{2}}\cos\theta_{r_{2}}&m_{r_{2}} L_{r_{2}}^{2}\end{array} \right], \tag{48}\]  
in which \(m_{r_{1}}\) and \(m_{r_{2}}\) are the masses of links; \(L_{r_{1}}\) and \(L_{r_{2}}\) are the lengths of links; \(\theta_{r_{1}}\) and \(\theta_{r_{2}}\) are the joint angles; the subscripts 1 and 2 refer to the first and second links, respectively. In this study, the joint torques are the control inputs, and the joint angles are the outputs. Thus, this system has two inputs and two outputs. The system parameters are shown in Table 5. The tracking control is performed to track the reference signals 0.5 for both joints. Similar to the previous example, the four control schemes were applied to compare their control performances. The robot parameters are listed in Table 4, and the controller parameters are given as  
\[\mathbf{Q}=150\mathbf{I},\ \mathbf{R}=\mathbf{I},\ p=0.9,\ N=7,\ T_{p}=15 \tag{49}\]  
For comparisons, the controller parameters of the other three schemes are selected as  
\[\mathrm{SDRE}:\ \mathbf{Q}=150\mathbf{I},\ \mathbf{R}=\mathbf{I} \tag{50}\] \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \
\begin{tabular}{c} **Input Constraints** \\ **(N-m)** \\ \end{tabular} & **Controllers** & **Rising Time (s)** & **Settling Time (s)** &
\begin{tabular}{c} **Max. Overshoot** \\ **(Rad)** \\ \end{tabular} & **RMSE (Rad)** \\ \hline \multirow{4}{*}{\(\pm\)4.5} & SDRE & 1.1120 & 15.8700 & 0.3589 & 0.0688 \\  & MPC-TSF & 13.3184 & 20.1470 & 0.0002 & 0.1333 \\  & LQT-FL & N/A & 44.7200 & N/A & N/A \\  & MPC-FL (proposed) & 9.2668 & 12.6885 & 0.0000 & 0.1564 \\ \hline \multirow{4}{*}{\(\pm\)1.9} & SDRE & 1.1360 & 18.7600 & 0.3588 & 0.0766 \\  & MPC-TSF & 13.3184 & 20.1470 & 0.0002 & 0.1333 \\  & LQT-FL & N/A & 45.7200 & N/A & N/A \\  & MPC-FL (proposed) & 9.2668 & 12.6885 & 0.0000 & 0.1564 \\ \hline \multirow{4}{*}{\(\pm\)1.8} & SDRE & 0.7194 & N/A & 0.3500 & 0.1324 \\  & MPC-TSF & 13.3184 & 20.1470 & 0.0002 & 0.1333 \\  & LQT-FL & N/A & 46.7000 & N/A & N/A \\  & MPC-FL (proposed) & 9.2668 & 12.6885 & 0.0000 & 0.1564 \\ \hline \multirow{4}{*}{\(\pm\)0.59} & SDRE & N/A & N/A & N/A & N/A \\  & MPC-TSF & 13.6132 & 23.2655 & 0.0000 & 0.1334 \\ \cline{1-1}  & LQT-FL & N/A & 47.4700 & N/A & N/A \\ \cline{1-1}  & MPC-FL (proposed) & 15.0869 & 20.5160 & 0.0000 & 0.1807 \\ \hline \multirow{4}{*}{\(\pm\)0.56} & SDRE & N/A & N/A & N/A & N/A \\ \cline{1-1}  & MPC-TSF & N/A & N/A & N/A & N/A \\ \cline{1-1}  & LQT-FL & N/A & 50.3700 & N/A & N/A \\ \cline{1-1}  & MPC-FL (proposed) & 15.3072 & 20.5160 & 0.0000 & 0.1840 \\ \hline \hline \end{tabular} Note: N/A refers to the values much greater than the others or non-existent.  
\end{table} 
Table 4: Comparisons of control performances by applying the four control schemes with input constraints to the flexible-joint mechanism. \[\text{MPC-TSF}:\ \mathbf{Q}=150\mathbf{I},\ \mathbf{R}=\mathbf{I},\ p=0.9,\ N=7,\ T_{p}=15 \tag{51}\] \[\text{LQT-FL}:\ \mathbf{Q}=150\mathbf{I},\ \mathbf{R}=\mathbf{I} \tag{52}\]  
Note that the controller parameter values are the same in the four control schemes. Case C: Control without the input constraints for the two-link robot arm  
Figure 10 shows the output and input responses by applying the control schemes.