APM:Libraries
Classes | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AP_MotorsHeli Class Referenceabstract

#include <AP_MotorsHeli.h>

Inheritance diagram for AP_MotorsHeli:
[legend]
Collaboration diagram for AP_MotorsHeli:
[legend]

Classes

struct  heliflags_type
 

Public Member Functions

 AP_MotorsHeli (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_HELI_SPEED_DEFAULT)
 Constructor. More...
 
void init (motor_frame_class frame_class, motor_frame_type frame_type)
 
void set_frame_class_and_type (motor_frame_class frame_class, motor_frame_type frame_type)
 
virtual void set_update_rate (uint16_t speed_hz)=0
 
void output_min ()
 
virtual void output_test (uint8_t motor_seq, int16_t pwm)=0
 
virtual bool parameter_check (bool display_msg) const
 
virtual bool has_flybar () const
 
void set_collective_for_landing (bool landing)
 
void set_inverted_flight (bool inverted)
 
uint8_t get_rsc_mode () const
 
float get_rsc_setpoint () const
 
virtual void set_desired_rotor_speed (float desired_speed)=0
 
virtual float get_desired_rotor_speed () const =0
 
virtual float get_main_rotor_speed () const =0
 
bool rotor_runup_complete () const
 
virtual bool rotor_speed_above_critical () const =0
 
virtual uint16_t get_motor_mask ()=0
 
virtual void set_acro_tail (bool set)
 
virtual void ext_gyro_gain (float gain)
 
void output ()
 
virtual bool supports_yaw_passthrough () const
 
float get_throttle_hover () const
 
- Public Member Functions inherited from AP_Motors
 AP_Motors (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
 
bool initialised_ok () const
 
bool armed () const
 
void armed (bool arm)
 
void set_interlock (bool set)
 
bool get_interlock () const
 
void set_roll (float roll_in)
 
void set_pitch (float pitch_in)
 
void set_yaw (float yaw_in)
 
void set_throttle (float throttle_in)
 
void set_throttle_avg_max (float throttle_avg_max)
 
void set_throttle_filter_cutoff (float filt_hz)
 
void set_forward (float forward_in)
 
void set_lateral (float lateral_in)
 
float get_roll () const
 
float get_pitch () const
 
float get_yaw () const
 
float get_throttle () const
 
float get_throttle_bidirectional () const
 
float get_forward () const
 
float get_lateral () const
 
virtual void set_desired_spool_state (enum spool_up_down_desired spool)
 
enum spool_up_down_desired get_desired_spool_state (void) const
 
void set_air_density_ratio (float ratio)
 
void set_radio_passthrough (float roll_input, float pitch_input, float throttle_input, float yaw_input)
 
void set_loop_rate (uint16_t loop_rate)
 
pwm_type get_pwm_type (void) const
 

Static Public Attributes

static const struct AP_Param::GroupInfo var_info []
 

Protected Types

enum  ServoControlModes {
  SERVO_CONTROL_MODE_AUTOMATED = 0, SERVO_CONTROL_MODE_MANUAL_PASSTHROUGH, SERVO_CONTROL_MODE_MANUAL_MAX, SERVO_CONTROL_MODE_MANUAL_CENTER,
  SERVO_CONTROL_MODE_MANUAL_MIN, SERVO_CONTROL_MODE_MANUAL_OSCILLATE
}
 

Protected Member Functions

void output_armed_stabilizing ()
 
void output_armed_zero_throttle ()
 
void output_disarmed ()
 
virtual void update_motor_control (RotorControlState state)=0
 
void reset_flight_controls ()
 
void update_throttle_filter ()
 
virtual void move_actuators (float roll_out, float pitch_out, float coll_in, float yaw_out)=0
 
void reset_swash_servo (SRV_Channel *servo)
 
virtual bool init_outputs ()=0
 
virtual void calculate_armed_scalars ()=0
 
virtual void calculate_scalars ()=0
 
virtual void calculate_roll_pitch_collective_factors ()=0
 
virtual void servo_test ()=0
 
int16_t calc_pwm_output_1to1_swash_servo (float input, const SRV_Channel *servo)
 
- Protected Member Functions inherited from AP_Motors
virtual void rc_write (uint8_t chan, uint16_t pwm)
 
virtual void rc_write_angle (uint8_t chan, int16_t angle_cd)
 
virtual void rc_set_freq (uint32_t mask, uint16_t freq_hz)
 
virtual uint32_t rc_map_mask (uint32_t mask) const
 
void add_motor_num (int8_t motor_num)
 
virtual void save_params_on_disarm ()
 
int16_t calc_pwm_output_1to1 (float input, const SRV_Channel *servo)
 
int16_t calc_pwm_output_0to1 (float input, const SRV_Channel *servo)
 

Protected Attributes

struct AP_MotorsHeli::heliflags_type _heliflags
 
AP_Int16 _cyclic_max
 
AP_Int16 _collective_min
 
AP_Int16 _collective_max
 
AP_Int16 _collective_mid
 
AP_Int8 _servo_mode
 
AP_Int16 _rsc_setpoint
 
AP_Int8 _rsc_mode
 
AP_Int8 _rsc_ramp_time
 
AP_Int8 _rsc_runup_time
 
AP_Int16 _land_collective_min
 
AP_Int16 _rsc_critical
 
AP_Int16 _rsc_idle_output
 
AP_Int16 _rsc_thrcrv [5]
 
AP_Int16 _rsc_slewrate
 
AP_Int8 _servo_test
 
float _collective_mid_pct = 0.0f
 
uint8_t _servo_test_cycle_counter = 0
 
motor_frame_type _frame_type
 
- Protected Attributes inherited from AP_Motors
struct AP_Motors::AP_Motors_flags _flags
 
uint16_t _loop_rate
 
uint16_t _speed_hz
 
float _roll_in
 
float _pitch_in
 
float _yaw_in
 
float _throttle_in
 
float _forward_in
 
float _lateral_in
 
float _throttle_avg_max
 
LowPassFilterFloat _throttle_filter
 
spool_up_down_desired _spool_desired
 
float _air_density_ratio
 
uint16_t _motor_fast_mask
 
float _roll_radio_passthrough
 
float _pitch_radio_passthrough
 
float _throttle_radio_passthrough
 
float _yaw_radio_passthrough
 
AP_Int8 _pwm_type
 

Additional Inherited Members

- Public Types inherited from AP_Motors
enum  motor_frame_class {
  MOTOR_FRAME_UNDEFINED = 0, MOTOR_FRAME_QUAD = 1, MOTOR_FRAME_HEXA = 2, MOTOR_FRAME_OCTA = 3,
  MOTOR_FRAME_OCTAQUAD = 4, MOTOR_FRAME_Y6 = 5, MOTOR_FRAME_HELI = 6, MOTOR_FRAME_TRI = 7,
  MOTOR_FRAME_SINGLE = 8, MOTOR_FRAME_COAX = 9, MOTOR_FRAME_TAILSITTER = 10, MOTOR_FRAME_HELI_DUAL = 11,
  MOTOR_FRAME_DODECAHEXA = 12, MOTOR_FRAME_HELI_QUAD = 13
}
 
enum  motor_frame_type {
  MOTOR_FRAME_TYPE_PLUS = 0, MOTOR_FRAME_TYPE_X = 1, MOTOR_FRAME_TYPE_V = 2, MOTOR_FRAME_TYPE_H = 3,
  MOTOR_FRAME_TYPE_VTAIL = 4, MOTOR_FRAME_TYPE_ATAIL = 5, MOTOR_FRAME_TYPE_Y6B = 10, MOTOR_FRAME_TYPE_Y6F = 11
}
 
enum  spool_up_down_desired { DESIRED_SHUT_DOWN = 0, DESIRED_SPIN_WHEN_ARMED = 1, DESIRED_THROTTLE_UNLIMITED = 2 }
 
enum  pwm_type {
  PWM_TYPE_NORMAL = 0, PWM_TYPE_ONESHOT = 1, PWM_TYPE_ONESHOT125 = 2, PWM_TYPE_BRUSHED = 3,
  PWM_TYPE_DSHOT150 = 4, PWM_TYPE_DSHOT300 = 5, PWM_TYPE_DSHOT600 = 6, PWM_TYPE_DSHOT1200 = 7
}
 
- Static Public Member Functions inherited from AP_Motors
static AP_Motorsget_instance (void)
 
- Public Attributes inherited from AP_Motors
struct AP_Motors::AP_Motors_limit limit
 

Detailed Description

Definition at line 50 of file AP_MotorsHeli.h.

Member Enumeration Documentation

◆ ServoControlModes

Enumerator
SERVO_CONTROL_MODE_AUTOMATED 
SERVO_CONTROL_MODE_MANUAL_PASSTHROUGH 
SERVO_CONTROL_MODE_MANUAL_MAX 
SERVO_CONTROL_MODE_MANUAL_CENTER 
SERVO_CONTROL_MODE_MANUAL_MIN 
SERVO_CONTROL_MODE_MANUAL_OSCILLATE 

Definition at line 142 of file AP_MotorsHeli.h.

Constructor & Destructor Documentation

◆ AP_MotorsHeli()

AP_MotorsHeli::AP_MotorsHeli ( uint16_t  loop_rate,
uint16_t  speed_hz = AP_MOTORS_HELI_SPEED_DEFAULT 
)
inline

Constructor.

Definition at line 54 of file AP_MotorsHeli.h.

Here is the call graph for this function:

Member Function Documentation

◆ calc_pwm_output_1to1_swash_servo()

int16_t AP_MotorsHeli::calc_pwm_output_1to1_swash_servo ( float  input,
const SRV_Channel servo 
)
protected

Definition at line 432 of file AP_MotorsHeli.cpp.

Referenced by 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:

◆ calculate_armed_scalars()

virtual void AP_MotorsHeli::calculate_armed_scalars ( )
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by output().

Here is the caller graph for this function:

◆ calculate_roll_pitch_collective_factors()

virtual void AP_MotorsHeli::calculate_roll_pitch_collective_factors ( )
protectedpure virtual

◆ calculate_scalars()

virtual void AP_MotorsHeli::calculate_scalars ( )
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by init(), output_disarmed(), and reset_flight_controls().

Here is the caller graph for this function:

◆ ext_gyro_gain()

virtual void AP_MotorsHeli::ext_gyro_gain ( float  gain)
inlinevirtual

Reimplemented in AP_MotorsHeli_Single.

Definition at line 126 of file AP_MotorsHeli.h.

Here is the call graph for this function:

◆ get_desired_rotor_speed()

virtual float AP_MotorsHeli::get_desired_rotor_speed ( ) const
pure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by get_rsc_setpoint().

Here is the caller graph for this function:

◆ get_main_rotor_speed()

virtual float AP_MotorsHeli::get_main_rotor_speed ( ) const
pure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by get_rsc_setpoint().

Here is the caller graph for this function:

◆ get_motor_mask()

virtual uint16_t AP_MotorsHeli::get_motor_mask ( )
pure virtual

Implements AP_Motors.

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by rotor_runup_complete().

Here is the caller graph for this function:

◆ get_rsc_mode()

uint8_t AP_MotorsHeli::get_rsc_mode ( ) const
inline

Definition at line 99 of file AP_MotorsHeli.h.

◆ get_rsc_setpoint()

float AP_MotorsHeli::get_rsc_setpoint ( ) const
inline

Definition at line 102 of file AP_MotorsHeli.h.

Here is the call graph for this function:

◆ get_throttle_hover()

float AP_MotorsHeli::get_throttle_hover ( ) const
inlinevirtual

Implements AP_Motors.

Definition at line 134 of file AP_MotorsHeli.h.

◆ has_flybar()

virtual bool AP_MotorsHeli::has_flybar ( ) const
inlinevirtual

Reimplemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Definition at line 90 of file AP_MotorsHeli.h.

◆ init()

void AP_MotorsHeli::init ( motor_frame_class  frame_class,
motor_frame_type  frame_type 
)
virtual

Implements AP_Motors.

Definition at line 204 of file AP_MotorsHeli.cpp.

Referenced by AP_MotorsHeli().

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

◆ init_outputs()

virtual bool AP_MotorsHeli::init_outputs ( )
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by init(), output_disarmed(), and reset_flight_controls().

Here is the caller graph for this function:

◆ move_actuators()

virtual void AP_MotorsHeli::move_actuators ( float  roll_out,
float  pitch_out,
float  coll_in,
float  yaw_out 
)
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by output_armed_stabilizing(), output_armed_zero_throttle(), output_disarmed(), and output_min().

Here is the caller graph for this function:

◆ output()

void AP_MotorsHeli::output ( )
virtual

Implements AP_Motors.

Definition at line 256 of file AP_MotorsHeli.cpp.

Referenced by ext_gyro_gain().

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

◆ output_armed_stabilizing()

void AP_MotorsHeli::output_armed_stabilizing ( )
protectedvirtual

Implements AP_Motors.

Definition at line 274 of file AP_MotorsHeli.cpp.

Referenced by output().

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

◆ output_armed_zero_throttle()

void AP_MotorsHeli::output_armed_zero_throttle ( )
protected

Definition at line 287 of file AP_MotorsHeli.cpp.

Referenced by output().

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

◆ output_disarmed()

void AP_MotorsHeli::output_disarmed ( )
protected

Definition at line 300 of file AP_MotorsHeli.cpp.

Referenced by output().

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

◆ output_min()

void AP_MotorsHeli::output_min ( )
virtual

Implements AP_Motors.

Definition at line 241 of file AP_MotorsHeli.cpp.

Referenced by AP_MotorsHeli().

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

◆ output_test()

virtual void AP_MotorsHeli::output_test ( uint8_t  motor_seq,
int16_t  pwm 
)
pure virtual

Implements AP_Motors.

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by AP_MotorsHeli().

Here is the caller graph for this function:

◆ parameter_check()

bool AP_MotorsHeli::parameter_check ( bool  display_msg) const
virtual

Reimplemented in AP_MotorsHeli_Single.

Definition at line 359 of file AP_MotorsHeli.cpp.

Referenced by AP_MotorsHeli(), and AP_MotorsHeli_Single::parameter_check().

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

◆ reset_flight_controls()

void AP_MotorsHeli::reset_flight_controls ( )
protected

Definition at line 422 of file AP_MotorsHeli.cpp.

Referenced by output_armed_stabilizing(), and output_armed_zero_throttle().

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

◆ reset_swash_servo()

void AP_MotorsHeli::reset_swash_servo ( SRV_Channel servo)
protected

Definition at line 398 of file AP_MotorsHeli.cpp.

Referenced by 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:

◆ rotor_runup_complete()

bool AP_MotorsHeli::rotor_runup_complete ( ) const
inline

Definition at line 114 of file AP_MotorsHeli.h.

Here is the call graph for this function:

◆ rotor_speed_above_critical()

virtual bool AP_MotorsHeli::rotor_speed_above_critical ( ) const
pure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by rotor_runup_complete().

Here is the caller graph for this function:

◆ servo_test()

virtual void AP_MotorsHeli::servo_test ( )
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by output_disarmed().

Here is the caller graph for this function:

◆ set_acro_tail()

virtual void AP_MotorsHeli::set_acro_tail ( bool  set)
inlinevirtual

Reimplemented in AP_MotorsHeli_Single.

Definition at line 123 of file AP_MotorsHeli.h.

◆ set_collective_for_landing()

void AP_MotorsHeli::set_collective_for_landing ( bool  landing)
inline

Definition at line 93 of file AP_MotorsHeli.h.

◆ set_desired_rotor_speed()

virtual void AP_MotorsHeli::set_desired_rotor_speed ( float  desired_speed)
pure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by get_rsc_setpoint().

Here is the caller graph for this function:

◆ set_frame_class_and_type()

void AP_MotorsHeli::set_frame_class_and_type ( motor_frame_class  frame_class,
motor_frame_type  frame_type 
)
virtual

Implements AP_Motors.

Definition at line 235 of file AP_MotorsHeli.cpp.

Referenced by AP_MotorsHeli().

Here is the caller graph for this function:

◆ set_inverted_flight()

void AP_MotorsHeli::set_inverted_flight ( bool  inverted)
inline

Definition at line 96 of file AP_MotorsHeli.h.

◆ set_update_rate()

virtual void AP_MotorsHeli::set_update_rate ( uint16_t  speed_hz)
pure virtual

Reimplemented from AP_Motors.

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by AP_MotorsHeli(), and init().

Here is the caller graph for this function:

◆ supports_yaw_passthrough()

virtual bool AP_MotorsHeli::supports_yaw_passthrough ( ) const
inlinevirtual

Reimplemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Definition at line 132 of file AP_MotorsHeli.h.

◆ update_motor_control()

virtual void AP_MotorsHeli::update_motor_control ( RotorControlState  state)
protectedpure virtual

Implemented in AP_MotorsHeli_Single, AP_MotorsHeli_Dual, and AP_MotorsHeli_Quad.

Referenced by output_armed_stabilizing(), output_armed_zero_throttle(), output_disarmed(), and output_min().

Here is the caller graph for this function:

◆ update_throttle_filter()

void AP_MotorsHeli::update_throttle_filter ( )
protectedvirtual

Implements AP_Motors.

Definition at line 408 of file AP_MotorsHeli.cpp.

Referenced by output().

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

Member Data Documentation

◆ _collective_max

AP_Int16 AP_MotorsHeli::_collective_max
protected

◆ _collective_mid

AP_Int16 AP_MotorsHeli::_collective_mid
protected

◆ _collective_mid_pct

float AP_MotorsHeli::_collective_mid_pct = 0.0f
protected

◆ _collective_min

AP_Int16 AP_MotorsHeli::_collective_min
protected

◆ _cyclic_max

AP_Int16 AP_MotorsHeli::_cyclic_max
protected

◆ _frame_type

motor_frame_type AP_MotorsHeli::_frame_type
protected

◆ _heliflags

struct AP_MotorsHeli::heliflags_type AP_MotorsHeli::_heliflags
protected

◆ _land_collective_min

AP_Int16 AP_MotorsHeli::_land_collective_min
protected

◆ _rsc_critical

AP_Int16 AP_MotorsHeli::_rsc_critical
protected

◆ _rsc_idle_output

AP_Int16 AP_MotorsHeli::_rsc_idle_output
protected

◆ _rsc_mode

AP_Int8 AP_MotorsHeli::_rsc_mode
protected

◆ _rsc_ramp_time

AP_Int8 AP_MotorsHeli::_rsc_ramp_time
protected

◆ _rsc_runup_time

AP_Int8 AP_MotorsHeli::_rsc_runup_time
protected

◆ _rsc_setpoint

AP_Int16 AP_MotorsHeli::_rsc_setpoint
protected

Definition at line 204 of file AP_MotorsHeli.h.

Referenced by get_rsc_setpoint(), and parameter_check().

◆ _rsc_slewrate

AP_Int16 AP_MotorsHeli::_rsc_slewrate
protected

◆ _rsc_thrcrv

AP_Int16 AP_MotorsHeli::_rsc_thrcrv[5]
protected

◆ _servo_mode

AP_Int8 AP_MotorsHeli::_servo_mode
protected

◆ _servo_test

AP_Int8 AP_MotorsHeli::_servo_test
protected

Definition at line 213 of file AP_MotorsHeli.h.

Referenced by init().

◆ _servo_test_cycle_counter

uint8_t AP_MotorsHeli::_servo_test_cycle_counter = 0
protected

◆ var_info

const AP_Param::GroupInfo AP_MotorsHeli::var_info
static

Definition at line 137 of file AP_MotorsHeli.h.

Referenced by AP_MotorsHeli().


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