# A Model-Free Online Learning Control for Attitude Tracking of Quadrotors
## 2 Model Description and Problem Statement
### Attitude Model of a Quadrotor  
The attitude of the quadrotors is modeled as an airborne rigid body in terms of the unit-quaternion, \(\mathbf{q}\). Thus, the attitude dynamics are given by the following [20; 21]:  
\[\dot{\mathbf{q}}(t)= \begin{bmatrix}\dot{s}(t)\\ \dot{\mathbf{v}}(t)\end{bmatrix} =\frac{1}{2} \begin{bmatrix}-\mathbf{v}(t)^{T}\\ \mathbf{v}(t)^{\wedge}+s(t)\mathbf{I}_{3}\end{bmatrix} \mathbf{\omega}(t) \tag{2}\]  
\[\dot{\mathbf{J}}\dot{\mathbf{\omega}}(t)=-\mathbf{\omega}(t)^{\wedge}\dot{\mathbf{J}}\mathbf{ \omega}(t)+\mathbf{u}(t)+\mathbf{d}(t) \tag{3}\]  
where \(\mathbf{\omega}(t)\in\mathbb{R}^{3\times 1}\) is the angular velocity of the quadrotor expressed in the body frame; \(\mathbf{J}\in\mathbb{R}^{3\times 3}\) denotes the inertia matrix, which is a positive definite constant matrix; \(\mathbf{u}(t)\in\mathbb{R}^{3}\) is the control torques provided by four rotors; and \(\mathbf{d}(t)\in\mathbb{R}^{3}\) denotes the time-varying external disturbance torques acting on the vehicle. For the sake of brevity, time stamps will be omitted below when they do not interfere with comprehension, e.g., writing \(\mathbf{\omega}(t)\) as \(\mathbf{\omega}\). Once given the desired attitude quaternion, \(\mathbf{q}_{d}=\big{[}s_{d},\mathbf{v}_{d}^{T}\big{]}^{T}\), desired rotational speeds \(\mathbf{\omega}_{d}\) and desired rotational accelerations \(\dot{\mathbf{\omega}}_{d}\), the attitude tracking error quaternion \(\mathbf{q}_{e}=\big{[}s_{e},\mathbf{v}_{e}^{T}\big{]}^{T}\) and angular velocity error \(\mathbf{\omega}_{e}\) can be defined as follows:  
\[ \begin{cases}s_{e}=ss_{d}+\mathbf{v}^{T}\mathbf{v}_{d}\\ \mathbf{v}_{e}=s_{d}\mathbf{v}-s\mathbf{v}_{d}+\mathbf{v}^{\wedge}\mathbf{v}_{d}\end{cases}  \tag{4}\]  
\[\mathbf{\omega}_{e}=\mathbf{\omega}-\mathbf{\Omega}_{d} \tag{5}\]  
where \(\mathbf{\Omega}_{d}=\big{(}\mathbf{R}(\mathbf{q}_{e})\big{)}^{T}\mathbf{\omega}_{d}\). By directly differentiating \(\mathbf{q}_{e}\) and \(\mathbf{\omega}_{e}\), the tracking error dynamics can be obtained as follows:  
\[\dot{\mathbf{q}}_{e}= \begin{bmatrix}\dot{s}_{e}\\ \dot{\mathbf{v}}_{e}\end{bmatrix} =\frac{1}{2} \begin{bmatrix}-\mathbf{v}_{e}^{T}\mathbf{ \omega}_{e}\\ \big{(}s_{e}\mathbf{I}_{3}+\mathbf{v}_{e}^{\wedge}\big{)}\mathbf{\omega}_{e}\end{bmatrix}  \tag{6}\]  
\[\dot{\mathbf{J}}\dot{\mathbf{\omega}}_{e}=-\mathbf{\omega}^{\wedge}\dot{\mathbf{J}}\mathbf{\omega}+ \mathbf{J}\Big{(}\mathbf{\omega}_{e}^{\wedge}\mathbf{\Omega}_{d}-\dot{\mathbf{\Omega}}_{d} \Big{)}+\mathbf{u}+\mathbf{d} \tag{7}\]  
where \(\dot{\mathbf{\Omega}}_{d}=\big{(}\mathbf{R}(\mathbf{q}_{e})\big{)}^{T}\dot{\mathbf{\omega}}_{d}\). Note that the thrust and torsional torque produced by each rotor are bounded; the desired rotational speeds and accelerations given by the user or higher-level controller are also bounded. Therefore, the following reasonable assumptions are made. **Assumption 1**. : _Control torque \(\mathbf{u}\) is bounded; i.e., there exists \(\overline{u}>0\) such that \(\|\mathbf{u}\|\leq\overline{u}\). \(\mathbf{\omega}_{d}\) and \(\dot{\mathbf{\omega}}_{d}\) are bounded, and thus \(\mathbf{\omega}_{e}\) and \(\dot{\mathbf{\omega}}_{e}\) are bounded; i.e., there exist \(\overline{\omega}_{d}\), \(\overline{\omega}_{d}\), \(\overline{\omega}_{e}\), \(\overline{\omega}_{e}>0\), such that \(\|\mathbf{\omega}\|_{d}\leq\overline{\omega}_{d}\), \(\|\dot{\mathbf{\omega}}_{d}\|\leq\overline{\omega}_{d}\), \(\|\mathbf{\omega}_{e}\|\leq\overline{\omega}_{e}\), and \(\|\dot{\mathbf{\omega}}_{e}\|\leq\overline{\dot{\omega}}_{e}\)._  
**Assumption 2**. : _External disturbance torque \(\mathbf{d}\) is bounded; i.e., there exists \(\overline{d}>0\) such that \(\|\mathbf{d}\|\leq\overline{d}\)._  
In practice, the inertia matrix \(\mathbf{J}\) is unknown, but it can be estimated by weighting the individual components of the quadrotor and building a physical model [22].