APM:Libraries
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
AP_MotorsHeli_Quad Class Reference

#include <AP_MotorsHeli_Quad.h>

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

Public Member Functions

 AP_MotorsHeli_Quad (uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_HELI_SPEED_DEFAULT)
 
void set_update_rate (uint16_t speed_hz) override
 
void output_test (uint8_t motor_seq, int16_t pwm) override
 
void set_desired_rotor_speed (float desired_speed) override
 
float get_main_rotor_speed () const override
 
float get_desired_rotor_speed () const override
 
bool rotor_speed_above_critical () const override
 
void calculate_scalars () override
 
void calculate_armed_scalars () override
 
uint16_t get_motor_mask () override
 
bool has_flybar () const override
 
bool supports_yaw_passthrough () const override
 
void servo_test () override
 
- Public Member Functions inherited from AP_MotorsHeli
 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)
 
void output_min ()
 
virtual bool parameter_check (bool display_msg) 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
 
bool rotor_runup_complete () const
 
virtual void set_acro_tail (bool set)
 
virtual void ext_gyro_gain (float gain)
 
void output ()
 
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 []
 
- Static Public Attributes inherited from AP_MotorsHeli
static const struct AP_Param::GroupInfo var_info []
 

Protected Member Functions

bool init_outputs () override
 
void update_motor_control (RotorControlState state) override
 
void calculate_roll_pitch_collective_factors () override
 
void move_actuators (float roll_out, float pitch_out, float coll_in, float yaw_out) override
 
- Protected Member Functions inherited from AP_MotorsHeli
void output_armed_stabilizing ()
 
void output_armed_zero_throttle ()
 
void output_disarmed ()
 
void reset_flight_controls ()
 
void update_throttle_filter ()
 
void reset_swash_servo (SRV_Channel *servo)
 
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

AP_MotorsHeli_RSC _rotor
 
SRV_Channel_servo [AP_MOTORS_HELI_QUAD_NUM_MOTORS]
 
float _rollFactor [AP_MOTORS_HELI_QUAD_NUM_MOTORS]
 
float _pitchFactor [AP_MOTORS_HELI_QUAD_NUM_MOTORS]
 
float _collectiveFactor [AP_MOTORS_HELI_QUAD_NUM_MOTORS]
 
float _yawFactor [AP_MOTORS_HELI_QUAD_NUM_MOTORS]
 
- Protected Attributes inherited from AP_MotorsHeli
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
 
- Protected Types inherited from AP_MotorsHeli
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
}
 

Detailed Description

Definition at line 22 of file AP_MotorsHeli_Quad.h.

Constructor & Destructor Documentation

◆ AP_MotorsHeli_Quad()

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

Definition at line 25 of file AP_MotorsHeli_Quad.h.

Here is the call graph for this function:

Member Function Documentation

◆ calculate_armed_scalars()

void AP_MotorsHeli_Quad::calculate_armed_scalars ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 100 of file AP_MotorsHeli_Quad.cpp.

Referenced by calculate_scalars(), and rotor_speed_above_critical().

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

◆ calculate_roll_pitch_collective_factors()

void AP_MotorsHeli_Quad::calculate_roll_pitch_collective_factors ( )
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 136 of file AP_MotorsHeli_Quad.cpp.

Referenced by calculate_scalars().

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

◆ calculate_scalars()

void AP_MotorsHeli_Quad::calculate_scalars ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 114 of file AP_MotorsHeli_Quad.cpp.

Referenced by rotor_speed_above_critical().

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

◆ get_desired_rotor_speed()

float AP_MotorsHeli_Quad::get_desired_rotor_speed ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 46 of file AP_MotorsHeli_Quad.h.

Here is the call graph for this function:

◆ get_main_rotor_speed()

float AP_MotorsHeli_Quad::get_main_rotor_speed ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 43 of file AP_MotorsHeli_Quad.h.

Here is the call graph for this function:

◆ get_motor_mask()

uint16_t AP_MotorsHeli_Quad::get_motor_mask ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 159 of file AP_MotorsHeli_Quad.cpp.

Referenced by rotor_speed_above_critical().

Here is the caller graph for this function:

◆ has_flybar()

bool AP_MotorsHeli_Quad::has_flybar ( ) const
inlineoverridevirtual

Reimplemented from AP_MotorsHeli.

Definition at line 61 of file AP_MotorsHeli_Quad.h.

◆ init_outputs()

bool AP_MotorsHeli_Quad::init_outputs ( )
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 47 of file AP_MotorsHeli_Quad.cpp.

Here is the call graph for this function:

◆ move_actuators()

void AP_MotorsHeli_Quad::move_actuators ( float  roll_out,
float  pitch_out,
float  coll_in,
float  yaw_out 
)
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 195 of file AP_MotorsHeli_Quad.cpp.

Here is the call graph for this function:

◆ output_test()

void AP_MotorsHeli_Quad::output_test ( uint8_t  motor_seq,
int16_t  pwm 
)
overridevirtual

Implements AP_MotorsHeli.

Definition at line 71 of file AP_MotorsHeli_Quad.cpp.

Referenced by AP_MotorsHeli_Quad().

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

◆ rotor_speed_above_critical()

bool AP_MotorsHeli_Quad::rotor_speed_above_critical ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 49 of file AP_MotorsHeli_Quad.h.

Here is the call graph for this function:

◆ servo_test()

void AP_MotorsHeli_Quad::servo_test ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 279 of file AP_MotorsHeli_Quad.cpp.

Referenced by supports_yaw_passthrough().

Here is the caller graph for this function:

◆ set_desired_rotor_speed()

void AP_MotorsHeli_Quad::set_desired_rotor_speed ( float  desired_speed)
overridevirtual

Implements AP_MotorsHeli.

Definition at line 94 of file AP_MotorsHeli_Quad.cpp.

Referenced by AP_MotorsHeli_Quad().

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

◆ set_update_rate()

void AP_MotorsHeli_Quad::set_update_rate ( uint16_t  speed_hz)
overridevirtual

Implements AP_MotorsHeli.

Definition at line 32 of file AP_MotorsHeli_Quad.cpp.

Referenced by AP_MotorsHeli_Quad().

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

◆ supports_yaw_passthrough()

bool AP_MotorsHeli_Quad::supports_yaw_passthrough ( ) const
inlineoverridevirtual

Reimplemented from AP_MotorsHeli.

Definition at line 64 of file AP_MotorsHeli_Quad.h.

Here is the call graph for this function:

◆ update_motor_control()

void AP_MotorsHeli_Quad::update_motor_control ( RotorControlState  state)
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 170 of file AP_MotorsHeli_Quad.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _collectiveFactor

float AP_MotorsHeli_Quad::_collectiveFactor[AP_MOTORS_HELI_QUAD_NUM_MOTORS]
protected

Definition at line 95 of file AP_MotorsHeli_Quad.h.

Referenced by calculate_roll_pitch_collective_factors(), and move_actuators().

◆ _pitchFactor

float AP_MotorsHeli_Quad::_pitchFactor[AP_MOTORS_HELI_QUAD_NUM_MOTORS]
protected

Definition at line 94 of file AP_MotorsHeli_Quad.h.

Referenced by calculate_roll_pitch_collective_factors(), and move_actuators().

◆ _rollFactor

float AP_MotorsHeli_Quad::_rollFactor[AP_MOTORS_HELI_QUAD_NUM_MOTORS]
protected

Definition at line 93 of file AP_MotorsHeli_Quad.h.

Referenced by calculate_roll_pitch_collective_factors(), and move_actuators().

◆ _rotor

AP_MotorsHeli_RSC AP_MotorsHeli_Quad::_rotor
protected

◆ _servo

SRV_Channel* AP_MotorsHeli_Quad::_servo[AP_MOTORS_HELI_QUAD_NUM_MOTORS]
protected

Definition at line 90 of file AP_MotorsHeli_Quad.h.

Referenced by init_outputs(), and move_actuators().

◆ _yawFactor

float AP_MotorsHeli_Quad::_yawFactor[AP_MOTORS_HELI_QUAD_NUM_MOTORS]
protected

Definition at line 96 of file AP_MotorsHeli_Quad.h.

Referenced by calculate_roll_pitch_collective_factors(), and move_actuators().

◆ var_info

const AP_Param::GroupInfo AP_MotorsHeli_Quad::var_info
static
Initial value:

Definition at line 70 of file AP_MotorsHeli_Quad.h.

Referenced by AP_MotorsHeli_Quad().


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