These parameters allow the motor PWM output range to be different from receiver's throttle input range
Also renamed throttle_pass_through to set_throttle_passthrough_for_esc_calibration and change the method's input to the 0 to 1 range instead of direct PWM value
// set_throttle_range - sets the minimum throttle that will be sent to the engines when they're not off (i.e. to prevents issues with some motors spinning and some not at very low throttle)
// set_throttle_range - sets the minimum throttle that will be sent to the engines when they're not off (i.e. to prevents issues with some motors spinning and some not at very low throttle)
// also sets throttle channel minimum and maximum pwm
// also sets throttle channel minimum and maximum pwm
// get_lift_max - get maximum lift ratio - for logging purposes only
// get_lift_max - get maximum lift ratio - for logging purposes only
floatget_lift_max(){return_lift_max;}
floatget_lift_max(){return_lift_max;}
@ -143,6 +142,10 @@ protected:
// convert thrust (0~1) range back to pwm range
// convert thrust (0~1) range back to pwm range
int16_tcalc_thrust_to_pwm(floatthrust_in)const;
int16_tcalc_thrust_to_pwm(floatthrust_in)const;
// get minimum or maximum pwm value that can be output to motors
int16_tget_pwm_min()const;
int16_tget_pwm_max()const;
// apply any thrust compensation for the frame
// apply any thrust compensation for the frame
virtualvoidthrust_compensation(void){}
virtualvoidthrust_compensation(void){}
@ -162,6 +165,8 @@ protected:
AP_Float_batt_current_max;// current over which maximum throttle is limited
AP_Float_batt_current_max;// current over which maximum throttle is limited
AP_Float_thr_mix_min;// throttle vs attitude control prioritisation used when landing (higher values mean we prioritise attitude control over throttle)
AP_Float_thr_mix_min;// throttle vs attitude control prioritisation used when landing (higher values mean we prioritise attitude control over throttle)
AP_Float_thr_mix_max;// throttle vs attitude control prioritisation used during active flight (higher values mean we prioritise attitude control over throttle)
AP_Float_thr_mix_max;// throttle vs attitude control prioritisation used during active flight (higher values mean we prioritise attitude control over throttle)
AP_Int16_pwm_min;// minimum PWM value that will ever be output to the motors (if 0, vehicle's throttle input channel's min pwm used)
AP_Int16_pwm_max;// maximum PWM value that will ever be output to the motors (if 0, vehicle's throttle input channel's max pwm used)
// internal variables
// internal variables
boolmotor_enabled[AP_MOTORS_MAX_NUM_MOTORS];// true if motor is enabled
boolmotor_enabled[AP_MOTORS_MAX_NUM_MOTORS];// true if motor is enabled