flight_mech.motor module#
Module to define motor models.
- class flight_mech.motor.ElectricalMotor(motor_data_name: str | None = None, motor_database_folder: str = '/home/runner/work/flight-mech/flight-mech/flight_mech/motor_database', motor_parameters_dict: dict | None = None)[source]#
Bases:
object
Class to define an electrical motor controlled by tension.
- Parameters:
I0 (float) – No-load current in A.
internal_resistance (float) – Internal resistance of the motor in Ohm.
external_resistance (float) – External resistance of the batteries in Ohm.
K (float) – Coefficient between tension and rotation speed in s-1.V-1.
- property I#
- I_0: float#
- I_max: float#
- Kv: float#
- property U#
- U_max: float#
- compute_I_at_max_efficiency()[source]#
Compute the current that gives the maximum efficiency.
- Returns:
Current of maximum efficiency
- Return type:
float
- property efficiency#
- property electromotive_force#
- external_resistance: float#
- internal_resistance: float#
- load_motor_data(motor_data_name: str, motor_data_folder: str = '/home/runner/work/flight-mech/flight-mech/flight_mech/motor_database')[source]#
Load the data from a motor stored in the given database folder.
- Parameters:
motor_data_name (str) – Name of the motor.
motor_data_folder (str, optional) – Path to the database folder, by default default_motor_database
- mass: float | None#
- property max_efficiency#
- plot_graph(variable: Literal['efficiency', 'rotation_speed', 'power', 'torque'], nb_points=100, **kwargs)[source]#
Plot the graph of evolution of the given variable with the current in the motor.
- Parameters:
variable (Literal["efficiency", "rotation_speed", "power", "torque"]) – Name of the variable to plot.
- property power#
- property rotation_speed#
- set_motor_parameters(I_0: float, I_max: float, internal_resistance: float, external_resistance: float, Kv: float, U_max: float, mass: float | None = None)[source]#
Set the parameters of the motor.
- Parameters:
I0 (float) – No-load current in A.
internal_resistance (float) – Internal resistance of the motor in Ohm.
external_resistance (float) – External resistance of the batteries in Ohm.
Kv (float) – Coefficient between tension and rotation speed in s-1.V-1.
U_max (float) – Max tension of the motor in V.
mass (float | None, optional) – Mass of the motor in kg.
- property torque#