## 4 The FO PI\({}^{\lambda}\)D\({}^{\mu}\) Controller of a Ship's Course  
### FO PI\({}^{\lambda}\)D\({}^{\mu}\) Controller Design  
The working principle of the FO PI\({}^{\lambda}\)D\({}^{\mu}\) controller system of a ship's course is shown in Figure 4.  
In Figure 4, the actual course is determined with the compass and compared with the given course to generate the course deviation, which enters the FO PI\({}^{\lambda}\)D\({}^{\mu}\) controller. It then calculates the rudder angle signal to be generated, and the rudder is turned to the required angle when the rudder receives the command signal to make the ship start to change its course. The rudder then returns to its zero position, completing the course revision. In this paper, given the values of the gain margin \(A_{m}\) and phase margin \(\phi_{m}\), the parameters of the FO PI\({}^{\lambda}\)D\({}^{\mu}\) controller parameters can be calculated [39]. Starting from the basic definitions of \(A_{m}\) and \(\phi_{m}\), the dynamically controlled object \(G_{p}(s)\) and the controller \(G_{c}(s)\) should satisfy the following relationships:  
\[\phi_{m}=arg\big{[}G_{c}\big{(}j\omega_{g}\big{)}G_{p}\big{(}j\omega_{g}\big{)} \big{]}\ +\ \pi \tag{12}\]  
\[A_{m}=\frac{1}{|G_{c}(j\omega_{p})G_{p}\big{(}j\omega_{p}\big{)}|} \tag{13}\]  
where \(\omega_{g}\) meets  
\[\big{|}G_{c}\big{(}j\omega_{g}\big{)}G_{p}\big{(}j\omega_{g}\big{)}\big{|}\ =1 \tag{14}\]  
and where \(\omega_{p}\) meets  
\[arg\big{[}G_{c}\big{(}j\omega_{p}\big{)}G_{p}\big{(}j\omega_{p}\big{)}\big{]} \ =-\pi \tag{15}\]  
By substituting \(G_{c}(s)\) with Equation (6), the following relationship is obtained:  
\[K_{p}+K_{i}\frac{cos\frac{\pi\lambda}{2}}{\omega_{p}^{\lambda}}+K_{d}cos\frac {\pi\mu}{2}\omega_{p}^{\mu}=R_{mp} \tag{16}\]  
\[K_{p}+K_{i}\frac{cos\frac{\pi\lambda}{2}}{\omega_{g}^{\lambda}}+K_{d}cos\frac {\pi\mu}{2}\omega_{g}^{\mu}=R_{mg} \tag{17}\]  
\[-K_{i}\frac{sin\frac{\pi\lambda}{2}}{\omega_{p}^{\lambda}}+K_{d}sin\frac{\pi \mu}{2}\omega_{p}^{\mu}=I_{mp} \tag{18}\]  
\[K_{i}\frac{sin\frac{\pi\lambda}{2}}{\omega_{g}^{\lambda}}+K_{d}sin\frac{\pi \mu}{2}\omega_{g}^{\mu}=I_{mg} \tag{19}\]  
where  
\[-\frac{1}{A_{m}G_{p}\big{(}j\omega_{p}\big{)}}=R_{mp}+jI_{mp} \tag{20}\]  
\[\phi_{m}=arg\big{[}G_{c}\big{(}j\omega_{g}\big{)}G_{p}\big{(}j\omega_{g}\big{)} \big{]}\ +\ \pi \tag{12}\]0  
When the controller is designed, as the controlled object \(G_{p}(s)\) and \(A_{m}\) and \(\phi_{m}\) are known from Equations (16)-(19), the error squared minimization equation is introduced into the parameter calculation:  
\[\phi_{m}=arg\big{[}G_{c}\big{(}j\omega_{g}\big{)}G_{p}\big{(}j\omega_{g}\big{)} \big{]}\ +\ \pi \tag{12}\]1  
\[\phi_{m}=arg\big{[}G_{c}\big{(}j\omega_{g}\big{)}G_{p}\big{(}j\omega_{g}\big{)} \big{]}\ +\ \pi \tag{12}\]2 FO PI\({}^{\lambda}\)D\({}^{\mu}\) control system of a ship’s course. Here, \(\omega_{p}\), \(\omega_{g}\), \(\lambda\), and \(\mu\) need to meet the following constraints:  
\[ \begin{array}{c}\Big{(}\omega_{g}^{\lambda+\mu}-\omega_{p}^{\lambda+\mu}\Big{)} \big{(}R_{mp}-R_{mg}\big{)}+\Big{(}\omega_{p}^{\lambda+\mu}I_{mp}+\omega_{g}^{ \lambda+\mu}I_{mg}\Big{)}cot\big{(}\frac{\pi\mu}{2}\big{)}+\\ \Big{(}\omega_{p}^{\lambda+\mu}I_{mg}+\omega_{g}^{\lambda+\mu}I_{mp}\Big{)}cot \Big{(}\frac{\pi\lambda}{2}\Big{)}-\Big{(}\omega_{p}^{\lambda}\omega_{g}^{\mu} I_{mp}+\omega_{g}^{\lambda}\omega_{p}^{\mu}I_{mg}\Big{)}\Big{(}cot\frac{\pi \lambda}{2}+cot\frac{\pi\mu}{2}\Big{)}=0\end{array}