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

#include <AP_MotorsHeli_Dual.h>

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

Public Member Functions

 AP_MotorsHeli_Dual (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
 
float _oscillate_angle = 0.0f
 
float _servo_test_cycle_time = 0.0f
 
float _collective_test = 0.0f
 
float _roll_test = 0.0f
 
float _pitch_test = 0.0f
 
AP_Int16 _collective2_min
 
AP_Int16 _collective2_max
 
AP_Int16 _collective2_mid
 
AP_Int16 _servo1_pos
 
AP_Int16 _servo2_pos
 
AP_Int16 _servo3_pos
 
AP_Int16 _servo4_pos
 
AP_Int16 _servo5_pos
 
AP_Int16 _servo6_pos
 
AP_Int8 _collective_direction
 
AP_Int16 _swash1_phase_angle
 
AP_Int16 _swash2_phase_angle
 
AP_Int8 _dual_mode
 
AP_Float _dcp_scaler
 
AP_Float _dcp_yaw_effect
 
AP_Float _yaw_scaler
 
SRV_Channel_swash_servo_1
 
SRV_Channel_swash_servo_2
 
SRV_Channel_swash_servo_3
 
SRV_Channel_swash_servo_4
 
SRV_Channel_swash_servo_5
 
SRV_Channel_swash_servo_6
 
float _collective2_mid_pct = 0.0f
 
float _rollFactor [AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
 
float _pitchFactor [AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
 
float _collectiveFactor [AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
 
float _yawFactor [AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
 
- 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 46 of file AP_MotorsHeli_Dual.h.

Constructor & Destructor Documentation

◆ AP_MotorsHeli_Dual()

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

Definition at line 49 of file AP_MotorsHeli_Dual.h.

Here is the call graph for this function:

Member Function Documentation

◆ calculate_armed_scalars()

void AP_MotorsHeli_Dual::calculate_armed_scalars ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 268 of file AP_MotorsHeli_Dual.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_Dual::calculate_roll_pitch_collective_factors ( )
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 314 of file AP_MotorsHeli_Dual.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_Dual::calculate_scalars ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 282 of file AP_MotorsHeli_Dual.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_Dual::get_desired_rotor_speed ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 71 of file AP_MotorsHeli_Dual.h.

Here is the call graph for this function:

◆ get_main_rotor_speed()

float AP_MotorsHeli_Dual::get_main_rotor_speed ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 68 of file AP_MotorsHeli_Dual.h.

Here is the call graph for this function:

◆ get_motor_mask()

uint16_t AP_MotorsHeli_Dual::get_motor_mask ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 384 of file AP_MotorsHeli_Dual.cpp.

Referenced by rotor_speed_above_critical().

Here is the caller graph for this function:

◆ has_flybar()

bool AP_MotorsHeli_Dual::has_flybar ( ) const
inlineoverridevirtual

Reimplemented from AP_MotorsHeli.

Definition at line 86 of file AP_MotorsHeli_Dual.h.

◆ init_outputs()

bool AP_MotorsHeli_Dual::init_outputs ( )
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 184 of file AP_MotorsHeli_Dual.cpp.

Here is the call graph for this function:

◆ move_actuators()

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

Implements AP_MotorsHeli.

Definition at line 416 of file AP_MotorsHeli_Dual.cpp.

Here is the call graph for this function:

◆ output_test()

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

Implements AP_MotorsHeli.

Definition at line 218 of file AP_MotorsHeli_Dual.cpp.

Referenced by AP_MotorsHeli_Dual().

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

◆ rotor_speed_above_critical()

bool AP_MotorsHeli_Dual::rotor_speed_above_critical ( ) const
inlineoverridevirtual

Implements AP_MotorsHeli.

Definition at line 74 of file AP_MotorsHeli_Dual.h.

Here is the call graph for this function:

◆ servo_test()

void AP_MotorsHeli_Dual::servo_test ( )
overridevirtual

Implements AP_MotorsHeli.

Definition at line 542 of file AP_MotorsHeli_Dual.cpp.

Referenced by supports_yaw_passthrough().

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

◆ set_desired_rotor_speed()

void AP_MotorsHeli_Dual::set_desired_rotor_speed ( float  desired_speed)
overridevirtual

Implements AP_MotorsHeli.

Definition at line 262 of file AP_MotorsHeli_Dual.cpp.

Referenced by AP_MotorsHeli_Dual().

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

◆ set_update_rate()

void AP_MotorsHeli_Dual::set_update_rate ( uint16_t  speed_hz)
overridevirtual

Implements AP_MotorsHeli.

Definition at line 166 of file AP_MotorsHeli_Dual.cpp.

Referenced by AP_MotorsHeli_Dual().

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

◆ supports_yaw_passthrough()

bool AP_MotorsHeli_Dual::supports_yaw_passthrough ( ) const
inlineoverridevirtual

Reimplemented from AP_MotorsHeli.

Definition at line 89 of file AP_MotorsHeli_Dual.h.

Here is the call graph for this function:

◆ update_motor_control()

void AP_MotorsHeli_Dual::update_motor_control ( RotorControlState  state)
overrideprotectedvirtual

Implements AP_MotorsHeli.

Definition at line 391 of file AP_MotorsHeli_Dual.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _collective2_max

AP_Int16 AP_MotorsHeli_Dual::_collective2_max
protected

Definition at line 123 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_scalars(), and move_actuators().

◆ _collective2_mid

AP_Int16 AP_MotorsHeli_Dual::_collective2_mid
protected

Definition at line 124 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_scalars().

◆ _collective2_mid_pct

float AP_MotorsHeli_Dual::_collective2_mid_pct = 0.0f
protected

Definition at line 147 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_scalars(), and move_actuators().

◆ _collective2_min

AP_Int16 AP_MotorsHeli_Dual::_collective2_min
protected

Definition at line 122 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_scalars(), and move_actuators().

◆ _collective_direction

AP_Int8 AP_MotorsHeli_Dual::_collective_direction
protected

Definition at line 131 of file AP_MotorsHeli_Dual.h.

Referenced by move_actuators().

◆ _collective_test

float AP_MotorsHeli_Dual::_collective_test = 0.0f
protected

Definition at line 117 of file AP_MotorsHeli_Dual.h.

Referenced by servo_test().

◆ _collectiveFactor

float AP_MotorsHeli_Dual::_collectiveFactor[AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
protected

◆ _dcp_scaler

AP_Float AP_MotorsHeli_Dual::_dcp_scaler
protected

Definition at line 135 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _dcp_yaw_effect

AP_Float AP_MotorsHeli_Dual::_dcp_yaw_effect
protected

Definition at line 136 of file AP_MotorsHeli_Dual.h.

Referenced by move_actuators().

◆ _dual_mode

AP_Int8 AP_MotorsHeli_Dual::_dual_mode
protected

◆ _oscillate_angle

float AP_MotorsHeli_Dual::_oscillate_angle = 0.0f
protected

Definition at line 115 of file AP_MotorsHeli_Dual.h.

Referenced by servo_test().

◆ _pitch_test

float AP_MotorsHeli_Dual::_pitch_test = 0.0f
protected

Definition at line 119 of file AP_MotorsHeli_Dual.h.

Referenced by servo_test().

◆ _pitchFactor

float AP_MotorsHeli_Dual::_pitchFactor[AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
protected

◆ _roll_test

float AP_MotorsHeli_Dual::_roll_test = 0.0f
protected

Definition at line 118 of file AP_MotorsHeli_Dual.h.

Referenced by servo_test().

◆ _rollFactor

float AP_MotorsHeli_Dual::_rollFactor[AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
protected

◆ _rotor

AP_MotorsHeli_RSC AP_MotorsHeli_Dual::_rotor
protected

◆ _servo1_pos

AP_Int16 AP_MotorsHeli_Dual::_servo1_pos
protected

Definition at line 125 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo2_pos

AP_Int16 AP_MotorsHeli_Dual::_servo2_pos
protected

Definition at line 126 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo3_pos

AP_Int16 AP_MotorsHeli_Dual::_servo3_pos
protected

Definition at line 127 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo4_pos

AP_Int16 AP_MotorsHeli_Dual::_servo4_pos
protected

Definition at line 128 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo5_pos

AP_Int16 AP_MotorsHeli_Dual::_servo5_pos
protected

Definition at line 129 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo6_pos

AP_Int16 AP_MotorsHeli_Dual::_servo6_pos
protected

Definition at line 130 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _servo_test_cycle_time

float AP_MotorsHeli_Dual::_servo_test_cycle_time = 0.0f
protected

Definition at line 116 of file AP_MotorsHeli_Dual.h.

Referenced by servo_test().

◆ _swash1_phase_angle

AP_Int16 AP_MotorsHeli_Dual::_swash1_phase_angle
protected

Definition at line 132 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _swash2_phase_angle

AP_Int16 AP_MotorsHeli_Dual::_swash2_phase_angle
protected

Definition at line 133 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _swash_servo_1

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_1
protected

Definition at line 139 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _swash_servo_2

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_2
protected

Definition at line 140 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _swash_servo_3

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_3
protected

Definition at line 141 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _swash_servo_4

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_4
protected

Definition at line 142 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _swash_servo_5

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_5
protected

Definition at line 143 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _swash_servo_6

SRV_Channel* AP_MotorsHeli_Dual::_swash_servo_6
protected

Definition at line 144 of file AP_MotorsHeli_Dual.h.

Referenced by init_outputs(), and move_actuators().

◆ _yaw_scaler

AP_Float AP_MotorsHeli_Dual::_yaw_scaler
protected

Definition at line 137 of file AP_MotorsHeli_Dual.h.

Referenced by calculate_roll_pitch_collective_factors().

◆ _yawFactor

float AP_MotorsHeli_Dual::_yawFactor[AP_MOTORS_HELI_DUAL_NUM_SWASHPLATE_SERVOS]
protected

◆ var_info

const AP_Param::GroupInfo AP_MotorsHeli_Dual::var_info
static

Definition at line 95 of file AP_MotorsHeli_Dual.h.

Referenced by AP_MotorsHeli_Dual().


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