# Automatic Control Optimization for Large-Load Plant-Protection Quadrotor
## 2 Materials and Methods  
### System Model and Identification  
In this article, the quadrotor is a 10 kg class large-load plant-protection quadrotor, and Figure 1 introduces the definition of the quadrotor's frames. In Figure 0(a), the attitude of the quadrotor is represented with \(\phi\) (the roll angle), \(\varphi\) (the pitch angle) and \(\psi\) (the yaw angle). In Figure 0(b), \(\omega_{1}\) to \(\omega_{4}\) represent the angular velocities of the four rotors. The movement and the rotation of the quadrotor is determined by the lift force of the rotors. The dynamic model of the quadrotor is presented in Equation (1):  
\[ \begin{cases}J_{xx}\dot{\omega_{x}}=\omega_{y}\omega_{z}\left(J_{yy}-J_{zz} \right)+M_{x}\\ J_{yy}\omega_{y}=\omega_{x}\omega_{z}(J_{zz}-J_{xx})+M_{y}\\ J_{zz}\omega_{z}=\omega_{x}\omega_{y}\left(J_{xx}-J_{yy}\right)+M_{z},\end{cases}  \tag{1}\]  
where \(\omega_{x},\omega_{y},\omega_{z}\) represent the angular velocities of the three axes and \(J_{xx},J_{yy},J_{zz}\) represent the MOIs of the three axes. \(M_{x},M_{y},M_{z}\) represent the torque generated by the rotors. The torque is generated by the four rotors:  
\[ \begin{cases}M_{x}=\frac{\sqrt{2}}{2}C_{T}\ d\ C_{x}\\ M_{y}=\frac{\sqrt{2}}{2}C_{T}\ d\ C_{y}\\ M_{z}=C_{M}\ C_{z}\end{cases}  \tag{2}\]  
Figure 1: Coordinate definition of the quadrotor. \[ \begin{cases}C_{x}=-\omega_{1}^{2}-\omega_{2}^{2}+\omega_{3}^{2}+\omega_{4}^{2}=S_{ x}\ a_{x}\\ C_{y}=-\omega_{1}^{2}+\omega_{2}^{2}+\omega_{3}^{2}-\omega_{4}^{2}=S_{y}\ a_{y}\\ C_{z}=-\omega_{1}^{2}+\omega_{2}^{2}-\omega_{3}^{2}+\omega_{4}^{2}=S_{z}\ a_{z},\end{cases}  \tag{3}\]  
where \(C_{T}\) and \(C_{M}\) are the lift coefficient and the torque coefficient of the rotors, and \(\omega_{1}\) to \(\omega_{4}\) are rotors' angular velocities. In addition, \(d\) represents the arm length of the plant-protection quadrotor; \(C_{x},C_{y},C_{z}\) and \(S_{x}\), \(S_{y}\), \(S_{z}\) are intermediate variables; and \(a_{x},a_{y},a_{z}\in[-1.0,1.0]\) are the control values of the attitude controller. We scale the controller output between \(-1.0\) and \(1.0\) to simplify the design of controller neural networks. The relationships between the angular velocity of a rotor and the control value of the rotor are modeled in Equation (4):  
\[ \begin{cases}\omega=\frac{1}{T_{m}s+1}\omega_{d}\\ \omega_{d}=C_{R}\sigma,\end{cases}  \tag{4}\]  
where \(\omega\) represents the current angular velocity of the rotor and \(\omega_{d}\) represents the desired angular velocity of the rotor. \(\sigma\in[0,1.0]\) represents the control value of the rotor, \(C_{R}\) represents the rotor control constant, and \(T_{m}\) represents the dynamic response constant. System identification is an important aspect in controlling quadrotors and we present several methods to measure or estimate the relevant physical parameters (shown in Figure 2). Parameters such as the mass and length of arms can be measured directly. MOIs can be measured using the three wire pendulum methods, but these methods require large and expensive equipment for a large-load quadrotor. We estimate the MOIs using the computer aided design (CAD) method; that is, we build an accurate model in SolidWorks software (Figure 2a), weigh every component of the quadrotor, assign the masses of these components in SolidWorks software, and finally automatically calculate the MOIs of the total quadrotor. Moreover, this article focuses on controlling the plant-protection quadrotor with any amount of water carried on it, and the water model must be considered. It is worth noting that, the water in the tank may wobbles during flight, which can greatly worsen the flight performance. To increase the impact of water, we control the quadrotor within a low speed (under \(5.0\) m/s in the \(x\) and \(y\) axes, under \(1.0\) m/s in the \(z\) axis) and a low accelerated velocity (under \(1.0\) m/s\({}^{2}\) in the three axes).