# Research and Verification of Trajectory Tracking Control of a Quadrotor Carrying a Load
## 2 Establishment of a Quadrotor Carrying a Load
\begin{array}{l}\ddot{\phi}=\left[U_{2}+\dot{\theta}\dot{\psi}\! \left(I_{y}-I_{z}\right)\right]/I_{x}+d_{\phi}\\ \ddot{\theta}=\left[U_{3}+\dot{\phi}\dot{\psi}\!\left(I_{z}-I_{x}\right) \right]/I_{y}+d_{\theta}\\ \ddot{\psi}=\left[U_{4}+\dot{\phi}\dot{\theta}\!\left(I_{x}-I_{y}\right) \right]/I_{z}+d_{\varphi}\\ \ddot{X}=U_{1x}/\ M\ +d_{x}\\ \ddot{Y}=U_{1y}/\ M\ +d_{y}\\ \dot{Z}=U_{1z}/\ M\ -g+d_{z}\end{array} \right. \tag{3}\]  
Figure 1: Space model of a quadrotor carrying a load. where \(U_{1x}\), \(U_{1y}\) and \(U_{1z}\) are denoted as follows:  
\[\left\{ \begin{array}{l}U_{1x}=(\cos\!\phi\sin\!\theta\cos\!\psi+\sin\!\phi\sin \!\psi)\,U_{1}\\ U_{1y}=(\cos\!\phi\sin\!\theta\sin\!\psi-\sin\!\phi\cos\!\psi)\,U_{1}\\ U_{1z}=(\cos\!\phi\cos\!\theta)\,U_{1}\end{array} \right. \tag{4}\]  
where \(U_{2}\), \(U_{3}\) and \(U_{4}\) represent the roll force, pitch force and yaw moment. \(I_{x}\), \(I_{y}\) and \(I_{z}\) represent the moment of inertia on the corresponding coordinate axes, and \(l\) is the half-length of the motor shaft; \(d_{i}\) is the total disturbance term of model uncertainty, unknown external disturbance, air damping torque, propeller gyro torque and wind field disturbance. Based on the quadrotor model established above, a hanging load is added for modeling. The coordinates of the hanging loads in the inertial coordinate system are shown in Equation (5):  
\[\left\{ \begin{array}{l}x_{1}=x+L\sin\!\beta\\ y_{1}=y+L\sin\!\cos\!\beta\\ z_{1}=z-L\cos\!\beta\cos\!\alpha\end{array} \right. \tag{5}\]  
where \(L\) is the length of the hanging rope, \(x\), \(y\), \(z\) are the position coordinates of the quadrotor and \(x_{1}\), \(y_{1}\), \(z_{1}\) are the position coordinates of the hanging load. Using [PERSON]'s principle and [PERSON]'s formula, the system is simplified as follows:  
\[\frac{d}{d_{\tau}}\left(\frac{\partial(T-P)}{\partial\dot{n}}\right)-\left( \frac{\partial(T-P)}{\partial n}\right)=0 \tag{6}\]  
where \(T\) is the kinetic energy of the whole system, \(P\) is the potential energy of the whole system and \(n\) represents the \(\alpha\) swing angle or the \(\beta\) swing angle. Calculate \(T\) and \(P\) separately. The first-order derivation of both sides of Equation (5) leads to Equation (7):  
\[\left\{ \begin{array}{l}\dot{x}_{1}=\dot{x}+L\cos\!\beta\dot{\beta}\\ \dot{y}_{1}=\dot{y}-L\left(\sin\!\beta\sin\!\alpha\dot{\beta}-\cos\!\beta\cos \!\alpha\dot{\alpha}\right)\\ \dot{z}_{1}=\dot{z}+L\left(\sin\!\beta\cos\!\alpha\dot{\beta}+\cos\!\beta\sin \!\alpha\dot{\alpha}\right)\end{array} \right. \tag{7}\]  
The kinetic energy \(T\) of the entire system is shown in Equation (8):  
\[T=\frac{1}{2}M\left(\dot{x}^{2}+\dot{y}^{2}+\dot{z}^{2}\right)+\frac{1}{2}m \left(\dot{x}_{1}^{2}+\dot{y}_{1}^{2}+\dot{z}_{1}^{2}\right) \tag{8}\]  
where \(m\) represents the mass of the hanging load, which can be found from Equation (7) as \(T\):  
\[ \begin{array}{l}T=\frac{1}{2}M\left(\dot{x}^{2}+\dot{y}^{2}+\dot{z}^{2} \right)+\frac{1}{2}m\left[\begin{array}{l}\left(\dot{x}+L\cos\!\beta\dot{ \beta}\right)^{2}\\ +\left(\dot{y}-L\left(\sin\!\beta\sin\!\alpha\dot{\beta}-\cos\!\beta\cos\! \alpha\dot{\alpha}\right)\right)^{2}\\ +\left(\dot{z}+L\left(\sin\!\beta\cos\!\dot{\beta}+\cos\!\beta\sin\!\alpha \dot{\alpha}\right)\right)^{2}\end{array}\right]\\ =\frac{1}{2}(M+m)\left(\dot{x}^{2}+\dot{y}^{2}+\dot{z}^{2}\right)+\frac{1}{2} mL^{2}\dot{\beta}^{2}+\frac{1}{2}mL^{2}\!\cos^{2}\!\beta\dot{x}^{2}\\ +mL\cos\!\beta\dot{\beta}\dot{x}+mL\!\left(\cos\!\beta\cos\!\alpha\dot{\alpha}- \sin\!\beta\sin\!\beta\right)\!\dot{y}+mL\!\left(\cos\!\beta\sin\!\alpha\dot{ \alpha}+\sin\!\beta\cos\!\alpha\dot{\beta}\right)\!\dot{z}\end{array}