192 _spool_mode(SHUT_DOWN),
193 _spin_up_ratio(0.0
f),
195 _throttle_limit(1.0
f),
196 _throttle_thrust_max(0.0
f),
197 _disarm_safety_timer(0)
287 if (
is_zero(_batt_resistance)) {
297 float batt_current_ratio = _batt_current/batt_current_max;
312 float throttle_ratio = thrust;
315 if (fabsf(thrust_curve_expo) < 0.001) {
322 throttle_ratio = ((thrust_curve_expo-1.0f) +
safe_sqrt((1.0
f-thrust_curve_expo)*(1.0f-thrust_curve_expo) + 4.0
f*thrust_curve_expo*
_lift_max*thrust))/(2.0
f*thrust_curve_expo);
350 _lift_max = batt_voltage_filt*(1-thrust_curve_expo) + thrust_curve_expo*batt_voltage_filt*batt_voltage_filt;
362 #if AP_MOTORS_DENSITY_COMP == 1 406 if (radio_max <= radio_min) {
494 float spin_up_armed_ratio = 0.0f;
609 if (mask & (1U<<i)) {
AP_Int8 _throttle_hover_learn
int16_t get_pwm_output_min() const
static const struct AP_Param::GroupInfo var_info[]
#define AP_MOTORS_BAT_VOLT_MAX_DEFAULT
int16_t get_pwm_output_max() const
float safe_sqrt(const T v)
virtual void set_esc_scaling(uint16_t min_pwm, uint16_t max_pwm)
struct AP_Motors::AP_Motors_flags _flags
#define AP_MOTORS_BAT_CURR_MAX_DEFAULT
#define AP_GROUPINFO(name, idx, clazz, element, def)
int16_t _throttle_radio_max
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
struct AP_Motors::AP_Motors_limit limit
#define AP_MOTORS_SPIN_MIN_DEFAULT
AP_Float _thrust_curve_expo
uint16_t _disarm_safety_timer
virtual void thrust_compensation(void)
virtual void output_to_motors()=0
void set_cutoff_frequency(float cutoff_freq)
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
void save_params_on_disarm()
float apply_thrust_curve_and_volt_scaling(float thrust) const
#define AP_MOTORS_BATT_VOLT_FILT_HZ
AP_Float _batt_voltage_max
#define AP_MOTORS_YAW_HEADROOM_DEFAULT
virtual void output_armed_stabilizing()=0
static void set_output_scaled(SRV_Channel::Aux_servo_function_t function, int16_t value)
float voltage_resting_estimate(uint8_t instance) const
virtual float get_throttle_hover() const
bool motor_enabled[AP_MOTORS_MAX_NUM_MOTORS]
bool is_zero(const T fVal1)
bool has_current(uint8_t instance) const
has_current - returns true if battery monitor instance provides current info
#define AP_MOTORS_SPIN_MAX_DEFAULT
int16_t _throttle_radio_min
void update_throttle_hover(float dt)
float current_amps(uint8_t instance) const
current_amps - returns the instantaneous current draw in amperes
AP_MotorsMulticopter(uint16_t loop_rate, uint16_t speed_hz=AP_MOTORS_SPEED_DEFAULT)
#define AP_MOTORS_SPOOL_UP_TIME_DEFAULT
AP_Float _batt_current_max
float _throttle_thrust_max
void set_throttle_range(int16_t radio_min, int16_t radio_max)
virtual void rc_write(uint8_t chan, uint16_t pwm)
AP_BattMonitor & battery()
#define AP_MOTORS_THST_HOVER_MAX
LowPassFilterFloat _throttle_filter
#define AP_GROUPINFO_FRAME(name, idx, clazz, element, def, frame_flags)
float constrain_float(const float amt, const float low, const float high)
virtual void update_throttle_filter()
void set_throttle_passthrough_for_esc_calibration(float throttle_input)
virtual void set_desired_spool_state(enum spool_up_down_desired spool)
spool_up_down_mode _spool_mode
#define AP_MOTORS_THST_HOVER_MIN
spool_up_down_desired _spool_desired
int16_t calc_spin_up_to_pwm() const
#define AP_MOTORS_THST_HOVER_DEFAULT
#define AP_MOTORS_BAT_VOLT_MIN_DEFAULT
float get_compensation_gain() const
Motor control class for Multicopters.
virtual float get_current_limit_max_throttle()
AP_Float _batt_voltage_min
int16_t calc_thrust_to_pwm(float thrust_in) const
virtual void output_boost_throttle(void)
float get_throttle() const
void update_lift_max_from_batt_voltage()
#define AP_MOTORS_MAX_NUM_MOTORS
float voltage(uint8_t instance) const
voltage - returns battery voltage in millivolts
float get_resistance() const
LowPassFilterFloat _batt_voltage_filt
#define AP_PARAM_FRAME_TRICOPTER
#define AP_MOTORS_THST_EXPO_DEFAULT
#define AP_MOTORS_BAT_CURR_TC_DEFAULT
AP_Float _batt_current_time_constant
#define AP_MOTORS_SPIN_ARM_DEFAULT
#define AP_MOTORS_THST_HOVER_TC
vertical booster throttle
T apply(T sample, float dt)
virtual void output_motor_mask(float thrust, uint8_t mask)
static void setup_object_defaults(const void *object_pointer, const struct GroupInfo *group_info)