:py:mod:`multirotor.vehicle` ============================ .. py:module:: multirotor.vehicle Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: multirotor.vehicle.MotorParams multirotor.vehicle.PropellerParams multirotor.vehicle.BatteryParams multirotor.vehicle.VehicleParams multirotor.vehicle.SimulationParams .. py:class:: MotorParams .. py:attribute:: resistance :type: float Motor resistance r. Current = (voltage - back_emf) / resistance .. py:attribute:: k_motor :type: float Motor constant k_m, where speed = k_m * back_emf, and k_m = 1/k_e .. py:attribute:: k_emf :type: float Back-EMF constant k_e, relates motor speed induced voltage, back_emf = k_e * omega .. py:attribute:: k_torque :type: float Torque constant k_q, where torque Q = k_q * current. Equal to k_e .. py:attribute:: k_drag :type: float Aerodynamic drag coefficient, where torque = k_drag * omega^2 .. py:attribute:: moment_of_inertia :type: float :value: 0.0 Moment of inertia about rotational axis .. py:attribute:: k_df :type: float :value: 0.0 Viscous damping coefficient. Torque = d_f * speed .. py:attribute:: static_friction :type: float :value: 0.0 .. py:attribute:: speed_voltage_scaling :type: float :value: 1.0 Scaling constant to convert speed signal (rad/s) into speed controller voltage (V). If 1, means input action is same as Voltage .. py:attribute:: max_current :type: float Max allowed current .. py:method:: __post_init__() .. py:class:: PropellerParams .. py:attribute:: moment_of_inertia :type: float .. py:attribute:: diameter :type: float :value: 6 .. py:attribute:: pitch :type: float :value: 3 .. py:attribute:: a :type: float :value: 5.7 Lift curve slope used in example in Stevens & Lewis (eq 2.2-6a) .. py:attribute:: b :type: float :value: 2 Number of blades .. py:attribute:: c :type: float :value: 0.0274 Mean chord length (m) of the propeller blade .. py:attribute:: eta :type: float :value: 1.0 Propeller efficiency .. py:attribute:: use_thrust_constant :type: bool :value: True Use k_thrust instead of propeller geometry for thrust calculations. .. py:attribute:: k_thrust :type: float Propeller's aerodynamic thrust coefficient, where thrust = k_thrust * angular velocity^2 .. py:attribute:: k_drag :type: float Torque constant or drag coefficient, where torque = k_drag * angular velocity^2 .. py:attribute:: motor :type: MotorParams The parameters of the motor to simulate speed, otherwise instantaneous. .. py:method:: __post_init__() .. py:class:: BatteryParams .. py:attribute:: max_voltage :type: float Maximum voltage of the battery .. py:class:: VehicleParams .. py:attribute:: mass :type: float The total mass of the vehicle .. py:attribute:: inertia_matrix :type: numpy.ndarray 3x3 intertia matrix describing the rotational properties of the body. .. py:attribute:: propellers :type: List[PropellerParams] .. py:attribute:: angles :type: numpy.ndarray Angle (radians) of propeller arm from the positive x-axis (forward) of the body frame. .. py:attribute:: distances :type: numpy.ndarray Distance (m) of each propeller from the centre of mass. .. py:attribute:: clockwise :type: numpy.ndarray 1 if motor spins clockwise, -1 if anti-clockwise, looking from the top. Defaults to alternating clockwise/anti-clockwise. .. py:attribute:: battery :type: BatteryParams The battery parameters .. py:method:: __post_init__() .. py:class:: SimulationParams .. py:attribute:: dt :type: float :value: 0.001 Timestep of simulation .. py:attribute:: g :type: float :value: 9.81 Gravitational acceleration .. py:attribute:: rho :type: float :value: 1.225 Air density kg/m^3 at MSL .. py:attribute:: dtype :type: type Default data type for arrays. If None, inferred from VehicleParams inertia_matrix.