# Critically Leveraging Theory for Optimal Control of Quadrotor Unmanned Aircraft Systems
## 2 The Structure and Mathematical Model of the Quadrotor
### Euler-Lagrange Equation  
The plane kinematics equations can be expressed using the Euler-Lagrange formula based on kinetic and potential energy:  
\[\begin{bmatrix}\mathrm{f_{\xi}}\\ \tau_{\mathrm{\eta}}\end{bmatrix}=\frac{\mathrm{d}}{\mathrm{dt}}\left(\frac{ \partial\mathrm{L}}{\partial\dot{\mathrm{q_{i}}}}\right)-\frac{\partial \mathrm{L}}{\partial\dot{\mathrm{q_{i}}}} \tag{5}\]  
\[\mathrm{L}\left(\mathrm{q},\dot{\mathrm{q}}\right)=\mathrm{E_{Ctrans}}+\mathrm{ E_{Crot}}-\mathrm{E_{P}} \tag{6}\]  
where:  
L is the Lagrange function of the Quadcopter model.  
\(\mathrm{E_{Ctrans}}\) is the kinetic energy of translational motion.  
\(\mathrm{E_{Crot}}\) is the kinetic energy of rotation.  
\(\mathrm{E_{P}}\) is the total potential energy.  
\(\mathrm{q}=\left[\mathrm{\acute{x}}\ \mathrm{\acute{\eta}}  
dynamic modellessness. The proposed control strategy based on the distributed structure of the Quadrotor [27] is shown in Figure 4 below.  
First, the trajectory set for the reciprocating motion is fed offline by the trajectory generator block. This calculation is based on a virtual prototype device that has the same model as the Quadrotor for translational motion. Therefore, based on the path \(\mathrm{x}_{r},\mathrm{y}_{r},\mathrm{z}_{r}\), our desired translational motion along with its derivatives will compute the signals set for the control input \(\mathrm{U}_{1r},\mathrm{u}_{\mathrm{x}r},\mathrm{u}_{\mathrm{y}_{r}}\). The yaw angle is set later, which has nothing to do with the outer control loop. This trajectory is created with the assumption that no external disturbances will affect the virtual device and that the aircraft state is stable.  
A predictive controller is used to control the reciprocating motion of the Quadrotor in the outer loop using the signal provided by the trajectory generator block. The Error-based State Space Predictor Controller (E-SSPC) model also includes an integral component of the position error in the state vector to achieve a steady state when continuous disturbances affect each other motion.  
The reciprocating motion control is performed in two stages. The first controls the Quadrotor's height z, and the total thrust \(\mathrm{U}_{1}\) is the impact signal; the second stage, the set signal of the pitch and roll angles (respectively,\(\mathrm{\theta}_{r},\mathrm{\pi}_{r}\)) are calculated through two virtual inputs according to the requirement of motion in the x and y coordinates. It is important to mention that in this second step, the control variable \(\mathrm{U}_{1}\) is utilized as a time-varying parameter.  
Finally, the \(\mathrm{H}_{\infty}\) controller designed for the rotational subsystem is employed in the inner loop to achieve stabilization of the Quadrotor. The angular position and speed are controlled in this ring through the torques on the three coordinate axes, \(\mathrm{\tau}_{\eta a}=\left[\mathrm{\tau}_{\tau a}\quad\mathrm{\tau}_{\theta a }\quad\mathrm{\tau}_{\Psi a}\right]\) are the action variables. In order to achieve the zero-displacement steady state in the presence of continuous external noise, the integral of angular position deviation is also considered. Due to the cascade structure of this strategy and considering the closed loop efficiency achieved by the control loop \(\mathrm{H}_{\infty}\), Euler angles can be considered as time-varying parameters in the design of the net controller up.  
Figure 4: The control structure of the Quadrotor.