# Single-Parameter-Tuned Attitude Control for Quadrotor with Unknown Disturbance
## 2 System Model and Identification  
In this paper, an \"X\" type F550 quadrotor is used and tested, and its structure and frame are presented in Figure 1. The attitude of the quadrotor represents the angular error between the body frame and the earth frame.In Figure 1, \(\phi,\varphi,\psi\) represent the roll, pitch, and yaw angles, respectively, while \(\omega_{1}\) to \(\omega_{4}\) represent angular velocities of four rotors. The rotation of a quadrotor can only be controlled by changing the lift force and torque of the four rotors. The rigid-body dynamic model of the quadrotor in this paper can be derived from the Newton-Euler equation:  
\[ \begin{cases}J_{xx}\omega_{x}=\omega_{y}\omega_{2}\left(J_{yy}-J_{zz}\right)+M _{x}+D_{x}\\ J_{yy}\omega_{y}=\omega_{x}\omega_{2}\left(J_{zz}-J_{xx}\right)+M_{y}+D_{y}\\ J_{zz}\dot{\omega}_{z}=\omega_{x}\omega_{y}\left([PERSON]_{xx}-J_{yy}\right)+M_{z}+D_{ z}\end{cases}  \tag{1}\]  
where \(\omega_{x},\omega_{y},\omega_{z}\) are angular velocities of the quadrotor. \(J_{xx},J_{yy},J_{zz}\) are the moment of inertia in three axes. \(M_{x},M_{y},M_{z}\) are torque generated by rotors. \(D_{x},D_{y},D_{z}\) are disturbance torque in three axes, including aerodynamic drag, side wind, center of gravity shift, physical impact, and model error. The torque of three axes are determined by the angular velocities of four rotors:  
\[ \begin{cases}M_{x}=\frac{\sqrt{2}}{C}_{T}*d*ctr_{x}\\ M_{y}=\frac{\sqrt{2}}{2}C_{T}*d*ctr_{y}\\ M_{z}=C_{M}*ctr_{z}\end{cases}  \tag{2}\]  
Figure 1: Coordinate definition. \[ \begin{cases}\mathit{ctr}_{x}=-\omega_{1}^{2}-\omega_{2}^{2}+\omega_{3}^{2}+ \omega_{4}^{2}=scale_{x}*\mathit{a}_{x}\\ \mathit{ctr}_{y}=-\omega_{1}^{2}+\omega_{2}^{2}+\omega_{3}^{2}-\omega_{4}^{2}= scale_{y}*\mathit{a}_{y}\\ \mathit{ctr}_{z}=-\omega_{1}^{2}+\omega_{2}^{2}-\omega_{3}^{2}+\omega_{4}^{2}= scale_{z}*\mathit{a}_{z}\end{cases}  \tag{3}\]  
where \(C_{T}\) is the lift coefficient and \(C_{M}\) is the torque coefficient of the rotors. \(d\) denotes the length of arm of the quadrotor. \(a_{x},a_{y},a_{z}\in[-1,1]\) and \(\mathit{ctr}_{x}\in[-scale_{x},scale_{x}]\,\mathit{ctr}_{y}\in[-scale_{y},scale _{y}]\,\mathit{ctr}_{z}\in[-scale_{z},scale_{z}]\) are intermediate variables. \(scale_{x},scale_{y},scale_{z}\) are scale constants, \(\omega_{1}\) to \(\omega_{4}\) are the triangular velocities of the four rotors in Figure 1. \(a_{x},a_{y},a_{z}\) are the results of attitude controller. The relationships between \(\omega\) and \(\sigma\in[0,1]\) can be modeled as a first order system:  
\[ \begin{cases}\omega=\frac{1}{T_{m}s+1}\omega_{d}\\ \omega_{d}=C_{R}\sigma\end{cases}  \tag{4}\]  
where \(\omega\) and \(\omega_{d}\) denote the current angular velocity and the desired angular velocity, \(T_{m}\) is the dynamic response constant of the motor-rotor system. The accuracy of these parameters is critical. The mass and length can be measured directly, but the measurement of other parameters is difficult. Mechanical parameters, such as moment of inertia, are directly calculated in the Solidworks software package in this paper. The physical parameters of motors and propellers are measured with a motor test beach. The remaining of unknown parameters, including \(C_{M}\) and \(T_{M}\), can be found in a quadrotor data base online: [[https://flyeval.com/](https://flyeval.com/)]([https://flyeval.com/](https://flyeval.com/)) [25]. A simulation environment program in which the quadrotors' states can be updated with the control signals of motors is built with the system model and parameters. The attitude of quadrotors is represented with unit quaternions and updated with the traditional Runge-Kuta method, as shown in Equation (5). \[ \begin{bmatrix}q_{0}\\ q_{1}\\ q_{2}\\ q_{3}\end{bmatrix} =\frac{1}{2} \begin{bmatrix}0&-\omega_{x}&-\omega_{y}&- \omega_{z}\\ \omega_{x}&0&\omega_{z}&-\omega_{y}\\ \omega_{y}&-\omega_{z}&0&\omega_{x}\\ \omega_{z}&\omega_{y}&-\omega_{x}&0\end{bmatrix}\begin{bmatrix}q_{0}\\ q_{1}\\ q_{2}\\ q_{3}\end{bmatrix}  \tag{5}\]  
where \(