# Optimal Control for a Three-Rotor Unmanned Aerial Vehicle in Programmed Flights
## 2 Control Object
### Physical Model  
The adopted reference frame is the one related to the object. The Z-axis is directed towards the Earth (Figure 3).  
It has been assumed that the thrust forces and rotational moments generated by individual motors are proportional to the square of the motor speed value [19]. The coefficients determining the thrust force and rotational moment values can be expressed by the following equation:  
\[f_{i}=k_{t}\cdot\omega_{t}^{2}, \tag{1}\]  
\[\tau_{i}=k_{d}\cdot\omega_{t}^{2}, \tag{2}\]  
where:  
\(\tau_{i}\)--torque,  
\(f_{i}\)--thrust force,  
\(k_{t}\)--thrust coefficient,  
\(k_{d}\)--torque coefficient,  
\(\omega_{i}\)--motor speed,  
\(i\)--motor numer {1, 2, 3}.  
Similarly to the commonly used equations for a quadcopter [20], the control forces for a tricopter are expressed as:  
\[U_{z}=-k_{t}\omega_{1}^{2}-k_{t}\omega_{2}^{2}-k_{t}\omega_{3}^{2}cos(\alpha), \tag{3}\]  
\[U_{\phi}=-d_{1}k_{t}\omega_{1}^{2}+d_{1}k_{t}\omega_{2}^{2}, \tag{4}\]  
\[U_{\theta}=d_{2}k_{t}\omega_{1}^{2}+d_{2}k_{t}\omega_{2}^{2}-d\cdot k_{t}\omega _{3}^{2}cos(\alpha), \tag{5}\]  
Figure 3: Adopted orientation of the axes [18].  
\[U_{\phi}=-k_{d}\omega_{1}^{2}-k_{d}\omega_{2}^{2}-k_{d}\omega_{3}^{2}cos(\alpha)+ d\cdot k_{t}\omega_{3}^{2}sin(\alpha), \tag{6}\]  
where:  
\(U_{z}\)--thrust force,  
\(U_{\phi}\)--rotation force around the X-axis,  
\(U_{\theta}\)--rotation force around the Y-axis,  
\(U_{\psi}\)--rotation force around the Z-axis,  
\(d_{1}\)--distance between the center of the tricopter and the right or left motor, measured in the Y-axis,  
\(d_{2}\)--distance between the center of the tricopter and the right or left motor, measured in the X-axis,  
\(d\)--distance between the center of the tricopter and the tail motor,  
\(\alpha\)--angle of inclination of the tail motor.  
In addition, there is a fifth force resulting from the inclination of the tail motor, called \(U_{Y}\). It is equal to:  
\[U_{Y}=k_{t}\omega_{3}^{2}sin(\alpha). \tag{7}\]  
To minimize this force, it is important for the right and left motors to rotate in opposite directions and for the center of mass to be shifted forward.  
The flight controller on board the tricopter is responsible for generating the desired engine speeds and tail motor angles. The equations derived by the authors from Equations (3)-(7) are as follows:  
\[\omega_{1}=\sqrt{\frac{-d}{2k_{t}(d+d_{2})}U_{z}-\frac{1}{2d_{1}k_{t}}U_{\phi }+\frac{1}{2k_{t}(d+d_{2})}U_{\theta}}, \tag{8}\]  
\[\omega_{2}=\sqrt{\frac{-d}{2k_{t}(d+d_{2})}U_{z}+\frac{1}{2d_{1}k_{t}}U_{\phi }+\frac{1}{2k_{t}(d+d_{2})}U_{\theta}}, \tag{9}\]  
\[\omega_{3}=\sqrt{\frac{\left[k_{t}^{2}U_{\phi}^{2}\left(d+d_{2}\right)^{2}+k_{ d}^{2}U_{z}^{2}\left(d+d_{2}\right)^{2}-2k_{t}k_{d}U_{\phi}U_{z}\left(d+d_{2} \right)^{2}+d_{2}^{2}U_{z}^{2}k_{t}^{2}d^{2}+U_{\theta}^{2}k_{t}^{2}d^{2}+2d_ {2}U_{z}U_{\theta}k_{t}^{2}d^{2}\right]}{\left(d^{2}k_{t}^{4}(d+d_{2})^{2} \right)}}, \tag{10}\]  
\[cos^{2}\alpha=\frac{\left(d_{2}^{2}U_{z}^{2}+U_{\theta}^{2}+2d_{2}U_{z}U_{ \theta}\right)}{k_{t}^{2}\left(d+d_{2}\right)^{2}\cdot\omega_{3}^{4}}. \tag{11}\]