# Control for Ship Course-Keeping Using Optimized Support Vector Machines
## 3 Controller Design and Stability Analysis
### Controller Design  
First of all, feedback control is applied to the certain terms in the System (3). A desired rudder angle can be defined as  
\[\delta_{d}=\frac{1}{K}(T\ddot{\psi}_{d}+f(\psi,\dot{\psi})\dot{\psi}_{d}+u_{1}) \tag{11}\]  
where \(f(\psi,\dot{\psi})=1+\alpha\dot{\psi}^{2}\), \(u_{1}\) is introduced as an auxiliary controller to deal with the uncertainties in (3). Three error signals are defined as  
\[e=\psi_{d}-\psi \tag{12}\]  
\[\xi=\delta_{d}-\delta \tag{13}\]  
\[\zeta=\dot{e}+\lambda e\left(\lambda>0\right) \tag{14}\]  
Incorporating (11)-(14) into (3), it follows  
\[T\dot{\zeta}=(T\lambda-f(\psi,\dot{\psi}))\dot{e}-u_{1}+\Delta(\psi,\dot{\psi} )+w+K\xi \tag{15}\]  
For the actuator dynamics described by (4), the controller can be designed as  
\[\delta_{c}=\delta_{d}+u_{2} \tag{16}\]  
where \(u_{2}\) is another auxiliary controller. By analogy to (15), it holds  
\[T_{E}\dot{\xi}=T_{E}\dot{\delta}_{d}-\zeta-u_{2} \tag{17}\]  
Thus, based on (15) and (17), an error system can be obtained as  
\[\left. \begin{array}{l}\dot{\zeta}=(\lambda-\frac{f(\psi,\dot{\psi})}{T}) \dot{e}+\frac{\Delta(\psi,\dot{\psi})}{T}+\frac{w}{T}+\frac{K}{\xi}-\frac{1}{T }u_{1}\\ \dot{\zeta}=\dot{\delta}_{d}-\frac{\xi}{T_{E}}-\frac{1}{T_{E}}u_{2}\end{array} \right\} \tag{18}\]  
As can be seen, the above system is linear with respect to the error vector \(\left( \begin{array}{ccc}e&\zeta&\xi\end{array} \right)^{\text{T}}\). Moreover, the convergence of the error system will depend on the design of two auxiliary controllers, i.e., \(u_{1}\) and \(u_{2}\). Lyapunov function method is adopted to obtain proper \(u_{1}\) and \(u_{2}\). This method has been widely used in control engineering since it provides an effective and systematic procedure to obtain a stable controller. For the control of a nonlinear complicated system, this method is usually preferred. For the System (18), a definitely positive Lyapunov function candidate w.r.t. the error vector \(\left( \begin{array}{ccc}e&\zeta&\xi\end{array} \right)^{\text{T}}\) can be defined as \[V_{1}=\frac{1}{2}e^{2}+\frac{1}{2}T\zeta^{2}+\frac{1}{2}T_{E}\xi^{2} \tag{19}\]  
Its derivative w.r.t. time is  
\[\dot{V}_{1}=-\lambda e^{2}+\zeta(T\lambda\dot{e}-f(\psi,\dot{\psi})\dot{e}-u_{ 1}+\Delta(\psi,\dot{\psi})+e+w+K\xi)+\xi(T_{E}\dot{\delta}_{d}-\xi-u_{2}) \tag{20}\]  
As can be seen, to obtain the auxiliary controller \(u_{1}\), one has to deal with the uncertain terms, i.e., \(\Delta(\psi,\dot{\psi})\) and \(w\). For the disturbance \(w\), L2-gain design is applied. This approach derives from H-infinity control strategy and is considered as an effective way to suppress uncertain disturbance. Using this method, an L2-gain performance index should be defined as  
\[\int_{0}^{t}||z||^{2}d\tau\leq\mu_{1}^{2}\int_{0}^{t}w^{2}d\tau+\mu_{2} \tag{21}\]  
where \(\mu_{1},\;\mu_{2}\) are small positive constants, \(z\) is introduced as an evaluation signal. An identity w.r.t. the evaluation signal \(z\) and the disturbance \(w\) can be obtained as  
\[||z||^{2}-\mu_{1}^{2}w^{2}\equiv\frac{1}{4\mu_{1}^{2}}\zeta^{2}-(\frac{1}{2\mu _{1}}\zeta-\mu_{1}w)^{2}+||z||^{2}-\zeta w \tag{22}\]  
Let \(z=[r_{1}e,\;r_{2}\dot{e}]^{\mathsf{T}}(r_{1},r_{2}>0)\), the above identity becomes the following inequality  
\[||z||^{2}-\mu_{1}^{2}w^{2}\leq\frac{1}{4\mu_{1}^{2}}\xi^{2}+r_{1}^{2}e^{2}+r_{ 2}^{2}(\xi^{2}+\lambda^{2}e^{2}-2\lambda\zeta e)-\zeta w \tag{23}\]  
Combining the above inequality with the derivative (20), one has  
\[ \begin{array}{c}\dot{V}_{1}+||z||^{2}-\mu_{1}^{2}w^{2}\leq(r_{1}^{2}+r_{2}^ {2}\lambda^{2}-\lambda)e^{2}+\zeta(T\lambda\dot{e}-f(\psi,\dot{\psi})\dot{e}+ \Delta(\psi,\dot{\psi})+e\\ \qquad\qquad\qquad\qquad\qquad\qquad\qquad+\frac{1}{4\mu_{1}^{2}}\zeta+r_{2}^ {2}\zeta-2r_{2}^{2}\lambda e-u_{1})+\xi(T_{E}\dot{\delta}_{d}+K\zeta-\zeta-u_ {2})\end{array}  \tag{24}\]  
To obtain \(u_{1}\), one has to account for another uncertainty, i.e., \(\Delta(\psi,\dot{\psi})\).