Quadratic Thrust Curve

File: quadratic_thrust_curve.py
Author: Marcelo Jacinto (marcelo.jacinto@tecnico.ulisboa.pt)
Descriptio: File that implements a quadratic thrust curve for rotors
License: BSD-3-Clause. Copyright (c) 2023, Marcelo Jacinto. All rights reserved.

Classes:

QuadraticThrustCurve

Class that implements the dynamics of rotors that can be described by a quadratic thrust curve

class pegasus.simulator.logic.thrusters.quadratic_thrust_curve.QuadraticThrustCurve

Bases: ThrustCurve

Class that implements the dynamics of rotors that can be described by a quadratic thrust curve

Methods:

__init__([config])

_summary_

set_input_reference(input_reference)

Receives as input a list of target angular velocities of each rotor in rad/s

update(state, dt)

Note: the state and dt variables are not used in this implementation, but left to add support to other rotor models where the total thrust is dependent on states such as vehicle linear velocity

Attributes:

force

The force to apply to each rotor of the vehicle at any given time instant

rolling_moment

The total rolling moment being generated on the body frame of the vehicle by the rotating propellers

rot_dir

The direction of rotation of each rotor of the vehicle

velocity

The velocity at which each rotor of the vehicle should be rotating at any given time instant

__init__(config={})

_summary_

Parameters:

config (dict) – A Dictionary that contains all the parameters for configuring the QuadraticThrustCurve - it can be empty or only have some of the parameters used by the QuadraticThrustCurve.

Examples

The dictionary default parameters are

>>> {"num_rotors": 4,
>>>  "rotor_constant": [5.84e-6, 5.84e-6, 5.84e-6, 5.84e-6],
>>>  "rolling_moment_coefficient": [1e-6, 1e-6, 1e-6, 1e-6],
>>>  "rot_dir": [-1, -1, 1, 1],
>>>  "min_rotor_velocity": [0, 0, 0, 0],                      # rad/s
>>>  "max_rotor_velocity": [1100, 1100, 1100, 1100],          # rad/s
>>> }
set_input_reference(input_reference)

Receives as input a list of target angular velocities of each rotor in rad/s

update(state, dt)

Note: the state and dt variables are not used in this implementation, but left to add support to other rotor models where the total thrust is dependent on states such as vehicle linear velocity

Parameters:
  • state (State) – The current state of the vehicle.

  • dt (float) – The time elapsed between the previous and current function calls (s).

property force

The force to apply to each rotor of the vehicle at any given time instant

Returns:

A list of forces (in Newton N) to apply to each rotor of the vehicle (on its Z-axis) at any given time instant

Return type:

list

property rolling_moment

The total rolling moment being generated on the body frame of the vehicle by the rotating propellers

Returns:

The total rolling moment to apply to the vehicle body frame (Torque about the Z-axis) in Nm

Return type:

float

property rot_dir

The direction of rotation of each rotor of the vehicle

Returns:

A list with the rotation direction of each rotor (-1 is counter-clockwise and 1 for clockwise)

Return type:

list(int)

property velocity

The velocity at which each rotor of the vehicle should be rotating at any given time instant

Returns:

A list of angular velocities (in rad/s) of each rotor (about its Z-axis) at any given time instant

Return type:

list