APM:Libraries
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
AP_MotorsHeli_RSC Class Reference

#include <AP_MotorsHeli_RSC.h>

Public Member Functions

 AP_MotorsHeli_RSC (SRV_Channel::Aux_servo_function_t aux_fn, uint8_t default_channel)
 
void init_servo ()
 
void set_control_mode (RotorControlMode mode)
 
void set_critical_speed (float critical_speed)
 
float get_critical_speed () const
 
float get_idle_output ()
 
void set_idle_output (float idle_output)
 
float get_desired_speed () const
 
void set_desired_speed (float desired_speed)
 
float get_control_output () const
 
float get_rotor_speed () const
 
bool is_runup_complete () const
 
void set_ramp_time (int8_t ramp_time)
 
void set_runup_time (int8_t runup_time)
 
void set_throttle_curve (float thrcrv[5], uint16_t slewrate)
 
void set_collective (float collective)
 
void output (RotorControlState state)
 

Private Member Functions

void update_rotor_ramp (float rotor_ramp_input, float dt)
 
void update_rotor_runup (float dt)
 
void write_rsc (float servo_out)
 
float calculate_desired_throttle (float collective_in)
 

Private Attributes

uint64_t _last_update_us
 
SRV_Channel::Aux_servo_function_t _aux_fn
 
uint8_t _default_channel
 
RotorControlMode _control_mode = ROTOR_CONTROL_MODE_DISABLED
 
float _critical_speed = 0.0f
 
float _idle_output = 0.0f
 
float _desired_speed = 0.0f
 
float _control_output = 0.0f
 
float _rotor_ramp_output = 0.0f
 
float _rotor_runup_output = 0.0f
 
int8_t _ramp_time = 0
 
int8_t _runup_time = 0
 
bool _runup_complete = false
 
float _thrcrv_poly [4][4]
 
uint16_t _power_slewrate = 0
 
float _collective_in
 

Friends

class AP_MotorsHeli_Single
 
class AP_MotorsHeli_Dual
 
class AP_MotorsHeli_Quad
 

Detailed Description

Definition at line 24 of file AP_MotorsHeli_RSC.h.

Constructor & Destructor Documentation

◆ AP_MotorsHeli_RSC()

AP_MotorsHeli_RSC::AP_MotorsHeli_RSC ( SRV_Channel::Aux_servo_function_t  aux_fn,
uint8_t  default_channel 
)
inline

Definition at line 30 of file AP_MotorsHeli_RSC.h.

Here is the call graph for this function:

Member Function Documentation

◆ calculate_desired_throttle()

float AP_MotorsHeli_RSC::calculate_desired_throttle ( float  collective_in)
private

Definition at line 195 of file AP_MotorsHeli_RSC.cpp.

Referenced by output().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_control_output()

float AP_MotorsHeli_RSC::get_control_output ( ) const
inline

Definition at line 59 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Single::move_actuators().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_critical_speed()

float AP_MotorsHeli_RSC::get_critical_speed ( ) const
inline

Definition at line 46 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::rotor_speed_above_critical(), AP_MotorsHeli_Dual::rotor_speed_above_critical(), and AP_MotorsHeli_Single::rotor_speed_above_critical().

Here is the caller graph for this function:

◆ get_desired_speed()

float AP_MotorsHeli_RSC::get_desired_speed ( ) const
inline

Definition at line 53 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Single::get_desired_rotor_speed(), and AP_MotorsHeli_Single::move_yaw().

Here is the caller graph for this function:

◆ get_idle_output()

float AP_MotorsHeli_RSC::get_idle_output ( )
inline

Definition at line 49 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Single::move_actuators().

Here is the caller graph for this function:

◆ get_rotor_speed()

float AP_MotorsHeli_RSC::get_rotor_speed ( ) const

◆ init_servo()

void AP_MotorsHeli_RSC::init_servo ( )

Definition at line 24 of file AP_MotorsHeli_RSC.cpp.

Referenced by AP_MotorsHeli_RSC(), AP_MotorsHeli_Quad::init_outputs(), AP_MotorsHeli_Dual::init_outputs(), and AP_MotorsHeli_Single::init_outputs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_runup_complete()

bool AP_MotorsHeli_RSC::is_runup_complete ( ) const
inline

Definition at line 65 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::update_motor_control(), AP_MotorsHeli_Dual::update_motor_control(), and AP_MotorsHeli_Single::update_motor_control().

Here is the caller graph for this function:

◆ output()

void AP_MotorsHeli_RSC::output ( RotorControlState  state)

Definition at line 46 of file AP_MotorsHeli_RSC.cpp.

Referenced by set_collective(), AP_MotorsHeli_Quad::update_motor_control(), AP_MotorsHeli_Dual::update_motor_control(), and AP_MotorsHeli_Single::update_motor_control().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_collective()

void AP_MotorsHeli_RSC::set_collective ( float  collective)
inline

Definition at line 77 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::move_actuators(), AP_MotorsHeli_Dual::move_actuators(), and AP_MotorsHeli_Single::move_actuators().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_control_mode()

void AP_MotorsHeli_RSC::set_control_mode ( RotorControlMode  mode)
inline

Definition at line 40 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::calculate_scalars(), AP_MotorsHeli_Dual::calculate_scalars(), and AP_MotorsHeli_Single::calculate_scalars().

Here is the caller graph for this function:

◆ set_critical_speed()

void AP_MotorsHeli_RSC::set_critical_speed ( float  critical_speed)
inline

Definition at line 43 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::calculate_armed_scalars(), AP_MotorsHeli_Dual::calculate_armed_scalars(), AP_MotorsHeli_Single::calculate_armed_scalars(), and AP_MotorsHeli_Single::calculate_scalars().

Here is the caller graph for this function:

◆ set_desired_speed()

void AP_MotorsHeli_RSC::set_desired_speed ( float  desired_speed)
inline

Definition at line 56 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::set_desired_rotor_speed(), AP_MotorsHeli_Dual::set_desired_rotor_speed(), and AP_MotorsHeli_Single::set_desired_rotor_speed().

Here is the caller graph for this function:

◆ set_idle_output()

void AP_MotorsHeli_RSC::set_idle_output ( float  idle_output)
inline

Definition at line 50 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::calculate_armed_scalars(), AP_MotorsHeli_Dual::calculate_armed_scalars(), AP_MotorsHeli_Single::calculate_armed_scalars(), and AP_MotorsHeli_Single::calculate_scalars().

Here is the caller graph for this function:

◆ set_ramp_time()

void AP_MotorsHeli_RSC::set_ramp_time ( int8_t  ramp_time)
inline

Definition at line 68 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::calculate_armed_scalars(), AP_MotorsHeli_Dual::calculate_armed_scalars(), AP_MotorsHeli_Single::calculate_armed_scalars(), and AP_MotorsHeli_Single::calculate_scalars().

Here is the caller graph for this function:

◆ set_runup_time()

void AP_MotorsHeli_RSC::set_runup_time ( int8_t  runup_time)
inline

Definition at line 71 of file AP_MotorsHeli_RSC.h.

Referenced by AP_MotorsHeli_Quad::calculate_armed_scalars(), AP_MotorsHeli_Dual::calculate_armed_scalars(), AP_MotorsHeli_Single::calculate_armed_scalars(), and AP_MotorsHeli_Single::calculate_scalars().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_throttle_curve()

void AP_MotorsHeli_RSC::set_throttle_curve ( float  thrcrv[5],
uint16_t  slewrate 
)

Definition at line 32 of file AP_MotorsHeli_RSC.cpp.

Referenced by AP_MotorsHeli_Quad::calculate_armed_scalars(), AP_MotorsHeli_Dual::calculate_armed_scalars(), AP_MotorsHeli_Single::calculate_armed_scalars(), and set_runup_time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_rotor_ramp()

void AP_MotorsHeli_RSC::update_rotor_ramp ( float  rotor_ramp_input,
float  dt 
)
private

Definition at line 106 of file AP_MotorsHeli_RSC.cpp.

Referenced by output().

Here is the caller graph for this function:

◆ update_rotor_runup()

void AP_MotorsHeli_RSC::update_rotor_runup ( float  dt)
private

Definition at line 131 of file AP_MotorsHeli_RSC.cpp.

Referenced by output().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_rsc()

void AP_MotorsHeli_RSC::write_rsc ( float  servo_out)
private

Definition at line 183 of file AP_MotorsHeli_RSC.cpp.

Referenced by output().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ AP_MotorsHeli_Dual

friend class AP_MotorsHeli_Dual
friend

Definition at line 27 of file AP_MotorsHeli_RSC.h.

◆ AP_MotorsHeli_Quad

friend class AP_MotorsHeli_Quad
friend

Definition at line 28 of file AP_MotorsHeli_RSC.h.

◆ AP_MotorsHeli_Single

friend class AP_MotorsHeli_Single
friend

Definition at line 26 of file AP_MotorsHeli_RSC.h.

Member Data Documentation

◆ _aux_fn

SRV_Channel::Aux_servo_function_t AP_MotorsHeli_RSC::_aux_fn
private

Definition at line 86 of file AP_MotorsHeli_RSC.h.

Referenced by init_servo(), and write_rsc().

◆ _collective_in

float AP_MotorsHeli_RSC::_collective_in
private

Definition at line 102 of file AP_MotorsHeli_RSC.h.

Referenced by output(), and set_collective().

◆ _control_mode

RotorControlMode AP_MotorsHeli_RSC::_control_mode = ROTOR_CONTROL_MODE_DISABLED
private

Definition at line 90 of file AP_MotorsHeli_RSC.h.

Referenced by output(), set_control_mode(), update_rotor_runup(), and write_rsc().

◆ _control_output

float AP_MotorsHeli_RSC::_control_output = 0.0f
private

Definition at line 94 of file AP_MotorsHeli_RSC.h.

Referenced by get_control_output(), and output().

◆ _critical_speed

float AP_MotorsHeli_RSC::_critical_speed = 0.0f
private

Definition at line 91 of file AP_MotorsHeli_RSC.h.

Referenced by get_critical_speed(), set_critical_speed(), and update_rotor_runup().

◆ _default_channel

uint8_t AP_MotorsHeli_RSC::_default_channel
private

Definition at line 87 of file AP_MotorsHeli_RSC.h.

Referenced by init_servo().

◆ _desired_speed

float AP_MotorsHeli_RSC::_desired_speed = 0.0f
private

Definition at line 93 of file AP_MotorsHeli_RSC.h.

Referenced by get_desired_speed(), output(), and set_desired_speed().

◆ _idle_output

float AP_MotorsHeli_RSC::_idle_output = 0.0f
private

Definition at line 92 of file AP_MotorsHeli_RSC.h.

Referenced by get_idle_output(), output(), and set_idle_output().

◆ _last_update_us

uint64_t AP_MotorsHeli_RSC::_last_update_us
private

Definition at line 83 of file AP_MotorsHeli_RSC.h.

Referenced by output().

◆ _power_slewrate

uint16_t AP_MotorsHeli_RSC::_power_slewrate = 0
private

Definition at line 101 of file AP_MotorsHeli_RSC.h.

Referenced by output(), and set_throttle_curve().

◆ _ramp_time

int8_t AP_MotorsHeli_RSC::_ramp_time = 0
private

Definition at line 97 of file AP_MotorsHeli_RSC.h.

Referenced by set_ramp_time(), update_rotor_ramp(), and update_rotor_runup().

◆ _rotor_ramp_output

float AP_MotorsHeli_RSC::_rotor_ramp_output = 0.0f
private

Definition at line 95 of file AP_MotorsHeli_RSC.h.

Referenced by output(), update_rotor_ramp(), and update_rotor_runup().

◆ _rotor_runup_output

float AP_MotorsHeli_RSC::_rotor_runup_output = 0.0f
private

Definition at line 96 of file AP_MotorsHeli_RSC.h.

Referenced by get_rotor_speed(), update_rotor_ramp(), and update_rotor_runup().

◆ _runup_complete

bool AP_MotorsHeli_RSC::_runup_complete = false
private

Definition at line 99 of file AP_MotorsHeli_RSC.h.

Referenced by is_runup_complete(), and update_rotor_runup().

◆ _runup_time

int8_t AP_MotorsHeli_RSC::_runup_time = 0
private

Definition at line 98 of file AP_MotorsHeli_RSC.h.

Referenced by set_runup_time(), and update_rotor_runup().

◆ _thrcrv_poly

float AP_MotorsHeli_RSC::_thrcrv_poly[4][4]
private

Definition at line 100 of file AP_MotorsHeli_RSC.h.

Referenced by calculate_desired_throttle(), and set_throttle_curve().


The documentation for this class was generated from the following files: