Compute the hovering capabilities of drones with arbitrary configurations.
Updates:
[20 May 2024]
- Motor commands are now proportionate to the square of motor RPM.
- Propeller forces are now defined using force and moment constants rather than maximum thrust and moments.
The drone has a body-fixed coordinate system attached to the C.G. which follows the right-handed convention (
Drones are defined using classes, and require inertia and propeller properties as class variables.
Inertia properties are the mass and moment of inertia of the drone, and are defined using variables.
Propeller properties are defined using dictionaries, and require the following keywords:
"loc":[x,y,z]
: List that defines the
"dir":[x,y,z,r]
: List that defines the direction of thrust and rotation for the propeller. Includes 4 numbers, first 3 numbers are the
"constants":[k_f, k_m]
: Thrust and moment constant for the propeller.
"wmax": wmax
: Maximum rotational speed (rad/s) for propeller.
Example:
props = [{"loc":[1, 1, 0], "dir": [0, 0, -1, 1], "constants": [5.15e-06, 1.72e-06], "wmax": 3927},
{"loc":[-1, 1, 0], "dir": [0, 0, -1, -1], "constants": [5.15e-06, 1.72e-06], "wmax": 3927},
{"loc":[-1, -1, 0], "dir": [0, 0, -1, 1], "constants": [5.15e-06, 1.72e-06], "wmax": 3927},
{"loc":[1, -1 0], "dir": [0, 0, -1, -1], "constants": [5.15e-06, 1.72e-06], "wmax": 3927}]
There are 2 ways to define the drone body.
- Creating a class that follows the format as seen in
drone_hover.standard_bodies
. - Call the
Custombody
object
Example:
from drone_hover.custom_bodies import Custombody
drone = Custombody(mass, Ix, Iy, Iz, Ixy, Ixz, Iyz, props)
This code utilizes 2 levels of mapping for the propeller commands.
- The propeller angular velocity is normalized such that
$f:\omega \rightarrow \hat{\omega}$ , where$\omega \in [0.02\omega_{max}, \omega_{max}]$ and$\hat{\omega} \in [0.02, 1]$ . The factor 0.02 is arbitrarily selected to be the idling speed of the propeller. This mapping embeds the propeller information into the propeller effectiveness matrices. - When giving actual commands to the drone, it is more convinient to give a command
$u \in [0,1]$ . Hence, a second map$g:\hat{\omega} \rightarrow u$ is defined.
This is done to ensure that the equations remain linear (to
Optimization is performed using scipy.optimize.minimize
module, using the SLSQP algorithm.
- Determine whether a drone can hover statically, while spinning, or not able to hover at all.
- Works on drones with arbitrary configurations (e.g. number of propellers, location of propellers, direction of propellers, etc.).
- Computes the input commands for most efficient hover.
- Computes the maximum thrust to weight ratio at hovering configuration
- Computes the cost of most efficient hover.
- Spinning hover optimization does not work when force is aligned with torque for all values of input commands. SLSQP require constraints to be twice differentiable. To consider alternative optimization algorithms.
- The origin of the body-fixed coordinates is assumed to always be on the C.G. To consider a more general case where the origin and the C.G. do not coincide.