# Curved Path Following Control for a Small Fixed-Wing UAV with Parameters Adaptation
## 3 Controller Design
### The Adaptive Design of \(k_{1}(t)\) and \(k_{2}(t)\)
\begin{array}{ll}T_{1}+\frac{1}{4}(T_{2}-T_{1}),&\text{if }e_{d0}>120\\ T_{1}+\frac{1}{4}(T_{2}-T_{1}),&\text{if }120\geq e_{d0}>80\text{ and }e_{\chi 0}\geq 0\\ T_{1}+\frac{1}{5}(T_{2}-T_{1}),&\text{if }120\geq e_{d0}>80\text{ and }e_{\chi 0}<0\\ T_{1}+\frac{1}{5}(T_{2}-T_{1}),&\text{if }80\geq e_{d0}>0\text{ and }e_{\chi 0}>0\\ 0,&\text{if }80\geq e_{d0}>0\text{ and }e_{\chi 0}\leq 0\\ T_{1}+\frac{1}{5}(T_{2}-T_{1}),&\text{if }e_{d0}=0\\ 0,&\text{if }0>e_{d0}\geq-80\text{ and }e_{\chi 0}>0\\ T_{1}+\frac{1}{5}(T_{2}-T_{1}),&\text{if }0>e_{d0}\geq-80\text{ and }e_{\chi 0}\leq 0\\ T_{1}+\frac{1}{5}(T_{2}-T_{1}),&\text{if }-80>e_{d0}\text{ and }e_{\chi 0}\geq 0\\ T_{1}+\frac{1}{4}(T_{2}-T_{1}),&\text{if }-80>e_{d0}\text{ and }e_{\chi 0}<0.\end{array} \right. \tag{26}\]  
At this time, the discrete relationship between the time constant \(\tau\) and 399 pairs of \((e_{d0},\ e_{\chi 0})\) can be obtained, as can be seen in Figure 6. When following each desired path, the initial state of the UAV will be calculated, and then the corresponding time constant \(\tau\) required to follow this path can be obtained by using the bilinear interpolation method. According to the analysis shown in Section 3.2, the value of \(k_{2}\) should be adjusted adaptively in a certain range near the appropriate value. Additionally, the dynamics of \(e_{\chi}\) is a nonlinear combination of the variable \(e_{d}\) and its differential, which is similar to a PD controller. The method of applying fuzzy logic to a linear PD controller is adopted to the  
Figure 6: The relationship between the time constant \(\tau\) and the initial states of \(e_{d0}\) and \(e_{\chi 0}\). adaptive design of parameter \(k_{2}\). In this study, the adaptive parameter \(k_{2}\) can be calculated around the given nominal value \(k_{20}\) by a fuzzy logic controller as  
\[k_{2}=k_{20}+\Delta k_{2} \tag{27}\]  
where \(\Delta k_{2}\) is the output of the fuzzy logic controller. While designing the fuzzy logic controllers, the value of \(\Delta k_{2}\) is defined by the fuzzy rules described in Table 1, based on \(e_{d}\) and \(\dot{e}_{d}\). The terms NB, NM, NS, Z, PS, PM, and PB stand for negative big, negative medium, negative small, zero, positive small, positive medium, and positive big, respectively. Figure 7a shows the triangular, Z-shaped, and S-shaped membership functions used for the fuzzification of the inputs \(e_{d}\) and \(\dot{e}_{d}\), and the output \(\Delta k_{2}\). The universe of discourse of \(e_{d}\), \(\dot{e}_{d}\), and \(\Delta k_{2}\) are given as \([-240,240]\), \([-30,30]\), and \([-0.00025,0.00075]\), respectively. Figure 7b shows the input-output surface for the fuzzy logic controller among \(e_{d}\), \(e_{d}\), and \(\Delta k_{2}\). The minimum value of \(\Delta k_{2}\) is \(-0.0002042\). In this study, the parameter \(k_{20}\) is chosen as \(0.0008\). Then, \(k_{2}\) is always positive with \(k_{2}>0.000596\). \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \multicolumn{2}{c}{\multirow{2}{*}{\(\Delta k_{2}\)}} & \multicolumn{8}{c}{\(\dot{e}_{d}\)} \\ \cline{3-10}  & & **NB** & **NM** & **NS** & **Z** & **PS** & **PM** & **PB** \\ \hline \multirow{6}{*}{\(e_{d}\)} & NB & PB & PB & PM & PM & PS & Z & Z \\  & NM & PB & PB & PM & PS & PS & Z & NS \\  & NS & PM & PM & PM & PS & Z & NS & NS \\  & Z & PM & PM & PS & Z & NS & NM & NM \\  & PS & PS & PS & Z & NS & NS & NM & NM \\  & PM & PS & Z & NS & NM & NM & NM & NB \\  & PB & Z & Z & NM & NM & NM & NB & NB \\ \hline \end{tabular}
\end{table} 
Table 1: Fuzzy rules to estimate \(\Delta k_{2}\), based on \(e_{d}\) and \(e_{d}\). Figure 7: The properties of the fuzzy controller. (**a**) The membership functions used for the fuzzification of the inputs \(e_{d}\) and \(\dot{e}_{d}\), and the output \(\Delta k_{2}\), respectively; (**b**) Input-output surface of the fuzzy logic controller among \(e_{d}\), \(\dot{e}_{d}\), and \(\Delta k_{2}\).