## 2 System Description
### Baseline LQI Controller  
The Linear Quadratic Integral (LQI) controller is a state-feedback compensator that improves the system's reference tracking accuracy while reducing overshoots and undershoots by introducing an integral error component into the standard LQR framework [33; 34]. The control law is formulated by minimizing a quadratic cost function, which penalizes deviations in both system states and control inputs. The cost function is mathematically represented as follows [35]:  
\[I_{lqi}=\frac{1}{2}\!\int_{0}^{\infty}\Big{(}x(t)^{T}\mathbf{Q}x(t)+u(t)^{T}\mathbf{R} u(t)\Big{)}dt \tag{16}\]  
The state-weighting matrix \(\mathbf{Q}\in\mathbb{R}^{4\times 4}\) is positive semi-definite, while the control-weighting matrix \(\mathbf{R}\in\mathbb{R}\) is positive definite. These matrices are customized to provide a well-balanced compromise between the system's control effort and reference tracking accuracy. The proposed UAV system's \(\mathbf{Q}\) and \(\mathbf{R}\) matrices are represented in Equation (17).  
\[\mathbf{Q}=\text{diag}\Big{(}q_{m}\quad q_{\tilde{m}}\quad q_{\tilde{m}}\quad q_{ \tilde{c}}\ \Big{)},\mathbf{R}=p \tag{17}\]  
To acquire an asymptotically stable control law, the coefficients of the \(\mathbf{Q}\) and \(\mathbf{R}\) matrices are chosen so that \(q_{\tilde{m}}\geq 0\), \(q_{\tilde{m}}\geq 0\), \(q_{\tilde{m}}\geq 0\), \(q_{\tilde{c}}\geq 0\), and \(p>0\). Section 4 describes the offline tuning approach used to configure these coefficients. Once the weighting matrices have been configured offline, the Hamilton-Jacobi-Bellman (HJB) equations are solved to obtain the LQI control law. Their solution yields the following algebraic Riccati Equation (ARE) [35].  
\[\mathbf{A}^{T}\mathbf{P}+\mathbf{PA}-\mathbf{P}\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{T}\mathbf{P}+\mathbf{Q}=0 \tag{18}\]  
The positive definite, symmetric matrix \(\mathbf{P}\in\mathbb{R}^{4\times 4}\) represents the ARE's solution. The state-compensator gain vector \(\mathbf{K}\) is computed as described in Equation (19) [35].  
\[\mathbf{K}=\mathbf{R}^{-1}\mathbf{B}^{T}\mathbf{P} \tag{19}\]  
The optimal LQI control law thus derived from solving the ARE is expressed in Equation (20).  
\[u(t)=-\mathbf{K}x(t) \tag{20}\]  
where \(\mathbf{K}=\begin{bmatrix}k_{m}&k_{\tilde{m}}&k_{\tilde{m}}&k_{\tilde{c}}\end{bmatrix}\). This integral component enhances the system's ability to eliminate steady-state errors and improves disturbance rejection.  
Stability Proof: The LQI controller' stability is established via the following Lyapunov function, ensuring asymptotic convergence under appropriate weight selection [33].  
\[Z(t)=x(t)^{T}\mathbf{P}x(t)>0,\ \text{for}x(t)\
eq 0 \tag{21}\]  
The first derivative of \(Z(t)\) is obtained as illustrated below.  
\[\begin{array}{c}\dot{Z}(t)=2x(t)^{T}\dot{\mathbf{P}}\dot{x}(t)\\ =2x(t)^{T}\mathbf{P}(\mathbf{A}-\mathbf{B}\mathbf{K})x(t)\\ =2x(t)^{T}\mathbf{P}(\mathbf{A}-\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{T}\mathbf{P})x(t)\\ =x(t)^{T}\big{(}\mathbf{P}\mathbf{A}+\mathbf{A}^{T}\mathbf{P}\big{)}x(t)-2x(t)^{T}\big{(}\mathbf{P} \mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{T}\mathbf{P}\big{)}x(t)\end{array} \tag{22}\]  
Substituting Equation (18) into Equation (22) simplifies \(\dot{Z}(t)\), as expressed below.  
\[\dot{Z}(t)=-x(t)^{T}\mathbf{Q}x(t)-x(t)^{T}\Big{(}\mathbf{P}\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{T} \mathbf{P}\Big{)}x(t)<0 \tag{23}\]The expression in Equation (22) depicts that \(\dot{Z}(t)\) becomes a negative definite function if \(R=R^{T}>0\) and \(Q=Q^{T}\geq 0\). Hence, fulfilling the aforementioned prerequisites serves to preserve the asymptotic stability of the LQI control law. The schematic of the LQI control architecture used for the UAV's longitudinal motion control is shown in Figure 2.