multirotor.vehicle

Module Contents

Classes

MotorParams

PropellerParams

BatteryParams

VehicleParams

SimulationParams

class multirotor.vehicle.MotorParams
resistance: float

Motor resistance r. Current = (voltage - back_emf) / resistance

k_motor: float

Motor constant k_m, where speed = k_m * back_emf, and k_m = 1/k_e

k_emf: float

Back-EMF constant k_e, relates motor speed induced voltage, back_emf = k_e * omega

k_torque: float

Torque constant k_q, where torque Q = k_q * current. Equal to k_e

k_drag: float

Aerodynamic drag coefficient, where torque = k_drag * omega^2

moment_of_inertia: float = 0.0

Moment of inertia about rotational axis

k_df: float = 0.0

Viscous damping coefficient. Torque = d_f * speed

static_friction: float = 0.0
speed_voltage_scaling: float = 1.0

Scaling constant to convert speed signal (rad/s) into speed controller voltage (V). If 1, means input action is same as Voltage

max_current: float

Max allowed current

__post_init__()
class multirotor.vehicle.PropellerParams
moment_of_inertia: float
diameter: float = 6
pitch: float = 3
a: float = 5.7

Lift curve slope used in example in Stevens & Lewis (eq 2.2-6a)

b: float = 2

Number of blades

c: float = 0.0274

Mean chord length (m) of the propeller blade

eta: float = 1.0

Propeller efficiency

use_thrust_constant: bool = True

Use k_thrust instead of propeller geometry for thrust calculations.

k_thrust: float

Propeller’s aerodynamic thrust coefficient, where thrust = k_thrust * angular velocity^2

k_drag: float

Torque constant or drag coefficient, where torque = k_drag * angular velocity^2

motor: MotorParams

The parameters of the motor to simulate speed, otherwise instantaneous.

__post_init__()
class multirotor.vehicle.BatteryParams
max_voltage: float

Maximum voltage of the battery

class multirotor.vehicle.VehicleParams
mass: float

The total mass of the vehicle

inertia_matrix: numpy.ndarray

3x3 intertia matrix describing the rotational properties of the body.

propellers: List[PropellerParams]
angles: numpy.ndarray

Angle (radians) of propeller arm from the positive x-axis (forward) of the body frame.

distances: numpy.ndarray

Distance (m) of each propeller from the centre of mass.

clockwise: numpy.ndarray

1 if motor spins clockwise, -1 if anti-clockwise, looking from the top. Defaults to alternating clockwise/anti-clockwise.

battery: BatteryParams

The battery parameters

__post_init__()
class multirotor.vehicle.SimulationParams
dt: float = 0.001

Timestep of simulation

g: float = 9.81

Gravitational acceleration

rho: float = 1.225

Air density kg/m^3 at MSL

dtype: type

Default data type for arrays. If None, inferred from VehicleParams inertia_matrix.